Skip to content

Add spec-delta: baseline comparison for the Gate-B reviewer (vision 2c, part 3) - #37

Merged
dsnger merged 6 commits into
mainfrom
spec-delta
Oct 4, 2026
Merged

dsnger merged 6 commits into
mainfrom
spec-delta

Conversation

@dsnger

@dsnger dsnger commented Oct 3, 2026 •

Copy link
Copy Markdown
Owner

What

scripts/spec-delta.py covers vision step 2c, part 3. Daniel narrowed it on 2026-10-03 to an explicit baseline comparison. For every relevant spec and plan, a Gate-B reviewer sees the change from a baseline commit the caller names (usually the Gate-A closing commit) to the candidate.

Relevant artifacts are:

  • changed plans and specs;
  • the specs a contributing plan's header cites;
  • every --spec and --baseline path.

For each baseline, the report quotes that commit's cycle records verbatim. It names any ambiguity: no matching record, several cycles, several same-kind files, or a likely squash. It claims no review attribution, because no record names the file a cycle reviewed. A missing baseline stays visibly unknown.

The report informs and obliges nothing: no gate rule, pass rule or record format changes. It writes nothing and is not shipped.

python3 -B scripts/spec-delta.py --base <baseSha> [--plan <path>]… [--spec <path>]… --baseline <commit>:<path>… [<head>]

scripts/spec-delta.test.sh (16 cases) is now in the quality row, the lint row and CI. This PR's own Gate B carried the report as its input, which is story criterion 4.

Also in this PR: P5 light is marked "trigger met, ready for intake" in todos.md. That covers the IDs only; G1b and 4e are not activated. Daniel decided on 2026-10-03 to rank P5 against part 4 after this part.

  • Story: docs/superpowers/stories/2026-10-03-spec-delta-for-gate-b-story.md, narrowed with a dated fate table.
  • Spec: docs/superpowers/specs/2026-10-03-spec-delta-design.md.
  • Plan: docs/superpowers/plans/2026-10-03-spec-delta.md.

Review record

  • Gate A spec, cycle 7mdof8i8pb: 4 passes, Majors 8,4,4,0 (7a36b80). Pass 1 led to the scope decision.
  • Gate A plan, cycle i0rng7770i: 4 passes, Majors 9,5,1,0 (8b52829).
  • Gate B, cycle hc7bzri2yb: 3 passes, Majors 1,0,0.

What no check covers

  • Which file a Gate-A cycle reviewed.
  • Signature suppression: testing it needs a signing key.
  • Collected Minors: docs/./superpowers header spellings, and filename bytes that are not UTF-8.

Summary by CodeRabbit

  • New Features
    • Added a read-only report that compares selected specs and plans with explicitly specified baselines, showing changes, relevant review records, and cases where the comparison is unknown.
  • Documentation
    • Documented how to run the report and its limits, and added its design and review guidance.
  • Quality
    • Added regression tests and included the suite in CI checks.
    • Updated repository guidance to reflect the additional report suite and Git version requirement.

dsnger added 5 commits October 3, 2026 15:23
…rt 3)

A read-only report shows the Gate-B reviewer, for every relevant spec and
plan, the change from an explicitly given baseline to the candidate. It
quotes the baseline commit's cycle records verbatim, names any ambiguity,
and claims no review attribution. A missing baseline stays visibly
unknown. Pass 1 led to Daniel narrowing the scope on 2026-10-03 (47db446).

cycle 7mdof8i8pb; floor 3 per {docs/superpowers/stories/2026-10-03-spec-delta-for-gate-b-story.md (level 1)}; hook reminder threshold absent
cycle 7mdof8i8pb; Gate-A spec (passes 1-4, gpt-6-astra): Findings 13,9,8,6. Blockers 0,0,0,0. Majors 8,4,4,0.
The plan embeds the tested report, its POSIX-sh suite (16 cases) and the
docs/CI edit script, plus twelve rulings where it settles what the closed
spec left open.

cycle i0rng7770i; floor 3 per {docs/superpowers/stories/2026-10-03-spec-delta-for-gate-b-story.md (level 1)}; hook reminder threshold absent
cycle i0rng7770i; Gate-A plan (passes 1-4, gpt-6-astra): Findings 16,8,4,2. Blockers 0,0,0,0. Majors 9,5,1,0.
…e B (vision 2c, part 3)

scripts/spec-delta.py shows a Gate-B reviewer, for every relevant spec and
plan, the change from an explicitly given baseline commit to the
candidate. Relevant artifacts are changed plans and specs, the specs a
contributing plan's header cites, and every --spec and --baseline path.
For each baseline, the report quotes that commit's cycle records verbatim
and names any ambiguity: no matching record, several cycles, several
same-kind files, or a likely squash. It claims no review attribution. A
missing baseline stays visibly unknown. The report writes nothing and
informs without obliging. scripts/spec-delta.test.sh (16 cases) joins the
quality and lint rows, CI and the inventories in AGENTS.md and README.md.

