feat(ci): Mythos delta-pass auto-runner (single-actor, OAuth-token)#162
Conversation
Automates the human-driven discover protocol that mythos-gate.yml
currently enforces by label. On every PR that touches a Tier-5
file, runs anthropics/claude-code-action (SHA-pinned) per touched
file with scripts/mythos/discover.md as the prompt and captures a
structured `{verdict: NO_FINDINGS | FINDING}` JSON via the action's
--json-schema input. Posts a sticky <!-- mythos-auto-gate --> PR
comment with per-file results; applies mythos-pass-done on all-pass,
fails the job (without the label) on any FINDING.
Authorization stack (defense-in-depth, "only avrabe can trigger"):
1. Job-level if: requires both `github.actor == 'avrabe'` AND the
immutable `github.actor_id == '10056645'`. Usernames can be
reassigned after account deletion; numeric IDs cannot.
2. Trigger is pull_request (not pull_request_target). GitHub's
default policy keeps secrets away from fork-repo PRs.
3. claude-code-action pinned by full commit SHA, not the floating
v1 tag. Hijacking the tag does not change what we run.
4. Explicit minimal permissions: pull-requests write (sticky comment
+ label), contents read.
5. concurrency: cancel-in-progress per PR head — no budget burn on
rapid push cycles.
6. Detect job path-shape-validates every Tier-5 file
(^[a-zA-Z0-9/_.-]+$) before piping into the matrix so a hostile
filename cannot inject through ${{ matrix.file }} downstream;
matrix.file is read via env: in run blocks, not direct
interpolation.
Auth flow uses CLAUDE_CODE_OAUTH_TOKEN from avrabe's Max plan; no
separate API billing. Token usage draws from the subscription rate
limit shared with interactive Claude Code use.
Label-only mythos-gate.yml remains source-of-truth — the auto-runner
is one way the label gets applied, not the only way. Contributors
without OAuth access continue using the honor-system flow per
AGENTS.md.
Setup (one-time, on maintainer machine):
claude update # ensure v1.0.44+
claude setup-token # prints CLAUDE_CODE_OAUTH_TOKEN
Then add the token as repo secret CLAUDE_CODE_OAUTH_TOKEN.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
LS-N verification gate
Approved Failed LS entries(none) Missing regression tests
Updated automatically by |
Admin-merge per #139 (smithy capacity)9 checks green + 2 expected skips ( This is the same admin-merge case as PR #161 yesterday. The workflow added here is single-actor-scoped (only avrabe can trigger it), and the new Admin-merge counter for #139 since last reset:
Will track the reset back into #139 after merge. |
Summary
Automates the Mythos discover protocol that
mythos-gate.ymlcurrently enforces by label only. On every PR that touches a Tier-5
file,
anthropics/claude-code-action(SHA-pinned) runs against eachtouched file with
scripts/mythos/discover.mdas the prompt, emitsa structured JSON verdict (
NO_FINDINGSorFINDING), and theaggregate job posts a sticky
<!-- mythos-auto-gate -->PR commentmythos-pass-doneon all-pass.Authorization stack — "only avrabe can trigger this"
if: github.actor == 'avrabe' && github.actor_id == '10056645'pull_request(notpull_request_target)claude-code-actionpinned by commit SHA51ea8ea7...v1doesn't change what we runpermissions:(PR write, contents read)concurrency: cancel-in-progressper PR head${{ matrix.file }}interpolation injection blocked even if a hostile filename slips throughPhase A — your one-time setup
Then in browser: Repo Settings → Secrets and variables → Actions → New repository secret
CLAUDE_CODE_OAUTH_TOKENOnce added, mark this PR ready for review and the workflow will fire on the next push.
Files
.github/workflows/mythos-auto.yml— workflow (detect → scan matrix → aggregate)AGENTS.md— new "Auto-runner" subsection under Mythos pipelineCHANGELOG.md—[Unreleased] / AddedentryHow this fits with
mythos-gate.ymlmythos-gate.yml(label-only check) stays as source of truth.The auto-runner is one way the
mythos-pass-donelabel getsapplied — not the only way. Contributors without OAuth access (or
non-avrabe actors) continue to use the documented honor-system flow:
run discover.md in a fresh Claude Code session, post findings/NO
FINDINGS comment, apply label manually.
Test plan
actionlintif available)avrabe: workflow runs, posts comment, applies/withholds label per verdictif:fails); no token leaked, no comment postedany=false, downstream jobs skip cleanlymeld-core/src/parser.rs;evildoesn't pass the path-shape filter and is logged as a warningCost / quota note
Token usage draws from the Max-plan subscription quota, shared with
interactive Claude Code use. A burst of Tier-5 PRs could starve
interactive sessions during the same window. Refresh-token gap
tracked at anthropics/claude-code-action#727.
🤖 Generated with Claude Code