Repository navigation
Files Changed: model external mutation lifecycle and net-zero states #974
Description
Files Changed: model external mutation lifecycle and net-zero states
Important
Problem - A basic external tracer can show one changed file, but cannot truthfully retire a reverted row, distinguish creation from deletion, or preserve destination identity during moves. Interrupted work must not become false ownership evidence.
Approach - Extend the tracer with session-bound mutation reservations. Prepare before mutation, atomically commit verified endpoint state after success, or abort. The assessed-detail consumer then renders only changed states and removes unchanged rows.
Scope - in: zero-net transitions; create and delete state; paired source and destination move state; prepared, committed, and aborted reservations. out: a second baseline store, canonical-reference redesign, generic shell attribution, legacy-route migration, and UI redesign.
Assumptions - The external tracer from child 1 supplies canonical references, immutable first-touch baselines, assessed detail, and a session-bound capability surface.
Acceptance Criteria
- Restoring a modified external file byte-for-byte to baseline yields unchanged and removes its Files Changed row.
- A file absent at first touch becomes added after committed creation and unchanged after committed deletion.
- A file present at first touch becomes deleted after committed deletion and unchanged when recreated with exact baseline bytes.
- A move to a missing destination yields independent source deleted and destination added assessments.
- A move to a pre-existing destination derives modified or unchanged from that destination's baseline and is never automatically added.
- A prepared first-touch mutation left after interruption is unavailable and produces no changed row.
- Aborting a first-touch reservation removes ownership; aborting a later reservation preserves the prior committed assessment.
- An expired, forged, wrong-session, wrong-reference, or stale-revision commit cannot replace the last committed expected state.
Testing Decisions
- Extend child 1's server integration harness with a table-driven create, delete, revert, abort, and paired-move matrix using real non-Git files.
- Extend tool mutation tests for registered external modification, creation, deletion, partial failure, and abort.
- Extend the assessed-detail UI coverage with visible zero-net row removal.
- Extend Sidebar operation tests only for prepare-before-mutate, commit-after-success, abort-after-failure, and paired move reservations.
Key Decisions
- A reservation group represents one logical mutation; a move reserves source and destination together while keeping their baselines distinct.
- Commit records only server-verified present or absent endpoint state.
- Filesystem failure aborts attribution rather than inventing a partial diff.
- Watcher events remain invalidation only and never infer lifecycle state.
Constraints & Invariants
- Do not add another baseline store, canonical resolver, or browser identity scheme.
- Do not use client titles, watcher status, tool patches, or rename maps as lifecycle truth.
- Do not expand undeclared shell attribution.
- Keep parent Files Changed: full session-lineage mutation ledger #972's privacy and legacy compatibility boundaries intact.
Prior Art
- Parent Files Changed: full session-lineage mutation ledger #972 lifecycle matrix
- fix(app): trust server session diff for Files Changed panel #720, zero-net server authority
- Slice 1: Contamination fix — derive agent-file filter from tool filediff only #742, session-scoped ownership filtering
- Files Changed: per-session file watcher for reliable external-change refresh #845, watcher invalidation semantics
Source
Part of #972. Blocked by #973.
Notes
This child starts as hitl because the parent review is degraded. Its own deliberate review must pass before implementation begins.
Activity
jeonghun-jj-lee commentedon Sep 10, 2026
Deliberation addendum: mechanical checks are degraded because model critics were unavailable; an independent adversarial review found no remaining blocker. The accepted local contract preserves a prior expected state then reassesses after a later abort; explicitly covers the B/E/C partial-write matrix including C=E, canonical self-moves, invalid reservation commits, and all-or-nothing group publication. This issue remains hitl pending implementation review.
jeonghun-jj-lee commentedon Sep 11, 2026
Merged into the #972 integration branch after TDD verification; continuing with dependent slice #975.
jeonghun-jj-lee commentedon Sep 11, 2026
Reopened after the paired-local #976 investigation: the reservation lifecycle is implemented only as in-process server calls. The required authenticated extension transport for prepare, group commit, and abort is missing; the fork currently exposes only the assessed-detail GET route. A focused TDD correction is now required before the Sidebar can integrate safely.
jeonghun-jj-lee commentedon Sep 11, 2026
Corrected the missing authenticated reservation transport discovered during #976 integration. Merged into the #972 fork integration branch after TDD verification; resuming #976 against the actual route contract.