Skip to content

fix(skills): measure the Codex description cut, and fix the one misroute it caused - #831

Merged
athvin merged 1 commit into
mainfrom
fix/825-codex-description-routing
Nov 8, 2026
Merged

athvin merged 1 commit into
mainfrom
fix/825-codex-description-routing

Conversation

@athvin

@athvin athvin commented Nov 8, 2026 •

Copy link
Copy Markdown
Owner

Closes #825

Post-merge is part of this pull request. The ledger below records whether
the follow-up work actually happened. /land-pr closes it.

What

Answers #825 with the measurement it asked for, fixes the single misroute that
measurement found, and makes the constraint visible to authors instead of
sweeping 27 descriptions. One description changes.

Why

Codex truncates every skill description at ~650 characters, so 94 of the 105
for … see … routing clauses in the tree (89%) do not exist at selection time

and 17 skills lose every clause they have. The ticket's own instruction was to
measure before rewriting anything, because the cap is established and the
consequence was not.

Proof

Ten routing trials, each a prompt whose correct skill is one of an adjacent pair
whose disambiguator sits in the cut region. Nine selected correctly — the
surviving Use when clause carries enough trigger vocabulary by itself. That is
the result that justifies leaving 26 of the 27 over-cap descriptions alone.

The tenth names a rule. Asked "should this new query be a declared statement or
a plan-vector-tested generator?"
, Codex chose entity-framework over
sql-analysis:

truncated (real Codex) full descriptions, same model expected
that question entity-framework ✗ sql-analysis ✓ sql-analysis
the other 4 all correct all correct —

The within-model A/B is what attributes it to truncation rather than to model
judgment: same model, same question, only the descriptions differ. The phrase
sits at character 186 of entity-framework's description and was at 748 of
sql-analysis's — the skill that owns the decision.

After trimming 114 characters of sql-analysis's what clause (putting the
discriminator at 600), the same prompt set scores 5 of 5.

make check green, including skills-check's drift arm over the regenerated
block.

Risk & rollback

One description is shorter; its Doing row in CLAUDE.md and its inventory row
are unchanged, which was the explicit constraint on the fix. The new generated
table is derived, so it cannot go stale, and it names the probe
(codex debug prompt-input) so the ~650 constant can be re-measured when
another vendor moves it. Rollback: git revert <merge-sha>.

Post-merge ledger

Closed by: agent · session c19a9a1f-4446-4d2f-bd7d-5ac2d0f08eca on Mac · 2026-11-08T02:52:00Z

  • main is green with this change on it — merge SHA 5e62a87d, all
    four push runs succeeded with real work done: rust 23 jobs /
    251 steps, frontend 9/8, infra 8/5, devcontainer 2/5, zero
    failures. Step counts rather than conclusions, because a starved run also
    reports a conclusion — this repo spent ~90 minutes red on exactly that
    earlier today, every job 0 steps, which is why both of these pull requests
    sat unmergeable until an account billing fix.
  • images — n/a — correctly never ran. This commit's own diff
    (5e62a87d^..5e62a87d) is four files: two .claude/skills/sql-analysis/
    files, the agent-skills standard, and scripts/skills-check.sh. Nothing
    under ^rust/ or ^frontend/, which is what images-detect.sh keys on,
    and gh run list --commit 5e62a87d --workflow images.yml returns zero
    runs — the workflow did not trigger at all.
  • deploy — n/a — nothing to deploy. Fires on workflow_run after
    images, which did not run. A description edit reaches no container.
  • the push-only surface no pull request can pre-test is green: drift
    scheduled 2026-11-07T06:01 success, kind scheduled 2026-11-07T06:44
    success. The deploy push-trigger failure on 70f31c54 predates this
    merge by five hours and is deploy.yml's push trigger was a misdiagnosis — remove it and gate what it was protecting #661/deploy.yml: a mixed infra/k8s + image-input commit always produces one spurious red deploy #817, not this change.
  • the board card reached Done through the automation: Codex truncates skill descriptions at ~670 chars — every routing tail is invisible there #825 reads
    CLOSED / COMPLETED, card Done, and the ClosedEvent's
    closer.__typename is PullRequest — the merge closed it, not a hand
    edit to Status.
  • follow-ups — skills-check: the Codex-cut table over-reports TRIGGER TEXT, because non-tail is not the same as trigger text #834, filed against this change (see below). The
    sibling Codex ticket No PreToolUse guard under Codex: aws-write-guard and permissions.deny do not port #826 landed separately as 43da3b62.
  • what was learned is written down: the authoring rule — a term two
    skills share, where one owns it, must sit inside the first ~650
    characters of the owner's description — is beside the negative-routing
    rule in the agent-skills standard, with the measurement, the within-model
    A/B that attributes it to truncation, and the rejected
    reorder-the-triggers alternative. The measured case is eval scenario 8 in
    sql-analysis/evals.md, written as a selection test with the
    instruction to re-run it in Codex. Memory: codex-agent-config-bridge
    records "measure, do not sweep" and the asymmetry rule.

