Skip to content

fix(cli): os create --in-repo scaffolds extend tsconfig.base.json - #26331

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-wfu1a8
Oct 26, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-wfu1a8

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Steve · project thread
Fixes #26209

Clause-②: no
Metadata-protocol: none

What

os create plugin NAME --in-repo wrote a tsconfig.json that extended the monorepo root tsconfig.json. Since #26203 that root file is the type-check program for scripts/, and its exclude (packages, apps, examples, ui) resolves against the root. The scaffold declared include but no exclude, so it inherited that list and matched none of its own src/.

  • rootTsconfigExtends is renamed baseTsconfigExtends and now derives the ascent to tsconfig.base.json (call site in the plugin template updated).
  • The in-repo template now declares the sibling shape (packages/plugins/plugin-email is the reference): types: ["node"] and its own exclude: ["dist", "node_modules"].
  • The standalone (default) placement is unchanged.
  • Root .changeset/ entry: @objectstack/cli patch.

Measured

Before, on origin/main 817cb89 (scaffolded with packages/cli/bin/run-dev.js create plugin probe26209 --in-repo, then tsc --listFilesOnly -p tsconfig.json in the scaffold, tsc 6.0.3):

error TS18003: No inputs were found in config file '.../packages/plugins/plugin-probe26209/tsconfig.json'. Specified 'include' paths were '["src/**/*"]' and 'exclude' paths were '["../../../node_modules","../../../packages","../../../apps","../../../examples","../../../ui"]'.
exit 1

So the inherited exclude dropped the scaffold's whole src/, and the template now carries its own exclude.

After, on this branch (same scaffold command):

tsc --listFilesOnly -p tsconfig.json   exit 0
  SCAFFOLD/src/index.ts
  SCAFFOLD/src/index.test.ts

tsc --showConfig of the scaffold against packages/plugins/plugin-email, keys compared one by one: the only difference is files (2 files against 59, each package's own src/). compilerOptions, include and exclude are byte-equal after showConfig's path normalisation (outDir ./dist, rootDir ./src on both). That is inside the card's allowance (include, outDir, rootDir).

Tests

  • packages/cli/test/create.test.ts: the in-repo extends arithmetic now resolves to tsconfig.base.json; a new case pins that the template extends the base (never the root program), owns exclude: ["dist", "node_modules"] and declares types: ["node"]; the function test follows the rename.
  • packages/cli/test/init-template-comments-self-contained.test.ts: comment only, the renamed function and the measured in-repo value; it carries no assertion on the target.
  • Ablation (one-shot, not kept): scripts/ablation-replace.mjs reverted the ascent target to tsconfig.json; create.test.ts went red on 3 cases (the arithmetic, the new base pin, the function test), and the restore was byte-identical to HEAD (git diff HEAD empty).
  • pnpm --filter @objectstack/cli exec vitest run --project unit: 332/334 files on the first pass; the 2 red files (published-subpath-console.pin, published-subpath-hook-body.pin) refused because packages/cli/dist was not built yet. After a full pnpm build (119/119 tasks) those two plus both touched files: 4/4 files, 84/84 tests.
  • pnpm --filter @objectstack/cli typecheck: exit 0.
  • node scripts/pm/dispatch-gates.mjs --commands derived 67 families at e4865e1; all 67 run with exit codes recorded, --ran reconciliation: 0 NOT-MEASURED. check-plugin-teardown-shape --self-test first exited 3 (shallow clone could not read its pinned fixture commit); after fetching that commit it exited 0. The integration CLI tier and test:repo are left to CI.

Acceptance notes

  • With the base fixed, the in-repo scaffold reaches its own src/, but its own pnpm typecheck and pnpm build are still red on two things this PR does not change (both were hidden behind TS18003 before):
    1. TS5103 Invalid value for '--ignoreDeprecations': the in-repo package.json declares typescript SCAFFOLD_TYPESCRIPT_RANGE (^5.3.0, resolves to 5.9.3), while tsconfig.base.json sets ignoreDeprecations: "6.0", which only TypeScript 6 accepts. Siblings declare ^6.0.3. The range is a deliberate scaffold policy in init.ts, so it is reported, not changed here.
    2. TS6133 'context' is declared but its value is never read in the emitted src/index.ts, under the base's noUnusedParameters: true (measured with the workspace tsc 6.0.3).
      Both are reported to the seat for a follow-up card. cli(create --in-repo): in-repo scaffolds extend the root tsconfig.json, which becomes the scripts/ program, and inherit its exclude of packages/apps/examples #26209 is not blocked by them: its acceptance diff (showConfig against a sibling) holds.
  • check:type-check-debt prints a surplus of 26 below the root ledger entry's ceiling; that entry is not touched here.
  • origin/main moved 11 commits since the branch point, touching other packages/cli files but none of this diff's; git merge-tree is clean. Not merged in.

Generated by Claude Code

The in-repo plugin template extended the root tsconfig.json, which is the
type-check program for scripts/ and excludes packages/apps/examples/ui
relative to the root. A scaffold under packages/plugins/ inherited that
exclude, matched none of its own src/, and tsc stopped with TS18003.

Rename rootTsconfigExtends to baseTsconfigExtends, derive the ascent to
tsconfig.base.json, and give the template the sibling shape: types node
and its own exclude.

Claude-Session: https://claude.ai/code/session_01B9rx6JYFJTqGy5tXRwwRfM
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/s documentation Improvements or additions to documentation tests tooling labels Oct 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/cli, touching 4 documentable anchor(s).

10 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/ai/skills-reference.mdx (via node_modules (literal, a string literal in plugin))
  • content/docs/ai/skills.mdx (via node_modules (literal, a string literal in plugin))
  • content/docs/deployment/cli.mdx (via node_modules (literal, a string literal in plugin), os create (command, read off packages/cli/src/commands/create.ts))
  • content/docs/deployment/self-hosting.mdx (via node_modules (literal, a string literal in plugin))
  • content/docs/deployment/troubleshooting.mdx (via os create (command, read off packages/cli/src/commands/create.ts))
  • content/docs/getting-started/your-first-project.mdx (via os create (command, read off packages/cli/src/commands/create.ts))
  • content/docs/plugins/index.mdx (via os create (command, read off packages/cli/src/commands/create.ts))
  • content/docs/protocol/kernel/index.mdx (via os create (command, read off packages/cli/src/commands/create.ts))
  • content/docs/protocol/kernel/plugin-spec.mdx (via os create (command, read off packages/cli/src/commands/create.ts))
  • content/docs/upgrading.mdx (via node_modules (literal, a string literal in plugin))

⛔ 3 release-owned page(s) also name something this change touched. These are read-only:

  • content/docs/releases/v17/17-4.mdx (via os create (command, read off packages/cli/src/commands/create.ts))
  • content/docs/releases/v18/18-0.mdx (via node_modules (literal, a string literal in plugin))
  • content/docs/releases/v18/18-1.mdx (via os create (command, read off packages/cli/src/commands/create.ts))

content/docs/releases/ is RELEASE-OWNED (AGENTS.md "Documentation Guardrails"): release
notes are written centrally at release time, and a code PR that edits them is the exact PR
that guardrail exists to stop. They are still audited — read-only. If one of them is actually
wrong, file an issue or open a dedicated docs-only PR; do not edit it here.

What this run could not see
  • 1 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 54 of 206 client-bound route-ledger rows — the other 152 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 152: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 55 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 97 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 31 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 46255b19842480a4f5e4a2556ae9f2e0764c9943 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 3b5d99d81bf917862d663e5f4658b1dc36bdc3be — the merge of head e4865e1af2cfcbf3626f0b43a0c90e51bcac0cc5 into base 46255b19842480a4f5e4a2556ae9f2e0764c9943, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 3b5d99d81bf917862d663e5f4658b1dc36bdc3be && git checkout 3b5d99d81bf917862d663e5f4658b1dc36bdc3be
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 46255b19842480a4f5e4a2556ae9f2e0764c9943 e4865e1af2cfcbf3626f0b43a0c90e51bcac0cc5 && git checkout -B drift-repro 46255b19842480a4f5e4a2556ae9f2e0764c9943 && git merge --no-ff e4865e1af2cfcbf3626f0b43a0c90e51bcac0cc5

node scripts/docs-audit/affected-docs.mjs --json 46255b19842480a4f5e4a2556ae9f2e0764c9943

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 46255b19842480a4f5e4a2556ae9f2e0764c9943 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

席位核对 · ACCEPT · devx seat 2 · 2026-10-26T21:24Z

Seat domain:devx#2 (#20163) · session_01Q4MDXRbEJCNdPAP4SiXwp9 · reviewed head e4865e1af2 · card #26209, claim 6426408373 (wave 7, delta T). PR carries Fixes #26209.

  • Scope: 4 files, +60/−21: packages/cli/src/commands/create.ts, packages/cli/test/create.test.ts, packages/cli/test/init-template-comments-self-contained.test.ts (comment text only), and one root .changeset/ @objectstack/cli patch. Not governed. None of the files the claim excluded are touched (package.json, build config, README.md, compile/serve/validate.ts, migrate/meta*).
  • The fix: rootTsconfigExtends → baseTsconfigExtends now returns …/tsconfig.base.json, so the ascent is still derived from where the template lands. The in-repo plugin template gains types: ["node"] and its own exclude: ["dist","node_modules"], which is the shape plugin-email declares. The rename is internal: packages/cli/src/index.ts re-exports only CreateCommand's default, so no published name moves.
  • Premise measured, not assumed: on main 817cb89 the scaffold's tsc --listFilesOnly stops with TS18003, because the inherited root exclude drops its whole src/. After the change, listFiles shows its two src/ files, and tsc --showConfig differs from plugin-email only in the file list.
  • Tests: the in-repo extends is pinned as arithmetic from the landing directory (now tsconfig.base.json). A new case pins base-not-root, the owned exclude and types. Ablation turns 3 cases red. cli unit tests pass 84/84 on a re-run, typecheck is green, and 67 derived families exit 0 with 0 NOT-MEASURED.
  • Changeset: a patch with Clause-②: no / Metadata-protocol: none, before/after text, and a one-line migration for an in-repo plugin scaffolded earlier.
  • Follow-up for the seat (filed separately): an in-repo scaffold's own typecheck is still red for two reasons outside this card. One is TS5103 (the template's typescript ^5.3.0 against the base's ignoreDeprecations: "6.0"). The other is TS6133 (the starter's unused init(context) parameter under noUnusedParameters).
  • Landing: once every check on this head is green or skipped, the seat runs ready + auto-merge.

Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/s tests tooling

Projects

None yet

2 participants