Repository navigation
harden(filters): match_output unless guards + strip-pattern narrowing (#100 G8) - #103
Merged
Merged
Conversation
) Audit group G8 of #100 — TOML filter configs + test harness. Finding 1: add `unless` guards to 8 match_output filters that could short-circuit a failing run to a success message. Each guard is case-insensitive ((?i)) and tailored to the tool's failure vocabulary, with a new inline test proving a failure-containing input is not swallowed: - brew-install: (?i)\berror[: ]|\bfailed\b|\bfatal\b|cannot install (warning excluded — benign "Warning: already installed") - bundle-install: (?i)\berror\b|\bwarning\b|\bfailed\b|\bfatal\b|could not find|conflict - composer-install: (?i)\berror\b|\bwarning\b|\bfailed\b|\bfatal\b|your requirements could not be resolved|deprecated - dotnet-build: (?i)\bwarning [A-Z]+\d|\berror [A-Z]+\d|build failed|\bfatal\b - poetry-install: (?i)\berror\b|\bwarning\b|\bfailed\b|\bfatal\b|could not|version solving failed - quarto-render: (?i)\berror\b|\bwarning\b|\bfailed\b|\bfatal\b|caused by: - tofu-validate: (?i)\berror[: ]|\bwarning[: ]|\bfailed\b|\bfatal\b - uv-sync: (?i)\berror[: ]|\bwarning[: ]|\bfailed\b|\bfatal\b|no solution found Finding 2: narrow over-broad strip patterns so a warnings-only run is not mistaken for clean. - oxlint: strip only the all-clear summary ("Found 0 warnings and 0 errors"); non-zero warning summary now survives. - helm: narrow "^W\d{4}" to the full glog format ("^W\d{4} \d{2}:\d{2}:\d{2}") so a real warning line beginning with W+digits is not eaten. Finding 3: cloud_hardening.rs used a shared cc-hardening-<pid>.sqlite DB across all tests (order-dependence risk). Each run_cc invocation now gets its own tempfile::TempDir-backed RTK_DB_PATH. Finding 4 (NICE): gradle/pio-run/tofu-plan/xcodebuild on_empty can fire on a crash with no stdout. The TOML schema has no exit-code field and the engine only sees output text, so this cannot be gated without an engine change (out of scope). Limitation documented inline in each file. No filter count change (edits to existing files only). Engine (toml_filter.rs) untouched. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
8 tasks
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
Fixes the G8 (TOML filter configs + test harness) findings from audit #100. Codex-reviewed — clean, no findings.
Findings fixed
match_outputfilters (brew-install,bundle-install,composer-install,dotnet-build,poetry-install,quarto-render,tofu-validate,uv-sync) — added a case-insensitiveunlessguard so a failure-containing run is not short-circuited to the success message. Each tailored to the tool's failure vocabulary; each got a new inline[[tests.*]]failure case. (brew-installdeliberately excludes the wordwarning— brew prints a benignWarning: <pkg> is already installedon the success path;Error:still blocks.)oxlint.toml/helm.toml— narrowedstrip_lines_matchingso real warning-summary lines survive (only the all-clear noise is stripped).tests/cloud_hardening.rs— per-invocation tempRTK_DB_PATH, replacing the sharedcc-hardening-<pid>.sqlite(removes order-dependence).Filter engine (
toml_filter.rs) untouched — config + test edits only.Test plan
cargo test --workspace— 2293 pass, 0 failcontextcrawler verify— 156/156 inline filter tests passcargo build --releasecleanPart of the #100 audit.
🤖 Generated with Claude Code