---
id: OBPI-0.0.45-05-cli-mode-density-doctrine
parent: ADR-0.0.45-cli-mode-density-doctrine
item: 5
lane: Heavy
status: Draft
---

# OBPI-0.0.45-05-cli-mode-density-doctrine: Cli Mode Density Doctrine

## ADR Item

- **Source ADR:** `docs/design/adr/foundation/ADR-0.0.45-cli-mode-density-doctrine/ADR-0.0.45-cli-mode-density-doctrine.md`
- **Checklist Item:** #5 - "OBPI-0.0.45-05: **doctrine-landing** — `.claude/rules/cli.md` three-lane amendment; `docs/governance/advisory-rules-audit.md` scorecard promotion; `.gzkit/rules/governance-core.md` § Proof commands update; Heavy-lane behave smoke."

**Status:** Draft

## Objective

**doctrine-landing** — `.claude/rules/cli.md` three-lane amendment; `docs/governance/advisory-rules-audit.md` scorecard promotion; `.gzkit/rules/governance-core.md` § Proof commands update; Heavy-lane behave smoke.

## Lane

**Heavy** - This OBPI changes a command/API/schema/runtime contract surface.

> Heavy is reserved for command/API/schema/runtime-contract changes. Process,
> documentation, and template-only work stays Lite unless it changes one of
> those external surfaces.

## Allowed Paths

- `docs/design/adr/foundation/ADR-0.0.45-cli-mode-density-doctrine/ADR-0.0.45-cli-mode-density-doctrine.md` — parent ADR for intent and scope (read-only)
- `.gzkit/rules/cli.md` — canonical three-lane rule amendment (vendor mirror `.claude/rules/cli.md` regenerated by sync)
- `.gzkit/rules/governance-core.md` — proof-commands update
- `docs/governance/advisory-rules-audit.md` — scorecard promotion from advisory to mechanical
- `features/cli_mode_density.feature` — net-new behave smoke created by this OBPI
- `features/steps/cli_mode_density_steps.py` — net-new behave step bindings created by this OBPI
- `tests/governance/test_cli_mode_density_doctrine.py` — net-new unit test asserting the three-lane rule landed and the scorecard entry promoted

## Denied Paths

- Paths not listed in Allowed Paths
- New dependencies
- CI files, lockfiles

## OBPI creates these files

- `features/cli_mode_density.feature`
- `features/steps/cli_mode_density_steps.py`
- `tests/governance/test_cli_mode_density_doctrine.py`

## Requirements (FAIL-CLOSED)

1. REQ-0.0.45-05-01: `.gzkit/rules/cli.md` (canonical source) is amended with the three-lane rule replacement (Lite/Behavior Mode closed enum, Mode/Scope Selector subject to density check, Heavy/New Verb unchanged) and the rule version is bumped per `.claude/rules/skill-surface-sync.md`; `uv run gz agent sync control-surfaces` propagates the change to `.claude/rules/cli.md`.
1. REQ-0.0.45-05-02: `docs/governance/advisory-rules-audit.md` promotes the clig.dev baseline scorecard entry from advisory to "Promoted: Mechanical — enforced by `gz validate audit cli-flag-density`"; `gz validate --advisory-scorecard` passes after the edit.
1. REQ-0.0.45-05-03: `.gzkit/rules/governance-core.md` § Proof commands is updated to include `uv run gz validate suite cheap-fidelity` (replacing the prior `--<scope>` form); the rule version is bumped.
1. REQ-0.0.45-05-04: A Heavy-lane behave smoke at `features/cli_mode_density.feature` and `features/steps/cli_mode_density_steps.py` covers Green / Yellow / Red density-band scenarios and the suite-orphan-member scenario; `uv run -m behave features/cli_mode_density.feature` passes.
1. REQ-0.0.45-05-05: After the three-lane doctrine lands, `gz validate audit cli-flag-density` running against the current gzkit CLI surface either reports all verbs in Green band OR every Yellow / Red verb has a foundation-attested waiver entry with named `next_action`; the doctrine cannot be self-contradicting.
1. REQ-0.0.45-05-06: GHIs #471 (cure) and #472 (prophylaxis) are referenced in the closeout ceremony notes; the `ghi-close` skill (not this OBPI) closes them `superseded` on ADR-0.0.45 completion.

> STOP-on-BLOCKERS: if prerequisites are missing, print a BLOCKERS list and halt.

## Discovery Checklist

**Parent ADR (read first; order pinned — GHI #321):**

- [ ] **Parent ADR § Decision item — quote the line this OBPI implements** verbatim into the brief's Implementation Summary. The Decision item is the contract; everything else hangs off it.
- [ ] Parent ADR § Intent — the why-frame for the Decision read above.
- [ ] Parent ADR file: `docs/design/adr/foundation/ADR-0.0.45-cli-mode-density-doctrine/ADR-0.0.45-cli-mode-density-doctrine.md`

> **STOP:** If you cannot quote the parent ADR § Decision item that this OBPI implements, STOP and re-read. Do not proceed to Allowed Paths, Prerequisites, or implementation until the Decision quote is in hand.

**Governance (read once, cache):**

- [ ] `.github/discovery-index.json` - repo structure
- [ ] `AGENTS.md` or `CLAUDE.md` - agent operating contract

**Context:**

- [ ] Related OBPIs in same ADR

**Prerequisites (check existence, STOP if missing):**

- [ ] Required path exists or is intentionally created in this OBPI: `docs/design/adr/foundation/ADR-0.0.45-cli-mode-density-doctrine/ADR-0.0.45-cli-mode-density-doctrine.md`
- [ ] Required path exists or is intentionally created in this OBPI: `.claude/rules/cli.md`
- [ ] Parent ADR evidence artifacts referenced by this brief are present

**Existing Code (understand current state):**

- [ ] Test patterns: `tests/governance/test_cli_density_validators.py`
- [ ] Parent ADR integration points reviewed for local conventions

## Quality Gates

### Gate 1: ADR

- [ ] Intent and scope recorded in this OBPI brief
- [ ] Parent ADR checklist item quoted

### Gate 2: TDD (Red-Green-Refactor)

- [ ] Tests derived from brief acceptance criteria, not from implementation
- [ ] Red-Green-Refactor cycle followed per behavior increment
- [ ] Tests pass: `uv run gz test`
- [ ] Validation commands recorded in evidence with real outputs

### Code Quality

- [ ] Lint clean: `uv run gz lint`
- [ ] Type check clean: `uv run gz typecheck`

### Gate 3: Docs (Heavy only)

- [ ] Docs build: `uv run mkdocs build --strict`
- [ ] Relevant docs updated

### Gate 4: BDD (Heavy only)

- [ ] Acceptance scenarios pass: `uv run -m behave features/`

### Gate 5: Human (Heavy only)

- [ ] Human attestation recorded

## Verification

```bash
uv run gz validate --documents
uv run gz lint
uv run gz typecheck
uv run gz test

# Specific verification for this OBPI
test -f docs/design/adr/foundation/ADR-0.0.45-cli-mode-density-doctrine/ADR-0.0.45-cli-mode-density-doctrine.md
test -f .claude/rules/cli.md
test -f docs/governance/advisory-rules-audit.md
test -f .gzkit/rules/governance-core.md
test -f src/gzkit/cli/parser_validate.py
test -f src/gzkit/governance/trust_audits/cli_density_models.py
test -f src/gzkit/governance/trust_audits/cli_flag_density.py
test -f src/gzkit/governance/trust_audits/suite_density.py
uv run -m unittest tests/governance/test_cli_density_validators.py -v
uv run -m unittest tests/governance/test_cli_density_models.py -v
uv run -m unittest tests/cli/test_validate_suite_audit.py -v
uv run -m behave features/cli_mode_density.feature
test -f features/steps/cli_mode_density_steps.py
```

## Demo

```bash
# Replace with concrete product demonstrations for this OBPI.
```

## Acceptance Criteria

- [ ] REQ-0.0.45-05-01: Given `.gzkit/rules/cli.md` post-edit, when read, then the three-lane rule is present; the rule version is bumped; `gz agent sync control-surfaces` propagates to `.claude/rules/cli.md`.
- [ ] REQ-0.0.45-05-02: Given the post-edit `docs/governance/advisory-rules-audit.md`, when `gz validate --advisory-scorecard` runs, then it exits 0 and the clig.dev entry reads "Promoted: Mechanical".
- [ ] REQ-0.0.45-05-03: Given `.gzkit/rules/governance-core.md` post-edit, when read, then § Proof commands lists `uv run gz validate suite cheap-fidelity`; the rule version is bumped.
- [ ] REQ-0.0.45-05-04: Given the behave smoke at `features/cli_mode_density.feature`, when run, then Green / Yellow / Red and orphan-member scenarios all pass.
- [ ] REQ-0.0.45-05-05: Given the current gzkit CLI surface after doctrine landing, when `gz validate audit cli-flag-density` runs, then every flagged verb either Greens or has a foundation-attested waiver with named `next_action`.
- [ ] REQ-0.0.45-05-06: Given the closeout ceremony notes, when reviewed, then GHIs #471 and #472 are referenced; `ghi-close` performs the actual `superseded` close on ADR-0.0.45 completion (not this OBPI).

## Completion Checklist

- [ ] **Gate 1 (ADR):** Intent recorded in brief
- [ ] **Gate 2 (TDD):** RGR cycle followed, tests derived from brief, coverage maintained
- [ ] **Code Quality:** Lint, format, type checks clean
- [ ] **Value Narrative:** Problem-before vs capability-now is documented
- [ ] **Key Proof:** One concrete usage example is included
- [ ] **OBPI Acceptance:** Evidence recorded below

> For ceremony steps and lane-inheritance attestation rules, see `AGENTS.md` section `OBPI Acceptance Protocol`.

## Evidence

### Gate 1 (ADR)

- [ ] Intent and scope recorded

### Gate 2 (TDD — Red-Green-Refactor)

```text
# Paste test output here
```

### Code Quality

```text
# Paste lint/format/type check output here
```

### Gate 3 (Docs)

```text
# Paste docs-build output here when Gate 3 applies
```

### Gate 4 (BDD)

```text
# Paste behave output here when Gate 4 applies
```

### Gate 5 (Human)

```text
# Record attestation text here when required by parent lane
```

### Value Narrative

### Key Proof

### Implementation Summary

- Files created/modified:
- Tests added:
- Date completed:
- Attestation status:
- Defects noted:

## Tracked Defects

_No defects tracked._

## Human Attestation

- Attestor: `<name>` when required, otherwise `n/a`
- Attestation: substantive attestation text or `n/a`
- Date: YYYY-MM-DD or `n/a`

---

**Date Completed:** -

**Evidence Hash:** -
