Skip to content

fix(#9157): treat "export -n NAME" as un-exporting NAME - #9159

Open
fullsend-ai-coder[bot] wants to merge 6 commits into
mainfrom
agent/9157-export-n-unexport
Open

fullsend-ai-coder[bot] wants to merge 6 commits into
mainfrom
agent/9157-export-n-unexport

Conversation

@fullsend-ai-coder

Copy link
Copy Markdown
Contributor

Summary

internal/envmanifest/shellexports.go recorded export -n FOO as exporting FOO. It skipped every dash-prefixed export argument, and its result set could only grow. In Bash, -n removes 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

  • collectFromCommand reads export options 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=value removes NAME too, which matches Bash.
  • Shell-level exports are now kept in a separate set from prefix assignments (FOO=1 cmd) and env assignments. Those only reach their own command's process, so a later export -n never removes them.
  • Each sh -c / bash -c script gets its own export set. An export -n inside the child shell can't un-export a name in the parent. The names the child exports are still reported.
  • Scripts passed to ExportedNames are still read in order as one shell, so retraction follows that order.
  • Updated the ExportedNames doc comment.

Testing

  • The old export flags are skipped test expected the wrong result. It's replaced by cases for: -n, -p, combined flags, --, ordering in both directions, partial un-export, prefix assignments surviving export -n, and sh -c scoping.
  • go test ./internal/envmanifest/... passes. Every new line is covered.
  • The internal/cli env-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.
  • Unrelated internal/cli tests (TestStartFetchService_*, TestPostScriptEnv_*) fail in the sandbox. They fail on main as well, because of the sandbox's network and environment.

Checklist

🤖 Generated with Claude Code


Closes #9157

Post-script verification

  • Branch is not main/master (agent/9157-export-n-unexport)
  • Secret scan passed (gitleaks — 1ae05959caaa61b9f38d1243ce8e6737bab1146c..HEAD)
  • PR body secret scan passed (gitleaks — no-git)
  • Final PR description secret scan passed (gitleaks — no-git)

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>
@fullsend-ai-review

Copy link
Copy Markdown

🤖 Review · ⚠️ Cancelled · Ended 2:23 PM UTC

Commit: 69344e2 · View workflow run →

Automated review did not complete for this commit. Check the latest review status before merging. If no review is queued or running, comment /fs-review to retry.

@fullsend-ai-review

fullsend-ai-review Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 2:25 PM UTC · Completed 2:34 PM UTC

Commit: 69344e2 · View workflow run →

Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $1.16

@fullsend-ai-review fullsend-ai-review Bot added the risk/low PR risk: low label Nov 6, 2026
@fullsend-ai-review

fullsend-ai-review Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Risk Assessment: low (1/5)

Details

Small 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 run

Risk Assessment: low (1/5)

Details

Small, 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)

Details

Small, 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)

Details

Small, 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)

Details

Small, 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)

Details

Small, 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.

@fullsend-ai-review

fullsend-ai-review Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Review

Findings

Low

  • [logic-error] internal/envmanifest/shellexports.go:131 — The exec launch check treats any argument as a command, including options alone. ExportedNames("export X=1; exec --; export -n X") returns X. In Bash, exec -- launches nothing, so the later export -n X removes it. This is inconsistent with the PR's own "exec with no command launches nothing" case.
    Remediation: Skip exec options (at least --, and -a/-c/-l) before deciding whether a command remains, and add an options-only exec regression test.

  • [logic-error] internal/envmanifest/shellexports.go:125 — Prefix assignments are added to seen before the code knows whether export, command or exec launches a process. So Y=1 command -v true reports Y even though the lookup launches nothing, and Y=1 export -n Y reports the variable it un-exports. The new builtin forwarding re-dispatches the prefix words, so Y=1 builtin command -v true has the same result. The behavior over-reports and also exists on the base branch for command; advisory, not blocking.
    Remediation: 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.

Earlier findings

  • internal/envmanifest/shellexports.go:202, logic-error — resolved: the builtin dispatcher now clones the prefix assignments into the forwarded command (target := append(slices.Clone(words[:i]), args...)), and four new tests cover builtin exec, builtin command, nested builtin, and builtin -- true.
  • internal/envmanifest/shellexports.go:107, edge-case — reclassified to info: parenthesized subshells still share the parent's export set, which the ExportedNames doc comment states as a deliberate tokenizer limitation.

Labels: The PR fixes a defect in Go code.


Next steps:

  • /fs-fix — agent addresses review findings automatically
  • /fs-fix <your instruction> — agent fixes with your specific guidance
  • Push commits directly — review re-runs automatically on push
  • /fs-fix-stop — disable automatic fix runs for this PR

1 finding(s) below the low severity threshold were not posted.

Previous run

