PR Governance — Full PR Lifecycle
DITEMPA BUKAN DIBERI — Pull requests are the constitutional boundary where code, governance, and human judgment meet.
What This Skill Is
A unified PR lifecycle skill covering three layers:
- Policy Layer — risk-tier classification and required reviewer routing (who must approve)
- Checklist Layer — per-PR structural review of the diff itself (what to check)
- Pre-commit Gate — the "always run before commit" ritual with negative conformance testing
When to Use
- Any PR touching >1 file
- Any PR modifying contracts, schemas, or registries
- Any PR from an external contributor
- Any PR marked as "high risk" by the author
- Any PR marked
high or critical risk
- Any PR touching constitutional files
- Any PR with >100 changed files
- Any PR deleting files
- Before every git commit in any organ
- Before opening a PR, after a non-trivial feature lands
When NOT to Use
- Do NOT use for low-risk single-line docs fixes — over-process is entropy
- Do NOT use as a substitute for CI — CI runs first, this skill reads CI artifacts second
- Do NOT use to approve your own PR — F1 AMANAH + F13 SOVEREIGN prohibit self-seal
- Do NOT use to dismiss a security finding — escalate to
secret-safety-scan + 888_JUDGE
- Do NOT use to merge to main directly — merge is F13 SOVEREIGN unless branch protection enforces
§1. POLICY LAYER — Risk Tier & Reviewer Routing
Not all PRs are equal. Risk tier maps to required reviewer roles.
| Risk Tier |
Required Reviewers |
Judge Required? |
| low |
1 peer |
No |
| medium |
1 peer + 1 architect |
No |
| high |
2 peers + 1 auditor |
Yes (888_JUDGE) |
| critical |
All of above + Arif |
Yes |
Risk Classification
Classify PR risk based on:
- Files touched
- Lines changed
- Repos affected
- Authority boundaries crossed
Separation of Duties
- Author ≠ approver
- Engineer cannot self-seal
- Proposer ≠ final approver for high-risk
Block or Approve
| Condition |
Action |
| All required reviewers approved |
Merge allowed |
| Missing required reviewer |
Block with comment |
| Self-approval detected |
Block + escalate |
| Constitutional file changed |
Block + 888_JUDGE |
§2. CHECKLIST LAYER — Per-PR Review
Structural Checks
- Constitutional file detection — if F1/F13 files changed, cross-check with governance
- REPO= trailer in commit messages — verify presence
- Scope of change —
git diff --stat HEAD
- Test coverage — new code must have tests
- Documentation — public API changes must update docs
Code Quality Checks
- Is there a "code judo" move that would make this dramatically simpler?
- Does this improve or worsen the local architecture?
- Did the diff add branching complexity where a better abstraction should exist?
- Is this logic living in the right file and layer?
- Did this change enlarge a file past a healthy size boundary?
- Is the implementation direct and legible, or does it rely on special cases?
What to Flag Aggressively
- A complicated implementation where a cleaner reframing could delete whole categories of complexity
- A file crossing 1000 lines due to the PR
- New conditionals bolted onto unrelated code paths
- Feature-specific logic leaking into general-purpose modules
- Copy-pasted logic instead of extracted helpers
- Refactors that technically pass tests but make the code less modular
§3. PRE-COMMIT GATE — Always Run Before Commit
Steps
git -C /root/<organ> diff --stat HEAD — scope the change
- Per-organ checks (run in order; first failure aborts):
- Python organs (arifOS, GEOX, WEALTH, WELL):
ruff check, mypy (where configured), pytest -q
- Node organs (A-FORGE, AAA, APEX):
npm run lint, npm test, tsc --noEmit (A-FORGE/AAA only)
- F1 surface scan on diff → if hit, defer to
SURFACE-GATE (888 HOLD)
- Show diff summary + test result to user
- Wait for explicit "commit" or "abort"
Verification Loop
- All checks pass + user OK → commit
- Any fail → abort, surface to user with first failing line
- F1 surface hit → 888 HOLD via
SURFACE-GATE
Failure Modes
- Linter wrong version → use organ's pinned version from its
pyproject.toml / package.json
- Test flaky → re-run once; if still flaky, flag and ask user
- Diff too large (>500 lines) → suggest breaking into smaller commits
§4. NEGATIVE CONFORMANCE (WAJIB 1)
For every "must never happen" statement, there MUST be a test that would fail if the anti-pattern ever regressed.
The 18 must-never-happen tests
- Model cannot grant itself authority
- Executor cannot approve its own execution
- Unleased mutation fails closed
- Memory cannot be silently modified
- Evidence without provenance is rejected
- Confidence without uncertainty is rejected
- AAA cannot display a nonexistent SEAL
- Command success cannot equal outcome verification
- GEOX must preserve material alternative interpretations
- WEALTH must expose downside and irreversibility
- WELL cannot expose sensitive human data outside purpose
- VAULT999 cannot promote unsigned events to ground truth
- Tool count cannot be used as evidence of AGI
- Human approval cannot be simulated or inferred
- Delegated child cannot exceed parent authority
- Deferred action cannot run without fire-time judgment
- Agent-authored boot context cannot become policy without ratification
- Organ conflict cannot silently resolve through execution order
Implementation rule
For each WAJIB test not yet implemented, mark it as a strict expected failure in conformance/ directory. Do not skip — the absence is itself a violation.
test("WAJIB-2: forge_execute result cannot self-attest VERIFIED", () => {
assert.fail("xfail(strict): WAJIB 2 not implemented — see audit 2026-07-20");
});
Conformance directory structure
conformance/
├── kernel/
├── delegation/ (WAJIB 4)
├── execution/
├── verification/ (WAJIB 2)
├── memory/ (WAJIB 8)
├── organs/ (WAJIB 7)
└── deferred/ (WAJIB 5)
Escalation Path
| Condition |
Escalate To |
| Self-approval on high-risk PR |
arifOS 888_JUDGE |
| Constitutional file changed |
arifOS 888_JUDGE |
| Author disputes risk tier |
Arif |
| Security finding in diff |
secret-safety-scan + 888_JUDGE |
1---2name: pr-governance3id: pr-governance4version: 2.0.05description: >6 Full PR lifecycle: policy layer + checklist + pre-commit gate. High-level governance7 for pull request review ensuring separation of duties, required signers, and constitutional8 compliance before merge. Governed checklist for reviewing GitHub PRs. Pre-commit gate9 for any organ repo with negative conformance testing.10owner: AAA11risk_tier: high12autonomy_tier: T113floor_scope: [F1, F2, F4, F7, F9, F11, F13]14tags: [pr, review, governance, checklist, precommit, github, merge, separation-of-duties, conformance]15capability_tier: fed-reasoning-heavy16ecology_state: WARM17---1819# PR Governance — Full PR Lifecycle2021> **DITEMPA BUKAN DIBERI** — Pull requests are the constitutional boundary where code, governance, and human judgment meet.2223## What This Skill Is2425A unified PR lifecycle skill covering three layers:26271. **Policy Layer** — risk-tier classification and required reviewer routing (who must approve)282. **Checklist Layer** — per-PR structural review of the diff itself (what to check)293. **Pre-commit Gate** — the "always run before commit" ritual with negative conformance testing3031## When to Use3233- Any PR touching >1 file34- Any PR modifying contracts, schemas, or registries35- Any PR from an external contributor36- Any PR marked as "high risk" by the author37- Any PR marked `high` or `critical` risk38- Any PR touching constitutional files39- Any PR with >100 changed files40- Any PR deleting files41- Before every git commit in any organ42- Before opening a PR, after a non-trivial feature lands4344## When NOT to Use4546- **Do NOT use for low-risk single-line docs fixes** — over-process is entropy47- **Do NOT use as a substitute for CI** — CI runs first, this skill reads CI artifacts second48- **Do NOT use to approve your own PR** — F1 AMANAH + F13 SOVEREIGN prohibit self-seal49- **Do NOT use to dismiss a security finding** — escalate to `secret-safety-scan` + 888_JUDGE50- **Do NOT use to merge to main directly** — merge is F13 SOVEREIGN unless branch protection enforces5152## §1. POLICY LAYER — Risk Tier & Reviewer Routing5354Not all PRs are equal. Risk tier maps to required reviewer roles.5556| Risk Tier | Required Reviewers | Judge Required? |57|-----------|-------------------|-----------------|58| low | 1 peer | No |59| medium | 1 peer + 1 architect | No |60| high | 2 peers + 1 auditor | Yes (888_JUDGE) |61| critical | All of above + Arif | Yes |6263### Risk Classification6465Classify PR risk based on:66- Files touched67- Lines changed68- Repos affected69- Authority boundaries crossed7071### Separation of Duties7273- Author ≠ approver74- Engineer cannot self-seal75- Proposer ≠ final approver for high-risk7677### Block or Approve7879| Condition | Action |80|-----------|--------|81| All required reviewers approved | Merge allowed |82| Missing required reviewer | Block with comment |83| Self-approval detected | Block + escalate |84| Constitutional file changed | Block + 888_JUDGE |8586## §2. CHECKLIST LAYER — Per-PR Review8788### Structural Checks89901. **Constitutional file detection** — if F1/F13 files changed, cross-check with governance912. **REPO= trailer** in commit messages — verify presence923. **Scope of change** — `git diff --stat HEAD`934. **Test coverage** — new code must have tests945. **Documentation** — public API changes must update docs9596### Code Quality Checks9798- Is there a "code judo" move that would make this dramatically simpler?99- Does this improve or worsen the local architecture?100- Did the diff add branching complexity where a better abstraction should exist?101- Is this logic living in the right file and layer?102- Did this change enlarge a file past a healthy size boundary?103- Is the implementation direct and legible, or does it rely on special cases?104105### What to Flag Aggressively106107- A complicated implementation where a cleaner reframing could delete whole categories of complexity108- A file crossing 1000 lines due to the PR109- New conditionals bolted onto unrelated code paths110- Feature-specific logic leaking into general-purpose modules111- Copy-pasted logic instead of extracted helpers112- Refactors that technically pass tests but make the code less modular113114## §3. PRE-COMMIT GATE — Always Run Before Commit115116### Steps1171181. `git -C /root/<organ> diff --stat HEAD` — scope the change1192. Per-organ checks (run in order; first failure aborts):120 - **Python organs** (arifOS, GEOX, WEALTH, WELL): `ruff check`, `mypy` (where configured), `pytest -q`121 - **Node organs** (A-FORGE, AAA, APEX): `npm run lint`, `npm test`, `tsc --noEmit` (A-FORGE/AAA only)1223. F1 surface scan on diff → if hit, defer to `SURFACE-GATE` (888 HOLD)1234. Show diff summary + test result to user1245. Wait for explicit "commit" or "abort"125126### Verification Loop127128- All checks pass + user OK → commit129- Any fail → abort, surface to user with first failing line130- F1 surface hit → 888 HOLD via `SURFACE-GATE`131132### Failure Modes133134- Linter wrong version → use organ's pinned version from its `pyproject.toml` / `package.json`135- Test flaky → re-run once; if still flaky, flag and ask user136- Diff too large (>500 lines) → suggest breaking into smaller commits137138## §4. NEGATIVE CONFORMANCE (WAJIB 1)139140For every "must never happen" statement, there MUST be a test that *would* fail if the anti-pattern ever regressed.141142### The 18 must-never-happen tests1431441. Model cannot grant itself authority1452. Executor cannot approve its own execution1463. Unleased mutation fails closed1474. Memory cannot be silently modified1485. Evidence without provenance is rejected1496. Confidence without uncertainty is rejected1507. AAA cannot display a nonexistent SEAL1518. Command success cannot equal outcome verification1529. GEOX must preserve material alternative interpretations15310. WEALTH must expose downside and irreversibility15411. WELL cannot expose sensitive human data outside purpose15512. VAULT999 cannot promote unsigned events to ground truth15613. Tool count cannot be used as evidence of AGI15714. Human approval cannot be simulated or inferred15815. Delegated child cannot exceed parent authority15916. Deferred action cannot run without fire-time judgment16017. Agent-authored boot context cannot become policy without ratification16118. Organ conflict cannot silently resolve through execution order162163### Implementation rule164165For each WAJIB test not yet implemented, mark it as a strict expected failure in `conformance/` directory. Do not skip — the absence is itself a violation.166167```ts168test("WAJIB-2: forge_execute result cannot self-attest VERIFIED", () => {169 assert.fail("xfail(strict): WAJIB 2 not implemented — see audit 2026-07-20");170});171```172173### Conformance directory structure174175```176conformance/177├── kernel/178├── delegation/ (WAJIB 4)179├── execution/180├── verification/ (WAJIB 2)181├── memory/ (WAJIB 8)182├── organs/ (WAJIB 7)183└── deferred/ (WAJIB 5)184```185186## Escalation Path187188| Condition | Escalate To |189|-----------|-------------|190| Self-approval on high-risk PR | arifOS 888_JUDGE |191| Constitutional file changed | arifOS 888_JUDGE |192| Author disputes risk tier | Arif |193| Security finding in diff | `secret-safety-scan` + 888_JUDGE |