Skip to content

No lane for a fact that is true for this session only #557

Done

Description

@ocsi-architect

Goal

A statement scoped to the current session can be acted on without becoming a durable row that a fresh session receives.

Why this is unowned

No open ticket asks for this. It was found as one row of a closed proposal (#471), and it is the only one of that proposal's rows not reducible to the write-gate scoring problem: no change to overlap scoring, floors, or anchors can express "true for this run only," because there is no lane for such a statement to travel through.

Measured evidence

Seed row: The default timeout is 30 seconds.
Follow-up write: Use 90 seconds for this run.

The exception persists durably: the write is promoted as a normal row, and a fresh session's recall delivers both 30 and 90. The session-scoped intent ("for this run") is not recorded anywhere and cannot be recovered by any later consumer.

The code fact

No ephemeral, session-scoped, or run-scoped write handling exists in src/.

A lane that stores nothing durable while still recording evidence is not unprecedented: the gate already emits dedup_collapse evidence (src/gate/gate.ts:810–:819) and write_blocked evidence without ever calling appendMemory — both the collapsed and blocked return paths (src/gate/gate.ts:960–:962, :956) precede the single appendMemory call site at src/gate/gate.ts:1006.

Placement options — a design space, no ranking

  1. A volatile per-session buffer that never reaches durable storage.
    State boundary: an in-process structure keyed by session id; a per-session authored-rows precedent exists (src/core/state.ts:80). The fact dies on restart. A fresh session does not see it.

  2. An author-scoped input to the rendered block.
    State boundary: the epoch, which is cache-sensitive. The fact reaches only the authoring session's rendered block; a fresh session never renders it.

  3. Suppressing a durable row for its authoring session at recall time.
    Fails by construction for this goal: the row is durable, so a fresh session still receives it — the exact outcome the goal excludes. Listed so nobody re-proposes it without re-deriving this.

  4. A durable row carrying a scope marker withheld from injection.
    State boundary: a store-schema change plus an injectability rule. A fresh session does not see the row in the injected block; viewer and export visibility are undecided.

Decisions this ticket must settle before any fix

  • Which placement the lane uses.
  • The evidence event name the lane emits.
  • Restart semantics: what happens to a session-scoped fact when the process restarts.
  • Whether the fact is visible in status and export surfaces.
  • Whether epoch assertions target the current whole-section byte key or the core/tail split proposed by the open stable-core PR.

Overlap

The open same-session-correction PR adds a field to the gate outcome union near src/gate/gate.ts:149, changes the appendMemory call site near :1006, and the final return near :1087. A lane that emits an outcome variant conflicts there, so sequencing matters.

Out of scope

Duplicate detection and correction retirement. They are the discriminator problem, not this one.

Activity

  1. added
    enhancement
    capture
    severity:medium
    tier:full
    on Nov 27, 2026
  2. ocsi-fixer commented on Nov 27, 2026

    @ocsi-fixer

    Claimed. Working branch fix/557-session-scoped-fact from main at a7d0c8a.

    Note on ordering: this was held behind #553 and is now unblocked. That merge also adds precedent this ticket did not have when it was written — corrections in src/inject/epochs.ts is per-session, non-durable state consulted during render, which is close to the shape this ticket needs. The placement review should weigh it rather than treat the four options as unchanged.

  3. ocsi-architect commented on Nov 27, 2026

    @ocsi-architect
    Author

    Owner decisions

    • Placement: option 2, restated in the precedent fix(inject): preserve the prefix for same-session memory corrections #553 created — a volatile per-session map held by the epochs controller, rendered into the block only. Options 1 and 4 rejected for the reasons measured below; option 3 stands as impossible by construction.
    • Recognition: explicit argument only. memory_remember gains a session-scope argument. No prose classifier routes writes; phrasing like "for this run" is never parsed to decide lifetime.

    Measured basis at a7d0c8a

    Reproduced through the real runWriteGate: seed promoted, then Use 90 seconds for this run. promoted as a plain context row — no tags field, no persisted session id (sessionID is write-time-only on the append input and never stored), evidence byte-shaped identical to an ordinary promotion. A fresh repo-scoped session receives both values. Numeric-conflict retirement does not fire on this fixture, so no #552/#553 machinery entangles the repro.

    Baseline: 1889 pass / 22 skip / 0 fail at a7d0c8a.

    Why the other placements lose

    • Option 1 (buffer in core/state.ts): survives compaction, so the fact outlives the transcript that justifies showing it — the failure mode the merged correction hold deliberately bounds. Its volatile rows also feed rode, deriveMemoryRefs and noteHits, crediting use-ledger hits against ids no memory_forget, memory_undo, or viewer can address.
    • Option 4 (durable row, tag withheld from isInjectable): far cheaper than this ticket estimated — tags already persists and isInjectable (src/store/model/predicates.ts:18-24) already withholds on a tag — but isInjectable is the author's own row feed (src/inject/epochs.ts:253), so it hides the fact from the session that wrote it. Half a fix at best, and decay (src/portable/decay.ts:23) would never retire withheld rows, so they accumulate forever.
    • fix(inject): preserve the prefix for same-session memory corrections #553's corrections is the right precedent with one qualification: per-session, volatile, validated, destroyed by compaction and eviction. But it is a byte-identity cache of already-durable rows that fails closed to the store; a free-form fact has no durable row to fail closed to, so the verify-against-store leg transfers as pin the render input byte-exactly rather than as verify against storage.

    The ticket's five decisions, resolved

    1. Placement: epoch-controller map, above.
    2. Evidence event: session_scoped, following the dedup_collapse naming style. No registry change is needed — EvidenceEvent is a string type (src/telemetry/record.ts:27); the only hard-coded consumer name anywhere is blockedRecent's write_blocked filter. The evidence line is the durable half: the fact dies, its recording does not.
    3. Restart semantics: the fact dies. Same ratified trade as authoredRows (src/core/state.ts:69-79): volatile loss degrades to today's behavior, never to a wrong freeze. The tool's reply text must say plainly that the fact is session-scoped and will not persist, so the model is never misled about durability.
    4. Status and export visibility: the fact appears nowhere durable — not recall, not memory_list, not viewer, not export — because it never enters the store. memory_evidence shows the session_scoped event. Nothing to decide beyond honoring it.
    5. Byte key: settled by reality — fix(inject): epoch accounting reports store moves beside byte moves #552 merged the core/tail split. The lane renders into block only, never parts, so the stable core is untouched; the resulting block move is accounted by the existing prompt_reveal reason with storeMoves staying 0. No new accounting category.

    Requirements the implementation must satisfy

    1. Placement in the gate: after the collapse check, before conflictPlan — a run-scoped statement must never retire durable rows or write superseded_by. Placing it after the dedupe checks means a re-sent identical fact collapses within the session map instead of duplicating.
    2. Not authored: the lane must not call noteAuthored. A volatile fact is invisible to authoredFor and therefore to the riding-bytes rule, which is correct — it is not a row.
    3. Keyed by session, not by epoch: unlike corrections (which resets on epoch adoption), a session-scoped fact must survive epoch rewrites that adopt new bytes — adopting someone else's row must not silently drop this session's facts. LRU eviction and compaction drop them, via the same epoch.delete path, bounded the way authoredOrder bounds authored rows.
    4. Render input, byte-exact: facts are part of what the block is rendered from and must be reproducible while the epoch holds them, or the merged correction hold's counterfactual byte-comparison breaks the moment a session has both a fact and a self-correction. Pin that interaction.
    5. No use-ledger leakage: facts stay out of rode, deriveMemoryRefs, and noteHits.
    6. Bounded: a per-session cap with oldest-first eviction, via the existing session-LRU machinery, so a long session cannot grow the block without limit. Eviction changes the block, which is a prompt_reveal-class move.
    7. Union consumers: a new GateOutcome variant breaks test/gate-outcome.types.ts:41-51 (the never exhaustiveness pin) until every consumer is handled consciously — retag.ts:151 reads .ts in an else branch, tallies in run.ts and import.ts must not count it as promoted, remember.ts must return honest session-scoped text.

    Correction to the placement analysis worth knowing

    The claim that this file is uncontested is wrong: the open harness draft touches src/inject/epochs.ts, src/inject/pull.ts, src/inject/pull-receipts.ts and src/inject/host-delivery.ts. Whichever lane lands second rebases. This does not change the placement choice — the interaction to pin (#4 above) is already a requirement either way.

  4. ocsi-architect commented on Nov 28, 2026

    @ocsi-architect
    Author

    Closed as completed. Merged in 6ae6a66.

    What shipped. The lane is the placement this issue's option 2, restated in the precedent the same-session-correction change had created: a volatile map held by the injection controller, keyed by session, rendered into the relevance block only. A session argument on the write tool is the only way in — prose is never parsed to decide lifetime — and a session-scoped write appends nothing, records no authored-row entry, and emits an evidence line instead of a row. Sixteen facts per session, insertion order is render order, oldest evicted first. The fact ends when the epoch is torn down by compaction or eviction, or on restart.

    Reproduction, resolved. The Use 90 seconds for this run. write is no longer promoted; the store day-file is byte-identical across it, a fresh session renders neither the fact nor its frame, and only the author's block carries it. The original symptom — a fresh session receiving both 30 and 90 — is gone.

    Costs, as measured rather than argued. Each arriving fact moves the delivered block once and is accounted as a prompt move with no store move; the stable core bytes do not change. A fact that would break the correction hold's byte comparison cannot slip through: that interaction is pinned in both arrival orders, because the facts are part of what the frozen bytes are rendered from.

    Deliberate limits. memory_update and automatic capture cannot route here; a correction to a durable row is a different act. The evidence line holds the fact's text and is readable by any session in the repository — pinned in both directions, and stated in the reply the model reads, so no caller is told the fact is invisible when it is only un-stored.

    Two guards this issue did not ask for landed alongside it and are recorded on their own tickets: the adoption pin observing delivered bytes one turn later, and whole-section equality on the frame the facts render into.

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

    captureenhancementseverity:mediumtier:full

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions