Repository navigation
Add file-level @var directive - #65
Merged
Merged
Conversation
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Adds SeedCaptures function that returns a copy of fileVars for seeding per-run captures map. Ensures returned map never aliases input map. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@var only expands {{KEY}} in an entry's command line, since it rides the same runtime path as [captures] substitution (vars.SubstituteCaptures, called only on entry.Command). It does not expand in expected body or [asserts] values, unlike --var, which is a raw whole-file-text pass run before parsing. Add a Scope bullet to SPEC.md's @var subsection stating this explicitly, plus a Variable substitution bullet parallel to @env's, noting that --var placeholders and $VAR/${VAR} env vars expand inside @var values themselves. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…plemented SeedCaptures approach The original correction (MergeCaptures -> SeedCaptures rewrite) was made before this branch's worktree was created and never made it into the cherry-picked commit — the worktree carried the stale MergeCaptures text while the plan and actual implementation already used SeedCaptures.
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.
Summary
@var KEY=VALUEthat sets a file-scoped default for{{KEY}}template substitution, so sibling.clitestfiles that differ by one value (a scenario directory, a tool version) need change only one frontmatter line instead of repeating it on every line.--var(CLI) >[captures]>@var(file) — falls out naturally by seeding the per-run captures map with the file's@varvalues at creation (vars.SeedCaptures), rather than a merge at every substitution call site.no =) rejected as a parse-time error.Closes #60
Test plan
go test ./...— all unit packages passmake e2e— 139/139 e2e tests pass (incl. newtest/e2e/var/+ validation fixtures)make examples— 35 pass, 1 pre-existing skip (incl. newexamples/09_var.clitest)#### @varsubsection with scope/precedence notes)