Skip to content

fix(lint)!: refuse a page component whose properties is present but not an object, nested ones included - #25067

Merged
objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/issue-24991-nested-props-non-record
Oct 21, 2026
Merged

objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/issue-24991-nested-props-non-record

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Closes #24991

Clause-②: no (narrowing: os lint --strict refuses a nested page component whose properties is null or an array)

What

validateComponentProps (packages/lint/src/validate-component-props.ts) now refuses a walked page component, top-level or nested, whose properties is present but not a record (null, an array, a scalar). The refusal is one component-props-invalid error at the node's own properties path, for example pages[0].regions[0].components[0].properties.children[0].properties. The message names what was received.

Why

PageComponentSchema declares properties a record, but that parse only reaches top-level components (regions[].components[], slots.*). A nested component (in children, items[].children or footer) sits in a z.array(z.unknown()) slot that no parse judges. The rule set props to undefined for a non-record bag and skipped the node, so a nested record:related_list with properties: null or [], or a nested object-metric with properties: [], passed os lint --strict, os validate and tsc. The node published with none of its props.

No duplicate with the schema's own top-level refusal

At both doors (CLI and the runtime page save door), the page parse runs before any authoring rule and stops on its own refusal. So a top-level non-record bag is reported once, by the parse ("expected record"), and this rule's finding never appears beside it. On a top-level node the new branch only answers a caller that hands the rule an unparsed stack, and it gives the same verdict. A test pins both halves: PageSchema.safeParse refuses the top-level bag at regions.0.components.0.properties and accepts the nested one, which is the gap.

Tests

On head 88d3dd0572 (the lint source is byte-identical to c444510a55, where the package suite ran; the later merge brought no packages/lint or packages/spec change):

  • pnpm --filter @objectstack/lint test: 153 files passed, 7080 tests passed, 5 skipped.
  • pnpm --filter @objectstack/lint typecheck (with check:test-typecheck): exit 0.
  • New cases cover five walks (container children, tab items[].children, accordion items[].children, card footer, a slot component's children) times three bags (null, [], 'x'). Each draws exactly one component-props-invalid at the node's properties path. Each walk also has two controls: a valid bag stays silent, and an absent bag keeps the earlier verdict. Further cases: the object-metric [] probe, an unregistered type (refused, plus a silent object-bag control), a data-source-bound element (bag plus binding verdict, nothing more), the top-level parse/no-duplicate pin, and pipeline gating at error for validate, lint and build.
  • The old pin "a present bag that is not an object is still left to the parse that owns its shape" is removed. It pinned exactly the skip this PR closes.

Gates: node scripts/pm/dispatch-gates.mjs --commands derived 65 families on c444510a55. All 65 ran, and --ran reconciled them with exit codes recorded: 65 run, 0 NOT-MEASURED (a derived zero). The --commands derivation on 88d3dd0572 is byte-identical. On 88d3dd0572 I reran check-adr-0087-registration --base origin/main, check-changeset-no-major --base origin/main, check-empty-changeset --base origin/main and check:nul-bytes, all exit 0. check:dts-closure and check:dual-build-cjs-loads exited non-zero in the first sweep. That sweep ran while I was rebuilding shared dists with OS_SKIP_DTS=1 for the producer measurement, so the dists were mid-rebuild. Both reran clean (exit 0) once that build finished, with no source change between the two runs.

Producers measured

I ran the rule over every in-repo example stack (normalized, through validateComponentProps) on c444510a55:

stack pages component-props findings non-record bag findings
examples/app-crm 1 0 0
examples/app-multi-package 0 0 0
examples/app-showcase 29 0 0
examples/app-todo 0 0 0

Positive control: I planted a nested record:related_list with properties: null in memory into the showcase's showcase_component_gallery page. It drew exactly 1 finding at pages[2].regions[0].components[1].properties.children[0].properties. A static grep of examples/** and the page sources for a literal properties: null or properties: [] also returns zero hits. There are no in-repo producers to fix.

Changeset

.changeset/24991-nested-props-non-record.md: @objectstack/lint minor, with a BREAKING section (what moves at os build / os validate / os lint and the page save door, the remedy, what is unchanged). It carries the claim's Clause-② line. The ADR-0087 disposition is not-required (no-migration-prescription): no authorable key, spelling, export or stored shape moves. Stored pages are not converted and keep loading until their next save, and the repair (restoring the lost props) is not derivable by a ledger entry. check-adr-0087-registration accepts it.

Acceptance notes

  • No governed surface is touched: the diff is packages/lint/src/validate-component-props.ts, its test and one changeset.
  • No open PR touches validate-component-props.ts. I checked the files of all 11 open PRs before opening this one.
  • CI owns the repo-wide pnpm lint and the full battery. This PR did not run them locally.

Generated by Claude Code

@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tests tooling labels Oct 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

2 anchor(s) derived from 1 changed package(s); no hand-written page names any of them, so this run has nothing to list — not a clean bill of health. This check sees only pages that NAME a derived anchor: one that documents this change in prose, or enumerates it in an authoring dialect, names none and stays invisible to it on every run.

What this run could not see
  • 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 — 4 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 688052e147f23a15e127070ff1bc7c1572de09ab → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 5b1ea5cbcb99e2a9d86d3a66e73daa3dc4a452e0 — the merge of head 88d3dd057289261d4c6d95a86ca96c7823ff68c9 into base 688052e147f23a15e127070ff1bc7c1572de09ab, 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 5b1ea5cbcb99e2a9d86d3a66e73daa3dc4a452e0 && git checkout 5b1ea5cbcb99e2a9d86d3a66e73daa3dc4a452e0
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 688052e147f23a15e127070ff1bc7c1572de09ab 88d3dd057289261d4c6d95a86ca96c7823ff68c9 && git checkout -B drift-repro 688052e147f23a15e127070ff1bc7c1572de09ab && git merge --no-ff 88d3dd057289261d4c6d95a86ca96c7823ff68c9

node scripts/docs-audit/affected-docs.mjs --json 688052e147f23a15e127070ff1bc7c1572de09ab

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

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

Seat review — PASS · domain:spec seat 3

Head: 88d3dd057289261d4c6d95a86ca96c7823ff68c9. Card #24991, claim 6308270351, dev report 6309774593.

  • Contract review: none owed. The diff touches only packages/lint/src/validate-component-props{,.test}.ts and .changeset/24991-*.md: nothing under packages/spec/src/** and no governed path (check-governed-merges: NOT governed). It declares Clause-②: no.
  • Diff read: a walked node whose properties is present but not a record draws one component-props-invalid error at <path>.properties. The rest of the node is still judged (the data-source binding check runs first). The per-prop pass is skipped, so no missing-prop duplicate appears. An absent bag keeps its lint: five os lint --strict blind spots measured against firing controls — aliased ctx.api in hook handlers, action-body free identifiers, unbound visibility roots, lookup-bound detail grants, empty record:details sections #22212 {} verdict. An unregistered type with a malformed bag is refused too, and the dev measured 0 in-repo producers across 30 shipped pages, with a positive control.
  • Changeset: @objectstack/lint minor with the BREAKING banner (launch-window rule for a narrowing), the Clause-② line matching the claim, and ADR-0087 not-required (no-migration-prescription). That disposition holds: no conversion can restore props a component has lost.

Seat re-read of the check-runs at landing: all 41 runs on 88d3dd0572 have completed: 34 succeeded, the rest were skipped, and none is red.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review October 21, 2026 07:12
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge October 21, 2026 07:12
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Oct 21, 2026
Merged via the queue into main with commit c0ae356 Oct 21, 2026
42 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-24991-nested-props-non-record branch October 21, 2026 07:44
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/m tests tooling

Projects

None yet

2 participants