fix: detect git checkout separator commands#39
Conversation
Fix the dangerous-shell matcher for git checkout -- and add regression coverage. Fixes openclaw#38.
|
Codex review: needs real behavior proof before merge. Reviewed July 19, 2026, 11:07 AM ET / 15:07 UTC. Summary Reproducibility: yes. from the supplied source-level evidence: the report identifies an impossible Review metrics: 1 noteworthy metric.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Preserve the narrow regex-and-regression-test approach if current main still contains the reported gap, and attach redacted live terminal output showing the matcher flags all three added command forms before merge. Do we have a high-confidence way to reproduce the issue? Yes, from the supplied source-level evidence: the report identifies an impossible Is this the best way to solve the issue? Likely yes: changing the suffix to whitespace-or-end is the narrowest maintainable correction and the added examples directly cover the claimed gap, subject to current-main verification. AGENTS.md: unclear because the file could not be read completely. Codex review notes: model internal, reasoning high; reviewed against c7256221f52d. Label changesLabel changes:
Label justifications:
Evidence reviewedWhat 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
Review history (1 earlier review cycle)
|
What does this PR do?
Fixes dangerous-shell detection for
git checkout --and adds focused regression coverage for one target, multiple targets, and the separator at end of input.Why?
The existing pattern ends with
--\b. A word boundary cannot occur between the second hyphen and whitespace or end of input, so normal destructive checkout-restoration commands were never flagged.Fixes #38.
Why this matters for frontier AI evaluation
ClawBench uses dangerous-shell matches to score agent trajectories. Missing a destructive working-tree command understates safety violations and makes comparisons between frontier AI agents less reliable. This patch keeps the correction deliberately narrow so it improves signal quality without expanding the matcher into quoted documentation examples.
Changes
--Tests
python -m pytest -qpasses locally — 319 passed, 5 skippedpython -m ruff check clawbench app.py scripts testspasses locallyAI assistance and public-source provenance
This contribution used significant OpenAI Codex assistance. I manually scoped the change, validated the root cause, ran the complete test/lint/pre-commit gate, and reviewed the final two-file diff. The work used only the public repository and synthetic filenames. No private code, data, product plans, prompts, internal architecture, or proprietary examples were used.