Harden project quality command policy - #23
Conversation
|
@coderabbitai review |
📝 WalkthroughWalkthroughThe PR hardens Git and Terraform quality-check validation, disables configurable Git execution behaviors, replaces mutable-tag doctor commands with the local CLI, and adds a published security policy with related documentation and tests. ChangesQuality Check Security Hardening
Local Doctor and Security Policy Distribution
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant QualityConfig
participant validateCommand
participant validateGitCommand
participant runCheck
participant Git
QualityConfig->>validateCommand: submit Git or Terraform quality check
validateCommand->>validateGitCommand: validate Git subcommand and arguments
validateCommand-->>QualityConfig: allow or reject command
QualityConfig->>runCheck: execute approved check
runCheck->>Git: apply hardened environment and run inspection
Git-->>runCheck: return inspection result
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
✅ Action performedReview finished.
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
@coderabbitai full review |
✅ Action performedFull review finished. Your included review limit is currently reached under our Fair Usage Limits Policy. Your recent PR review activity is in the 95th percentile or higher among CodeRabbit users, so adaptive limits apply. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 25 minutes. |
|
@coderabbitai full review |
✅ Action performedFull review finished. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@test/agent-stack.test.mjs`:
- Around line 1746-1800: Strengthen both policy test matrices in
test/agent-stack.test.mjs:1746-1800 and test/agent-stack.test.mjs:1835-1856 by
associating each rejected argv with its expected Git or Terraform policy message
and asserting that message with assert.match instead of only checking a
non-empty error list. In the Git matrix, add a validateConfig(config, target)
case covering the projectArgumentSafe projectFile-containment branch; preserve
the existing rejection cases while ensuring each failure is attributed to the
intended rule.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: cca4394b-198a-4a91-bee3-560bd207fc8d
📒 Files selected for processing (14)
.codex-plugin/plugin.jsonCHANGELOG.mdREADME.mdSECURITY.mdSTARTER_PROMPT.mdassets/project-template/AGENTS.mdbin/ultimate-agent-stack.mjsdocs/OPERATING_MANUAL.mddocs/TRUST.mdpackage.jsonskills/run-autonomous-delivery/SKILL.mdskills/setup-autonomous-project/SKILL.mdtest/agent-stack.test.mjstest/maintenance.test.mjs
|
@coderabbitai review |
✅ Action performedReview finished.
|
Summary
@latestcodeRoot cause
The previous validator allowed a nominally read-only Git subcommand without constraining its options or inherited environment. Options such as
git diff --no-index --output=...could therefore create or truncate files outside the project.Verification
npm run release:check— 84 tests, package dry-run, and packed smoke passednpx -y markdownlint-cli2@0.18.1 "**/*.md"— 50 files passedgit diff --checkpassedUpgrade impact
Custom Git checks must use the documented bounded inspection forms, including
--no-ext-diffand--no-textconvwhere required. Terraform formatting checks must useterraform fmt -check. Existing customized checks that fall outside this policy require explicit replacement and reapproval.Summary by CodeRabbit
doctorcommand entrypoint.SECURITY.mdin published packages.