Uh oh!
There was an error while loading. Please reload this page.
fix(spec): make check:skill-examples's orphan scan fence-aware - #11354
Merged
Conversation
The os:check orphan-marker guard in check-skill-examples.ts scanned every line for marker text with no notion of being inside some other fence. A marker shown as example text inside a wrapping fence (e.g. a ```md illustration of the convention) is not adjacent to any real ts fence, so it was never claimed -- and the orphan scan flagged it as misplaced, making the os:check convention undocumentable in the very roots it governs. Adds fenceSpans(), lifted from check-role-word.mjs's #10533 fence-awareness shape: tracks every top-level fence of any language (run-length-aware closing, per CommonMark), and the orphan scan now skips lines inside one. A genuine top-level misplaced marker -- not inside any fence, just not adjacent to its own -- is unaffected and still fails loudly. Confirmed with a run before and after: a temporary repro fixture reproduced the false orphan against origin/main's script, and the fix removes exactly that false positive while a real misplaced marker in the same fixture still fails. New --self-test coverage pins both directions in one fixture. No changeset: packages/spec/scripts/** is dev/CI tooling, not published. Matches the skip-changeset precedent set by #10787, the same fence-awareness shape in check-role-word.mjs. Fixes#10791 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RadETjNRLALFLhFA3xehZP
Contributor
📓 Docs Drift CheckNothing in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 0 changed package(s)), so this run has no opinion about the docs. |
os-sam
marked this pull request as ready for review
August 23, 2026 13:51
Uh oh!
There was an error while loading. Please reload this page.
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 freeto 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.
Fixes#10791
The defect
packages/spec/scripts/check-skill-examples.ts's orphan-marker scan had no fenceawareness.
extractFromFilewalks every line looking foros:checkmarker text; the"is this claimed by a real block" check only looks one line up (is the previous line a
ts/tsx/typescript fence-open), but the orphan scan afterwards runs over every line
in the file with no notion of being inside some other fence. A marker shown as example
text inside a
```mdillustration of the convention (e.g. "put this exact line aboveyour fence:
<!-- os:check -->") is not adjacent to any real fence, so it was neverclaimed— and the orphan scan flagged it as a misplaced marker, failing the gate. Theos:checkconvention could not be documented in the very roots it governs (skills/,content/docs/).Confirming run — premise re-measurement
The card's premise is source-derived and was latent: today's corpus has all 192 (now 246,
after the #10969 SDK surface landed) markers at top level, so the gate is green on
mainwith nothing exercising this path.
Reproduced against
origin/main's script by adding a temporary fixture(
skills/tmp-fence-repro.md, not part of this PR) with two markers:```mdfence, illustrating the conventionBoth were reported — the false orphan confirms the defect exactly as described.
The fix
Lifted the fence-awareness shape from
scripts/check-role-word.mjs's #10533 fix (themaintainer-accepted precedent for the same "this gate's own convention must be
documentable in the roots it governs" problem): a new
fenceSpans()walks every lineonce, recognizing any CommonMark-shaped opening fence (any language, backtick run
length 3+, with a run-length-aware matching closer — a `````` fence wrapping a
```tsexample closes on its own fence, not the inner one; an unclosed fence runs to EOF per
CommonMark). The orphan scan in `extractFromFile` now skips any line inside such a span.
The real marked-block extraction loop is untouched — it still only recognizes bare
```ts/```tsx/```typescriptfences for compilation, so this fix is scopedexactly to the orphan-scan defect the card describes, not to a broader "nested fence"
extraction concern.
Re-running the same repro with the fix:
The false orphan (line 8) is gone; the genuine orphan (line 13) still fails — the gate's
hard-error posture is unweakened. The temporary fixture was then deleted (not part of
this PR).
Self-test coverage
Added a new fixture to the existing
--self-testsuite in the same file, asserting bothdirections in one run: a marker shown inside a
```mdillustration must extract 0blocks and report 0 orphans for that line, while a genuine top-level misplaced marker in
the same fixture must still be reported. Composing both in one fixture catches an
over-wide fix (treating every marker as "documented") as readily as an under-wide one.
Changeset
None —
packages/spec/scripts/**is dev/CI tooling, not published (packages/spec'sfilesallowlist isdist,json-schema,liveness,prompts,llms.txt,README.md,src/**/*.zod.ts,CHANGELOG.md,api-surface,spec-changes.json— noscripts/). Matches the precedent for this exact shape of fix, #10787(
fix(gate): let check:role-word exempt marked vendor-wire fences), merged with theskip-changesetlabel and no changeset.skip-changesetlabel applied to this PR via theadditive labels endpoint per repo convention, and read back after size-labeler settled.
Gates
Derived via
node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstackagainstthe actual diff (
packages/spec/scripts/check-skill-examples.tsonly).pnpm --filter @objectstack/spec check:skill-examples(self-test + full run)246 prose examples type-check across 2 surface(s)pnpm --filter @objectstack/spec typecheckpnpm --filter @objectstack/spec run check:empty-statepnpm --filter @objectstack/spec run check:livenesspnpm --filter @objectstack/spec run check:strictness-ledgerpnpm --filter @objectstack/spec run check:variant-docspnpm check:merge-driverpnpm check:published-filespnpm check:slot-lookuppnpm check:test-source-aliaspnpm check:type-source-resolutionnode scripts/check-ci-filter-parity.mjsnode scripts/check-dev-prereqs.mjs(needed a fullpnpm buildfirst — 67/67 package artifacts)node scripts/check-plugin-teardown-shape.mjs0 known-unreachednode scripts/docs-audit/check-affected-docs.mjsUNREACHABLEsdk-route-bridge rows are unrelated to this diff)node scripts/check-nul-bytes.mjsExit codes captured before any pipe (
cmd > file 2>&1; EXIT=$?); each command run throughscripts/pm/os-verify-lock.sh, verdict read from its own printedVERDICT command-exit Nline.Union re-run at final HEAD
01ade5594(clean tree) — every family above re-run and green atthat exact commit.
⛔ Not enabled for auto-merge and not marked ready — CI convergence and merge are the PM's.
Generated by Claude Code
Generated by Claude Code