Skip to content

fix(skills): the aws-account-operations audit follow-ups, and the one I dropped - #712

Merged
athvin merged 4 commits into
mainfrom
followup/aws-skill-audit-followups
Nov 6, 2026
Merged

athvin merged 4 commits into
mainfrom
followup/aws-skill-audit-followups

Conversation

@athvin

@athvin athvin commented Nov 6, 2026

Copy link
Copy Markdown
Owner

Follow-ups flagged at the end of #694 (merged as 73e9da7c; main verified
green on it, including the authoritative push-to-main agent skills (lint + drift)).

One commit per item. One of the three was dropped on evidence and a fourth
was added by the sweep.

1. ci-and-supply-chain → aws-account-operations routing — DROPPED

I claimed in the audit that "the runner never starts" would fire
ci-and-supply-chain while the answer lived in aws-account-operations. That
was wrong. Every workflow runs ubuntu-latest/ubuntu-slim — no self-hosted
runners and no ARC anywhere in .github/workflows/
— so a CI job never waits
on this account's EC2 vCPU quota. That half of the collision does not exist.

The surviving half (ECR, the GitHub OIDC provider) is already answered in the
body of the skill that wins selection, at ci-and-supply-chain:390-392. And the
description is at 1018/1024 characters after a concurrent PR grew it, so
fitting a tail means cutting a live trigger phrase to fix nothing.

Skipped deliberately, not forgotten.

2. Restore the run-shaped quota scenario — b57310df

#694 left a note promising this. The run-shaped wording was retired in 2026-10
as unanswerable because there was no per-run pod and no kube dependency;
er-k8s now pins kube + k8s-openapi, renders a per-attempt Job manifest,
and the dispatcher watches it.

Restored as scenario 4, not as a replacement — scenario 3's NodePool
phrasing tests the same quota knowledge without depending on the orchestration
shape, which is what makes it durable.

What the run-shaped wording is uniquely good for is a discrimination reading
er-k8s/src/classify.rs revealed: two unrelated causes both end in
PreStartVerdict::CapacityWait.
So the query names the wrong one on purpose
and accepting its premise is the miss.

3. Run the skills self-test from make skills-check — 5d3ad5eb

make skills-check passed clean on #694 while CI's skills job failed, because
scripts/ci/skills-check-test.sh was wired only into rust.yml. The shape
error cost a full CI cycle — in a job that is not even a required check.

