Repository navigation
v1.13.0 — post-section TASK_BASE_REF, trust guard, committed-range (D142/D147)
Ports all three of the canonical stride plugin's D142 base-ref / snapshot fixes (stride v1.36.0) into the Pi hook bridge. TASK_BASE_REF was captured at claim time — before runHook ran the ## before_doing section's git pull — so the after_doing changed_files diff spanned commits pulled from another clone (D132/W1678), and the W1529 dirty-baseline filter dropped committed task work (D137). Per ADR-002 all new logic lives in the pure, unit-tested modules; index.ts only wires them.
Fixed
- D132 (reorder + trust marker).
resolveClaimEnvCachenow persists task identity only and strips any inheritedTASK_BASE_REF/TASK_BASE_REF_TRUSTED; a new pureresolveFinalizeBeforeDoingEnvwrites the base + trust marker, called fromindex.tsafterrunHookreturns (regardless of exit code), re-recording the dirty baseline against the post-pull tree. - D132 (trust guard). New exported
resolveSnapshotBase(baseRef, cwd, trusted)— the three reference rules with the trusted-marker gate on rule 3, a loudconsole.errorrecompute, and a no-origin passthrough.finalizeAfterDoingandselfHealChangedFilesUploadresolve it once per task window and persist it as abase=line in.stride-diff-upload-state, reusing it so an after_doinggit pushcannot recompute a correct base toHEADand empty the snapshot. - D137 (committed range).
captureChangedFilesoverrides the dirty-baseline exclusion for any path in thebase..HEADcommitted range: committed range = task work.
Testing
npm test (node --test) grows from 195 to 213 tests, all passing. New coverage in the pure modules: resolveSnapshotBase over a two-clone bare-origin cross-pull fixture, the committed-range override, the base= round-trip, readFinalizerEnv trust-marker parsing, the inverted env resolvers, and two finalizeAfterDoing integration tests. The new tests reference resolveSnapshotBase (absent pre-fix), so they fail by construction against old code.
Backward compatibility
Backward-compatible and additive. The TASK_BASE_REF_TRUSTED cache key and base= state line are tolerated when absent. No marketplace — the extension installs via a github: ref pin.