Skip to content
This repository was archived by the owner on Nov 4, 2026. It is now read-only.

feat(scripts): make the marked skill-example population shrink-only, per category - #7553

Merged
os-steve merged 1 commit into
mainfrom
claude/issue-7550-marked-fence-floors
Sep 3, 2026
Merged

os-steve merged 1 commit into
mainfrom
claude/issue-7550-marked-fence-floors

Conversation

@os-steve

@os-steve os-steve commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Fixes #7550
Part of #7359

Executes the maintainer's ruling on objectstack #14909 item 2 (option A): the marked-fence population that scripts/check-skill-examples.mjs type-checks becomes shrink-only, per category, as a floor rather than an exact pin and ⛔ not as a file:line register (option B, refused).

The gate landed saying so in its own header — "There is deliberately NO ratchet and NO count pin ... a separate decision, recorded as a follow-up rather than taken here". That paragraph is replaced by the decision.

The seeded floors, and the run that measured them

MARKED_FLOOR carries one number per marked-fence category. Seeded from a measurement at the branch point 3e01cb5, not from a claim in a merged pull request body — pnpm check:skill-examples on the unmodified tree printed:

Scanned 20 guide(s) under skills, .claude/skills: 121 ts/tsx/typescript fence(s), 56 json/jsonc fence(s).
Marked: 17 ts fence(s) and 39 json fence(s). Unmarked fences are ignored by design (opt-in).

so ts: 17, json: 39 — the same numbers objectui#7359 reported at the gate's landing, meaning no marker had moved in between.

⚠️ That is the marked population, not the passing one, and the two are not the same number today. The same tree under --measure printed:

MEASURE MODE: every candidate judged, marked or not — 56 of them carry the marker today.
Starting population — ts: 20/121 pass; json: 39/56 pass.

Three more ts fences hold up than are opted in, so a floor seeded off the Starting population line would have been red on the day it landed. The docblock records the distinction beside the constant.

What the gate now does

  • Below the floor exits 1, naming the category, the count, the floor and the two legal moves — raise it in the pull request that adds markers; lower it in the one that removes a marker, with the reason written beside the row.
  • Above the floor stays green. Opting one more fence in is the direction this gate exists to travel, and a ratchet that reds on the good move is one people learn to route around — here, by unmarking, which is the exact move the floor exists to catch. Only the downward move has to be declared.
  • The report line prints each count beside its floor on every run, so the number stays re-derivable:
    Marked: 17 ts fence(s) (floor 17), 39 json fence(s) (floor 39) — the floor is ⛔ SHRINK-ONLY. Unmarked fences are ignored by design (opt-in).
  • An empty population stays a PRECONDITION (exit 2). The floor is read only after every precondition has returned and never under --measure, so this ratchet cannot re-label "could not run" as "ran and found errors". The ordering is pinned, not just written.

The self-description is in check-doc-fence-languages.mjs's idiom for its KNOWN_UNHIGHLIGHTED_TS_FENCES baseline: a per-key count, ⛔ SHRINK-ONLY, with the remedy spelled out as a REMEDY_FLOOR block the way that gate spells REMEDY_SYNONYM.

One reading declared, so the seat can redirect cheaply

The card says "two floor constants: MARKED_FLOOR for ts and for json". Landed as one exported Map named MARKED_FLOOR carrying exactly those two rows — two floors, one per category, each with room for its reason beside it. That reading keeps the identifier the card names verbatim, matches the sibling idiom it told me to copy (a Map keyed per category, injectable so the self-test can drive it), and lets the check be a loop that names the category. If the seat meant two separate identifiers, it is a rename.

Pins (scripts/__tests__/check-skill-examples.test.ts)

All of it runs on an unbuilt tree — the floor is a count over the scanner's output — so it belongs in the vitest suite rather than in --self-test, per that file's stated boundary.

  • floor met and floor exceeded are green;
  • below the floor reds, and the breach names the category, the count and the floor;
  • a floor one above the current count reds and names itself, driven off the REAL corpus rather than a fixture;
  • the committed floors are met by the corpus in this checkout;
  • the report line prints the population beside the floor;
  • the category coupling: MARKED_FLOOR's keys are derived from what scanSkillFences can actually produce, so a third fence kind cannot land without a floor decision for it;
  • the wiring, as a source-level fact for the reason the harness-import pin above it states for its own: a floor computed and never consulted passes every other assertion in the file. It pins that main() reads it, that a breach exits examplesFailed, and that it is read after the preconditions and not under --measure.

