Skip to content

refactor(cli): os serve names its built-in preset once - #39094

Open
sunhaolin wants to merge 1 commit into
mainfrom
claude/adoring-rubin-8u73we
Open

sunhaolin wants to merge 1 commit into
mainfrom
claude/adoring-rubin-8u73we

Conversation

@sunhaolin

Copy link
Copy Markdown
Collaborator

No issue is linked: this is a one-line cleanup found while triaging a static-analysis report, not a defect with a reproduction.

What changes

os serve resolved its preset as flags.preset ?? (isDev ? 'default' : 'default'). The line now reads flags.preset ?? 'default'.

  • packages/cli/src/commands/serve.ts: the inner conditional is removed.
  • .changeset/serve-preset-default-one-spelling.md: a patch changeset for @objectstack/cli.

Why

Both arms of the inner conditional were the same string, so the development check decided nothing: a boot with no --preset used default in development and in production alike. A static analyser reports it as a conditional that returns the same value on both branches (SonarQube rule S3923), and a reader is left looking for a production preset that was never there. Behaviour is unchanged; isDev is still read at its other sites in the file.

Verification

Run on this branch at d8ec47f3, based on main at 78148226:

  • pnpm --filter @objectstack/cli typecheck: passes (tsc --noEmit and check:test-typecheck).
  • eslint packages/cli/src/commands/serve.ts --no-inline-config: no findings. The repository-wide pnpm lint was not run.
  • node scripts/check-changeset-fixed.mjs and node scripts/check-empty-changeset.mjs: pass.
  • pnpm --filter @objectstack/cli test: 667 test files passed on the first run and 25 failed, all 25 because that run had built the CLI's dependencies and not the CLI itself (the tests spawn dist/). After turbo run build --filter=@objectstack/cli, those 25 files were run again: 25 files, 143 tests, all pass.

Clause-②: no
Metadata-protocol: none

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic.
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint passes. (No formatter ran. Only the touched file was linted, as noted above.)
  • 4. One issue, one branch off an up-to-date main, one pull request. (One branch off an up-to-date main and one pull request; no issue, and the branch carries a session name instead of an issue number.)
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset.
  • 6. packages/spec touched: its generated artifacts are regenerated and committed. (Not touched.)
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English.
  • The Before Submitting list in CONTRIBUTING.md is done. (Partly: see items 3 and 4.)

Generated by Claude Code

The preset fallback read `flags.preset ?? (isDev ? 'default' : 'default')`.
Both arms of the inner conditional were the same string, so the development
check decided nothing. The line now reads `flags.preset ?? 'default'`;
behaviour is unchanged.

Claude-Session: https://claude.ai/code/session_017xRBcS7F1RYaiGn99nvUtU
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/s documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Dec 2, 2026
@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

Nothing in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 1 changed package(s)), so this run has no opinion about the docs.

What this run could not see
  • 1 anchor(s) matched too much of the corpus to be a work list: os serve (command, 53 pages)
  • 1 name(s) were too generic to anchor anything (single lowercase words)
  • 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 — 41 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 6354509427fab0ca2052b2b05be787f8593422ca → packageMentionDocs.

@sunhaolin
sunhaolin marked this pull request as ready for review December 2, 2026 09:10

This branch has not been deployed

No deployments
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 tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants