---
mode: CREATE
adr_id: ADR-0.0.37
branch: main
timestamp: "2026-05-31T00:03:57Z"
agent: claude-code
obpi_id: OBPI-0.0.37-11
session_id:
continues_from:
---

<!-- Handoff document for ADR-0.0.37 — created by claude-code at 2026-05-31T00:03:57Z -->

## Current State Summary

A return-to-health status request evolved into a deep diagnosis of the AGENTS.md
rendering system and a decision to extend ADR-0.0.37 to bear the density-dial CMS
vision (the structural remediation for emergency GHI #519). This session landed the
ADR-level work; the brief-authoring and implementation are the next phase.

Done this session:

- ADR-0.0.37 Decision extended with a new subsection, "Decision Extension
  (2026-05-30): CIC-1 Density-Dial Composition" — operator vision verbatim, the
  mechanism, the 0-Kelvin floor, and six OBPI descriptions.
- Checklist items 11-16 added; Decomposition Scorecard made coherent
  (`baseline_selected` 6 to 12, so `12 + split_total 4 = 16` final target).
- Six brief stubs created via `gz specify` (heavy for 11-15, lite for 16);
  brief count is 16, matching 16 checklist items (1:1 sync established).
- Registered; `uv run gz validate --documents` is green (exit 0).
- A full `uv run gz check` was launched at handoff time to confirm the harness is
  still green after the amendment; the resuming agent must confirm its result
  (see Verification Checklist).

The six new briefs are deterministic SCAFFOLDS. They intentionally fail
`uv run gz obpi validate --authored` until the semantic authoring pass. Nothing
is committed; all changes are in the working tree.

## Important Context

These are the facts that cost this session a large context budget to re-derive
from source. Read the named artifacts FIRST; do not reconstruct from code again.

- AGENTS.md is a RENDERED surface, not hand-authored. The authoritative doctrine is
  `docs/governance/agent-control-surface-rendering-substrate.md` (binding claim:
  every per-turn surface file is rendered from a canonical Pydantic content model
  via a Jinja2 template; nothing hand-authored at the rendered location). Read it
  before touching anything in the rendering chain.
- The LIVE render path today is the monolith: `sync_agents_md` calls
  `render_template("agents", ...)` in `src/gzkit/sync_surfaces.py`. The template
  `src/gzkit/templates/agents.md` is 100 percent hardcoded prose. The renderer
  passes `invariants` to Jinja2 but the template never references them, so the four
  entries in `.gzkit/invariants/` are orphan seeds projecting nothing.
- Two half-built "render-from-source" substrates exist for the same surface and
  NEITHER drives AGENTS.md: ADR-0.0.37's flat `ConstitutionalInvariant` plus
  `src/gzkit/governance/compose.py` (used only by `gz validate --invariant-coherence`
  and `gz governance render`), and ADR-0.0.34's `AgentContract`/`Pillar`/`Bullet`
  content model in `src/gzkit/content/models/agent_contract.py` (used only by the
  markdown parser, never to render). The extension reconciles them onto the
  AgentContract spine.
- `.gzkit/agents.local.md` (about 8.7k) is spliced raw into AGENTS.md via the
  `{local_content}` substitution slot; the hardcoded literals (`purpose`, `invariants`,
  etc.) live in `get_project_context` in `src/gzkit/sync_surfaces.py`. Both dissolve
  into model rows under OBPI-13.
- Scorecard arithmetic is enforced by `src/gzkit/core/scoring.py`:
  `final_target = baseline_selected + split_total`, splits capped at 4. That is why
  `baseline_selected` is 12 (12 + 4 = 16), not because the ADR intrinsically needed
  a baseline of 12.
- Codex loads `AGENTS.md` root-to-cwd, capped at `project_doc_max_bytes` (default
  32 KiB, no repo override). Root AGENTS.md is ~32,121 bytes (98 percent of the cap).
  That is the #519 magnitude; the per-vendor lite template (OBPI-15) is its relief.

## Decisions Made

- **Decision:** Extend ADR-0.0.37 (do not split, do not author a new ADR) to bear the
  density-dial CMS vision.
  **Rationale:** 0.0.37 already built the registry, renderer, and drift-gate skeleton;
  the substrate doctrine names AGENTS.md as the composition target.
  **Alternatives rejected:** a fresh `gz-design` ADR (the design is already authored in
  the substrate doctrine); finishing OBPI-09 as written (byte-preserving, cannot
  deliver the context reduction).
- **Decision:** `AgentContract` (ADR-0.0.34) is the single spine; the invariant
  registry becomes its foundation-classified subset.
  **Rationale:** richer model, already carries a vendor render pipeline and a `Bullet`
  primitive; the substrate doctrine names it.
  **Alternatives rejected:** growing the flat `ConstitutionalInvariant` into a parallel
  third substrate.
- **Decision:** The temperature dial has an absolute floor (operator: "we don't go to
  0 Kelvins"). `Judgment`-classified bullets render at every temperature; the dial
  thins only Mechanical and Reference prose.
  **Rationale:** judgment invariants are the anti-vibe floor that no gate enforces and
  the model must hold in-context.
  **Alternatives rejected:** a uniform density level that could drop a judgment bullet.
- **Decision:** Per-vendor templates (Codex lite, Claude standard) are in scope
  (OBPI-15); harness/model detection that auto-selects a template is a named
  forward-reference, not this pass.

## Immediate Next Steps

1. Author `docs/design/adr/foundation/ADR-0.0.37-constitutional-invariant-composition/obpis/OBPI-0.0.37-11-density-aware-master-model.md` via the `gz-obpi-specify` skill: quote the ADR section "Decision Extension (2026-05-30)" verbatim into Implementation Summary; ground Allowed Paths against `src/gzkit/content/models/` per the GHI #190 ground-truth check; add REQ `[kind]` tags; run `uv run gz obpi validate --authored <path>` until green.
2. Author OBPI-0.0.37-12 through -16 in order; 12-16 all depend on the OBPI-11 schema (`classification`, `witness`, `rationale_ref`, `density_min`, section `order`/`enabled`/`tier`).
3. Run `uv run gz check` and confirm exit 0 before any sync or commit.
4. Begin implementation with `uv run gz obpi pipeline OBPI-0.0.37-11`.

## Pending Work / Open Loops

- All six new briefs (11-16) are thin scaffolds; semantic authoring is pending for each.
- The ADR-0.0.37 amendment is uncommitted. Decide whether to commit the milestone before authoring begins.
- OBPI-0.0.37-09's brief still carries the original byte-preserving framing, now
  superseded by OBPI-13; reconcile OBPI-09 when OBPI-13 is authored.
- The CIC-2 brief-reconciliation half (OBPIs 04-08) is unrelated to this thread and was
  not touched; OBPIs 06-08 remain Draft.
- Emergency GHI #519 remains open; this extension is its remediation route, so the
  return-to-health plan's Decision line stays blocked until the route lands.
- The open-loop finding (capture-without-reinjection) logged in
  `.gzkit/insights/agent-insights.jsonl` is structurally addressed by OBPI-16
  (docs-for-agents orientation index); this handoff is the interim re-injection.

## Verification Checklist

- [ ] `uv run gz check` exits 0
- [ ] Branch matches: `git branch --show-current` returns `main`
- [ ] `uv run gz validate --documents` is green
- [ ] Brief count is 16: list the files under the ADR `obpis/` directory and count them
- [ ] `docs/governance/agent-control-surface-rendering-substrate.md` has been read before any edit to the rendering chain

## Evidence / Artifacts

- `docs/design/adr/foundation/ADR-0.0.37-constitutional-invariant-composition/ADR-0.0.37-constitutional-invariant-composition.md` — Decision Extension subsection, checklist 11-16, scorecard fix
- `docs/design/adr/foundation/ADR-0.0.37-constitutional-invariant-composition/obpis/OBPI-0.0.37-11-density-aware-master-model.md` — first authoring target (stub)
- `docs/design/adr/foundation/ADR-0.0.37-constitutional-invariant-composition/obpis/OBPI-0.0.37-12-temperature-renderer-templates.md` — stub
- `docs/design/adr/foundation/ADR-0.0.37-constitutional-invariant-composition/obpis/OBPI-0.0.37-13-reverse-parse-migration.md` — stub
- `docs/design/adr/foundation/ADR-0.0.37-constitutional-invariant-composition/obpis/OBPI-0.0.37-14-wire-sync-retire-monolith.md` — stub
- `docs/design/adr/foundation/ADR-0.0.37-constitutional-invariant-composition/obpis/OBPI-0.0.37-15-per-vendor-template-selection.md` — stub
- `docs/design/adr/foundation/ADR-0.0.37-constitutional-invariant-composition/obpis/OBPI-0.0.37-16-docs-for-agents-orientation-index.md` — stub
- `docs/governance/agent-control-surface-rendering-substrate.md` — authoritative substrate doctrine (read first)
- `src/gzkit/content/models/agent_contract.py` — AgentContract spine (currently skeletal)
- `src/gzkit/governance/compose.py` — current registry renderer, orphaned from sync
- `src/gzkit/sync_surfaces.py` — live monolith render path and `get_project_context` literals
- `src/gzkit/core/scoring.py` — scorecard arithmetic validator
- `.gzkit/insights/agent-insights.jsonl` — open-loop meta-insight from this session
- `docs/governance/return-to-health-plan-2026-05-30.md` — recovery plan, updated this session

## Environment State

Windows 11, branch `main`. All changes are in the working tree and uncommitted at
handoff time. A full `uv run gz check` was launched in the background at handoff
creation; its exit code must be read before commit or sync.