The existing leaves the majority unmarked pin stays a ratio; its comment, which said objectui#7359 had not decided this, is updated rather than the assertion.

Ablation

Two legs, each mutated on disk with the mutation proved by grepping both the removed and the injected text, each restored with git checkout HEAD -- ... and the restore proved by state (disk blob b83b589 equals the HEAD blob, git diff HEAD empty), under a trap ... EXIT INT TERM with absolute paths. No build leg is involved: the pins are pure functions plus a source read, and the gate runs from source.

Leg A — the floor check deleted from main() (reconcileFloors(population) occurrences on disk: 1 → 0). The wiring pin reds and names itself:

× is READ by the gate, after the preconditions and never under `--measure`
AssertionError: main() no longer reconciles the marked population against MARKED_FLOOR
Tests  1 failed | 72 passed (73)

Leg B — the ts floor raised one above the measured count (['ts', 17] → ['ts', 18]; injected 1, replaced 0). The gate itself exits 1 and names everything the ruling asked for:

Marked: 17 ts fence(s) (floor 18), 39 json fence(s) (floor 39) — the floor is ⛔ SHRINK-ONLY. ...

❌  check:skill-examples — the MARKED population fell below its floor in 1 category:

  ts: 17 marked fence(s), floor 18 — 1 short

followed by the two legal moves. The corpus pin reds in the same leg and names itself (Tests 1 failed | 72 passed).

Gates — verdict lines, run on head e9508b4 after the final commit, clean tree

gate exit verdict line
pnpm check:skill-examples 0 Every marked skill example holds up against the built types.
node scripts/check-skill-examples.mjs --self-test 0 ✓ check-skill-examples self-test: 42 cases pass (...)
pnpm check:doc-snippets 0 Every covered documentation snippet compiles against the built types.
pnpm check:doc-fences 0 ✅ check:doc-fences — every TypeScript block in 227 document(s) is fenced ts/tsx/typescript, except 80 declared file(s) carrying 90 block(s) ... (⛔ SHRINK-ONLY).
pnpm check:control-bytes 0 ✅ check-control-bytes: OK (scanned 6224 tracked text file(s); skipped 85 binary).
pnpm vitest run scripts/__tests__/check-skill-examples.test.ts 0 Test Files 1 passed (1) · Tests 73 passed (73)
pnpm vitest run scripts/__tests__/check-skill-eval-tokens.test.ts scripts/__tests__/scripts-type-check.test.ts 0 Test Files 2 passed (2) · Tests 51 passed (51)
pnpm type-check:scripts 0 tsc -p tsconfig.scripts.json, no diagnostics
pnpm lint 0 Tasks: 47 successful, 47 total

Every exit code was captured before any pipe (cmd redirected to a file; EXIT=$?; tail), never read through one.

Both edited files are proved to be in the type-check:scripts program by tsc --listFiles (2 hits), so "typecheck clean" is a statement about them and not a vacuous pass. The two heavier gates needed a build first: check:skill-examples builds the closure its own --build-filter names, and check:doc-snippets exited 2 PRECONDITION NOT MET on the wider closure until that was built too — an exit 2 that is "could not run", not a red, and it is 0 above.

Changeset

None owed, and none added. node scripts/check-changeset-presence.mjs on this range: 2 file(s) changed, 0 of them published source of a package the release covers ... ✅ No source or published contract of a released package changed in this range, so no changeset is owed.

⚠️ The dispatch asked for the skip-changeset label. It is not applied, and deliberately: in this repository that label is the phantom scripts/__tests__/ci-cd-pipeline-doc.test.ts documents at length — auto-minted by an API call, read by no workflow and no script, and one whose application was refused and the refusal upheld on PR #6260. The repo's exemption is an empty-frontmatter changeset, and here not even that is owed. Raised for the seat rather than acted on silently.

Out of scope, filed

Session, as prose so it survives a later body edit: https://claude.ai/code/session_019RfFHiRCSs3JXLK4cwcfox


Generated by Claude Code

…per category

`check-skill-examples.mjs` landed with no ratchet and said so in its own
header: whether the marked population becomes shrink-only — the way
`check-doc-fence-languages.mjs` treats its declared-file population — was
left as a separate decision. That decision is taken here, as a per-category
FLOOR rather than an exact pin or a `file:line` register.

- `MARKED_FLOOR` carries one number per marked-fence category, seeded at the
  population measured at this branch point: 17 `ts`, 39 `json` — the same
  numbers the gate printed at its own landing, so nothing had moved between.
  That is the MARKED population, not the passing one; `--measure` on the same
  tree prints `ts: 20/121 pass`, and a floor seeded off that line would have
  been red on the day it landed.
- Below the floor exits 1, naming the category, the count, the floor and the
  two legal moves (raise it in the pull request that adds markers; lower it in
  the one that removes a marker, with the reason written beside the row).
  Above the floor stays green: opting one more fence in is the direction this
  gate exists to travel, and a ratchet that reds on the good move is one people
  route around — here, by unmarking.
- The report line prints each count beside its floor on every run, so the
  number stays re-derivable rather than a claim in a merged pull request body.
- An EMPTY population stays a PRECONDITION (exit 2). The floor is read only
  after every precondition has returned and never under `--measure`, so this
  ratchet cannot re-label "could not run" as "ran and found errors".

Pins in `scripts/__tests__/check-skill-examples.test.ts` cover both directions
on fixtures, the category coupling (a third fence kind cannot land without a
floor decision), the report line, the real corpus, and — as a source-level
fact, because a floor computed and never consulted passes everything else —
that `main()` reads it, after the preconditions and not under `--measure`.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019RfFHiRCSs3JXLK4cwcfox
@github-actions github-actions Bot added the tests label Sep 3, 2026
@os-steve
os-steve marked this pull request as ready for review September 3, 2026 21:11
@os-steve
os-steve added this pull request to the merge queue Sep 3, 2026
Merged via the queue into main with commit 403e3e5 Sep 3, 2026
30 checks passed
@os-steve
os-steve deleted the claude/issue-7550-marked-fence-floors branch September 3, 2026 21:27
os-steve pushed a commit that referenced this pull request Sep 3, 2026
objectui#7550's per-category `MARKED_FLOOR` ratchet (PR #7553) landed on the
same two files. Both behaviours are kept whole:

- `scripts/check-skill-examples.mjs` auto-merged. The summary now carries the
  floors on its `Marked:` line and the root bound's refused count on its own
  `Root bound:` line, and the exit path reads both — the floor breach check and
  the undeclared/stale root-bound rows.
- The one conflict was this suite's import list, resolved by keeping both
  sides' symbols.
- The two docblocks now name each other, which is the interaction neither PR
  could state alone: the floor counts MARKS, so a fence the root bound refuses
  stays inside it while being type-checked by nothing, and unmarking one to
  silence a refusal would breach the floor. Two ratchets, counting different
  things, neither substituting for the other.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019RfFHiRCSs3JXLK4cwcfox
akarma-synetal pushed a commit to akarma-synetal/objectui that referenced this pull request Sep 9, 2026
…bjectstack-ai#7563)

The Skill Example Check section documented every other assertion the
gate makes but said nothing about the second shrink-only ratchet
PR objectstack-ai#7553 added: MARKED_FLOOR, one floor per marked-fence category
(ts: 17, json: 39 as measured on this tree), raised only by a PR that
adds marks and lowered only by the PR that removes one, with the
reason written beside the constant.

Adds one paragraph beside the existing KNOWN_BARE_ANY_EXAMPLES one, in
the same voice, and rewrites the "If it fails" advice so that removing
a marker is named as the floor-lowering move (with its reason) rather
than a silent unmark.


Claude-Session: https://claude.ai/code/session_019RfFHiRCSs3JXLK4cwcfox

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

2 participants