Skip to content

Gate evidence: attribute only supersessions actually performed by the call #208

Closed

Description

@WhollyMindless

Proposed classification: bug, test-integrity, severity:medium. Labels require maintainer permissions; these are suggestions for your triage.

For maintainer triage and approval of scope. Reviewed main at bf9f4d2, still current when these proposals were prepared. Review probes use synthetic temporary stores; this is not a report of a production incident. No implementation or assignment is implied by this issue.

GATE-1: GATE-2 writes superseded_by evidence for every planned row whenever any row was marked

  • src/gates.ts:447-462 — drift: if (marked.length > 0) for (const p of driftPlan) records all plan rows and sets supersededTs
  • src/gates.ts:494-514 — canonical: same pattern; supersededTs may name an unmarked row
  • src/memory.ts:420-425 — markManySupersededReport documents that marked excludes rows retired out-of-band

Reproduction: Bun test outside the repo: mock.module wraps memory.ts markManySupersededReport so that, before the real batch runs, a simulated other session retires the 2nd planned row (superseded_by=OTHER-SESSION). Store has 'worker backend mysql' and 'queue backend redis' in scope planning, plus canonical backend=postgres. Then runWriteGate({type:context,scope:planning,content:'api backend postgres'}, trusted).

Observed: durable=['2026-01-01T00:00:00.000Z'] (correct). Row 2026-01-02 superseded_by=OTHER-SESSION. Evidence still records superseded_by for BOTH rows with target= reason=canonical.

Effect: memory_evidence and audits attribute a retirement to the wrong chain and reason. This contradicts the #158 round-3 rule that the trail never claims a retirement the call did not perform. The durable ledger (ctx.durable) is correct; only evidence and write_promoted.supersedes are affected.

Preconditions: A concurrent session (or viewer) retires a planned row between the gate's scope read and the batch publish.

Proposed scope / decision requested

Emit superseded_by and derive promoted.supersedes only from the returned marked rows. Pin both drift and canonical interleavings. Parent independently reproduced the canonical case with the supplied deterministic module wrapper; the drift path is source-reviewed, not independently exercised. Different from #199/#202, which concern the owning repository/session.

Please accept, narrow, defer, or decline this independently of the other review findings. We will wait for your direction before taking implementation. Happy to supply a checked-in regression reproducer with an accepted fix; the review report and probe artifacts are preserved locally.

Activity

  1. added
    bug
    test-integrity
    severity:medium
    agent:ready
    on Nov 1, 2026
  2. ocsi-triager commented on Nov 3, 2026

    @ocsi-triager

    osi-spec-hash: ec78f65d5801a2c7 2026-11-03T23:52:44Z - acceptance criteria frozen at this text. A later edit to the body changes this hash, and the reviewer will withhold approval until a maintainer replies spec ok.

  3. added
    fix:pr-open
    on Nov 4, 2026
  4. added a commit that references this issue on Nov 4, 2026
  5. abogartz-opencode-self-improvement commented on Nov 4, 2026

    @abogartz-opencode-self-improvement

    🎉 This issue has been resolved in version 0.15.20 🎉

    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

    agent:readybugfix:pr-openreleasedseverity:mediumtest-integrity

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions