Repository navigation
fix(cli): objectui check prints the refused key and path, and never calls an unvalidated file passed (objectui#11007) - #11053
Conversation
…alls an unvalidated file passed `check` recognises a JSON file either by a structural root key or by the whole document validating. For a file refused by both arms whose root `type` is registered, it listed the file and its type but threw away the validator's issue it already held, so a root `object-map` with a mistyped `map` key was listed without the key. A file admitted on a structural key (`children`, `className`, ...) is never parsed, yet the run closed with "All checks passed" over it, a nested refused key included. - Each "did not validate" entry now carries one indented line: the first issue's path, spelled the way `objectui validate` prints it, and its message, with the issue count when there is more than one. - The no-error close is now a tally: validated, recognised but not validated, did not validate, and a pointer to `objectui validate` for a verdict. Nothing reads as a pass. The exit code does not move. - The path spelling moves into `utils/issue-path.ts` (`formatIssuePath`), shared by `validate` and `check`, so the two cannot drift. `validate`'s output is byte-identical. - No nested walk is added to `check`; a pin holds that boundary. Claude-Session: https://claude.ai/code/session_011p7ikEivgXefNDaE5S5Uec Co-authored-by: Claude <noreply@anthropic.com>
…eset and dated notes - `content/docs/utilities/cli.mdx`: the `objectui check` section says that a file admitted by a structural key is not parsed, shows the first-issue line under a file that did not validate, and describes the closing tally. - `.changeset/11007-check-prints-key.md`: `@object-ui/cli` patch. - Dated notes on three pending changesets whose sentences this change makes false: `check` listing a file "without the issue" / "without naming the missing field", and `check` having no zod-issue printer. Each note is appended; the existing text and declarations are unchanged. Claude-Session: https://claude.ai/code/session_011p7ikEivgXefNDaE5S5Uec Co-authored-by: Claude <noreply@anthropic.com>
|
changeset-claim-re-read
|
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
… structurally admitted file The row ended "so `check` passes it". `objectui check` no longer prints a pass line: it counts such a file as recognised but not validated and exits 0, and the refusal is `objectui validate`'s. Only that clause changes. Claude-Session: https://claude.ai/code/session_011p7ikEivgXefNDaE5S5Uec Co-authored-by: Claude <noreply@anthropic.com>
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
Contract reviewServed-tier: Inputs read: card #11007 (body, triage ① Derived judgments
② Semver level
The PR body's declaration line reads ③ Boundary flags
Check-runs on the head (latest per name, read with Implemented-by: VERDICT: PASS Generated by Claude Code |
… evaluates (objectui#4795) (objectstack-ai#11126) Fixes objectstack-ai#4795 Clause-②: yes — `objectui check` newly refuses `${…}` in the four closed keys where `expressionBindableTextKeysFor(type)` excludes the key, as ruled (`5406135987`, `5479466110`). The PR waits as a draft for the director seat's contract review. Ruling item 2 of objectstack-ai#4795 (maintainer, 2026-08-31, comment `5479466110`), built in `objectui check` as ruled. Draft for the director seat's contract review. ## The repository's own `pnpm check`: red in round 1, resolved by the seat's answer A `.github/workflows/lint.yml` runs `pnpm check` on this repository (step "Verify the CLI's own check command passes on this repository"). Measured with the CLI built from each tree: | tree | `pnpm check` exit | refusals | warnings | |:--|:--|:--|:--| | `main` `d1e683fa1` (no gate) | 0 | 0 | 0 | | round 1, `ed32e7c6b` | 1 | 1 | 0 | | this branch, `c985c4d7d` | 0 | 0 | 0 | **The round-1 refusal.** It was `examples/schema-catalog/src/schemas/plugin-editor/javascript-editor.json`: a root `code-editor` whose `value` was a JavaScript sample using template literals. That is literal content, not a misplaced expression, and it had no mechanical channel move. **The fix.** The seat chose A under ruling `5479466110`: 「no-row types included」, and 「A row can always be added later with a named need + its own measurement」. The sample now builds the same strings by concatenation. Run, it still logs `Hello, Developer!` and returns `Welcome, Developer`. **Nothing pinned the old content.** No test, snapshot or docs fence reproduces it: - the catalog registers the file by import; - `safe-validate-corpus-6318.test.ts` asserts only that it validates; - `catalog-gallery-render.test.tsx` skips it, because Monaco cannot load under happy-dom; - `plugin-editor.mdx` embeds it by id through `SchemaExample`. The run's closing tally is the same as on `main`: `265 validated, 167 recognised but not validated, 1 did not validate`. ## What it does `findUnbindableTextExpressions` (new, `packages/cli/src/utils/unbindable-text-expressions.ts`), called by `check` on every recognised file, from either recognition arm: - **The rule.** Each of the four keys `EXPRESSION_BINDABLE_TEXT_KEYS` on a component node is judged against `expressionBindableTextKeysFor(type)`. Both are imported from `@objectstack/spec/ui`: the vocabulary and the carriage map are consumed, not copied. - **Component nodes (sub-rule i).** The document root, plus every node `children` holds (an array or a single node), recursively. A root of type `page` is not judged itself, because its `title` is a page key; its `children` still are. - **Expression.** The evaluator's own interpolation pattern, as `ExpressionEvaluator.evaluate` matches it. A lone `${` or an empty `${}` is not an expression there, so it is not one here. - **Refusal vs warning (sub-rule ii).** A registered type (the `isKnownSchemaType` universe) is refused: a red `x Unevaluated expression in FILE at PATH: …` line plus a channel line, and it counts toward the run's `Found N errors`, so the exit code is 1. A type no registered component answers to gets a yellow `⚠️ Expression not judged in …` line, and the run still passes. - **Message.** It follows the `describeFirstIssue` shape objectui#11007 / PR objectstack-ai#11053 gave `check`. The path is spelled by `formatIssuePath`, the formatter `objectui validate` prints with. It names the key, the path, the type, the keys that type does evaluate, and the channels `SchemaRenderer` evaluates: the type's own evaluated keys, `content`, `properties.KEY` (evaluated, then hoisted onto the node), or resolving the value in the host. `@objectstack/spec` becomes a declared dependency of `@object-ui/cli` at `^17.1.0`. That is the range `@object-ui/react` declares, and `@object-ui/react` is the runtime consumer of the same lookup. The lockfile gains only the importer entry, which resolves the installed version. Docs: `content/docs/utilities/cli.mdx` gains the rule, the two sub-rules and the real output. It also says a refused expression now fails the run, where the page used to say only unreadable JSON did, and that a literal `${…}` has no escape spelling (the changeset says so too). Changeset: `@object-ui/cli` minor. ## Premises re-derived on `main` `d1e683fa1` 1. **Spec floor and carriage map.** The lockfile carries a single `@objectstack/spec`, and the installed `node_modules/@objectstack/spec/package.json` reads 17.4.0. It exports both symbols. Its answers: `statistic` gives `label` / `value` / `description`; `card` gives `title` / `description`; `button` gives `label`; `text`, `action:button`, `ui:card` and `page` give the empty set. `check:spec-floors` fetched the declared-floor tarball and passed: the CLI artifact's two `./ui` symbols are present at the floor. Nothing here depends on 17.5.0. 2. **Type keying.** The evaluation memo in `SchemaRenderer` calls `expressionBindableTextKeysFor(typeof newSchema.type === 'string' ? newSchema.type : '')`, verbatim, with no prefix stripping. The comment "keys on the bare registry name" describes the spec map's keys; it does not describe a normalization. The gate passes `node.type` verbatim. - **Measured once through the real `SchemaRenderer` (at `e2f8e48d9`; the gate's code is unchanged since):** every one of the 649 registered types was rendered with the four keys set to `${data.total}`. On every type, the keys it left unevaluated equalled the gate's refusals, 0 disagreements. The types it evaluated anything on were exactly those with a row. - **Not committed, for one reason:** a CLI test importing `@object-ui/react` turns the CLI's generated-source allowance for that dependency stale in `check:unused-deps` (`DECLARED_WITHOUT_IMPORT`). That ledger is outside this claim's file surface. - **What is committed instead:** the unit-tier table. It pins the gate against the verbatim lookup on every registered type, and derives the namespaced spellings a prefix-stripping gate would get wrong. The runtime half stays pinned by the `@object-ui/react` suite `SchemaRenderer.bindableTextKeys.test.tsx` ("a namespaced spelling is not silently normalized"). 3. **Sub-rule (i) premise: holds.** - `SchemaRenderer` does not recurse on its own. Each renderer hands keys back through `renderChildren` / `renderNodeSlot` / a direct `SchemaRenderer`. - A form's `fields[]` entries are rendered by the form's `renderFieldComponent` (field widgets under `field:*`), never through `SchemaRenderer`. - `check` judged the root only before this change. - The walk follows `children` alone. That is the one composition key `BaseSchema` declares, and the same single spelling core's `validateChildren` and the SDUI parser's `CHILD_LIST_KEY` follow. - Census of the recognised corpus: objects with a string `type` that are not nodes sit under `form` `fields[]`, `filter-builder` `fields[]`, `grid` `columns[]`, `dashboard` `widgets[]` / `globalFilters[]`, and even `object-grid`'s `columns[].summary` (`{ "type": "count_unique" }`) and `selection` (`{ "type": "multiple" }`). A walk over every typed object would judge all of them. 4. **Corpus.** See the table above: one offender in round 1, not mechanical. It was resolved in round 2 by rewriting the sample, the seat's answer A. 5. **Sub-rule (ii).** Pinned: `stat-card` warns and the run passes. `text.value`, `action:button.label`, `card.label` and `ui:card.title` are refused. `statistic.value`, `card.title` and `button.label` pass. 6. **Message format.** See above. 7. **PR objectstack-ai#11069.** Not read from and not edited toward. The second of the two to land merges `main`. ## Tests - `packages/cli/src/__tests__/check-unbindable-text-expression-4795.test.ts` (unit tier, 28 tests). Expected text is derived from the command's own formatters, fed from the gate's real findings. It covers: - the refusals, with the key, path, type, channels and exit code; - the passes, including a lone `${` and an empty `${}`; - the walk through `children` (array and single node) and multiple refusals per file; - the page-root `title` exclusion, with the page's children still judged; - the form-field `label` non-refusal, with a control: the same object under `children` IS refused; - the `stat-card` warning; - validity-arm files judged and unrecognised files not; - the verbatim-lookup agreement table over every registered type. - Whole package, `pnpm exec vitest run packages/cli/` at `c985c4d7d`, under the verify lock: `Test Files 23 passed (23)`, `Tests 330 passed (330)`. - The catalog the rewritten sample lives in, `pnpm exec vitest run examples/schema-catalog/` at `c985c4d7d`, under the verify lock: `Test Files 34 passed (34)`, `Tests 2199 passed (2199)`. Within it, `safe-validate-corpus-6318.test.ts` passes `plugin-editor/javascript-editor validates unchanged`. ## Ablations Each direction was predicted before the run. Mutations went through `ablation-replace.mjs`: in each run the anchor went 1 to 0, the marker 0 to 1, and the restore proved blob == HEAD with `git diff HEAD` empty. All three were re-run on `ed32e7c6b`. Round 2 touched neither the gate nor its tests, so these readings stand. 1. **Refusal removed** (severity forced to `warning`). Predicted: the refusal pins go red. Observed: `15 failed | 13 passed`. The passes, the page-root exclusion, the `stat-card` warning and the unrecognised-file pins stayed green. 2. **Walk widened** to every object with a string `type`. Predicted: only the form-field pin goes red. Observed: exactly that, `1 failed | 27 passed`, and the failure prints the refusal at `fields → 0 → label`. 3. **Namespace stripped** before the lookup. Predicted: the two agreement cases and `ui:card.title` go red. Observed: 5 red, those 3 plus `action:button.label` and "refuses every offending node". `action:button` strips to `button`, which has a `label` row. The direction matched the prediction, with two more reds than predicted, both explained. ## Gates (exit codes; at `c985c4d7d` unless noted) Heavy runs (builds, test suites, `pnpm check`, the doc compile gates, `check:node-esm-load`) went through the shared verify lock in round 2. - **CLI package:** `type-check` 0 · `lint` 0 (0 errors; 5 warnings, all in files this PR does not touch) · tests 0 (above). - **Repo check:** `pnpm check` **0**: 0 refusals, 0 warnings. - **Changesets:** `check-changeset-presence` 0 · `check-changeset-no-major` 0 · `check-changeset-overwrite` 0 · `check-changeset-fixed` 0 · `check:changeset-claims` 0 (report-only; it names the same five pending changesets as round 1, and none is falsified by this diff) · `check:pending-changeset-literals` 0. - **Bytes and citations:** `check:control-bytes` 0 · `check:new-line-citations` 0. - **Dependencies and lockfile:** `check:phantom-deps` 0 · `check:unused-deps` 0 · `check:lockfile-integrity` 0 · `check:lockfile-dedupe` 0. At `ed32e7c6b` (round 2 moved no manifest and no CLI source): `check:spec-floors` 0 · `check:installed-pin-claims` 0 · `check:esm-specifiers` 0 · `check:spec-symbols` 0 · `check:self-import` 0. - **Docs:** `check:doc-snippets` 0 (681 of 681 blocks) · `check:doc-examples` 0 · `check-doc-component-types` 0 · `check-prompt-component-keys` 0 · `check-doc-example-ids` 0 · `check-doc-fence-languages` 0 · `check-doc-links` 0 · `check-doc-expression-carriage` 0 (report-only) · `toc-anchor-parity.test.tsx` 15 passed. - **Test shape and dist, at `ed32e7c6b`** (round 2 touched no source or test file): `check-lint-coverage` 0 · `check:test-path-roots` 0 · `check:vi-mock-*` (three) 0 · `type-check:coverage` 0 · `check:unreferenced-sources` 0 · `check:dist-completeness` 0 · `check:published-dist` 0 · `check:shell-escape-residue` 0. - **Governed surface:** `check-governed-queue-guard --test` over the eight paths: NOT GOVERNED · `check:governed-queue-guard` self-test 0 (at `ed32e7c6b`). - **`check:node-esm-load`: 1, left to CI.** Under the lock at `c985c4d7d`, it again refused `@object-ui/auth` and `@object-ui/react-runtime` on provenance: the turbo cache is shared across worktrees and replayed another tree's build. The `@object-ui/cli` entry was among the 32 graded loads. CI builds fresh. ## Acceptance notes - **Known limitation: no escape spelling.** - A literal `${…}` in a closed key of a type with no carriage row is refused, and nothing lets it through. That covers a code sample in a `code-editor` `value` and shell `${VAR}` text. - A carve-out for literal content is a spec-first decision, reopened on the first named user need. None is built here, and there is no local key list. - The docs page and the changeset say this. This repository's own sample was the only measured instance, and the runtime dev diagnostic already reported it. - **Walk boundary.** Nodes a renderer reaches through a key of its own are not walked: `trigger`, `header`, `footer`, a page's `regions[].components[]`, a tab's `items[].content`, `panels[].content` and carousel `items`. No declaration of per-renderer node slots exists to derive them from. The boundary fails quiet in the safe direction: it never produces a false refusal. - **Keys outside the four** (e.g. `badge.text`) are not judged. `5479466110` set item 2's scope to the carriage map, which narrows `5406135987`'s "any key outside that closed list". The `props`-envelope blank render is outside that scope too. - **`check` reads `.json` only.** `.yaml` / `.yml` are globbed and never read, as `check.ts` already stated. - **Two rulings meet in `check.ts`.** The objectui#11007 triage ruling declined a nested *validation* walk in `check`. Its pin "no nested walk of its own" stays green, because this walk validates nothing and reads only the four keys. Named here so the reviewer sees both rulings. - **The channel line says "evaluated", not "read back".** It mirrors the runtime diagnostic's vocabulary (objectui#7849). For `text.value`, which `TextSchema` retired and whose renderer reads `content` alone, `properties.value` is evaluated and hoisted but not rendered. The seat kept this wording (answer A, one vocabulary with the runtime diagnostic); the contract review may still choose B, which would be a one-line change in `workingChannels`. - **Runtime agreement.** The real `SchemaRenderer` was measured once over all 649 registered types, with 0 disagreements. The committed pins are the two verbatim-lookup halves. The seat chose not to add the DOM suite (answer A), so the CLI's `@object-ui/react` allowance in `check:unused-deps` is untouched. Session: `https://claude.ai/code/session_012UwY3ahMixEFkfTUxMVkYm` --- _Generated by [Claude Code](https://claude.ai/code/session_012UwY3ahMixEFkfTUxMVkYm)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
Fixes #11007
Clause-②: no
domain:uiseat 2, branchclaude/issue-11007-check-prints-key, sessionhttps://claude.ai/code/session_011p7ikEivgXefNDaE5S5Uec. Placeholders are spelled in capitals (FILE) because GitHub strips tag-shaped text from a body.What this changes
objectui checkrecognises a JSON file in one of two ways: a structural root key (children,className, …) admits it without parsing it, or the whole document validates. Measured onorigin/mainatbf7ab35cebefore this change, with the card's two documents:object-mapwhosemapblock carrieslatitudeFieIdwas listed under "did not validate" asmap.json (type "object-map"). The validator's issue was already in hand from the recognising parse, and was dropped.childrenwas admitted onchildrenand never parsed. The run ended✓ All checks passed. No exit call in either run.Per the triage ruling (both halves, narrowly):
objectui validate'sPath:line, and its message, with the issue count when there is more than one. For the card's root case it readsIssue at map: Unrecognized key: "latitudeFieId". It reuses the issues of the parse the recogniser already ran. Skipped (foreign) files still get no diagnosis.ObjectUI schema files: V validated, S recognised but not validated, U did not validate. This sweep is advisory; run objectui validate FILE for a verdict.Nothing reads as a pass. The parse-error close (Found N errors, exit 1) is untouched.check. A structurally admitted file is still not parsed, and a pin holds that boundary: a later walk turns it red.Surface beyond the claim's file list, and why
packages/cli/src/utils/issue-path.ts(new,formatIssuePath), andvalidate.tsswitched to it. The suggested route said to reusevalidate's formatter rather than copy it. It was an inline ternary with no export, so it moved into one helper that both commands call.validate's output is byte-identical: same expression, and its three suites are green below.validate.tsand the header ofutils/union-arm-diagnostics.tseach saidvalidateis "the repository's only zod-issue printer". This change makes that false, so both now say whatcheckprints (one first-issue line, no arm selection).7004-cli-union-arm-selection.md(check"has no zod-issue printer"),7694-chart-series-chart-type-alias-refusal.md("without the issue") and6475-gantt-block-face-declared.md("without naming the missing field"). The shape follows the 2026-09-25 dated notes (objectui#10524) on the same files.check-changeset-overwritereports the three as modified, with declarations unchanged (report-only).Closing text pinned next to an exit code. The order asked for this to be reported, not acted on. Four existing tests asserted
All checks passedbeside their exit-code assertion:check-jsonc-parse(two),check-schema-markerandcheck-validity-recogniser.check-known-typesused the same line as its "not a failure" signal. Each text assertion now reads the tally throughclosingLine(...). Every exit-code assertion is unchanged.Tests
packages/cli/src/__tests__/check-first-issue-11007.test.ts, 8 tests:map.map → zoom./pass/i, the tally is 0 / 1 / 0, and there is no exit call.safeValidateSchematells them apart.Expected text comes from
describeFirstIssueandclosingLine, fed with realsafeValidateSchemaissues. The assertions pin the subject (key, path, counts), not the wording.Ablations. Each was one-shot, run on the committed tree at
762723318through objectstack'sscripts/ablation-replace.mjs. Each restore was proven: the blob equals HEAD andgit diff HEADis empty. No permanent test was added.Gates, all at
762723318(the final commit)pnpm exec vitest run packages/cli/→Test Files 22 passed (22),Tests 302 passed (302). The base has 21 files.pnpm --filter @object-ui/types build→ exit 0. That is the only workspace package the CLI's source imports (@object-ui/types/zod); the other@object-ui/*hits are template strings.pnpm --filter @object-ui/cli type-check(tsc --noEmit) → exit 0.--listFilesincludes the new test,issue-path.tsandcheck.ts.pnpm --filter @object-ui/cli build, thenpnpm check(the repo-tree runlint.ymlmakes) → exit 0. Output is below.lintscript runs it (eslint srcinpackages/cli, inline config honoured): 48 files, 0 errors, 5 warnings. All five areno-explicit-anyin untouched files.eslint.config.jsenables no type-aware linting (noparserOptions, no type-checked preset), so this diff cannot move any untouched file's verdict.check-changeset-presence✅ (1 added),check-changeset-no-major✅,check-control-bytes✅,check-new-line-citations0 new,check-pending-changeset-literals✅.check-changeset-claimsis report-only. It names two pending changesets that mention touched files: 6320 (the ignore list incheck.ts) and 7658 (headings incli.mdx). Both still hold.check-test-path-roots✅,check-unreferenced-sources✅,check-doc-fences✅,check-doc-types✅,check-spec-symbols✅,check-doc-example-ids✅,check-doc-example-readers✅,check-doc-links✅.check:doc-examplesandcheck:doc-snippets. Their prerequisite is not met: they need a scoped build of 34 packages. This diff adds no TypeScript block to any document; its one new fence istext. CI runs both.pnpm checkon this tree (FILEstands for the placeholder the command prints):Acceptance notes
None of these was filed.
typeselects no arm gets the bare message. Its first issue is the discriminator'sIssue at type: Invalid input. The only hit on this tree ispackages/vscode-extension/schemas/objectui-schema.json, a JSON Schema document with"type": "object", which is the bucket's known false positive.objectui validateadds its "No arm accepts type" note from arm selection, which the ruling keeps out ofcheck. This is polish.content/docs/plugins/plugin-chatbot.mdxsayscheck"passes" a structurally admitted chatbot document. It still exits 0 but no longer prints a pass line. Left as is.Analyzing N files..., as before and as the source already states. The tally counts JSON only.Generated by Claude Code