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

fix(devx): say the skill-examples build is scoped at both precondition sites - #8066

Merged
baozhoutao merged 2 commits into
mainfrom
claude/issue-7811-skill-examples-scoped-build-notice
Sep 6, 2026
Merged

baozhoutao merged 2 commits into
mainfrom
claude/issue-7811-skill-examples-scoped-build-notice

Conversation

@baozhoutao

Copy link
Copy Markdown
Contributor

Fixes #7811

scripts/check-skill-examples.mjs prints the same --build-filter build command on two
precondition paths, and neither said the build is trimmed. This ports the shape objectui#7795
landed for check-doc-snippet-types.mjs (scopedBuildNotice), adapted to what this gate scopes:
the marked examples' import surface.

The gap, measured on this branch (3b26507ba)

  • node scripts/check-skill-examples.mjs --build-filter names 10 packages; packages/ holds 40.
  • Running the printed command expands those to 30 packages in scope (turbo --dry=text), and
    finishes with 29 of 40 packages carrying a dist/.
  • So a reader who ran the command exactly as printed is looking at 11 package directories with no
    dist/, and nothing on screen told them that leftover was the intended end state rather than a
    build that half-failed. (Ten of those are simply outside the closure; @object-ui/test-support is
    in scope but is source-typed and emits no dist/ by design.)

Trimming is this gate's design — .github/workflows/skill-examples.yml's header forbids the
unfiltered build outright, under the 2026-08-16 ruling on objectui#4846 — so what was missing is the
sentence, never a wider filter.

What changed

One exported scopedBuildNotice(named, total) in scripts/check-skill-examples.mjs, called from
both sites and from nowhere else:

  • :1285 — the regular precondition path (followed by pnpm check:skill-examples)
  • :1721 — the --self-test type-check leg (followed by node scripts/check-skill-examples.mjs --self-test)

Both counts are arguments, derived from what the gate already read: state.neededPackages.size,
and Object.keys(state.packageDirOf).length. analyze() now carries packageDirOf out in its
return — it is the same map it already walked to resolve neededPackages, not a second reading of
the tree. The notice names no package; the reader who wants the exact set is sent back to the
same filter (--dry=text, turbo's Packages in scope line), never to a second list that would rot.

⛔ Untouched: --build-filter's package selection, the scanner, the judge, every exit code, and
every existing assertion in the pin test. Nothing under skills/** or .claude/** is in the diff.

It reaches a real terminal

This worktree was genuinely unbuilt, so both paths were exercised for real (exit 2 both times,
unchanged):

Regular path — node scripts/check-skill-examples.mjs:

PRECONDITION NOT MET (exit 2) — the example program was NOT run: the packages it resolves against are not built, or are typed from source.
This is "I could not run", NOT "I ran and found errors" (exit 1). No line above is a verdict about any guide. Build what the gate needs, then re-run:
  pnpm exec turbo run build $(node scripts/check-skill-examples.mjs --build-filter) --concurrency=2
  pnpm check:skill-examples

That build is SCOPED, and it is not a whole-tree build: --build-filter names the 10 package(s) the marked examples import (packages/ holds 40) plus each one's dependency closure, and every package outside that closure is left exactly as it was. An unbuilt package still sitting there when the build finishes is this gate's designed end state, not a build that half-failed — a whole-workspace build for a guide check is what this gate's workflow refuses outright. For the exact set, ask that same filter rather than a list written down somewhere else: append --dry=text to the command above and read its "Packages in scope" line.

The --self-test leg prints the identical paragraph under its own two-line remedy. After the scoped
build, both run green and the notice is correctly absent from the happy path.

The pin, and its must-fail leg

New describe in scripts/__tests__/check-skill-examples.test.ts (relative imports only; existing
assertions untouched). Six cases: the counts are interpolated (with the control — different inputs,
different text, so a hard-coded "10 of 40" fails); the notice names no package (with the control —
the same matcher is first shown to catch package names in this tree, so the refusal is not
vacuous); it says the build is scoped and its leftovers are the designed end state; both sites
call it; neither call site passes a numeric literal; and analyze() derives packageDirOf from the
tree it walked.

Ablation, on the committed implementation (dcf79b983), restoring under a trap:

step evidence
before blob 2b105219f = HEAD:scripts/check-skill-examples.mjs; 2 call sites
mutate (drop the --self-test leg's call) blob a6b6eb01b — different, so it reached disk; 1 call site
run vitest run scripts/__tests__/check-skill-examples.test.ts → exit 1, 2 failed / 88 passed — "is printed on BOTH precondition paths" and "is handed numbers the gate read" both red
restore blob back to 2b105219f, git diff HEAD empty, 2 call sites

Gates (all at 3b26507ba, exit codes captured by redirect-then-capture)

command exit
node scripts/check-skill-examples.mjs --self-test 0 (52 cases pass)
pnpm check:skill-examples (after its scoped build) 0 — 13/13 ts, 70/70 json, same verdict as main
pnpm exec vitest run scripts/__tests__/check-skill-examples.test.ts 0 — 90 passed
pnpm exec vitest run scripts/__tests__/ 0 — 111 files, 3333 tests
pnpm type-check:scripts 0 — --listFiles confirms both changed files are in the program, so this is measured, not vacuous
pnpm lint:root 0 (32 pre-existing warnings, 0 errors; full scan, not narrowed)
pnpm check:control-bytes 0 (6472 files) + manual grep -naP over both paths: no hits
node scripts/check-changeset-presence.mjs 0 — none owed (root scripts/ publishes nothing)
node scripts/check-governed-queue-guard.mjs --test both paths 0 — NOT GOVERNED (control: AGENTS.md → exit 3, GOVERNED)

Readers checked: .github/workflows/skill-examples.yml invokes the gate as
node scripts/check-skill-examples.mjs --build-filter, --self-test and bare — the command line the
notice points at still matches exactly. scripts/__tests__/check-skill-eval-tokens.test.ts names the
gate only in prose and ran green in the directory sweep above.

origin/main moved while this was in flight (#8054), so origin/main was merged in and every gate
above was re-run on the merged head. Live E2E (informational) is red on every branch today for an
upstream reason (objectui#7990) and is not this branch's.


Generated by Claude Code

…n sites

`scripts/check-skill-examples.mjs` prints the `--build-filter` build command on
two precondition paths — the regular path (:1285) and the `--self-test`
type-check leg (:1721) — and neither said the build is TRIMMED. Measured on
`origin/main` `65ce8c576`: the filter names 10 of the workspace's 40 packages
and turbo expands those to 30 in scope, so a reader who runs the printed
command is left with 10 packages carrying no `dist/` and nothing to tell that
apart from a build that half-failed.

Ports the shape objectui#7795 landed as `check-doc-snippet-types.mjs`'s
`scopedBuildNotice`: one exported notice function, called from both sites, whose
two counts are ARGUMENTS derived from what the gate already read
(`state.neededPackages` and the `packageDirOf` map `analyze` now carries out),
and which names no package — the reader who wants the exact set is sent back to
the same filter via `--dry=text` and turbo's "Packages in scope" line, never to
a second list that would rot.

`--build-filter`'s selection, the scanner, the judge and every exit code are
untouched: the trimming is this gate's design, and the workflow forbids the
unfiltered build outright.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FhBNJcLRZLe8M87VcUgpKr
…notice

Keeps this branch on the current main (#8054 landed while this was in flight).
Disjoint by file: that change is app-shell/console vi.mock factories plus
scripts/check-vi-mock-inherit.mjs; this branch touches only
scripts/check-skill-examples.mjs and its pin test.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FhBNJcLRZLe8M87VcUgpKr

Copy link
Copy Markdown
Contributor Author

Standing down on Live E2E (informational): that check is red on main itself today (base-red, anchored on objectui#7990 / objectstack-ai/objectstack#16186), it is informational (not required), and this PR changes one gate script's stderr prose and its pin test — nothing the live lane exercises. No fix is ported because none exists yet upstream. The flip to ready happens only once every non-informational check on 3b26507ba is green.


Generated by Claude Code

@baozhoutao
baozhoutao marked this pull request as ready for review September 6, 2026 14:18
@baozhoutao
baozhoutao added this pull request to the merge queue Sep 6, 2026
Merged via the queue into main with commit 295804a Sep 6, 2026
30 of 31 checks passed
@baozhoutao
baozhoutao deleted the claude/issue-7811-skill-examples-scoped-build-notice branch September 6, 2026 14:34
baozhoutao pushed a commit that referenced this pull request Sep 6, 2026
#8066 touches only scripts/check-skill-examples.mjs and its test — no package
source, so the built types this corpus is judged against do not move and no
rebuild is owed. Its test is a reader of the gate file, so the reader suite is
re-run on this head.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FhBNJcLRZLe8M87VcUgpKr
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

finding(devx): check-skill-examples.mjs 的两处 --build-filter 命令同样没说它只建一个裁剪过的闭包

2 participants