<!-- fullsend:review-findings-v2:eyJ2ZXJzaW9uIjoyLCJhY3Rpb24iOiJyZXF1ZXN0LWNoYW5nZXMiLCJmaW5kaW5ncyI6W3sic2V2ZXJpdHkiOiJpbmZvIiwiY2F0ZWdvcnkiOiJlZGdlLWNhc2UiLCJmaWxlIjoiaW50ZXJuYWwvZW52bWFuaWZlc3Qvc2hlbGxleHBvcnRzLmdvIiwiaWQiOiJmXzg4YTgyNjk4NGQ0MjFlZGUiLCJsaW5lIjoxMDcsImFjdGlvbmFibGUiOmZhbHNlLCJkaW1lbnNpb24iOiJjb3JyZWN0bmVzcyJ9LHsic2V2ZXJpdHkiOiJsb3ciLCJjYXRlZ29yeSI6ImxvZ2ljLWVycm9yIiwiZmlsZSI6ImludGVybmFsL2Vudm1hbmlmZXN0L3NoZWxsZXhwb3J0cy5nbyIsImlkIjoiZl9iMWJjMTk2YjkyYzEzNzRkIiwibGluZSI6MjAyLCJhY3Rpb25hYmxlIjpmYWxzZSwiZGltZW5zaW9uIjoiY29ycmVjdG5lc3MifSx7InNldmVyaXR5IjoibG93IiwiY2F0ZWdvcnkiOiJsb2dpYy1lcnJvciIsImZpbGUiOiJpbnRlcm5hbC9lbnZtYW5pZmVzdC9zaGVsbGV4cG9ydHMuZ28iLCJpZCI6ImZfYjRiMGU4YTdmNjJkOTA5MiIsImxpbmUiOjEzMCwiYWN0aW9uYWJsZSI6dHJ1ZSwiZGltZW5zaW9uIjoiY29ycmVjdG5lc3MifSx7InNldmVyaXR5IjoibG93IiwiY2F0ZWdvcnkiOiJsb2dpYy1lcnJvciIsImZpbGUiOiJpbnRlcm5hbC9lbnZtYW5pZmVzdC9zaGVsbGV4cG9ydHMuZ28iLCJpZCI6ImZfNmM1NDY5ZGM0YzRiY2RjMyIsImxpbmUiOjE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Z2UifSx7ImlkIjoiZl84ZjMzMjBlZDNmYjE3NzQ3Iiwic3RhdHVzIjoicmVzb2x2ZWRfYnlfY2hhbmdlIn0seyJpZCI6ImZfMDM1NDEyMGFlNmM3MjZjZCIsInN0YXR1cyI6InJlc29sdmVkX2J5X2NoYW5nZSJ9LHsiaWQiOiJmX2NmZWFkMmI3ZDEzMTc3YTUiLCJzdGF0dXMiOiJyZXNvbHZlZF9ieV9jaGFuZ2UifSx7ImlkIjoiZl85ODQ4NTk1OGM5MmUwMmU2Iiwic3RhdHVzIjoicmVzb2x2ZWRfYnlfY2hhbmdlIn1dfQ== -->

Review

Findings

Low

  • [logic-error] internal/envmanifest/shellexports.go:202 — The new builtin dispatcher drops prefix assignments even when its target launches an external process. For example, Y=1 builtin exec /usr/bin/env returns no names, whereas Bash passes Y to env. Adding builtin to shellBuiltins skips the outer prefix words, and recursing with args alone loses them. This also affects builtin command <external>. Before this change Y was reported, so this is a narrow regression. Non-blocking: rare input, and nothing in the repo uses it.
    Remediation: Propagate prefix assignments through builtin dispatch and record them when the resolved target launches a process. Add tests for prefixed builtin exec and builtin command, keeping the builtin true exclusion.

Earlier findings

  • internal/envmanifest/shellexports.go:126, logic-error — resolved: adding builtin to shellBuiltins stops it from snapshotting exports as a process launch, and builtin export -n is now dispatched, with regression tests.
  • internal/envmanifest/shellexports.go:106, edge-case — remains info: a parenthesized subshell still shares the parent export set, which the doc comment documents as a tokenizer limitation.

Re-review note: One or more prior blocking findings remain open and must still be addressed.

Blocking prior findings:


Next steps:

  • /fs-fix — agent addresses review findings automatically
  • /fs-fix <your instruction> — agent fixes with your specific guidance
  • Push commits directly — review re-runs automatically on push
  • /fs-fix-stop — disable automatic fix runs for this PR

1 finding(s) below the low severity threshold were not posted.

Previous run (2)

<!-- fullsend:review-findings-v2:eyJ2ZXJzaW9uIjoyLCJhY3Rpb24iOiJyZXF1ZXN0LWNoYW5nZXMiLCJmaW5kaW5ncyI6W3sic2V2ZXJpdHkiOiJsb3ci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JuYWwvZW52bWFuaWZlc3Qvc2hlbGxleHBvcnRzLmdvIiwiaWQiOiJmXzk4NDg1OTU4YzkyZTAyZTYiLCJsaW5lIjoxNjgsImFjdGlvbmFibGUiOmZhbHNlLCJkaW1lbnNpb24iOiJjb3JyZWN0bmVzcyJ9XSwiZGlzcG9zaXRpb25zIjpbeyJpZCI6ImZfMDM1NDEyMGFlNmM3MjZjZCIsInN0YXR1cyI6InJlc29sdmVkX2J5X2NoYW5nZSJ9LHsiaWQiOiJmX2NmZWFkMmI3ZDEzMTc3YTUiLCJzdGF0dXMiOiJyZXNvbHZlZF9ieV9jaGFuZ2UifSx7ImlkIjoiZl85ODQ4NTk1OGM5MmUwMmU2Iiwic3RhdHVzIjoicmVzb2x2ZWRfYnlfY2hhbmdlIn0seyJpZCI6ImZfODhhODI2OTg0ZDQyMWVkZSIsInN0YXR1cyI6InJlY2xhc3NpZmllZCJ9LHsiaWQiOiJmXzkxMzdlNzBjMzM3YjQyNTQiLCJzdGF0dXMiOiJvcGVuIn0seyJpZCI6ImZfNmM1NDY5ZGM0YzRiY2RjMyIsInN0YXR1cyI6InJlc29sdmVkX2J5X2NoYW5nZSJ9LHsiaWQiOiJmX2Q4MDE2ODU2ZmIxMzQ5NDMiLCJzdGF0dXMiOiJyZXNvbHZlZF9ieV9jaGFuZ2UifSx7ImlkIjoiZl8wOWZjMWY2MGZiMmFhMTAxIiwic3RhdHVzIjoicmVzb2x2ZWRfYnlfY2hhbmdlIn0seyJpZCI6ImZfOGYzMzIwZWQzZmIxNzc0NyIsInN0YXR1cyI6InJlc29sdmVkX2J5X2NoYW5nZSJ9XX0= -->

Review

Findings

Low

  • [logic-error] internal/envmanifest/shellexports.go:130 — The process-launch snapshot still treats unlisted shell builtins as external commands. For example, export X=1; builtin true; export -n X reports X even though builtin true launches no child and X is later un-exported. builtin is not in shellBuiltins, and no case in collectFromCommand handles it.
    Remediation: Add the builtin dispatcher to collectFromCommand and process its target with builtin semantics. Add a regression test that un-exports a variable after builtin true.

Earlier findings

  • internal/envmanifest/shellexports.go:129, logic-error — resolved: an argument-free exec no longer snapshots exports (cmd != "exec" || len(args) > 0), with a regression test.
  • internal/envmanifest/shellexports.go:143, logic-error — resolved: a lone - now ends export option parsing and is an operand, with a regression test.
  • internal/envmanifest/shellexports.go:168, edge-case — resolved: function-mode operands no longer fall through to variable export handling (case funcMode:), with a regression test.
  • internal/envmanifest/shellexports.go:106, edge-case — reclassified: remains info; parenthesized subshells still share the parent export map, a documented tokenizer limitation.

Next steps:

  • /fs-fix — agent addresses review findings automatically
  • /fs-fix <your instruction> — agent fixes with your specific guidance
  • Push commits directly — review re-runs automatically on push
  • /fs-fix-stop — disable automatic fix runs for this PR

1 finding(s) below the low severity threshold were not posted.

Previous run (3)

<!-- fullsend:review-findings-v2:eyJ2ZXJzaW9uIjoyLCJhY3Rpb24iOiJyZXF1ZXN0LWNoYW5nZXMiLCJmaW5kaW5ncyI6W3sic2V2ZXJpdHkiOiJsb3ciLCJjYXRlZ29yeSI6ImxvZ2ljLWVycm9yIiwiZmlsZSI6ImludGVybmFsL2Vudm1hbmlmZXN0L3NoZWxsZXhwb3J0cy5nbyIsImlkIjoiZl8wMzU0MTIwYWU2YzcyNmNkIiwibGluZSI6MTI5LCJhY3Rpb25hYmxlIjp0cnVlLCJkaW1lbnNpb24iOiJjb3JyZWN0bmVzcyJ9LHsic2V2ZXJpdHkiOiJsb3ciLCJjYXRlZ29yeSI6ImxvZ2ljLWVycm9yIiwiZmlsZSI6ImludGVybmFsL2Vudm1hbmlmZXN0L3NoZWxsZXhwb3J0cy5nbyIsImlkIjoiZl9jZmVhZDJiN2QxMzE3N2E1IiwibGluZSI6MTQzLCJhY3Rpb25hYmxlIjpmYWxzZSwiZGltZW5zaW9uIjoiY29ycmVjdG5lc3MifSx7InNldmVyaXR5IjoiaW5mbyIsImNhdGVnb3J5IjoiZWRnZS1jYXNlIiwiZmlsZSI6ImludGVybmFsL2Vudm1hbmlmZXN0L3NoZWxsZXhw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GVnb3J5IjoibG9naWMtZXJyb3IiLCJmaWxlIjoiaW50ZXJuYWwvZW52bWFuaWZlc3Qvc2hlbGxleHBvcnRzLmdvIiwiaWQiOiJmXzA5ZmMxZjYwZmIyYWExMDEiLCJsaW5lIjoxNDUsImFjdGlvbmFibGUiOnRydWUsImRpbWVuc2lvbiI6ImNvcnJlY3RuZXNzIn0seyJzZXZlcml0eSI6ImxvdyIsImNhdGVnb3J5IjoibG9naWMtZXJyb3IiLCJmaWxlIjoiaW50ZXJuYWwvZW52bWFuaWZlc3Qvc2hlbGxleHBvcnRzLmdvIiwiaWQiOiJmXzhmMzMyMGVkM2ZiMTc3NDciLCJsaW5lIjoxODUsImFjdGlvbmFibGUiOmZhbHNlLCJkaW1lbnNpb24iOiJjb3JyZWN0bmVzcyJ9XSwiZGlzcG9zaXRpb25zIjpbeyJpZCI6ImZfMDlmYzFmNjBmYjJhYTEwMSIsInN0YXR1cyI6InJlc29sdmVkX2J5X2NoYW5nZSJ9LHsiaWQiOiJmXzk4NDg1OTU4YzkyZTAyZTYiLCJzdGF0dXMiOiJvcGVuIn0seyJpZCI6ImZfOGYzMzIwZWQzZmIxNzc0NyIsInN0YXR1cyI6InJlc29sdmVkX2J5X2NoYW5nZSJ9LHsiaWQiOiJmXzkxMzdlNzBjMzM3YjQyNTQiLCJzdGF0dXMiOiJvcGVuIn0seyJpZCI6ImZfODhhODI2OTg0ZDQyMWVkZSIsInN0YXR1cyI6InJlY2xhc3NpZmllZCJ9LHsiaWQiOiJmXzZjNTQ2OWRjNGM0YmNkYzMiLCJzdGF0dXMiOiJyZXNvbHZlZF9ieV9jaGFuZ2UifSx7ImlkIjoiZl9kODAxNjg1NmZiMTM0OTQzIiwic3RhdHVzIjoicmVzb2x2ZWRfYnlfY2hhbmdlIn1dfQ== -->

Review

Findings

Low

  • [logic-error] internal/envmanifest/shellexports.go:129 — The process-launch snapshot also runs for exec without a command, although that form launches no process. export X=1; exec; export -n X therefore still reports X, though Bash leaves it unexported and no child inherited it.
    Remediation: Handle exec before recording inherited exports and snapshot only when an external command follows; add a regression test for exec with no operands.
  • [logic-error] internal/envmanifest/shellexports.go:143 — A lone - should end export option parsing and be treated as an operand, but this branch treats it as an empty option and keeps parsing. export X=1; export - -n X is read as -n un-exporting X, whereas Bash leaves X exported. The new tests cover a lone dash for command but not for export.
    Remediation: Treat a lone - as the first operand (end option parsing), and add a regression test.

Info

  • [edge-case] internal/envmanifest/shellexports.go:168 — Plain export -f FUNC falls through to recording FUNC as an exported variable; function-mode is isolated only when combined with -n. This is an approximation outside the runner-generated subset.
    Remediation: Exclude all function-mode operands from the variable export map and add a plain export -f test.
  • [edge-case] internal/envmanifest/shellexports.go:106 — Commands inside ( ... ) subshells share the parent export map, so export X=1; (export -n X) returns no names while Bash keeps X exported. This is now a documented tokenizer limitation, so it is reclassified from low to info.

Earlier findings

  • internal/envmanifest/shellexports.go (export option parsing), logic-error — resolved: export options outside -f, -n, -p now make the command a no-op, with tests for both directions.
  • internal/envmanifest/shellexports.go (command wrapper), logic-error — resolved: command option parsing now handles --, -p, -v, -V, invalid options and a lone dash, with tests.
  • internal/envmanifest/shellexports.go:106, edge-case — reclassified from low to info: the subshell limitation is documented in the ExportedNames comment.

Next steps:

  • /fs-fix — agent addresses review findings automatically
  • /fs-fix <your instruction> — agent fixes with your specific guidance
  • Push commits directly — review re-runs automatically on push
  • /fs-fix-stop — disable automatic fix runs for this PR

2 finding(s) below the low severity threshold were not posted.

Previous run (4)

<!-- fullsend:review-findings-v2:eyJ2ZXJzaW9uIjoyLCJhY3Rpb24iOiJyZXF1ZXN0LWNoYW5nZXMiLCJmaW5kaW5ncyI6W3sic2V2ZXJpdHkiOiJsb3ciLCJjYXRlZ29yeSI6ImxvZ2ljLWVycm9yIiwiZmlsZSI6ImludGVybmFsL2Vudm1hbmlmZXN0L3NoZWxsZXhwb3J0cy5nbyIsImlkIjoiZl8wOWZjMWY2MGZiMmFhMTAxIiwibGluZSI6MTQ1LCJhY3Rpb25hYm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byIsImlkIjoiZl82YzU0NjlkYzRjNGJjZGMzIiwibGluZSI6MTM5LCJhY3Rpb25hYmxlIjp0cnVlLCJkaW1lbnNpb24iOiJjb3JyZWN0bmVzcyJ9LHsic2V2ZXJpdHkiOiJsb3ciLCJjYXRlZ29yeSI6ImxvZ2ljLWVycm9yIiwiZmlsZSI6ImludGVybmFsL2Vudm1hbmlmZXN0L3NoZWxsZXhwb3J0cy5nbyIsImlkIjoiZl9kODAxNjg1NmZiMTM0OTQzIiwibGluZSI6MTUxLCJhY3Rpb25hYmxlIjpmYWxzZSwiZGltZW5zaW9uIjoiY29ycmVjdG5lc3MifV0sImRpc3Bvc2l0aW9ucyI6W3siaWQiOiJmXzZjNTQ2OWRjNGM0YmNkYzMiLCJzdGF0dXMiOiJyZXNvbHZlZF9ieV9jaGFuZ2UifSx7ImlkIjoiZl85MTM3ZTcwYzMzN2I0MjU0Iiwic3RhdHVzIjoib3BlbiJ9LHsiaWQiOiJmX2Q4MDE2ODU2ZmIxMzQ5NDMiLCJzdGF0dXMiOiJyZXNvbHZlZF9ieV9jaGFuZ2UifSx7ImlkIjoiZl84OGE4MjY5ODRkNDIxZWRlIiwic3RhdHVzIjoib3BlbiJ9XX0= -->

Review

Findings

Low

  • [logic-error] internal/envmanifest/shellexports.go:145 — Any export option containing n sets un-export mode, even when Bash rejects the option as invalid. export X=1; export -notvalid X leaves X exported in Bash (the builtin errors out without acting), but this parser deletes X from the export set. Needs malformed input the runner's emitters do not generate.
    Remediation: Validate the option characters (only the letters export accepts, e.g. f, n, p) before changing export state, and add a regression test for an invalid option containing n.
  • [logic-error] internal/envmanifest/shellexports.go:185 — command options are re-dispatched as the executable name. For export X=1; command -v bash; export -n X, the recursive call sees cmd -v, so every exported name is copied into the child-visible set as if a process launched; Bash command -v launches nothing, so the later export -n X should remove X. command -- echo ... is misclassified similarly. New edge case from the launch-snapshot logic added in the latest commit.
    Remediation: Parse command options (-v, -V, -p, --) before dispatch: treat lookup-only modes as launching nothing, and skip option words before inspecting the real command. Add regression tests.

Info

  • [edge-case] internal/envmanifest/shellexports.go — Parenthesized subshells share the parent's export set, so export X=1; (export -n X) reports no names although X stays exported in the parent. The PR documents this as a known tokenizer limitation, and nothing in the repo uses export -n.

Earlier findings

  • internal/envmanifest/shellexports.go:139, logic-error — resolved: function-mode handling (export -fn / export -f -n) added with tests.
  • internal/envmanifest/shellexports.go:151, logic-error — resolved: env wrapper recursion now uses an isolated export set, with a test.
  • internal/envmanifest/shellexports.go:95, edge-case — reclassified from low to info: subshell behavior is now documented as a known limitation.

Next steps:

  • /fs-fix — agent addresses review findings automatically
  • /fs-fix <your instruction> — agent fixes with your specific guidance
  • Push commits directly — review re-runs automatically on push
  • /fs-fix-stop — disable automatic fix runs for this PR

1 finding(s) below the low severity threshold were not posted.

Previous run (5)