Evidence — docs/superpowers/stories/2026-10-03-spec-delta-for-gate-b-story.md
Battery: AGENTS.md quality row, exit 0 at f8b8e3541428872828f2e4d6a166de7ee426b4fe.
Check (counterfactual): at 7a36b80 no report exists (git ls-tree prints nothing).
Negative control in the suite: a copy that reads every **Spec:** line picks up a task-level
reference, and the suite catches it. Suite 16/16 under sh (in the quality row) and under dash.
Real Gate-B input: python3 -B scripts/spec-delta.py --base 8b52829 --plan docs/superpowers/plans/2026-10-03-spec-delta.md --baseline 7a36b80:docs/superpowers/specs/2026-10-03-spec-delta-design.md --baseline 8b52829:docs/superpowers/plans/2026-10-03-spec-delta.md f8b8e3541428872828f2e4d6a166de7ee426b4fe — exit 0; "artifacts 2: no change 2". Gate-B passes 2 and 3 carried this output in additionalContext; pass 1 carried the same invocation's output for its own head.

cycle hc7bzri2yb; floor 3 per {docs/superpowers/stories/2026-10-03-spec-delta-for-gate-b-story.md (level 1)}; hook reminder threshold absent
cycle hc7bzri2yb; Gate B (passes 1-3, gpt-6-astra): Findings 3,2,1. Blockers 0,0,0. Majors 1,0,0.

Each logical pass is one reviewType full call. Pass 1 ran against
8b52829.../8eb984f...; its Major (a ./ header citation was dropped) and a
Minor (newlines in file names) were fixed by an amend. Passes 2 and 3 ran
against 8b52829.../f8b8e35....
@coderabbitai

coderabbitai Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 42 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0d35a706-1379-460a-b4cf-5a0457f1f805
📥 Commits

Reviewing files that changed from the base of the PR and between c12a412 and 3adcbbc.

📒 Files selected for processing (2)
  • scripts/spec-delta.py
  • scripts/spec-delta.test.sh

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 30f71700-b96f-40ad-9f27-cead4fc11e9b
📥 Commits

Reviewing files that changed from the base of the PR and between 712c3ff and c12a412.

📒 Files selected for processing (9)
  • .github/workflows/ci.yml
  • AGENTS.md
  • README.md
  • docs/superpowers/plans/2026-10-03-spec-delta.md
  • docs/superpowers/specs/2026-10-03-spec-delta-design.md
  • docs/superpowers/stories/2026-10-03-spec-delta-for-gate-b-story.md
  • scripts/spec-delta.py
  • scripts/spec-delta.test.sh
  • todos.md

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

Adds a read-only CLI that compares selected specs and plans at explicit baseline commits with a candidate commit. It reports Gate-A records, ambiguity, artifact states, and diffs. A fixture-based regression suite and repository guidance, documentation, and CI updates support the report.

Changes

Spec Delta Report

Layer / File(s) Summary
Report contract and scope
docs/superpowers/stories/*, docs/superpowers/specs/*, docs/superpowers/plans/2026-10-03-spec-delta.md
The story, design, and plan specify artifact selection, explicit baselines, Gate-A metadata checks, report states, and attribution limits. Missing baselines remain unknown.
CLI, discovery, and report generation
scripts/spec-delta.py
The CLI validates paths and refs, discovers relevant plans and specs, checks baseline records, and reports artifact states and diffs. It controls Git environment settings and fails on required-read errors.
Regression suite and CI validation
scripts/spec-delta.test.sh, .github/workflows/ci.yml, AGENTS.md, docs/superpowers/plans/2026-10-03-spec-delta.md, docs/superpowers/specs/2026-10-03-spec-delta-design.md
The shell suite checks fixture reports, no-write behavior, Git configuration isolation, and failure cases. CI lints and runs the suite. The plan and design describe test coverage.
Repository guidance and Gate-B procedure
AGENTS.md, README.md, docs/superpowers/plans/2026-10-03-spec-delta.md
Repository inventories and quality guidance include the report and suite. The README documents report usage. The plan records the Gate-B evidence and closeout procedure.

P5 Light Intake Update

Layer / File(s) Summary
P5 light status
todos.md
The entry records the trigger date and stable-ID intake scope. It keeps G1b and vision leaf 4e inactive and defers ranking.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  actor Reviewer as Gate-B reviewer
  participant Report as spec-delta.py
  participant Git as Git repository
  participant Parser as ledger-metrics.py
  Reviewer->>Report: Provide artifact paths, baselines, and optional head
  Report->>Git: Resolve refs and read artifact history
  Report->>Parser: Load Gate-A record parser
  Parser-->>Report: Parsed cycle records
  Report->>Git: Read baseline and candidate content
  Report-->>Reviewer: Print artifact states, records, and diffs
Loading

Merge Risk: ⚪ Minimal · up to c12a4

No actionable merge-blocking issue was established for the report; it is ready for normal merge checks.

Security Architecture Review

Security architecture risk: 🔵 Low · up to c12a4

The report remains advisory and limits revision and path inputs before invoking Git. The inspected CI configuration does not grant additional privileges. Residual uncertainty concerns execution from untrusted checkouts and environments outside this repository’s CI configuration.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • observed — Explicit inputs can select normalized repository-relative blobs beyond the automatically discovered documentation set. Their contents flow to stdout. The sibling parser executes in the invoking process and therefore shares its environment and filesystem authority; this is a checkout-code trust requirement, not a data-only parsing sandbox.

Trust Boundaries and Controls

  • observed — Caller-selected revisions and paths enter Git as arguments rather than shell code. Revisions are resolved with end-of-options protection; paths are normalized and delimited. Centralized Git execution strips selector and trace overrides, disables replacement objects, and disables external diff and text conversion for displayed diffs.
  • observed — The inspected CI workflow grants contents-read permission, disables persisted checkout credentials, and supplies no explicit secret environment to the step executing the report suites. The supplied changed ranges do not alter those authority controls.

Resilience and Maintainability Implications

  • inferred — The reported test-helper fanout remains within fixture execution. Unique temporary directories isolate concurrent invocations, rebuilds reset fixture state, and ordinary exit removes it. Abrupt interruption may leave temporary fixtures behind, but the inspected lifecycle does not establish exposure of credentials or production state.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 24.24% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 33 functions across 2 files. (7 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: adding a baseline-comparison report for Gate-B reviewers.
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.
Full details: Docstring Coverage

Explanation

Docstring coverage is 24.24% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 33 functions across 2 files. (7 skipped: 7 unsupported.)

✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

I’m a rabbit with a baseline to compare,
I nibble through the specs with care.
Changed leaves, unchanged leaves, each gets a name,
The cycle records join the game.
No files are written as I hop away,
And tests keep watch along the way.

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

@greptile-apps

greptile-apps Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Medium risk] Adds a new read-only reporting script and its test suite.

The PR appears safe to merge; no outstanding finding or new actionable issue remains.

Summary

The PR adds a read-only Gate-B report comparing relevant specs and plans with caller-supplied baselines, documents its limits, and adds a regression suite to CI. The latest changes preserve non-UTF-8 filename bytes during Git path discovery and rename matching; the suite passes all 16 checks.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Base and candidate commits] --> C[Relevant specs and plans]
  B[Explicit artifact baselines] --> D[Baseline records and ambiguity]
  C --> E[Artifact report]
  D --> E
  E --> F[Gate-B reviewer]
Loading

Reviews (2) · Last reviewed commit: "Keep non-UTF-8 file names intact in spec..."

Comment thread scripts/spec-delta.py Outdated
Comment thread docs/superpowers/plans/2026-10-03-spec-delta.md
git's NUL-delimited path lists are now decoded with os.fsdecode, so a
changed spec whose name is not valid UTF-8 keeps its bytes. It can be
looked up again and deduplicated against a --baseline for the same path.
The output escapes it. The suite adds such a spec, written through the
index, with a baseline.

Evidence — docs/superpowers/stories/2026-10-03-spec-delta-for-gate-b-story.md
Battery: AGENTS.md quality row, exit 0 at 5aeb3b66d2d64816441d46baaf57d17eaacee466.
Check (counterfactual): with scripts/spec-delta.py from c12a412, the extended fixture's report
differs (the non-UTF-8 spec appears twice, once with a replaced name), and the report case fails;
with the fix, 16/16 under sh and dash.
Real Gate-B input: python3 -B scripts/spec-delta.py --base c12a412 --plan docs/superpowers/plans/2026-10-03-spec-delta.md --baseline 7a36b80:docs/superpowers/specs/2026-10-03-spec-delta-design.md --baseline 8b52829:docs/superpowers/plans/2026-10-03-spec-delta.md 5aeb3b66d2d64816441d46baaf57d17eaacee466 — exit 0; "artifacts 2: no change 2".

cycle 0yfsl8xv5o; floor 3 per {docs/superpowers/stories/2026-10-03-spec-delta-for-gate-b-story.md (level 1)}; hook reminder threshold absent
cycle 0yfsl8xv5o; Gate B (passes 1, gpt-6-astra): Findings 0. Blockers 0. Majors 0.

The single logical pass was one reviewType full call against
c12a412.../5aeb3b6...; both branches found nothing: the zero-finding exit.
@dsnger
dsnger merged commit b18e7db into main Oct 4, 2026
3 checks passed
@dsnger
dsnger deleted the spec-delta branch October 4, 2026 08:16
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