Skip to content

📝 Plan: the library warns a writer when a resolver settles nothing or a scene lists someone twice - #140

Open
ebigunso wants to merge 3 commits into
feature/2026-09-22/v0-2-time-planfrom
feature/2026-09-22/v0-2-write-warnings-plan
Open

ebigunso wants to merge 3 commits into
feature/2026-09-22/v0-2-time-planfrom
feature/2026-09-22/v0-2-write-warnings-plan

Conversation

@ebigunso

Copy link
Copy Markdown
Owner

Small slice plan, stacked on the time plan (#138). One task, about six hours.

At prepare or validate_plan time the library warns, without refusing or rewriting (the scene is stored as given, ADR-D-0029), when what is about to be stored will not do what the writer probably means:

  • A memory that resolves or fulfils another shares no subject and no thread with it: the settled matter silently leaves where-things-stand and "we settled it" never comes on meeting the person.
  • A scene lists the same key twice: the participant is stored twice under the scene's own words.

Dropped on review, with the reason recorded: a warning for a scene time later than the record's creation (it compared the wrong instants: visibility to recency and "last met" depends on the retrieval scene's time, and the library never judges what the application perceived). Warnings are identified by the kind tag the result already carries; no new public type, no configuration, no added read.

This plan changes no recall, so its measurement item is an explicit exemption under the measurement rule; the driver's warning drift test is the evidence.

Reviews: Tier D feasibility (Codex) with one finding closed; Tier A altitude and value audit (Claude) that dropped the third warning and folded two tasks into one.

🤖 Generated with Claude Code

… a scene lists someone twice

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…2/v0-2-write-warnings-plan

Co-Authored-By: Codex <noreply@openai.com>
@ebigunso
ebigunso added this pull request to stack #149 September 22, 2026 22:00
…2/v0-2-write-warnings-plan

Co-Authored-By: Codex <noreply@openai.com>
Copilot AI balanced review requested due to automatic review settings September 22, 2026 22:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

The plan has contract discrepancies, missing serialization coverage, and repository-rule violations.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 3 Low severity

Open (3)
What changed in this PR

Documents a plan for advisory write-time warnings without changing stored data or recall behavior.

Changes:

  • Plans resolver-scope and duplicate-participant warnings.
  • Defines validation, tests, documentation, and compatibility expectations.
  • Records rejected warning candidates and measurement exemption.
File Description
docs/​coding-agent/​plans/​active/​v0-2-write-warnings-plan.md Defines the implementation plan and acceptance criteria.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

- work_type: code

## Goal
- An application author who writes a memory that will silently misbehave later learns it at the moment of writing, in the same place the library already reports its one existing warning, and is never refused. Two situations this phase found: a memory that settles a matter but shares no subject and no thread with what it settles, so "we settled it" never comes on meeting the person; and a person listed twice by key in one scene, so the stored scene says they were there twice and their words are indexed twice. Each is stored exactly as given (ADR-D-0029) and reported as a warning the writer can read by kind.
- An application author who writes a memory that will silently misbehave later learns it at the moment of writing, in the same place the library already reports its one existing warning, and is never refused. Two situations this phase found: a memory that settles a matter but shares no subject and no thread with what it settles, so "we settled it" never comes on meeting the person; and a person listed twice by key in one scene, so the stored scene says they were there twice and their words are indexed twice. Each is stored exactly as given (ADR-D-0029) and reported as a warning the writer can read by kind.

## Definition of Done
- `validate_plan` and `remember` report, on the candidate concerned, a warning when a `Resolves` or `FulfillsCommitment` link's resolving memory shares no subject (entity) and no thread with the memory it resolves, and when one participant key appears more than once in a scene. Each warning is a variant of the existing `CandidateValidationIssue`, carried in the existing `warnings` list of the existing `CandidateValidation`, and its `kind` tag (the enum's existing serde tag) is the stable identifier a reader asserts on. No new public type; no new field on any public type.
- justification: no external consumers; the companion evaluation repository matches on `CandidateValidationStatus` only and is unaffected by new variants unless it matches exhaustively, which the task checks.

## Context (workspace)
- Related files/areas: `src/domain/write_validation.rs` (`CandidateValidation` with `warnings`, `CandidateValidationIssue` tagged `kind`, `DuplicateObservationEcho` at 123), `src/usecases/write_planning.rs` (`WritePlanValidator` at 690, `PlanValidationContext` at 744 with `existing_refs` holding references only, link endpoint collection at 844, `validate_candidate` at 891, `echo_surface_warning` at 1079, `caller_hint_links` deduplicating participant keys at 354), `src/api/types/write_plan.rs` (`RememberDiagnostics::refresh_validation_warning_messages` at 617), `src/usecases/remember.rs:90` (validations with warnings kept on the accepted path), `src/memory.rs:74` (`validate_plan` returns `Vec<CandidateValidation>`), `src/domain/scene.rs` (`without_blank_participants`, `participant_keys`), `src/policy/embedding_surface.rs:28` (participant words joined per entry), `src/usecases/scope.rs` (scope keys from source scenes), `src/policy/graph_expansion.rs:118` (`resolved_by` read from `Resolves` and `FulfillsCommitment`), README lines 161 to 217 (`validate_plan` and `remember`); the companion `C:/Users/Kohta/GitLocal/CharacterMemoryEvals/crates/cmem-eval/src/adapter.rs` (status-only reads at 1816, 3828, 4768); the load-bearing decisions list items 2, 3, 13, 36, 42; the state plan Task_3 (resolution ends being current state).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants