Skip to content

feat: thin-caller-gate and pin-health guard workflows - #7

Merged
buggtb merged 1 commit into
mainfrom
feat/thin-caller-gate-and-pin-health
Oct 12, 2026
Merged

buggtb merged 1 commit into
mainfrom
feat/thin-caller-gate-and-pin-health

Conversation

@buggtb

@buggtb buggtb commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

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 a uses: 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 the allow-local-scripts allowlist, or when mode / enforce-from-issue is not a literal or ${{ vars.NAME }}. Same skip-outside-pull-request handling as convention.yml (skipped inside the workflow, not via an if: on the calling job). A PR that touches neither .github/workflows/ nor acceptance/ gets a clean skipped verdict, so a required check never stays pending. mode: report and verdict/findings outputs match the other workflows.
  • pin-health.yml (workflow_call + workflow_dispatch): compares the pinned SHA with main via the compare API and writes a job summary (commits behind, whether scripts/workflows changed, diff link). With open-issue: true (default false) it opens or edits ONE issue titled "acceptance-spec pin health". Only that opt-in job holds issues: write. Never bumps, never closes.
  • Scripts (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 in workflows.test.mjs (incl. the new issues: write exception being limited to the opt-in job).
  • selftest.yml: gate on fixtures/thin-caller/good (must pass), on fixtures/thin-caller/drifted (report mode: green job, verdict fail, 6 findings), a direct enforce-mode run that must exit 1, and pin-health on fixtures/pin-health.
  • README (workflow table + "Guarding a caller's wiring") and docs/adopting.md ("Adopt the guards").

Test plan

  • node --test "scripts/*.test.mjs" passes locally (165 tests)
  • ci and selftest green on this PR
  • After merge: first caller confirms the cross-repository uses: and that a caller job granting issues: write is accepted for pin-health (a called workflow cannot hold a scope its caller lacks)

🤖 Generated with Claude Code

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>
@github-actions

Copy link
Copy Markdown

Acceptance self-test (fixture)

Check Result What it means
Convention (a closing PR ships its spec) Nothing to check Nothing to check on this PR.
Specs on this PR's build Pass Everything that ran passed.
Spec-first proof (red on base, green on this PR) Nothing to check Nothing to check on this PR.

Updated for commit 8aabf94, workflow run. This comment is edited in place, never repeated.

@buggtb
buggtb merged commit e1ee022 into main Oct 12, 2026
26 checks passed
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