<!-- fullsend:review-findings-v2:eyJ2ZXJzaW9uIjoyLCJhY3Rpb24iOiJyZXF1ZXN0LWNoYW5nZXMiLCJmaW5kaW5ncyI6W3sic2V2ZXJpdHkiOiJsb3ciLCJjYXRlZ29yeSI6ImxvZ2ljLWVycm9yIiwiZmlsZSI6ImludGVybmFsL2Vudm1hbmlmZXN0L3NoZWxsZXhwb3J0cy5nbyIsImlkIjoiZl82YzU0NjlkYzRjNGJjZGMzIiwibGluZSI6MTM5LCJhY3Rpb25hYmxlIjp0cnVlLCJkaW1lbnNpb24iOiJjb3JyZWN0bmVzcyJ9LHsic2V2ZXJpdHkiOiJsb3ciLCJjYXRlZ29yeSI6ImxvZ2ljLWVycm9yIiwiZmlsZSI6ImludGVybmFsL2Vudm1hbmlmZXN0L3NoZWxsZXhwb3J0cy5nbyIsImlkIjoiZl85MTM3ZTcwYzMzN2I0MjU0IiwibGluZSI6MTI2LCJhY3Rpb25hYmxlIjp0cnVlLCJkaW1lbnNpb24iOiJjb3JyZWN0bmVzcyJ9LHsic2V2ZXJpdHkiOiJsb3ciLCJjYXRlZ29yeSI6ImxvZ2ljLWVycm9yIiwiZmlsZSI6ImludGVybmFsL2Vudm1hbmlmZXN0L3NoZWxsZXhwb3J0cy5nbyIsImlkIjoiZl9kODAxNjg1NmZiMTM0OTQzIiwibGluZSI6MTUxLCJhY3Rpb25hYmxlIjpmYWxzZSwiZGltZW5zaW9uIjoiY29ycmVjdG5lc3MifSx7InNldmVyaXR5IjoibG93IiwiY2F0ZWdvcnkiOiJlZGdlLWNhc2UiLCJmaWxlIjoiaW50ZXJuYWwvZW52bWFuaWZlc3Qvc2hlbGxleHBvcnRzLmdvIiwiaWQiOiJmXzg4YTgyNjk4NGQ0MjFlZGUiLCJsaW5lIjo5NSwiYWN0aW9uYWJsZSI6ZmFsc2UsImRpbWVuc2lvbiI6ImNvcnJlY3RuZXNzIn1dfQ== -->

Review

Findings

Low

  • [logic-error] internal/envmanifest/shellexports.go:139 — export -n deletes a name from the exported set without recording whether a child process already inherited it. For example export X=1; bash -c 'printenv X'; export -n X returns no names although the child received X. Ordinary shell-level exports are never snapshotted into seen when a non-builtin command launches, which contradicts the documented child-environment contract.
    Remediation: Before processing a non-builtin command launch, copy the currently exported names into seen. Keep final export attributes separate so export X=1; export -n X with no intervening launch still returns no X. Add tests for an intervening external command and child shell.

  • [logic-error] internal/envmanifest/shellexports.go:126 — The option parser sets unexport whenever a flag contains n, without tracking -f. export X=1; export -fn X (or export -f -n X) removes X from the variable export set, but Bash's -f selects the function namespace and leaves variable X exported. No test covers function-mode exports.
    Remediation: Track -f while parsing options and leave variable export attributes unchanged in function mode, or document the limitation. Add a regression test.

  • [logic-error] internal/envmanifest/shellexports.go:151 — Wrapper recursion forwards the parent's mutable exported set through env/nohup/exec, so export X=1; env export -n X removes X even though those wrappers cannot invoke the export builtin (command export -n X does). Unrealistic input; pre-PR wrapper handling was equally approximate.
    Remediation: Optionally pass an isolated export map when recursing through env/nohup/exec.

  • [edge-case] internal/envmanifest/shellexports.go:95 — All commands share one mutable export set while the tokenizer treats parentheses as plain separators, so export X=1; (export -n X) returns no X although Bash keeps X exported in the parent. Consistent with the documented "tokenizer, not a shell" limits.
    Remediation: Add a regression test and either isolate export mutations in parenthesized subshells or document the limitation.


Next steps:

  • /fs-fix — agent addresses review findings automatically
  • /fs-fix <your instruction> — agent fixes with your specific guidance
  • Push commits directly — review re-runs automatically on push
  • /fs-fix-stop — disable automatic fix runs for this PR

fullsend-ai-review[bot]

This comment was marked as outdated.

@fullsend-ai-coder

fullsend-ai-coder Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Finished Fix · ✅ Success · Started 2:36 PM UTC · Completed 2:49 PM UTC

Commit: 69344e2 · View workflow run →

Runtime: claude · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $0.59

@codecov

codecov Bot commented Nov 6, 2026

Copy link
Copy Markdown

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>
@fullsend-ai-coder

Copy link
Copy Markdown
Contributor Author

🔧 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):

  1. export -n deletes a name a child process already inherited (export X=1; bash -c ...; export -n X) (internal/envmanifest/shellexports.go): When a non-builtin command launches, snapshot the currently exported names into the child-visible set; export and command are excluded since they run in the shell. Added tests for an intervening external command, a child shell, and builtins that still retract.
  2. export -fn / -f -n treated as un-exporting the variable (internal/envmanifest/shellexports.go): Track -f while parsing export options; a function-mode -n leaves the variable exported. Added regression tests for -fn and -f -n.
  3. env/nohup/exec wrapper recursion can mutate the parent's export set (internal/envmanifest/shellexports.go): env, exec and nohup recurse with an isolated export set, since external programs cannot run the export builtin; command keeps the shared set. Added a test for env export -n X.
  4. export -n inside a ( ... ) subshell is treated as running in the parent shell (internal/envmanifest/shellexports.go): Documented the limitation in the ExportedNames doc comment, since the tokenizer treats parentheses as plain separators.

Tests: passed

Conflict update: skipped; strategy none; forge MERGEABLE; target main

Next steps:

  • /fs-review — request a re-review of the changes
  • /fs-fix <your instruction> — run another fix pass with specific guidance
  • Push commits directly — review re-runs automatically on push
    Updated by fullsend fix agent

@fullsend-ai-review

fullsend-ai-review Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 2:51 PM UTC · Completed 2:57 PM UTC

Commit: 9a1636a · View workflow run →

Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $1.00

fullsend-ai-review[bot]

This comment was marked as outdated.

@fullsend-ai-coder

fullsend-ai-coder Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Finished Fix · ✅ Success · Started 2:59 PM UTC · Completed 3:04 PM UTC

Commit: 9a1636a · View workflow run →

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>
@fullsend-ai-coder

Copy link
Copy Markdown
Contributor Author

🔧 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):

  1. Any export option containing n triggers un-export, even when Bash rejects the option as invalid (internal/envmanifest/shellexports.go): export now treats a command with an option outside f, n, p as a no-op, matching Bash. Added regression tests for an invalid option containing n and an invalid option without n.
  2. command options are re-dispatched as the executable name (internal/envmanifest/shellexports.go): command options (p, v, V, --) are now parsed before dispatch. Lookup-only modes (v, V) and rejected options launch nothing, so a later export -n still retracts. Other option words are skipped before the real command is inspected. Added tests for -v, -V, an invalid option, -p, --, -p export -n, options only, and a lone dash.

Disagreed (1):

  1. Parenthesized subshells share the parent's export set (info): Info-level, non-actionable finding. It is a documented limitation of the tokenizer, which treats parentheses as plain separators. Isolating subshell scopes would need a real parser, which is out of scope here. Nothing in the repo uses export -n.

Tests: passed

CI inspections (8):

  1. commit-lint (passing, success)
  2. pr-title-lint (passing, success)
  3. web (passing, success)
  4. gateway-doc-configs (passing, success)
  5. test-sandbox-darwin (passing, success)
  6. test (pending, in_progress): Still running when inspected.
  7. behaviour (pending, in_progress): E2E job still running when inspected.
  8. playback (pending, in_progress): E2E job still running when inspected.

Conflict update: skipped; strategy none; forge MERGEABLE; target main@9a4a811b935c60e6a4998757266c2a8219cfb9c8

Next steps:

  • /fs-review — request a re-review of the changes
  • /fs-fix <your instruction> — run another fix pass with specific guidance
  • Push commits directly — review re-runs automatically on push
    Updated by fullsend fix agent

@fullsend-ai-review

fullsend-ai-review Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 3:06 PM UTC · Completed 3:13 PM UTC

Commit: 9b1d492 · View workflow run →

Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $1.03

fullsend-ai-review[bot]

This comment was marked as outdated.

@fullsend-ai-coder

fullsend-ai-coder Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Finished Fix · ✅ Success · Started 3:15 PM UTC · Completed 3:20 PM UTC

Commit: 9b1d492 · View workflow run →

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>
@fullsend-ai-coder

Copy link
Copy Markdown
Contributor Author

🔧 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):

  1. exec with no command still snapshots exported names as if a process launched (internal/envmanifest/shellexports.go): Skip the launch snapshot when exec has no operands; added regression tests for exec with and without a command.
  2. A lone dash in export is treated as an option instead of ending option parsing (internal/envmanifest/shellexports.go): A lone '-' is now the first operand, so a following '-n' is not read as an option; added a regression test.
  3. Plain export -f FUNC records FUNC as an exported variable (internal/envmanifest/shellexports.go): All function-mode operands are now excluded from the variable export map; added a plain export -f test.

