Repository navigation
feat(lens): clampLens — clamps into a lens's first layer (3.5.1) - #37
Merged
Merged
Conversation
The lens-layer op template, Kingdom, Tribe and Zealot each kept a copy of (intoFirstLayer): AND a root where, and per-map model-default and source wheres, into the first narrowing over the base lens, where clamps read the whole schema; later layers kept. Source entries normalize through the engine's own normalizeSource. Folded into the unreleased 3.5.1. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Aron (2026-10-08): "get rid of those duplicate helpers for sure."
intoFirstLayerlived as a copy in template (@template/db/lens), its Kingdom and Tribe ports, and Zealot (@zealot/db, PR #2715). Its job is a lens-layer op: put clamps where they may read the whole schema — the first narrowing over the base lens (LENS.md: only layer 1's clamps read any relation; a later layer's only what its parent shows). It now lives here asclampLens(lens, clamps)(verb clamp, added to docs/VERBS.md;test/verbs.test.tsrequires every export there).LensClamps = { root?: { where }, mapDefaults?: { [map]: { models: { [model]: { where?, sources? } } } } }— the copies'FirstLayerClamps, unchanged.sourcesentry is told apart from a bareConditionby the engine's ownnormalizeSource(the copies used their own key test), so the merge reads an entry exactly as the engine does;{}now throws the engine'sinvalid_sourceearly.Consumers switch after the train publishes 3.5.1.
🤖 Generated with Claude Code