Skip to content

feat: bulk-install-standards-check.sh and the canonical caller stub (W2) - #164

Merged
twistedmelonman merged 3 commits into
mainfrom
claude/feat-bulk-install-standards-check-019HDRKL
Sep 8, 2026
Merged

feat: bulk-install-standards-check.sh and the canonical caller stub (W2)#164
twistedmelonman merged 3 commits into
mainfrom
claude/feat-bulk-install-standards-check-019HDRKL

Conversation

@twistedmelonman

Copy link
Copy Markdown
Member

Task 1 of the W2 fleet rollout plan (dev-env docs/superpowers/plans/2026-09-08-w2-fleet-rollout.md).

Adds the canonical caller stub and the bulk-install classifier. Nothing is applied to any repo by this PR; the script's default mode is a dry run.

What lands

  • standards/caller-stub.yml — the single canonical copy of the caller. Byte-matches the README Setup block and the header comment in .github/workflows/standards-check.yml (both already agreed; verified by diff).
  • bulk-install-standards-check.sh — classifies every repo of --owners plus --extra-repos as MISSING / CURRENT / DIFFERS / IGNORED / ARCHIVED / ERROR. With --apply, writes the stub into MISSING repos only, either through a branch and PR (--mode=pr) or a Contents-API put to the default branch (--mode=push, the mechanism authorized 2026-09-08 for this one file). DIFFERS repos are reported and never touched.
  • .standards-check-ignore — seeded with nightowlstudiollc/networth-agent.
  • tests/stub-gh/gh and tests/test-bulk-install-standards-check.sh — hermetic stub-gh tests, 16 assertions, picked up by the existing tests/run-tests.sh glob.

Verification

  • tests/run-tests.sh: 0 test file(s) failed (16/16 new assertions, plus the pre-existing 9 and 11).
  • The CURRENT/DIFFERS comparison was validated against a known-bad case: reintroducing the trailing-newline asymmetry makes beta is CURRENT fail, so the assertion is load-bearing rather than vacuous.
  • shellcheck -S info clean on all three new shell files, no disable directives.
  • standards/run-standards.sh --repo . exits 0.
  • Live dry run against the real fleet: 40 MISSING, 1 DIFFERS, 1 IGNORED, 3 ARCHIVED, 0 ERROR.

smartwatermelon/github-workflows classifies as DIFFERS by design: its .github/workflows/standards-check.yml is the reusable workflow itself, not a caller stub. The self-applying caller lives in self-standards-check.yml and uses a local path. That file is deliberately unchanged.

https://claude.ai/code/session_019HDRKLQNv82SEBd4zGpcXf

Classifies every fleet repo and installs standards/caller-stub.yml where
absent, via PR (pilots) or direct put to the default branch (fleet, per
the 2026-09-08 authorization). Hermetic stub-gh tests.

Claude-Session: https://claude.ai/code/session_019HDRKLQNv82SEBd4zGpcXf
@claude

This comment has been minimized.

Two defects in bulk-install-standards-check.sh, both observed failing first.

existing_b64 discarded stderr and treated every nonzero `gh api` exit as
"the file is absent". A 403, a rate limit, or a network blip therefore read
as MISSING, and under --apply --mode=push the script would PUT the stub
onto the default branch of a repo whose real state it never learned. It now
returns 0/1/2 for content / confirmed HTTP 404 / any other failure, and the
caller reports ERROR with the message and exits 1.

install_pr assumed chore/standards-check-stub did not exist, so any retry
after a partial run died on a duplicate git/refs POST. It now reuses an
existing ref and passes the file's blob sha to the PUT when the file is
already on the branch. The branch-scoped read puts the ref in the query
string: `gh api` promotes any -f parameter to POST, which would have turned
that read into a failing write.

Also guard every step of install_push/install_pr with `|| return 1`. They
run inside a command substitution in an `if`, which suspends `set -e`, so an
empty default branch or a failed ref POST previously fell through to the PUT
and the PR.

The stub gh now reproduces real `gh api` failure output (JSON body on stdout,
"gh: <reason> (HTTP <code>)" on stderr, exit 1), measured against a live
404 rather than assumed.

Claude-Session: https://claude.ai/code/session_019HDRKLQNv82SEBd4zGpcXf
@claude

This comment has been minimized.

The `|| return 1` guards on install_push/install_pr had no test: the stub's
default-branch arm could not fail, so the "install step failed -> ERROR"
path was never exercised in either mode.

Adds a fail-repo fixture that makes the default-branch GET return 403 and
asserts the repo reports ERROR, no PUT is sent, no PR is opened, and the run
exits 1. Observed failing first by removing the guards: without them the
lookup's error text became the branch name and a PUT went out against it.

Claude-Session: https://claude.ai/code/session_019HDRKLQNv82SEBd4zGpcXf
@claude

This comment has been minimized.

@twistedmelonman
twistedmelonman merged commit 6f759f1 into main Sep 8, 2026
3 checks passed
@twistedmelonman
twistedmelonman deleted the claude/feat-bulk-install-standards-check-019HDRKL branch September 8, 2026 23:42
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