W0 S-fix batch: #230 pricing, #234.4 gate alignment, #53 deprecation warning, #91 docs - #268
Conversation
…ation, #91 docs Four S-size fixes from the W0 phase (#258), plus a .dev maintenance pass. #230: PRICING gains claude-opus-5 ($5/$25/MTok — Opus 5 spend had reported as $0.000 across two code paths), plus fable-5 and haiku-4-5; costUSD warns once per unpriced model while still returning 0, because zero is a legitimate value (cache-only responses) and must not double as the unknown sentinel. VALID_MODEL_PATTERNS gains opus-5/fable-5 in the same change (same cause). #234 item 4: the scaffolded resync gate used contains() while the action's parser requires startsWith on the trimmed body, so a comment merely quoting \translate-resync started a secrets-bearing runner that no-op'd. The gate, every doc and example quoting it, and the harness template now use startsWith; the FAQ and action reference state the command-first rule. Accepted residual: GitHub's startsWith does not trim, so a comment with leading whitespace before the command no longer fires the workflow. #53: reading the legacy heading-map: frontmatter now logs a deprecation warning (once per process — the reader has no filename to report) naming npx translate headingmap. Fallback removal itself stays W6. #91: heading-maps.md documented lowercase-hyphenated MyST-style keys — a format no writer has ever produced. Keys are heading text verbatim minus markers and MyST roles, with ::-joined parent paths for nesting; the page, the FAQ, fresh-setup, and AGENTS.md now match cleanHeading's actual behavior. connect-existing.md already showed the real format. .dev: STATE.md rewritten to ~1 page against current truth (verified 2026-08-11); FUTURE.md model-allowlist staleness line updated; session log added. dist-action/ rebuilt — heading-map.ts and models.ts are in the bundle, so it legitimately changes here. Tests: 1516/1516; the three new tests fail on pre-fix source (verified by revert). Lint, format:check, check-dev-refs clean. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR batches several small W0 fixes across the action, CLI scaffolding, scripts, tests, and documentation: it adds missing pricing/model IDs (and makes unknown pricing loud), aligns the resync workflow gate with the action’s resync parser semantics, introduces a deprecation warning for the legacy heading-map: frontmatter format, and corrects user docs to reflect the actual heading-map key format. It also includes the corresponding .dev/ maintenance updates and a rebuilt dist-action/ bundle.
Changes:
- Add pricing entries + warn-once behavior for unpriced models; extend valid model patterns for Opus 5 / Fable 5.
- Align resync gate checks from
contains(...)tostartsWith(...)across generated templates, docs/examples, harness templates, and drift-guard tests. - Warn once per process when reading legacy
heading-map:frontmatter; update docs/examples to the correct heading-map key format and document deprecation.
Reviewed changes
Copilot reviewed 24 out of 25 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tool-test-action-on-github/test-action-on-github-data/sync-workflow-template.yml | Updates harness workflow template resync gate to startsWith(...) to match parser expectations. |
| src/models.ts | Adds claude-opus-5 / claude-fable-5 to the model validation patterns (non-fatal validation list). |
| src/heading-map.ts | Adds a once-per-process deprecation warning when legacy heading-map: frontmatter is read. |
| src/cli/commands/setup.ts | Updates scaffolded workflow YAML gate to use startsWith(...) for resync command detection. |
| src/cli/tests/workflow-templates.test.ts | Updates drift-guard expectation to match the new startsWith(...) resync gate. |
| src/cli/tests/setup.test.ts | Updates setup scaffolding test to expect startsWith(...) in generated YAML. |
| src/tests/inputs.test.ts | Adds Opus 5 / Fable 5 IDs to the “valid model” test coverage. |
| src/tests/heading-map.test.ts | Adds tests ensuring the legacy heading-map: warning fires once per process and still parses correctly. |
| scripts/glossary/lib.mjs | Extends pricing table (Opus 5/Fable 5/Haiku 4.5) and warns once per unknown/unpriced model while returning 0. |
| README.md | Updates documented workflow if: gate to startsWith(...) for \\translate-resync. |
| examples/README.md | Updates example workflow snippets to use startsWith(...) for resync gating. |
| docs/user/tutorials/fresh-setup.md | Fixes heading-map examples (keys are English heading text, not MyST-style IDs) and updates resync gate snippet. |
| docs/user/tutorials/connect-existing.md | Updates resync gate snippet to startsWith(...). |
| docs/user/tutorials/add-language.md | Updates resync gate snippets to startsWith(...). |
| docs/user/quickstart.md | Updates resync gate snippet to startsWith(...). |
| docs/user/heading-maps.md | Corrects heading-map key-format documentation and examples; documents :: paths and legacy deprecation warning behavior. |
| docs/user/faq.md | Updates resync-gate explanation (startsWith), and corrects heading-map YAML example keys. |
| docs/user/action-reference.md | Updates workflow gate snippets and clarifies the “command must start the comment” contract. |
| dist-action/index.js | Rebuilt bundle reflecting models.ts and heading-map.ts updates. |
| CHANGELOG.md | Adds [Unreleased] entries covering #230/#234.4/#53/#91 user-visible behavior changes. |
| AGENTS.md | Updates heading-map format description to match reality (verbatim heading keys + :: paths; legacy warning noted). |
| .dev/STATE.md | Refreshes state summary and verified date; reflects current tracker-based plan status. |
| .dev/log/2026-08-11-w0-sfix-batch.md | Adds session log entry documenting the W0 S-fix batch work and verification. |
| .dev/FUTURE.md | Marks model allowlist staleness item as done through Opus 5 / Fable 5; keeps structural question open. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Four S-size fixes from W0 (#258), plus the
.devmaintenance pass. Fixes #230, fixes #53, fixes #91; addresses item 4 of #234 (the rest of #234 is W1-shaped and untouched).#230 —
claude-opus-5costs reported as $0.000PRICINGinscripts/glossary/lib.mjsgainsclaude-opus-5($5/$25 per MTok),claude-fable-5($10/$50), andclaude-haiku-4-5($1/$5) — prices confirmed against Anthropic's current model documentation at fix time, not recalled from memory.costUSDnow warns once per unknown model while still returning 0: zero is a legitimate value (cache-only responses), so it must not double as an "unknown" sentinel — that ambiguity is exactly what made the missing entry invisible.VALID_MODEL_PATTERNSinsrc/models.tsgainsclaude-opus-5andclaude-fable-5in the same change, since both gaps had the same cause.#234 item 4 — resync gate aligned with the resync parser
The scaffolded sync workflow gated on
contains(github.event.comment.body, '\translate-resync')while the action requires the trimmed body tostartsWithit — so a comment merely quoting the command mid-text started a secrets-bearing runner that then no-op'd. Aligned tostartsWithin the scaffolder, the root and examples READMEs, four docs pages, both drift-guard tests, and the E2E harness template; the FAQ and action reference now state the command-first rule. Direction is deliberate: loosening the parser tocontainswould make any comment quoting the command trigger a full sync. One accepted residual, documented in the changelog: GitHub'sstartsWithdoes not trim, the action does, so a comment with leading whitespace before the command no longer fires the workflow — command-first-at-column-one is the contract.#53 — legacy
heading-map:deprecation warningextractHeadingMapwarns when it takes the legacy fallback — once per process, since the function has no filename to report and per-read repeats would add noise without information. The warning names the migration command (npx translate headingmap). Removal of the fallback itself stays scheduled for W6; this is the notice period. Tests usejest.isolateModulesfor a fresh once-flag per test.#91 — heading-maps.md documented a format no writer ever produced
The page taught lowercase-hyphenated MyST-style IDs (
model-description: "模型描述"). Keys are actually the English heading text with#markers and MyST roles stripped and nothing else changed, with::-joined parent paths for nested headings at any depth — verified againstcleanHeadinginsrc/heading-map.tsbefore rewriting. Fixed the page (prose, both examples, the key-rules table), plus the same wrong examples in the FAQ, the fresh-setup tutorial, and AGENTS.md (which also claimed "no nesting").connect-existing.mdalready showed the real format; a docs-wide grep afterward comes back clean. #90'scanonicalizeHeading()— one code-level answer to "what is a key" — remains open and is not attempted here..dev maintenance
STATE.mdrewritten to its ~1-page budget against current truth (verified: 2026-08-11— the old top half predated the #257 plan);FUTURE.md's model-allowlist staleness line marked done-through-opus-5; session log added.dist-action/is rebuilt and committed —heading-map.tsandmodels.tsare in the action bundle, so this is the rare batch where the bundle legitimately changes.Verification
Full suite 1516/1516. The three new tests (the #53 warning test, the two #230 valid-model cases) fail on pre-fix source — checked by reverting
heading-map.tsandmodels.tsand re-running (3 failed, 132 passed), then restoring. Lint,format:check, andcheck-dev-refs(168/168) all clean.🤖 Generated with Claude Code