Repository navigation
feat(ci): four gh-aw agentic workflows, on the judgement CI cannot do - #359
Conversation
4463fb5 to
84b21ec
Compare
…est (#362) Two things, both found by looking at what the last PR actually shipped. **The repository is private, and five files said otherwise.** `gh repo view --json visibility` returns PRIVATE. I had propagated "public repository" into the plan-step comment, `docs/infrastructure.md` §14.2, the infra-platform skill, and — worst — the PR comment template, which renders that sentence onto every infra PR. Two pre-existing claims in `ci-terraform.tf` and `ses.tf`, plus two in `sccache.tf`, said the same. Every decision those comments justify stays correct, so none of them is a word swap; each needed its premise replaced: - `-refresh=false` on the plan tier: the path was never "the whole internet reads the log", it is that the plan role is assumable from any PR branch, a PR can edit the workflow it runs under, and the resulting build log needs no AWS access to read, is readable by every collaborator, and persists in the run history. Private narrows who, not whether. - zero repository secrets: the argument never depended on visibility — secrets are not readable by anonymous visitors on a public repo either. It is that a static key does not expire, is reachable by every workflow rather than one job, and is rotated only by someone remembering to. - the sccache writer split: cache poisoning now has to come from a collaborator rather than from anyone, which narrows who can attempt it without closing the path — and poisoning outlives the credential that planted it, which is why it is worth a second role. Left alone deliberately: six `rust.yml` sccache comments and `build-cost.md`'s runner-cost paragraph, which claims standard minutes are free — materially wrong on a private repo. Both files belong to #359, which is in flight and already corrects one line of build-cost.md. Sweeping them here would only conflict with it. **The destroy guard had never refused anything in CI.** Every real apply has planned `0 to destroy`, so the one mechanism between a merge and an unattended production teardown had its refusal path verified exactly once, by hand, by me. That is the state this repo keeps getting burned by — a gate nobody has watched fail is indistinguishable from a gate that cannot. `scripts/ci/tf-helpers-test.sh` asserts 31 behaviours of the three helpers against fixtures: the refusal, the `ALLOW-DESTROY` override, the fail-closed branch, the import-form summary a full-line pattern would miss, the 65536-character comment cap, the backtick-in-plan-text fence, and that a plan-only stack never gets the "merging applies this" warning. No toolchain, no credentials, no network, no terraform binary. `apply` now gates on it, which is the reason it is a CI job and not a local convenience: a broken guard stops the apply instead of being discovered by it. The suite is mutation-checked — breaking the guard's refusal, its fail-closed branch, the metadata parser's import handling, the comment cap or the plan-only warning skip each turns it red. The first attempt at that check reported a false CAUGHT from a `sed` that matched nothing, which is why the mutations are applied by assertion now. One bug in the test itself, worth recording because it is the same class the suite exists to catch: the "names ALLOW-DESTROY in the refusal" assertion piped the guard into `grep -q`. With `pipefail` on, the pipeline returned the guard's own exit 1 — the behaviour under test — so the assertion read false however correct the message was, and `grep -q` would have SIGPIPEd the guard on the way. Captured and matched with `case` instead. Co-authored-by: bmoore813 <[email protected]> Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
#365) I made `plan (state-backend)`, `plan (core)`, `plan (dev)` and `plan (prod)` required in #360's follow-up. The next non-infra PR — #359, the agentic workflows — went unmergeable, with all four stuck on "Expected — waiting for status to be reported", and the four contexts have been removed from branch protection to unblock it. The behaviour, stated exactly, because it is genuinely surprising: While a matrix job RUNS it reports one check-run per leg — `plan (core)`, `plan (dev)`, … — which look like perfectly good contexts. When the job is SKIPPED by its `if:`, GitHub reports a single check-run under the literal, uninterpolated name `plan (${{ matrix.key }})`. So per-leg contexts never report at all on a PR that skips the tier, and a required context that never reports blocks the PR forever — the same failure mode as a `paths:` filter, which is precisely what this workflow's `detect` job exists to avoid. I replaced one trap with another wearing a different hat. `fmt + validate (credential-free)` was fine throughout, and the contrast is the diagnosis: it is not a matrix job, so it reports `skipped` under its own name and branch protection accepts that. The fix is a non-matrix aggregator, `terraform plan`, which `needs: plan` and inspects `needs.plan.result` — the aggregate, `success` only if every leg succeeded. It reports `skipped` when the tier is skipped, so it is safe to require in the legs' place. Two details in it: - `skipped` is ACCEPTED. Exactly one thing produces it: a fork PR, which is issued no `id-token` and so cannot assume the plan role (the `plan` job skips itself for that reason). Treating it as failure would make every fork PR unmergeable — this same bug pointed the other way. - anything unrecognised, including an empty result, FAILS. Verified against all five values `needs.*.result` can take. Documented where the next person will hit it: the `ci-and-supply-chain` skill now carries it as the third `name:`-is-a-context failure mode, and the generated job table — which displays `plan (${{ matrix.key }})` verbatim, i.e. the trap itself — gained a preamble line saying a context containing `${{ matrix.* }}` cannot be required. Nothing is added to branch protection here. That comes after this reports green on `main`, which is the only safe order. One bug caught while verifying, in the gate's own message: a backticked word inside a double-quoted shell string is command substitution, so the first draft ran `validate` and printed its empty output in place of the word. Single-quoted now. Co-authored-by: bmoore813 <[email protected]> Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
84b21ec to
220a2c6
Compare
…g the Rust gate (#366) The tail of #362, which corrected the "public repository" claim in the files it owned and deliberately left `rust.yml` and `build-cost.md` to #359. #359 has corrected one line of `build-cost.md` and is still open, so these are the remaining ones — the edits sit in different hunks from its, and a rebase either way is clean. **`rust.yml`'s six sccache comments.** The cache-poisoning argument stands; only its premise moves. Poisoning outlives the credential that planted it, which is why writes are restricted to `main` — and the repository being private means the branch has to come from a collaborator rather than from anyone at all. Narrower, not closed. **`build-cost.md` claimed "its minutes are free, because standard GitHub-hosted runners are free for public repositories" and that the bill for all of this CI is zero.** That is materially wrong on a private repo: the runtime this whole file measures is a cost, not only a wait. Two downstream conclusions moved with it — an organisation on the Team plan trades one metered rate for another rather than giving up a free one, which is a smaller step than it read; and the usual objection to self-hosted runners (a fork PR executing arbitrary code) mostly does not apply, so what remains is the ordinary compromised-collaborator case and the runner wanting its own least-privileged identity. No replacement figure is asserted. The allowance and consumption are account settings rather than repository state, and `gh api /users/{user}/settings/billing/actions` needs a `user` scope this session does not hold — so the text says where to read them instead of substituting one unverified number for another. **`.github/workflows/infra.yml` joins `rust.yml`'s detect denylist**, with `scripts/ci/tf-*` which was already exempt in `infra.yml`'s own detect but not here. An infra-only PR was paying the full ~40-minute backend gate — `test` plus the DuckLake e2e — and `infra.yml` defines no Rust job and cannot affect the workspace build. Every infra PR in this series paid it. Named FILE BY FILE and not as `^\.github/workflows/`: `rust.yml`, `frontend.yml` and `images.yml` must keep triggering the gates they define, or a change to a gate would stop reporting on exactly the PR most likely to break it. Simulated over nine shapes — infra.yml alone, with terraform, and with a tf helper all skip; rust.yml, frontend.yml, images.yml, docs, `scripts/ci/actionlint.sh`, and infra.yml+rust all still run. `rust/deny.toml`'s "Public repo" is left alone: it describes `github.com/athvin/feather-flow`, the ff-analysis dependency, which really is public (checked). Co-authored-by: bmoore813 <[email protected]> Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
athvin
left a comment
There was a problem hiding this comment.
Reviewed while rebasing this onto the infra work (#358–#366). The construction is careful — I checked the things I'd expect to be wrong and they're right. One finding looks blocking, and it needs a decision rather than a patch, so I've left it alone.
Blocking: the four agents cannot authenticate as merged
gh aw compiles an unconditional Validate COPILOT_GITHUB_TOKEN secret step into each lock file (ci-triage.lock.yml:235), feeding it ${{ secrets.COPILOT_GITHUB_TOKEN }} with no fallback. Two facts together:
gh secret listis empty — noCOPILOT_GITHUB_TOKEN.- None of the four workflows declares
copilot-requests: write. The only occurrence of that string in any lock file is inside gh-aw's own failure-message text (:1509), not a permissions block.grep -c copilot-requestson the four.mdsources returns 0.
So each run reaches activation, sets secret_verification_result=failed, and conclusion reports the missing credential. It degrades gracefully rather than crashing — and none of them is a required check, so nothing is blocked — but none of the four will ever do anything until one of the two is supplied.
The skill text describes the intended mechanism correctly:
engine: copilotdraws oncopilot-requests: writeagainst the job token, so there is still nosecrets.*reference in any workflow.
The permission implementing it was just never added. Which would be a one-line-per-file fix plus a recompile — except for the next part.
Why I didn't just fix it
gh-aw's own failure message scopes that path to an organisation:
If your organization has a Copilot subscription, you can avoid the need for a personal access token by adding a top-level
permissionsblock …copilot-requests: write
gh api repos/:owner/:repo --jq .owner.type → User. Same fact that makes larger runners unavailable in build-cost.md. I don't know whether copilot-requests: write works for a user-owned repo on an individual Copilot plan, and I'd rather say so than guess. If it doesn't, the remaining option is a COPILOT_GITHUB_TOKEN PAT — the repository's first secret, which contradicts the paragraph above it:
The zero-repository-secrets invariant survives them.
That's an operator trade, not a patch: mint the PAT and retire the zero-secrets property, move the repo to an org (which also unlocks larger runners), switch engines and accept ANTHROPIC_API_KEY instead, or leave the agents dormant on purpose. Worth settling before merge, because merging as-is ships four workflows that look installed and are inert — the "built but unexercised" shape this repo keeps getting bitten by.
Cheapest way to find out: add copilot-requests: write to one workflow, recompile, and run it via workflow_dispatch.
What I checked and found sound
- Token separation is real, not claimed. Per-job
permissions:extracted fromgenerated-artifact-healer.lock.yml: theagentjob that runs the model and executes PR-branch code getscontents: read/actions: read/pull-requests: read/id-token: write. No job in the file holdscontents: write. Writes live inactivation/conclusion. That's the property that matters most here, given the healer re-runs a regen command from the PR branch under aworkflow_runtrigger — the classic escalation shape, correctly defused. - The
id-token: writeexception is honestly scoped. It's on the agent job, it buyser-ci-sccache-read, and that role has noDeleteObject. Read access to compiler output is the whole blast radius, so an agent can't plant object code a latermainbuild consumes. workflow_runoverpull_requestfor dependabot is the right call and the comment gives the right reason (a Dependabot-raisedpull_requestcarries a read-only token whatever the permissions block says).- Cost is bounded —
max-turnson all four,max-ai-credits: 400on the auditor,noopbefore billing. protected-files: fallback-to-issueplus draft PRs plus one-skill-per-PR on the auditor is the right posture for files every future session reads.- Branch scopes are positive and the deliberate caps are stated rather than implied.
One wording nit
there is still no
secrets.*reference in any workflow
Literally false as written — grep -oE 'secrets\.[A-Z_]+' finds six per lock file. The substance holds, because the ones that matter are fallback chains (secrets.GH_AW_GITHUB_MCP_SERVER_TOKEN || secrets.GH_AW_GITHUB_TOKEN || secrets.GITHUB_TOKEN), so no secret must be set. But in a repo whose convention is that a claim should survive the obvious grep, "no repository secret has to exist" says it and this doesn't.
Rebase note
I rebased this branch twice (--force-with-lease), once onto #358 and once onto #365, and folded nothing of mine into it — infra/terraform/ was already in your agent_only denylist when I got here. #366 then added .github/workflows/infra.yml and scripts/ci/tf-* to that same pattern on main, so expect a one-line conflict there; the rest of the hunks are disjoint.
Also worth knowing, since it bit this PR: required-checks.md now carries a preamble line saying a context containing ${{ matrix.* }} can never be required. Making the four plan (<env>) legs required is what left this PR unmergeable with them stuck on "Expected" — a matrix job skipped by if: reports once, under the literal uninterpolated name. Fixed in #365 with a non-matrix aggregator; the contexts are off protection.
Three gaps that each turn into a red run the moment a `.github/workflows/*.md` lands. Separated from the workflows themselves so the plumbing can be verified against a tree that has none. `skills-check.sh` globbed `.github/workflows/*.yml` to build the generated required-checks table. `gh aw compile` emits `*.lock.yml`, which matches that glob and carries a dozen machine-generated jobs, so every compile — and every gh-aw version bump — would have churned the reference and failed both the `skills` job and `lint`'s drift step. The lock files are skipped and the agentic surface is summarised from the `.md` sources instead: one row per workflow, triggers and safe outputs, which are the two questions a reviewer has. Both halves were observed, including the gate RED at exit 1 on an uncommitted workflow — and the first attempt to check that read exit 0, because `| tail` had eaten the status, which is the trap already recorded in this skill. `rust.yml`'s `detect` counted any path outside `.claude/` as code, so editing an agent prompt would have spent ~15 minutes on `test` + `ducklake-e2e`. The exclusion now also covers the agentic sources: the `.md`, the `.lock.yml` compiled from it, and the `shared/` imports. Deliberately per-file and NOT `^\.github/workflows/` — `rust.yml`, `frontend.yml`, `infra.yml` and `images.yml` must keep triggering the gate they define, and excluding the directory wholesale is the `paths:`-filter trap in CLAUDE.md wearing a different hat. Fifteen paths table-tested in both directions. Drift is still caught, because the `skills` job is not gated on `detect`. The CI skill gains the section the above implies: agentic workflows may never be required checks (a model run is non-deterministic, so requiring one gates every merge on a retry), which is also why they are the only workflows here allowed a `paths:` filter. They hold the repo's only `pull-requests: write` and `contents: write`, though the agent process still never writes — safe outputs are capped operations run by separate jobs after it exits. `engine: copilot` draws on the job token, so the zero-repository-secrets invariant survives; `engine: claude` would need an `ANTHROPIC_API_KEY` and is called out as a trade to make explicitly. `infra.yml`'s "NO REPOSITORY SECRETS" header needs no change: it is scoped to AWS identities and stays literally true. Its neighbouring "PUBLIC repository" claim is stale — this repo is private — but that is left alone deliberately, being both inside a file under concurrent edit and a worked example for the skill auditor landing next. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
The gates here already catch everything mechanical. What they cannot do is the judgement step, and the Dependabot history is the evidence: of the last twenty bot pull requests, EIGHT were closed rather than landed — ulid 3.0.0, sha2 0.11.0, hmac 0.13.0, duckdb 1.20000.0, rand 0.10.3, motion 14.3.0 and two whole frontend groups. Several were closed not because the bump was wrong but because it needed a second, known edit nobody made. Those coupling rules are already written down in this repo; nothing was missing except someone to read them. Each workflow is a Markdown prompt with YAML frontmatter; `gh aw compile` emits the `.lock.yml` beside it. The model never holds a GitHub write scope — gh-aw splits each workflow into five or six jobs and the `agent` job gets read scopes only, with `contents: write` confined to the `safe_outputs` and `conclusion` jobs that run after it exits. Verified by extracting the per-job `permissions:` from every lock file rather than by trusting the design. - `dependency-upgrade-pilot` reads release notes for the whole version range, checks the five coupled pins, then returns one of three verdicts in the repo's own vocabulary: safe-to-merge, needs-companion-change (which it applies and pushes), or schedule-as-migration with the migration surface named. It is pointed at `dependency-bumps.md` and the comment blocks in `rust/Cargo.toml` rather than having their version numbers copied into the prompt, because a second copy of a pin is a thing that goes stale. - `ci-triage` classifies a red run as your-diff / the-world-moved / runner-infra / flake, carrying this repo's specific false signals: `linking with cc failed` is really errno 28, semgrep reports zero findings when a ruleset fails to parse, a Playwright exit code gets eaten by `| tail`. - `generated-artifact-healer` re-runs the regen command behind a byte-compared artifact. Its safety is that the command comes from a fixed table, is re-verified before the push, and the diff is refused if it touches a file that command does not own — a hand-edited generated file is a bug to report, not to overwrite. - `skill-freshness-auditor` covers the semantic drift `skills-check.sh` structurally cannot see. A finding needs the stale sentence quoted AND a file:line that contradicts it, or it emits `noop` and costs nothing; "could be clearer" and "is missing X" are explicitly not findings. `shared/rust-gate.md` is imported by the two that compile Rust. Its env must match `rust.yml` EXACTLY — sccache keys on the compiler command line, so dropping `-fuse-ld=mold` would silently yield a 0% hit rate against a warm cache and the agent would wait out a cold duckdb build. It assumes `er-ci-sccache-read`, never write, whose trust policy covers any ref so `workflow_run` and `schedule` can use it. Against the plan, three things changed once measured: - `workflow_run`, not `pull_request`. A `pull_request` event raised by Dependabot carries a read-only token whatever the permissions block says, so the companion push would have failed. `workflow_run` also means CI has already answered, so the agent reads the result rather than guessing. - NO disk-reclaim step, which the plan called for. `rust.yml` carries it on `test` alone, because that job links a debug binary per crate; `lint`, whose commands these agents replicate, has none. It would also have been harmful — the reclaim deletes `/opt/hostedtoolcache`, which a gh-aw run needs for its own `actions/setup-node`. - The agent job is not purely read-only after all. The two cargo agents hold `id-token: write` for the sccache exchange. That mints an AWS credential, not a GitHub one, against a role holding `s3:GetObject`/`ListBucket` on one bucket and no `DeleteObject` at all. The skill says so rather than repeating the tidier claim. Supply-chain review, as `gh aw compile`'s safe-update mode requires: the four actions this introduces — Swatinem/rust-cache, aws-actions/configure-aws- credentials, mozilla-actions/sccache-action, taiki-e/install-action — are pinned to SHAs verified byte-identical to the ones `rust.yml` already uses, so there is no new supply-chain surface. `.github/aw/actions-lock.json` records the one genuinely new action, gh-aw's own `setup`, resolved to a SHA. The `*.lock.yml` skip added in 3872ddd was too narrow: `gh aw compile` also generates `agentics-maintenance.yml`, which the glob caught and tabulated. Now detected by the generated-file marker in the file header instead of by filename, so the next thing gh-aw generates is covered too. `rust.yml`'s `detect` grew `.github/aw/` and that filename for the same reason; sixteen paths re-tested. Two compiler warnings are accepted rather than silenced, both for `push-to-pull-request-branch: target: "*"`. The privilege is near-nil — the push goes to the pull request's own branch, which its author can already write to — and the suggested fix, a required label, means opting each PR in by hand, which is most of the cost these agents exist to remove. NOT run: `gh aw init`. It would also write `.github/mcp.json`, `.github/skills/`, `.github/agents/` and `.vscode/settings.json`, which is Copilot-coding-agent scaffolding and a deliberate decision under CLAUDE.md's rules on agent tooling, not a side effect of installing four workflows. The one piece that mattered, `.gitattributes` marking lock files generated, `gh aw compile` writes by itself. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…rence Merging a `workflow_run` workflow is also its first real execution — the trigger only fires once the file is on the default branch, so there is no way to watch these two before they can act. This repo's standard is that a gate is not trusted until it has been observed, so both agents that push commits start with `safe-outputs.staged: true`: every output is previewed in the run summary and nothing is posted or pushed. Remove the one line per agent after reading a real run. `ci-triage` stays live, because a comment is reversible and reading its first real classification is the point. Staging exposed a bug in the generator added two commits ago: `staged` is a modifier under `safe-outputs:`, not an output, and it was being listed as one — so the reference said these agents could perform an output called `staged`. It now drives a **Mode** column instead, which is better than merely correct: the one question a reader of that table has is whether an agent acts or rehearses, and it is now the second column. Other `safe-outputs:` config keys are filtered by a denylist that is deliberately not exhaustive — a new one showing up in the Safe outputs column is the signal to add it, which keeps the table's own staleness visible rather than silent. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Both agents trigger on a `rust.yml` failure and both push to the pull request branch, which retriggers `rust.yml`, which retriggers them. Reviewing the pair together is what surfaced it; neither prompt said anything about its own second invocation. It would in fact have terminated, for a reason too incidental to rely on: `skills-check.sh regen` and `er-entity gen` are deterministic, so a second lap produces no diff and falls through to `noop`. That is luck, not a guard, and every lap is a paid model run. Each now reads `git log` on the head branch before doing anything else and recognises its own previous commit. The healer stops, because a fix that did not make the run green will not work twice. The pilot splits on the CI result: its own commit plus green means the companion change worked and the verdict is `safe-to-merge` with nothing more to push; its own commit plus red means the companion change was insufficient, which makes the bump a `schedule-as-migration` rather than grounds for a second attempt. One push per branch, ever — a retry is a human's call. No loop was possible yet, since both ship `staged: true`. The guard belongs in before that comes off, not after. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Rebasing onto main picked up the CI-speedup work, which bumped `taiki-e/install-action` to v2.88.1. `shared/rust-gate.md` still pinned v2.87.31, which quietly falsified this PR's own claim that the four actions it introduces are byte-identical to the ones `rust.yml` already uses — the whole basis for saying it adds no supply-chain surface. Re-pinned and recompiled. The lock diff is that SHA and its two metadata hashes and nothing else: `compiler_version` stays `v1.0.1`, so there is no gh-aw version churn riding along. Checked, rather than assumed, while the branch was on main's tip: - all four actions now match `rust.yml` exactly (rust-cache, configure-aws-credentials, sccache-action, install-action) - the sccache env still matches: `CARGO_INCREMENTAL`, `RUSTFLAGS`, `SCCACHE_BUCKET`, `SCCACHE_REGION` and `RUSTC_WRAPPER` are identical to `rust.yml`'s top-level block plus `lint`'s job env, which is what keeps the hit rate off the floor - the rust-cache keys still match `lint`'s (`workspaces: rust`, `shared-key: rust`, `prefix-key: v1-rust`, `key` hashing `rust/Cargo.toml`), with `save-if: false` still deliberate - `gh aw compile --strict` — 4 succeeded, the same 2 documented `target: "*"` warnings - `gh aw lint` — actionlint over 12 files, no issues - `scripts/skills-check.sh check` — exit 0, references current Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
220a2c6 to
cf1ff06
Compare
Rebased onto
|
Post-merge: all four failed on first execution, and are now disabledMerged as This falsifies this PR's security claim. The body says "No repository The claim was reasoned from the engine choice rather than from an execution — They fail closed, which is the one thing that went right
Nothing was posted, pushed, or run. Done now
The decision this surfacesBoth engines cost a repository secret: Re-enabling is Unrelated, for the record
|
…path (#439) #359 shipped four agentic workflows on `engine: copilot` and asserted that kept the zero-repository-secrets invariant. On their first real execution — the run immediately after #359 landed — all four died at `activation`: Error: None of the following secrets are set: COPILOT_GITHUB_TOKEN COPILOT_GITHUB_TOKEN is required by GitHub Copilot CLI. The generated `activation` job runs `validate_multi_secret.sh` and hard-fails without it. `gh secret list` is empty, so they never had a chance to run. **There is no zero-secret engine.** `copilot` wants `COPILOT_GITHUB_TOKEN`, `claude` wants `ANTHROPIC_API_KEY`, and every other engine wants its own key. The invariant and the feature were always mutually exclusive; #359's claim just hid which side we were on. Since a secret is owed either way, this picks the engine whose model and cost are selectable per workflow. Bedrock was evaluated first and is not reachable: `gh aw compile --engine bedrock` answers *"Must be 'agy', 'claude', 'codex', 'copilot', 'gemini', or 'pi'"*. The `amazon-bedrock` and `AWS_BEARER_TOKEN_BEDROCK` strings in the binary belong to a generic cloud-auth layer (`AWF_AUTH_{AWS,ANTHROPIC,AZURE, GCP,OIDC}_*`) whose AWS members are only REGION / ROLE_ARN / ROLE_SESSION_NAME — OIDC role assumption, no inference path. ## Model per workflow, split on judgement | Workflow | Model | Why | |---|---|---| | `dependency-upgrade-pilot` | `claude-sonnet-5` | verdicts a version range | | `ci-triage` | `claude-sonnet-5` | classifies a red run | | `generated-artifact-healer` | `claude-haiku-4-5` | re-runs a known generator | | `skill-freshness-auditor` | `claude-haiku-4-5` | greps prose against code | Haiku 4.5 is the cheapest current model and right for mechanical work. It is the wrong default for the two judgement agents: #376 is the worked example of that cost — a bump whose own release notes named the companion edit, merged without it, three red PRs. A cheaper model reaching that verdict confidently is worse than no agent. `effort` is deliberately absent everywhere; Haiku 4.5 rejects it. `dependency-upgrade-pilot` also loses `copilot-sdk: true`, exactly as the note it replaces predicted: that nesting existed only to obtain a proxy-aware fetch tool, because Copilot's native `web-fetch` is unavailable under offline BYOK. On `engine: claude` `web-fetch` is native. ## Security review (required by safe-update mode) `gh aw compile` flagged one new restricted secret and refused to proceed until reviewed. Reviewed, then `--approve`d: - **`ANTHROPIC_API_KEY` — the only new secret.** Visible to `activation`, `agent` and `detection`; *not* to `safe_outputs` or `conclusion`, the write-capable jobs. - **Blast radius is Anthropic spend, nothing else.** No agent job holds `contents: write` — extracted per-job, they carry `contents: read` plus reads. The `id-token: write` on the two Rust agents still mints only `er-ci-sccache-read` (GetObject/ListBucket on one bucket, no DeleteObject). - **No new actions.** `setup-node@949feb24` appears as an added line but is already on `main` in these same files — a position shift, not a new dependency. No redirect changes. - **Use a dedicated key, not the product's.** `ANTHROPIC_API_KEY` is already the name of the frontend assistant's credential, and per `docs/infrastructure.md` §18.14 that path "sends real customer personal data to the Anthropic API". Reusing one value would turn a CI-side leak into a key that touches customer data. Mint a separate key in its own workspace. - **Cannot fully verify, flagged for a human:** whether a prompt-injected agent can defeat gh-aw's log masking and egress allowlist to exfiltrate the key. Mitigation is scoping and a spend cap, not sandbox trust. `GH_AW_MAX_DAILY_AI_CREDITS` (5000) is denominated in Copilot credits and does not bind a BYO-key run, so the spend ceiling is now whatever is configured Anthropic-side. These fire on every dependabot push and every red CI run, so that limit is load-bearing. ## Still disabled, deliberately All four remain `disabled_manually` from the triage that followed #359. They stay that way until `ANTHROPIC_API_KEY` exists — re-enable with `gh workflow enable` on each. `staged: true` is untouched on both push-capable agents, so their first real runs still only preview. They fail closed either way: `activation` failing leaves `agent`, `detection` and `safe_outputs` all `skipped`, so a missing or revoked key costs red runs, never an unintended write. Verified: `gh aw compile --strict` 4/4 with the 2 documented `target: "*"` warnings; `gh aw lint` 12 files clean; `scripts/skills-check.sh check` exit 0. Co-authored-by: bmoore813 <[email protected]> Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
What and why
Four
gh awagentic workflows, aimed at thejudgement step CI cannot do. The Dependabot history is the case for them: of the
last twenty bot PRs, eight were closed rather than landed —
ulid3.0.0,sha20.11.0,hmac0.13.0,duckdb1.20000.0,rand0.10.3,motion14.3.0and two whole frontend groups. Several were closed not because the bump was wrong
but because it needed a second, known edit that nobody made. Those coupling
rules are already written down in this repo; what was missing was someone to read
them.
Each workflow is a Markdown prompt with YAML frontmatter;
gh aw compileemitsthe
.lock.ymlbeside it. Edit the.md.dependency-upgrade-pilotworkflow_runondependabot/**safe-to-merge/needs-companion-change(applies + pushes it) /schedule-as-migrationci-triageworkflow_runon failuregenerated-artifact-healerworkflow_runon failureskill-freshness-auditor.claude/skillsthat the code contradictsSecurity posture, verified rather than asserted
gh-aw splits each workflow into five or six jobs. The
agentjob that runs themodel holds no GitHub write scope —
contents: writelives only in the separatesafe_outputsandconclusionjobs that run after it exits. Checked byextracting the per-job
permissions:from every lock file.One honest exception: the two agents that compile Rust carry
id-token: writeonthe agent job, because
shared/rust-gate.mdexchanges it for the sccache role.That mints an AWS credential, not a GitHub one, against
er-ci-sccache-read—s3:GetObject/ListBucketon one bucket, noDeleteObjectin the policy at all.Read access to compiler output is the whole blast radius. The skill says this
rather than the tidier claim that the agent never writes.
Supply-chain review (required by
gh aw compile's safe-update mode): the fouractions introduced —
Swatinem/rust-cache,aws-actions/configure-aws-credentials,mozilla-actions/sccache-action,taiki-e/install-action— are pinned to SHAsverified byte-identical to the ones
rust.ymlalready uses, so there is no newsupply-chain surface.
.github/aw/actions-lock.jsonrecords the one genuinely newaction, gh-aw's own
setup, resolved to a SHA. No repository secret is added:engine: copilotdraws on the job token, so the zero-secrets invariant holds.Both push-capable agents start staged
A
workflow_runworkflow only fires once it is on the default branch, so mergingthis is their first real execution — there is no way to watch them first.
Both agents that push therefore set
safe-outputs.staged: true: every output ispreviewed in the run summary, nothing posted or pushed. Remove one line per agent
after reading a real run.
ci-triagestays live because a comment is reversible.Three prerequisites, in the first commit
Each is a red run otherwise, and they are separated so the plumbing was verified
against a tree with no agentic workflows in it.
skills-check.shglobbed.github/workflows/*.ymlto build the generatedrequired-checks table.
gh aw compileemits*.lock.ymlandagentics-maintenance.yml, which that glob caught — every compile would havechurned the reference and failed two jobs. Now skipped by the generated-file
marker in the header rather than by filename, so whatever gh-aw generates next
is covered too.
rust.yml'sdetectcounted any path outside.claude/as code, soediting a prompt would spend ~15 minutes on
test+ducklake-e2e.Deliberately per-file and not
^\.github/workflows/— the fourhand-written workflows must keep triggering the gate they define, and
excluding the directory wholesale is the
paths:-filter trap inCLAUDE.mdwearing a different hat. Sixteen paths table-tested in both directions.
never be required checks (a model run is non-deterministic, so requiring one
gates every merge on a retry), which is also why they are the only workflows
here allowed a
paths:filter.Three things changed once measured
workflow_run, notpull_request. Apull_requestevent raised byDependabot carries a read-only
GITHUB_TOKENwhatever the permissions blocksays, so the companion push would have failed.
workflow_runalso means CI hasalready answered, so the agent reads the result instead of guessing.
rust.ymlcarries it ontestalone, because that job links a debug binary per crate;lint— whosecommands these agents replicate — has none. It would also have been harmful:
the reclaim deletes
/opt/hostedtoolcache, which a gh-aw run needs for its ownactions/setup-node.shared/rust-gate.md's env must matchrust.ymlexactly. sccache keys onthe compiler command line, so dropping
-fuse-ld=moldwould silently yield a0% hit rate against a warm cache and the agent would wait out a cold duckdb
C++ build. Matching it is the only reason these runs are affordable (~6 min for
fmt + clippy + deny + entity verify).
Verification
gh aw compile --strict— 4 succeeded. Two warnings accepted and documented inplace, both
push-to-pull-request-branch: target: "*": the privilege is nearnil, since the push goes to the PR's own branch which its author can already
write to, and the suggested fix (a required label) means opting each PR in by
hand, which is most of the cost these agents exist to remove.
gh aw lint— actionlint over all 9 workflow files, no issues.make skills-check— green, and observed red at exit 1 on an uncommittedagentic workflow. The first attempt to check that read exit 0 because
| tailhad eaten the status, which is the masking trap this very skill documents.
make checkis not run here: nothing in this PR touches Rust source, and acold
rust/targetis 30–80 GB.rust.ymlon this PR is that gate.Not done, deliberately
gh aw initwas not run. It would also write.github/mcp.json,.github/skills/,.github/agents/and.vscode/settings.json— Copilotcoding-agent scaffolding, which under
CLAUDE.md's rules on agent tooling is adecision to make explicitly, not a side effect of installing four workflows. The
one piece that mattered,
.gitattributesmarking lock files generated,gh aw compilewrites by itself.One stale claim found — and fixed, not kept as a fixture
Writing
skill-freshness-auditorturned up exactly the kind of thing it is for..claude/skills/ci-and-supply-chain/references/build-cost.md:485asserted "Therepository is public and owned by a user account" and concluded "its
minutes are free … The current bill for all of this CI is zero."
gh repo view --json visibilityreturnsPRIVATE. Free standard-runner minutesare a public-repo property, so the cost premise under that whole document was
wrong — and it is a hand-written sentence in a file with no GENERATED block,
which is precisely the gap
skills-check.shcannot see.That changes two conclusions, not just a word: the wall-clock reductions recorded
there are a cost reduction and not only a latency one, and a scheduled
workflow — four of which are landing here — is a recurring line item rather than
a free one. Two entries in its "paths if cores are wanted" list inherited the
premise and are corrected with it.
Fixed here rather than kept as the auditor's test fixture. A standing
instruction that is wrong about money should not survive for test convenience.
Correcting my own earlier note on this PR:
rust.yml:219andinfra.yml:16argue from the same stale premise, but they are code comments and so outside
this agent's scope — it reads
.claude/skills/only. Both mechanisms thereremain correct (an untrusted PR still must not be able to plant object code;
federated OIDC still beats a static key); only their stated reasons need
rewording, which
build-cost.mdnow records.infra.ymlis additionally underconcurrent edit on another branch.
So the auditor ships unexercised against a known finding — see the caveat
below.
The honest caveat: none of these has ever run
A
workflow_runworkflow only fires once it is on the default branch, so therewas no way to execute any of them from this branch. The negative tests the plan
called for — breaking a clippy rule to watch
ci-triageclassify it, staling agenerated file to watch the healer heal it — have not been run. That is what
staged: trueon the two push-capable agents is for, and whyci-triageis leftlive: its first real run is the cheapest way to see whether the prompts work.
gh aw forecastlikewise returns nothing yet (404: not on the default branch),so there is no cost estimate for these four;
gh aw logsandgh aw auditwill give real AIC per run once they fire.
🤖 Generated with Claude Code