Skip to content

write gate: preference/decision scope blocks distinct writes, memory_update is frozen, and the block offers no resolution #122

Closed

Description

@abogartz

What happened

Storing a new global preference (a review-workflow instruction) on 2026-10-26 evening was blocked twice with superseded_overlap, and the advertised memory_merge_review resolution proved a dead end. The eventual store (rephrase + distinct scope) succeeded first try — the friction was entirely gate-side. Evidence chains: f03c9f6e (memory_remember), 60b8d3bc (memory_update); today's evidence file has the full gate trace.

Three related defects in gate 3/4 (src/gates.ts)

  1. The conflictProne overlap has no similarity floor. For decision/preference (gates.ts:483-489), any active divergent row of the same type in scope sets overlapMatch — the jaccard score is recorded but never used to decide. Measured: a genuinely new preference scored 0.25 overlap with the scope's existing one and was still blocked, while the generic branch (gates.ts:490-500) requires score >= 0.9. Consequence: the second decision/preference in any scope is review-gated regardless of topical distance, which makes multi-preference scopes unwritable — a normal operation.

  2. memory_update can never update a decision/preference row. The update re-enters runWriteGate as a fresh candidate; its own supersession-target is still active in scope+type, so it lands in divergent and gets blocked by the very row it is replacing (60b8d3bc scored 0.74 against its own target; flag supersedes_check_<that row's ts> names the target as the check). Preference rows are effectively frozen after creation.

  3. The blocked-write resolution is unreachable. write_blocked + merge_proposal review=required point at memory_merge_review, but its loser must be a stored row (markSuperseded resolves by ts) — a blocked write was never persisted, so every derivable id (chain id f03c9f6e/60b8d3bc, evidence ts) returns "loser not found or already superseded". Two failed calls, nothing to resolve. Relatedly, superseded_overlap sets no hint (unlike ref_path_missing/ambiguous_memory), so the actionable remedy — rephrase against the rival's distinctness, or use a distinct scope — is never surfaced.

Suggested shape of the fix

  • Gate 3 conflictProne: keep the rivalry semantics only for genuinely competing statements — floor the overlap (e.g. the same 0.9, or a dedicated threshold) — so distinct second preferences write clean; true rivals still get review-gated.
  • Threading for updates: pass the row being superseded through to gate 3 and exclude it from divergent/overlapMatch (the update IS the sanctioned supersession — the gate must not cite it as the conflict). This also closes the family the 2026-10-17 note about memory_update clobbering belonged to.
  • Honesty in the block surface: either make blocked-candidate evidence resolvable by merge_review, or drop review=required for blocked (nothing was stored) and attach a hint naming the rephrase/distinct-scope remedy.

Relevant to #83 (store correctness) in spirit, though this is gate semantics, not security.

Activity

  1. added
    store-security
    on Oct 26, 2026
  2. added 2 commits that reference this issue on Oct 26, 2026
  3. abogartz-opencode-self-improvement commented on Oct 26, 2026

    @abogartz-opencode-self-improvement

    🎉 This issue has been resolved in version 0.14.8 🎉

    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

    releasedstore-security

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions