Repository navigation
chore(spec): every skill-examples surface build dir is gitignored (and asserted) - #11555
Merged
Merged
Conversation
git check-ignore exits 128 (not 0/1) when cwd has no .git ancestor, which dist-freshness-adoption.test.ts's sandboxed tree deliberately is not. Reading 128 as 'not ignored' made the new assert fire before the freshness refusals those tests probe. isGitIgnored now returns boolean | null; only an authoritative false counts as a gap.
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-steve
marked this pull request as ready for review
August 24, 2026 03:21
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.
Fixes #11440
check:skill-exampleswrites each surface's extracted blocks to a throwaway build dir under that surface'sresolutionDir, wiping and deleting it on every run — so a gap in.gitignoreis invisible on a clean pass and only surfaces via--keep(a documented debug flag) or a run interrupted before cleanup, at which point a routinegit add -Acommits the extracted blocks into someone's PR.Per-surface coverage
resolutionDir.gitignorebefore@objectstack/spec)packages/spec.examples-build@objectstack/spec, #11433)packages/spec.examples-build-src@objectstack/client-react,@objectstack/client, #10969)packages/client-react.examples-buildOne line added beside the existing pair, and the comment above generalised to "one per surface" (already generalised by #11433; unchanged here).
Assert:
assertGitignoredBuildDirs()A sibling of #11433's
assertDistinctBuildDirs(), in the same file, wired intomain()right after it. It walksSURFACES, and for each declared build dir runsgit check-ignore -q(via a smallisGitIgnored()helper) asserting the dir is covered —fail()s with the surface name and the exact.gitignoreline to add if not.One mechanical wrinkle worth noting:
git check-ignoreonly matches a directory-only pattern (every entry here ends in/) against a path it can tell IS a directory — either because the path exists on disk, or because the query itself carries a trailing separator. Since this gate deletes the build dir on exit, the directory is normally absent, soisGitIgnored()always queries with a trailingpath.sepappended.--self-testadds a fixture (sibling to the build-dir-distinctness one) that inits a throwaway git repo, gives it a.gitignorecovering one stub surface's build dir but not another's, and assertsisGitIgnored()/findUnignoredBuildDir()catch the gap in both directions — plus a check that the REALSURFACESare fully covered (this is what pre-fix reverse verification failed).Caught by the real test suite: a non-git sandbox false-positive
dist-freshness-adoption.test.tsruns this same script against a "repo-shaped" temp tree that is deliberately not a real git checkout (its own header explains why — making the realpackages/spec/diststale to drive a refusal would corrupt whatever else is running in the container).git check-ignorethere exits128("fatal: not a git repository"), and a first version ofisGitIgnored()read any non-zero status as "not ignored" — which made the new assert fire first in every one of that file's cases, ahead of the dist-freshness refusal they exist to probe (3 failing tests, caught bypnpm --filter @objectstack/spec test, not by--self-test, whose own throwaway repo IS a realgit init). Fixed by havingisGitIgnored()returnboolean | null(null= indeterminate, not a git working tree) and havingfindUnignoredBuildDir()treat only an authoritativefalseas a gap. Pinned with a new non-git self-test fixture; re-confirmed against the real suite:vitest run scripts/dist-freshness-adoption.test.ts—10 passed (10).Reverse verification
At the committed fix, temporarily reverted just the new
.gitignoreline and re-ran:Exit 1, naming exactly the surface the issue describes. Restored via
git checkout HEAD -- .gitignore(the fix was already committed) and re-ran green.Verification
All at final commit
6b5de1105c, tree clean vs HEAD:git check-ignore -q packages/client-react/.examples-build/— red pre-fix (measured onorigin/mainat merge base), green post-fix; both spec surfaces stay green throughout.pnpm --filter @objectstack/spec exec tsx scripts/check-skill-examples.ts --self-test— green, including the new gitignore + non-git fixtures.pnpm --filter @objectstack/spec check:skill-examples(self-test + real gate) — green:253 marked example(s) across 97 file(s), 3 surface(s).pnpm --filter @objectstack/spec test— green:420 Test Files passed (420),11204 Tests passed (11204).pnpm --filter @objectstack/spec typecheck(tsc --noEmit+check:scripts-typecheck+check:test-typecheck) — green.node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack— derived 13 local gate families for this diff, all run and green:check:empty-state,check:liveness,check:merge-driver,check:published-files,check:slot-lookup,check:strictness-ledger,check:test-source-alias,check:type-source-resolution,check:variant-docs,check-ci-filter-parity.mjs,check-dev-prereqs.mjs --self-test(its only CI-invoked form),check-plugin-teardown-shape.mjs,docs-audit/check-affected-docs.mjs.Scope
Diff is
.gitignore+packages/spec/scripts/check-skill-examples.tsonly — nopackages/spec/src/**touched (clause-② out of scope for this card).packages/spec/scripts/is not in the package's publishedfiles— this ships no consumer-visible bytes, soskip-changesetrather than a changeset.Generated by Claude Code