Specific to this change

  • Eval scenario 8 re-run against merged main in Codex — not against
    the branch, and not inferred from a green gate, because this is a
    selection test and make check cannot observe Codex's cut. On
    5e62a87d: the discriminator ends at character 600 (inside the ~648
    window) and Codex answered 5 of 5, with the previously-misrouted
    question now selecting sql-analysis instead of entity-framework.
  • The TRIGGER TEXT rows re-read with both Codex pull requests on
    main
    — and this is the item that earned its place: the re-read found a
    defect in what this change shipped. deferred — #834. The classifier
    splits two ways (tail only / TRIGGER TEXT) over a three-way reality,
    so it labels any non-tail overflow as trigger text. sql-analysis still
    reads TRIGGER TEXT despite its discriminator now being visible and
    selecting correctly, because what it loses past the cut is a what
    clause sentence — "This skill owns the E0xx remedies and the oracle's
    verdict;" — which costs nothing. 16 of 27 rows are flagged while the
    measurement found at most one that matters. It errs fail-safe, but the
    label is what people skim, and the hazard is someone performing the
    27-description sweep this ticket rejected on evidence.
Context — plan, discoveries, measurements, files

Plan

  1. Quantify which routing clauses fall inside the cut
  2. Pick adjacent pairs whose only disambiguator is in the cut, and measure
  3. Attribute any miss to truncation with a within-model A/B
  4. Fix only what measurably broke; make the constraint visible for the rest

Discoveries

  • Two skills had to be dropped from the eval, not because they failed but
    because they carry disable-model-invocation: health-sweep and
    claim-ticket are user-invoked only, so the model declining to select them is
    correct behaviour and would have scored as a false negative.
  • Three of the five pairs in the first batch were already adversarial —
    sql-analysis, land-pr and frontend-data-ui each lose part of the
    Use when clause itself, not merely the tail — and all three still routed
    correctly. That is what moved the conclusion from "probably fine" to
    "measured fine".
  • Truncation is not symmetric, and that is the whole mechanism. It does not
    only remove information from the skill that owns a term; it leaves that term
    visible in a neighbour that merely mentions it. Whichever description says it
    earlier wins. That reframing is what makes the fix narrow — the question is
    never "is this description too long", it is "is a shared discriminating term
    late here and early next door".
  • Reordering the triggers was the obvious fix and the wrong one. Moving the
    discriminator to the front of Use when worked for Codex and silently
    rewrote CLAUDE.md's Doing row, because gen_skill_inventory derives that
    row from the first Use when item — so sql-analysis stopped being listed as
    where an E0xx diagnostic goes. Caught by regenerating and reading the diff.
    Trimming the what clause instead — this standard's own prescription, since
    the body carries that material — satisfies both and improves 1,024-cap
    headroom as a side effect.

Measurements

Batch Prompts target Codex result
1 five adjacent pairs, disambiguator in the cut 5 / 5
2 five pairs whose trigger words exist only in the cut 4 / 5
2, full descriptions (control) same questions, same model 5 / 5
2, after the fix same questions, real Codex 5 / 5
Clause census
routing clauses in the tree 105
invisible to Codex 94 (89%)
skills losing every clause 17 of 28
skills losing Use when text too 15
observed cut point 648–652 chars, word boundary

Files

  • .claude/skills/sql-analysis/SKILL.md — 114 characters of what trimmed
  • .claude/skills/sql-analysis/evals.md — scenario 8, the selection regression
  • scripts/skills-check.sh — the description-budget generator gains the
    tail-vs-trigger table
  • .claude/skills/skill-writer/references/agent-skills.md — the authoring rule,
    the measurement, and the rejected alternative

@athvin

athvin commented Nov 8, 2026

Copy link
Copy Markdown
Owner Author

CI red here is the account, not this diff — do not "fix" it

Every job on this pull request failed in ~2 seconds having executed zero
steps
, with no log and no annotation. That is the starved-runner signature
ci-and-supply-chain documents: no runner was ever allocated, so nothing in the
diff can be responsible and no change here will make it green.

Evidence, in the order it rules things out:

Check Result
steps executed, across every job of all 5 workflows 0 (a healthy rust run is ~33)
job duration 2s (01:06:10 → 01:06:12)
job log log not found
check-run annotation / summary empty
rerun (run_attempt: 2) reproduced — still 0 steps
last healthy allocation in this repo 01:00:46, another branch, steps 5/5/33/8/6
GitHub Actions status page operational, no incident
repo Actions permissions enabled: true, allowed_actions: all
repo visibility PUBLIC (so this is not public-repo minutes)

Both Codex pull requests (#830 and #831) failed identically, across five
workflows, at 01:06:10 and 01:06:51. #831 changes no workflow file at
all
— only .claude/** and scripts/skills-check.sh — yet its infra,
frontend, devcontainer and pr-contract runs failed the same way. A diff
cannot produce that shape.

The onset is sharp: healthy at 01:00:46, starved from 01:06:10. That points
at an account-level Actions block — a spending limit or a payment problem —
which is a billing setting rather than anything in this repository.

What to do: check Actions billing / spending limits on the account, then
re-run these runs. Nothing needs rebasing and nothing needs editing; both
branches passed make check locally before being pushed.

…ute it caused

#825 asked whether Codex truncating every skill `description` at ~650
characters actually costs anything, and said to measure before rewriting 27
descriptions. Measured, and the answer is mostly no — with one exception that
names a rule.

WHAT IS LOST. 94 of the 105 `for … see …` routing clauses in the tree — 89% —
do not exist at selection time in Codex. 17 skills lose every clause they have,
and 15 lose part of the `Use when` clause as well.

WHAT IT COSTS. Ten routing trials, each a prompt whose correct skill is one of
an adjacent pair whose disambiguator sits in the cut region. Nine selected
correctly. The surviving `Use when` carries enough trigger vocabulary by
itself, so the sweep this ticket contemplated would have been churn with no
evidence behind it. That is the finding, and it is why 26 of the 27 over-cap
descriptions are untouched here.

THE ONE THAT FAILED, AND THE RULE. Asked whether a new query should be "a
declared statement or a plan-vector-tested generator", Codex chose
`entity-framework` over `sql-analysis`. The phrase is at character 186 of
`entity-framework`'s description and was at 748 of `sql-analysis`'s — which
owns the decision. Attributed to truncation rather than model judgment by a
within-model A/B: same model, same question, full descriptions pasted in, and
it picks `sql-analysis`.

So truncation does not merely drop information, it hands a shared term to
whichever skill mentions it earlier. Stated as an authoring rule next to the
negative-routing one: a term two skills share, where one owns it, must appear
inside the first ~650 characters of the owner's description.

THE FIX, AND THE ONE THAT WAS REJECTED. Reordering `sql-analysis`'s triggers to
put the discriminator first worked for Codex and broke something else: the
inventory generator derives the `Doing` row from the first `Use when` item, so
`CLAUDE.md` stopped saying `sql-analysis` is where an E0xx diagnostic goes.
Trimming 114 characters of the **what** clause instead — the fix this standard
already prescribes, because the body carries that material — puts the
discriminator at 600, leaves the row intact, and improves headroom against the
1,024 cap too. Codex then selects `sql-analysis`: 5 of 5 on the re-run.

The description-budget block now carries a second table: for every description
past Codex's cut, whether what falls past it is `tail only` or `TRIGGER TEXT`.
That is the actionable distinction, it is derived rather than stated, and the
generator names the probe (`codex debug prompt-input`) so the constant can be
re-measured when another vendor moves it.

`sql-analysis/evals.md` gains the measured case as scenario 8 — a selection
test rather than a content test, with the instruction to re-run it in Codex,
since the cut is only observable from the agent that has it.

Closes #825

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@athvin
athvin force-pushed the fix/825-codex-description-routing branch from 83fddbe to 34ff7e4 Compare November 8, 2026 02:33
@athvin
athvin merged commit 5e62a87 into main Nov 8, 2026
43 checks passed
@athvin
athvin deleted the fix/825-codex-description-routing branch November 8, 2026 02:56
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.

Codex truncates skill descriptions at ~670 chars — every routing tail is invisible there

2 participants