Repository navigation
Closed
Description
Why
#57's replay (#121; results in eval/decisions-57/results-k5.json and results-k3.json, discussion in the research note, sections 4–5) found two things:
- Decisions are never revalidated.
revalidatecheckscodememories only. A probe retained adecisionand acodememory citing the same file, then rewrote and deleted the file: thecodememory was flagged both times, thedecisionneither time (file_probein the results). - A file-hash check would catch real stale decisions, and also valid ones. In code-copilot-team's history at
00d49c0, the first cited file of both stale decisions changed after the decision date. So did the cited file of 3 of the 10 decisions still in force, two of them safety rules (cited_file_historyin the results).recallhides flagged memories by default, so hiding flagged decisions would lose those rules.
Proposed (needs a spec first)
- Record a hash at retain. A
decisionwhosesourcenames a file under the project root stores that file's hash, ascodememories do. Onlysourceis tracked for now, not the other paths inevidence. - Flag on change or loss.
revalidateflags such a decision when the file is missing or its hash changed, and clears the flag when the hash matches again or the decision is superseded. - Flagged code stays hidden; flagged decisions are returned.
recallkeeps hiding flaggedcodememories, as today, but returns flagged decisions, so the agent re-checks the evidence instead of losing the decision. - The mark is an additive field. Each
recallresult gainsneeds_reviewandreview_reason(false and empty when not flagged). The preview is unchanged, and existing fields keep their meaning. - Older decisions (no stored hash) are flagged only when the cited file is missing.
- No new record type or MCP tool; reuse the
coderevalidation path.
Acceptance (sketch)
- The Preserve and retrieve implementation alternatives for reuse-first coding #57 file probe: the decision is flagged on rewrite and on delete, and
recallstill returns it withneeds_review: trueand areview_reason. - The replay: every seed record is still found; decisions whose cited files changed come back flagged, not hidden.
recallstill hides flaggedcodememories.- Stores from 0.1.x to 0.9.x load unchanged (the new key loads with a default).
To decide in the spec
- Whether flagged decisions also appear in the session-start "Needs review" list (
lifecycle.py, today fed by revalidation's flagged items, at most 10 lines).
Related: #57, #121 (replay), #118 (decision records in the template).
Metadata
Metadata
Assignees
Labels
No labels
Activity
Merge pull request #126 from gosha70/spec/123-decision-revalidation
decision revalidation: fix the second review of #127
Merge pull request #127 from gosha70/feat/123-decision-revalidation
gosha70 commentedon Nov 15, 2026
Closing: shipped on
main(spec #126, build #127, merged asbaff4dd; not yet in a release).Revalidation:
sourceis a readable file under the project root records that file's hash assource_hash. A retain that matches an existing decision returns it unchanged, with its own source and hash.revalidate()flags such a decisionchangedwhen the file differs andmissingwhen it is gone.sourceis tracked, not other paths inevidence.Flagged, not hidden:
recallreturns flagged decisions on both its relevance and itsorder="newest"paths.needs_reviewandreview_reasonfields.codememories stay hidden as before.Session start:
### Needs reviewlist names each item's type, with a hint for decisions and for code, and shows every memory still flagged.[decision, needs review: changed].Acceptance:
recallstill returns it.source_hashkey, loads and revalidates as above.The tests are in
tests/unit/test_decision_revalidation.py.gosha70 commentedon Nov 16, 2026
A finding from #128's calibration, for the conflict rule this issue's parent (#57) put in the template.
#128 ran the #57 corpus's crowded store (code-copilot-team
00d49c0, embedding pinned at1110a243) through the hook paths that callrecall(): compact recovery andon_post_compact(), ten candidates each, five shown.The finding. For the conflict case "Destructive git commands require confirmation", the partner record "Balanced profile denies destructive git commands" was among the ten candidates on both paths, but ranked 10th of 10. So it never made the five shown. A session that resumes after compaction would see one side of the conflict, and the template's "show both and ask" rule could not fire. This happens with or without a relevance floor.
It matches #57's MCP replay, where
top_k=3also lost this partner andtop_k=5brought it back. The hook blocks show 5 too, but they rank over a whole checkpoint rather than a short task line, which pushes the partner lower.Where the evidence is:
eval/anti-rot-128/calibration.jsonon the #128 build branch: per-case windows with similarities, and the displayed memories per path.Not addressed by #128. #128 dropped its floor, which had no effect on this corpus (amendment A5). Showing both sides of a conflict in a hook block would need its own change, for example pulling in a displayed decision's conflict partners. No issue is filed for that yet.