Repository navigation
Commit f3135a4
feat(types): declare node-level
Part of #10872
Clause-②: yes
Batch 9 of objectui#10872. It declares the node-level `responsiveStyles`
that `@objectstack/spec`'s `PageComponentSchema` declares on every page
component on the three arms outside the public-block set that a producer
writes it on: `flex`, `object-grid` and `object-chart`. The declaration
is by reference to the spec, from batch 8's fragment. Claim
`5918816527`, seat `domain:ui#1`, session
`https://claude.ai/code/session_0122Knsowci76D2rBWReCzzZ`.
**Clause-② yes (widening).** The strict authoring face
(`StrictAnyComponentSchema`) now accepts a spec-valid node-level
`responsiveStyles` on `FlexSchema`, `ObjectGridSchema` and
`ObjectChartSchema`. Before, it refused the key by name. Changeset:
`.changeset/10872-flat-arm-responsive-styles.md`, `'@object-ui/types':
minor`. Unlike batch 8's arms, these three were already published, so
the changeset spells out the narrowings too (see Acceptance notes).
## What changed
- **zod.** `FlexSchema` (`layout.zod.ts`), `ObjectGridSchema` and
`ObjectChartSchema` (`objectql.zod.ts`) spread the same fragment the 30
public-block arms spread. The member is ONE object on all 33 arms: the
spec's `ResponsiveStylesSchema` through the objectui#8317 boundary.
`BaseSchema` is not touched, and neither is any other arm.
- **The fragment is renamed from `PUBLIC_BLOCK_ENVELOPE` to
`NODE_ENVELOPE`.** It stays in `public-blocks.zod.ts`, because that
module imports only `base.zod.ts`, `imported-defaults.ts` and
`tombstone.zod.ts`, so neither import makes a cycle. With `flex`
spreading it, the old name would tell a reader that `flex` is a public
block. The rename is mechanical: 30 occurrences in
`public-blocks.zod.ts`, 5 in `objectql.zod.ts`, plus one census row key,
one test comment and one README line. On-disk counts were 0 old / 38 new
after the rename.
- **TypeScript twins.** `FlexSchema` (`layout.ts`), `ObjectGridSchema`
and `ObjectChartSchema` (`objectql.ts`) declare `responsiveStyles?:
ResponsiveStyles`, the spec's type by reference (type-only import, as
`dataSource?: ElementDataSource` already is). It is not on
`FlexLayoutProps`, so `stack` does not gain it.
- **`object-view`'s `table` slot does not gain the key.** The slot is
built from `ObjectGridSchema`'s shape, so the zod change alone would
have made `table.responsiveStyles` accepted and judged, where nothing
compiles it: `ObjectView` draws its grid as a component. The slot now
refuses it by name, as it refuses the other node-level keys
(objectui#10976). The reason is its own, not the shared node-level one,
because that one points the author at the `object-view` node, whose arm
does not declare the key either.
- **Pins.** New:
`packages/types/src/__tests__/flat-arm-responsive-styles-10872.test.ts`,
with 37 runtime rows and 3 type-level assertion groups. Forced edits to
existing pins:
- batch 8's pin: its boundary control moves from `flex` to `grid`;
- `object-view-slot-key-lists.test.ts`: the grid's member count goes
from 63 to 64, and `responsiveStyles` joins the `nodeLevel` withheld
set;
- `stack-schema-emitted-members.test.ts`: `stack` declares exactly
`flex`'s members less the named `responsiveStyles`;
- census text in `zod-mirror-parity.test.ts` and
`imported-defaults-8317.test.ts`: the row key follows the rename, and
the reason names the three arms. The census reads presence, not words.
- One zod `README.md` line plus the rename in the existing line, and one
changeset.
## The order's mechanism assumptions, measured
1. **The pull, re-driven.** objectui `54a78308a3` was read from its
tracked files. objectstack `aaad682dbc` (main at 2026-09-30T19:33Z) was
read from a depth-1 scratch clone; the shared checkout was not fetched
or edited. The instrument is `scripts/body-dialect-census.mjs`
(`scanNodes`, `keepFencedCodeOnly`, `bucketOf`) under an uncommitted
scratch driver. It counts NODES carrying a node-level
`responsiveStyles`, and it reads the arm population at run time from
`AnyComponentSchema` (189 literals, 30 of them public-block literals).
- Non-test producers on arms outside the public-block set: `flex` 16
(showcase `command-center.page.ts` 8 and `styling-gallery.page.ts` 7,
plus skill `rules/pages.md` 1), `object-chart` 1 and `object-grid` 1
(both in `command-center.page.ts`). Every other non-public arm: 0.
objectui non-test: 0.
- Lit control: the detector fires on the test buckets, on the same types
(objectstack `flex` 11; objectui `flex` 1, `object-chart` 1).
- **Confirmed**, and the population is exactly these three arms.
2. **The faces at base.** For all three arms, the strict face refused a
valid map as `unrecognized_keys` naming `responsiveStyles`. The tolerant
face ACCEPTED and kept `7` and `{ md: … }` unjudged. `grid`, `stack` and
`container` read the same. **Confirmed.**
3. **Reuse the fragment.** There is no cycle, so the fragment was not
moved. It was renamed because the name would lie (see What changed).
There is no second copy of the member: the pin asserts identity with
`PageSectionBlockSchema.shape.responsiveStyles`.
4. **Flat arms and the TypeScript twins.** Measured with the zod member
alone, before any TypeScript edit, `tsc -p tsconfig.test.json` failed on
two census assertions:
- `assertionMirroredUndeclaredMatchesLedger` named exactly the three
pairs (`layout.zod.ts#FlexSchema`, `objectql.zod.ts#ObjectChartSchema`,
`objectql.zod.ts#ObjectGridSchema`);
- `assertionMirroredUndeclaredRecordsEveryKey` named `responsiveStyles`.
Two edits turn it green: three new `MirroredUndeclared` rows, or the
declaration on the twins. That ledger is a floor that "can only shrink",
so the declaration was taken, by reference to the spec's type, as the
order's item 4 says. It is part of the same widening. Two more consumers
read the twins through the compiler and were forced as listed above.
5. **`BaseSchema` stays untouched.** It is not in the diff; the pin
asserts that `BaseSchema.shape` lacks the key and that every other arm
refuses it. There is no `needs_decision`.
## Evidence
- **Red first**, at base `54a78308a3` with the pin added and the source
unmodified. `pnpm exec vitest run --maxWorkers=2
…/flat-arm-responsive-styles-10872.test.ts` gave `Tests 17 failed | 20
passed (37)`. The 17 reds:
- 3 member-identity rows, the spec-map row and the arm-population row;
- 3 valid-node rows (strict face `unrecognized_keys`);
- 9 invalid-value rows (tolerant face accepted, expected the spec's
issue).
The 20 controls (population, lit control, `grid` / `stack` /
`container`, and the other five envelope keys) were green. `pnpm
--filter @object-ui/types type-check` at base gave 8 errors: TS2339 on
the three zod shapes, and TS2344 `Type 'false' does not satisfy the
constraint 'true'` on the three TypeScript-twin assertions.
- **Ablation**, at `c4edd1d106` with the implementation committed first.
It ran three single-arm legs through objectstack's
`scripts/ablation-replace.mjs` in WRAP mode, plus a shell trap restoring
both zod files by absolute path. Each leg deleted one arm's spread, and
each anchor hit exactly once:
- `flex` leg: blob `797a9c0b4e63` to `6011a4533631`, `Tests 7 failed |
30 passed (37)`;
- `object-grid` leg: `2aa44c282213` to `1e00d88afe2c`, `6 failed | 31
passed`;
- `object-chart` leg: `2aa44c282213` to `673ec48085df`, `6 failed | 31
passed`.
The union of the three is exactly the 17 red-first rows. Every restore
read `ok restored: blob == HEAD … git diff HEAD is empty`, and the final
check read both blobs equal to HEAD with `git diff HEAD` at 0 bytes. The
pin imports `../zod/index.zod.js` from source, so there is no dist leg.
- **Reverse type check**, through the rebuilt `dist`. A scratch consumer
in `packages/components` resolved `@object-ui/types` to
`packages/types/dist/index.d.ts` (`--traceResolution`). It got exactly 3
errors, one per bad line: TS2353 `'md' does not exist`, TS2559 for a
number, and TS2322 for a boolean style value. The three valid lines got
none. The scratch files were deleted.
- **Runtime probe** (scratch, deleted). Each type was mounted through
the real `SchemaRenderer` and registry, and each emitted a
`style[data-os-scope]` with the base block and the `@media` override:
- `flex`: the scope class is on the flex root `div`;
- `object-grid`: on the grid's container `div`, which holds the rows;
- `object-chart`: on the chart container (`[data-slot="chart"]`), which
holds the SVG.
In each control without the key, 0 style tags were emitted. Declared is
enforced on these arms.
- **Final head `c31dff6c1f`**, clean tree, one os-verify-lock hold per
step, every VERDICT command-exit 0:
- `pnpm --filter @object-ui/types build` gave `dist completeness: 1
package(s) complete`;
- `pnpm --filter @object-ui/types type-check` passed, and `tsc -p
tsconfig.test.json --listFilesOnly` lists both 10872 pins;
- `pnpm exec vitest run packages/types/` gave `Test Files 296 passed
(296)` and `Tests 7412 passed (7412)`;
- `pnpm exec vitest run packages/cli/` gave `23 passed (23)` and `335
passed (335)`; the registered-types ratchet is unchanged;
- **the arm-list consumer sweep** ran 162 test files outside
`packages/types` and `packages/cli`: every file naming the zod node
union, the strict face, `safeValidateSchema`, the `@object-ui/types/zod`
entry, an arm `.shape`, or `FlexSchema` / `StackSchema` /
`ObjectGridSchema` / `ObjectChartSchema` / `ObjectViewSchema` /
`responsiveStyles` / the fragment. It gave `79 passed` with 1537 tests
and `83 passed` with 1196 tests;
- the 24 `scripts/__tests__` files that read `.changeset/` gave `24
passed (24)` and `914 passed (914)`.
## Gates at `c31dff6c1f`
objectui has no `scripts/pm/dispatch-gates.mjs`. The families were
derived by hand from the root `package.json` for this diff's paths
(`packages/types/src/**`, one README, one changeset).
- `pnpm check:handler-key-reads`: exit 0, `OK 140 arm(s), 212
registration(s)`.
- `pnpm check:spec-symbols`: exit 0.
- `pnpm check:new-line-citations`: exit 0, `VERDICT
new-cross-file-line-citations: 0 new citation(s)`.
- `node scripts/check-changeset-presence.mjs`: exit 0, `12 source
file(s) of 1 released package(s) changed, and this change declares 1
changeset(s)`.
- `pnpm changeset:check`: exit 0, `No changeset declares a major bump`.
- `pnpm check:control-bytes`: exit 0. A `grep -P` control-byte scan of
the 13 changed files found 0.
- Exit 0 each: `check:changeset-claims` (report-only),
`check:pending-changeset-literals`, `check:component-surface-parity`
(report-only; no row names these keys), `check:test-path-roots`,
`check:element-data-source-declaration`, `check:esm-specifiers`, and
`markdown-test-inputs --audit`.
- `check-governed-queue-guard.mjs --test` on the 13 paths: NOT GOVERNED.
- ESLint on the 11 changed TS files, `--no-inline-config --format json`:
11 files, 0 errors. All 37 warnings are `no-explicit-any` on lines this
diff does not add (checked line by line against the diff).
`--print-config` shows no `project` / `projectService`, so linting is
not type-aware and an untouched file's verdict cannot move. Repo-wide
`pnpm lint` is CI's.
- NOT MEASURED: `check:readme-exports`. Its population collapsed
(`packagesRead: found 3, floor is 25`) because the other packages'
`dist` is not built in this worktree. That is a prerequisite, not a
verdict. The README lines edited here carry no fenced block.
## Acceptance notes
- **The narrowings on already-published arms**, disclosed in the
changeset. The tolerant face now refuses a spec-refused
`responsiveStyles` value on the three arms, and `table.responsiveStyles`
by name. The three TypeScript interfaces type the key as the spec's
type, where it was `any` through the index signature. Level: `minor`, as
the ruling set it; `check-changeset-no-major` forbids `major`.
- **The 18 producer nodes still do not validate on objectui's faces
after this batch, for a reason outside this card's key.** The showcase
writes them in the spec's page-component form, with props under
`properties`. The three flat arms do not declare `properties`, so the
strict face also refuses them by name. On the tolerant face the
`object-grid` and `object-chart` nodes are refused too (`objectName`
required; no chart family), because the arms read those keys at node
level. `SchemaRenderer` hoists `properties` and renders the nodes, and
the spec accepts them. This is reported to the seat as a finding, and is
relevant to PR objectui#11069's un-park census.
- `object-chart`'s scope class lands on the chart container, not the
`ObjectChart` root. A first probe on a node with no series binding drew
the explanatory placeholder, and that placeholder did not carry the
class.
- Downstream consumers' type-check is declared to CI's `Type Check`.
Outside `packages/types`, no TypeScript source writes `responsiveStyles`
on a node typed as one of these interfaces: the only hits are comments,
`identity-probe` fixtures and `SchemaRenderer`'s own read. The one
derived type, the `table` slot's `Pick`, is pinned by
`object-view-slot-key-lists`.
- `origin/main` moved to `f4ed2387e9` (objectui#10188, objectui#11163)
with zero file overlap with this branch, so it was not merged; the queue
rebuilds on `main`.
## Deviations
- The fragment was renamed without being moved. The order tied the
rename to a move, but the name would lie either way.
- The PR's reach is wider than the claim's file surface:
`public-blocks.zod.ts` (rename only), `layout.ts` / `objectql.ts` (the
twins, forced by the census), and two existing type-reading pins
(forced). Each is listed above with its reason.
---
_Generated by [Claude
Code](https://claude.ai/code/session_0122Knsowci76D2rBWReCzzZ)_
---------
Co-authored-by: Claude <noreply@anthropic.com>responsiveStyles on flex, object-grid and object-chart, by reference to the spec (objectui#10872, batch 9) (#11273)1 parent 1cb3732 commit f3135a4
13 files changed
Lines changed: 498 additions & 55 deletions
File tree
- .changeset
- packages/types/src
- __tests__
- zod
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
Lines changed: 307 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
301 | 301 | | |
302 | 302 | | |
303 | 303 | | |
304 | | - | |
| 304 | + | |
| 305 | + | |
305 | 306 | | |
306 | 307 | | |
307 | 308 | | |
| |||
0 commit comments