feat(audit): T2 security department — prompt, registry flip, validate CLI, artifact contract - #26
Conversation
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
|
Warning Review limit reached
Next review available in: 17 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (12)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
security flips to enabled:true in departments.v1.json with its prompt at orchestration/audit/prompts/security.md (adapted from Fuck_My_Shit_Mountain, MIT). New `code-intel audit --operation validate|render` CLI (audit_report/cli.rs) validates a report against the department registry or renders its markdown section. Audit reports are now a registered artifact (code-intel-audit-report.v1 / diagnosis.audit) in artifact_ref.rs. Toolchain digest for the changed prompt refreshed in integrations.json.
0c6254a to
76b7eca
Compare
|
@coderabbitai review |
✅ Action performedReview finished.
|
Closes #19. Part of the audit layer map #17.
Stacked on #24 (
feat/audit-kernel-t1) — the T1 kernel is not onmainyet, so this PR targets that branch. Review the last commit only; rebase ontomainonce #24 lands.What
The first audit department. The kernel was built so a department is a prompt plus a registry flag — that held: no kernel change was needed.
orchestration/audit/prompts/security.md— the department prompt, adapted from Fuck_My_Shit_Mountainprompts/security-audit.md(MIT, attributed). Rewritten for this pipeline: threat-model-first (a local CLI that parses untrusted repositories does not get TLS findings), evidence sourced from modalities (xraysweep,cthotspot ordering,anatomyboundaries,chartfor false-positive suppression) with tool hits treated as leads that a targeted read must confirm, and output bound to the fail-closedcode-intel-audit-report.v1contract. Secrets red line:redacted: true, path and variable name only, never the value.orchestration/audit/departments.v1.json—securityflipped toenabled: true(its prompt now exists, so the registry's enabled-requires-prompt rule passes).ai-safetyandsupply-chainstay disabled.code-intel audit --operation validate|render(crates/code-intel-cli/src/audit_report/cli.rs) —validateparses a report, loads and validates the registry, runs the kernel's fail-closed invariants, and prints a one-line JSON verdict;renderprints the hospital.md audit section. Registered through the existingRAW_ROUTEStable, no new dependencies.crates/code-intel-cli/src/artifact_ref.rs—(code-intel-audit-report.v1, diagnosis.audit)contract pair so an audit report can be carried as a first-class Artifact Ref. The payload validator is structural only; registry-level validation needs a repo root, which payload validators do not get, so that stays with the CLI.securityasnot_assessedinstead ofdisabled(valid under rules (c), (d), (e), (i) together).docs/audit-report.md; CHANGELOG entry.Dogfood: the department audited this repository
Not a fixture — the real CLI over the real tree, and the point of the whole design (tool-level evidence plus model judgment, which a prompt-only auditor cannot do):
The sweep covered all 22
Command::newsites, all 11 environment reads, and artifact path handling. What it found:security-001, low/suspected): thecmd.exe /d /cwrapper for.cmd/.batprovider tools passes the tool path as an argument cmd.exe re-parses, and because the spawned program iscmd.exerather than the batch file, Rust's batch-file argument quoting does not apply. Precondition is operator control ofoptions.toolPathPrefix, not scanned-repository content — hence low, not high.Command::new("rg")with.current_dir(target)looked like a Windows current-directory program-search hijack. A scanned repository containingrg.exeandrg.batdecoys did not divert execution. Recorded in the coverage matrix as inspected evidence rather than reported as a finding.env_remove("RIPGREP_CONFIG_PATH")against ripgrep config injection, and traversal-segment rejection on artifact paths.Coverage is honestly
medium, nothigh— provider HTTP surfaces, PowerShell compatibility entry points, and parser fuzzing were out of scope, and the exclusions say so. Underrubrics/scoring.mdthat ceiling is what keeps the score at 8.0 instead of a clean-looking 10.Verification
cargo test -p code-intel --bin code-intel audit: 46 passed, 0 failed (39 before this PR).--test audit_report --test hospital_diagnosis --test artifact_ref: 9 + 5 + 9, 0 failed.cargo fmt --all --checkclean;cargo test --no-runcompiles every binary.test-atomic-capability-contract.ps1:"ok": true(theartifact_ref.rstoolchain digest inintegrations.jsonwas refreshed surgically — 3 lines).Quality 3971 -> 3973,Coupling 44.78 -> 44.59,Cycles 0 -> 0,God files 29 -> 29, No degradation detected.