Skip to content

CORE (signing sitting): tripwire for KNOWN-LIMITS 35, session id on gate receipts - #49

Merged
githubscum merged 1 commit into
mainfrom
lotor-lane/limit-35-session-attribution
Sep 7, 2026
Merged

githubscum merged 1 commit into
mainfrom
lotor-lane/limit-35-session-attribution

Conversation

@githubscum

Copy link
Copy Markdown
Owner

WO

KNOWN-LIMITS 35 — a gate decision carries no session id, so a denial (or an
approval) cannot be attributed to the session that caused it. Found 2026-07-26;
narrowed today rather than fixed, because both call sites are non-delegable core.

What this ships

Not the fix — a tripwire proving the gap is real against the live source, plus
an amendment to the entry naming the exact three-part repair so a future
signing sitting can act on it without re-deriving the call sites.

test/known-limits-35-session-attribution.test.js, three assertions, all
currently passing (i.e. proving the gap, not a fix):

  1. A denied-path gatedAction() call with meta.sessionId set produces a
    receipt where sessionId is undefined — while the sibling informational
    fields ruleId/heldMs (added for a different limit, same "meta carries
    informational-only fields" pattern) already do survive. That contrast is
    the control.
  2. Same for the approved path — the gap is not decision-specific.
  3. A static-source check on bin/hook-pre-tool-use.js: the file already
    computes sessionId from payload.session_id and already threads it onto
    one receipt type (policy-warn, the both-layers-permissive case), but
    all three gatedAction() call sites build meta as { ruleId, heldMs }
    with no sessionId. Counts the bare sites (3 today) rather than asserting
    a boolean, so a partial fix (attribution on some gate decisions, silently
    not on others — worse than today's uniform gap) also fails this test, not
    just a zero-vs-nonzero fix.

KNOWN-LIMITS.md entry 35 gets a dated amendment pointing at the test file
for the fix recipe, rather than re-describing it in prose that could drift
from what the test actually checks.

944/944 (941 baseline on main + 3 new).

The gate held

Attempted the actual fix first, per Lotor rule 1: adding sessionId: meta.sessionId || null,
to the four gated-action receipt objects in src/gate/index.js. Denied
unsigned (self-mod, request 0e2c4bda). Not reshaped, not routed around, not
waited on. The two remaining pieces of the fix (the same one-line addition to
src/gate/index.js's other three receipt sites, and const meta = { ruleId, heldMs, sessionId: parsed.sessionId }; at the three call sites in
bin/hook-pre-tool-use.js) are named verbatim in the test file's docstring.

What a reviewer should doubt

  • This is a confession about a confession. It does not move the trace
    forward on its own — no new attribution exists after this merges, only a
    named and tested path to it. Judge it as documentation-with-a-tripwire, not
    as a feature.
  • The static-source check (assertion 3) is brittle by construction. It
    regexes for the literal string const meta = { ruleId, heldMs };. A
    refactor that reformats those three lines without fixing the underlying gap
    would make this test fail for the wrong reason (formatting, not
    attribution). That is judged an acceptable cost for a test that pins three
    call sites precisely rather than one — a reviewer who disagrees should say
    so; a more robust version would parse the file rather than regex it, and
    wasn't judged worth the complexity for a signing-sitting confession test.
  • Queued alongside four other core items (limit 63's parts widening,
    limit 34's two-part path-resolution fix, limit 64's digest-on-session-open,
    limit 65's pin-body coverage). This is the fifth. None has landed since
    limit 29: the pin is stale on main, and the suite is shaped so it cannot see it #41 merged on 2026-09-01 — worth Isaac's eye on whether the signing sitting
    itself is now the bottleneck, separate from ordinary review.

Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com

…ate receipts

gatedAction() already carries an informational side-channel for exactly this
shape of field: meta.ruleId and meta.heldMs reach the receipt without ever
entering canonicalizeRequest or verifyApproval. meta.sessionId does not exist
yet, though the value is available at every call site in bin/hook-pre-tool-use.js
(parsed.sessionId is already computed and already threaded onto one receipt
type, the both-layers-permissive policy-warn case) and simply is not forwarded
to gatedAction's meta.

This ships a tripwire, not the fix: three assertions proving the gap against
the live source (two live gatedAction() calls showing sessionId dropped on
both denied and approved paths, one static-source check counting the three
bare `meta = { ruleId, heldMs }` sites in the hook). All three currently pass
against today's code. KNOWN-LIMITS 35 is amended to point at the exact
three-part fix recipe, named in the test file's own docstring, rather than
left as a paragraph nobody can act on without re-deriving the call sites.

The actual fix (src/gate/index.js, bin/hook-pre-tool-use.js) was attempted
first per Lotor rule 1 and denied unsigned by the gate (self-mod, request
0e2c4bda on the src/gate edit) -- correct outcome, not reshaped, not routed
around. It queues for Isaac's signing sitting alongside the other core items
already stacked (limit 63's parts widening, limit 34's two-part fix, limit 64's
digest-on-session-open, limit 65's pin-body coverage).

944/944 (941 baseline on main + 3 new).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant