feat: add task-scoped vars #11
Merged
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
varsthat override global onesTesting
go test ./...Prompt
Task 11: Support Nested
varsBlocks Within TasksPurpose:
Enable task-scoped variable definitions via
varsblocks inside individualtaskdefinitions. This allows task-local variables that override or extend global ones and participate in the same expression resolution model.Requirements:
taskblock may contain its ownvarsblock.varsshould follow the same lazy evaluation and recursive resolution rules as global variables.vars.X, and vice versa is not allowed.varsmust be evaluated in a merged context (global + local), with localvarstaking precedence.vars.Examples to Support:
Assert:
vars.ABC == 123vars.DEF == 456(only within taskhi)vars.GHI == "123456"(in taskhionly)Scope:
varsblock (notenv) inside tasks.taskblock'svarsshould shadow globals.Implementation Notes (Do Not Copy Code):
varsshould be parsed ashcl.Expressionlike global vars.Validation:
HCLE2ETestthat defines globalvars, and a task with additionalvars.${vars.ABC}${vars.DEF}) resolve as expected.env) and validate that appropriate errors or rejections occur.varsis isolated and does not leak between tasks.https://chatgpt.com/codex/tasks/task_e_68924507f3508330b1b9e26a2cb6344d