Skip to content

feat(api): fan out scoped variables at snapshot publish - #96

Merged
mrtaikandi merged 7 commits into
mainfrom
bug-fixes
May 10, 2026
Merged

feat(api): fan out scoped variables at snapshot publish#96
mrtaikandi merged 7 commits into
mainfrom
bug-fixes

Conversation

@mrtaikandi

@mrtaikandi mrtaikandi commented May 10, 2026

Copy link
Copy Markdown
Owner

Summary

  • Config entries that reference a scoped variable via {{name}} now produce one resolved tuple per scope the variable touches in the published snapshot, instead of a single unscoped default. Authoring MyConfigEntry = "{{MyVariable}}" against a variable with per-environment values fans out automatically — no need to redeclare scope tuples on every entry.
  • Fan-out is the dim-space cartesian over the referenced variables' scope dimensions. Explicit literal scope tuples on the entry win over fan-out emissions for the same final tuple. Strict-unresolved policy continues to block publish via 422.
  • New modules: ResolvedEntryBuilder (per-entry orchestrator) and TargetTupleBuilder (dim-space helper). PlaceholderScanner is now the single source of truth for the {{...}} regex; the MatchCollection is reused between scan and substitute paths to avoid M extra regex passes per source value.
  • No external API or schema changes. Templates merge first, fan-out runs once on the merged set. Per-entry sensitivity preserved.

… renders

The scoped values field passed `value={undefined}` to Radix Select when the
field was empty, putting it in uncontrolled mode. The first selection
transitioned the prop from undefined to a string, and the
`<SelectValue>{stringValue}</SelectValue>` children-override path didn't
reflect the change, leaving the trigger blank until the next interaction.

Pass `?? ''` so the select stays controlled and let `SelectValue` render
the matching item's text natively.
… publish

config entries that reference a scoped variable via `{{name}}` now produce one
resolved tuple per scope the referenced variable touches in the published
snapshot, instead of a single unscoped default. fan-out is the dim-space
cartesian over the referenced variables' scope dimensions, with explicit
literal scope tuples on the entry winning over fan-out emissions for the same
final tuple. strict-unresolved policy still blocks publish via 422 when a
required target tuple has no resolution.

implementation lives behind two new modules: ResolvedEntryBuilder (per-entry
orchestrator) and TargetTupleBuilder (dim-space helper). placeholder regex is
deduplicated through PlaceholderScanner and the MatchCollection is reused
between scan and substitute paths to avoid M extra regex passes per source
value. templates merge first, fan-out runs once on the merged entry set.
per-entry sensitivity preserved.
variables.md, concepts.md, Domain-Model.md, and Technical-Architecture.md
described the publish pipeline as per-placeholder substitution against the
client's scopes. that model predates the fan-out behavior on the bug-fixes
branch, where a scopeless config entry referencing a scoped variable produces
one snapshot value per tuple the variable touches.

updated the variable resolution doc to lead with fan-out, document the
strict-unresolved policy, and reword the worked example to show the
materialized per-environment snapshot values. updated the snapshot resolution
process in the domain model to describe target generation, source-scope merge,
explicit-wins dedup, and per-entry sensitivity. nudged the technical
architecture pipeline diagram and the concepts overview to match.
the user-facing guide was leaning on internal jargon (fan-out, dim-space
cartesian, target tuples, emissions, dedup-by-most-specific-target) and was
linking out to internal C# classes from the user docs. swapped those for
plain-english descriptions with worked examples that show what users see in
the published snapshot, and dropped the implementation-detail links.

also replaced em-dashes in inline prose across the guide (kept conventional
em-dashes inside link labels and "what's next?" lists, since those are
typographic separators not prose interruptions). renamed two-tier-resolution
section anchor to two-tier-lookup with the matching cross-references updated.
@mrtaikandi
mrtaikandi merged commit 7fface7 into main May 10, 2026
3 checks passed
@mrtaikandi
mrtaikandi deleted the bug-fixes branch May 10, 2026 12:35
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