This is the one scripts/ci/*-test.sh that belongs in a make target: it tests
the very script the target runs and needs no toolchain, cluster or credentials.
tf-helpers-test.sh (terraform) and kind-assertions-test.sh (a cluster) stay
CI-only.

Two consequences the gate caught, not me: rust-conventions/references/gates.md
derives make commands from the Makefile, so this made it stale; and that
generator renders a multi-line recipe as a; b, which reads as "b runs even if
a fails" — false for make. Hence one line with &&.

4. Assert the absence list is a real set difference — c9a4d2f8 (new)

Found sweeping my own #694 change. The candidate list is the only human-edited
input to gen_aws_footprint, so it is the only place a typo can hide — and the
failure is silent: a pattern matching nothing reports its service absent and
the drift check sees a self-consistent file. That is the exact bug class the
generator was written to retire.

Two assertions, neither hard-coding which services exist today, both
mutation-tested:

Mutation Fires
aws_lambda_ → ws_lambda_ the shape assertion only
aws_sns_ → aws_snsX_ (present service stops matching) the both-ways assertion only, [SNS absent but not listed]

Each confirmed applied before running; suite returns to 7/7 on revert.

5. The Pending trap named one cause — 1175094c (surfaced by verifying 2)

Verifying scenario 4 showed ResourceQuota appeared nowhere in this skill —
infra-platform owns it. So the scenario required knowledge the skill did not
carry. The gap was in the skill: the body asserts "A pod stuck Pending with
no scheduling event is this, until proven otherwise"
and never says what the
other candidate is, so the trap over-triggers.

classify.rs already distinguishes them, and the discriminator is sharper than
the symptom — whether a pod exists at all:

  • a pod that exists and is Unschedulable, NodeClaims churning → account ceiling
  • no pod at all, active == 0, FailedCreate carrying exceeded quota →
    namespace ResourceQuota, charged at admission

Both land the same CapacityWait, which spends no launch, so the verdict cannot
tell them apart. Now a table, with the ResourceQuota column routed to
infra-platform.

Verification

  • make skills-check exit 0 (now including the self-test, which runs first).
  • scripts/ci/skills-check-test.sh: 7 passed, 0 failed; both new assertions
    mutation-tested in both directions.
  • Loaded aws-account-operations and ran scenario 4's prompt end to end. The
    loader reads the primary checkout, so it served main — which confirmed every
    fix(skills): the AWS skill asserted absences that had stopped being true #694 change is live, and confirmed the new scenario fails against main
    (0 ResourceQuota mentions) and passes against this branch (2). Observed
    failing before trusted.
  • No Rust, frontend or Terraform source changed, so no cargo/next/terraform gate
    applies. gates.md is the only generated artifact touched.

Sweep findings (no change needed)

Still off, deliberately untouched

  • scripts/ci/merge-bus-test.sh runs in no workflow and no make target — it
    is dead. Out of scope here; worth its own look.
  • ducklake-lakehouse's description reached 1010/1024, so fix(skills): the AWS skill asserted absences that had stopped being true #694's LOW-severity
    routing tail to this skill was dropped for budget. The body cross-reference in
    bedrock-and-sdks.md still points the other way.

🤖 Generated with Claude Code

bmoore813 and others added 4 commits November 6, 2026 01:34
…ator it is good for

#694 left a note promising this: scenario 3's run-shaped wording ("a 10M-row run
has been Pending for twenty minutes") was retired in 2026-10 as unanswerable,
on the grounds that there was no per-run pod and no `kube` dependency in the
workspace. `er-k8s` now pins `kube` and `k8s-openapi`, renders a per-attempt Job
manifest, and the dispatcher watches it, so the ground is gone.

Restored as scenario 4 rather than as a replacement, because the NodePool
phrasing in scenario 3 tests the same quota knowledge without depending on the
orchestration shape — that is what makes it the durable one.

What the run-shaped wording is actually good for is a discrimination the
NodePool wording cannot ask for. Reading `er-k8s/src/classify.rs`, **two
unrelated causes both end in `PreStartVerdict::CapacityWait`**:

- an account EC2 vCPU ceiling — the NodeClaim cannot place, the pod is
  `Unschedulable`, NodeClaims churn;
- a Kubernetes `ResourceQuota` on the namespace — the controller's own message
  carries `exceeded quota` and no NodeClaim is attempted at all.

Different layers, non-overlapping remedies. So the scenario's query names the
wrong one on purpose ("the namespace has a ResourceQuota — did we undersize
it?") and the must-list is to separate them; accepting the premise is the miss.

Credit items are drawn from the same source rather than invented: that twenty
minutes is past the unschedulable bound so a capacity wait should already be on
the `task_instance` row (`executor.rs:819` → `task_instance::update::capacity_wait`),
and that a capacity wait spends no launch because "a starved account is the
operator's problem, never the tenant's".

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…ference

Found sweeping my own #694 change. `gen_aws_footprint` derives "services with
nothing declared" by matching a hand-maintained candidate list against the
`resource "aws_*"` types in `infra/terraform`. The candidate list is the only
input a human edits, so it is the only place a typo can hide — and the failure
is **silent**: a pattern that matches nothing reports its service as absent, and
the drift check sees a perfectly self-consistent file.

That is the shape of the bug the generator was written to retire. The skill
asserted "there is no ... Athena, Glue ... SNS ..." while all three were
declared, and nothing caught it for weeks because an asserted absence is the one
claim the thing it describes cannot falsify. Deriving the list removed the
stale-prose failure but left this one.

Two assertions, neither hard-coding which services exist today:

- every alternation is a well-formed `aws_*` resource-type prefix;
- the set difference holds **both ways** — a candidate whose pattern matches a
  declared type must not be on the absence list, and one that matches nothing
  must be.

Both mutation-tested, since this suite's own standard is that a test which
cannot distinguish the fix from the bug proves nothing:

- `Lambda|aws_lambda_` -> `ws_lambda_` fires the shape assertion only;
- `SNS|aws_sns_` -> `aws_snsX_` (a present service whose pattern stops matching)
  fires the both-ways assertion only, reporting `[SNS absent but not listed]`.

Each mutation was confirmed applied before running, and the file restored after;
the suite returns to all-green on revert.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
`make skills-check` passed clean on #694 while CI's skills job failed, because
`scripts/ci/skills-check-test.sh` was wired only into `rust.yml`. The local gate
could not see a piped `grep -q` that the self-test exists to reject, so the
shape error cost a full CI cycle to learn about — in a job that is not even a
required check.

This is the one `scripts/ci/*-test.sh` that belongs in a make target, and the
distinction is not special-casing: it tests the very script this target runs,
and it is pure bash with no toolchain, no cluster and no cloud credentials.
`tf-helpers-test.sh` needs terraform and `kind-assertions-test.sh` needs a
cluster, which is why those stay CI-only.

Ordered first because the self-test is sub-second and checks the gate itself —
no reason to pay the regen to find out the gate is malformed.

Two consequences worth recording, both surfaced by the gate rather than by me:

- `rust-conventions/references/gates.md` carries a GENERATED block deriving each
  make target's command from the Makefile, so this edit made it stale and
  `skills-check` failed on its own drift check. The regenerated block is
  included here, which is the whole point of that gate.
- That generator renders a multi-line recipe as `a; b`, which reads as "b runs
  even if a fails" — false for make, which stops at the first failing line. So
  the recipe is **one** line with `&&`, making the fail-fast explicit in the
  generated doc instead of only in make's semantics.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…s two

Surfaced by verifying the scenario added two commits ago, which is the point of
writing evals against a real failure. The new scenario's must-list asks a reader
to separate an account vCPU ceiling from a namespace `ResourceQuota` — and
`ResourceQuota` appeared nowhere in this skill. `infra-platform` owns that
concept, so the scenario required knowledge the skill did not carry.

The gap is in the skill, not the test. The body asserts **"A pod stuck
`Pending` with no scheduling event is this, until proven otherwise"** and then
never says what the other candidate is, so the trap over-triggers: every
`Pending` pod reads as a quota increase request.

`er-k8s/src/classify.rs` already distinguishes them, and the discriminator is
sharper than the symptom:

- a pod that **exists** and is `Unschedulable`, with NodeClaims appearing and
  being torn down → the account ceiling;
- **no pod at all**, `active == 0`, and a `FailedCreate` Event carrying
  `exceeded quota` → the namespace `ResourceQuota`, charged at admission so the
  Job controller never creates one.

Both land the same `PreStartVerdict::CapacityWait`, which spends no launch, so
the verdict cannot tell them apart — only the evidence underneath it can. That
is now a table in the trap section, with the `ResourceQuota` column routed to
`infra-platform`.

The eval's wording is corrected to match the source in the same commit: it said
"no NodeClaim is attempted", which is a consequence rather than the condition
the code tests.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@athvin
athvin force-pushed the followup/aws-skill-audit-followups branch from 1175094 to e20e254 Compare November 6, 2026 06:35
@athvin
athvin merged commit c75dc83 into main Nov 6, 2026
39 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.

2 participants