Repository navigation
fix(skills): measure the Codex description cut, and fix the one misroute it caused - #831
Conversation
CI red here is the account, not this diff — do not "fix" itEvery job on this pull request failed in ~2 seconds having executed zero Evidence, in the order it rules things out:
Both Codex pull requests (#830 and #831) failed identically, across five The onset is sharp: healthy at What to do: check Actions billing / spending limits on the account, then |
…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]>
83fddbe to
34ff7e4
Compare
Closes #825
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
descriptionat ~650 characters, so 94 of the 105for … see …routing clauses in the tree (89%) do not exist at selection timeand 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 whenclause carries enough trigger vocabulary by itself. That isthe 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-frameworkoversql-analysis:entity-framework✗sql-analysis✓sql-analysisThe 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 ofsql-analysis's — the skill that owns the decision.After trimming 114 characters of
sql-analysis's what clause (putting thediscriminator at 600), the same prompt set scores 5 of 5.
make checkgreen, includingskills-check's drift arm over the regeneratedblock.
Risk & rollback
One description is shorter; its
Doingrow inCLAUDE.mdand its inventory roware 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 whenanother vendor moves it. Rollback:
git revert <merge-sha>.Post-merge ledger
Closed by: agent · session
c19a9a1f-4446-4d2f-bd7d-5ac2d0f08ecaonMac· 2026-11-08T02:52:00Zmainis green with this change on it — merge SHA5e62a87d, allfour push runs succeeded with real work done:
rust23 jobs /251 steps,
frontend9/8,infra8/5,devcontainer2/5, zerofailures. 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. Nothingunder
^rust/or^frontend/, which is whatimages-detect.shkeys on,and
gh run list --commit 5e62a87d --workflow images.ymlreturns zeroruns — the workflow did not trigger at all.
deploy—n/a — nothing to deploy.Fires onworkflow_runafterimages, which did not run. A description edit reaches no container.driftscheduled 2026-11-07T06:01 success,
kindscheduled 2026-11-07T06:44success. The
deploypush-trigger failure on70f31c54predates thismerge 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.
Donethrough the automation: Codex truncates skill descriptions at ~670 chars — every routing tail is invisible there #825 readsCLOSED / COMPLETED, cardDone, and theClosedEvent'scloser.__typenameisPullRequest— the merge closed it, not a handedit to
Status.sibling Codex ticket No PreToolUse guard under Codex: aws-write-guard and permissions.deny do not port #826 landed separately as
43da3b62.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 theinstruction to re-run it in Codex. Memory:
codex-agent-config-bridgerecords "measure, do not sweep" and the asymmetry rule.
Specific to this change
mainin Codex — not againstthe branch, and not inferred from a green gate, because this is a
selection test and
make checkcannot observe Codex's cut. On5e62a87d: the discriminator ends at character 600 (inside the ~648window) and Codex answered 5 of 5, with the previously-misrouted
question now selecting
sql-analysisinstead ofentity-framework.TRIGGER TEXTrows re-read with both Codex pull requests onmain— and this is the item that earned its place: the re-read found adefect in what this change shipped.
deferred — #834. The classifiersplits two ways (
tail only/TRIGGER TEXT) over a three-way reality,so it labels any non-tail overflow as trigger text.
sql-analysisstillreads
TRIGGER TEXTdespite its discriminator now being visible andselecting 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
Quantify which routing clauses fall inside the cutPick adjacent pairs whose only disambiguator is in the cut, and measureAttribute any miss to truncation with a within-model A/BFix only what measurably broke; make the constraint visible for the restDiscoveries
because they carry
disable-model-invocation:health-sweepandclaim-ticketare user-invoked only, so the model declining to select them iscorrect behaviour and would have scored as a false negative.
sql-analysis,land-prandfrontend-data-uieach lose part of theUse whenclause itself, not merely the tail — and all three still routedcorrectly. That is what moved the conclusion from "probably fine" to
"measured fine".
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".
discriminator to the front of
Use whenworked for Codex and silentlyrewrote
CLAUDE.md'sDoingrow, becausegen_skill_inventoryderives thatrow from the first
Use whenitem — sosql-analysisstopped being listed aswhere 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
Use whentext tooFiles
.claude/skills/sql-analysis/SKILL.md— 114 characters of what trimmed.claude/skills/sql-analysis/evals.md— scenario 8, the selection regressionscripts/skills-check.sh— thedescription-budgetgenerator gains thetail-vs-trigger table
.claude/skills/skill-writer/references/agent-skills.md— the authoring rule,the measurement, and the rejected alternative