Disagreed (1):

  1. Subshell exports share the parent export map: Info-level and already documented as a tokenizer limitation in the ExportedNames comment; isolating subshells would need real parenthesis tracking, which is out of scope for this PR.

Tests: passed

CI inspections (6):

  1. test (pending, in_progress): Still running at inspection time.
  2. playback (pending, in_progress): Still running at inspection time.
  3. behaviour (pending, in_progress): Still running at inspection time.
  4. commit-lint (passing, success)
  5. pr-title-lint (passing, success)
  6. test-sandbox-darwin (passing, success)

Conflict update: skipped; strategy none; forge MERGEABLE; target main

Next steps:

  • /fs-review — request a re-review of the changes
  • /fs-fix <your instruction> — run another fix pass with specific guidance
  • Push commits directly — review re-runs automatically on push
    Updated by fullsend fix agent

@fullsend-ai-review

fullsend-ai-review Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 3:22 PM UTC · Completed 3:30 PM UTC

Commit: 82e8f25 · View workflow run →

Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $0.81

fullsend-ai-review[bot]

This comment was marked as outdated.

@fullsend-ai-coder

fullsend-ai-coder Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Finished Fix · ✅ Success · Started 3:32 PM UTC · Completed 3:36 PM UTC

Commit: 82e8f25 · View workflow run →

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>
@fullsend-ai-coder

Copy link
Copy Markdown
Contributor Author

🔧 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):

  1. The builtin dispatcher was treated as an external command, so exported names were snapshotted as if a process launched before a later export -n (internal/envmanifest/shellexports.go): Added builtin to the shell builtins list so it no longer counts as a process launch, and added a builtin case that processes export, command, exec and builtin targets with builtin semantics (optional -- skipped; other targets are no-ops). Added regression tests, including un-export after builtin true.

Tests: passed

CI inspections (5):

  1. test (pending, in_progress): Project unit-test job still running on the previous head.
  2. behaviour (pending, in_progress): E2E behaviour job still running.
  3. playback (pending, in_progress): E2E playback job still running.
  4. commit-lint (passing, success)
  5. pr-title-lint (passing, success)

Next steps:

  • /fs-review — request a re-review of the changes
  • /fs-fix <your instruction> — run another fix pass with specific guidance
  • Push commits directly — review re-runs automatically on push
    Updated by fullsend fix agent

@fullsend-ai-coder fullsend-ai-coder Bot added the needs-human Agent loop needs human intervention label Nov 6, 2026
@fullsend-ai-review

fullsend-ai-review Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 3:39 PM UTC · Completed 3:45 PM UTC

Commit: 116eb03 · View workflow run →

Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $1.00

fullsend-ai-review[bot]

This comment was marked as outdated.

@fullsend-ai-coder

fullsend-ai-coder Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Finished Fix · ✅ Success · Started 3:47 PM UTC · Completed 3:51 PM UTC

Commit: 116eb03 · View workflow run →

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>
@fullsend-ai-coder

Copy link
Copy Markdown
Contributor Author

🔧 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):

  1. builtin dispatcher drops prefix assignments when its target launches an external process (internal/envmanifest/shellexports.go): builtin now forwards the command's prefix assignments when dispatching to export/command/exec/builtin, so a prefixed builtin exec or builtin command reports the name while a prefixed builtin true still does not. Added regression tests for builtin exec, builtin command, nested builtin, and builtin -- true.

Tests: passed

CI inspections (3):

  1. CI / test (passing, success): Passing.
  2. codecov/patch (passing, success): Passing.
  3. E2E Tests / behaviour (pending, in_progress): Still running at inspection time.

Conflict update: skipped; strategy none; forge MERGEABLE; target main

Next steps:

  • /fs-review — request a re-review of the changes
  • /fs-fix <your instruction> — run another fix pass with specific guidance
  • Push commits directly — review re-runs automatically on push
    Updated by fullsend fix agent

@fullsend-ai-review

fullsend-ai-review Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 3:53 PM UTC · Completed 4:00 PM UTC

Commit: 47cccc2 · View workflow run →

Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $1.11

@fullsend-ai-review fullsend-ai-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the review comment for full details.

// 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) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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.

@fullsend-ai-review fullsend-ai-review Bot added type/bug Confirmed defect in existing behavior go Pull requests that update go code labels Nov 6, 2026
@fullsend-ai-coder

fullsend-ai-coder Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 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: 47cccc2 · View workflow run →

Effort: high

This branch was previously deployed

1 inactive deployment
dev — 47cccc2c Deployed Nov 6, 2026 by fullsend-ai-coder[bot] via playback #19136
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

go Pull requests that update go code needs-human Agent loop needs human intervention ready-for-review Triggers review agent dispatch risk/low PR risk: low type/bug Confirmed defect in existing behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

envmanifest: "export -n NAME" is recorded as exporting NAME

1 participant