Skip to content

Commit 4feeadb

Browse files
Elon Muskclaude
andauthored
feat(devx): mechanise the sdui-parser lockstep against a vendored record of objectui's side (#13362)
Two copies of the constrained-JSX parser exist: objectui's runs in the renderer, this one runs in the save gate, and #12719 states that they must byte-agree on the accepted grammar and on diagnostic codes. That invariant was enforced by nothing through three manual ports. `check:sdui-lockstep` recomputes this copy's grammar-region blob id and its diagnostic-code set and compares both against a vendored record of objectui's side taken at a named revision. No network, no build and no objectui checkout at check time; `pnpm gen:sdui-lockstep` re-records objectui's side only, so it cannot launder a divergence here. The code extractor resolves a SCREAMING_SNAKE constant at a code position and refuses on one it cannot resolve: the same code is a quoted literal here and a constant reference on objectui's side, so a literal-only scan reports a false 24-vs-23 difference on day one. Claude-Session: https://claude.ai/code/session_01CPrUz21stTFhJRUirdc4yw Co-authored-by: Claude <noreply@anthropic.com>
1 parent 0079e25 commit 4feeadb

4 files changed

Lines changed: 851 additions & 0 deletions

File tree

.github/workflows/lint.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,27 @@ jobs:
532532
- name: Widget `options` census derived from the spec, not pinned
533533
run: pnpm check:widget-option-census
534534

535+
# The sdui-parser LOCKSTEP invariant (#12719 / #13150). Two copies of the
536+
# constrained-JSX parser exist: objectui's runs in the RENDERER, this one
537+
# runs in the SAVE GATE, and #12719 states that they must byte-agree on
538+
# the accepted grammar and on the diagnostic codes — an invariant that had
539+
# been enforced by NOTHING through three manual ports, two of which landed
540+
# only because someone happened to file a card naming the drift.
541+
#
542+
# Compared against a VENDORED RECORD of objectui's side, so this step
543+
# needs no network, no build and no objectui checkout. Read the gate's
544+
# header for what that buys and what it costs: it sees this copy moving
545+
# away from the recorded objectui state; it does NOT see objectui moving
546+
# afterwards, and only a `.objectui-sha` bump — the moment a divergence
547+
# starts SHIPPING — brings that direction back into view.
548+
#
549+
# Unfiltered on purpose. The record lives under packages/sdui-parser/, the
550+
# pin is a root dotfile, and this workflow declares no paths: filtering it
551+
# to the parser subtree would go dormant on exactly the PR that moves the
552+
# pin. Cost is one TypeScript parse of seven small files, ~0.4 s.
553+
- name: sdui-parser stays in lockstep with objectui's copy
554+
run: pnpm check:sdui-lockstep
555+
535556
# pm-dispatch SKILL.md line ratchet (#7341 / #5925 item 7): the PM skill
536557
# is read in full by every seat session and every Routine fire, so its
537558
# size is a per-round tax on the whole fleet. The #7341 extraction moved

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"os": "node packages/cli/bin/run.js",
2626
"objectui:build": "bash scripts/build-console.sh",
2727
"sdui:manifest": "bash scripts/gen-sdui-manifest.sh",
28+
"gen:sdui-lockstep": "node scripts/check-sdui-lockstep.mjs --update",
2829
"objectui:bump": "bash scripts/bump-objectui.sh",
2930
"objectui:refresh": "bash scripts/bump-objectui.sh && bash scripts/build-console.sh",
3031
"objectui:clean": "rm -rf packages/console/dist .cache/objectui-*",
@@ -40,6 +41,7 @@
4041
"check:bash32-floor": "node scripts/check-bash32-floor.mjs --self-test && node scripts/check-bash32-floor.mjs",
4142
"check:stack-collection-maps": "node scripts/check-stack-collection-maps.mjs --self-test && node scripts/check-stack-collection-maps.mjs",
4243
"check:widget-option-census": "node scripts/check-widget-option-census.mjs --self-test && node scripts/check-widget-option-census.mjs",
44+
"check:sdui-lockstep": "node scripts/check-sdui-lockstep.mjs --self-test && node scripts/check-sdui-lockstep.mjs",
4345
"check:doc-authoring": "node scripts/check-doc-authoring.mjs --self-test && node scripts/check-doc-authoring.mjs",
4446
"check:doc-anchors": "node scripts/check-doc-anchors.mjs --self-test && node scripts/check-doc-anchors.mjs",
4547
"check:docs-single-h1": "node scripts/check-docs-single-h1.mjs --self-test && node scripts/check-docs-single-h1.mjs",
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{
2+
"$comment": [
3+
"GENERATED by `pnpm gen:sdui-lockstep`. Do not hand-edit.",
4+
"objectui's side of the sdui-parser lockstep (#12719), recorded at one objectui revision.",
5+
"ONE SIDE ONLY: this file holds no diff and blesses no divergence — see scripts/check-sdui-lockstep.mjs."
6+
],
7+
"objectui": {
8+
"repo": "objectstack-ai/objectui",
9+
"rev": "45a9aeb57c1374171a5c95ec8aa02adfd731e915",
10+
"revDate": "2026-08-30T06:17:22+00:00",
11+
"source": "packages/sdui-parser/src",
12+
"files": [
13+
"packages/sdui-parser/src/codegen.ts",
14+
"packages/sdui-parser/src/dashboard-widget-options.ts",
15+
"packages/sdui-parser/src/index.ts",
16+
"packages/sdui-parser/src/input-type.ts",
17+
"packages/sdui-parser/src/parse.ts",
18+
"packages/sdui-parser/src/provenance.ts",
19+
"packages/sdui-parser/src/types.ts",
20+
"packages/sdui-parser/src/validate.ts"
21+
]
22+
},
23+
"recordedAgainstPin": "9602dc820450dda956843c6cfe5b329bcf88c757",
24+
"grammarRegion": {
25+
"file": "packages/sdui-parser/src/parse.ts",
26+
"delimiter": "/* ---------------------- the JS literal subset (#6614) ---------------------- */",
27+
"lines": 214,
28+
"blob": "0131f27cf86dbabec09b4ae55ae131403667e7e9"
29+
},
30+
"diagnosticCodes": [
31+
"bad-attr",
32+
"bad-attr-value",
33+
"bad-self-close",
34+
"bad-tag",
35+
"expected-element",
36+
"expression-child",
37+
"forbidden-attr",
38+
"forbidden-tag",
39+
"inert-expression",
40+
"invalid-enum",
41+
"mismatched-tag",
42+
"missing-required-prop",
43+
"multiple-roots",
44+
"no-root",
45+
"not-a-container",
46+
"type-mismatch",
47+
"unclosed-comment",
48+
"unclosed-element",
49+
"unconsumed-widget-option",
50+
"unknown-component",
51+
"unknown-prop",
52+
"unterminated-brace",
53+
"unterminated-open-tag",
54+
"unterminated-string"
55+
]
56+
}

0 commit comments

Comments
 (0)