Status:
accepted v0.2 — body sourced from TriGraph spec entity. Docs-mirror file added by docs lane to surface ratified specs that lacked an on-disk mirror.SPEC-077: Canonical Boot + Governance Resolution
SPEC-077 — Canonical Boot + Governance Resolution v0.2
Plan: #10 — Governance Foundation Implementation Wave: 1 (P0) Blocker: #1 of 6 Sealing order: AFTER ADR #45 v0.2 (now ADR #47, supersedes #45) per Plan #10 v0.2 amendment 1 Authored: Donna, 2026-05-04 v0.2 changelog: folds Texid15c8380 7 binding amendments + 2 nits + cross-blocker shared-definition-reference.
Status
Draft (v0.2 awaiting Texi re-review for Donna ratification)Shared definitions
This SPEC consumes the shared term table defined in ADR #47 v0.2 §“Shared definitions” (the v0.2 of ADR #45). Terms used herein: governance layer, authority-bearing, routing-authority, governance authority, mandatory guardrail, runtime override, effective source, feature flag.1. Problem (unchanged from v0.1)
The boot contract distinguishes static editor-loaded context from live runtime initialization. Existing ring-precedence text in CLAUDE.md / AGENTS.md + governance file locations + env-block +prism_start lack a single source-of-truth specification. This SPEC consolidates that.
2. Locked boot model (unchanged from v0.1)
Per Candi research §“Agreement 1”:- Agent surface loads static BIOS at launch (Codex:
AGENTS.md; Claude Code:CLAUDE.md). - Static BIOS instructs the agent to call
prism_start. prism_startis the first Prism runtime / tool action.prism_startreturns the effective live context + boot report.- The first substantive human-visible response displays a status / boot card.
3. Governance layers (5)
Per ADR #47 v0.2 §1 — narrowest-wins across 5 layers (global / tenant / org / project / user-session-runtime). Project PRISM.md is PO-owned. Mandatory guardrails are file-level frontmatter (per ADR #47 v0.2 §3); user/session/runtime is bounded to operational/transient scope (per ADR #47 v0.2 §2).4. Per-layer state classification (5-state)
Per Lafonda v0.2 §6 + Plan #10 v0.2 amendment 5 + Texid15c8380 SPEC-077 amendment 4:
skipped is reserved; only emit it when an explicit opt-out env/flag is set. Missing files → missing, never skipped (Texi v0.2 amendment 4).
5. ORG.md discovery
Consumes ADR #47 v0.2 §4 directly.prism_start.governance.layers.org.repo_local_used: true|false reports whether repo-local override was used; mandatory canonical ORG cannot be bypassed.
6. PRISM_GLOBAL.md source policy (Texi d15c8380 SPEC-077 nit 2)
On first install:
- If
$PRISM_ROOT/templates/PRISM_GLOBAL.mdis present AND schema_version-compatible → copy template to governance root. - Else → create empty schema-compatible stub.
copied_templatevscreated_stub- Source hash + version when
copied_template(Texi nit 2):template_source_hash(sha256),template_source_version(schema_version of source) - Schema mismatch fallback reason (if applicable)
PRISM_GLOBAL.md without explicit force=true flag.
7. prism_start response shape (Texi d15c8380 SPEC-077 amendments 1, 3 — folded)
Default-off invariant resolution (amendment 1): when PRISM_GOVERNANCE_RESOLVER_ENABLED=false, the existing prism_start response shape and existing status card remain UNCHANGED. The governance block is OMITTED entirely. The gov:<summary> status-card field is rendered only when the flag is on.
When flag is ON, response gains a governance block:
8. Status card field split (Texi d15c8380 SPEC-077 amendments 1, 2 — folded)
When PRISM_GOVERNANCE_RESOLVER_ENABLED=on, status card adds gov:<summary> field:
gov: field). No fallback gov:off rendering — the field is simply absent.
<summary> shape (when flag on):
gov:N/M ok— N of M file-bearing layers infound_nonemptyorfound_empty_stub, noneinvalidgov:N/M warn— at least one file-bearing layermissingorskipped, noneinvalidgov:invalid— at least one layerinvalid— OPERATOR ATTENTIONgov:offline— governance layer cannot be resolved (offline mode)
governance.user_session_runtime); not counted in M because it is not a static file layer.
Detail-only fields (NOT in card; available in prism_start JSON governance block): layout, governance_root, all slugs, per-layer paths, BIOS source, source hashes, schema versions, mandatory_guardrails array, conflicts array, user_session_runtime sub-block, invalid/missing reasons, offline fallback details.
9. Stub frontmatter contract (unchanged from v0.1)
10. Layout detection / collision handling (unchanged from v0.1)
Per Lafonda v0.2 §5 + ADR #47 v0.2 §5. Explicit-wins → both-detected ambiguity-stops → installer-first-run-defaults-sibling-projects → runtime-resolver-no-silent-pick.11. Engineering inventory (Texi d15c8380 SPEC-077 nit 1 — module-neutral)
(Spec language kept module-neutral per Texi nit 1; exact backend module name verified during implementation.)
12. Acceptance criteria (Texi d15c8380 SPEC-077 amendment 6 — tests added)
prism_install_localreports layout + governance_root + per-layer creation results (4-bucket idempotency report per Lafonda v0.2 §4).- With flag ON:
prism_startresponse includesgovernanceblock per §7; status card displaysgov:N/M <state>per §8 with M=4. - Per-layer state classification matches §4 across 4 file-bearing layers; user/session/runtime reported separately.
- Dual ORG sources: when both
$PROJECT_ROOT/ORG.mdand repo-local./ORG.mdexist, response reports the conflict + identifies effective source. - PRISM_GLOBAL.md source policy: fresh install with schema-compatible template →
copied_template+template_source_hash+template_source_version. Without template →created_stub. Existing PRISM_GLOBAL.md never overwritten withoutforce=true. - Status card field split: card shows compact summary; detail-only fields ONLY in
prism_startJSON, never in card text. - Porsche measurement gate: boot-correctness panel shows per-layer state distribution + mandatory-guardrail counts BEFORE flag flips default-on.
- NEW TESTS (Texi v0.2 amendment 6):
- Invalid frontmatter test: layer file with bad
schema_version→ state=invalid;prism_start.governance.conflictscontains entry withkind=invalid_frontmatter. - Dual ORG with mandatory canonical test: canonical ORG marked
mandatory: true+ repo-local ORG present → canonical wins; conflict reported withwinner=broader, rationale=mandatory_guardrail. - Layout collision test: both
.prism-governance/andgovernance/present, no env override → installer + resolver fail-fast with structured error listing collisions. - Feature flag OFF inertness test: with
PRISM_GOVERNANCE_RESOLVER_ENABLED=false, response shape EXACTLY matches pre-SPEC-077 shape (nogovernanceblock, nogov:in card). - Feature flag ON compact summary test: with flag on, status card includes
gov:N/M <state>matchinggovernance.summaryfield.
- Invalid frontmatter test: layer file with bad
13. Feature flag (Texi d15c8380 SPEC-077 amendment 5 — folded)
Per Plan #10 v0.2 §4 strict policy + cross-blocker amendment 2 (mirrored shape):
- Flag name:
PRISM_GOVERNANCE_RESOLVER_ENABLED - Default:
false(off) - Owner: Donna (engineering) until SPEC ratifies; Donna PO post-ratification
- Operator-visible state: when ON,
prism_start.governance.resolver_enabled: true+ dashboard panel; when OFF, nogovernanceblock (visibility from absence) - Default-off invariant: when flag is off,
prism_startreturns existing response shape; status card unchanged; existing flows behaviorally unchanged. NO shadow-mode telemetry — telemetry consumes the same response field, so when flag off, no telemetry is generated. Porsche measurement panels source from on-flag deployments only; default-off measurement gate evaluates panel after operator flips on in test environment first. - Default-off tests: see §12 amendment 6 — invariance test required before merge.
- Rollback instructions: unset env var → resolver returns to current behavior; no schema changes to roll back; dashboard panel hides.
- Shadow mode: NO (Texi amendment 5). Resolver does NOT run when flag off. If shadow telemetry is needed later, define in a follow-up SPEC.
14. Out of scope (deferred to other Wave 1 blockers — clarified per Texi d15c8380 SPEC-077 amendment 7)
- Layer precedence + override semantics in detail → ADR #47 v0.2 (Blocker #2)
- Identity / persona / specialization field model → ADR #46 / #48 (Blocker #3)
- Memory-domain-aware recall → Wave 2 Blocker #5
- Tri-graph governance recall → Wave 3 Blocker #6
- Method fragments → Wave 2 Blocker #4
15. Cross-references
- ADR #47 v0.2 — Layer Precedence + Override Semantics (this SPEC consumes; supersedes ADR #45)
- ADR #46/#48 v0.2 — Persona / Identity / Specialization Field Model (orthogonal; same Wave 1)
- Plan #10 v0.2 (
prism_plannumber=10, IDd23a0b0d) - Lafonda install plan v0.2
- Candi research §“Agreement 1, 2”
- Candi
3bb3d70d(3 governance-input answers folded) - Texi
e215ed87+fe4cbb13+d15c8380(architectural reviews; v0.2 folds d15c8380) - SPEC-021 (extended/superseded only on boot-card/governance-reporting per §14)
- SPEC-031 (Session lifecycle —
prism_statuspayload basis; no change) - ADR #16 (BIOS sync gate — adjacent; no change)
16. Authority
Donna authored under Plan #10 PO authority per operating contract rule 1. Texi reviewed v0.1 (d15c8380) with binding amendments; v0.2 folds them. Donna ratifies per Ring authority. Sealing AFTER ADR #47 per Plan #10 v0.2 amendment 1.
