[Repo Assist] test(shared): add unit tests for ExecCommandToken and ExecEnvInvocationUnwrapper#548
Conversation
Add 66 direct unit tests for two security-critical components in the exec-approval pipeline that had no dedicated coverage: - ExecCommandTokenTests (26 tests): BasenameLower, NormalizedBasename, IsEnv — covering plain tokens, paths, extension stripping, whitespace, and env-lookalike tokens (envsubst, env_helper). - ExecEnvInvocationUnwrapperTests (39 tests): Unwrap, HasModifiers, UnwrapForResolution — covering bare commands, VAR=val assignments, FlagOnly and WithValue options, inline-value forms, -- / - terminators, unknown-flag fail-closed behaviour, double-wrapping, and max-depth guard. All pre-existing test failures (8) are infrastructure-level and unrelated to these changes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Codex review: needs changes before merge. Reviewed May 26, 2026, 9:37 PM ET / 01:37 UTC. Summary Reproducibility: yes. for the review finding: the PR head source shows an empty xUnit Review metrics: 1 noteworthy metric.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge Security Review findings
Review detailsBest possible solution: Keep the dedicated test coverage, replace or remove the empty fact, and rely on full repository validation before merge. Do we have a high-confidence way to reproduce the issue? Yes for the review finding: the PR head source shows an empty xUnit Is this the best way to solve the issue? No, not quite: adding focused tests is the right direction, but the empty fact should be replaced with a real assertion or removed before this is the best merge shape. Full review comments:
Overall correctness: patch is correct AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against 0a164fc111b2. Label changesLabel changes:
Label justifications:
Evidence reviewedAcceptance criteria:
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
ClawSweeper PR egg ✨ Hatched: 🥚 common Frosted Branchling Hatch commandComment Hatchability rules:
Rarity: 🥚 common. What is this egg doing here?
|
🤖 This PR was created by Repo Assist, an automated AI assistant.
Summary
Adds 66 direct unit tests for two security-critical components in the exec-approval pipeline that had no dedicated test coverage:
ExecCommandTokenTests(26 tests)Covers
BasenameLower,NormalizedBasename, andIsEnv:.exeonly)env-lookalike rejection (envsubst,env_helper)/usr/bin/env,C:\tools\env.exe)ExecEnvInvocationUnwrapperTests(40 tests)Covers
Unwrap,HasModifiers, andUnwrapForResolution:env COMMAND→ strips env prefixVAR=valassignment strippingFlagOnly(-i,--ignore-environment,-0,--null) andWithValue(-u,--unset,-c,--chdir) with inline and separate forms--(ends option parsing, not a modifier) and-(clears env, is a modifier)null)HasModifierslogic: VAR=val and flags returntrue; bare command and--returnfalseUnwrapForResolution: single and double env-wrapping, with assignments, max-depth guard, empty inputWhy these tests matter
ExecCommandToken.IsEnvandExecEnvInvocationUnwrapper.Unwrapsit at the entry of the exec-approval security pipeline. A misclassification (e.g. treatingenvsubstasenv, or silently swallowing an unknown flag instead of failing closed) would bypass the allowlist evaluator. Direct unit tests make regressions visible immediately.Test Status
Full suite: 8 pre-existing failures (infrastructure-level, unrelated to this PR); 2080 passing.