Skip to content

limit 75/76: one edited file no longer counts twice in touched - #62

Merged
githubscum merged 2 commits into
mainfrom
lotor-lane/touched-path-identity
Oct 22, 2026
Merged

githubscum merged 2 commits into
mainfrom
lotor-lane/touched-path-identity

Conversation

@githubscum

Copy link
Copy Markdown
Owner

WO: WO-TOUCHED-PATH-IDENTITY, lotor lane run 34. Closes the candidate limit run 33 named: every touched path appeared twice, absolute and relative.

Spec / limit: new KNOWN-LIMITS entry (numbered 75 here; #61 also claims 75, so whichever lands second renumbers to 76). Serves v3's R1 completeness: a trace that double-counts its own writes is not a trustworthy floor for the deeper rungs. Non-core: parser only.

What changed: the parser resolves Edit/Write paths (absolute) and file-history paths (relative to cwd) against the transcript's first cwd, and keys touched on that identity. Windows keys fold case and separators. Merged entries keep the edit/write via and gain alsoVia: ['file-history']. No cwd means no guessing: the relative entry stays separate. Parser version hash changes.

Tested: npm test 1064/1064 green on this branch (8 new tests in the new parser-touched-identity test file). Probe: main's parser and this branch's, on two real transcripts from this machine. touched went 68 -> 39 and 26 -> 15, with no relative paths left. Executor glm-5.3-flash:cloud wrote the code and tests. The orchestrator re-read the diff and ran the suite and probe; the executor could not run tests itself.

Eval: none of E1-E6 applies directly. The closest is E2 (fidelity of what the chain says), and the probe above is the evidence.

Doubt this:

  • Conflicts with limit 75: a refused write no longer reads as touched #61. Both PRs rewrite the same touched block in the parser. limit 75: a refused write no longer reads as touched #61 adds outcome and maps tool_use ids to paths; after this PR, that map has to carry the canonical key and recordTouched has to carry outcome. Whichever lands second needs that merge and the 75 -> 76 renumber.
  • The resolve is lexical. Symlinks, junctions and 8.3 names are not folded, and case-insensitive macOS volumes are not folded.
  • When a second Edit/Write hits the same file, the latest one sets via.
  • Receipts already on the chain keep their doubled lists.

…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>
…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>
githubscum added a commit that referenced this pull request Oct 22, 2026
…, 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

Copy link
Copy Markdown
Owner Author

Review fixes pushed in 8b4993b.

  1. Fixture shape. file-history-snapshot and file-history-delta lines no longer carry cwd; checked against real transcripts on this machine, they never do (snapshot keys: type, messageId, snapshot, isSnapshotUpdate; delta keys: type, messageId, snapshotMessageId, trackingPath, backup, timestamp). "snapshot BEFORE the Edit" now takes its cwd from an earlier user line, as a real session does. A guard test pins the helper shape.
  2. touchKey normalises an absolute Edit/Write file_path lexically in its own flavour (path.win32.normalize for drive/UNC, path.posix.normalize otherwise), so .\, .. and doubled separators land on the same key as the resolved file-history twin. Windows and posix tests; both fail on the previous head.
  3. KNOWN-LIMITS 75 text updated to match (normalisation; this PR lands before limit 75: a refused write no longer reads as touched #61).

npm test: 1067/1067 pass on 8b4993b.

Noted, not fixed:

  • sessionCwd is the FIRST cwd in the transcript. Transcript cwd can change mid-session, and whether file-history keys stay relative to the original cwd after a change is unconfirmed. A file-history line that comes before any cwd-carrying line stays relative and unmerged. Both are now named in the entry's "What to doubt".

Numbering and land order: this PR keeps 75 and must merge first. #61 has been rebased onto this branch and renumbered to 76. PR #67 also claims 75 (matcher stamp line endings); that collision is left for the owner, #67 was not touched.

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 514e668 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