Repository navigation
Commit 54a7830
feat(types): declare node-level
Part of #10872
Clause-②: yes
Batch 8 of objectui#10872, the envelope-key batch. It declares the
node-level `responsiveStyles` that `@objectstack/spec`'s
`PageComponentSchema` declares on every public-block arm, by reference
to the spec. The change is additive, and it is the only envelope key
this batch declares. Claim `5917584827`, seat `domain:ui#1`, session
`https://claude.ai/code/session_0122Knsowci76D2rBWReCzzZ`.
**Clause-② yes (widening).** The strict authoring face
(`StrictAnyComponentSchema`) now accepts a node-level `responsiveStyles`
on the 30 public-block arms: the 27 in `PublicBlockComponentSchema` and
the 3 in `ObjectQLPublicBlockComponentSchema`. Before this, it refused
the key by name. The tolerant face (`safeValidateSchema`) already
accepted the key, but never judged it. It now judges it the way the spec
does. The one narrowing is on the tolerant face: a value the spec
refuses (a `md` breakpoint, a number, a non-CSS value) no longer passes.
The renderer never applied such a value (probe below). Changeset:
`.changeset/10872-envelope-responsive-styles.md`, `'@object-ui/types':
minor`.
## What changed
- `packages/types/src/zod/public-blocks.zod.ts` adds
`PUBLIC_BLOCK_ENVELOPE = { responsiveStyles }`. The member is
`stripImportedDefaults(SpecResponsiveStylesSchema).optional()`, the
construct `dataSource` uses. It is written once and spread into each of
the 27 arms. Like `propsBag`, the fragment is internal: `index.zod.ts`
does not re-export it (the rebuilt `dist/zod/index.zod.d.ts` has 0 hits
for it; the control `PublicBlockComponentSchema` has 2).
- `packages/types/src/zod/objectql.zod.ts`: the three ObjectQL
public-block arms (`object-metric`, `object-master-detail-form`,
`object-timeline`) spread the same fragment. This is the fold that seat
note `5866125199` asked for.
- It is not declared on `BaseSchema`, and nothing else widens. The other
five envelope keys (`events`, `dataSource`, `aria`, `visibility`,
`responsive`) stay undeclared. `dataSource` stays on the four arms that
already read it.
- Census rows this change forces, and no others:
- `imported-defaults-8317.test.ts` gets an `IMPORTED` row for
`ResponsiveStylesSchema`. The census `every symbol the mirrors import is
covered by the differential above` requires it for every import, even
though this schema carries no default.
- `zod-mirror-parity.test.ts` gets an `EXCLUSIONS` row for the new
`export const` (a shape fragment, not a mirror).
- The 30 per-arm `EXCLUSIONS` reasons were left as they are: no test
reads them, and the new row's comment names the shared fragment.
- New pin
`packages/types/src/__tests__/public-block-responsive-styles-10872.test.ts`,
190 tests:
- a `page:section` bag node and an `object-metric` bag node with a valid
map parse on both faces, and the map comes back unchanged. Control: the
spec's `PageComponentSchema` accepts the same node;
- every arm accepts a node carrying only `responsiveStyles` on the
strict face;
- three invalid values are refused on both faces with exactly the issue
list (code, path, message) the spec emits for the same node, read at run
time;
- the member is one shared object across all 30 arms, and its breakpoint
schemas are the spec's own objects;
- `BaseSchema` does not declare the key, and a `flex` node is still
refused by name on the strict face, which is the boundary control;
- no arm gained any of the other five keys (`dataSource` only on the
four named arms), and each is still refused by name on the strict face
(146 cases);
- a type-level row: the member's input type equals the spec's
`ResponsiveStyles`, or undefined.
- `packages/types/src/zod/README.md` gets one line.
## Zone 2 readings (the order's mechanism assumptions)
1. **The pull, re-driven at this tip.** objectui `ae0b9d3905` and
objectstack `4d0b9cd542` (a depth-1 clone into the scratchpad; the
shared checkout was not fetched or edited). The instrument is
`scripts/body-dialect-census.mjs` (`scanNodes`), driven by a scratch
script that is not committed. The population is the 30 arm literals,
read at run time from the two unions. `responsiveStyles` still has
producers:
- the objectstack showcase writes it on 17 public-block nodes and 34
nodes of all types (`command-center.page.ts`, `styling-gallery.page.ts`,
`test/sdui-styling/pricing-showcase.ts`);
- `skills/objectstack-ui/rules/pages.md` teaches it on 2 public-block
nodes.
Non-test writers of the other five keys on arms that lack them: 0. The
only hits are `responsive` in the spec's own CHANGELOG and in its
retired-key conversion, and `dataSource` on `element:number` in
objectui's guide, where the arm already declares it. Lit controls: the
detector fires on the test buckets (`responsiveStyles` 12 in objectui,
14 in objectstack). Population: 644 objectstack nodes of the 30 types,
545 of them carrying `properties`.
2. **The spec's declaration.** The installed `@objectstack/spec` 17.5.0
`dist/ui` exports `ResponsiveStylesSchema` by name, and
`PageComponentSchema` declares `responsiveStyles:
ResponsiveStylesSchema.optional()`. The schema is a strict `{ large,
medium, small, xsmall }` with no default.
3. **Where to declare.** Measured before the edit, on both a
`page:section` node and an `object-metric` node:
- the strict face refused the key (`unrecognized_keys`);
- the tolerant face accepted it unjudged, including `responsiveStyles:
7` and `{ md: ... }`.
Each arm is a `BaseSchema.extend`, so one fragment spread into the
public-block arms closes it without touching `BaseSchema`. `BaseSchema`
is therefore not the only sound place, and this batch does not raise a
`needs_decision`.
4. **The renderer honours it.** A scratch probe mounted a `page:section`
with `responsiveStyles` through the real `SchemaRenderer` and registry,
then was deleted without being committed:
- the section carried the scope class `os-s-probe-10872`;
- the injected style held the `large` base plus `@media (max-width:
640px)` and `@media (max-width: 479px)` overrides;
- the child in `properties.children` still rendered inside the section.
Controls: without the key, no scope class and no style tag. A `{ md: ...
}` map (which the tolerant face used to pass) produced no style tag at
all.
5. **Census.** See the two forced rows above. The `IMPORTED` row is
forced by the census unconditionally, not only when the schema carries
defaults.
## Verification (every run through `os-verify-lock.sh`, slot
`issue-10872`)
- **Red first.** The pin was run on the unmodified source (base
`ae0b9d3905`): `Tests 40 failed | 150 passed (190)`. The 40 failures
were the two declaration rows, the two bag-node rows, 30 strict per-arm
rows and 6 invalid-value rows. The 150 controls were green.
- **Ablation** at `73d9479eef`, with the implementation committed first,
through objectstack's `scripts/ablation-replace.mjs` in WRAP mode, with
a trap-armed restore:
- the mutation replaced the anchor `export const PUBLIC_BLOCK_ENVELOPE =
{` with an empty fragment. The tool reported `ok mutation landed: anchor
1 to 0, blob de912a0 to 5fdcec5bb9ee`;
- the pin went to `Tests 40 failed | 150 passed (190)`, exactly the
red-first set;
- restore: `ok restored: blob == HEAD (de912a0) and git diff HEAD
is empty`.
The first attempt was a no-op. Its replacement text contained the
anchor, so the tool refused (anchor count 1 to 1) and ran nothing. It
was re-run with a corrected replacement. The pin imports
`../zod/index.zod.js` by relative source path, so there is no dist leg.
- **Reverse type check through the rebuilt dist.** A scratch consumer in
`packages/components`, resolved to
`packages/types/dist/zod/index.zod.d.ts`, got exactly one error, TS2353
(`'md' does not exist in type`), on the invalid line. With that line
removed, `tsc` exits 0. The scratch files were deleted.
- **Final head `361c5428ff`** (`main` merged in for objectui#8069, which
also edits `imported-defaults-8317.test.ts` in a different row; no
conflict). One hold, `VERDICT command-exit 0`:
- `pnpm install --frozen-lockfile` exit 0;
- `pnpm --filter @object-ui/types build` exit 0 (`dist completeness: 1
package(s) complete`);
- `pnpm --filter @object-ui/types type-check` exit 0. The new pin is
listed by `tsc -p tsconfig.test.json --listFilesOnly`;
- `pnpm exec vitest run packages/types/`: `Test Files 294 passed (294)`,
`Tests 7332 passed (7332)`;
- `pnpm exec vitest run packages/cli/`: `Test Files 23 passed (23)`,
`Tests 335 passed (335)`.
- **Arm-list consumer sweep** (the ruling's order lesson), 53 files
outside `packages/types` and `packages/cli`. They came from `git grep
-lw` on
`AnyComponentSchema|StrictAnyComponentSchema|safeValidateSchema|ObjectQLPublicBlockComponentSchema|PUBLIC_BLOCKS|propsBag|nodeOracles|KNOWN_SCHEMA_TYPES`,
the four named files, and a widening to every `...BlockSchema` arm name,
`PublicBlockComponentSchema`, `SchemaNodeSchema`,
`StrictSchemaNodeSchema` and `deriveStrictAuthoringSchema`. Result at
`361c5428ff`: `Test Files 53 passed (53)`, `Tests 1033 passed (1033)`.
- The 24 `scripts/__tests__` files that read `.changeset/` (owed because
the diff adds a changeset) gave `Test Files 24 passed (24)` / `Tests 914
passed (914)` at `361c5428ff`, the same counts they gave at
`73d9479eef`.
- **Gates at `361c5428ff`, every one exit 0:**
- `check:handler-key-reads` (`OK 140 arm(s) ... every judged read is a
declared member of its arm`);
- `check:spec-symbols`;
- `check:new-line-citations` (`VERDICT new-cross-file-line-citations: 0
new citation(s)`);
- `check-changeset-presence.mjs` (`6 source file(s) of 1 released
package(s) changed, and this change declares 1 changeset(s)`);
- `changeset:check` (`No changeset declares a major bump`);
- `check:control-bytes`;
- `check:changeset-claims` (report-only; 33 pending changesets name a
touched file, and none claims anything about node-level
`responsiveStyles`);
- `check:pending-changeset-literals`;
- `markdown-test-inputs.mjs --audit`;
- governed guard: `NOT GOVERNED`.
- **eslint, a declared narrowing:** the five changed TS files, run with
`--no-inline-config --format json`, gave 5 files, 0 errors and 3
warnings, all pre-existing `no-explicit-any` on lines this diff does not
touch. `--print-config` shows no `parserOptions.project` or
`projectService`, so linting is not type-aware and no untouched file's
verdict can move. The repo-wide `pnpm lint` run belongs to CI.
## Acceptance notes
- **Showcase nodes outside the public-block arms stay refused.**
Objectstack's showcase writes `responsiveStyles` on 17 nodes whose types
are not public blocks, and its skill on 1 more (by type, the 18 are
`flex` 16, `object-chart` 1 and `object-grid` 1). The strict face still
refuses them, because `BaseSchema` is not widened; that would be a
different accept-set change. This bites only when PR objectui#11069
moves `objectui validate` onto the strict face. That sequencing belongs
to its un-park census, and batch 7 already pointed it on objectui#5250.
This PR files nothing for it.
- The five other envelope keys stay undeclared: they have no producer.
`record:line_items` and the flat-props refusal half are not touched. The
files of draft PR objectui#11069 (`packages/cli/**` and the ratchet
test) are not touched.
---
_Generated by [Claude
Code](https://claude.ai/code/session_0122Knsowci76D2rBWReCzzZ)_
Co-authored-by: Claude <noreply@anthropic.com>responsiveStyles on every public-block arm, by reference to the spec (objectui#10872, batch 8) (#11260)1 parent 02a2295 commit 54a7830
7 files changed
Lines changed: 377 additions & 3 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 | + | |
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| 116 | + | |
| 117 | + | |
116 | 118 | | |
117 | 119 | | |
118 | 120 | | |
| |||
297 | 299 | | |
298 | 300 | | |
299 | 301 | | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
300 | 309 | | |
301 | 310 | | |
302 | 311 | | |
| |||
Lines changed: 257 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4333 | 4333 | | |
4334 | 4334 | | |
4335 | 4335 | | |
| 4336 | + | |
| 4337 | + | |
| 4338 | + | |
| 4339 | + | |
| 4340 | + | |
| 4341 | + | |
| 4342 | + | |
| 4343 | + | |
4336 | 4344 | | |
4337 | 4345 | | |
4338 | 4346 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
240 | 240 | | |
241 | 241 | | |
242 | 242 | | |
| 243 | + | |
243 | 244 | | |
244 | 245 | | |
245 | 246 | | |
| |||
0 commit comments