Skip to content

limit 75: a refused write no longer reads as touched - #61

Merged
githubscum merged 4 commits into
mainfrom
lotor-lane/touched-outcome
Oct 22, 2026
Merged

githubscum merged 4 commits into
mainfrom
lotor-lane/touched-outcome

Conversation

@githubscum

Copy link
Copy Markdown
Owner

WO: touched-vs-changed (lane run 33). Closes the candidate limit found in run 32; recorded as KNOWN-LIMITS 75.

What it addresses. The trace said "touched" for a write that never happened. A gate denial (seq 36203) was followed by a session receipt (seq 36204) listing the denied file under touched. Legibility and trust: a witness that reports attempts as changes overstates what the agent did.

Change (non-core: parser and views only).

  • Parser: Edit/Write touched entries carry outcome: ok, error, or unknown. The matching tool_result settles it. ok is sticky. No result seen means unknown. Entries that come only from file-history carry no outcome.
  • since-view: a touchedRefused count (null when there is no receipt). Paths are marked (refused) and the work line reads N files touched (M refused). A later receipt that lands the same path clears its marker. Legacy receipts render unchanged.
  • Facts from the transcript only. Lotor still infers nothing about intent.

Tested. test/known-limits-75-touched-outcome.test.js covers ok, error, error then ok, ok then error, no result, file-history only, the Read control, the since render, a legacy receipt, no receipt yet, and multi-receipt clearing. Full npm test: 1066/1066. An orchestrator probe on a hand-built transcript (a denied Edit) gives outcome: "error".

Eval served. E2-adjacent, chain fidelity of what a receipt claims. No v3 eval number applies directly.

Doubt this.

  1. is_error is the harness's word. It is self-attested, like all capture.
  2. An ok Edit can still be a no-op on disk. ok means "not refused", not "changed".
  3. Receipts written before this change carry no outcome and must still be read as "attempted".
  4. Across several receipts for one session, touchedRefused sums per receipt. The count line can say "(1 refused)" after a later receipt landed that path, while the path itself shows unmarked. This follows the view's existing sum-across-receipts convention (touchedCount does the same), but it is inconsistent.
  5. Not part of this PR: the same session's touched lists every path twice, once absolute and once relative.

Executor: glm-5.3-flash on Ollama (session.model read on the chain at seq 36244 and 36257). The orchestrator ran the verification.

🤖 Generated with Claude Code

…twice in touched

Edit/Write record file_path absolute; file-history records the same file
relative to the session cwd. parseSession now resolves both against the
transcript's cwd and keys touched on that identity (Windows paths folded
case- and separator-insensitively). Merged entries keep the edit/write via
and gain alsoVia ['file-history']. No cwd: no guessing.

Measured on two real sessions: touched 68 -> 39 and 26 -> 15.

Executor: glm-5.3-flash:cloud (lotor lane run 34). Orchestrator verified.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
githubscum and others added 3 commits October 22, 2026 11:47
…bsolute Edit paths

- Fixtures: file-history-snapshot and file-history-delta lines no longer
  carry cwd (real transcripts never do). Tests that need a cwd before the
  first file-history line get it from a user line, as a real session does.
- touchKey normalises an absolute Edit/Write file_path lexically in its own
  flavour (win32 for drive/UNC, posix otherwise), so `.\`, `..` and doubled
  separators collide with the resolved file-history twin. Two tests; both
  fail on the previous head.
- KNOWN-LIMITS 75: this lands before #61 (which becomes 76); the doubt now
  names the first-cwd-only assumption and file-history before any cwd.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The parser added an Edit/Write path to `touched` at tool_use time, before its
tool_result, so a write the harness refused (is_error, e.g. a gate denial)
landed in `touched` and sessions_since printed it as a change. Found
2026-10-19: denial at seq 36203, session receipt seq 36204 listed the hook
file under touched; the file was unchanged on disk.

- parser: Edit/Write touched entries carry outcome ok | error | unknown,
  settled by the matching tool_result; ok is sticky; no result -> unknown;
  file-history entries carry no outcome.
- since-view: touchedRefused count (null without a receipt), "(refused)" on
  the path, "(M refused)" on the work line; a later non-error receipt for the
  same path clears the marker. Legacy receipts render unchanged.
- test/known-limits-75-touched-outcome.test.js; KNOWN-LIMITS 75.

Executor glm-5.3-flash (receipts seq 36244, 36257); orchestrator verified,
npm test 1066/1066.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…, claim narrowed

Rebased onto #62 (limit 75, touched-path identity); this entry renumbered
75 -> 76 and its test file renamed to match. Parser conflict resolved by
having recordTouched open the attempt's outcome and return the canonical
key, which touchToolIds stores, so a tool_result settles the same entry a
file-history twin merged into (tests h1, h2).

- since-view: touchedRefused counts distinct refused paths per session.
  Every subsession receipt re-parses the whole transcript, so the old
  per-receipt sum showed one refusal as "(3 refused)". Tests g5, g6, g4.
- text receipt: a refused path prints "(via: write, refused)". Test i.
- live view: "N files (M refused)" and "(refused)" on the path; refusedPaths
  on the session object. Test j.
- KNOWN-LIMITS 76 narrowed to PARTLY CLOSED: retcon's charter
  reconciliation folds touched to bare paths in bin/retcon.js (core), so a
  refused Write still confirms a charter item; MCP query_receipts
  touchedCount, the chapters view, and the since-view's per-receipt
  touchedCount sum are listed as still open.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@githubscum
githubscum force-pushed the lotor-lane/touched-outcome branch from 9de6ccf to e5c30a6 Compare October 22, 2026 16:53
@githubscum

Copy link
Copy Markdown
Owner Author

Review fixes pushed in e5c30a6 (force-pushed with lease from 9de6ccf).

This PR now depends on #62 and must merge after it. The branch is rebased onto #62's head (8b4993b). Until #62 merges, the diff here against main also shows #62's commits.

  1. Rebase and parser conflict. recordTouched now opens the attempt's outcome (pending, unless already ok) and returns the canonical key; touchToolIds stores that key, so a tool_result settles the same entry a file-history twin merged into. Tests h1 (absolute Write + relative file-history + refused result = one entry, outcome: 'error', alsoVia: ['file-history']) and h2.
  2. Renumbered 75 -> 76. KNOWN-LIMITS entry, code comments and the test file (test/known-limits-76-touched-outcome.test.js). limit 75/76: one edited file no longer counts twice in touched #62 keeps 75. The PR title and the original commit subject still say 75. Collision for the owner: PR limit 53: a matcherHash resolves to its commit; found limit 77 (stamp is line-ending-sensitive) #67 also claims 75 (matcher stamp line endings). I did not renumber limit 53: a matcherHash resolves to its commit; found limit 77 (stamp is line-ending-sensitive) #67.
  3. touchedRefused per session. It now counts distinct refused paths. Every subsession receipt re-parses the whole transcript (src/ingest), so one refusal with three SessionEnd firings showed "(3 refused)". Test g5 (three receipts give 1); g4 and g6 check that a later landed write takes the count back to 0. All three fail on the previous head.
  4. Other readers. The text receipt (renderSessionReceipt) now prints (via: write, refused) (test i). The live view prints N files (M refused), marks the path, and carries refusedPaths (test j). Both fail on the previous head.
  5. CLOSED claim narrowed to PARTLY CLOSED. bin/retcon.js reconstruct() folds touched into a Set of bare paths before src/views/reconcile.js sees it, so the fix has to go in reconstruct(). bin/ is wholesale core in the core-paths list, so I did not touch it: a refused Write still confirms a charter item in retcon. It needs a signing sitting. The entry's "Still open" list also names three readers that still count a refused write as a change: query_receipts rows (touchedCount in src/mcp/server.js), the chapters view, and the since-view's touchedCount, which is still summed per receipt (a pre-existing overcount with subsessions).

npm test: 1083/1083 pass on e5c30a6.

githubscum added a commit that referenced this pull request Oct 22, 2026
The KNOWN-LIMITS numbering test requires contiguous entries, so numbers
follow the merge order #65, #66, #64, #63, #60, #62, #61, #67, #68, #69,
#70, #71: #62 takes 75, #61 takes 76, this PR takes 77. Every citation on
this branch moves with it (KNOWN-LIMITS.md heading and the limit 53 note,
src/views/matcher-history.js header, test/matcher-history.test.js comment).

On this branch alone the numbering test reports 75 and 76 missing; that
clears once #62 and #61 are on main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
githubscum added a commit that referenced this pull request Oct 22, 2026
The KNOWN-LIMITS numbering test requires contiguous entries, so numbers
follow the merge order #65, #66, #64, #63, #60, #62, #61, #67, #68, #69,
#70, #71: #62 takes 75, #61 takes 76, #67 takes 77, this PR takes 78.
Every citation on this branch moves with it: KNOWN-LIMITS.md heading,
CHANGELOG.md, docs/receipt-coverage.md, and the V3-03 proposal note. The
staged .patch carries no limit number and is unchanged.

On this branch alone the numbering test reports 75, 76 and 77 missing;
that clears once #62, #61 and #67 are on main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@githubscum
githubscum merged commit 09d1300 into main Oct 22, 2026
githubscum added a commit that referenced this pull request Oct 22, 2026
The KNOWN-LIMITS numbering test requires contiguous entries, so numbers
follow the merge order #65, #66, #64, #63, #60, #62, #61, #67, #68, #69,
this branch moves with it (KNOWN-LIMITS.md heading and the limit 53 note,
src/views/matcher-history.js header, test/matcher-history.test.js comment).

On this branch alone the numbering test reports 75 and 76 missing; that
clears once #62 and #61 are on main.

Co-Authored-By: Claude Opus 5.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