Verify the safe-version steer before printing it#104
Conversation
start_port + 50 panics in debug builds when the start port is above 65485 — the port-search test binds an ephemeral port and trips this whenever the OS hands out one near u16::MAX. Saturate instead.
Re-verdict each proposed '→ safe version' against vuln-api through the
existing verdict_pool before any output. A clean re-check prints the
steer; a flagged one prints '→ advertised fix {v} is also flagged — no
safe version to suggest'; a failed re-check suppresses the steer quietly
and never moves counts or exit codes. JSON 'remediation' now emits only
on a Verified steer. Proposals dedup by normalized (name, version) and
requests fire only when a vulnerable verdict exists with a token
configured.
There was a problem hiding this comment.
-
src/precheck/mod.rs:220/src/lib.rs:2: Addingpub steers: HashMap<(String, String), SteerCheck>toPrecheckReportis a source-breaking public API change.precheckis exported from the library (pub mod precheck), andPrecheckReportis a public struct with public fields, so any downstream Rust consumer or integration test constructingPrecheckReport { ... }now fails to compile unless it knows about this internal render-only cache. Impact: a patch/minor CLI release can break library consumers even though the new state is only needed while rendering. Fix: keep steer verification state out ofPrecheckReport's public shape, e.g. haveverify_steersreturn a localHashMap/sidecar passed intoprint_text,print_json,steer_for, andverdict_json, or introduce a constructor/builder as part of an intentional breaking API change. -
skills/corgea/SKILL.md:161: The documented JSON contract is now stale. It still says vulnerable verdictremediationis "the certified safe version, ornullwhen any advisory has no known fix," but the new renderer setsremediationtonullfor rejected and unverified steer re-checks too (src/precheck/mod.rs:975andsrc/precheck/mod.rs:982). Impact: agents or other machine consumers following this skill can misinterpretnullas "no known fixed version" even when every advisory did advertise a fix but the re-check failed or found that fix vulnerable. Fix: update the JSON documentation to state thatremediationis non-null only after the proposed fix re-verdicts clean, and isnullwhen no fix is known, the fix is also flagged, or the re-check cannot be verified.
Sent by Cursor Automation: pr-flow


What
The install gate steered blocked installs to the advisories'
fixed_versionwithout checking whether that version is itself flagged. Now every proposed→ safe versionis re-verdicted against vuln-api (through the existingverdict_pool) before anything prints:→ safe version: <name>@<version>prints, and JSONremediationcarries the version.→ advertised fix <v> is also flagged — no safe version to suggestprints; JSONremediationisnull.remediationisnull. Counts and exit codes never move —should_block_installis untouched.How
enum SteerCheck { Verified, Rejected, Unverified }andsteers: HashMap<(String, String), SteerCheck>onPrecheckReport, keyed by (normalized name, proposed version).verify_steers()runs once inrun_parsed_installafter the verdict/tree passes: collects proposals from named + transitive vulnerable verdicts, dedups by normalized (name, version), and sends requests only when a token is configured and at least one proposal exists.steer_for()resolves a proposal + check at render time; a missing map entry counts asUnverified(suppress).Tests
verify_steersmapping (clean/flagged/503 → Verified/Rejected/Unverified, named + transitive), tokenless no-op, no-proposal short-circuit, normalized-name dedup.tests/cli_remediation.rs): rejected fix prints the rejection note and keeps1 vulnerable, 0 unverifiable; 503 re-check suppresses the steer quietly with unchanged counts/exit; JSONremediationnull on rejection; existing verified-path tests still pass (stub default-clean re-check)../harness checkgreen (clippy strict, fmt, 259 tests, deps-skill drift).corgea npm install axios@0.21.0againstcve-worker-stagingblocks with exit 1 and prints→ safe version: axios@0.21.2(staging re-verdicts 0.21.2 clean).Notes
skills/corgea/SKILL.mdline ~158 ("remediation …nullwhen any advisory has no known fix") is now incomplete —nullalso means the fix was rejected or unverified. That paragraph belongs to another unit's section, so it is flagged here instead of edited.find_available_portoverflowedu16onstart_port + 50; the pre-commit hook's test run tripped it when the OS handed the test an ephemeral port above 65485. Saturating add.