Skip to content

fix: allow Task.File.* in <StepScript>.let, matching Env.File.* in environments#152

Merged
mwiebe merged 1 commit into
OpenJobDescription:mainlinefrom
mwiebe:fix/step-script-let-task-file-scope
Jul 17, 2026
Merged

fix: allow Task.File.* in <StepScript>.let, matching Env.File.* in environments#152
mwiebe merged 1 commit into
OpenJobDescription:mainlinefrom
mwiebe:fix/step-script-let-task-file-scope

Conversation

@mwiebe

@mwiebe mwiebe commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Background

Templates can define embedded files — small scripts or config
files that the worker writes to disk before running an action. Env.File.<name>
and Task.File.<name> are the symbols that tell you where such a file will
land. With the EXPR extension, let bindings let you name a computed value
once and reuse it across the script.

The spec's Let Binding Scope Summary (Template Schemas §3.6.2) says an
environment script's let bindings may reference Env.File.*, because the
file's path is decided before the bindings run — only its content is
evaluated later. That exact reasoning applies to step scripts and
Task.File.* too, but the <StepScript>.let row never granted it. While
fixing evaluation ordering in OpenJobDescription/openjd-rs#260 we found that
implementations already accept Task.File.* there — the spec table was just
inconsistent between the two contexts.

The change

Grant Task.File.* in the <StepScript>.let scope row and
generalize the accompanying note to cover both contexts; state the same grant
explicitly in RFC 0005 (which previously only implied the environment side via
an example); and back it with conformance tests — the §3.6 validation fixture
now actually exercises Task.File.* in let (its header comment already
claimed to), plus a new runtime test mirroring the existing Env.File one.

Verification

Full 2023-09/EXPR conformance suite passes (350/350) against
openjd-rs built with #260. A pre-#260 build fails the new runtime test,
confirming it guards the fixed behavior.


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

… in environments

The Let Binding Scope Summary granted Env.File.* to <EnvironmentScript>.let
but omitted Task.File.* from <StepScript>.let. The rationale for the Env
case — embedded file paths are determined before let evaluation — applies
identically to step scripts, and implementations already validate and
evaluate Task.File.* in step-script let bindings
(OpenJobDescription/openjd-rs#260).

- Add Task.File.* to the <StepScript>.let scope row and generalize the
  embedded-file note to cover both contexts (2023-09 Template Schemas 3.6.2)
- Align RFC 0005's ScriptTemplate let description, which granted embedded
  file symbols to environment scripts via example but never stated the
  step-script side
- Exercise Task.File.* in the 3.6 let-host-context-symbols validation
  fixture (its header comment already claimed this coverage) and add a
  7.3 runtime test mirroring the existing Env.File one

Signed-off-by: Mark <399551+mwiebe@users.noreply.github.com>
@mwiebe
mwiebe merged commit 933111e into OpenJobDescription:mainline Jul 17, 2026
2 of 7 checks passed
@mwiebe
mwiebe deleted the fix/step-script-let-task-file-scope branch July 17, 2026 18:51
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.

3 participants