feat(runner): add native built-in gate policy - #34
Conversation
422c7a3 to
b9605f9
Compare
|
Codex review: needs maintainer review before merge. Reviewed July 27, 2026, 11:33 AM ET / 15:33 UTC. ClawSweeper reviewWhat this changesThis PR adds opt-in native gate evaluation for the registered SkillSpector and Merge readinessKeep this draft PR open for normal member review. The proposed native policy is a new public profile/configuration surface and changes the embedded ClawHub profile defaults, so it needs an explicit compatibility and product-direction check rather than cleanup automation. Likely related people: jesse-merhi is the available low-confidence routing candidate from the proposed runner/profile work. Priority: P3 Review scores
Verification
How this fits togetherClawScan profiles resolve scanner selections and gate rules into registered scanner adapters. Scanner runs preserve raw JSON evidence, then gate evaluation records the strongest pass, warn, or block outcome in the run artifact and CLI summary. flowchart LR
A[Trusted profile] --> B[Profile resolver]
B --> C[Registered scanner adapters]
C --> D[Raw scanner JSON]
D --> E[Native and exit-code gate rules]
E --> F[Run artifact]
F --> G[CLI gate summary]
Decision needed
Why: The implementation is technically bounded, but changing shipped profile defaults can alter artifact verdicts consumed by existing operator workflows; that default belongs to maintainer product policy. Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep native policies narrowly limited to built-in adapters with stable raw-result contracts, document the changed ClawHub profile verdict behavior, and show fresh-profile plus upgrade-profile artifacts before merge. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR introduces a new native gate-policy mode rather than fixing a reported failure. The branch includes focused fixture coverage claims for the intended scanner-result matrix. Is this the best way to solve the issue? Unclear: the runner design is narrowly aligned with the repository's registered-adapter and raw-evidence rules, but enabling it by default in embedded profiles needs maintainer confirmation of the upgrade behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b3bab6b88d91. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
New behavior
Trusted profiles can now opt built-in SkillSpector and
clawscan-staticinto native gate policy without redefining either scanner as a command. ClawScan derivespass,warn, orblockfrom their unchanged raw JSON and does not require a judge.DO_NOT_INSTALLor anyCRITICALfinding blocks.HIGHfinding warns.clawscan-staticfinding warns and never blocks.clawhubprofiles now enable the shipped native policy.Profile and artifact proof
A built-in scanner reference can carry policy while remaining backed by the registered adapter:
The observable verdict matrix is:
passwarnblockblockclawscan-staticfinding, including high severitywarnFired native rules identify the matched recommendation or finding through
value,findingCode,findingTitle, andfindingSeverity. Existing exit-code rules retainexitCode. Raw scanner evidence is byte-identical with native policy on and off.How to verify
gateandgateRules.warn.Checks
go test -count=1 ./internal/profiles— passed.env TMPDIR=/private/tmp go test -count=1 ./...— passed.go vet ./...— passed.make docs-site— passed; no trackeddist/changes.Implementation notes
This deliberately does not add generic JSONPath/BYOS finding mappings. Command-defined scanners continue to participate through
blockOnExitCodeandwarnOnExitCode. Gate actions remain record-only and do not alter scan ordering, judge execution, or process exit status.