Skip to content

regress-stage: add /pharn-regress product command and outside-scope gate#26

Merged
PrzemekGalarowicz merged 2 commits into
mainfrom
regress-stage
Jul 1, 2026
Merged

regress-stage: add /pharn-regress product command and outside-scope gate#26
PrzemekGalarowicz merged 2 commits into
mainfrom
regress-stage

Conversation

@PrzemekGalarowicz

@PrzemekGalarowicz PrzemekGalarowicz commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds /pharn-regress, the fifth product-pipeline stage (spec → plan → grill → build → regress → verify → ship), as a command-only increment with no new floor primitive.
  • Reuses existing floor helpers (check-regress.mjs for baseline vs HEAD exit-code comparison, check-plan-spec-agree.mjs as the third spec→plan hash-chain consumer after grill and build) to detect pass→fail flips outside the feature's declared scope in the user's codebase.
  • Includes the build-loop audit trail under .dev/features/regress-stage/ (plan, grill, review, regression/verify reports).

Test plan

  • npm test — floor and hook suites stay green
  • node .dev/floor/validate.mjs . — capability count remains 1 (command is floor-ignored)
  • Run /pharn-regress against a feature with a known features/<name>/PLAN.md + SPEC.md and confirm regression-report.json + REGRESSION.md emit with deterministic verdict
  • Confirm spec→plan hash drift halts with a RED REGRESSION.md (chain gate, no silent pass)
  • Confirm an outside-scope gate flip at HEAD is reported as regression (exit 1 from check-regress.mjs verdict)

Made with Cursor

Summary by CodeRabbit

  • New Features

    • Added a new regression workflow for feature changes, with clear pass/fail reporting and a deterministic no-regression verdict.
    • Outputs now include a human-readable report plus a machine-readable summary for easier review.
  • Bug Fixes

    • Improved detection of behavior changes outside the intended feature scope.
    • Added safeguards to prevent false positives from pre-existing test failures and environment differences.

Introduce the fifth product-pipeline stage: deterministic regress detection outside the feature scope, reusing check-regress.mjs and the spec→plan hash-chain gate.

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@PrzemekGalarowicz, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 50 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: acde817c-100a-46a9-a897-ee930f37ed63

📥 Commits

Reviewing files that changed from the base of the PR and between 45bd635 and a9387aa.

📒 Files selected for processing (3)
  • .dev/features/regress-stage/REVIEW.md
  • .dev/features/regress-stage/SHIP.md
  • .dev/features/regress-stage/VERIFY.md
📝 Walkthrough

Walkthrough

This PR adds a new /pharn-regress product command specification (.claude/commands/pharn-regress.md) defining a deterministic outside-scope regression detection pipeline stage, along with its full development-lifecycle documentation set (PLAN, GRILL, REGRESSION, REVIEW, SHIP, VERIFY, and JSON report artifacts) under .dev/features/regress-stage/.

Changes

New /pharn-regress command and stage artifacts

Layer / File(s) Summary
Command frontmatter and guarantee model
.claude/commands/pharn-regress.md
Defines command metadata, stage purpose vs /pharn-build, floor/advisory separation, trusted-prefix model, and the core guarantee/residual statement.
Regress orchestration steps
.claude/commands/pharn-regress.md
Specifies name resolution, writes-scope setup, spec→plan hash-chain enforcement, base determination, inside/outside partitioning via check-regress.mjs scope, gate discovery/classification, baseline/HEAD gate execution in worktrees, verdict computation, and artifact emission.
Guarantee, trust, and determinism audits
.claude/commands/pharn-regress.md
Adds audit sections mapping guarantees to floor helpers, trust boundaries for untrusted inputs, deterministic branching rules, and cost/granularity limits.
Feature PLAN and GRILL review documents
.dev/features/regress-stage/PLAN.md, .dev/features/regress-stage/GRILL.md
Documents the plan for the command's design, files to write/not write, satisfied contracts, guarantee/trust/determinism audits, resolved open questions, and GRILL advisory findings on the plan.
VERIFY, REVIEW, SHIP, and generated reports
.dev/features/regress-stage/VERIFY.md, .dev/features/regress-stage/REVIEW.md, .dev/features/regress-stage/SHIP.md, .dev/features/regress-stage/REGRESSION.md, .dev/features/regress-stage/regression-report.json, .dev/features/regress-stage/verify-report.json
Adds verification results (PASS, format:check fix note), advisory review findings, ship roll-up summary, and machine-generated regression/verify JSON reports and the corresponding REGRESSION.md.

Estimated code review effort: 2 (Simple) | ~12 minutes

Possibly related PRs

  • pharn-dev/pharn-oss#10: Adds the same .claude/commands/pharn-regress.md orchestration logic and identical regression-report.json/REGRESSION.md artifact outputs.
  • pharn-dev/pharn-oss#18: Consumes the /pharn-regress command's regression-report.json output as a structural halting signal in a gated ship orchestrator.
  • pharn-dev/pharn-oss#21: Introduces the .dev/floor/check-plan-spec-agree.mjs hash-chain checker that this PR's regress command relies on and fails closed against.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: adding the /pharn-regress command and its outside-scope regression gate.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch regress-stage

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.

