Skip to content

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

Closed
os-zhuang wants to merge 1 commit into
mainfrom
docs/adr-0072-reference-model
Closed

docs(adr): ADR-0072 — reference scope & resolvability (the data-picker model) (#1934)#1985
os-zhuang wants to merge 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).

Drafts the architecture decision behind the flow variable data-picker (#1973#1981) and the contract for extending it across the ~50 authored-expression surfaces. Written after a research sweep of the framework engine, prompted by the #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. Everything else (per-surface scope, drillable object outputs, the relational story, validation) follows from that invariant.

Why it needed an ADR (not another PR)

  • Cross-cuts engine semantics (framework service-automation), the designer (objectui), and the spec (FlowNode.outputSchema).
  • 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 (engine.ts:946-964), so a lookup dot-walk resolves to undefined. Without writing this down, the next contributor re-introduces the footgun (I nearly did).
  • Generalises the model beyond flow: research found each surface has a different scope and token shape (flow flattens the record → bare refs valid; formula/validation/RLS/sharing → record.x only). See the per-surface evidence table 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-typed 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 outputSchema with objectName (spec change) · D7 degrade gracefully.
  • Roadmap frames the 5 shipped PRs as Slice 0/1 and sequences Slices 2–5.

Review asks

  • D4 (no lookup dot-walk; guided fetch) — confirm the runtime stance.
  • D6 (outputSchema.objectName) — this is a @objectstack/spec change; needs framework coordination.
  • Placement: filed in objectui/docs/adr (picker code lives here); move to the framework repo if architects prefer the expression-layer ADRs stay co-located with 0032/0058.

Docs-only; no changeset (the changeset check validates the fixed-group config, not per-PR changesets).

🤖 Generated with Claude Code

…r model) (#1934)

Capture the model behind the flow data-picker (#1973#1981) and the contract for
extending it. 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 (engine.ts:946-964);
- validation reuses the engine's canonical CEL scope roots (cel-engine.ts:52-62).

Builds on ADR-0032 (unified expression layer) / ADR-0058 (expression & predicate
surface). Research evidence (engine record-seeding, per-surface eval scopes,
current `outputSchema` shape) 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.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
objectui Ignored Ignored Jun 24, 2026 4:43pm

Request Review

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Jun 24, 2026
@os-zhuang

Copy link
Copy Markdown
Contributor Author

Moving ADR-0072 to the framework repo, alongside the expression-layer ADRs 0032/0058 (the decision is grounded in framework engine + spec semantics). New PR: objectstack-ai/framework#2306

@os-zhuang os-zhuang closed this Jun 24, 2026
@os-zhuang
os-zhuang deleted the docs/adr-0072-reference-model branch June 24, 2026 16:48
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant