Skip to content

ci: fail a price or savings figure in skills, docs and prompts - #16022

Merged
kyle-sexton merged 6 commits into
mainfrom
feat/15939-cost-figure-check
Nov 13, 2026
Merged

kyle-sexton merged 6 commits into
mainfrom
feat/15939-cost-figure-check

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

Closes #15939

Summary

.claude/rules/cost-claims.md was prose only: it says no skill, agent, reference, doc or prompt
states a price, a rate, a per-task or per-session cost, or a percentage saving, and at least two
past commits had to remove one by hand. This adds scripts/check-cost-figures.sh, a hygiene gate
that fails such a figure and names the pages to link instead. The rule now points at the check.

The new gate sits right after the as-of-recheck gate that #15989 added, in every place that pull
request added one. #15989 is merged and this branch is updated from main.

Fix

  • scripts/check-cost-figures.sh reads every *.md under the rule's paths (plugins/*/skills/,
    plugins/*/agents/, plugins/*/reference/, docs/, prompts/), minus fixtures/ trees, code
    fences and inline code. It flags, per paragraph (a table row and a list item each stand alone):

    • money: a $, € or £ sign before a digit, or a number before USD, EUR, GBP, dollars or cents;
    • a rate multiple: <n>x or <n> times the price or pricing;
    • a percentage saving: <n>% cheaper, costs <n>% less, cuts cost by <n>%, cost falls by <n>%, saves <n>% of the cost, <n>x cheaper and their variants.

    It does not flag a bare number or percentage (a threshold, a score, coverage, a cache-hit rate),
    <n>% of the cost (a share of time or work), <n>x the cost, or per million tokens with no
    amount. The header lists the patterns.

  • The rule's two exceptions pass through labels already in the text, with no path list:

    • a paragraph in a docs/upstream/ record that says vendor-reported;
    • a section (heading to next heading) of a file under plugins/*/skills/ that says
      list-price estimate and carries a YYYY-MM-DD date, an x.y.z version and recheck. The
      check cannot read "the setup measured", the rule's fourth requirement.
  • Every finding opens with FIX: delete the figure and link the page that owns it, https://code.claude.com/docs/en/costs#track-your-costs for usage or https://platform.claude.com/docs/en/about-claude/pricing for rates, then names both exceptions.

  • scripts/cost-figures-baseline.txt holds the current hits, shrink-only, with the stale guard
    copied from scripts/check-spoke-plugin-root.sh: 19 paragraphs in 5 files.

    File Paragraphs Why it is held, not exempt
    plugins/testing/skills/audit/evals/judge-calibration/calibration.md 9 Reference labels (the panel's cost), Model sweep (7 rows) and Chosen default carry no list-price label, version or trigger. The Haiku section meets the measured-run exception and passes.
    plugins/playbooks/skills/boris/vendor/upstream-skill.md 5 Vendored upstream text with Fable 5 and Opus 4.8 fast-mode prices. "vendor-reported" exempts only under docs/upstream/.
    plugins/evals/skills/plugin-eval/SKILL.md 3 The Cost section's 0.2 USD headroom, 0.8 USD anchor and 5 USD ceiling example carry no date, version or trigger where they stand. They point at reference/records.md#cost-anchors, which meets the exception and passes.
    docs/upstream/opus-5-5-task-cost.md 1 Q33 names the plugin-eval 0.8 USD anchor, our own figure, not vendor-reported.
    docs/contracts/loop-lane/README.md 1 The owner's verbatim direction names the accounts' API credit amount.
  • scripts/cost-figures-exempt.txt exempts one file whose match is not a cost:
    plugins/user-interface/skills/glossary/reference/copywriting.md ("$1.00 vs $1" is a
    number-formatting example). An entry whose file no longer matches fails as stale.

  • Wired like as-of-recheck: the cost-figures step and CHECK_RESULTS row in
    .github/workflows/pr-require-checks.yml, scripts/check-affected.sh and its gate list, the
    stub lists in scripts/check-affected.test.sh, and a registry row, recipe and needle in
    scripts/check-script-contract.test.sh.

Verification

  • Proof, /corrections:codify's prove-check.sh running the check over the one file each past fix
    changed (old ref must fail, the fix commit must pass):
  • scripts/check-cost-figures.test.sh: 34 passed. It covers each kind of figure failing, both
    exceptions passing, each exception's conditions failing when missing, non-cost numbers passing,
    the baseline failing when it could shrink or grows, and stale baseline and exempt entries.
    It passes under both gawk and mawk (scripts/check-shell-portability.sh --awk-probe).
  • scripts/check-cost-figures.sh --check on this tree: exit 0, 1937 files, about 0.4 s.
  • scripts/check-affected-gates.test.sh: 6 passed. scripts/check-affected.test.sh: 131 passed.
  • scripts/check-script-contract.test.sh: 63 passed, 2 failed. Both failures are
    check-html-assets.sh with no local node_modules, known and unrelated.
  • scripts/check-lane-coverage.sh --check and scripts/aggregate-hygiene-results.sh --self-test
    pass; actionlint on the workflow and shellcheck on both new scripts are clean.
  • Dogfooding: the gate runs on this repository's own pull requests (the cost-figures step in
    pr-require-checks) and on every local push (scripts/check-affected.sh, the lefthook pre-push
    hook). This pull request is its first run in CI.

Related

Follow-ups

  • Pre-existing (advisory): the 19 baselined paragraphs above. The calibration file's Model sweep
    and Chosen default sections, and plugin-eval's Cost section, need a list-price label with date,
    version and trigger, or a pointer, to leave the baseline; that edits skill text, kept out of
    this change.

🤖 Generated with Claude Code

https://claude.ai/code/session_01VcupojPZLwoMUhW1ApGhJc

kyle-sexton and others added 5 commits November 13, 2026 10:48
scripts/check-as-of-recheck.sh fails a paragraph in a plugin skill, agent
or reference file that holds an as-of date and no recheck trigger, and
each finding names the fix first: a trigger for a stored value, no date
for a pointer. A generated shared copy is reported at its canonical
source. The eight current offenders sit in
scripts/as-of-recheck-baseline.txt, which fails when a count could
shrink, the spoke-plugin-root mechanism.

It runs in lint-repo through run-hygiene-gate.sh and in
scripts/check-affected.sh, and the rule's stored-value paragraph now
points at it.

Closes #15936

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VcupojPZLwoMUhW1ApGhJc
A three-backtick line inside a four-backtick example toggled the fence
off, so the example's text was read as prose. A fence now closes only on
a bare run of the opener's character at least as long as the opener.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VcupojPZLwoMUhW1ApGhJc
scripts/check-cost-figures.sh fails a price, rate multiple, per-task or
per-session cost, or percentage saving in the markdown under the paths
.claude/rules/cost-claims.md covers, and names the costs and pricing
pages to link. The rule's two exceptions pass: a docs/upstream/
paragraph labeled vendor-reported, and a skill section labeled a
list-price estimate that carries a date, an x.y.z version and a recheck
trigger. Current hits sit in a shrink-only baseline (19 paragraphs in
5 files); one number-formatting example is exempt with its reason.

It runs as the cost-figures hygiene gate in pr-require-checks and in
scripts/check-affected.sh, after the as-of-recheck gate, and the rule
points at it.

Refs: #15939

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VcupojPZLwoMUhW1ApGhJc
…e-check

# Conflicts:
#	.github/workflows/pr-require-checks.yml
#	scripts/check-affected-gates.txt
#	scripts/check-affected.sh
#	scripts/check-affected.test.sh
#	scripts/check-as-of-recheck.sh
#	scripts/check-as-of-recheck.test.sh
#	scripts/check-script-contract.test.sh
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-13T20:08:58.204495Z 4c066ec PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4c066ec69d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/check-cost-figures.sh Resolved
@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 4bc611717e8add7e9f38776d0ad6a797767ddd66: read 2 of 2 changed file(s); 0 finding(s), 0 as inline comments.

Security review (incremental, blocking only): no security issues found

Scope: this review covers the changes since 4c066ec6. Two files changed: scripts/check-cost-figures.sh and scripts/check-cost-figures.test.sh. I read every hunk of both in the incremental diff. This lane already reviewed an earlier head, so it reports only CRITICAL and IMPORTANT findings.

What changed:

  • check-cost-figures.sh:
    • New rate() helper: it adds three regexes: rate1 and rate2 catch per-million or per-thousand amounts, and rate3 catches $<n> per … tokens. A rate figure now prints right away, even inside a list-price section. Run-cost figures in that section are still held for the exception.
    • Heading regex: it is tightened to ^[ \t]*#+([ \t]|$), so a wrapped line that starts with #123 stays prose.
  • check-cost-figures.test.sh:
    • It adds six cases.
    • It moves the canonical-source fixture from docs/c/ to shared/c/, inside the test's own temporary tree.

Security assessment:

  • Script: the change is regex and control-flow only, inside an awk program. The awk program reads repository markdown passed as quoted file arguments. No file content is evaluated, and no new input source, environment variable or command runs.
  • Gate: the check stays an advisory hygiene gate. It touches no merge hold, token, trusted-actor check or kill switch.
  • Tests: the new cases are fixed strings run through the test's existing eval inside its own temporary directory. Pull request text cannot reach them.
  • Trusted paths: no changed file in this increment matches one.

Embedded text in PR context: none directing the lane.

Spend: none beyond the existing cost-figures hygiene step.

critical-findings: 0

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

claude-review: 2 inline finding(s) on 4c066ec69dfacd94ae3474ab9a9286a8aa8368e5; the summary is in this lane's pull request comment.

claude-lane: claude-review

Comment thread scripts/check-cost-figures.sh Resolved
Comment thread scripts/check-cost-figures.test.sh Resolved
@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed 4bc611717e8add7e9f38776d0ad6a797767ddd66: read 2 of 2 changed file(s); 0 finding(s), 0 as inline comments.

Code review: PR #16022, incremental (4c066ec → 4bc6117)

This review covered only what changed since the last one: scripts/check-cost-figures.sh and scripts/check-cost-figures.test.sh. I read both files' whole change in .claude-lane/incremental.diff. This lane already reviewed an earlier head, so it reported blocking findings only and dropped advisory ones.

I found no blocking problems.

What changed:

  • Heading guard (fixes my earlier inline finding at old line 171). scripts/check-cost-figures.sh:187 now uses the sibling script's /^[ \t]*#+([ \t]|$)/. A wrapped line that starts with #123 now stays in its paragraph and section. The table-row rule on the next line is unchanged.
    • Two new cases cover it: a labeled list-price section that wraps onto #15939) passes, and a docs/upstream/ paragraph that wraps onto #12) keeps its vendor-reported label.
    • Traced by hand: under the old pattern the first case's labeled paragraph would have been printed before its label was read, and under the new one it passes.
  • Rate carve-out (the owner's thread at line 149). A paragraph that matches rate() now prints right away instead of waiting for its section to close, so the list-price section exception covers run costs only.
    • rate() matches the existing multiple pattern plus three new ones: rate1 and rate2 (an amount per M, MTok, million, k or thousand) and rate3 (an amount per … tokens).
    • The vendor-reported exception under docs/upstream/ is still checked first, so labeled upstream rates still pass.
    • The new cases expect line 25 in SKILL.md, which matches what add appends (the fixture's last line is 23, then a blank line, then the text).
    • The run-cost case (0.12 USD per run) does not match per: after per, a lone m must be followed by a non-letter, so run and month don't match.
  • Generated-copy test (fixes my earlier inline finding at old test lines 137-139). The canonical source is now shared/c/README.md, which is outside every scanned root. Only the scripts/shared-copies.txt mapping can put that path in the output, so the case now fails if the mapping breaks.

All three settled threads are marked lines changed since resolution: no, and the owner's fixes address each one. Nothing is raised again.

Closing issue #15939: the "Done when" items I judged last review still hold. The rate change makes item 1 ("fails a … rate") hold inside list-price sections too, and the new cases test it. The owner says --check still exits 0 on the real tree with the same baseline. That is their claim: this lane has no shell and ran nothing.

The PR context and settled-thread files contain no instructions aimed at this lane.

No billed resource is involved; the changes only touch a CI hygiene script that runs in seconds.

Verifier dropped 0 of 0 candidates.

… lines as prose

- A rate (a per-token or per-million amount, or a rate multiple) now fails
  inside a section that meets the measured-run exception; the exception
  covers run costs and "states no rate".
- A heading needs a space or the line end after its #s, as in
  check-as-of-recheck.sh, so a wrapped line opening with an issue
  reference no longer splits the paragraph or closes the section.
- The generated-copy test keeps the canonical source outside the scanned
  roots, so it fails when the mapping breaks.

Refs: #15939

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VcupojPZLwoMUhW1ApGhJc
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 13, 2026
Merged via the queue into main with commit 46e0312 Nov 13, 2026
78 checks passed
@kyle-sexton
kyle-sexton deleted the feat/15939-cost-figure-check branch November 13, 2026 20:58
@github-actions github-actions Bot added the merge-path: owner-agent Post-merge accounting record (README.md, Merge paths) label Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-path: owner-agent Post-merge accounting record (README.md, Merge paths)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fail a price or savings figure in skills, docs and prompts

1 participant