Repository navigation
Conversation
## Summary `gh-write-guard.py` stripped only the first heredoc body a line opens, while bash reads every body a line opens, in order, before the next command. A line such as `cat <<A <<B` therefore left B's body to be read as commands, and a heredoc opener inside it could swallow a real wait loop after it, so the wait-loop rule never judged that loop. - `host-setup/agent-safety/claude/gh-write-guard.py`: a line opening several heredocs is read as opening its first alone (the old reading) and, where the bodies close, as opening each in order through the last data body, keeping a fed-to-a-shell body before it whole. A line holding `((` or `$[` is read as opening nothing, plus each `<<` alone and each with every later one whose body closes. - New `--selftest` rows pin the #2112 command, both `((` shapes it names, a fed body before a data body, a heredoc inside `$(` and a backquote, a `$[` shift, a quoted `<<` after a real heredoc, and five empty bodies on a `((` line. The deny rows fail on develop. - `host-setup/agent-safety/README.md`: the rule's paragraph restated to match. ## Known follow-ups Decision #2126 shipped this change as it stands, with the findings its third local review pass raised filed rather than fixed: #2198, #2199, and #2200. The fresh local review pass run before this pull request raised two more, filed the same way as #2201 (a false deny, the safe direction, like #2199) and #2202 (a shape develop also allows, so not a regression). None of them makes this branch allow a command develop denies. ## Verification - `python3 host-setup/agent-safety/claude/gh-write-guard.py --selftest` passes. - `python3 -m unittest discover -s tests` passes (1879 tests). - ruff check and format, mypy, `scripts/prose_lint.py --diff origin/develop`, `scripts/repo_gate.py`, and `spec/validate.py` are clean. - A local strict review pass is recorded against develop at the pushed head. Closes on promotion: #2112 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved command safety checks for heredocs combined with arithmetic shifts, including commands with multiple heredoc openers or heredoc content passed to a shell. * Commands are denied when a valid interpretation contains an unbounded wait, helping prevent unsafe commands from slipping through alternate readings. * Added coverage for these command patterns and interpretations. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
## Summary The prose gate's `charset-unknown` finding told the reader to "classify it in GOVERNANCE.md", but `GOVERNANCE.md` "Character Set" holds only a pointer to the `comment-and-doc-style` skill. The message now names the two places a classification actually goes, that skill's "Character set" section and the gate's `TIER1`, `TIER2`, and `TIER3` tables in `prose_lint.py`, and names the hub as the repository both live in, since a downstream repository runs the gate from the hub's action checkout and carries neither. - `.github/actions/prose-gate/prose_lint.py`: the message's tail moves to a `CHARSET_CLASSIFY` constant beside the tier tables and names both places. - `tests/test_prose_lint.py`: a new `TestTierTables` case pins the message text and asserts it no longer names `GOVERNANCE.md`. It fails against the old message. ## Verification - `python3 -m unittest discover -s tests`: 1880 tests, OK. - The new test fails with the fix reverted and passes with it in place. - `ruff format --check`, `ruff check`, `mypy`, `prose_lint.py . --diff origin/develop`, `repo_gate.py --check eol`, and `spec/validate.py` are clean. Closes on promotion: #2171 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Updated guidance for unclassified characters to point to the character-set guidance and classification tables instead of `GOVERNANCE.md`. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
The Linux loader's `swap_in` called `remove_owned` bare on a leftover owned `.old` tree, so an entry `rm` could not remove aborted the run with only `rm`'s own error. It now stops with the loader's message naming the `.old` path and the remedy, matching what `bootstrap.ps1` already says in the same state. A test with a locked entry in the leftover tree fails without the change. Closes on promotion: #1790 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Sonnet 5.5 <[email protected]>
## Summary
The wait-loop rule's `_redirects_stdin` scan credited a redirect written
inside a trailing comment as the loop's input bound, so `yes | while
read l; do sleep 30; done # < f` (and the `#< f` spelling) was allowed
although bash reads nothing after the `#`.
- The scan now ends at a word opening an unquoted comment, the way it
already ends at a separator or a reserved word. The quoted mask the rule
already computes says which `#` words are quoted, so `done < '#f'` still
names a file.
- A comment keeps an earlier binding only where the scan is sure it is
one: the quoting is known and no expansion that can hold a space
precedes it. Otherwise ending early skipped the later binding bash
applies, as in `< ${g:- #x} < /dev/zero`.
- A redirect whose target opens a comment has no target, so it bounds
nothing.
- A command holding a carriage return passes no mask, since the lex
splits words at one and bash does not, so `log<CR>#x` is one word rather
than a comment.
- New `--selftest` cases cover each shape. Reverting the fix with the
cases kept fails the new deny cases, and passing no mask fails the
quoted-`#` allow case.
A local strict review pass also found a pre-existing sibling, a
separator or parenthesis inside a target expansion ending the scan
early, filed as #2225.
Closes on promotion: #2152
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 5.5 <[email protected]>
Closes on promotion: #1372 `labels_payload_ok` now refuses a repeated label name (ignoring ASCII case) and an uppercase hex color, since GitHub stores colors lowercased (confirmed read-only against this repository's labels). It checks the payload in separate steps and reports each cause as itself: did not parse, not exactly one JSON document, not an array, empty, outside the field contract, repeated name, and a failing jq. `cmd_apply` and `check_labels` print that reason. Tests in `LabelsPayloadCase` use constructed payloads and fail on the old code. The comment change needs the `comments` label. Remaining gaps the local review found are filed as #2229. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Sonnet 5.5 <[email protected]>
#2232) Closes on promotion: #2149 ## Summary The header of `catalog/snippets/configs/vscode-tasks-python.json` named a coverage task the snippet does not define, and pointed at two CODESTYLE.md sections whose text now lives in the `python-codestyle` Skill. - The lint-only Scripts-profile line now names only tasks the snippet defines: it omits "uv Sync" and "uv Upgrade", and "Python Test" runs the unittest command the repository's OPERATIONS.md gives rather than pytest. The local strict review found that the earlier wording dropped the test task outright, although "Two profiles" says the lint-only profile still uses unittest for tests and runs the coverage command from OPERATIONS.md. - The "Local Development Loop" and "Two profiles" pointers now name the `python-codestyle` Skill sections, in the same form as the header's existing Skill pointer. The mypy swap lines and the "Adapt the target paths" line are left as they were, since the parked `auto-2157` lane edits them. This changes comment lines only, so it needs the `comments` label. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
…ntry (#2234) Removes the "Private for now..." sentence from PhotoCleaner's driftNotes, since the repository is public (live check: visibility PUBLIC). The multi-arch Docker sentence is unchanged. No other file in registry, spec, docs, or TODO.md describes PhotoCleaner as private. Closes on promotion: #1082 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Sonnet 5.5 <[email protected]>
## Summary - `check-this-repo` "What it checks" step 1 now reads the `live` block by its shape. A `vcs: archive` tree is the one the hub bootstrap keeps: `branch: null` there does not mean detached, a `live.commit` behind `main` or null is the finding, and re-running `bootstrap.sh --skills` or `bootstrap.ps1 -Skills` is the fix, with `--dir` or `-Dir` where the tree was kept outside the default. The git case is keyed on no `vcs` and a non-null `commit`, and every other shape is an unregistered or unreadable channel. - `merge-and-release` step 7 states that an archive live channel holds what the bootstrap fetched until the bootstrap's skills action runs again, which that step does not do. - Distributions are regenerated with `scripts/build_dist.py`, and `--check` is clean. The same framing in `docs/host-setup.md` "Fleet Skills Install" is filed as #2236. Closes on promotion: #1772 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
`backlog-burndown` "The Promotion Boundary" step 1 required a `git fetch origin` before counting `origin/main..origin/develop`, and named the stale-ref hazard, but never said what a failed fetch means. A failed fetch leaves the stale ref, the count reads zero, and the round reports nothing to promote while develop carries work. This adds one sentence telling the reader to stop and report a failed fetch rather than running `git rev-list` anyway, matching the wording the same file already uses for its `git fetch --prune origin` read in "Grouping and File Claims". The generated distributions are regenerated with `scripts/build_dist.py`. Closes on promotion: #1310 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Clarified that promotion stops and reports an error if fetching from the remote fails. * Confirmed that promotion includes all pending commits, and reports no work only when none are pending. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Co-authored-by: Claude Opus 5.5 <[email protected]>
In `--check` mode `main()` computed the include drift and then `is_stale()` computed it again, so one run rendered every include region twice. `is_stale()` now takes the drift list `main()` already holds, and falls back to walking the includes when called without one. Exit codes and messages are unchanged. A new test pins one render per include document for both a clean and a drifted tree, and fails against the previous code. Closes on promotion: #1379 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Sonnet 5.5 <[email protected]>
…ponent (#2243) ## Summary - `spec/validate.py`'s tree loop now calls `escapes_repo_root` for each tree's `source` and `target`, beside `reduces_to_repo_root`, rather than restating three of its conditions. A backslash or drive-letter spelling is now refused here as `scripts/carry.py` refuses it, and one implementation of the rule remains. - A tree `source` or `target` with a symlinked component is refused, by a new `symlinked_component` helper that walks the path's components under the root the way `scripts/carry.py`'s `relative_root` does for both fields. The existing `is_dir()` check follows a link, so before this a symlinked source validated while the carrier refused it on every host. - `tests/test_spec_validate.py` gains `TreePathGateCase`, which runs the real script against a scratch tree and pins a backslash spelling, a drive-letter spelling, and a symlinked source as refused. A control tree draws no path error, and every tree the live `spec/files.json` declares passes both checks. ## Verification - Reverting the `spec/validate.py` change fails every new refusal case. - `python3 -m unittest discover -s tests`, ruff format and check, mypy, `spec/validate.py`, the prose gate, and the EOL gate all pass. Closes on promotion: #1452 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <[email protected]>
`escapes_repo_root` in `spec/validate.py` matched a Windows drive only at the start of a value, and `relative_root` in `scripts/carry.py` matched none. Both tools walk a tree path one component at a time with `current /= part`, and on Windows joining a component that carries a drive, such as `C:x`, discards everything joined before it. A value such as `real/C:x` passed both. - `escapes_repo_root` now refuses a component whenever `PureWindowsPath(part).drive` is non-empty. That is wider than a letter, since Windows reads any character followed by a colon as a drive (`1:x`, `_:x`). - `relative_root` refuses a component whenever `PureWindowsPath(part).anchor` is non-empty, which also covers a leading backslash. That spelling resets the walk to the drive root in the same way, and `escapes_repo_root` already refuses it. - Each suite has a test refusing these values. Both tests fail when the fix is reverted. The local review pass also found that `relative_root` still accepts a backslash in the middle of a component. That gap predates this change and is filed as #2246. Closes on promotion: #2244 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
Stage 1 and stage 2 of the reusable-workflows rollout now match the fleet's ground-truth branches, each ticked box citing its adopting pull request. The TODO merge-bot entry points at the tracker instead of naming adopters. Closes on promotion: #2168 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Sonnet 5.5 <[email protected]>
## Summary `scripts/local_review.py`'s `remote_tracking_ref` read a `git show-ref --verify` failure as meaning the ref did not exist. That command also fails for a ref naming an absent object and for a symbolic ref whose target is gone. `target_ref` then fell through to the as-written step, and a local branch sharing the short name defined the review scope with no error. - A new `ref_name_exists` checks that the exact ref name exists without requiring its object to resolve. `check-ref-format` first rules out a name git would never read as a ref. Then `git for-each-ref` lists a ref naming an absent object, and a loose ref file is looked for directly through `rev-parse --git-path`, since an empty or garbage one is skipped by every listing command. Last, `git symbolic-ref -q` reads a dangling symbolic ref, which `for-each-ref` skips and a reftable store holds in no loose file. Every one of these is an old git primitive, so the change adds no git version floor. `show-ref --exists` would need git 2.43, which is why it is not used. - `remote_tracking_ref` now refuses such a ref with `CannotRun` rather than returning `None`. A loose file that cannot be checked also raises `CannotRun`, rather than an uncaught `OSError`. A ref that is genuinely absent still returns `None`, and the #1235 non-commit refusal is unchanged. - The qualified `--target` spellings in #2109 are untouched, since that issue waits on a decision. Closes on promotion: #2106 ## Verification - `DanglingRemoteTrackingCase` pins both shapes from the issue, each beside a local branch of the same short name. It also covers an empty loose ref file, a dangling symbolic ref found with the loose file hidden, an unreadable loose file as a boundary, a `..` name never looked for on disk, a nested ref not counted as the name, and an absent ref still falling through. `ReftableDanglingRemoteTrackingCase` reruns the same cases on the reftable backend and skips where git cannot create a reftable repository. - With the fix reverted, the refusal tests fail on both backends. Removing any one check in `ref_name_exists` fails the test that pins it (mutation-checked with bytecode caching off). - These pass locally: `python3 -m unittest tests.test_local_review` (111 run, 1 skipped), ruff format and check, mypy, `prose_lint.py --diff HEAD`, `repo_gate.py --check eol`, and `spec/validate.py`. - A `local-strict-review` pass ran three rounds and ended with no findings. It is recorded against `develop`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Target selection now stops when an exact remote-tracking reference exists but is invalid, instead of silently falling back to a same-named local branch. * This prevents reviews from proceeding with a potentially unintended target when a remote reference is dangling, empty, or points to a missing object. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
The wait-loop rule found a loop's `do` and `done` by command position alone. The shell tokens drop their quoting, so a quoted `";"` read as a separator and the word after it as the loop's close. `while true; do echo ";" done; sleep 1; done` therefore closed at its first `done`, the body it saw held no sleep, and the unbounded wait was allowed. `_loop_parts` now takes the quote mask `_unbounded_wait_loop` already computes, and counts a `do` or `done` only when it opens a command and neither it nor the word before it is quoted. Two self-test rows pin the two halves (a `done` after a quoted `;`, and a quoted `done`), and each fails when only its clause is removed. The local strict review raised no finding. It noted one shape that is unreachable today: a backslash-newline continuation directly before `do` or `done` lexes as a quoted newline token, which the new previous-word test would reject. `classify` folds those continuations into a space before it calls the wait-loop check, its only caller, so the hook never sees that shape. Closes on promotion: #2207 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <[email protected]>
|
ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Repository: ptr727/ProjectTemplate/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID:
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. Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2250 +/- ##
==========================================
+ Coverage 56.61% 56.84% +0.22%
==========================================
Files 16 16
Lines 7482 7519 +37
==========================================
+ Hits 4236 4274 +38
+ Misses 3246 3245 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
It is a broad promotion to the production main branch spanning security-critical agent-safety guard parsing, path validators, and config-apply scripts, which warrants final human sign-off even though no defects were found.
Review effort: Balanced
Findings: None
What changed in this PR
This is a develop → main promotion PR that carries 15 already-reviewed, already-merged pull requests. It fixes defects across the agent-safety gh-write-guard shell parser, the fleet spec/tree-path validators, the local_review ref resolution, the configure.sh label pre-flight, and various documentation/skill files. No new feature surface is introduced; these are correctness, error-message, and documentation-accuracy fixes.
Changes:
- Hardening of the
gh-write-guardwait-loop detector: multi-heredoc body stripping, a stdin-redirect scan that stops at trailing comments, and a quote-mask-aware loopdo/donefinder. - Tighter fleet path validation:
escapes_repo_rootrefuses a Windows drive in any component, a newsymlinked_componentcheck,carry.pyrefuses a drive/root in any component, andlocal_reviewrefuses a dangling remote-tracking target instead of silently falling through. - Clearer diagnostics and docs:
configure.shreports each label-payload refusal cause separately (and requires lowercase hex / case-insensitive unique names), the charset-unknown message points at where tiers live, and several skill/doc files are corrected; the generated skill trees and digests are regenerated to match.
| File | Description |
|---|---|
spec/validate.py |
Drive-in-any-component refusal + symlinked_component; tree loop now reuses escapes_repo_root (checked before the symlink walk). |
scripts/local_review.py |
Adds ref_name_exists; refuses a dangling remote-tracking ref via CannotRun. |
scripts/carry.py |
Refuses a Windows drive/root in any path component. |
scripts/build_dist.py |
is_stale(drift) reuses the precomputed include-drift, rendering the walk once per --check. |
repo-config/configure.sh |
labels_payload_ok splits refusal causes, enforces lowercase hex and CI-unique names. |
host-setup/agent-safety/claude/gh-write-guard.py |
Multi-heredoc stripping, comment-aware stdin scan, quote-mask loop boundaries; self-test rows added. |
host-setup/bootstrap.sh |
swap_in names the un-removable .old tree and aborts before the move. |
.github/actions/prose-gate/prose_lint.py |
Charset-unknown message points at the skill section and tier tables. |
host-setup/agent-safety/README.md |
Prose updated to describe the new heredoc readings. |
docs/reusable-workflows.md, TODO.md |
Rollout checkboxes/pointers updated to fleet ground truth. |
catalog/snippets/configs/vscode-tasks-python.json |
Header task names/pointers corrected. |
registry/repos.json |
Drops the stale "Private for now" PhotoCleaner drift note. |
.agents/.github/.claude-plugin skill trees + digests |
Regenerated copies of the three edited skills (check-this-repo, merge-and-release, backlog-burndown). |
tests/* |
New/updated cases for every behavior above; all pass. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Summary
Promotes develop to main, carrying the pull requests below, each already reviewed and merged into develop.
build_dist.py --checkrun.escapes_repo_rootand refuse a symlinked component.local_review.done.Closes #2112
Closes #2171
Closes #1790
Closes #2152
Closes #1372
Closes #2149
Closes #1082
Closes #1772
Closes #1310
Closes #1379
Closes #1452
Closes #2244
Closes #2168
Closes #2106
Closes #2207
🤖 Generated with Claude Code