Repository navigation
feat: resolve env refs in PARAM lines and preset values - #285
Merged
Merged
Conversation
Planning artifacts for #283: PARAM and preset entry values resolve $FOO, ${FOO} and ${FOO:-bar} against the process environment at consumption time, keeping raw text through parse and export.
Values in PARAM spinloop lines and preset entries resolve $FOO,
${FOO} and ${FOO:-bar} against the process environment, with $$ for
a literal dollar. Expansion lives in a new internal/envref leaf and runs
where a consuming command builds its configuration — preset.Parse for
presets, selectionParams for PARAMs — so serve and deploy show resolved
values while Parse, show and export keep the raw text. A malformed
reference fails naming the preset line or PARAM key.
Closes #283
Describe the syntax on the Spinloop-file, serve and cloud docs pages, record the choke-point rationale in the maintainer notes, pin the literal-default behaviour with tests, and align the local-serving delta with where each command's environment actually comes from.
Sync the three delta requirements into the main specs and move the completed change to the archive.
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.
Values in
PARAMspinloop lines and preset.inientries resolve$FOO,${FOO}and${FOO:-bar}against the process environment, so a shared Spinloop or preset can carry machine-specific paths and tags.Summary
PARAMvalues and preset entry values interpolate$FOO,${FOO}and${FOO:-fallback}(the fallback stands when the variable is unset or empty);$$is a literal$and a stray$stays literal.spinloop serve,spinloop cloud deploy, a node wake — so printed and dry-run commands show resolved values, while parsing,showandexportkeep the raw text and can never leak a resolved value into a re-rendered file.${, bad name, any other${...}form) fails naming the offending preset line or PARAM key, rather than passing raw text to an engine.servepresets and PARAMs,cloud deploy, and a maintainer note on why resolution sits at the two choke points.Implementation details
Expansion lives in a new stdlib-only leaf,
internal/envref, called from exactly two places —preset.ParseandselectionParams— both reached only by the serve and deploy derivations. That placement keepsinternal/spinloopI/O-free (its standing invariant) and gives the timing rule for free: nothing else that reads a Spinloop resolves anything. The OpenSpec change records the behaviour as new requirements onspinloop-files,local-servingandremote-endpoint; it still needs archiving before merge.Closes #283