Skip to content
This repository was archived by the owner on Nov 4, 2026. It is now read-only.

fix(metadata-admin): the page-block and hook condition editors lint in the scope their runtime binds (objectui#8167) - #9643

Merged
os-justin merged 5 commits into
mainfrom
claude/issue-8167-conditionbuilder-per-surface-scope
Sep 17, 2026
Merged

os-justin merged 5 commits into
mainfrom
claude/issue-8167-conditionbuilder-per-surface-scope

Conversation

@os-justin

@os-justin os-justin commented Sep 16, 2026 •

Copy link
Copy Markdown
Collaborator

Part of #8167

⚠️ Deliberately Part of, not Fixes. Only ONE of the ruling's three arms ships here. A closing keyword would shut the card over the two that do not.

Revised after contract review — 5706686234 returned VERDICT: FAIL on the page-block arm, and it was right. That arm has been withdrawn; the body below describes what the branch now contains. The history of the reversal is in the commits, not hidden by this edit.


What ships: the hook arm

@objectstack/objectql's wrapDeclarativeHook compiles a hook condition once and evaluates it as

const r = ExpressionEngine.evaluate<boolean>(expr, { record: record ?? {}, previous });

record and previous, and nothing else; the next lines throw HookConditionError rather than resolving false ("Fail LOUD. Not false", objectstack#4775). The editor linted flattened, so a bare status == 'done' came back clean — and on this surface the consequence is worse than a dead gate: the author's write pays for the editor's success receipt. The mount now passes scope="record".

previous needed no work, and that is a measurement. The ruling wrote 「previous added to the lint scope's known roots」 as though it were a line of work. It is already there:

scope 'record' · "previous.status != record.status"  ->  errors: [], warnings: []
introspectScope('predicate', { scope: 'record' }).roots
  -> ["record","previous","input","os","current_user","user","vars"]

A new case pins the transition idiom so a later narrowing cannot take it away in silence.

⛔ What was withdrawn: the page-block arm, and why it cannot be fixed at the mount

The renderer reading was correct as far as it went — SchemaRenderer binds the row as the record root, so a bare status == 'done' never matches on a page block. What it missed is in the very expression it quoted: the same evaluator construction also binds page: pageVariables.

At scope: 'record' the validator runs a strict environment declaring exactly the engine's SCOPE_ROOTS, and page is not in it. Measured on the installed @objectstack/formula, all four corners:

scope source verdict
flattened status == 'done' clean — the defect the card is about
flattened page.selectedProjectId != '' clean
record status == 'done' error naming record.status — right
record page.selectedProjectId != '' error: "bare reference page … Write record.page."

That last row is @objectstack/spec's own worked example: page.zod.ts describes visibleWhen as "Contract-bound roots: record, current_user … and page state as page.<var>" and ends with e.g. "page.selectedProjectId != ''". And because this inspector reports blocking CEL issues upward, where the host counts them, that error disables Save and auto-save while the block is selected.

⇒ neither lint scope fits this mount. flattened accepts the bare-field defect; record refuses a contract-bound root with a nonsense remedy. This is the objectui#8155 shape (app refused although bound). The mount goes back to passing nothing — flattened being the less-wrong of two wrong answers, an editor that over-accepts rather than one that refuses what the spec documents.

The reading is kept, corrected. The comment at the mount now names all three bound roots and says in as many words that neither scope expresses that set, so the next reader does not re-derive the measurement and reach the same wrong conclusion.

Blocked on the engine, not on this PR. Making that mount lintable needs either page among @objectstack/formula's scope roots — its own docblock says the list errs toward declaring more, and that a missing root is a false positive — or a per-surface root allowlist on validateExpression. That is an objectstack spec-seat change carrying its own clause-② review. ⛔ Not opened from here; carried back to the card for the seat.

⛔ Still not shipped: the ConditionWidget arm

Unchanged from the first round and upheld by the review. ConditionWidget has zero mount sites — it is resolved from a registry by field-name convention behind WidgetRenderer = (props: WidgetProps) => React.ReactElement, so satisfies Record<string, WidgetRenderer> makes a widget-specific required prop a compile error at the registry. FormFieldSpec.scope would be born declared-and-unenforced (zero in-tree form specs declare a condition field); WidgetContext.conditionScope hard-codes one scope inside the generic ResourceEditPage unless derived per metadata type; a required prop on the published SchemaForm is a break across ~70 call sites. The choice is the director's — costed in the report on the card. widgets.tsx is untouched.

The fence, verified

mount scope status
hook condition record changed here
page block visibleWhen flattened unchanged — withdrawn, blocked on the engine
widgets.tsx (ConditionWidget) flattened unchanged — arm open
PermissionAdvancedFacets (RLS) flattened unchanged — CORRECT (#5738 stand-down 3)
FlowNodeConfigField (flow node) flattened unchanged — flow tier is not a row surface
ConditionBuilder's own default undefined → hint.scope ?? 'flattened' identical; the prop stays optional

No component API changes. Production wiring in this branch is exactly one line.

Verification — re-run on d519436

Every heavy run through scripts/pm/os-verify-lock.sh (OS_VERIFY_LOCK_SLOT=objectui-8167-dev); verdicts read from the lock's own VERDICT command-exit line, exit codes redirected to a file and read back, never through a pipe.

Pins — ConditionBuilder.mountScope.test.tsx, real @objectstack/formula, no stub: Test Files 1 passed (1) / Tests 11 passed (11), exit 0.

Ablation, two legs, both directions predicted before running. trap … EXIT INT TERM with REPO_ROOT-absolute restore; HEAD blob hashes resolved non-empty first (2b4b1183…, 7c26cca5…).

LEG A — remove the HOOK wiring (predict RED, 1 case)
  on-disk proof: scope="record" HK 1 -> 0 · git diff --stat: 1 file changed, 1 deletion
  Tests  1 failed | 10 passed (11)
  × rejects the bare shorthand in a hook condition and names the record.FIELD fix
  failure mode is the DEFECT: AssertionError: expected null to be 'true' (aria-invalid null)
  restore: git diff HEAD EMPTY · count back to 1

LEG B — ADD scope="record" to the PAGE BLOCK (predict RED, the page.VAR pin)
  on-disk proof: scope="record" PB 0 -> 1 · git diff --stat: 1 file changed, 1 insertion
  Tests  1 failed | 10 passed (11)
  × accepts the spec's own `page.VAR` example — which the `record` scope would refuse
  failure message is the review's refusal, rendered in the designer:
    "bare reference `page` … Write `record.page`."
  restore: git diff HEAD EMPTY · count back to 0

Leg B is the point of the replacement pin: the withdrawal is now falsifiable, not asserted. Anyone who "settles" that mount with 'record' gets a red test carrying the nonsense remedy, instead of a designer with a disabled Save button.

Affected tests — the 32 files naming PageBlockInspector, HookDefaultInspector or ConditionBuilder (git grep -lw): Test Files 32 passed (32) / Tests 347 passed (347), exit 0.

Type-check — pnpm --filter @object-ui/app-shell type-check, exit 0, zero error TS lines; the script echoed tsc --noEmit && tsc -p tsconfig.test.json. Prerequisite built first: turbo run build --filter='@object-ui/app-shell^...' --concurrency=2 → 28 successful, 28 total.

Lint — NARROWING DECLARED, three pieces of evidence: ① pnpm lint is turbo run lint across every package; what ran is app-shell's own complete CI unit, the only package this diff touches. ② 1168 files, 0 errors, 3026 warnings — counts read from --format json. ③ Invariance: eslint.config.js configures no projectService and no project:, so no type-aware linting exists and a change inside app-shell cannot move another package's verdict.

Derived gates (hand-derived from package.json + .github/workflows/; objectui has no scripts/pm/dispatch-gates.mjs) — all exit 0: check:control-bytes (scanned 7762 tracked text file(s)), check:new-line-citations (0 new citation(s)), check:test-path-roots, check:vi-mock-specifiers, check:vi-mock-inherit, check:vi-mock-override-shape, check:changeset-claims, check:unreferenced-sources, check:i18n-keys, check:i18n-drift, check:governed-queue-guard, changeset:check, check-changeset-presence.mjs (3 source file(s) of 1 released package(s) changed, and this change declares 1 changeset(s)), check-governed-queue-guard.mjs --test over all four paths → NOT GOVERNED. Out-of-band control-byte scan of the diff → no hits.

Changeset re-scoped to the hook arm. The withdrawn sentence the review flagged ("Nothing already saved changes meaning") is gone as a blanket claim; the text now describes one mount, and states that the page-block mount is unchanged and why.

NOT MEASURED: remote CI on this head — reported at local-verification close; no waiting, no polling.

Carriers: both were stripped by the seat after the FAIL. ⛔ Not re-hung from here — a fresh clause-② review is the seat's to commission on this head.


🤖 Generated with Claude Code

https://claude.ai/code/session_012EpHzwH4wTy5sd7ibkD2yq


Generated by Claude Code

…visibleWhen` (objectui#8167)

The objectui#8167 ruling settled the RULE — a mount's lint scope is decided by
what the evaluator binds at runtime — and deliberately did not settle this
mount, because the director did not read the objectui renderer side. It asked
for the reading to be the first commit, with the mount following it.

This is that reading, and it FALSIFIES the "node tier, therefore flattened"
default the ruling carried as a placeholder:

  * a page block is a SDUI node — `previews/PageBlockCanvas.tsx` hands each one
    to `SchemaRenderer`, and the page preview uses the same runtime renderer;
  * `visibleWhen` is enforced once, generically, inside `SchemaRenderer`, whose
    `shouldHide` short-circuits on it ahead of every other visibility leg;
  * the evaluator it is answered by binds the row as the `record` ROOT ONLY —
    the file says so in as many words ("NOT as bare fields"), and
    `SchemaRenderer.visibleWhenRecordBinding.test.tsx` already pins it: a bare
    `status == 'in_review'` renders the block on BOTH polarities of the row.

So the node tier IS a row surface here. No behaviour changes in this commit —
only the measurement the next one acts on.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012EpHzwH4wTy5sd7ibkD2yq
…following the renderer (objectui#8167)

The mount follows the reading in the previous commit. `SchemaRenderer` binds the
row as the `record` root only, so a bare `status == 'done'` typed into a page
block's visibility gate resolves against nothing — and because that surface is
fail-soft, it resolves to SHOWN on every row, forever, with no signal. The
editor was handing out a success receipt for a predicate the renderer never
matches.

The value is written EXPLICITLY at the mount, which the ruling asked for either
way it came out. It came out `record`, which falsifies the "node tier, therefore
flattened" default the ruling carried as a placeholder.

Pins are a pair, not a prop-arrival probe: the bare shorthand is REJECTED with
the `record.<field>` fix named, and the canonical spelling is still ACCEPTED.
Both run against the real `@objectstack/formula`.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012EpHzwH4wTy5sd7ibkD2yq
…what the server binds (objectui#8167)

`@objectstack/objectql`'s `wrapDeclarativeHook` compiles the condition once and
evaluates it as `ExpressionEngine.evaluate<boolean>(expr, { record: record ?? {},
previous })` — `record` and `previous`, and nothing else. This editor linted
`flattened`, so a bare `status == 'done'` came back clean and then met a scope
with no top-level `status`.

On this surface the consequence is worse than a gate that never fires: an
unevaluable condition does not resolve false, it throws `HookConditionError`,
deliberately (the objectstack#4775 fail-LOUD ruling). The author's write pays for
the editor's success receipt.

`previous` needed no change, and that was measured rather than assumed: at
`scope: 'record'` the installed engine draws no finding for a `previous.*`
reference and already advertises `previous` among its roots. A case now pins
that, so a later narrowing of the root list cannot take the transition idiom
away in silence.

The hook mount's old CONTROL case is re-homed, not weakened. It asserted "no
claim is made here"; a claim is made now, and the same mount appears as a
rejecting case instead. The one mount still passing nothing is the
schema-driven `ConditionWidget`, whose arm is unshipped — see the PR body.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012EpHzwH4wTy5sd7ibkD2yq
…objectui#8167)

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012EpHzwH4wTy5sd7ibkD2yq
@github-actions

Copy link
Copy Markdown
Contributor

✅ Console Performance Budget

Metric Value Budget
Eager closure (gzip, 329 chunks) 3064.7 KB 3104.5 KB
Main entry chunk (gzip) 145.7 KB 350 KB
Entry file index-BUx3mraT.js —
Status PASS —

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

Package Size Gzipped
app-shell (consoleActionDispatch.js) 0.20KB 0.19KB
app-shell (index.js) 16.69KB 6.21KB
app-shell (runtime-config.js) 20.68KB 7.36KB
app-shell (types.js) 0.01KB 0.04KB
app-shell (urlParams.js) 10.06KB 3.86KB
auth (ActiveOrganizationStorage.js) 25.05KB 9.16KB
auth (AuthContext.js) 0.31KB 0.24KB
auth (AuthGuard.js) 2.07KB 1.00KB
auth (AuthProvider.js) 40.18KB 10.59KB
auth (AuthShell.js) 3.49KB 1.40KB
auth (ForgotPasswordForm.js) 12.21KB 3.45KB
auth (LoginForm.js) 18.15KB 5.39KB
auth (PreviewBanner.js) 0.90KB 0.50KB
auth (RegisterForm.js) 6.65KB 2.22KB
auth (SocialSignInButtons.js) 9.61KB 3.89KB
auth (UserMenu.js) 3.41KB 1.23KB
auth (auth-gate-events.js) 1.29KB 0.66KB
auth (authStyles.js) 5.04KB 1.72KB
auth (createAuthClient.js) 40.21KB 10.80KB
auth (createAuthenticatedFetch.js) 8.46KB 3.43KB
auth (index.js) 3.19KB 1.44KB
auth (invitation-status.js) 1.22KB 0.70KB
auth (org-roles.js) 6.66KB 2.78KB
auth (phone-identifier.js) 1.11KB 0.66KB
auth (types.js) 0.59KB 0.35KB
auth (useAuth.js) 5.30KB 1.02KB
auth (useWorkspaceAdminStatus.js) 11.08KB 4.58KB
collaboration (CommentThread.js) 26.08KB 7.56KB
collaboration (LiveCursors.js) 3.17KB 1.27KB
collaboration (PresenceAvatars.js) 6.49KB 2.64KB
collaboration (PresenceProvider.js) 2.79KB 1.13KB
collaboration (index.js) 1.68KB 0.73KB
collaboration (useCollaborationTranslation.js) 6.05KB 2.52KB
collaboration (useCommentSearch.js) 1.98KB 0.88KB
collaboration (useConflictResolution.js) 7.75KB 1.86KB
collaboration (useMentionNotifications.js) 1.81KB 0.68KB
collaboration (usePresence.js) 6.33KB 1.84KB
collaboration (useRealtimeSubscription.js) 7.91KB 2.01KB
components (index.js) 544.93KB 130.50KB
core (index.js) 8.94KB 3.59KB
create-plugin (index.js) 27.94KB 9.51KB
data-objectstack (index.js) 215.98KB 59.97KB
fields (index.js) 249.35KB 62.93KB
i18n (LocalizationContext.js) 1.76KB 0.96KB
i18n (builtinAggregateLabels.js) 0.86KB 0.49KB
i18n (currency.js) 1.22KB 0.64KB
i18n (fallbackInterpolation.js) 6.25KB 2.77KB
i18n (i18n.js) 8.87KB 3.64KB
i18n (index.js) 5.22KB 2.26KB
i18n (pickLocalized.js) 9.86KB 3.95KB
i18n (provider.js) 32.15KB 10.49KB
i18n (useDisplayLocale.js) 2.85KB 1.45KB
i18n (useObjectLabel.js) 34.34KB 9.17KB
i18n (useSafeTranslation.js) 5.60KB 2.33KB
layout (index.js) 38.83KB 10.95KB
mobile (MobileProvider.js) 0.92KB 0.49KB
mobile (ResponsiveContainer.js) 0.94KB 0.38KB
mobile (breakpoints.js) 1.51KB 0.70KB
mobile (createOfflineDataSource.js) 5.61KB 1.75KB
mobile (index.js) 1.99KB 0.87KB
mobile (offlineQueue.js) 3.91KB 1.35KB
mobile (pwa.js) 0.97KB 0.49KB
mobile (serviceWorker.js) 1.48KB 0.62KB
mobile (serviceWorkerSource.js) 3.41KB 1.48KB
mobile (useBreakpoint.js) 1.54KB 0.65KB
mobile (useGesture.js) 6.96KB 1.98KB
mobile (useOfflineSync.js) 1.99KB 0.72KB
mobile (usePullToRefresh.js) 2.53KB 0.85KB
mobile (useResponsive.js) 0.72KB 0.42KB
mobile (useSpecGesture.js) 4.39KB 1.66KB
mobile (useTouchTarget.js) 1.01KB 0.54KB
permissions (MePermissionsProvider.js) 13.52KB 4.88KB
permissions (PermissionContext.js) 0.31KB 0.25KB
permissions (PermissionGuard.js) 0.89KB 0.45KB
permissions (PermissionProvider.js) 6.24KB 2.16KB
permissions (discardProofCache.js) 1.04KB 0.55KB
permissions (evaluator.js) 8.39KB 3.10KB
permissions (index.js) 0.93KB 0.41KB
permissions (store.js) 0.91KB 0.42KB
permissions (useFieldPermissions.js) 1.28KB 0.53KB
permissions (usePermissions.js) 4.83KB 2.27KB
plugin-ai (index.js) 14.81KB 3.63KB
plugin-calendar (index.js) 49.99KB 14.24KB
plugin-charts (index.js) 71.33KB 19.90KB
plugin-chatbot (index.js) 195.34KB 46.51KB
plugin-dashboard (index.js) 131.44KB 34.65KB
plugin-designer (index.js) 215.94KB 44.33KB
plugin-detail (index.js) 252.65KB 65.65KB
plugin-editor (index.js) 2.23KB 1.05KB
plugin-form (index.js) 136.71KB 34.16KB
plugin-gantt (index.js) 167.62KB 41.26KB
plugin-grid (index.js) 212.64KB 57.91KB
plugin-kanban (index.js) 46.63KB 14.53KB
plugin-list (index.js) 112.67KB 27.68KB
plugin-map (index.js) 21.48KB 6.99KB
plugin-markdown (index.js) 13.88KB 4.80KB
plugin-report (index.js) 43.41KB 11.93KB
plugin-timeline (index.js) 30.07KB 8.74KB
plugin-tree (index.js) 10.58KB 3.72KB
plugin-view (index.js) 84.98KB 20.99KB
providers (DataSourceProvider.js) 0.75KB 0.39KB
providers (MetadataProvider.js) 1.37KB 0.59KB
providers (ThemeProvider.js) 1.90KB 0.85KB
providers (UploadProvider.js) 11.66KB 3.50KB
providers (index.js) 0.45KB 0.23KB
providers (types.js) 0.01KB 0.04KB
react-runtime (index.js) 5.62KB 2.34KB
react (LazyPluginLoader.js) 4.47KB 1.63KB
react (SchemaRenderer.js) 104.82KB 34.67KB
react (data-invalidation.js) 5.05KB 2.08KB
react (index.js) 4.63KB 2.18KB
react (schema-input.js) 4.25KB 2.04KB
react (spec-input.js) 0.20KB 0.18KB
sdui-parser (codegen.js) 6.58KB 2.74KB
sdui-parser (dashboard-widget-options.js) 3.08KB 1.30KB
sdui-parser (index.js) 5.66KB 2.50KB
sdui-parser (input-type.js) 2.84KB 1.40KB
sdui-parser (kanban-quick-add.js) 3.89KB 1.87KB
sdui-parser (parse.js) 25.28KB 7.80KB
sdui-parser (provenance.js) 3.66KB 1.82KB
sdui-parser (types.js) 0.28KB 0.23KB
sdui-parser (validate.js) 14.82KB 4.99KB
types (ai.js) 4.11KB 2.06KB
types (api-types.js) 0.20KB 0.18KB
types (app.js) 2.87KB 1.00KB
types (base.js) 0.20KB 0.18KB
types (blocks.js) 0.20KB 0.18KB
types (complex.js) 2.93KB 1.49KB
types (crud.js) 0.20KB 0.18KB
types (dashboard-filter-alias.js) 6.23KB 2.74KB
types (data-display.js) 3.75KB 1.85KB
types (data-protocol.js) 0.20KB 0.19KB
types (data.js) 0.20KB 0.18KB
types (designer.js) 1.85KB 0.85KB
types (disclosure.js) 0.20KB 0.18KB
types (error-code.js) 1.54KB 0.88KB
types (expression.js) 0.20KB 0.18KB
types (feedback.js) 0.20KB 0.18KB
types (field-types.js) 0.20KB 0.18KB
types (form.js) 0.20KB 0.18KB
types (http-inflight.js) 8.87KB 3.73KB
types (http-retry.js) 4.32KB 2.02KB
types (icon-key-migration.js) 4.26KB 1.63KB
types (index.js) 4.74KB 2.25KB
types (layout.js) 0.20KB 0.18KB
types (managed-by.js) 0.19KB 0.18KB
types (mobile.js) 4.73KB 2.28KB
types (navigation.js) 0.20KB 0.18KB
types (objectql.js) 0.20KB 0.18KB
types (overlay.js) 0.20KB 0.18KB
types (permissions.js) 0.20KB 0.18KB
types (plugin-scope.js) 0.20KB 0.18KB
types (record-components.js) 0.20KB 0.19KB
types (record-semantics.js) 1.28KB 0.67KB
types (registry.js) 0.20KB 0.18KB
types (reports.js) 0.20KB 0.18KB
types (select-option.js) 0.20KB 0.19KB
types (spec-report.js) 5.05KB 1.93KB
types (spec-ui-namespace.js) 0.20KB 0.19KB
types (strict-authoring-face.js) 14.04KB 5.36KB
types (system-fields.js) 3.33KB 1.54KB
types (theme.js) 6.28KB 2.87KB
types (ui-action.js) 8.11KB 3.32KB
types (views.js) 0.20KB 0.18KB
types (widget.js) 0.20KB 0.18KB

Size Limits

  • ✅ Core packages should be < 50KB gzipped
  • ✅ Component packages should be < 100KB gzipped
  • ⚠️ Plugin packages should be < 150KB gzipped

Copy link
Copy Markdown
Collaborator Author

Contract review

Served-tier: 98/98 CONTRACT_REVIEW_TIER
Head-sha: a119aabed8768eb0f9751611ddcd5fbed84967ad

Provenance, measured rather than passed: the tier reading is the harness-written "model": stamps in this reviewer's own transcript (98 of 98 read the constant's value, none read anything else); get_session in mode:subagent describes the dispatching session (claude-opus-5) and is not this reviewer's reading, per references/contract-review.md. The constant was read at source in scripts/pm/dispatch-gates.mjs. NOT MEASURED at runtime: no node_modules and no dist of @objectstack/formula exists on this box, so every engine verdict below is derived from the engine's SOURCE (packages/formula/src/validate.ts and packages/formula/src/cel-engine.ts at objectstack 9c1897e52c), and the PR's own runtime readings were checked against that source rather than re-run. Diff reviewed from the REST diff endpoint and from the branch fetched as FETCH_HEAD in a read-only objectui tree (no worktree, no edits).

① Derived judgments

Diff at head: 4 files, +225/-14. Production wiring is exactly two added props, scope="record" on the ConditionBuilder mount in HookDefaultInspector.tsx and in PageBlockInspector.tsx; the rest is comments, one test file and one changeset. No new export (packages/app-shell/src/index.ts is untouched; neither inspector nor ConditionBuilder is published), no new prop, no new schema key, no new registration. node scripts/pm/check-widening-tells.mjs --declaration no --diff on this diff: 0 tells, all 4 files NOT MEASURED (no declared surface covers app-shell inspectors), so that exit 0 is evidence about nothing and the reading below is by hand. Nothing this PR adds becomes authorable. Every accept-set change it implies is a NARROWING of an editor's lint; judged one by one:

  1. Hook condition editor: a bare field reference (status == 'done') goes from clean to an error naming record.status. RIGHT. Verified in objectstack packages/objectql/src/hook-wrappers.ts: ExpressionEngine.evaluate(expr, { record: record ?? {}, previous }), and an unevaluable condition throws (fix(plugin-form): a no-sections drawer form honours field-level conditional rules (#4755) #4775). The server binds record and previous; the editor now lints in a scope that declares both.
  2. Hook condition editor: previous.FIELD stays accepted. RIGHT, and the ruling's "previous added to the known roots" clause is correctly discharged with zero lines: previous is in SCOPE_ROOTS (cel-engine.ts) and in introspectScope's root list (validate.ts). Pinned by the new transition case.
  3. Hook condition editor still ACCEPTS roots the server does not bind (input, os, vars, current_user, user, and the rest of SCOPE_ROOTS). Pre-existing over-acceptance of the record scope, the same under flattened, not introduced here; the dev filed it as out of scope. Not a refusal ground; the successor card is owed.
  4. Page-block visibleWhen editor: a bare field reference goes from clean to an error naming record.status. RIGHT in isolation: packages/react/src/SchemaRenderer.tsx binds the row as the record root only, and SchemaRenderer.visibleWhenRecordBinding.test.tsx pins that a bare reference renders the block on both polarities. The ruling's "node tier, therefore flattened" default is falsified, as the PR says, and the reading-first commit order was honoured.
  5. Page-block visibleWhen editor: current_user.FIELD stays accepted. RIGHT (current_user is in SCOPE_ROOTS).
  6. Page-block visibleWhen editor: page.VAR goes from clean to a HARD ERROR prescribing record.page. WRONG, and this is the refusal. Derived at source: ExprSchemaHint.scope is 'record' | 'flattened' with no root extension; at record, validate.ts calls firstUndeclaredReference, whose strict env (buildScopedEnv, unlistedVariablesAreDyn: false) declares exactly SCOPE_ROOTS, and page is not in that list; cel-js faults Unknown variable: page and the validator turns it into the bare-reference error "Write record.page". page.VAR is not a stray spelling: packages/spec/src/ui/page.zod.ts describes visibleWhen as "Contract-bound roots: record, current_user, and page state as page.VAR" and its own example is page.selectedProjectId != ''; SchemaRenderer.tsx binds page: pageVariables in the very evaluator this PR cites; and @objectstack/formula's own index records that the view/page visibility surface "binds current_user / page on top of SCOPE_ROOTS". Under the previous flattened scope the same expression linted clean (a page draft without an object carries no field catalog, so nothing fires; with one, a did-you-mean warning at most). Consequence in the designer: PageBlockInspector reports the error through onBlockingIssuesChange, ResourceEditPage counts it as inspectorBlocking, and Save and auto-save are disabled while that block is selected. So the ruling's own rule, a mount lints in what its evaluator binds at runtime, is broken by this arm in the opposite direction: the evaluator binds page, the editor refuses it. Neither available scope satisfies this mount today: flattened accepts the bare-field defect, record refuses a contract-bound root. That is an engine-vocabulary gap of the same class as card The record-scope CEL lint refuses the app root, which app-shell's predicate scope DOES bind — @objectstack/formula's SCOPE_ROOTS has no app #8155 (app refused although bound), and it has to be surfaced, not shipped through with a changeset that says nothing about it.
  7. ConditionBuilder's own default, the RLS facets, the flow-node mount and widgets.tsx are byte-for-byte unchanged (verified on the diff and against main). RIGHT.
  8. The re-homed control (the hook mount moves from a "lints clean" control to a rejecting case) is a re-homing, not a weakened pin: the hook tier is settled by the ruling and the default-itself control remains. RIGHT.

② Semver level

.changeset/8167-per-surface-condition-scope.md: @object-ui/app-shell: minor. The LEVEL is correct and consistent with this repo's policy: objectui forbids major (AGENTS.md, scripts/check-changeset-no-major.mjs; the Changeset Bump Policy check is green on this head), a behaviour break ships as minor with the break spelled out, and scripts/check-changeset-presence.mjs requires a changeset here because released app-shell source changed (Changeset Declaration is green; app-shell is in the fixed group). The TEXT is what fails together with ① item 6: it states "Nothing already saved changes meaning, this moves where you find out" and names only bare field references as the newly rejected spelling, while on the page-block mount a contract-bound page.VAR predicate also flips from accepted to rejected. Whatever shape the fix takes, the changeset must describe only what actually narrows.

③ Boundary flags

Dev report 5701370574 on the card, each flag answered:

  • Part of rather than Fixes: RIGHT. The ConditionWidget arm is undecided; a closing keyword would close the card over it.
  • In-source citations by content rather than cross-file path:line: RIGHT per AGENTS.md [WIP] Update documentation for project #11; Line Citation Gate is green.
  • Affected-test narrowing (32 files locally, not the whole package): ACCEPTED. On a119aab all four remote Test shards, Type Check and Lint are green (36 check runs: 33 success, 3 skipped, none red), so the whole package did run.
  • The re-homed control: RIGHT, see ① item 8.
  • widgets.tsx untouched: RIGHT, see the next flag.
  • open_questions[0], which channel should carry ConditionWidget's host-supplied scope (A FormFieldSpec.scope; B WidgetContext.conditionScope required; C a required prop on the published SchemaForm; D narrow the route): ESCALATED to the director seat, explicitly. The departure from the ruling's letter is right. Verified on main: ConditionWidget has zero JSX mount sites; SchemaForm.tsx routes a field to it by name convention (CONDITION_FIELD_NAMES or a When suffix) and widgets.tsx registers it under 'condition' in a map typed as a record of WidgetRenderer, a function of WidgetProps, so a required widget-specific prop is a compile error at the registry and there is no host mount to supply it. A would be a declared-and-unenforced key born on a published spec type and is itself a clause-② yes change; C is a published break on SchemaForm; B hard-codes one scope in the generic ResourceEditPage unless derived per metadata type, which is a tier ruling per type; D closes the arm without inventing a channel. None is one line. This reviewer's reading: B with a per-type derivation, or D, and not A; the choice is the director's, and this PR is right not to have made it.
  • Out-of-scope finding 1 (hook autocomplete advertises unbound roots): AGREED, file it; it is the accept-side twin of ① item 3.
  • Out-of-scope finding 2 (the page-block mount does not pass slot="visibleWhen"): AGREED that the field-rule slot is the wrong verdict source, but the deeper collision is ① item 6: the record scope itself refuses page, so this mount needs a node-tier root vocabulary the validator does not have, not a slot.

The seat's review comment 5701420303 accepted both shipped arms. The hook arm stands. The page-block arm does not, for the reason in ① item 6, which that review did not measure.

What has to change for a pass, concretely: drop the scope="record" wiring from PageBlockInspector.tsx in this PR (keep the renderer reading as a comment if wanted, but state that the evaluator binds record, current_user AND page.VAR, and that neither lint scope expresses that set); remove the two page-block test cases, or replace them with one pin documenting why the mount still passes nothing (the spec's own page.selectedProjectId != '' must lint clean there); re-scope the changeset to the hook arm; and carry the page-block arm back to the card as blocked on the engine: @objectstack/formula needs either page in SCOPE_ROOTS (its own docblock says the list errs toward declaring more, and that a missing root is a false positive that would break the build) or a per-surface root allowlist on validateExpression, which is an objectstack spec-seat change with its own clause-② review. The hook arm alone is a coherent, contract-consistent slice and would pass as-is.

Implemented-by: claude/issue-8167-conditionbuilder-per-surface-scope
Reviewed-by: session_012EpHzwH4wTy5sd7ibkD2yq

VERDICT: FAIL


Generated by Claude Code

… refuses a contract-bound root (objectui#8167)

Contract review returned FAIL on the page-block arm, and it is right. The
renderer reading was correct as far as it went — `SchemaRenderer` binds the row
as the `record` root — but the SAME evaluator construction also binds
`page: pageVariables`, which the reading quoted and did not act on.

At `scope: 'record'` the validator runs a strict environment declaring exactly
the engine's `SCOPE_ROOTS`, and `page` is not in it. Measured on the installed
`@objectstack/formula`:

    scope 'record' · "page.selectedProjectId != ''"
      -> error: "bare reference `page` … Write `record.page`."

That is `@objectstack/spec`'s OWN worked example for this key — `page.zod.ts`
documents the contract-bound roots as `record`, `current_user` and page state as
`page.<var>`. So the narrowing turned a predicate the spec prescribes into a
hard error with a nonsense remedy, and because this inspector reports blocking
issues upward it would have disabled Save and auto-save while the block was
selected. The objectui#8155 shape exactly (`app` refused although bound).

So neither lint scope fits that mount: `flattened` accepts the bare-field defect
the card is about, `record` refuses a contract-bound root. The mount goes back
to passing nothing, `flattened` being the less-wrong of two wrong answers — an
editor that over-accepts rather than one that refuses what the spec documents.

⭐ The reading is KEPT, corrected to name all three bound roots and to say that
neither scope expresses that set, so the next reader does not re-derive it and
reach the same wrong conclusion. The two page-block pins are replaced by one
that asserts the spec's own `page.selectedProjectId != ''` still lints CLEAN
there — it reddens the moment anyone "settles" the mount with `'record'`.

The changeset is re-scoped to the hook arm, which is what still narrows.

The hook arm is unchanged and stands.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012EpHzwH4wTy5sd7ibkD2yq
@github-actions

Copy link
Copy Markdown
Contributor

✅ Console Performance Budget

Metric Value Budget
Eager closure (gzip, 329 chunks) 3064.9 KB 3104.5 KB
Main entry chunk (gzip) 145.7 KB 350 KB
Entry file index-ChsUkSkV.js —
Status PASS —

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

Package Size Gzipped
app-shell (consoleActionDispatch.js) 0.20KB 0.19KB
app-shell (index.js) 16.69KB 6.21KB
app-shell (runtime-config.js) 20.68KB 7.36KB
app-shell (types.js) 0.01KB 0.04KB
app-shell (urlParams.js) 10.06KB 3.86KB
auth (ActiveOrganizationStorage.js) 25.05KB 9.16KB
auth (AuthContext.js) 0.31KB 0.24KB
auth (AuthGuard.js) 2.07KB 1.00KB
auth (AuthProvider.js) 40.18KB 10.59KB
auth (AuthShell.js) 3.49KB 1.40KB
auth (ForgotPasswordForm.js) 12.21KB 3.45KB
auth (LoginForm.js) 18.15KB 5.39KB
auth (PreviewBanner.js) 0.90KB 0.50KB
auth (RegisterForm.js) 6.65KB 2.22KB
auth (SocialSignInButtons.js) 9.61KB 3.89KB
auth (UserMenu.js) 3.41KB 1.23KB
auth (auth-gate-events.js) 1.29KB 0.66KB
auth (authStyles.js) 5.04KB 1.72KB
auth (createAuthClient.js) 40.21KB 10.80KB
auth (createAuthenticatedFetch.js) 8.46KB 3.43KB
auth (index.js) 3.19KB 1.44KB
auth (invitation-status.js) 1.22KB 0.70KB
auth (org-roles.js) 6.66KB 2.78KB
auth (phone-identifier.js) 1.11KB 0.66KB
auth (types.js) 0.59KB 0.35KB
auth (useAuth.js) 5.30KB 1.02KB
auth (useWorkspaceAdminStatus.js) 11.08KB 4.58KB
collaboration (CommentThread.js) 26.08KB 7.56KB
collaboration (LiveCursors.js) 3.17KB 1.27KB
collaboration (PresenceAvatars.js) 6.49KB 2.64KB
collaboration (PresenceProvider.js) 2.79KB 1.13KB
collaboration (index.js) 1.68KB 0.73KB
collaboration (useCollaborationTranslation.js) 6.05KB 2.52KB
collaboration (useCommentSearch.js) 1.98KB 0.88KB
collaboration (useConflictResolution.js) 7.75KB 1.86KB
collaboration (useMentionNotifications.js) 1.81KB 0.68KB
collaboration (usePresence.js) 6.33KB 1.84KB
collaboration (useRealtimeSubscription.js) 7.91KB 2.01KB
components (index.js) 544.93KB 130.50KB
core (index.js) 8.94KB 3.59KB
create-plugin (index.js) 27.94KB 9.51KB
data-objectstack (index.js) 215.98KB 59.97KB
fields (index.js) 249.27KB 62.92KB
i18n (LocalizationContext.js) 1.76KB 0.96KB
i18n (builtinAggregateLabels.js) 0.86KB 0.49KB
i18n (currency.js) 1.22KB 0.64KB
i18n (fallbackInterpolation.js) 6.25KB 2.77KB
i18n (i18n.js) 8.87KB 3.64KB
i18n (index.js) 5.22KB 2.26KB
i18n (pickLocalized.js) 9.86KB 3.95KB
i18n (provider.js) 32.15KB 10.49KB
i18n (useDisplayLocale.js) 2.85KB 1.45KB
i18n (useObjectLabel.js) 34.34KB 9.17KB
i18n (useSafeTranslation.js) 5.60KB 2.33KB
layout (index.js) 38.83KB 10.95KB
mobile (MobileProvider.js) 0.92KB 0.49KB
mobile (ResponsiveContainer.js) 0.94KB 0.38KB
mobile (breakpoints.js) 1.51KB 0.70KB
mobile (createOfflineDataSource.js) 5.61KB 1.75KB
mobile (index.js) 1.99KB 0.87KB
mobile (offlineQueue.js) 3.91KB 1.35KB
mobile (pwa.js) 0.97KB 0.49KB
mobile (serviceWorker.js) 1.48KB 0.62KB
mobile (serviceWorkerSource.js) 3.41KB 1.48KB
mobile (useBreakpoint.js) 1.54KB 0.65KB
mobile (useGesture.js) 6.96KB 1.98KB
mobile (useOfflineSync.js) 1.99KB 0.72KB
mobile (usePullToRefresh.js) 2.53KB 0.85KB
mobile (useResponsive.js) 0.72KB 0.42KB
mobile (useSpecGesture.js) 4.39KB 1.66KB
mobile (useTouchTarget.js) 1.01KB 0.54KB
permissions (MePermissionsProvider.js) 13.52KB 4.88KB
permissions (PermissionContext.js) 0.31KB 0.25KB
permissions (PermissionGuard.js) 0.89KB 0.45KB
permissions (PermissionProvider.js) 6.24KB 2.16KB
permissions (discardProofCache.js) 1.04KB 0.55KB
permissions (evaluator.js) 8.39KB 3.10KB
permissions (index.js) 0.93KB 0.41KB
permissions (store.js) 0.91KB 0.42KB
permissions (useFieldPermissions.js) 1.28KB 0.53KB
permissions (usePermissions.js) 4.83KB 2.27KB
plugin-ai (index.js) 14.81KB 3.63KB
plugin-calendar (index.js) 49.99KB 14.24KB
plugin-charts (index.js) 71.33KB 19.90KB
plugin-chatbot (index.js) 195.34KB 46.51KB
plugin-dashboard (index.js) 131.44KB 34.65KB
plugin-designer (index.js) 215.94KB 44.33KB
plugin-detail (index.js) 253.29KB 65.88KB
plugin-editor (index.js) 2.23KB 1.05KB
plugin-form (index.js) 136.71KB 34.16KB
plugin-gantt (index.js) 167.62KB 41.26KB
plugin-grid (index.js) 212.64KB 57.91KB
plugin-kanban (index.js) 46.41KB 14.49KB
plugin-list (index.js) 112.67KB 27.68KB
plugin-map (index.js) 21.48KB 6.99KB
plugin-markdown (index.js) 13.88KB 4.80KB
plugin-report (index.js) 43.41KB 11.93KB
plugin-timeline (index.js) 30.07KB 8.74KB
plugin-tree (index.js) 10.58KB 3.72KB
plugin-view (index.js) 84.98KB 20.99KB
providers (DataSourceProvider.js) 0.75KB 0.39KB
providers (MetadataProvider.js) 1.37KB 0.59KB
providers (ThemeProvider.js) 1.90KB 0.85KB
providers (UploadProvider.js) 11.66KB 3.50KB
providers (index.js) 0.45KB 0.23KB
providers (types.js) 0.01KB 0.04KB
react-runtime (index.js) 5.62KB 2.34KB
react (LazyPluginLoader.js) 4.47KB 1.63KB
react (SchemaRenderer.js) 104.82KB 34.67KB
react (data-invalidation.js) 5.05KB 2.08KB
react (index.js) 4.63KB 2.18KB
react (schema-input.js) 4.25KB 2.04KB
react (spec-input.js) 0.20KB 0.18KB
sdui-parser (codegen.js) 6.58KB 2.74KB
sdui-parser (dashboard-widget-options.js) 3.08KB 1.30KB
sdui-parser (index.js) 5.66KB 2.50KB
sdui-parser (input-type.js) 2.84KB 1.40KB
sdui-parser (kanban-quick-add.js) 3.89KB 1.87KB
sdui-parser (parse.js) 25.28KB 7.80KB
sdui-parser (provenance.js) 3.66KB 1.82KB
sdui-parser (types.js) 0.28KB 0.23KB
sdui-parser (validate.js) 14.82KB 4.99KB
types (ai.js) 4.11KB 2.06KB
types (api-types.js) 0.20KB 0.18KB
types (app.js) 2.87KB 1.00KB
types (base.js) 0.20KB 0.18KB
types (blocks.js) 0.20KB 0.18KB
types (complex.js) 2.93KB 1.49KB
types (crud.js) 0.20KB 0.18KB
types (dashboard-filter-alias.js) 6.23KB 2.74KB
types (data-display.js) 3.75KB 1.85KB
types (data-protocol.js) 0.20KB 0.19KB
types (data.js) 0.20KB 0.18KB
types (designer.js) 1.85KB 0.85KB
types (disclosure.js) 0.20KB 0.18KB
types (error-code.js) 1.54KB 0.88KB
types (expression.js) 0.20KB 0.18KB
types (feedback.js) 0.20KB 0.18KB
types (field-types.js) 0.20KB 0.18KB
types (form.js) 0.20KB 0.18KB
types (http-inflight.js) 8.87KB 3.73KB
types (http-retry.js) 4.32KB 2.02KB
types (icon-key-migration.js) 4.26KB 1.63KB
types (index.js) 4.74KB 2.25KB
types (layout.js) 0.20KB 0.18KB
types (managed-by.js) 0.19KB 0.18KB
types (mobile.js) 4.73KB 2.28KB
types (navigation.js) 0.20KB 0.18KB
types (objectql.js) 0.20KB 0.18KB
types (overlay.js) 0.20KB 0.18KB
types (permissions.js) 0.20KB 0.18KB
types (plugin-scope.js) 0.20KB 0.18KB
types (record-components.js) 0.20KB 0.19KB
types (record-semantics.js) 1.28KB 0.67KB
types (registry.js) 0.20KB 0.18KB
types (reports.js) 0.20KB 0.18KB
types (select-option.js) 0.20KB 0.19KB
types (spec-report.js) 5.05KB 1.93KB
types (spec-ui-namespace.js) 0.20KB 0.19KB
types (strict-authoring-face.js) 14.04KB 5.36KB
types (system-fields.js) 3.33KB 1.54KB
types (theme.js) 6.28KB 2.87KB
types (ui-action.js) 8.11KB 3.32KB
types (views.js) 0.20KB 0.18KB
types (widget.js) 0.20KB 0.18KB

Size Limits

  • ✅ Core packages should be < 50KB gzipped
  • ✅ Component packages should be < 100KB gzipped
  • ⚠️ Plugin packages should be < 150KB gzipped

Copy link
Copy Markdown
Collaborator Author

Contract review

Served-tier: 95/95 CONTRACT_REVIEW_TIER
Head-sha: d51943671b8a7b17b05a398aecbaa48255339b04

Provenance and method. The tier reading is the harness-written "model": stamps in this reviewer's own transcript: 95 of 95 read the constant's value and none read anything else; get_session in mode:subagent describes the dispatching session and was not used, per references/contract-review.md. The constant was read at source in scripts/pm/dispatch-gates.mjs. This is a second review judged on this head alone: the earlier record 5706686234 on a119aab was read as a claim and audited, not inherited. ENGINE RUN, not read: @objectstack/formula 17.4.0 is installed on this box (the version objectui's lockfile pins), and every engine verdict below was produced by calling validateExpression, introspectScope and ExpressionEngine.evaluate directly; the engine's source in the objectstack tree was read alongside for the mechanism. Diff from the REST diff endpoint; the three changed sources fetched at this head; both trees read-only, no worktree. NOT MEASURED: the vitest suite itself (no objectui install at this head on this box), so the pins are judged from their code plus the engine run. Remote CI on this head at post time: 36 check runs, 33 success, 3 skipped, 0 red, none in progress.

① Derived judgments

Diff at head: 4 files, +256/−14. Production wiring is exactly ONE added JSX attribute, scope="record" on the ConditionBuilder mount in HookDefaultInspector.tsx — verified by listing every added attribute line in the diff; the only other attribute additions are the new test harness. PageBlockInspector.tsx is +53/−0, comment only; its mount's props are byte-identical to main. No new export (the only added imports are in the test file; packages/app-shell/src/index.ts is untouched; neither inspector nor ConditionBuilder is published). No new prop, schema key, enum member or registration. PM_SWEEP_REPO=objectstack-ai/objectui node scripts/pm/check-widening-tells.mjs --declaration no --diff on this diff: 0 tells, all 4 files NOT MEASURED (no declared surface covers app-shell inspectors), so that exit 0 is evidence about nothing and the reading below is by hand. Nothing this PR adds becomes authorable. Each accept-set change it implies, judged:

  1. Hook condition editor: a bare field reference goes from clean to a blocking error naming record.FIELD. NARROWING, RIGHT. Measured on the installed engine: scope flattened + status == 'done' → ok, no findings (the defect); scope record + the same → error "bare reference status … Write record.status". Basis verified at source in packages/objectql/src/hook-wrappers.ts: ExpressionEngine.evaluate(expr, { record: record ?? {}, previous }), and on a non-ok result it throws HookConditionError (fix(plugin-form): a no-sections drawer form honours field-level conditional rules (#4755) #4775). The throw is real for this input: ExpressionEngine.evaluate of status == 'done' against { record: { status: 'done' } } returns ok:false, "Unknown variable: status" — so the editor's old success receipt really was paid for by the author's rejected write, as the changeset says. No second evaluator of a hook condition exists in objectstack (grep across packages/*/src).
  2. Hook editor: record.FIELD and previous.FIELD stay accepted. Measured: record.status == 'done' and previous.status != 'done' && record.status == 'done' are both clean at record, and introspectScope('predicate', { scope: 'record' }).roots is record, previous, input, os, current_user, user, vars. The ruling's "add previous" clause is correctly discharged with zero lines and the new transition case pins it. Also measured: record.status == 'done' was already clean at flattened, so the changeset's "that spelling was accepted before this change and still is" holds.
  3. Hook editor: any root outside the engine's SCOPE_ROOTS (a typo such as recrod.status) now errors where flattened without a catalog let it through. Narrowing, right: nothing outside record and previous resolves in that evaluator.
  4. Hook editor still ACCEPTS input.*, os.*, vars.*, current_user.*, user.* and the rest of SCOPE_ROOTS, which the server does not bind, and its autocomplete still advertises them. Pre-existing over-acceptance, identical under flattened, NOT introduced or widened here; the dev filed it out of scope and it is owed a successor card (③).
  5. Hook editor autocomplete: at record scope CelPredicateField drops bare field names from the bare-position candidates. A narrowing of suggestions, consistent with item 1.
  6. Page-block visibleWhen editor: accept set UNCHANGED. The mount passes nothing, so celAuthoring's hint.scope ?? 'flattened' answers as on main. Both halves of the mount comment's four-corner table were re-measured: at flattened, status == 'done' → clean (the defect the card is about, still live here) and page.selectedProjectId != '' → clean; at record, page.selectedProjectId != '' → error "bare reference page … Write record.page", while current_user.id != '' → clean, so it is page specifically. Also measured, beyond the comment: at flattened WITH a field catalog, page.selectedProjectId != '' draws a non-blocking did-you-mean warning, never an error, so on an object-bound page the status quo does not block Save either. The withdrawal this round guards is real, and the reversal of the earlier head's regression is complete.
  7. ConditionBuilder's default and prop, the RLS facets, the flow-node mount and widgets.tsx: byte-for-byte unchanged (diff, and on main scope?: 'record' | 'flattened' is optional and forwarded verbatim, undefined included).
  8. The replacement page-block pin witnesses something. expectAccepted requires the positive "Valid CEL" text, which CelPredicateField renders only when linted && issues.length === 0, so the case cannot pass with the lint never having run or with any warning present; and its red leg is real: with scope="record" the engine returns the record.page error, which the same component renders as aria-invalid plus a message, failing the case. The dev's ablation leg B reports exactly that; this reviewer reproduced the engine half, not the vitest run. Scope of the witness, stated so nobody over-reads it: the harness page has no object, so it covers the no-catalog case; with a catalog the status quo yields a warning, not a block (item 6).
  9. The re-homed hook control (from a "lints clean" control to a rejecting case) is a re-homing, not a weakened pin: the default-itself control remains and the hook tier is settled by the ruling.
  10. Coherence standing alone, with two arms unshipped: the hook arm is a complete, independently revertible slice exactly as the ruling budgeted ("three one-line changes, independently revertible"); its accept set is now what its runtime binds, with both directions pinned. The page-block mount's accept set is exactly main's, with the measured reason at the mount and on the card; the ConditionWidget mount is untouched. No mount is left half-moved, so nothing here is a half-applied contract change. Part of rather than a closing keyword is right, and more so now.
  11. Comment-only file audit, since this card is about false receipts. Every checkable statement in the two new comments and the test docblock was checked against the trees: the SchemaRenderer evaluator literal (...predicateScope, current_user, conditional record: boundRecord, page: pageVariables) — true; PageBlockCanvas.tsx renders one SchemaRenderer per block — true; visibleWhen is the first leg of shouldHide — true; page.zod.ts describes visibleWhen's contract-bound roots as record, current_user and page state as page.VAR, with page.selectedProjectId != '' as its example — true, verbatim; SCOPE_ROOTS has no page — true, measured; blocking issues flow reportCel → onBlockingIssuesChange → inspectorBlocking, disabling Save and auto-save — true (ResourceEditPage). Two imprecisions, neither touching the accept set: (a) the test docblock heading "Two mounts still pass nothing" — three ConditionBuilder mounts pass no scope on this tree: the page block, ConditionWidget, and FlowNodeConfigField, which is ruled CORRECT and sits outside the ruling's table; the paragraph is readable as "of the ruling's mounts", but the count as written is wrong. (b) the attribution "blocked on an engine-vocabulary change, not on this package" (mount comment and changeset) is over-stated — see ③, the new open question. Both are owed a one-line correction on the card or in the landing round; neither is a refusal ground under clause ②.

② Semver level

.changeset/8167-per-surface-condition-scope.md: @object-ui/app-shell: minor. major is forbidden in this repo and not used (Changeset Bump Policy green on this head); the changeset is required and present (Changeset Declaration green; released app-shell source changed). The text now describes only what ships: one mount, the runtime basis, the author-visible effect, the unchanged page-block mount and why, and "no component API changes" — each verified above. The blanket "nothing already saved changes meaning" the first review flagged is gone; its replacement, "a hook condition already saved keeps the meaning it always had — this moves where you find out", is true: runtime evaluation is untouched, and a saved bare-reference condition already threw on every write. Level: ACCEPTABLE. It is the conservative choice — an author-visible strictness increase spelled out as a behaviour change is what this repo's rule maps to minor — and it is inconsistent with the first slice of this same card (.changeset/8167-conditionbuilder-mount-scope.md on main declared patch for the same class of narrowing at three other mounts). Over-declaring never under-warns; not a blocker.

③ Boundary flags

Newest dev report 5706799894 on the card, each flag and each open question answered:

  • PR body PATCHed in place after the FAIL: judged as it stands against the diff as it stands. Its fence table, the "exactly one line" claim, the four-corner table, the previous measurement and the eleven-case pin count (9 plain it( plus 2 templated) all match the diff and the engine run; the reversal is stated at the top rather than hidden. RIGHT.
  • Part of retained: RIGHT.
  • Affected-test narrowing (32 files locally, not the whole package): ACCEPTED — on this head all four Test shards, Type Check and Lint completed green, so the whole package did run remotely.
  • Ablation leg B on non-shipped code: RIGHT to include; it is the falsifier for the replacement pin, and its engine half is reproduced here.
  • A departure the report does not list: the ruling said the page-block outcome is "written explicitly at the mount" either way, and the mount now passes nothing. Judged: an explicit scope="flattened" would assert something false about a surface whose evaluator binds record; passing nothing with the measured reason at the mount is the honest state, and the accept set is identical either way. ESCALATED to the director seat to ratify as the third outcome the ruling did not anticipate; not a refusal ground.
  • open_questions[0], the ConditionWidget channel (A FormFieldSpec.scope / B WidgetContext.conditionScope required / C a required prop on SchemaForm / D narrow the route): ESCALATED to the director seat, explicitly; the PR is right not to have chosen. Verified on main: zero JSX mount sites; SchemaForm routes by name (CONDITION_FIELD_NAMES or a When suffix) into a registry typed as a Record of WidgetRenderer; SchemaForm and the FormFieldSpec type are published from the app-shell barrel, WidgetContext and WidgetProps are not. So A is itself a clause-② yes (an authorable key on a published type, born unenforced), C is a published break, B is internal wiring whose per-type derivation is a tier ruling per metadata type, D closes the arm without inventing a channel. This reviewer's independent lean: B with a per-type derivation, or D; not A.
  • open_questions[1], NEW — "the engine has no scope expressing a page block's bound root set": premise VERIFIED for validateExpression's scope. Measured: ExprSchemaHint is objectName / fields / fieldTypes / scope / roleCatalog with scope two-valued; a roots or slot key in the hint changes nothing (same error); at record the validator calls firstUndeclaredReference(source) with no extra names against a strict environment of exactly SCOPE_ROOTS, which has no page. BUT the options list is incomplete, and it matters for where the work goes: the engine already PUBLISHES the per-surface oracle — firstUndeclaredReference(source, knownNames) takes an allowlist — and @objectstack/lint's own view/page visibility gate lints exactly this surface with it (VIEW_PAGE_EXTRA_ROOTS = ['current_user', 'page'] in validate-visibility-predicates.ts, passed straight into that call), while packages/formula/src/index.ts says in its own words that the oracle is exported for "a lint rule whose surface declares a DIFFERENT root set … current_user / page on top of SCOPE_ROOTS". So an option (iv) exists: objectui's celAuthoring takes the lint package's route for the page-block surface, inside this package — which changes what the editor accepts and is therefore a clause-② yes change of its own. ⇒ the arm is blocked on a DECISION of home — extend ExprSchemaHint in the engine (ii) or consume the published oracle in celAuthoring (iv) — not solely on the engine, and the words "not on this package" in the changeset and the mount comment over-state it. ESCALATED to the spec seat and the director together with (i)–(iii); this reviewer's lean: (ii) or (iv), and against (i), which would add page to every record-scoped surface including the hook and validation-rule editors where page is unbound — a clause-② widening at the spec seat, refused for the same reason A is refused above. Owed on the card: add (iv) and correct the attribution; if the seat wants the CHANGELOG sentence softened, it is one clause in the landing round.
  • Out-of-scope finding 1 (hook autocomplete advertises unbound roots): AGREED, file it; it is the accept-side twin of ① item 4, and (ii) or (iv) above would close both.
  • Out-of-scope finding 2 (slot="visibleWhen" deliberately not passed): AGREED, correct omission; folded into the question above.
  • Line-address drift: AGREED not to file.
  • Earlier record 5706686234: its refusal is answered in full on this head — wiring dropped, reading kept and corrected to three roots, two cases replaced by one clean-pin, changeset re-scoped, blocker carried to the card. Its accept-set findings 1–5, 7 and 8 were re-derived here independently and hold; its finding 6 no longer describes this head.

Implemented-by: claude/issue-8167-conditionbuilder-per-surface-scope
Reviewed-by: session_012EpHzwH4wTy5sd7ibkD2yq

VERDICT: PASS


Generated by Claude Code

Copy link
Copy Markdown
Collaborator Author

Provenance — clause-② carriers cleared on a PASS at tier

domain:ui execution seat, session_012EpHzwH4wTy5sd7ibkD2yq.

record of record comment 5706939666 on this PR
judged head d51943671b8a7b17b05a398aecbaa48255339b04 — the head as it stands
Served-tier CONTRACT_REVIEW_TIER on a 95/95 stamp control
verdict PASS
--pair 9643 exit 0, re-run by the seat before clearing
carriers stripped from both the PR and card objectui#8167, in one stroke

⭐ The reviewer ran the engine rather than reading it — it located an installed @objectstack/formula@17.4.0 and called validateExpression / introspectScope / ExpressionEngine.evaluate directly, reproducing every corner the first round had derived from source. Round 1's FAIL (5706686234, head a119aab…) is superseded by this record on a different head; ⛔ it did not carry forward and ⛔ nothing in it pre-cleared this one.

Two non-blocking notes the review raised, carried rather than dropped

  1. ⚠️ A test docblock says 「Two mounts still pass nothing」 — three do; FlowNodeConfigField also passes no scope and is ruled CORRECT that way. A one-line prose fix, ⛔ not a gate failure and ⛔ not worth a round trip on its own.
  2. ⭐⭐ The dev's new open question states the page-block arm is 「blocked on an engine-vocabulary change, not on this package」. The review measures that as over-stated, and it matters: the engine already publishes firstUndeclaredReference(source, knownNames), and @objectstack/lint's view/page gate already lints this exact surface with VIEW_PAGE_EXTRA_ROOTS = ['current_user','page']. ⇒ there is a fourth option — objectui's own celAuthoring takes that route — which is itself a clause-② yes but needs no objectstack change at all. objectstack#18554 is being amended with it; ⛔ the option list there was incomplete and this seat wrote it.

Also recorded by the review: the first slice's changeset (.changeset/8167-conditionbuilder-mount-scope.md) shipped the same class as patch while this one is minor. ⛔ Not a blocker on this PR; noted for whoever reconciles the card's changesets.

domain:ui execution seat · session_012EpHzwH4wTy5sd7ibkD2yq · carrier clear + provenance · reading taken 2026-09-17T01:20Z


Generated by Claude Code

@os-justin
os-justin marked this pull request as ready for review September 17, 2026 01:20
@os-justin
os-justin added this pull request to the merge queue Sep 17, 2026
Merged via the queue into main with commit 16603b9 Sep 17, 2026
38 checks passed
@os-justin
os-justin deleted the claude/issue-8167-conditionbuilder-per-surface-scope branch September 17, 2026 01:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants