Repository navigation
Conversation
Step 2 accepts any evidence_id of the window, but step 3 passed its evidence_ids straight to the reconciliation check, which only knows the created memory's own evidence and the recalled memories. A recheck that revised or merged a memory and cited another Source of the same window was rejected, and once corrections ran out the whole window failed and was retried. Step 3 now validates evidence_ids against the window, as step 2 does, and adds the cited evidence to the created memory before applying the decision. Ids outside the window are still rejected.
hidb4ai
left a comment
There was a problem hiding this comment.
Reviewed 7361c97. No blocking findings. Allowing step 3 to cite the current window's evidence is consistent with step 2, while retaining rejection of out-of-window IDs and the existing reconciliation/publication checks. No database schema changes or new public interfaces.
| }.values() | ||
| ), | ||
| ) | ||
| result.items[key] = proposal |
There was a problem hiding this comment.
[P2] Preserve original evidence during redundant-revision recovery
When a recheck cites another window Source and returns a revise identical to the recalled target while the proposal text differs, _apply() recovers by retaining the proposal, but this assignment leaves the newly cited evidence and Source lineage attached. The retained memory can consequently be published without that Source's required date; restore the original proposal's evidence and lineage before recovery or keep the expansion temporary until the write succeeds.
There was a problem hiding this comment.
Fixed in a1cd33b. When the recheck revision is redundant, the created memory is restored to what step 2 made before the recovery runs, so it keeps only the evidence and Source it was created from. test_recheck_accepts_every_evidence_id_of_the_window has a new case for this: the recheck revises the recalled memory to its own text and cites both Sources; the created memory is kept and links only its own Source. Without the restore the case fails with both Sources linked.
…heck revision is redundant
hidb4ai
left a comment
There was a problem hiding this comment.
Reviewed a1cd33b. The reported redundant-revision lineage issue is fixed: recovery restores the original step-2 item before retaining it, so evidence from the unwritten revision does not leak into the published memory. I reproduced the lineage regression on the previous implementation and verified the corrected recovery and successful cross-Source recheck paths. No remaining blocking findings, database schema changes, or new public interfaces.
|
The affected modules are Core. @hidb4ai, please coordinate follow-up. Core: @hidb4ai @frf12 @Fengzdadi @beatenevo. Please coordinate the review of the affected changes. |
Which issue or RFC does this PR close?
No issue. Found in an audit of the one-pass processing mode added in #2729. Design:
docs/zh/design/atomic_memory_one_pass_design.md§3.2 and §3.4.Rationale for this change
Step 2 of a one-pass window accepts any
evidence_idof the window. Step 3 (recheck) told the model to decide again "with the step 2 rules", but passed itsevidence_idsstraight to the reconciliation check, which builds its evidence only from the created memory and the recalled memories. A recheck that revised or merged a recalled memory and cited another Source of the same window was rejected with "write must have supported content and only supplied evidence". The correction message does not say which ids count, so the model could not fix it reliably, and once corrections ran out the flush failed and the whole window was retried.What changes are included in this PR?
apply_one_pass_rechecktakes the window's extraction input. A write'sevidence_idsmust be window evidence, the same rule and message as step 2. The cited evidence is added to the created memory before the decision is applied, so the published memory's evidence and Source lineage match what a step 2 write citing the same ids produces.evidence_idskeeps the created memory's own evidence, as before._recheck_one_passpasses the extraction input.Are there any user-facing changes?
Yes. A one-pass recheck that cites another Source of the same window is now applied instead of failing the window. No API or persisted format changes.
How was this change tested?
tests/e2e/test_atomic_memory_one_pass.py::test_recheck_accepts_every_evidence_id_of_the_window: a two-Source window where step 2 creates a memory from one Source and step 3 revises a recalled memory citing both. The revision keeps the recalled memory's identity and links both Sources. An id outside the window is still rejected and nothing is published. Without the fix the first case fails with the rejection above.uv run pytest tests/e2e/test_atomic_memory_one_pass.py tests/builtin/artifacts/atomic_memory/test_prefixed_extraction.py: all passed.make check: passed.make unit-test: 13 failed, 120 errors, all intest_hook_characterization.py,test_session_start_shells.py,test_user_prompt_submit_shells.py,test_jev_rerank_comparison.py,test_ci_installation_roles.pyandtest_system_cli.py. The same files give the same 13 failures and 120 errors on unmodified master in the same offline environment (hook environments runuv syncand need network).AI usage statement
This change was written with Claude Code (Claude Opus 5.5).