Skip to content

Enforce the symptom-first convention at the write gate (follow-up to #419) #423

Closed

Description

@abogartz

Problem

#419 made symptom-first content a capture convention: learning/blocker rows open with the observable trigger ("When : "). The measured gap is large — the same lesson surfaced 0/8 as session diary and ranked 1-7 symptom-first — but a convention only shapes new writes that obey it. The live store shows why: 443 learning/blocker rows, 6 carry a symptom clause, 437 do not (dry-run of scripts/symptom-fixer.ts, 2026-11-17).

Change

Make the gate enforce what the prompt requests:

  • runWriteGate blocks learning/blocker content that does not open with When <symptom>: — reason symptom_missing, evidence line ev=write_blocked reason=symptom_missing, hint names the shape and the alternative (write it as context/decision if it is not trigger-keyed).
  • ON by default; OPENCODE_MEMORY_SYMPTOM=off|0|false is the escape hatch for automation holding a pre-convention backlog.
  • memory_remember's type description states the rule at the point of choice (deliberate wire-contract move; pin re-captured).
  • Capture prompt now says the gate rejects, so the capture model self-corrects instead of losing candidates to blocks.

Non-goals

  • No silent rewriting of non-conforming rows (the gate asks for a rephrase; it never rewrites or deletes).
  • Backlog repair is a separate, replay-gated offline path (scripts/symptom-fixer.ts, dry-run only in this PR): symptoms are grounded ONLY in the store's own query ledger — 385 grounded proposals, 189 replay-eligible, 196 vetoed. No invented symptoms.

Evidence to ship with

  • New tests: block/hint, blocker type covered, conforming row stores, other types unaffected, escape hatch works, symptomRuleEnabled unit.
  • Full merge gate green: 1,463 unit + 34 e2e, 0 fail.

Activity

  1. abogartz commented on Nov 17, 2026

    @abogartz
    OwnerAuthor

    Fixer executed against the live store (2026-11-17), kw-only repair per the design in PR #424:

    • 385 ledger-grounded proposals -> 18 no-op (no new vocabulary), 215 replay-vetoed, 152 replay-eligible.
    • 132 applied through the gated update path (supersedesTs, batch lock, snapshot-first supersede, repo stamp inherited).
    • 20 blocked by GATE-2 ref_path_missing — the rows cite paths that no longer exist; the gate refused to re-persist them and they were left untouched. Correct outcome: the gate outranks the fixer.
    • Verified end-to-end: a row that previously missed its grounding query now ranks Port plugin + tests to OpenCode 2.x plugin API #1 for it under the injection scorer.

    Recovery: every touched day-file snapshotted before mutation; memory_undo lists them. The 215 vetoes are the replay gate earning its keep — rewrites that would have broken a window the old row already held.

  2. abogartz-opencode-self-improvement commented on Nov 18, 2026

    @abogartz-opencode-self-improvement

    🎉 This issue has been resolved in version 0.29.0 🎉

    The release is available on:

    Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions