Repository navigation
feat: thin-caller-gate and pin-health guard workflows - #7
Merged
Merged
Conversation
thin-caller-gate fails a PR when a caller's acceptance wiring drifts: non-SHA or mixed pins, local copies of shared scripts, non-literal mode/enforce-from-issue. pin-health reports how far the pinned SHA is behind main and, only when open-issue is true, keeps one tracking issue. Neither bumps anything. Adds scripts, node:test unit tests, fixtures (including a deliberately drifted one), selftest jobs, README and adopting docs. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Acceptance self-test (fixture)
Updated for commit 8aabf94, workflow run. This comment is edited in place, never repeated. |
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.
Summary
Two reusable, low-risk guards, modelled on projectbluefin/actions (
reusable-thin-caller-gate,factory-drift), adapted to this repo's conventions. First consumer will be saiku, in a separate PR after this merges.thin-caller-gate.yml(PR check, static,contents: read, no secrets, no token): fails when auses:of an acceptance-spec workflow is not pinned to a full 40-char SHA, when callers pin different SHAs, when a file named like a shared script (runner, check, base-check, spec, start/stop-server) exists outside theallow-local-scriptsallowlist, or whenmode/enforce-from-issueis not a literal or${{ vars.NAME }}. Sameskip-outside-pull-requesthandling asconvention.yml(skipped inside the workflow, not via anif:on the calling job). A PR that touches neither.github/workflows/noracceptance/gets a cleanskippedverdict, so a required check never stays pending.mode: reportandverdict/findingsoutputs match the other workflows.pin-health.yml(workflow_call+workflow_dispatch): compares the pinned SHA withmainvia the compare API and writes a job summary (commits behind, whether scripts/workflows changed, diff link). Withopen-issue: true(default false) it opens or edits ONE issue titled "acceptance-spec pin health". Only that opt-in job holdsissues: write. Never bumps, never closes.caller-workflows.mjs,thin-caller-gate.mjs,pin-health.mjs), small and side-effect free in their cores; unit tests in the existing node:test style; guard tests inworkflows.test.mjs(incl. the newissues: writeexception being limited to the opt-in job).selftest.yml: gate onfixtures/thin-caller/good(must pass), onfixtures/thin-caller/drifted(report mode: green job, verdictfail, 6 findings), a direct enforce-mode run that must exit 1, and pin-health onfixtures/pin-health.docs/adopting.md("Adopt the guards").Test plan
node --test "scripts/*.test.mjs"passes locally (165 tests)ciandselftestgreen on this PRuses:and that a caller job grantingissues: writeis accepted forpin-health(a called workflow cannot hold a scope its caller lacks)🤖 Generated with Claude Code