Skip to content

feat(floor): /pharn-regress reuses verified BASE evidence within one delivery run (6.33.0) - #297

Merged
PrzemekGalarowicz merged 1 commit into
mainfrom
regress-base-reuse
Sep 28, 2026
Merged

PrzemekGalarowicz merged 1 commit into
mainfrom
regress-base-reuse

Conversation

@PrzemekGalarowicz

Copy link
Copy Markdown
Contributor

What

Within one /pharn-loop or /pharn-ship run, a later /pharn-regress now reuses the BASE-side evidence an earlier invocation left. It skips the base worktree, the install and every base gate, but only when tested code shows the evidence agrees with the current BASE requirement. The HEAD side always runs. Any mismatch runs the base side exactly as before.

  • Requirement (versioned, sha256; never "same BASE SHA"):
    • the base SHA;
    • the gate spec the base side copies (via gate-run-core.mjs baseSpecFrom, now its one owner);
    • the install decision and the timeout;
    • the stamp schema and fingerprint algorithm;
    • the content of root-level HEAD paths in scope, since the base worktree is nested in the HEAD tree.
  • Rule: pharn/floor/regress-base-reuse-core.mjs (pure) decides reuse; the first check that fails names one of 13 miss reasons (BASE_REUSE_MISSES). pharn/floor/regress-base-reuse.mjs handles storage.
  • Binding: a record in <git dir>/pharn-regress-base-reuse.json, out of the write tools' reach. It is bound to the run marker's bytes and age (hashed, never parsed), the stamp's bytes and its logs.
    • A HIT saved mid-run is re-checked in full at the verdict.
    • A record is published only if the same check accepts it, for the run and requirement the decision saw.
  • Unchanged: check-regress.mjs, validateStamp, every verdict, the stage-exit protocol.
  • Report: regression-report.json gains the additive, advisory base_evidence block {reused, miss, requirement_sha256, recorded}.
  • Progress record: moves to pharn-stage-regress-progress/2; a /1 record resumed across the upgrade stops with progress-malformed.

Measured (.dev/features/regress-base-reuse/MEASUREMENT.md, 3 reps)

worktrees installs base gate runs head gate runs time
main, every invocation 1 1 3 3 ~10.1–10.6 s
branch, 2nd invocation of a run 0 0 0 3 ~4.4 s

The first invocation is unchanged, and the decision costs ~18 ms. No token saving is claimed.

Tests

  • HIT: a second-invocation test that counts the actual work done.
  • Equivalence: the mandatory fresh-vs-reused test. It covers a real regression, a pre-existing red gate and an eval pair, and the checker's output matches byte for byte.
  • MISS controls: 19 end-to-end controls, each changing one input. Also a foreign feature, a forged progress record, a crash during the base gates, and a paused chain with a root file edited before resume.
  • Wiring:
    • a hook test on the record path;
    • check-loop-fresh reads FRESH over a HIT run;
    • the pinned command line runs twice with a real npm ci.
  • Mutation checks: deleting the key lines makes their tests fail.
  • npm test: 4394 / 4394. Floor GREEN (36 capabilities). Reconcile CLEAN.

Pipeline

/pharn-dev-ship artifacts are in .dev/features/regress-base-reuse/ (PLAN, GRILL, REGRESSION, VERIFY, REVIEW, SHIP).

  • GATE 1 and the GATE-2 fixes were model decisions under the maintainer's delegation, not human approvals.
  • The independent review raised 2 floor-gate findings (overclaiming sentences) and 3 minor ones, including one real publication gap. All five are fixed; see REVIEW.md, "Disposition".

Limitations (named)

  • A HIT proves agreement, not provenance (L43): a shell writer can forge the record and the evidence together.
  • The base side's in-progress scratch is write-tool reachable while a chain is paused at continue (follow-up regress-paused-chain-integrity).
  • A marker left by an interrupted run (≤ 24 h) binds a later standalone regress.
  • Ignored root content, the environment and the machine are not bound.
  • /pharn-dev-regress is unchanged.

SKILLS_VERSION 6.32.1 → 6.33.0 (minor). MIN_CLI stays 0.5.0.

🤖 Generated with Claude Code

…delivery run (6.33.0)

Within one /pharn-loop or /pharn-ship run, a later /pharn-regress skips the base
worktree, the install and every base gate when tested code shows the retained
BASE evidence agrees with the current BASE requirement (base SHA, the copied gate
spec, install decision, timeout, format versions, and root-level HEAD files in
scope). The HEAD side always runs; check-regress.mjs and validateStamp are
unchanged. Any mismatch runs the base side exactly as before.

- regress-base-reuse-core.mjs (pure rule) + regress-base-reuse.mjs (storage):
  a record in the git dir bound to the run marker's bytes and age, the stamp and
  its logs; a persisted HIT is re-decided at the verdict; publication goes through
  the same predicate for the decision's run and requirement.
- regression-report.json gains the additive, advisory base_evidence block.
- Progress record pharn-stage-regress-progress/2.
- Measured: the second invocation of a run makes 0 worktrees, 0 installs and
  0 base gate runs (~10.1 s -> ~4.4 s on the fixture). No token saving claimed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 28, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: aea867ff-3df9-4b7f-91df-a0c251410596


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@PrzemekGalarowicz
PrzemekGalarowicz merged commit 2cf0e85 into main Sep 28, 2026
8 checks passed
@PrzemekGalarowicz
PrzemekGalarowicz deleted the regress-base-reuse branch September 28, 2026 16:08
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