test(#826): verify ${VAR} substitution semantics for harness env vars - #860
Open
fullsend-ai-coder[bot] wants to merge 1 commit into
Open
test(#826): verify ${VAR} substitution semantics for harness env vars#860fullsend-ai-coder[bot] wants to merge 1 commit into
fullsend-ai-coder[bot] wants to merge 1 commit into
Conversation
Add TestEnvVarExpansionSemantics to document and verify the
three-outcome contract for ${VAR} references in harness YAML
(runner_env, env.runner, env.sandbox):
1. Var unset -> ValidateRunnerEnvWith rejects (run aborts)
2. Var set to "" -> validation passes, expands to empty string
3. Var set to value -> validation passes, expands to value
Also covers mixed literal+var expansion, cross-target (runner
and sandbox) expansion, and optional vs required host_files
with unset variables.
This answers the question posed in the issue: when an operator
never configures a ${VAR} reference, ValidateRunnerEnvWith
rejects it with an error before expansion occurs, so the
fail-closed abort in post-review.sh is never reached for
truly unset variables.
Note: golangci-lint was not available in the sandbox. go vet
and go test passed. Pre-commit could not run (network error).
Closes #826
|
🤖 Finished Review · ✅ Success · Started 9:43 AM UTC · Completed 9:55 AM UTC |
|
Looks good to me |
Owner
|
/fs-fix |
Author
|
🤖 Finished Fix · ✅ Success · Started 10:31 AM UTC · Completed 10:35 AM UTC |
Author
🔧 Fix agent — iteration 1 (human-triggered)No changes made. The PR was already approved by the review bot with no findings. The human /fs-fix command included no specific instruction. All tests pass (9/9 subtests in TestEnvVarExpansionSemantics). Secret scan clean. Disagreed (1):
Tests: passedNext steps:
|
|
This pull request has been automatically marked as stale because it has not had any activity in the last month. It will be closed in 2 weeks if no further activity occurs. Remove the |
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
Add
TestEnvVarExpansionSemanticstointernal/harness/harness_test.goto document and verify the three-outcome contract for${VAR}references in harness env fields. This answers the question in the issue: when an operator never configures a variable,ValidateRunnerEnvWithrejects it with an error beforeos.Expandruns — so downstream fail-closed checks (e.g.post-review.sh'sREVIEW_PROTECTED_PATHS) are never hit for truly unset variables.Related Issue
Closes #826
Changes
runner_env,env.runner, andenv.sandbox""env.runner+env.sandbox) expansion works independentlyhost_filesskip unset vars; required ones reject themTesting
go test ./internal/harness/... -run TestEnvVarExpansionSemantics)go test ./internal/harness/...)go vet ./internal/harness/...cleanCloses #826
Post-script verification
agent/826-verify-env-var-expansion)c887fc47c59d8b87b5282ca44044d2933d30df41..HEAD)