Skip to content

chore: enforce CI/local parity and close the test.sh bypass - #187

Merged
st0nefish-ci[bot] merged 1 commit into
masterfrom
chore/close-ci-parity-gaps
Aug 29, 2026
Merged

chore: enforce CI/local parity and close the test.sh bypass#187
st0nefish-ci[bot] merged 1 commit into
masterfrom
chore/close-ci-parity-gaps

Conversation

@St0nefish

Copy link
Copy Markdown
Owner

Follow-up to #186, closing three gaps of the same silent-drift shape that PR was meant to eliminate.

1. CI bypassed the test aggregator

The workflow ran bash tests/test.sh while the docs and validate-all.sh ran bash test.sh. Those are not the same thing: the top-level script is the aggregator — it already parses pytest and cargo output and is built to register more than one suite root.

A second suite root added to test.sh would have run locally and silently never run in CI. Pointed CI at bash test.sh.

2. Nothing enforced the parity validate-all.sh claims

Its header asked humans to keep its list in step with the workflow. That convention is exactly what rotted last time — CLAUDE.md said "four checks", CI ran five, and the missing one had no local equivalent at all.

check-ci-parity.sh extracts the workflow's check commands and fails if validate-all.sh doesn't run each. Wired in from both directions: as a check inside validate-all.sh, and as a step in the CI plugin-structure job.

3. pre-commit didn't catch the mock recursion pattern

Added the cheap command git|gh|tea grep over tests/. The full shellcheck pass takes ~8s — too slow to put on every commit — so it stays in CI and lint-shell.sh.

Test plan

  • Parity check catches real drift, not just passes. Reverted CI to bash tests/test.sh and confirmed it reports MISSING bash tests/test.sh and exits 1; restored, back to 5/5 ok.
  • validate-all.shsix checks, all pass
  • shellcheck --severity=error clean on the new script and the modified hook
  • pre-commit runs clean on the current tree

Three gaps left over from the previous pass, all the same silent-drift
shape it was meant to fix.

**CI bypassed the test aggregator.** The workflow ran `bash tests/test.sh`
while the docs and validate-all.sh ran `bash test.sh`. The top-level script
is the aggregator — it already parses pytest and cargo output and is built
to hold more than one suite root — so a second root added there would never
have run in CI. Point CI at `bash test.sh`.

**Nothing enforced the parity that validate-all.sh claims.** Its header
asked humans to keep its list in step with the workflow, which is precisely
the convention that rotted last time (CLAUDE.md said four checks; CI ran
five; the missing one had no local equivalent at all). Add
check-ci-parity.sh, which extracts the workflow's check commands and fails
if validate-all.sh does not run each of them. Wired into both validate-all
and the CI plugin-structure job, so it is enforced from either direction.

**pre-commit did not catch the mock recursion pattern.** Add the cheap grep
for `command git|gh|tea` under tests/. The full shellcheck pass takes ~8s,
too slow for every commit, so that stays in CI and lint-shell.sh.

Verified the parity check actually catches drift, not just passes: with CI
reverted to `bash tests/test.sh` it reports `MISSING bash tests/test.sh` and
exits 1.

validate-all.sh: six checks, all pass.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EddJxaTMXyj7o4ndrqfCxa
Copilot AI lite review requested due to automatic review settings August 29, 2026 22:19
@St0nefish St0nefish self-assigned this Aug 29, 2026
@st0nefish-ci
st0nefish-ci Bot enabled auto-merge August 29, 2026 22:19

Copilot AI 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.

🟡 Changes recommended

The new parity script and pre-commit check use GNU-only \s/--include grep/sed features that can break local validation/hooks on macOS/BSD environments.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR tightens the repo’s “CI and local validation must match” guarantee by making CI run the same test aggregator as local workflows, and by adding an automated parity check that prevents the CI workflow and validate-all.sh from drifting apart.

Changes:

  • Update CI to run bash test.sh (the top-level test aggregator) instead of bash tests/test.sh.
  • Add .github/scripts/check-ci-parity.sh and wire it into both CI and validate-all.sh to enforce CI/local check parity.
  • Extend the pre-commit hook with a fast grep-based guard against the known command git|gh|tea mock-recursion pattern.
File summaries
File Description
CLAUDE.md Documents the added parity check and clarifies why test.sh (aggregator) must be used.
.github/workflows/ci.yml Runs the aggregator (bash test.sh) and adds a CI step to enforce parity with validate-all.sh.
.github/scripts/validate-all.sh Adds the parity check as a first-class local validation step.
.github/scripts/check-ci-parity.sh New script that extracts CI “check commands” and verifies validate-all.sh includes them.
.githooks/pre-commit Adds a lightweight pre-commit guard to prevent reintroducing the command <tool> mock-recursion pattern.
Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +33 to +34
grep -oE '^\s+run: (bash [^ ]+\.sh|rumdl check \.)$' "$WORKFLOW" |
sed -E 's/^\s+run: //' | sort -u
Comment thread .githooks/pre-commit
# bypasses functions and aliases but not PATH lookup, so the mock re-executes
# itself without bound. This is the cheap grep only; the full shellcheck pass
# (~8s) stays in CI and `lint-shell.sh` rather than on every commit.
if grep -rn --include='*.sh' -E '\)\s*command (git|gh|tea) ' "$repo_root/tests/" 2>/dev/null; then
@st0nefish-ci
st0nefish-ci Bot merged commit b647e0b into master Aug 29, 2026
7 checks passed
@st0nefish-ci
st0nefish-ci Bot deleted the chore/close-ci-parity-gaps branch August 29, 2026 22:22
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