Co-authored-by: Cursor <cursoragent@cursor.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.dev/features/regress-stage/REVIEW.md:
- Line 78: The REVIEW.md markdown has emphasis written with underscores instead
of asterisks, causing the markdownlint MD049 failure. Update the affected
emphasized phrases in this file to use *emphasis* syntax, and keep the existing
wording intact. After making the markdown style change, run npx prettier --write
on the same file to satisfy the prettier --check failure.

In @.dev/features/regress-stage/SHIP.md:
- Around line 10-17: The outcomes table in SHIP.md has spacing that breaks
markdownlint MD060 and prettier formatting. Reformat the table to match the
expected compact pipe-table style, keeping the same rows and values but fixing
the alignment/spacing so `npx prettier --write` and MD060 both pass.

In @.dev/features/regress-stage/VERIFY.md:
- Around line 7-15: The VERIFY.md status table is misformatted, causing
markdownlint MD060 and prettier check failures. Update the markdown table under
the regress-stage summary so the pipes and columns are properly aligned in the
same style used by the surrounding docs, and make sure the table remains valid
after formatting. Use the existing table content in VERIFY.md as the target and
reformat it so prettier and markdownlint both pass.
- Around line 18-29: The honest note is incomplete because it lists only three
prettified outputs, but the VERIFY.md document itself also needed formatting.
Update the `format:check` explanation so it explicitly includes VERIFY.md in the
set of files fixed by `npx prettier --write`, or rephrase the paragraph to say
all hand-written audit outputs from the run were formatted. Keep the rest of the
`check-verify.mjs` / `verdict: "no-regressions"` explanation unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a4299acf-4493-453d-b7e7-99b45cb52a26

📥 Commits

Reviewing files that changed from the base of the PR and between 0888102 and 45bd635.

📒 Files selected for processing (9)
  • .claude/commands/pharn-regress.md
  • .dev/features/regress-stage/GRILL.md
  • .dev/features/regress-stage/PLAN.md
  • .dev/features/regress-stage/REGRESSION.md
  • .dev/features/regress-stage/REVIEW.md
  • .dev/features/regress-stage/SHIP.md
  • .dev/features/regress-stage/VERIFY.md
  • .dev/features/regress-stage/regression-report.json
  • .dev/features/regress-stage/verify-report.json

> Per P7 (real, recurring — not hypothetical). Provenance: increment `regress-stage`
> (`.claude/commands/pharn-regress.md`), recurring across `grill-stage` + `build-stage`.

- **Candidate (target `.dev/memory-bank/lessons-learned.md`):** _"Every product `pharn-*` command that

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Fix emphasis style — use asterisks instead of underscores.

Lines 78, 82, 83, and 86 use _emphasis_ but markdownlint expects *emphasis* (MD049). Replace underscores with asterisks, e.g.:

-  _"Every product `pharn-*` command that
+  *"Every product `pharn-*` command that

Also run npx prettier --write on this file to resolve the prettier --check failure.

Also applies to: 82-83, 86-86

🧰 Tools
🪛 GitHub Actions: ci / check

[error] 78-78: markdownlint-cli2 (markdownlint) MD049/emphasis-style Emphasis style [Expected: asterisk; Actual: underscore]

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.dev/features/regress-stage/REVIEW.md at line 78, The REVIEW.md markdown has
emphasis written with underscores instead of asterisks, causing the markdownlint
MD049 failure. Update the affected emphasized phrases in this file to use
*emphasis* syntax, and keep the existing wording intact. After making the
markdown style change, run npx prettier --write on the same file to satisfy the
prettier --check failure.

Comment thread .dev/features/regress-stage/SHIP.md Outdated
Comment thread .dev/features/regress-stage/VERIFY.md Outdated
Comment on lines +18 to +29
### Honest note — the `format:check` gate (transparency, not hidden)

On the first pass `format:check` exited **1**: the three files authored during this pipeline run —
`.claude/commands/pharn-regress.md` (the deliverable), and the audit scaffolding
`.dev/features/regress-stage/GRILL.md` + `regression-report.json` — were not yet prettier-formatted (they
were hand-written). Every prior committed pipeline output on `main` is prettier-clean, so a clean build must
leave these files formatted. The fix was the **deterministic formatter** `npx prettier --write` on exactly
those three files (content-preserving — whitespace/wrapping only; `regression-report.json`'s data, incl.
`verdict: "no-regressions"`, is byte-equivalent). The gates were then re-run on the clean output and the
verdict above is that **true** re-computed result — not a judgment override. `check-verify.mjs` recomputes
`PASS iff every gate == 0`; it cannot be faked.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Update honest note to include VERIFY.md formatting.

The note lists three files that were prettier-formatted, but VERIFY.md itself also required formatting (per the pipeline's prettier --check failure). Update the note to include this file, or rephrase to indicate that all hand-written audit outputs in the run needed formatting.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.dev/features/regress-stage/VERIFY.md around lines 18 - 29, The honest note
is incomplete because it lists only three prettified outputs, but the VERIFY.md
document itself also needed formatting. Update the `format:check` explanation so
it explicitly includes VERIFY.md in the set of files fixed by `npx prettier
--write`, or rephrase the paragraph to say all hand-written audit outputs from
the run were formatted. Keep the rest of the `check-verify.mjs` / `verdict:
"no-regressions"` explanation unchanged.

@PrzemekGalarowicz PrzemekGalarowicz merged commit 4e508ab into main Jul 1, 2026
5 of 6 checks passed
@PrzemekGalarowicz PrzemekGalarowicz deleted the regress-stage branch July 1, 2026 09:59
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