Skip to content

feat: builderSource, and withAllRelations covers later layers (0.31.0) - #11

Merged
agreenspan merged 2 commits into
mainfrom
feat/builder-source
Oct 8, 2026
Merged

agreenspan merged 2 commits into
mainfrom
feat/builder-source

Conversation

@agreenspan

Copy link
Copy Markdown
Contributor

Aron (2026-10-08): "get rid of those duplicate helpers for sure."

Two of the three duplicated lens jobs get their home here (the third, clamps into the first layer, is json-rules#37 clampLens).

1. A builder source read off a lens, path by path → builderSource(lens, { sourceValues }) (type LensBuilderSource, assignable to RuleBuilderSource).
Copies: Zealot @zealot/db builderSource (#2715), and the surfaceNode walk inside template's emailSurface (plus Kingdom/Tribe ports) — the same function, line for line. Moved verbatim: model-keyed surface + one layer whose root spells per path the shown picks, enumPicks and relations; no clamp, no bridge. Zealot's test carried over (per-path gate, no where), plus the spelled shape and sourceValues riding the surface.

2. Turning relations on → withAllRelations, extended. Copies: Zealot relationTree and Omni everyRelation (anchor one hop + the config's spelled tree). What they genuinely add over withAllRelations is coverage of paths a later layer spells past the model-default tree (e.g. Omni's brandMission.missionType behind its redaction layer) — that otherwise throws not_visible. withAllRelations now turns on each later layer's root.relations hop by hop in the first layer's root (turn-ons only; picks/omits/clamps stay in the later layer). The one-hop-at-anchor restriction is not carried over: Omni reads only the anchor visit's fields (lensFields) and the where-carrying paths (tenantView), so the full posture changes nothing it emits — and it is the posture Zealot's platform-alert recordLens already uses. Tests: a later layer's org.parent is refused without it and turned on (only that, no picks) with it; a first-layer node keeps what it says.

Folded into unreleased 0.31.0; CHANGELOG names the consumers. Consumers switch after the train.

🤖 Generated with Claude Code

agreenspan and others added 2 commits October 8, 2026 15:50
builderSource(lens, { sourceValues }) reads a lens path by path into the
serializable source a builder authors against (Zealot's builderSource and
template's emailSurface surfaceNode walk). withAllRelations now turns on, in
the first layer, every path a later layer spells (Zealot's relationTree and
Omni's everyRelation). Folded into the unreleased 0.31.0.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@agreenspan
agreenspan merged commit 9cc91b2 into main Oct 8, 2026
1 check passed
@agreenspan
agreenspan deleted the feat/builder-source branch October 8, 2026 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant