-
Notifications
You must be signed in to change notification settings - Fork 1
docs: add CAC PR-ready enforcement prompt #22312
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,120 @@ | ||||||||||||||||||||||||||||
| # CAC Enforcement Prompt — Drift-Proof, Merge-Ready | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| ## Operating Mode | ||||||||||||||||||||||||||||
| You are implementing inside Summit. CAC already exists. Do not redesign. | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| Your only valid output is **mergeable patches** that enforce CAC. | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| ## Non-Negotiable Contract | ||||||||||||||||||||||||||||
| - Output at most **7 PRs** and at least **1 PR**. | ||||||||||||||||||||||||||||
| - Every PR is atomic, independently mergeable, and CI-passable. | ||||||||||||||||||||||||||||
| - No placeholders, no pseudocode, no TODOs, no mock-only enforcement. | ||||||||||||||||||||||||||||
| - Every referenced path must already exist or be created in the patch. | ||||||||||||||||||||||||||||
| - Every config must parse and execute in CI. | ||||||||||||||||||||||||||||
| - If uncertain, choose the smallest runnable implementation. | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| ## Hard Failure Rules | ||||||||||||||||||||||||||||
| If any of the following is missing, treat output as invalid: | ||||||||||||||||||||||||||||
| 1. Required evidence artifacts are absent. | ||||||||||||||||||||||||||||
| 2. Determinism check does not byte-compare regenerated artifacts. | ||||||||||||||||||||||||||||
| 3. CAC verdict is missing, false, or not explicitly `admissible: true`. | ||||||||||||||||||||||||||||
| 4. Branch protection drift sentinel does not verify CAC required check presence. | ||||||||||||||||||||||||||||
| 5. K8s admission policy does not deny on invalid or missing verdict. | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| ## Required Deliverable Format | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| ### 1) PR Stack Plan (exact block) | ||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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
|
||||||||||||||||||||||||||||
| ```id="prstack" | ||||||||||||||||||||||||||||
| /PR-1: evidence-contract | ||||||||||||||||||||||||||||
| /PR-2: cen-engine | ||||||||||||||||||||||||||||
| /PR-3: ci-gate | ||||||||||||||||||||||||||||
| /PR-4: k8s-enforcement | ||||||||||||||||||||||||||||
| /PR-5: ingestion-gate | ||||||||||||||||||||||||||||
| /PR-6: audit-ledger | ||||||||||||||||||||||||||||
| /PR-7: integration-glue | ||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| For each PR include: | ||||||||||||||||||||||||||||
| - Purpose | ||||||||||||||||||||||||||||
| - Files changed | ||||||||||||||||||||||||||||
| - Risk level (low/medium/high) | ||||||||||||||||||||||||||||
| - Rollback strategy (exact commands or commit revert strategy) | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| ### 2) Patches (mandatory) | ||||||||||||||||||||||||||||
| For each PR provide: | ||||||||||||||||||||||||||||
| - File tree | ||||||||||||||||||||||||||||
| - Full file contents (not snippets) | ||||||||||||||||||||||||||||
| - Exact repo-relative paths | ||||||||||||||||||||||||||||
| - Exact validation commands | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| ### 3) CI Integration (mandatory) | ||||||||||||||||||||||||||||
| Wire CAC gate as a **required** CI check. Pipeline must fail on: | ||||||||||||||||||||||||||||
| - missing evidence | ||||||||||||||||||||||||||||
| - hash mismatch | ||||||||||||||||||||||||||||
| - `admissible != true` | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| ### 4) Determinism Script (mandatory) | ||||||||||||||||||||||||||||
| Implement: | ||||||||||||||||||||||||||||
| - `/scripts/verify_determinism.mjs` | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| Script requirements: | ||||||||||||||||||||||||||||
| - regenerate artifacts twice in clean temp dirs | ||||||||||||||||||||||||||||
| - normalize line endings where needed | ||||||||||||||||||||||||||||
| - byte-compare outputs | ||||||||||||||||||||||||||||
| - exit non-zero on mismatch with actionable error | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| ### 5) Drift Sentinel Extension (mandatory) | ||||||||||||||||||||||||||||
| Extend: | ||||||||||||||||||||||||||||
| - `/scripts/check_branch_protection_drift.mjs` | ||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The prompt tells implementers to extend Useful? React with 👍 / 👎. |
||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| Must validate: | ||||||||||||||||||||||||||||
| - CAC check exists in required checks list | ||||||||||||||||||||||||||||
| - check is required for protected branches | ||||||||||||||||||||||||||||
| - fail CI when missing | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| ### 6) Kubernetes Enforcement (mandatory) | ||||||||||||||||||||||||||||
| Provide valid Kyverno policy: | ||||||||||||||||||||||||||||
| - deny admission when CAC verdict missing | ||||||||||||||||||||||||||||
| - deny admission when verdict is false | ||||||||||||||||||||||||||||
| - enforcement mode must block (not audit-only) | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| ### 7) Ingestion Gate (mandatory) | ||||||||||||||||||||||||||||
| Implement: | ||||||||||||||||||||||||||||
| - `/apps/ingestion/validator.ts` | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| Must: | ||||||||||||||||||||||||||||
| - validate schema | ||||||||||||||||||||||||||||
| - hash canonical input | ||||||||||||||||||||||||||||
| - reject duplicates | ||||||||||||||||||||||||||||
| - return structured typed errors | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| ### 8) Executable Tests (mandatory) | ||||||||||||||||||||||||||||
| Create: | ||||||||||||||||||||||||||||
| - `/tests/cac/pass.test.ts` | ||||||||||||||||||||||||||||
| - `/tests/cac/nondeterminism.test.ts` | ||||||||||||||||||||||||||||
| - `/tests/cac/poisoning.test.ts` | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| Tests must assert failure-first behavior: | ||||||||||||||||||||||||||||
| - no evidence => fail | ||||||||||||||||||||||||||||
| - nondeterministic artifacts => fail | ||||||||||||||||||||||||||||
| - poisoned/invalid verdict => fail | ||||||||||||||||||||||||||||
| - valid evidence + admissible true => pass | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| ## Implementation Bias | ||||||||||||||||||||||||||||
| - Prefer existing Node.js/TypeScript repo patterns. | ||||||||||||||||||||||||||||
| - Reuse existing dependencies unless strictly necessary. | ||||||||||||||||||||||||||||
| - Minimize scope and avoid framework churn. | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| ## Forbidden Output Patterns | ||||||||||||||||||||||||||||
| - Architecture essays | ||||||||||||||||||||||||||||
| - Future-state redesigns | ||||||||||||||||||||||||||||
| - "Example" files | ||||||||||||||||||||||||||||
| - Untested abstractions | ||||||||||||||||||||||||||||
| - Optional gates for required controls | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| ## 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. | ||||||||||||||||||||||||||||
|
Comment on lines
+115
to
+120
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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
|
||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This new prompt is not accompanied by a
prompts/registry.yamlentry, 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.tslines 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 👍 / 👎.