skills(upgrade): optimization flight — the stale pinned registry snapshot cut, the rule stated once, --yes and the --stored exit-code contract taught (net −1,134 tokens) - #14465
Merged
Conversation
…1, UPG-D-02) The "v17 prescription set, as of 17.0.0-rc.5" section pinned six readings that are now wrong against the installed 17.2.0 spec: 45 vs 58 D2 conversions, 29 vs 77 semantic entries, 113-across-32-files vs 179-across-44 retiredKey() sites, RETIRED_KEYS_BY_MAJOR[17] "3 entries" vs 29, RETIRED_DEFS_BY_MAJOR[17] "1 entry" vs 53. Nothing in the skill branched on a count, and the section itself told the reader "the install wins" -- so the pin bought nothing and cost a reader who trusted it. Its reconciliation rule also pointed the wrong way: it anticipated only additions, while data/ExternalFieldMapping:transform was REMOVED from the bucket. Deleted with it (UPG-D-02): the "why these two tables are short" paragraph, which narrated the platform's own retirement-registration policy over two files this same skill declares unreachable from a consumer project. What survives is the measurement, not the number: the spec-changes.json reading folded into the 2.1 source table, now deriving the target major from protocolVersion instead of hardcoding 17, plus a rule against carrying a remembered count into the report. Ratchet: 8333 -> 7799 (ceiling 8333). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LraLgQVGq8egUwfYZpbYt1
…02, B-03, C-01) Nine findings, all the same shape: a rule the file already states, or prose re-teaching what the CLI prints for itself. - E-04/E-05 §3.5 becomes a 3-row outcome -> evidence table; the re-quoted error block was already available verbatim from the install. The new probe rule is the E-05 fix: `os validate` loads WITHOUT authoredSource (validate.ts:159; config.ts:224 "Set by `os migrate meta` only"), so a probe calling `define*` throws inside the load and never reaches the gate the recipe is proving. - D-03 the data-gate table is printed by the run itself (meta.ts:106-141, measured: the two `unlocks` strings, the deployment scoping and the dry-run sentence are all emitted). Only the non-CLI half survives -- carry each printed gate into the report as pending, by name. - D-07 the three-layers preamble and Layer table; the section headings and the pipeline line already are the construct. - B-02 the Guardrails section: 4 of 6 restated the boundary verbatim and #6 restated the data-gate rule. The one non-duplicate (one conversionId per commit) moves into the boundary; #6 now lives where the gates are printed. - D-04 the AST-is-lossy rationale, D-05 the 2nd of five statements of "replay from the target major", D-06 two bullets restating the paragraph above them, D-08 a justification of a template row already in the template, B-03 the 3rd copy of the [REMOVED] grep, C-01 routing owned by README and by the domain skills' own frontmatter. B-03 left the .upgrade/ workspace listing a file nothing writes any more; that list now names retired-names.txt, which 2.6 actually produces. Ratchet: 7799 -> 6944 (ceiling 8333). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LraLgQVGq8egUwfYZpbYt1
…ed protocol (UPG-E-02, E-03, F-01, F-02, F-03, A-02, G-01)
Five funded additions, each paid by a deletion in the same file, plus the
frontmatter shrink.
- E-02 (falsehood 4) `os migrate meta --stored --apply` was documented as
"(prompts)". It does not prompt for this skill's reader: meta.ts:501-511
refuses in any non-TTY -- every agent session -- exiting 1 with
`confirmation_required`. The CLI's own example list already spells
`--stored --apply --yes --json`.
- E-03 the ranged `engines.protocol`. The skill's only worked form was an exact
'16.0.0'; all four real configs (showcase, crm, todo, the blank template)
write `engines: { protocol: '^17' }`, and template-consistency.test.ts:186
MECHANICALLY REQUIRES the caret form of every scaffold. Reading rule is the
range's floor, matching `declaredMajor` ("Major the app's declared
compatibility range targets", protocol-version-gap.ts) and agreeing with the
Manifest Reference objectstack-platform's delivered flight teaches.
- F-01 the `--stored` exit contract (meta.ts:577-578, 621; documented at
:451-453) becomes a 3.6: exit 0 = every row canonical, 1 = work left, which
is what makes "this deployment is on protocol N" a CI check.
- F-02 the five stable `--json` error codes an agent branches on
(meta.ts:262, 279, 414, 477, 504).
- F-03 the positional config path (meta.ts:191-193) -- a monorepo with more
than one stack could not follow the skill as written.
- A-02 drops the two "do not use" clauses that route nowhere a customer can go
(an internal playbook outside the published catalog, and a body rule restated
in the trigger) and adds the real one: physical DB drift is platform's job.
- G-01 compatibility becomes one line like the nine domain siblings. The phrase
"at the TARGET major" is kept verbatim ON PURPOSE: it is the warrant for this
file's exemption in check-skill-compatibility-version.mjs, whose rationale
regex dies with the text. The "protocol 10 at the time of writing" hedge is
gone rather than restated -- after D-01 the frontmatter was the last rottable
copy of that constant.
Ratchet: 6944 -> 7199 (ceiling 8333). Net for the flight so far: 8333 -> 7199.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LraLgQVGq8egUwfYZpbYt1
…r shrink Generator output only (`pnpm --filter @objectstack/spec gen:skill-docs`), forced by check:skill-docs, which was red on this file and named the command. skills/README.md regenerated byte-identical -- it does not carry the description prose -- so this flight's whole file surface is SKILL.md plus this one line. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LraLgQVGq8egUwfYZpbYt1
This was referenced Sep 2, 2026
os-zhuang
approved these changes
Sep 2, 2026
os-zhuang
marked this pull request as ready for review
September 2, 2026 11:24
os-zhuang
enabled auto-merge
September 2, 2026 11:24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #14307
Skills catalog optimization program #14292, member card #14307 (maintainer mandate 2026-09-02: 「审核所有的 skills,进行全面的优化。」). Verdict DIET, implemented on one file.
Not
Fixes: UPG-H-01 (theevals/package) is deferred to #14296 item 2, so #14307 stays open. #14296 is not addressed here.Governed face ⇒ this PR stays draft.
needs:contract-reviewis on both carriers: the--storedexit-code contract, the--yesnon-TTY semantics, the--json errorcodes and the rangedengines.protocolreading are all CLI / manifest contract claims.Token delta
skills/objectstack-upgrade/SKILL.mdNet −1,134 tok on 8,333 = −13.6% (693 lines → 597). Bundle total 176,225 → 175,091. No ceiling raise, no new file, no re-wrap-as-payment, ratchet script untouched.
The card's target was ≈ −1,808. The −674 gap is itemised, not smoothed — it is entirely the audit's per-finding Δtok estimates coming in optimistic on the rewrite-as-construct rows, plus three additions written longer than estimated because the measured contract needed more words than the audit budgeted. Measured per cluster:
Per-item 落点 | before | after
spec-changes.jsonreading folded into the 2.1 source table, now deriving the target major fromprotocolVersioninstead of hardcoding 17, plus a rule against carrying a remembered count into the reportdefine*callpending, by nameconversionIdper commit) moved into the boundary, #6 now lives where the gates are printed--outis the oracle you diff against, never the file you ship[REMOVED]grep.upgrade/workspace list, which named a file nothing writes any more, now namesretired-names.txtskills/README.mdand by the domain skills' own frontmatter--applyline--stored --apply # rewrite the rows (prompts)— falsehood 4--stored --apply --yes, plus why: non-TTY refuses withconfirmation_required'16.0.0'--stored --jsonexits 0 = every row canonical, 1 = work left--jsonerrorcodes, as a list under the table (see the construct note below)descriptioncompatibilitypremise_falseNone. Every finding's premise was re-verified against this branch's base (
a98b61b3) and held. Two implementation divergences, both deliberate and both measured:1. UPG-E-03 — the audit's proposed clause is wrong; the delivered platform row is right. The audit proposed writing "a range declares compatibility, not authorship —
'^17'means runs on 17, so fall to source (2)". That contradicts what objectstack-platform's delivered flight teaches for the same manifest row (origin/claude/issue-14299-skills-platform-optimization, "Manifest Reference": "the metadata-protocol major the app is authored against"). The platform row is the correct one, measured three ways:packages/cli/src/utils/protocol-version-gap.tsnames the fielddeclaredMajor= "Major the app's declared compatibility range targets", and its header explicitly rejects a naive leading-integer re-parse as a third opinion.packages/create-objectstack/src/template-consistency.test.ts:186mechanically requires the caret form of every scaffold: "objectstack.config.ts stamps engines.protocol at the scaffolder's major (ADR-0087 D1)".packages/metadata/src/plugin.ts:779calls it the "authored engines.protocol floor".So the shipped clause teaches the range's floor —
'^17'→--from 17,'>=15 <18'→--from 15, never the upper bound. This agrees with the manifest row objectstack-platform's delivered flight teaches.2. UPG-F-02 — the codes ship as a list, not as a 4th table column. Measured: the failure-modes table has 8 rows and only 2 map to a code, so a column would be 6 empty cells; and 2 of the 5 codes (
missing_from_major,database_busy) have no row at all, so a column cannot carry them. A compact list under the table carries all five and costs less. The finding's decision — an agent scripting the run branches on the code, not the prose — is delivered in full.Re-measured counts (with their commands)
All re-measured on this branch's base, not copied from the audit (which measured at
a59f78d;packages/spec/src/migrations/registry.tshas moved +78 lines since).a98b61b3retiredKey(sites in shipped*.zod.tsRETIRED_KEYS_BY_MAJOR[17]RETIRED_DEFS_BY_MAJOR[17]MIGRATION_SUPPORT_FLOORAlso measured:
data/ExternalFieldMapping:transform, one of the three keys the skill listed, has been removed from the bucket. The deleted reconciliation rule anticipated only additions ("post-rc.5 registrations are expected to add entries"), so a reader reconciling that delta was pointed the wrong way. After D-01 the skill carries no pinned snapshot at all — only the two re-measure commands, so a reader measures instead of trusting a number.Two gate mechanisms this flight had to obey
check-skill-compatibility-version.mjsexempts this file, and the exemption is warranted by a regex over the live text (rationale: /at\s+the\s+TARGET\s+major/i). A cross-major skill pinned to the current major would be actively wrong, so the G-01 one-liner keeps the phrase "at the TARGET major" verbatim — rewriting it away would have killed the exemption and turned the gate red. Gate confirms: "2 justified exemption(s), each with its stated reason still true of the file."check-skill-identifier-livenessLeg 2 binds sections by heading. Run before the first deletion: 8 registered exhaustive sections, none of them in this file, so the retired-key and tombstone tables were free to delete. Green after, still 8 / 0 gaps.G-01also drops the "protocol 10 at the time of writing" hedge rather than restating the number: after D-01 the frontmatter was the last rottable copy of that constant, so the line now points atMIGRATION_SUPPORT_FLOORinstead of quoting it.Follow-up for objectstack-platform / skills/README.md (UPG-A-01, deferred)
Not done here — this flight edits one package. Recorded for whoever owns those files:
skills/objectstack-platform/SKILL.mddescription needs one negative route: do not use for a protocol-major metadata upgrade — see objectstack-upgrade. Platform's description today claims "operations (CLI commands, migrations, deployment…)" while its migration table lists onlyos migrate plan/os migrate apply;os migrate meta,files-to-referencesandvalue-shapesappear nowhere in it. A customer agent asked "run the migrations for the new spec" loads platform and gets physical-DB drift reconciliation. This PR fixed the mirror half inside upgrade's own description (A-02), so the hole is now one-sided rather than two-sided.skills/README.md"Cross-skill routing" needs an upgrade-vs-platform row — the half of UPG-C-01 that could not land here (the deletion half did).UPG-H-01 (an
evals/package for this skill) stays deferred to #14296 item 2.Gates
Head sha
ecdddf53— every reading below is from that commit, after the final commit, with exit codes captured before any pipe.Named on the card:
node scripts/check-skills-token-ratchet.mjspnpm --filter @objectstack/spec check:skill-examples@objectstack/spec+ the@objectstack/client-reactclosure; it refused rather than false-greening until the build existedpnpm check:skill-compatibilitypnpm check:skill-identifier-livenesspnpm --filter @objectstack/spec check:skill-docsRe-derived family —
node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --commands, derived after regeneration, from the script's own merge-base changeset (2 paths, no hand-fed list): 36 commands. 35 green, 1 NOT MEASURED.The one non-green is
node scripts/check-test-completeness.mjs, exit 3 = PREREQUISITE NOT MET, which the gate itself defines as not-a-finding: it grades a savedturbo run testlog, CI tees one and passes the path, and there is no local log to hand it. Recorded as NOT MEASURED per the script's own instruction, not as a red.pnpm check:nul-bytes✅ (7,902 files, no raw control bytes).Why
skip-changesetNothing is released by any package. Verified rather than assumed: neither changed path lies inside a publishable package —
skills/andcontent/have nopackage.jsonof their own, and no publishable package's directory is a prefix of either path.Files
skills/objectstack-upgrade/SKILL.md— the flight.content/docs/ai/skills-reference.mdx— generator output only (pnpm --filter @objectstack/spec gen:skill-docs), forced bycheck:skill-docs, which was red on this file and named the command. One line, the description change.skills/README.mdregenerated byte-identical — it does not carry the description prose — so it is not in this diff at all, which is tighter than the claim comment anticipated.🤖 Generated with Claude Code
https://claude.ai/code/session_01LraLgQVGq8egUwfYZpbYt1
Generated by Claude Code