Repository navigation
fix(#9157): treat "export -n NAME" as un-exporting NAME - #9159
fullsend-ai-coder[bot] wants to merge 6 commits into
Conversation
The envmanifest shell export collector skipped every dash-prefixed export argument, so "export -n FOO" recorded FOO as exported, the opposite of what Bash does. Its result set was also add-only, so it could not retract a name exported earlier in the same script. collectFromCommand now parses export options up to "--" or the first operand, and -n (alone or combined, e.g. -pn) removes operands from the shell's export set instead of adding them. Shell-level exports are tracked separately from prefix and env assignments, which affect only their command's process and are never retracted. Each sh -c script gets its own export set, so its un-exports cannot reach the parent. Scripts passed to ExportedNames are still read in order as one shell. The "export flags are skipped" test expected the wrong result and is replaced by cases covering -n, -p, combined flags, "--", ordering, prefix assignments, and sh -c. Note: pre-commit could not fetch its remote hook repos in the sandbox (TLS verification failure); gofmt, go vet, whitespace/EOL and symlink checks were run directly and passed. Unrelated internal/cli tests (TestStartFetchService_*, TestPostScriptEnv_*) fail in the sandbox on main as well. Closes #9157 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
🤖 Review · Commit: Automated review did not complete for this commit. Check the latest review status before merging. If no review is queued or running, comment |
|
🤖 Finished Review · ✅ Success · Started 2:25 PM UTC · Completed 2:34 PM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $1.16 |
|
Risk Assessment: low (1/5) DetailsSmall bot-authored bug fix with high test ratio touching no protected or security-sensitive paths, exhibiting minimal historical churn and exact alignment with linked issue #9157. Previous runRisk Assessment: low (1/5) DetailsSmall, well-tested bug fix authored by a bot touching no protected or security paths with minimal historical churn and exact alignment to the linked issue. Previous run (2)Risk Assessment: low (1/5) DetailsSmall, well-tested bug fix authored by a bot touching no protected or security paths with minimal historical churn and exact alignment to the linked issue. Previous run (3)Risk Assessment: low (1/5) DetailsSmall, well-tested bug fix authored by a bot touching no protected or security paths with minimal historical churn and exact alignment to the linked issue. Previous run (4)Risk Assessment: low (1/5) DetailsSmall, well-tested bug fix authored by a bot touching no protected or security paths with minimal historical churn and exact alignment to the linked issue. Previous run (5)Risk Assessment: low (1/5) DetailsSmall, well-tested bug fix authored by a bot touching no protected or security paths with minimal historical churn and exact alignment to the linked issue. |
ReviewFindingsLow
Earlier findings
Labels: The PR fixes a defect in Go code. Next steps:
1 finding(s) below the Previous run<!-- fullsend:review-findings-v2:eyJ2ZXJzaW9uIjoyLCJhY3Rpb24iOiJyZXF1ZXN0LWNoYW5nZXMiLCJmaW5kaW5ncyI6W3sic2V2ZXJpdHkiOiJpbmZvIiwiY2F0ZWdvcnkiOiJlZGdlLWNhc2UiLCJmaWxlIjoiaW50ZXJuYWwvZW52bWFuaWZlc3Qvc2hlbGxleHBvcnRzLmdvIiwiaWQiOiJmXzg4YTgyNjk4NGQ0MjFlZGUiLCJsaW5lIjoxMDcsImFjdGlvbmFibGUiOmZhbHNlLCJkaW1lbnNpb24iOiJjb3JyZWN0bmVzcyJ9LHsic2V2ZXJpdHkiOiJsb3ciLCJjYXRlZ29yeSI6ImxvZ2ljLWVycm9yIiwiZmlsZSI6ImludGVybmFsL2Vudm1hbmlmZXN0L3NoZWxsZXhwb3J0cy5nbyIsImlkIjoiZl9iMWJjMTk2YjkyYzEzNzRkIiwibGluZSI6MjAyLCJhY3Rpb25hYmxlIjpmYWxzZSwiZGltZW5zaW9uIjoiY29ycmVjdG5lc3MifSx7InNldmVyaXR5IjoibG93IiwiY2F0ZWdvcnkiOiJsb2dpYy1lcnJvciIsImZpbGUiOiJpbnRlcm5hbC9lbnZtYW5pZmVzdC9zaGVsbGV4cG9ydHMuZ28iLCJpZCI6ImZfYjRiMGU4YTdmNjJkOTA5MiIsImxpbmUiOjEzMCwiYWN0aW9uYWJsZSI6dHJ1ZSwiZGltZW5zaW9uIjoiY29ycmVjdG5lc3MifSx7InNldmVyaXR5IjoibG93IiwiY2F0ZWdvcnkiOiJsb2dpYy1lcnJvciIsImZpbGUiOiJpbnRlcm5hbC9lbnZtYW5pZmVzdC9zaGVsbGV4cG9ydHMuZ28iLCJpZCI6ImZfNmM1N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2Vudm1hbmlmZXN0L3NoZWxsZXhwb3J0cy5nbyIsImlkIjoiZl82YzU0NjlkYzRjNGJjZGMzIiwibGluZSI6MTM5LCJhY3Rpb25hYmxlIjp0cnVlLCJkaW1lbnNpb24iOiJjb3JyZWN0bmVzcyJ9LHsic2V2ZXJpdHkiOiJsb3ciLCJjYXRlZ29yeSI6ImxvZ2ljLWVycm9yIiwiZmlsZSI6ImludGVybmFsL2Vudm1hbmlmZXN0L3NoZWxsZXhwb3J0cy5nbyIsImlkIjoiZl85MTM3ZTcwYzMzN2I0MjU0IiwibGluZSI6MTI2LCJhY3Rpb25hYmxlIjp0cnVlLCJkaW1lbnNpb24iOiJjb3JyZWN0bmVzcyJ9LHsic2V2ZXJpdHkiOiJsb3ciLCJjYXRlZ29yeSI6ImxvZ2ljLWVycm9yIiwiZmlsZSI6ImludGVybmFsL2Vudm1hbmlmZXN0L3NoZWxsZXhwb3J0cy5nbyIsImlkIjoiZl9kODAxNjg1NmZiMTM0OTQzIiwibGluZSI6MTUxLCJhY3Rpb25hYmxlIjpmYWxzZSwiZGltZW5zaW9uIjoiY29ycmVjdG5lc3MifSx7InNldmVyaXR5IjoibG93IiwiY2F0ZWdvcnkiOiJlZGdlLWNhc2UiLCJmaWxlIjoiaW50ZXJuYWwvZW52bWFuaWZlc3Qvc2hlbGxleHBvcnRzLmdvIiwiaWQiOiJmXzg4YTgyNjk4NGQ0MjFlZGUiLCJsaW5lIjo5NSwiYWN0aW9uYWJsZSI6ZmFsc2UsImRpbWVuc2lvbiI6ImNvcnJlY3RuZXNzIn1dfQ== --> ReviewFindingsLow
Next steps:
|
|
🤖 Finished Fix · ✅ Success · Started 2:36 PM UTC · Completed 2:49 PM UTC Commit: Runtime: claude · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $0.59 |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Snapshot the shell's exported names into the child-visible set when a non-builtin process launches, so a later export -n cannot retract names a child already inherited. Leave variables exported for export -f -n (function mode). Give env/exec/nohup wrapper recursion an isolated export set, since external programs cannot run the export builtin. Document the subshell limitation of the tokenizer. Addresses #9159 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
🔧 Fix agent — iteration 1 (bot-triggered)Addressed all four review findings in internal/envmanifest/shellexports.go with new tests. The subshell finding is documented as a tokenizer limitation. go test ./internal/envmanifest/... passes. Fixed (4):
Tests: passed Conflict update: skipped; strategy
|
|
🤖 Finished Review · ✅ Success · Started 2:51 PM UTC · Completed 2:57 PM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $1.00 |
|
🤖 Finished Fix · ✅ Success · Started 2:59 PM UTC · Completed 3:04 PM UTC Commit: Runtime: claude · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $0.30 |
Reject export commands with an option other than -f, -n or -p as a no-op, as Bash does, so an invalid option containing n no longer un-exports names. Parse command options (-p, -v, -V, --) before dispatch so lookup-only modes launch nothing and option words are not mistaken for the executable. Not addressed: the info-level subshell finding is a documented tokenizer limitation. pre-commit could not run (hook repos failed TLS verification); gofmt, go vet, git diff --check and tests were run directly. Addresses #9159 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
🔧 Fix agent — iteration 2 (bot-triggered)Addressed both actionable low findings (invalid export options are a no-op; command options are parsed before dispatch) with regression tests. Left the info-level subshell finding as a documented limitation. The PR title and body are still accurate. Fixed (2):
Disagreed (1):
Tests: passed CI inspections (8):
Conflict update: skipped; strategy
|
|
🤖 Finished Review · ✅ Success · Started 3:06 PM UTC · Completed 3:13 PM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $1.03 |
|
🤖 Finished Fix · ✅ Success · Started 3:15 PM UTC · Completed 3:20 PM UTC Commit: Runtime: claude · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $0.32 |
- exec with no command launches no process, so it no longer snapshots the current export attributes. - A lone "-" ends export option parsing and is an operand. - Plain "export -f" operands are functions and never recorded as exported variables. Not changed: subshell export isolation (documented tokenizer limitation). Note: pre-commit could not fetch remote hook repos (TLS failure); ran gofmt, go vet and go test directly instead. Addresses #9159 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
🔧 Fix agent — iteration 3 (bot-triggered)Fixed the three actionable findings (exec without a command, lone dash in export, plain export -f) with regression tests; left the documented subshell limitation as is. Fixed (3):
Disagreed (1):
Tests: passed CI inspections (6):
Conflict update: skipped; strategy
|
|
🤖 Finished Review · ✅ Success · Started 3:22 PM UTC · Completed 3:30 PM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $0.81 |
|
🤖 Finished Fix · ✅ Success · Started 3:32 PM UTC · Completed 3:36 PM UTC Commit: Runtime: claude · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $0.28 |
Treat the builtin dispatcher as a shell builtin so it does not snapshot exported names as a process launch, and process its export/command/exec targets with builtin semantics. Adds regression tests. Note: pre-commit could not fetch hook repositories (certificate verification failure); gofmt and go vet were run directly and passed. Addresses #9159 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
🔧 Fix agent — iteration 4 (bot-triggered)Addressed the single open low-severity finding (builtin dispatcher). The info-level subshell finding is a documented limitation and needs no change. Targeted tests in internal/envmanifest pass. Pre-commit could not fetch hook repositories, so gofmt and go vet were run directly and passed. Fixed (1):
Tests: passed CI inspections (5):
Next steps:
|
|
🤖 Finished Review · ✅ Success · Started 3:39 PM UTC · Completed 3:45 PM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $1.00 |
|
🤖 Finished Fix · ✅ Success · Started 3:47 PM UTC · Completed 3:51 PM UTC Commit: Runtime: claude · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $0.30 |
Keep a command's prefix assignments when "builtin" dispatches to export/command/exec/builtin, so "Y=1 builtin exec prog" and "Y=1 builtin command prog" report Y while "Y=1 builtin true" still does not. Add regression tests. Note: pre-commit could not fetch hook repositories (TLS verification failure), so the hooks were not run via pre-commit. Applicable checks (gofmt, go vet, go test, whitespace/EOL, secret scan) were run directly. Addresses #9159 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
🔧 Fix agent — iteration 5 (bot-triggered)Addressed the single open finding: prefix assignments now propagate through builtin dispatch, with tests. Unit tests, go vet and gofmt pass. pre-commit could not fetch its hook repositories (TLS failure), so applicable checks were run directly. Fixed (1):
Tests: passed CI inspections (3):
Conflict update: skipped; strategy
|
|
🤖 Finished Review · ✅ Success · Started 3:53 PM UTC · Completed 4:00 PM UTC Commit: Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $1.11 |
| // attributes, so a later "export -n" cannot retract them. "export" | ||
| // and "command" run inside the shell (command may run a builtin), | ||
| // and "exec" with no command launches nothing. | ||
| if cmd != "export" && cmd != "command" && (cmd != "exec" || len(args) > 0) { |
There was a problem hiding this comment.
[low] logic-error
The exec launch check treats any argument as a command, including options alone. ExportedNames("export X=1; exec --; export -n X") returns X, although Bash exec -- launches nothing and the later export -n removes X.
Suggested fix: Skip exec options (at least --, and -a/-c/-l) before deciding whether a command remains, and add an options-only exec regression test.
| @@ -99,17 +124,55 @@ func collectFromCommand(words []shellWord, seen map[string]bool, depth int) { | |||
| for _, w := range words[:i] { | |||
| seen[w.assignmentName()] = true | |||
There was a problem hiding this comment.
[low] logic-error
Prefix assignments are added to seen before it is known whether export, command or exec launches a process, so "Y=1 command -v true" and "Y=1 export -n Y" report Y. The new builtin forwarding re-dispatches the prefix words and inherits this. Over-reporting only; the command case exists on the base branch.
Suggested fix: Carry temporary prefix bindings through dispatch and record them only when the resolved operation launches a process; add tests for prefix assignments on lookup-only command and on export -n.
|
🤖 Finished Fix · ❌ Failure (running pre-script: exit status 1: Fix iteration 6 exceeds bot cap of 5. Escalating to human. The review→fix loop has run 6 times without converging. A human can still direct the agent with /fs-fix (u…) · Started 4:02 PM UTC · Completed 4:03 PM UTC Commit: Effort: high |
Summary
internal/envmanifest/shellexports.gorecordedexport -n FOOas exportingFOO. It skipped every dash-prefixedexportargument, and its result set could only grow. In Bash,-nremoves the export attribute. With this change, a name the scripts un-export is no longer reported, including when the same script exported it earlier (export FOO=bar; export -n FOO).Related Issue
Issue #9157 (found by the review bot on #8679).
Changes
collectFromCommandreadsexportoptions up to--or the first operand.-n, alone or combined with other flags (-pn), removes the operands from the shell's export set instead of adding them.-n NAME=valueremoves NAME too, which matches Bash.FOO=1 cmd) andenvassignments. Those only reach their own command's process, so a laterexport -nnever removes them.sh -c/bash -cscript gets its own export set. Anexport -ninside the child shell can't un-export a name in the parent. The names the child exports are still reported.ExportedNamesare still read in order as one shell, so retraction follows that order.ExportedNamesdoc comment.Testing
export flags are skippedtest expected the wrong result. It's replaced by cases for:-n,-p, combined flags,--, ordering in both directions, partial un-export, prefix assignments survivingexport -n, andsh -cscoping.go test ./internal/envmanifest/...passes. Every new line is covered.internal/clienv-manifest tests (TestEnvManifestCollector,TestEnvManifestGolden,TestEnvManifestRuntimeEnumeration) pass, so the generated contract is unchanged.make lint/ pre-commit couldn't run in the sandbox because the hook repos failed TLS verification. I ran gofmt,go vet ./..., whitespace/EOL checks and the symlink check directly, and all passed. gitlint passes on the commit.internal/clitests (TestStartFetchService_*,TestPostScriptEnv_*) fail in the sandbox. They fail onmainas well, because of the sandbox's network and environment.Checklist
🤖 Generated with Claude Code
Closes #9157
Post-script verification
agent/9157-export-n-unexport)1ae05959caaa61b9f38d1243ce8e6737bab1146c..HEAD)