Skip to content

docs(adr): ADR-0072 — reference scope & resolvability (the data-picker model) (objectui#1934) - #2306

Merged
os-zhuang merged 1 commit into
mainfrom
docs/adr-0072-reference-model
Jun 24, 2026
Merged

os-zhuang merged 1 commit into
mainfrom
docs/adr-0072-reference-model

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

Status: Proposed — for architect review (do not auto-merge).

Filed here (with the expression-layer ADRs 0032 / 0058) because the decision is grounded in framework engine + spec semantics. The implementation surface — the flow variable data-picker — lives in objectui (#1973 → #1981, already shipped as Slice 0/1).

Written after a research sweep of this repo's engine, prompted by the objectui #1934 follow-up ask "expand record.account.name" — which the investigation showed would be a footgun.

The decision in one line

The picker + its inline validator surface only references that actually resolve at runtime. Per-surface scope, drillable object outputs, the relational story, and validation all follow from that invariant.

Why an ADR (not just an objectui PR)

  • Cross-cuts engine semantics (service-automation), the spec (FlowNode.outputSchema), and the designer (objectui).
  • Sets a long-lived, counter-intuitive invariant: record.account.name must NOT be offered — the engine injects the raw trigger record and never expands lookups (packages/services/service-automation/src/engine.ts:946-964), so a lookup dot-walk resolves to undefined. Without writing this down, the next contributor re-introduces the footgun.
  • Research found each expression surface has a different scope + token shape (flow flattens the record → bare refs valid; formula/validation/RLS/sharing → record.x only). Per-surface evidence table is in the ADR.

Key decisions

D1 resolvability invariant · D2 per-surface graph-aware scope + surface-specific token shape · D3 lazy one-level drilling of object outputs (from config.objectName) · D4 relationships = guided "add Get Records", never lookup dot-walk · D5 validator reuses the engine's canonical CEL roots (cel-engine.ts:52-62) · D6 evolve FlowNode.outputSchema with objectName (spec change in this repo) · D7 degrade gracefully.

Review asks

  • D4 — confirm the runtime stance (no lookup dot-walk; guided fetch).
  • D6 — outputSchema.objectName is a @objectstack/spec change owned here; needs sign-off + a populating change in the CRUD executors.

Docs-only; no changeset.

🤖 Generated with Claude Code

…r model) (objectui#1934)

Capture the model behind the flow data-picker (objectui #1973–#1981) and the
contract for extending it across the ~50 authored-expression surfaces. Filed in
the framework repo alongside the expression-layer ADRs (0032, 0058) because the
invariant is grounded in framework engine + spec semantics; the UI lives in
objectui.

Core invariant: the picker + its inline validator surface only references that
actually RESOLVE at runtime. From that:

- scope is per-surface + graph-aware, and the inserted token follows the surface
  (flow flattens the record so bare `status` is valid; elsewhere it is
  `record.status`; templates use `{var}`);
- object-typed references are drillable one level, lazily, from the producing
  node's object (`config.objectName` now, `outputSchema.objectName` long-term);
- relationships are a guided "add a Get Records step" fetch, NEVER a lookup
  dot-walk — `record.account.name` never resolves because the engine injects the
  raw record and does not expand lookups (service-automation engine.ts:946-964);
- validation reuses the engine's canonical CEL scope roots (formula
  cel-engine.ts:52-62).

Builds on ADR-0032 / ADR-0058. Per-surface evaluation-scope evidence cited
inline. Status: Proposed — for architect review (esp. D4 lookup stance, D6
outputSchema.objectName spec change).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 24, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Ready Ready Preview, Comment Jun 24, 2026 5:01pm

Request Review

@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation labels Jun 24, 2026
@os-zhuang
os-zhuang merged commit 7e223a8 into main Jun 24, 2026
15 checks passed
@os-zhuang
os-zhuang deleted the docs/adr-0072-reference-model branch June 24, 2026 17:02
os-zhuang added a commit that referenced this pull request Jul 6, 2026
feat(app-shell): embed the build-agent copilot in Studio's aiSlot (ADR-0080 slice-1) (#2306)

objectui@883ec287e63a820ea5c49069226747d429c9a9a5

This branch was successfully deployed

1 active deployment
Preview — f0e10e43 Deployed Jun 24, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant