Skip to content

Bind a Canonical Sweep Record to the Reviewer's Report Instead of a Typed Count - #4380

Merged
ptr727 merged 5 commits into
developfrom
burndown/canonical-sweep-report-binding
Nov 24, 2026
Merged

ptr727 merged 5 commits into
developfrom
burndown/canonical-sweep-report-binding

Conversation

@ptr727

@ptr727 ptr727 commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner

Summary

scripts/canonical_review.py record took a caller-typed --findings count for each carried-content sweep pass. That count was bound to nothing the reviewer produced, the defect #3699 removed from scripts/local_review.py record. This applies the maintainer's answer on decision #3815 (option 1): bind each sweep pass to the reviewer's report file, reusing local_review's report reader rather than duplicating it.

  • record drops --findings. For each --unit, it reads the report with local_review.read_report, against the full unit digest. scripts/local_review.py is unchanged.
  • The report sits in the git directory beside local_review.py's own, under a canonical-review-report. prefix of its own. That engine's prune therefore never deletes a unit report not yet recorded. The name is keyed by a sha256 over the unit key and its digest, since a generated include gives several skill sections identical text, and so one digest. The hex key also keeps the colon of sha256: out of the file name, which Windows does not allow. A record prunes only the unit reports written for text no unit holds any more.
  • It refuses a unit whose report is absent or names another digest. While any unit it was given is refused, it records none of them. Each ledger entry stores the derived findings count and the report's reportSha256, the field local_review.py's receipt already uses.
  • A new read-only report-path --unit '<key>=<digest>' subcommand names each unit's report path as JSON. It refuses an unknown unit or a moved digest before a reviewer spends a pass on it.
  • The typed count is gone from the module docstring, the sweep issue's printed commands, the local-strict-review Skill's "The Carried-Content Sweep" (its brief now carries the report contract), its generated copies, and scripts/README.md.
  • Tests cover a record with no report, a record with one (its count and sha256), a header-only report, a report for another digest, a multi-unit record with one report missing, two units of identical text each taking their own report, the prune keeping a still-recordable report, a rejected --findings, and report-path.

reports/canonical-review.json is not touched. Entries recorded from now on carry one added reportSha256 key, and no reader of the ledger checks its keys beyond unit and digest.

Open findings from the local pass (edit budget spent)

  • scripts/canonical_review.py prune_unit_reports, introduced: the keep set calls unit_report_path once per carried unit, and each call runs local_review.git_dir, one git rev-parse per unit on every record. Fixed: the keep set now holds file names from a pure unit_report_name, and the directory is read once.
  • scripts/canonical_review.py unit_report_path and prune_unit_reports, introduced (design, reuse before building): they mirror local_review.report_path and local_review.prune_reports with another prefix rather than extending them. Declined. Extending them means editing scripts/local_review.py, which a concurrent change holds and which this one reuses unchanged by design. The report contract itself, local_review.read_report, is reused, which is what decision Decide: Should canonical_review.py record Bind a Sweep Pass to the Reviewer's Report Rather Than a Typed Count #3815 asked for. What is mirrored is a one-line path join and a three-line glob loop with a different keep rule, a set of current units against one path.
  • .agents/skills/local-strict-review/SKILL.md "The Carried-Content Sweep" brief, introduced: this change bound the report to the sweep worktree's git directory, but the brief named no worktree to read the unit in. So a reviewer starting in another checkout could read other text and still write a report record accepts. Fixed: the brief carries the same Worktree: line the diff pass's brief does.

Closes on promotion: #3804

🤖 Generated with Claude Code

ptr727 and others added 3 commits November 23, 2026 15:59
canonical_review.py record took a caller-typed --findings count, bound
to nothing the reviewer produced. It now reads each unit's report with
local_review.py's own reader at the path the new report-path command
names, keyed by the unit's digest. It refuses a unit whose report is
absent or names another digest, records none of its units while any is
refused, and stores each report's sha256 beside the derived count.

The typed count is gone from the module, the sweep's printed command,
the local-strict-review skill, and scripts/README.md.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A unit digest hashes the unit's text alone, so two units of identical
text, which a generated include gives two skills, shared one report
path. One reviewer's report could then overwrite the other's, or record
a unit whose own reviewer had not finished. The path is now keyed by a
hash over the unit key and its digest.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Unit reports shared local_review.py's report prefix, so recording a
diff pass pruned every unit report not yet recorded, and left that
engine's statement of why it prunes false for them. They now take a
prefix of their own, and a canonical record prunes only the unit
reports written for text no unit holds any more.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI lite review requested due to automatic review settings November 24, 2026 00:12
@ptr727

ptr727 commented Nov 24, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head 94f623ee6de7bcc65c36a68982cbdd5f8abf3591, the content this pull request carries at that commit against develop, and it recorded 2 findings.

@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

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 2 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

Commits

Reviewing files that changed from the base of the PR and between 469af7d and 9a0bd2f.

Files ignored due to path filters: 3

  • .claude-plugin/fleet-skills/.source-digests/local-strict-review is excluded by !.claude-plugin/fleet-skills/**
  • .claude-plugin/fleet-skills/skills/local-strict-review/SKILL.md is excluded by !.claude-plugin/fleet-skills/**
  • .github/skills/local-strict-review/SKILL.md is excluded by !.github/skills/**
Files selected for processing: 4

  • .agents/skills/local-strict-review/SKILL.md
  • scripts/README.md
  • scripts/canonical_review.py
  • tests/test_canonical_review.py
  • Autofix · 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

The prune's keep set built each unit's full path, and each build ran
`git rev-parse`, one process per carried unit on every record. The keep
set now holds file names from a pure name helper, compared against the
directory read once.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Active findings remain, including a critical stale-report acceptance bug that can record results before the current reviewer completes, plus duplicated lifecycle logic and repeated git-directory resolution.

3 open issues
What changed in this PR

This pull request binds canonical-content sweep records to reviewer-produced report files instead of caller-supplied finding counts, aligning canonical sweeps with the existing local_review.py report contract.

Changes:

  • Adds report-path, digest validation, report-derived finding counts, and reportSha256 ledger entries.
  • Adds per-unit report naming and pruning that supports identical content across multiple units.
  • Updates tests, documentation, and all generated local-strict-review Skill distributions.
File Description
tests/​test_canonical_review.py Adds coverage for report-backed recording, digest validation, report hashing, pruning, duplicate content, and the revised CLI.
scripts/​README.md Documents the updated canonical review commands and reviewer report workflow.
scripts/​canonical_review.py Implements report-backed recording, per-unit report paths, validation, hashing, and pruning.
.github/​skills/​local-strict-review/​SKILL.md Updates the generated local-strict-review Skill instructions for the report-backed canonical sweep.
.claude-plugin/​fleet-skills/​skills/​local-strict-review/​SKILL.md Updates the generated Claude Skill instructions for the revised canonical sweep workflow.
.claude-plugin/​fleet-skills/​.source-digests/​local-strict-review Updates the source digest for the regenerated local-strict-review Skill.
.agents/​skills/​local-strict-review/​SKILL.md Updates the authored local-strict-review Skill instructions to use reviewer reports during canonical sweeps.

Review effort: Lite

Comment thread scripts/canonical_review.py Resolved
Comment thread scripts/canonical_review.py Resolved
Comment thread scripts/canonical_review.py Resolved
The sweep brief binds the report to the sweep worktree's git directory
but named no worktree to read the unit in. A reviewer starting in
another checkout could read other text and still write a report that
`record` accepts. The brief now carries the same Worktree line the diff
pass's brief does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ptr727

ptr727 commented Nov 24, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head 9a0bd2f942f4098b129f6676e2af647ad27f6e65, the content this pull request carries at that commit against develop, and it recorded 0 findings.

@codecov

codecov Bot commented Nov 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.35%. Comparing base (b38e084) to head (9a0bd2f).
⚠️ Report is 310 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4380      +/-   ##
===========================================
- Coverage    81.60%   79.35%   -2.26%     
===========================================
  Files           26       45      +19     
  Lines         9070    16046    +6976     
===========================================
+ Hits          7402    12734    +5332     
- Misses        1668     3312    +1644     
Flag Coverage Δ
python-3.13 79.35% <100.00%> (-2.26%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ptr727

ptr727 commented Nov 24, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@ptr727

ptr727 commented Nov 24, 2026

Copy link
Copy Markdown
Owner Author

/review

@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@ptr727
ptr727 merged commit 9f6d1a1 into develop Nov 24, 2026
14 checks passed
@ptr727
ptr727 deleted the burndown/canonical-sweep-report-binding branch November 24, 2026 00:40
ptr727 added a commit that referenced this pull request Nov 24, 2026
…, Shared Run Deadline, and Second-Shell Paste-Safe (#4388)

Promotes the ten pull requests that landed on develop since the last
promotion: backlog burndown round 5, plus #4374 and #4376.

- #4374: Quote the last paste-safe placeholders and run the check in the
local block (the #1615 remainder).
- #4376: Declare host-secrets for HomeAutomation-Config in the registry.
- #4378: GOVERNANCE.md "Verification Discipline" requires the whole test
suite before every push. The Husky hook bullet says it passes the staged
paths to the prose gate. The `pr-review-conduct` Merge Gate names the
rate-limit `success` check trap, the only part of #1298 kept per the
maintainer's 2026-11-23 answer.
- #4379: `validate-task.yml` fails a promotion when main's first-parent
chain since the previous promotion holds a single-parent commit, an
accidental squash into main. The conflicted-promotion cut and the squash
recovery are documented in `branching-and-release-model`, and `drive-pr`
points at them.
- #4380: `canonical_review.py record` binds each unit's pass to the
reviewer's written report rather than a typed `--findings` count.
- #4381: Every argument refusal in the `host-setup/linux` scripts exits
64 through `die_usage`, and an EXIT trap maps a stray 64 to 1. The
contract is stated in CODESTYLE.md "Command-Line Arguments".
- #4382: The prose gate's `paste-safe` rule reads the string handed to
`su`/`runuser -c`, a POSIX shell's `-c`, and `ssh`. This edits
`host-setup/agent-safety/README.md` (two example loops only), which the
maintainer approved and merged on 2026-11-24.
- #4384: `upstream-contribution-workflow` says what a refused lease push
on the dirty branch means. `audit-a-repo` carries the convention-layout
note on its `--checkout` path.
- #4385: Every timed captured run in the review and install tooling goes
through one shared `scripts/run_deadline.py`, so a captured timeout
holds its deadline on Windows.
- #4386: The canonical `.editorconfig` sets every IDE code-style rule to
`warning`, per the maintainer's strictest-defaults answer, and the
`dotnet-codestyle` skill now agrees with the rules it enforces.

## Owed by the maintainer before rollout

- A fleet resync is owed, because carried text changed: GOVERNANCE.md,
CODESTYLE.md, `.editorconfig`, the reusable `validate-task.yml`, and
several skills.
- Every carrying C# repository has to fix its code at its next
`.editorconfig` resync (#4386). The rules likely to fire most are
IDE0058, IDE0046, IDE0210, IDE0290 and IDE0047/IDE0048.
- HomeAutomation-Config#1466 can adopt the exit-64 contract once this is
released.
- #4379 keeps the `048a442f` floor your decision named, but the walk
always stops at a later promotion merge, so the floor is never reached.
Whether to drop it is your call.

Fixes #1615
Fixes #2280
Fixes #3820
Fixes #1298
Fixes #2510
Fixes #4373
Fixes #3804
Fixes #3605
Fixes #4375
Fixes #4345
Fixes #3854
Fixes #1842

🤖 Generated with [Claude Code](https://claude.com/claude-code)
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.

2 participants