fix(guard): Gate 1 of the pre-release skill has been checking an empty directory - #2483
Closed
noahgift wants to merge 2 commits into
Closed
fix(guard): Gate 1 of the pre-release skill has been checking an empty directory#2483noahgift wants to merge 2 commits into
noahgift wants to merge 2 commits into
Conversation
noahgift
enabled auto-merge
August 14, 2026 18:14
github-merge-queue
Bot
removed this pull request from the merge queue due to no response for status checks
Aug 14, 2026
noahgift
enabled auto-merge
August 15, 2026 09:27
…y directory
`check_package_includes.sh` is the CB-510 guard: a Cargo.toml `exclude` pattern
can strip an `include!()` target from the published crate while git still tracks
it, so the crate compiles in-tree and fails for everyone installing from
crates.io. That has shipped twice -- `models/` matching `src/models/`, and an
unanchored `"tests/"` dropping 443 files from published aprender-serve in 0.63.0.
It scanned `src/` and packaged `-p aprender`: the PRE-MONOREPO layout. After
consolidation the root `src/` holds 2 files with zero `include!()`, while 1798
live under `crates/`. So it reported, truthfully and uselessly:
OK: All 0 include!() files are included in cargo package
Zero of zero, exit 0, for every release since the consolidation -- while being
Gate 1 of `.claude/skills/pre-release/SKILL.md`.
It now enumerates publishable workspace crates from `cargo metadata`, resolves
every `include!()` against the including file's directory, and diffs against that
crate's OWN `cargo package --list`. 10 crates, 1539 include targets. A vacuity
assertion fails below 100 targets, so the empty-scan mode cannot return.
RESULT: the tree is CLEAN. Every one of the 1539 targets survives packaging.
Three bugs of my own, each caught by a mutation that refused to turn red. Worth
recording because each produced a confident wrong answer:
1. `cargo package` inside `while read ... <<< "$pkgs"` consumed the heredoc on
stdin. The scan silently dropped a crate (11 -> 10) AND compared one crate's
include targets against another crate's listing, inventing a CB-510 violation
on src/bench/backend.rs. Fixed with `< /dev/null`.
2. One forked `grep -qxF` per target -- 922 for aprender-serve alone -- treating
ANY non-zero as "not packaged". grep exits >1 on ERROR, and a forked grep can
die under load, so the guard named a different innocent file on each run.
3. Replacing that with python, I put a heredoc script AND a `<<<` data
redirection on the same call. Last redirection wins, so python received the
include list as its SCRIPT and printed nothing. The guard then PASSED a
mutation that provably dropped a file from the package -- I had written
another gate that cannot fail, inside the fix for a gate that cannot fail.
Both inputs now go through explicit files.
Mutation-verified, with the mutation itself proven to engage first
(`cargo package --list | grep -c` goes 1 -> 0 before the guard is consulted):
* exclude "src/bench/" -> RED, 27 files named
* scan a nonexistent dir -> RED on vacuity
* restored -> GREEN
Wired into the merge-blocking guard block. bashrs 0 errors; the three embedded
python fragments moved to scripts/lib/ because bashrs parses an inline heredoc as
shell (8 phantom SC1007s from python assignments, 2 SC1078s from nested quotes
across a line continuation).
Refs #2481, #2474
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
noahgift
force-pushed
the
fix/vacuous-guards
branch
from
August 15, 2026 09:30
d453084 to
57fb82a
Compare
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Aug 15, 2026
noahgift
enabled auto-merge
August 16, 2026 10:59
Conflict in ci.yml's guard block only. Every guard PR appends steps to that one block, so its conflicts are structural rather than semantic and they are ADDITIVE: taking either side silently drops the other branch's gates, which is precisely how a guard stops running without anyone editing it. Both sides kept, main's first. Verified by parsing the YAML and counting the steps rather than by reading the diff.
This was referenced Aug 16, 2026
auto-merge was automatically disabled
August 18, 2026 16:52
Pull request was closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
check_package_includes.shis the CB-510 guard: a Cargo.tomlexcludepatterncan strip an
include!()target from the published crate while git still tracksit, so the crate compiles in-tree and fails for everyone installing from
crates.io. That has shipped twice --
models/matchingsrc/models/, and anunanchored
"tests/"dropping 443 files from published aprender-serve in 0.63.0.It scanned
src/and packaged-p aprender: the PRE-MONOREPO layout. Afterconsolidation the root
src/holds 2 files with zeroinclude!(), while 1798live under
crates/. So it reported, truthfully and uselessly:Zero of zero, exit 0, for every release since the consolidation -- while being
Gate 1 of
.claude/skills/pre-release/SKILL.md.It now enumerates publishable workspace crates from
cargo metadata, resolvesevery
include!()against the including file's directory, and diffs against thatcrate's OWN
cargo package --list. 10 crates, 1539 include targets. A vacuityassertion fails below 100 targets, so the empty-scan mode cannot return.
RESULT: the tree is CLEAN. Every one of the 1539 targets survives packaging.
Three bugs of my own, each caught by a mutation that refused to turn red. Worth
recording because each produced a confident wrong answer:
cargo packageinsidewhile read ... <<< "$pkgs"consumed the heredoc onstdin. The scan silently dropped a crate (11 -> 10) AND compared one crate's
include targets against another crate's listing, inventing a CB-510 violation
on src/bench/backend.rs. Fixed with
< /dev/null.grep -qxFper target -- 922 for aprender-serve alone -- treatingANY non-zero as "not packaged". grep exits >1 on ERROR, and a forked grep can
die under load, so the guard named a different innocent file on each run.
<<<dataredirection on the same call. Last redirection wins, so python received the
include list as its SCRIPT and printed nothing. The guard then PASSED a
mutation that provably dropped a file from the package -- I had written
another gate that cannot fail, inside the fix for a gate that cannot fail.
Both inputs now go through explicit files.
Mutation-verified, with the mutation itself proven to engage first
(
cargo package --list | grep -cgoes 1 -> 0 before the guard is consulted):Wired into the merge-blocking guard block. bashrs 0 errors; the three embedded
python fragments moved to scripts/lib/ because bashrs parses an inline heredoc as
shell (8 phantom SC1007s from python assignments, 2 SC1078s from nested quotes
across a line continuation).
Refs #2481, #2474
Co-Authored-By: Claude Opus 5 noreply@anthropic.com