Skip to content

docs: add CAC PR-ready enforcement prompt#22312

Closed
BrianCLong wants to merge 1 commit intomainfrom
codex/implement-cac-enforcement-pipeline-in-prs
Closed

docs: add CAC PR-ready enforcement prompt#22312
BrianCLong wants to merge 1 commit intomainfrom
codex/implement-cac-enforcement-pipeline-in-prs

Conversation

@BrianCLong
Copy link
Copy Markdown
Owner

Motivation

  • Convert a design-oriented CAC guidance into a strict, merge-ready enforcement contract so automated agents must produce fully runnable, CI-passable patches (≤7 atomic PRs) and cannot output placeholders, pseudocode, or non-enforceable guidance.

Description

  • Add prompts/cac-pr-ready-enforcement.prompt.md, a hardened prompt that specifies the exact PR stack, required files/scripts (/scripts/verify_determinism.mjs, /scripts/check_branch_protection_drift.mjs, /apps/ingestion/validator.ts, Kyverno policy, test locations, CI gate requirements), failure conditions (missing evidence, nondeterminism, inadmissible verdicts), and the deliverable/validation format for downstream patch generation.

Testing

  • Verified the new file was created and its contents with wc -l prompts/cac-pr-ready-enforcement.prompt.md, sed -n '1,40p' prompts/cac-pr-ready-enforcement.prompt.md, and nl -ba prompts/cac-pr-ready-enforcement.prompt.md | sed -n '1,220p', and registered PR metadata via the repository PR tooling; these checks succeeded (no CI or lint runs were invoked as part of this change).

Codex Task

@BrianCLong BrianCLong added the codex Codex-owned implementation work label Mar 31, 2026 — with ChatGPT Codex Connector
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 31, 2026

Warning

Rate limit exceeded

@BrianCLong has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 10 minutes and 36 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 10 minutes and 36 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 01ef792c-c39f-44b8-b695-c36d5d1e93d3

📥 Commits

Reviewing files that changed from the base of the PR and between 12cad4a and f4782dc.

📒 Files selected for processing (1)
  • prompts/cac-pr-ready-enforcement.prompt.md
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/implement-cac-enforcement-pipeline-in-prs

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new prompt specification, 'CAC Enforcement Prompt — Drift-Proof, Merge-Ready', which defines strict requirements for an AI agent to generate mergeable patches for Compliance as Code (CAC) enforcement. The feedback identifies a contradiction in the PR stack plan requirements and suggests aligning the final completion gate with the previously defined hard failure rules to ensure all security controls are verified.


## Required Deliverable Format

### 1) PR Stack Plan (exact block)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The instruction 'exact block' for the PR Stack Plan contradicts the rule on line 9 which allows for a variable number of PRs ('at most 7 PRs and at least 1 PR'). If the agent determines that fewer than 7 PRs are needed, it will be unable to provide the 'exact block' as specified. Changing this to 'template' or 'suggested structure' allows the agent to adapt the plan to the actual work required.

Suggested change
### 1) PR Stack Plan (exact block)
### 1) PR Stack Plan (template)

Comment on lines +115 to +120
## Completion Gate
Task is complete only if all are true:
1. PR without evidence fails in CI.
2. Non-deterministic artifacts fail in CI.
3. Invalid CAC verdict is blocked at deploy/admission.
4. Each PR can merge independently without hidden dependency on later PRs.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The 'Completion Gate' criteria do not fully align with the 'Hard Failure Rules' defined earlier. Specifically, the requirement for the branch protection drift sentinel (Rule 4 on line 21) is missing from the final checklist. Including it ensures the agent verifies this critical security control before completing the task.

Suggested change
## Completion Gate
Task is complete only if all are true:
1. PR without evidence fails in CI.
2. Non-deterministic artifacts fail in CI.
3. Invalid CAC verdict is blocked at deploy/admission.
4. Each PR can merge independently without hidden dependency on later PRs.
## Completion Gate
Task is complete only if all are true:
1. PR without evidence fails in CI.
2. Non-deterministic artifacts fail in CI.
3. Invalid CAC verdict is blocked at deploy/admission.
4. Branch protection drift sentinel verifies CAC check presence.
5. Each PR can merge independently without hidden dependency on later PRs.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f4782dcada

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@@ -0,0 +1,120 @@
# CAC Enforcement Prompt — Drift-Proof, Merge-Ready
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Register this prompt in the immutable prompt registry

This new prompt is not accompanied by a prompts/registry.yaml entry, which makes it unusable in the governed agent flow because PR metadata validation resolves prompts strictly by hash and throws when the hash is missing (scripts/ci/validate-pr-metadata.ts lines 120-125). As written, any task that references this prompt cannot pass the required metadata/integrity checks until the prompt id/path/hash/scope are added to the registry.

Useful? React with 👍 / 👎.


### 5) Drift Sentinel Extension (mandatory)
Extend:
- `/scripts/check_branch_protection_drift.mjs`
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Target the CI-enforced branch-protection checker path

The prompt tells implementers to extend /scripts/check_branch_protection_drift.mjs, but the enforced gate and integration tests invoke scripts/ci/check_branch_protection_drift.mjs (see package.json ci:branch-protection:check and tests/integration/ci-gate.test.mjs). Following this instruction literally can place CAC-required-check logic in the wrapper script while leaving the actual CI sentinel unchanged, so the required protection check may never be enforced in CI.

Useful? React with 👍 / 👎.

@BrianCLong
Copy link
Copy Markdown
Owner Author

Closed as prompt/spec collateral, not executable golden-path work. Keep the executable enforcement lane on #22309.

@BrianCLong BrianCLong closed this Mar 31, 2026
auto-merge was automatically disabled March 31, 2026 19:25

Pull request was closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-merge codex Codex-owned implementation work risk:low

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant