<?xml version="1.0" encoding="utf-8"?>
<entry xmlns="http://www.w3.org/2005/Atom" xml:base="https://docs.spec-kitty.ai/plans/doctrine/org-doctrine-layer-architecture-review/">
  <id>https://docs.spec-kitty.ai/plans/doctrine/org-doctrine-layer-architecture-review/</id>
  <title>Org Doctrine Layer — Post-Implementation Architecture Review</title>
  <updated>2026-06-01T00:00:00.000Z</updated>
  <author><name>Spec Kitty</name></author>
  <link rel="alternate" type="text/html" href="https://docs.spec-kitty.ai/plans/doctrine/org-doctrine-layer-architecture-review/"/>
  <summary>Architect Alphonso&apos;s post-merge architecture review (2026-05-16) of the org doctrine layer: how the shipped design holds up and the follow-ups.</summary>
  <content type="html">&lt;span id=&quot;org-doctrine-layer--post-implementation-architecture-review&quot;&gt;&lt;/span&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Retired (deprecated).&lt;/strong&gt; Design shipped via the org-doctrine-layer three-layer model (all 8 layer-rule tests pass; PRs #305/#348; drivers #832/#883/#1013/#391). Preserved as a historical record.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;Author:&lt;/strong&gt; Architect Alphonso (post-merge architectural review)
&lt;strong&gt;Date:&lt;/strong&gt; 2026-05-16
&lt;strong&gt;Mission:&lt;/strong&gt; &lt;code dir=&quot;auto&quot;&gt;layered-doctrine-org-layer-01KRNPEE&lt;/code&gt; (display number 118)
&lt;strong&gt;Merge commit:&lt;/strong&gt; &lt;code dir=&quot;auto&quot;&gt;9c2c26a0&lt;/code&gt; (squash) on &lt;code dir=&quot;auto&quot;&gt;feat/org-doctrine-layer&lt;/code&gt;
&lt;strong&gt;Post-merge remediations:&lt;/strong&gt; &lt;code dir=&quot;auto&quot;&gt;e1d58d2f&lt;/code&gt; (HIGH-1 multi-pack iteration), &lt;code dir=&quot;auto&quot;&gt;86c103e2&lt;/code&gt; (HIGH-2 interview pre-fill wiring), &lt;code dir=&quot;auto&quot;&gt;b0f69231&lt;/code&gt; (MEDIUM-1 collision warnings + spec/code reconciliation), &lt;code dir=&quot;auto&quot;&gt;76c9f3b4&lt;/code&gt; (quality sweep on touched modules)
&lt;strong&gt;Related ADRs:&lt;/strong&gt; &lt;code dir=&quot;auto&quot;&gt;2026-03-27-1-pytestarch-architectural-dependency-testing.md&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;2026-05-16-1-doctrine-layer-merge-semantics.md&lt;/code&gt;
&lt;strong&gt;Related design predecessor:&lt;/strong&gt; &lt;a href=&quot;/plans/doctrine/layered-doctrine-resolution-design/&quot;&gt;layered-doctrine-resolution-design.md&lt;/a&gt; (the &lt;em&gt;intent&lt;/em&gt; blueprint, written 2026-05-15)
&lt;strong&gt;Related mission review:&lt;/strong&gt; &lt;a href=&quot;../../../kitty-specs/layered-doctrine-org-layer-01KRNPEE/mission-review-report.md&quot;&gt;mission-review-report.md&lt;/a&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&quot;scope-and-audience&quot;&gt;Scope and audience&lt;/h2&gt;
&lt;p&gt;This note is an architectural review of the org-doctrine-layer feature &lt;strong&gt;as it actually landed&lt;/strong&gt;, written to complement the pre-implementation &lt;a href=&quot;/plans/doctrine/layered-doctrine-resolution-design/&quot;&gt;design blueprint&lt;/a&gt;. It targets future maintainers who need to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Understand which components the feature added and how they collaborate.&lt;/li&gt;
&lt;li&gt;Cross-check the implementation against the canonical architecture model, the mission specification, and the project glossary.&lt;/li&gt;
&lt;li&gt;Assess fit against the architectural intent statements in our ADRs and landscape model.&lt;/li&gt;
&lt;li&gt;Plan the documentation / glossary follow-ups needed before the next release that depends on this feature.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;It is not a design document (the predecessor already covers intent) and not a user guide (see &lt;code dir=&quot;auto&quot;&gt;docs/architecture/org-doctrine-layer.md&lt;/code&gt; and &lt;code dir=&quot;auto&quot;&gt;docs/guides/create-an-org-doctrine-pack.md&lt;/code&gt;). It is engineering notes for architecture review.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&quot;executive-summary&quot;&gt;Executive summary&lt;/h2&gt;
&lt;p&gt;The mission shipped the planned three-layer doctrine model (&lt;code dir=&quot;auto&quot;&gt;built-in → org → project&lt;/code&gt;) plus a &lt;code dir=&quot;auto&quot;&gt;spec-kitty doctrine&lt;/code&gt; operator CLI, an &lt;code dir=&quot;auto&quot;&gt;org-charter.yaml&lt;/code&gt; policy file, and an advisory &lt;code dir=&quot;auto&quot;&gt;charter lint&lt;/code&gt; org-layer surface. Architectural boundaries (&lt;code dir=&quot;auto&quot;&gt;kernel ← doctrine ← charter ← specify_cli&lt;/code&gt;) hold. All 8 architectural layer-rule tests pass on &lt;code dir=&quot;auto&quot;&gt;HEAD&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Three substantive deltas vs the original blueprint are worth flagging:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Merge semantics shifted from “full-replace” to field-level merge with collision warnings.&lt;/strong&gt; The blueprint’s design table said “Full-replace on ID collision”; the implementation preserved the pre-existing field-merge &lt;code dir=&quot;auto&quot;&gt;_merge()&lt;/code&gt; from &lt;code dir=&quot;auto&quot;&gt;BaseDoctrineRepository&lt;/code&gt;. The post-mission review caught the spec/code contradiction (MEDIUM-1) and the remediation reconciled the spec to the code while adding operator-visible &lt;code dir=&quot;auto&quot;&gt;DoctrineLayerCollisionWarning&lt;/code&gt; emission (ADR 2026-05-16-1). The new behaviour is documented and tested; the predecessor blueprint’s table entry is now stale.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Multi-pack iteration was initially incorrect.&lt;/strong&gt; WP02 framed &lt;code dir=&quot;auto&quot;&gt;org_dirs&lt;/code&gt; as future-proofing — the original &lt;code dir=&quot;auto&quot;&gt;_org_dir()&lt;/code&gt; returned only &lt;code dir=&quot;auto&quot;&gt;org_roots[0]&lt;/code&gt;. Post-mission review caught this (HIGH-1) and the remediation made the loop iterate every configured pack in declaration order. The fix is in place and tested.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;code dir=&quot;auto&quot;&gt;charter interview&lt;/code&gt; pre-fill was implemented but unwired.&lt;/strong&gt; WP09 created &lt;code dir=&quot;auto&quot;&gt;apply_org_charter_pre_fill_to_answers&lt;/code&gt; (file helper) and &lt;code dir=&quot;auto&quot;&gt;apply_org_charter_pre_fill&lt;/code&gt; (orchestrator) but never invoked them from the live &lt;code dir=&quot;auto&quot;&gt;charter interview&lt;/code&gt; command (HIGH-2). The remediation added an in-memory variant &lt;code dir=&quot;auto&quot;&gt;apply_org_charter_to_interview&lt;/code&gt; and wired it.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The architectural boundary documented in ADR 2026-03-27-1 (charter must not import specify_cli) materially shaped two design choices: &lt;code dir=&quot;auto&quot;&gt;charter._drg_helpers._resolve_org_root&lt;/code&gt; is an inert stub by deliberate design (org-root resolution lives in &lt;code dir=&quot;auto&quot;&gt;specify_cli.doctrine.config.resolve_org_roots&lt;/code&gt; and is passed down), and the WP09 org-charter loader was lifted from charter into &lt;code dir=&quot;auto&quot;&gt;specify_cli.doctrine.org_charter_loader&lt;/code&gt; so the charter layer remains import-clean.&lt;/p&gt;
&lt;p&gt;The glossary and parts of the mission spec are now out of sync with the shipped semantics (see &lt;a href=&quot;#domain-concepts-cross-check&quot;&gt;Domain concepts cross-check&lt;/a&gt;). This is the single largest gap left after the remediations.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&quot;architectural-overview-c4-style-component-diagram&quot;&gt;Architectural overview (C4-style component diagram)&lt;/h2&gt;
&lt;h3 id=&quot;layer-landscape-system-context-simplified-c4-1&quot;&gt;Layer landscape (system context, simplified C4-1)&lt;/h3&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame not-content&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;┌──────────────────────────────────────────────────────┐&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│                spec-kitty (CLI shell)                │&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│   - typer commands, charter lint, runtime adapters   │&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│   - hosts adapters to git, HTTPS, vendor APIs        │&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;└──────────────────────────────────────────────────────┘&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                       &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│ uses&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                       &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;▼&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;┌────────────────────────────────────────────────────────┐&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│                       charter                          │&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│   - charter generate / interview / context             │&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│   - DRG helpers (3-layer load)                         │&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│   - synthesizer pipeline                               │&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;└────────────────────────────────────────────────────────┘&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                       &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│ uses&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                       &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;▼&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;┌────────────────────────────────────────────────────────┐&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│                      doctrine                          │&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│   - artifact repositories (8 kinds + agent profiles)   │&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│   - BaseDoctrineRepository (3-source merge)            │&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│   - DRG loader (single-file or fragment dir)           │&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;└────────────────────────────────────────────────────────┘&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                       &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│ uses&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                       &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;▼&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;┌────────────────────────────────────────────────────────┐&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│                       kernel                           │&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│   - zero-dependency primitives (paths, glossary)       │&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;└────────────────────────────────────────────────────────┘&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;The arrow direction is &lt;strong&gt;import / call&lt;/strong&gt;: higher layers depend on lower layers; the reverse is forbidden and enforced by &lt;code dir=&quot;auto&quot;&gt;tests/architectural/test_layer_rules.py&lt;/code&gt;. ADR &lt;code dir=&quot;auto&quot;&gt;2026-03-27-1&lt;/code&gt; is the binding source.&lt;/p&gt;
&lt;h3 id=&quot;component-diagram-for-the-org-doctrine-layer-feature-c4-3&quot;&gt;Component diagram for the org-doctrine-layer feature (C4-3)&lt;/h3&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame not-content&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                                          &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;┌─────────────────────────────────┐&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                                          &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│ .kittify/config.yaml            │&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                                          &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│   doctrine.org.packs: [...]     │&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                                          &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;└───────────────┬─────────────────┘&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                                                          &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│ reads&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                                                          &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;▼&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;┌────────────────────────────────────────────┐&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│ specify_cli.doctrine.config                │&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│   OrgPackConfig (pydantic)                 │&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│   PackRegistry                             │&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│   load_pack_registry / save_pack_registry  │&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│   resolve_org_roots                        │&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;└───────────────┬────────────────────────────┘&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                                                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│ provides org_roots&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;spec-kitty doctrine fetch                               │&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;──────────────────────────►  ┌──────────────────────────┴───────────────┐&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                     &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│ specify_cli.doctrine.sources              │&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                     &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│   OrgDoctrineSource (Protocol)            │&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                     &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│   GitSource | HttpsBundleSource | ApiSource│&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                     &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│   FetchResult                             │&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                     &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;└──────────────────────────┬────────────────┘&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                                                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│ writes (atomic)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                                                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;▼&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                     &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;┌─────────────────────────────────────────┐&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                     &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│ specify_cli.doctrine.snapshot           │&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                     &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│   write_snapshot                        │&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                     &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│   write_pack_manifest                   │&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                     &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│   fetch_pack (dispatcher)               │&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                     &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;└─────────────────────────────────────────┘&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                                                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                                                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│ produces local pack dir&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                                                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;▼&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;spec-kitty doctrine                ┌────────────────────────────────────────────┐&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;pack validate / pack assemble  ──► │ specify_cli.doctrine.pack_validator         │&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                           &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│   validate_pack, ValidationResult           │&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                           &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│ specify_cli.doctrine.pack_assembler         │&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                           &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│   assemble_pack, AssemblyResult             │&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                           &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;└────────────────────────────────────────────┘&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;charter interview / generate                  ┌─────────────────────────────────────┐&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;────────────────────────────►                 │ specify_cli.doctrine.org_charter    │&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                                      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│   OrgCharterPolicy, GovernancePolicy│&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                                      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│   load_org_charter_policy           │&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                                      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│   load_org_charter_policies (merge) │&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                                      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│   apply_org_charter_pre_fill        │ ──┐&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                                      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│   apply_org_charter_to_interview    │   │&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                                      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;└──────────┬──────────────────────────┘   │&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                                                 &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│ uses data parameter         │&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                                                 &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;▼                              │&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                                      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;┌───────────────────────────────┐         │&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                                      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│ charter.interview              │         │&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                                      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│   apply_org_charter_pre_fill_  │◄────────┘&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                                      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│     to_answers (file side-fx)  │&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                                      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;└───────────────────────────────┘&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;DoctrineService(org_roots=[...])                 ┌─────────────────────────────────┐&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;(constructed in specify_cli or charter)  ──────► │ doctrine.service.DoctrineService │&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                                         &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│   _org_dirs(artifact)            │&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                                         &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;└──────────┬───────────────────────┘&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                                                    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│ instantiates per-type&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                                                    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;▼&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                                         &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;┌───────────────────────────────┐&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                                         &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│ doctrine.&amp;#x3C;artifact&gt;.Repository│   (× 8)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                                         &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;└──────────┬────────────────────┘&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                                                    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│ extends&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                                                    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;▼&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                                         &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;┌───────────────────────────────┐&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                                         &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│ doctrine.base                 │&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                                         &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│   BaseDoctrineRepository      │&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                                         &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│   _apply_org_overrides (loop) │&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                                         &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│   _record_collision_if_present│&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                                         &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│   _emit_collision_warning ──► UserWarning&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                                         &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│     [DoctrineLayerCollision-  │&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                                         &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│      Warning]                 │&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                                         &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;└───────────────────────────────┘&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;spec-kitty doctor doctrine                       ┌─────────────────────────────────┐&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;──────────────────────────►                      │ specify_cli.cli.commands.doctor  │&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                                         &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│   doctrine_check                 │&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                                         &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│   _collect_doctrine_collisions   │&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                                         &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│     (instantiates DoctrineService│&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                                         &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│      and captures warnings)      │&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                                         &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;└─────────────────────────────────┘&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;spec-kitty charter lint                          ┌─────────────────────────────────┐&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;──────────────────────────►                      │ specify_cli.charter_lint.checks  │&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                                         &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│   .org_layer.OrgOverridesBuiltin │&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                                         &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│   .org_layer.OrgCharterDeviation │&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                                         &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;└─────────────────────────────────┘&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;Lines crossing a layer boundary are import edges; all cross-layer edges go from a higher layer to a lower layer. No edge points the other way.&lt;/p&gt;
&lt;h3 id=&quot;where-each-new-component-sits&quot;&gt;Where each new component sits&lt;/h3&gt;



















































































































&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Layer&lt;/th&gt;&lt;th&gt;Module&lt;/th&gt;&lt;th&gt;Components introduced or significantly modified&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;doctrine&lt;/code&gt;&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;base.py&lt;/code&gt;&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;DoctrineLayerCollisionWarning&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;_emit_collision_warning&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;BaseDoctrineRepository(org_dirs=...)&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;_apply_org_overrides&lt;/code&gt; (loop over packs), &lt;code dir=&quot;auto&quot;&gt;_record_collision_if_present&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;doctrine&lt;/code&gt;&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;service.py&lt;/code&gt;&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;DoctrineService(org_roots=...)&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;_org_dirs(artifact_type) -&gt; list[Path]&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;doctrine&lt;/code&gt;&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;agent_profiles/repository.py&lt;/code&gt;&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;AgentProfileRepository(org_dirs=...)&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;_load_org_profiles_from_dir&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;_record_profile_collision_if_present&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;doctrine&lt;/code&gt;&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;drg/loader.py&lt;/code&gt;&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;load_graph_or_dir&lt;/code&gt; (used by 3-layer DRG merge)&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;doctrine&lt;/code&gt;&lt;/td&gt;&lt;td&gt;All 8 sub-repos (directives, tactics, …, mission_step_contracts)&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;org_dirs&lt;/code&gt; kwarg threaded through&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;charter&lt;/code&gt;&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;_drg_helpers.py&lt;/code&gt;&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;load_validated_graph(repo_root, org_root)&lt;/code&gt; (3-layer); &lt;code dir=&quot;auto&quot;&gt;_resolve_org_root&lt;/code&gt; (intentionally inert stub)&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;charter&lt;/code&gt;&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;context.py&lt;/code&gt;&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;build_charter_context_json&lt;/code&gt; adds per-artifact &lt;code dir=&quot;auto&quot;&gt;source&lt;/code&gt; provenance + &lt;code dir=&quot;auto&quot;&gt;org_charter&lt;/code&gt; block&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;charter&lt;/code&gt;&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;interview.py&lt;/code&gt;&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;apply_org_charter_pre_fill_to_answers&lt;/code&gt; (pure data side-effect on YAML)&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;charter&lt;/code&gt;&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;compiler.py&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;reference_resolver.py&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;synthesizer/project_drg.py&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;synthesizer/resynthesize_pipeline.py&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;synthesizer/validation_gate.py&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;synthesizer/write_pipeline.py&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Route through &lt;code dir=&quot;auto&quot;&gt;load_graph_or_dir&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;specify_cli&lt;/code&gt;&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;doctrine/config.py&lt;/code&gt; (new)&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;OrgPackConfig&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;PackRegistry&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;load_pack_registry&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;save_pack_registry&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;resolve_org_roots&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;specify_cli&lt;/code&gt;&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;doctrine/sources/*.py&lt;/code&gt; (new)&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;OrgDoctrineSource&lt;/code&gt; Protocol, &lt;code dir=&quot;auto&quot;&gt;GitSource&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;HttpsBundleSource&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;ApiSource&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;FetchResult&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;specify_cli&lt;/code&gt;&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;doctrine/snapshot.py&lt;/code&gt; (new)&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;write_snapshot&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;write_pack_manifest&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;fetch_pack&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;specify_cli&lt;/code&gt;&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;doctrine/pack_validator.py&lt;/code&gt; (new)&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;validate_pack&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;ValidationIssue&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;ValidationResult&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;render_validation_result&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;specify_cli&lt;/code&gt;&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;doctrine/pack_assembler.py&lt;/code&gt; (new)&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;assemble_pack&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;ConflictItem&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;AssemblyResult&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;render_assembly_result&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;specify_cli&lt;/code&gt;&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;doctrine/org_charter.py&lt;/code&gt; (new)&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;OrgCharterPolicy&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;GovernancePolicy&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;load_org_charter_policy/policies&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;apply_org_charter_pre_fill&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;apply_org_charter_to_interview&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;specify_cli&lt;/code&gt;&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;doctrine/org_charter_loader.py&lt;/code&gt; (new)&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;load_org_charter_json_block&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;specify_cli&lt;/code&gt;&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;cli/commands/doctrine.py&lt;/code&gt; (new)&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;doctrine fetch&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;doctrine pack validate&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;doctrine pack assemble&lt;/code&gt; command group&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;specify_cli&lt;/code&gt;&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;cli/commands/doctor.py&lt;/code&gt;&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;doctrine_check&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;_resolve_pack_version&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;_count_pack_artifacts&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;_summarize_org_charter&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;_render_doctrine_pack&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;_collect_doctrine_collisions&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;specify_cli&lt;/code&gt;&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;cli/commands/charter.py&lt;/code&gt;&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;_build_doctrine_service_with_org_layer&lt;/code&gt;, in-memory pre-fill wiring in &lt;code dir=&quot;auto&quot;&gt;interview()&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;specify_cli&lt;/code&gt;&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;charter_lint/checks/org_layer.py&lt;/code&gt; (new)&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;OrgOverridesBuiltinChecker&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;OrgCharterDeviationChecker&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;filesystem rename&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;src/doctrine/&amp;#x3C;artifact&gt;/built-in/&lt;/code&gt;&lt;/td&gt;&lt;td&gt;8 directories renamed from &lt;code dir=&quot;auto&quot;&gt;shipped/&lt;/code&gt; (provenance tag &lt;code dir=&quot;auto&quot;&gt;&quot;builtin&quot;&lt;/code&gt; unchanged)&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;hr&gt;
&lt;h2 id=&quot;dependency-flows-and-key-interactions&quot;&gt;Dependency flows and key interactions&lt;/h2&gt;
&lt;p&gt;Four interactions explain how the surfaces compose. They are sequence-style narratives; the boundary annotations call out which layer each step lives in.&lt;/p&gt;
&lt;h3 id=&quot;interaction-1--spec-kitty-doctrine-fetch&quot;&gt;Interaction 1 — &lt;code dir=&quot;auto&quot;&gt;spec-kitty doctrine fetch&lt;/code&gt;&lt;/h3&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame not-content&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;operator → specify_cli.cli.commands.doctrine.fetch&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;→ specify_cli.doctrine.config.load_pack_registry         (read .kittify/config.yaml)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;→ specify_cli.doctrine.snapshot.fetch_pack(pack)         (dispatch)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;→ specify_cli.doctrine.sources.GitSource / HttpsBundleSource / ApiSource&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;├── GitSource: git clone or fetch + reset --hard&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;└── HTTPS / API: write_snapshot (temp dir → validate → atomic rename)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;+ write_pack_manifest (sanitised source_url)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;→ returns FetchResult&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;→ prints per-pack outcome&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;Only this code path performs network operations. All other call paths read from local pack directories, per Constraint C-001 and Principle 4 (local-first operation).&lt;/p&gt;
&lt;h3 id=&quot;interaction-2--three-layer-resolution-at-read-time&quot;&gt;Interaction 2 — Three-layer resolution at read time&lt;/h3&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame not-content&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;caller (charter, lint, or doctor) → DoctrineService(org_roots=resolve_org_roots(repo_root))&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;→ service.directives                                      (lazy property)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;→ DirectiveRepository(shipped_dir=..., org_dirs=service._org_dirs(&quot;directives&quot;), project_dir=...)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;→ BaseDoctrineRepository._load&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;├── _load_shipped_items                       (provenance: &quot;builtin&quot;)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;├── _apply_org_overrides&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│     for org_dir in self._org_dirs:           (loop in declaration order)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│         for yaml in scan(org_dir):&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│             merge or add; tag provenance &quot;org&quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;│             _record_collision_if_present  → DoctrineLayerCollisionWarning&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;└── _apply_project_overrides&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                          &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;for yaml in scan(project_dir):&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                              &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;merge or add; tag provenance &quot;project&quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                              &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;_record_collision_if_present  → DoctrineLayerCollisionWarning&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;← returns resolved repository&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;The &lt;code dir=&quot;auto&quot;&gt;_org_dirs&lt;/code&gt; list is iterated &lt;strong&gt;in declaration order&lt;/strong&gt;; later packs overlay earlier ones for the same artifact ID. The &lt;code dir=&quot;auto&quot;&gt;_record_collision_if_present&lt;/code&gt; helper centralises warning emission and uniformly catches all four collision shapes (org-over-builtin, project-over-builtin, project-over-org, org-pack-N-over-pack-(N-1)).&lt;/p&gt;
&lt;h3 id=&quot;interaction-3--charter-interview-org-charter-pre-fill-fr-026&quot;&gt;Interaction 3 — &lt;code dir=&quot;auto&quot;&gt;charter interview&lt;/code&gt; org-charter pre-fill (FR-026)&lt;/h3&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame not-content&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;operator → spec-kitty charter interview --defaults&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;specify_cli.cli.commands.charter.interview&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;→ charter.interview.default_interview(...)               (builds default CharterInterview)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;→ specify_cli.doctrine.org_charter.apply_org_charter_to_interview(interview_data, repo_root)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;→ load_pack_registry → early return if no packs&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;→ load_org_charter_policies(repo_root)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                       &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;└── for pack in registry: load_org_charter_policy(pack) and merge&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                              &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;├── interview_defaults: last-wins on key collision&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                              &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;├── required_directives: union, order preserved&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                              &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;└── governance_policies: dedup&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;→ mutate interview_data.answers (only missing keys)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;→ mutate interview_data.selected_directives (only new directives)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;→ return list[str] of human-readable messages&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;→ console.print(&quot;[cyan]Org charter:[/cyan] ...&quot;) per message&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;→ prompt loop (unchanged; uses interview_data as default values)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;→ write_interview_answers(answers_path, interview_data)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;Two things matter architecturally here:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The &lt;code dir=&quot;auto&quot;&gt;apply_org_charter_to_interview&lt;/code&gt; helper sits in &lt;code dir=&quot;auto&quot;&gt;specify_cli.doctrine.org_charter&lt;/code&gt; and accepts the (mutable) &lt;code dir=&quot;auto&quot;&gt;CharterInterview&lt;/code&gt; instance. The charter layer hosts the dataclass and the file-level helper &lt;code dir=&quot;auto&quot;&gt;apply_org_charter_pre_fill_to_answers&lt;/code&gt;; the orchestration that knows about pack registry / config lives in &lt;code dir=&quot;auto&quot;&gt;specify_cli&lt;/code&gt;. The architecture’s “data flows down, orchestration flows up” pattern is preserved.&lt;/li&gt;
&lt;li&gt;The pre-fill is non-destructive: existing keys are never overwritten. This is the contract that lets operators safely re-run the interview after configuring an org pack.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;interaction-4--collision-auditing-via-spec-kitty-doctor-doctrine&quot;&gt;Interaction 4 — Collision auditing via &lt;code dir=&quot;auto&quot;&gt;spec-kitty doctor doctrine&lt;/code&gt;&lt;/h3&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame not-content&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;operator → spec-kitty doctor doctrine&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;    &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;specify_cli.cli.commands.doctor.doctrine_check&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;→ load_pack_registry (enumerate configured packs)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;→ for each pack: _resolve_pack_version, _count_pack_artifacts, _summarize_org_charter&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;→ _collect_doctrine_collisions(repo_root)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;→ DoctrineService(org_roots=resolve_org_roots(repo_root), project_root=...)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;→ warnings.catch_warnings(record=True) as captured:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                       &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;getattr(service, name) for each of the 8 artifact accessors&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;→ regex-parse each captured DoctrineLayerCollisionWarning into a structured dict&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;        &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;→ render &quot;Collisions&quot; section + JSON `collisions` array&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;This is the only place where the warning &lt;em&gt;category&lt;/em&gt; is consumed programmatically. It is also the one spot the architecture review flags as fragile (see &lt;a href=&quot;#recommended-follow-ups&quot;&gt;Recommended follow-ups&lt;/a&gt;).&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&quot;domain-concepts-cross-check&quot;&gt;Domain concepts cross-check&lt;/h2&gt;
&lt;p&gt;This section compares the canonical glossary against the spec and the implementation. Notation: ✓ aligned, ⚠ documentation drift, ✗ outright conflict.&lt;/p&gt;
&lt;h3 id=&quot;aligned-terms-no-action-needed&quot;&gt;Aligned terms (no action needed)&lt;/h3&gt;

























&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Term&lt;/th&gt;&lt;th&gt;Source of truth&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Doctrine (umbrella)&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;docs/context/charter.md:9&lt;/code&gt; matches implementation usage.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Charter Interview&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;docs/context/governance.md:69&lt;/code&gt; matches &lt;code dir=&quot;auto&quot;&gt;spec-kitty charter interview&lt;/code&gt; semantics.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Charter Compiler&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;docs/context/governance.md:81&lt;/code&gt; matches the synthesis pipeline.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Project Charter&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;docs/context/configuration-project-structure.md:70&lt;/code&gt; matches the project-layer artifact.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;h3 id=&quot;discrepancies--implementation-lands-them-glossary-and-parts-of-spec-lag&quot;&gt;Discrepancies — implementation lands them; glossary and parts of spec lag&lt;/h3&gt;














































































































&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Term&lt;/th&gt;&lt;th&gt;Glossary state&lt;/th&gt;&lt;th&gt;Spec state&lt;/th&gt;&lt;th&gt;Implementation state&lt;/th&gt;&lt;th&gt;Verdict&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;shipped&lt;/code&gt; → &lt;code dir=&quot;auto&quot;&gt;built-in&lt;/code&gt; rename&lt;/td&gt;&lt;td&gt;Glossary still uses &lt;code dir=&quot;auto&quot;&gt;shipped/&lt;/code&gt; paths in every &lt;code dir=&quot;auto&quot;&gt;Location&lt;/code&gt; field of &lt;code dir=&quot;auto&quot;&gt;docs/context/charter.md&lt;/code&gt; (lines 181, 194, 207, 220).&lt;/td&gt;&lt;td&gt;Spec is internally inconsistent: Domain Language table at &lt;code dir=&quot;auto&quot;&gt;spec.md:114&lt;/code&gt; mandates &lt;code dir=&quot;auto&quot;&gt;&quot;spec-kitty built-in&quot;&lt;/code&gt; and adds &lt;code dir=&quot;auto&quot;&gt;&quot;Avoid: &apos;shipped&apos;&quot;&lt;/code&gt;, but FR-001 (&lt;code dir=&quot;auto&quot;&gt;spec.md:132&lt;/code&gt;) and the &lt;code dir=&quot;auto&quot;&gt;DoctrineLayers&lt;/code&gt; entity (&lt;code dir=&quot;auto&quot;&gt;spec.md:202, 204&lt;/code&gt;) still say &lt;code dir=&quot;auto&quot;&gt;shipped&lt;/code&gt;.&lt;/td&gt;&lt;td&gt;Code uniformly uses &lt;code dir=&quot;auto&quot;&gt;built-in/&lt;/code&gt; (filesystem) and &lt;code dir=&quot;auto&quot;&gt;&quot;builtin&quot;&lt;/code&gt; (provenance tag). All 8 directories were renamed via WP10.&lt;/td&gt;&lt;td&gt;✗ Glossary out of date; spec internally inconsistent.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;provenance&lt;/code&gt; vs &lt;code dir=&quot;auto&quot;&gt;source attribution&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Neither term is glossed as a doctrine-specific concept (only one informal mention in &lt;code dir=&quot;auto&quot;&gt;doctrine.md:139&lt;/code&gt;).&lt;/td&gt;&lt;td&gt;Spec declares &lt;code dir=&quot;auto&quot;&gt;source attribution&lt;/code&gt; canonical (&lt;code dir=&quot;auto&quot;&gt;spec.md:122&lt;/code&gt;) and explicitly avoids &lt;code dir=&quot;auto&quot;&gt;provenance label&lt;/code&gt;. &lt;strong&gt;But FR-003 wording (post-remediation) uses &lt;code dir=&quot;auto&quot;&gt;provenance&lt;/code&gt;&lt;/strong&gt; (“its &lt;code dir=&quot;auto&quot;&gt;provenance&lt;/code&gt; becomes that layer”).&lt;/td&gt;&lt;td&gt;Code uses &lt;code dir=&quot;auto&quot;&gt;provenance&lt;/code&gt; everywhere (&lt;code dir=&quot;auto&quot;&gt;_provenance&lt;/code&gt; dict, &lt;code dir=&quot;auto&quot;&gt;get_provenance()&lt;/code&gt; method).&lt;/td&gt;&lt;td&gt;⚠ Spec internally inconsistent. Implementation diverges from spec’s stated canonical term. Resolution: either glossary adopts &lt;code dir=&quot;auto&quot;&gt;provenance&lt;/code&gt; (matching code) and spec is updated, or code is renamed (large surface change). My recommendation in the &lt;a href=&quot;#recommended-follow-ups&quot;&gt;follow-ups&lt;/a&gt; is option 1.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;doctrine pack&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Closest concept in glossary is &lt;code dir=&quot;auto&quot;&gt;Doctrine Catalog&lt;/code&gt; (&lt;code dir=&quot;auto&quot;&gt;doctrine.md:165&lt;/code&gt;) — a registry of available items, not a directory primitive.&lt;/td&gt;&lt;td&gt;Defined at &lt;code dir=&quot;auto&quot;&gt;spec.md:113&lt;/code&gt;.&lt;/td&gt;&lt;td&gt;New primitive throughout &lt;code dir=&quot;auto&quot;&gt;src/specify_cli/doctrine/&lt;/code&gt;.&lt;/td&gt;&lt;td&gt;⚠ Glossary needs &lt;code dir=&quot;auto&quot;&gt;doctrine pack&lt;/code&gt; entry; &lt;code dir=&quot;auto&quot;&gt;Doctrine Catalog&lt;/code&gt; relationship to &lt;code dir=&quot;auto&quot;&gt;doctrine pack&lt;/code&gt; should be clarified (a pack is a packagable subset of the catalog).&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;doctrine layer&lt;/code&gt; / &lt;code dir=&quot;auto&quot;&gt;built-in layer&lt;/code&gt; / &lt;code dir=&quot;auto&quot;&gt;org layer&lt;/code&gt; / &lt;code dir=&quot;auto&quot;&gt;project layer&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Not defined.&lt;/td&gt;&lt;td&gt;Defined in Overview + Domain Language (&lt;code dir=&quot;auto&quot;&gt;spec.md:115-116, 202&lt;/code&gt;).&lt;/td&gt;&lt;td&gt;Pervasive.&lt;/td&gt;&lt;td&gt;⚠ Whole-feature pivot concept missing from glossary.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;org pack&lt;/code&gt; / &lt;code dir=&quot;auto&quot;&gt;org doctrine pack&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Not defined.&lt;/td&gt;&lt;td&gt;Defined at &lt;code dir=&quot;auto&quot;&gt;spec.md:115&lt;/code&gt;.&lt;/td&gt;&lt;td&gt;Used throughout &lt;code dir=&quot;auto&quot;&gt;specify_cli/doctrine/&lt;/code&gt;.&lt;/td&gt;&lt;td&gt;⚠ Add entry.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;pack registry&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Not defined.&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;spec.md:120, 197&lt;/code&gt;.&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;specify_cli/doctrine/config.py&lt;/code&gt; model.&lt;/td&gt;&lt;td&gt;⚠ Add entry.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;pack assembly&lt;/code&gt; / &lt;code dir=&quot;auto&quot;&gt;assembled pack&lt;/code&gt; / &lt;code dir=&quot;auto&quot;&gt;assemble&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Not defined.&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;spec.md:123&lt;/code&gt;, FR-013, FR-022, C-007.&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;specify_cli/doctrine/pack_assembler.py&lt;/code&gt;.&lt;/td&gt;&lt;td&gt;⚠ Add entry; distinguish “assembled distributable” from “hand-authored pack”.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;pack-manifest.yaml&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Not defined.&lt;/td&gt;&lt;td&gt;FR-015, FR-021.&lt;/td&gt;&lt;td&gt;Emitted by &lt;code dir=&quot;auto&quot;&gt;specify_cli/doctrine/snapshot.py::write_pack_manifest&lt;/code&gt;.&lt;/td&gt;&lt;td&gt;⚠ Add entry.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;doctrine fetch&lt;/code&gt; / &lt;code dir=&quot;auto&quot;&gt;doctrine pack validate&lt;/code&gt; / &lt;code dir=&quot;auto&quot;&gt;doctrine pack assemble&lt;/code&gt; / &lt;code dir=&quot;auto&quot;&gt;doctor doctrine&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Not defined.&lt;/td&gt;&lt;td&gt;Defined operationally in spec and FR-007–FR-013, FR-015, FR-024.&lt;/td&gt;&lt;td&gt;New CLI subcommand group.&lt;/td&gt;&lt;td&gt;⚠ Add entries for the four operator-facing commands.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;DRG&lt;/code&gt; / &lt;code dir=&quot;auto&quot;&gt;Doctrine Reference Graph&lt;/code&gt; / &lt;code dir=&quot;auto&quot;&gt;GraphFragment&lt;/code&gt; / &lt;code dir=&quot;auto&quot;&gt;GraphExtension&lt;/code&gt;&lt;/td&gt;&lt;td&gt;&lt;strong&gt;Entirely absent.&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Used in FR-004, FR-005 and entities (&lt;code dir=&quot;auto&quot;&gt;spec.md:206-207&lt;/code&gt;).&lt;/td&gt;&lt;td&gt;Central to &lt;code dir=&quot;auto&quot;&gt;doctrine.drg.loader&lt;/code&gt; and &lt;code dir=&quot;auto&quot;&gt;charter._drg_helpers&lt;/code&gt;.&lt;/td&gt;&lt;td&gt;⚠ Pre-existing gap that this mission widens. DRG is a load-bearing concept and deserves a glossary section of its own.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;org-charter.yaml&lt;/code&gt; / &lt;code dir=&quot;auto&quot;&gt;OrgCharterPolicy&lt;/code&gt; / &lt;code dir=&quot;auto&quot;&gt;interview_defaults&lt;/code&gt; / &lt;code dir=&quot;auto&quot;&gt;required_directives&lt;/code&gt; / &lt;code dir=&quot;auto&quot;&gt;governance_policies&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Not defined. The existing glossary &lt;code dir=&quot;auto&quot;&gt;Charter&lt;/code&gt; entry is project-only.&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;spec.md:205&lt;/code&gt;, FR-025–FR-028.&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;src/specify_cli/doctrine/org_charter.py&lt;/code&gt;.&lt;/td&gt;&lt;td&gt;⚠ Glossary &lt;code dir=&quot;auto&quot;&gt;Charter&lt;/code&gt; entry must be revised to acknowledge tiered composition (built-in defaults → org charter(s) → project charter). Add entries for the three policy fields.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;OrgDoctrineSource&lt;/code&gt; / &lt;code dir=&quot;auto&quot;&gt;GitSource&lt;/code&gt; / &lt;code dir=&quot;auto&quot;&gt;HttpsBundleSource&lt;/code&gt; / &lt;code dir=&quot;auto&quot;&gt;ApiSource&lt;/code&gt; / &lt;code dir=&quot;auto&quot;&gt;FetchResult&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Not defined.&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;spec.md:201&lt;/code&gt; mentions &lt;code dir=&quot;auto&quot;&gt;OrgDoctrineSource&lt;/code&gt; as an entity name.&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;src/specify_cli/doctrine/sources/&lt;/code&gt;.&lt;/td&gt;&lt;td&gt;⚠ Add Source Protocol entry.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;collision&lt;/code&gt; / &lt;code dir=&quot;auto&quot;&gt;DoctrineLayerCollisionWarning&lt;/code&gt; / &lt;code dir=&quot;auto&quot;&gt;shadow&lt;/code&gt; / &lt;code dir=&quot;auto&quot;&gt;override&lt;/code&gt; / &lt;code dir=&quot;auto&quot;&gt;overlay&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Not defined. (“Overlay” not used anywhere; “override” only informal.)&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;spec.md:124&lt;/code&gt; explicitly says “Avoid: graph overlay” (in DRG context). FR-003 uses both &lt;code dir=&quot;auto&quot;&gt;override&lt;/code&gt; and &lt;code dir=&quot;auto&quot;&gt;shadowed&lt;/code&gt;.&lt;/td&gt;&lt;td&gt;Code uses &lt;code dir=&quot;auto&quot;&gt;shadowed&lt;/code&gt; in warning text; class is &lt;code dir=&quot;auto&quot;&gt;DoctrineLayerCollisionWarning&lt;/code&gt;.&lt;/td&gt;&lt;td&gt;⚠ Need one canonical term and one glossary entry; recommend &lt;code dir=&quot;auto&quot;&gt;override&lt;/code&gt; for the action, &lt;code dir=&quot;auto&quot;&gt;shadow&lt;/code&gt; for the resulting state, &lt;code dir=&quot;auto&quot;&gt;collision&lt;/code&gt; for the merge event.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;git-managed pack&lt;/code&gt; / &lt;code dir=&quot;auto&quot;&gt;local clone&lt;/code&gt; / &lt;code dir=&quot;auto&quot;&gt;local snapshot&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Not defined.&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;spec.md:117-119&lt;/code&gt; with explicit avoid-list (“avoid: cache, mirror, snapshot for git sources”).&lt;/td&gt;&lt;td&gt;Implemented in &lt;code dir=&quot;auto&quot;&gt;sources/git_source.py&lt;/code&gt; (clone) and &lt;code dir=&quot;auto&quot;&gt;sources/https_source.py&lt;/code&gt; / &lt;code dir=&quot;auto&quot;&gt;api_source.py&lt;/code&gt; (snapshot).&lt;/td&gt;&lt;td&gt;⚠ Add entries; preserve spec’s avoid-list discipline.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;h3 id=&quot;drift-between-predecessor-design-blueprint-and-shipped-behaviour&quot;&gt;Drift between predecessor design blueprint and shipped behaviour&lt;/h3&gt;
&lt;p&gt;The blueprint’s &lt;code dir=&quot;auto&quot;&gt;## Key design decisions&lt;/code&gt; table contains an entry that no longer matches reality:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;| ID collision semantics | Full-replace (org replaces shipped; project replaces org) | Simpler authoring contract than field-level merge; authors need to substitute, not patch |&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The shipped semantics is &lt;strong&gt;field-level merge with collision warnings&lt;/strong&gt;, reconciled by ADR &lt;code dir=&quot;auto&quot;&gt;2026-05-16-1&lt;/code&gt;. The blueprint should be amended to note “superseded by ADR 2026-05-16-1” on that row, or the row should be replaced. The blueprint’s Target resolution stack diagram says “full-replace on ID collision (org overrides shipped)” — same correction applies.&lt;/p&gt;
&lt;p&gt;This is not a defect — the post-mission review caught the inconsistency and the remediation produced the ADR. It is documentation hygiene that has to land before the next reader is misled.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&quot;user-journey-impact-analysis&quot;&gt;User journey impact analysis&lt;/h2&gt;
&lt;p&gt;Source: &lt;code dir=&quot;auto&quot;&gt;docs/plans/user_journey/&lt;/code&gt;.&lt;/p&gt;













































&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Journey&lt;/th&gt;&lt;th&gt;Affected?&lt;/th&gt;&lt;th&gt;Net change&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;001 — Project Onboarding &amp;#x26; Bootstrap&lt;/td&gt;&lt;td&gt;PARTIAL&lt;/td&gt;&lt;td&gt;The Phase-3 agent customisation and Phase-4–7 charter capture phases gain org-charter pre-fill via &lt;code dir=&quot;auto&quot;&gt;apply_org_charter_to_interview&lt;/code&gt;. The Project Owner now sees org-pre-selected approaches / directives instead of a blank slate; org-pack-supplied items appear in catalogs alongside built-in. Mitigation: &lt;code dir=&quot;auto&quot;&gt;DoctrineLayerCollisionWarning&lt;/code&gt; can surface during bootstrap if an org pack shadows a built-in approach — bootstrap UX should explain provenance, or new operators may be confused.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;002 — System Architecture Design&lt;/td&gt;&lt;td&gt;NO&lt;/td&gt;&lt;td&gt;Operates on &lt;code dir=&quot;auto&quot;&gt;architecture/*&lt;/code&gt; and ADR artifacts. Doctrine-layered governance does not enter this workflow.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;003 — System Design &amp;#x26; Shared Understanding&lt;/td&gt;&lt;td&gt;NO&lt;/td&gt;&lt;td&gt;Operates on the living glossary (a per-project artifact, not a doctrine layer). The shipped→built-in rename is invisible from this journey.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;004 — Curating External Practice into Governance&lt;/td&gt;&lt;td&gt;YES&lt;/td&gt;&lt;td&gt;Phase-4 governance integration and Phase-5 charter selection gain a new placement target: an artifact can now be curated &lt;strong&gt;into the org layer&lt;/strong&gt; (a shared pack) instead of only the project layer. &lt;code dir=&quot;auto&quot;&gt;spec-kitty doctrine pack validate&lt;/code&gt; and &lt;code dir=&quot;auto&quot;&gt;pack assemble&lt;/code&gt; let a curator test a candidate pack before publishing. Risk: schema-gate (Coordination Rule 4) must now consider cross-layer validity; &lt;code dir=&quot;auto&quot;&gt;DoctrineLayerCollisionWarning&lt;/code&gt; may fire when curated org tactics shadow built-in tactics.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;005 — Governance Mission Charter Operations&lt;/td&gt;&lt;td&gt;YES (most impacted)&lt;/td&gt;&lt;td&gt;Phase 2 (Curate) and Phase 6 (Apply charter extraction) directly interact with the new layered model. &lt;code dir=&quot;auto&quot;&gt;charter sync&lt;/code&gt; must reconcile org-layer directives alongside project selections. &lt;code dir=&quot;auto&quot;&gt;charter status&lt;/code&gt; should reflect which selections come from org vs project. Coordination Rule 1 (HIC escalation under D-011) gains a new trigger: collision warnings. The new &lt;code dir=&quot;auto&quot;&gt;spec-kitty doctrine&lt;/code&gt; group plus &lt;code dir=&quot;auto&quot;&gt;doctor doctrine&lt;/code&gt;’s Collisions section become first-class workflow surfaces.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Init Doctrine Flow (&lt;code dir=&quot;auto&quot;&gt;init-doctrine-flow.md&lt;/code&gt;)&lt;/td&gt;&lt;td&gt;YES&lt;/td&gt;&lt;td&gt;The decision tree’s “defaults” path (Path 1) previously loaded &lt;code dir=&quot;auto&quot;&gt;src/charter/defaults.yaml&lt;/code&gt; only. The loader chain is now built-in → org → project, so an org may override the default paradigms / directives that &lt;code dir=&quot;auto&quot;&gt;_apply_doctrine_defaults()&lt;/code&gt; writes. Paths 2/3 gain pre-population via &lt;code dir=&quot;auto&quot;&gt;apply_org_charter_to_interview&lt;/code&gt;. &lt;code dir=&quot;auto&quot;&gt;spec-kitty doctrine fetch&lt;/code&gt; can hydrate an org pack before &lt;code dir=&quot;auto&quot;&gt;spec-kitty init&lt;/code&gt; runs, so CI bootstraps inherit org policy without per-repo configuration. Risk: NFR-001 (≤2 s) could regress if org-pack fetch is in the critical path; the checkpoint format does not record layer provenance, so a resumed interview after org-pack changes may produce inconsistent answers.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Evaluation document&lt;/td&gt;&lt;td&gt;METADATA-ONLY&lt;/td&gt;&lt;td&gt;The journey index should note that the layered doctrine model introduces a canonical surface (org layer + doctrine CLI) not represented in any current journey; consider promoting a new journey from the brainstorm set.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;h3 id=&quot;net-new-journey-candidate&quot;&gt;Net-new journey candidate&lt;/h3&gt;
&lt;p&gt;None of the existing journeys covers the operator-facing flow:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Discover an org pack → fetch it → validate it → assemble against project → audit collisions via &lt;code dir=&quot;auto&quot;&gt;spec-kitty doctor doctrine&lt;/code&gt; → confirm provenance via &lt;code dir=&quot;auto&quot;&gt;charter context --json&lt;/code&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This is plausibly &lt;strong&gt;Journey 006 — Adopting and Auditing an Organisation Doctrine Pack&lt;/strong&gt;, with the platform / governance lead as primary actor, &lt;code dir=&quot;auto&quot;&gt;DoctrineLayerCollisionWarning&lt;/code&gt; events as a first-class coordination signal, and the Collisions section of &lt;code dir=&quot;auto&quot;&gt;doctor doctrine&lt;/code&gt; as the acceptance surface. The &lt;code dir=&quot;auto&quot;&gt;init-doctrine-flow&lt;/code&gt; note captures a partial slice (defaults loading) but does not cover multi-pack composition, fetch lifecycle, or collision triage.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&quot;architectural-intent-fit&quot;&gt;Architectural intent fit&lt;/h2&gt;
&lt;h3 id=&quot;where-the-implementation-honours-the-intent&quot;&gt;Where the implementation honours the intent&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Layer rule (ADR 2026-03-27-1).&lt;/strong&gt; All 8 layer-rule tests pass. The two places where this rule shaped the design — the inert &lt;code dir=&quot;auto&quot;&gt;_resolve_org_root&lt;/code&gt; stub in &lt;code dir=&quot;auto&quot;&gt;charter._drg_helpers&lt;/code&gt; and the lifting of org-charter loading into &lt;code dir=&quot;auto&quot;&gt;specify_cli.doctrine.org_charter_loader&lt;/code&gt; — are documented and tested.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Local-first operation (Landscape README Principle 4).&lt;/strong&gt; Network access is confined to &lt;code dir=&quot;auto&quot;&gt;spec-kitty doctrine fetch&lt;/code&gt;. Every resolution / context / lint path is offline. Constraint C-001 and FR-018 enforce this.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Governance at the execution boundary (Principle 5).&lt;/strong&gt; The same &lt;code dir=&quot;auto&quot;&gt;DoctrineService&lt;/code&gt; that the runtime consumes for agent context now resolves all three layers; agents do not need to know whether a directive came from the org pack or the built-in defaults.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Doctrine package isolation (Landscape README §Dependency Rules).&lt;/strong&gt; The new behaviour fits inside &lt;code dir=&quot;auto&quot;&gt;BaseDoctrineRepository&lt;/code&gt; and &lt;code dir=&quot;auto&quot;&gt;AgentProfileRepository&lt;/code&gt;; the doctrine layer’s API surface to charter is unchanged in shape (same &lt;code dir=&quot;auto&quot;&gt;service.directives.list_all()&lt;/code&gt; etc.).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Shared-package boundary (ADR 2026-04-25-1).&lt;/strong&gt; The feature introduces no new shared-PyPI consumption, no &lt;code dir=&quot;auto&quot;&gt;spec_kitty_runtime&lt;/code&gt; imports in production code, and no new edges into &lt;code dir=&quot;auto&quot;&gt;spec_kitty_events&lt;/code&gt; / &lt;code dir=&quot;auto&quot;&gt;spec_kitty_tracker&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;where-the-implementation-deviates-from-intent--and-why-it-is-defensible&quot;&gt;Where the implementation deviates from intent — and why it is defensible&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Field-merge instead of full-replace.&lt;/strong&gt; The blueprint listed full-replace as a key design decision; the implementation preserved the pre-existing field-merge &lt;code dir=&quot;auto&quot;&gt;_merge()&lt;/code&gt;. The post-mission ADR &lt;code dir=&quot;auto&quot;&gt;2026-05-16-1&lt;/code&gt; documents the rationale (zero migration burden for existing project overlays; operator ergonomics; the user-mission-review feedback explicitly asked for collision visibility rather than behaviour change). Net effect: the spec was updated to match the code; user-facing behaviour is identical to pre-mission baseline plus the new collision warnings.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code dir=&quot;auto&quot;&gt;charter interview&lt;/code&gt; pre-fill landed late.&lt;/strong&gt; Initially WP09 produced the helper without wiring; the wiring landed in the post-mission remediation. This is the only place where the mission shipped an unconsumed surface; the gap was caught by mission review and closed within a day.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;where-intent-and-implementation-are-in-tension-and-the-tension-is-not-yet-resolved&quot;&gt;Where intent and implementation are in tension, and the tension is not yet resolved&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Documentation drift.&lt;/strong&gt; The mission delivered the feature; the glossary and parts of the spec did not catch up. The cross-check above lists ~30 new doctrine concepts unglossed and 2 spec inconsistencies (&lt;code dir=&quot;auto&quot;&gt;shipped&lt;/code&gt;/&lt;code dir=&quot;auto&quot;&gt;built-in&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;provenance&lt;/code&gt;/&lt;code dir=&quot;auto&quot;&gt;source attribution&lt;/code&gt;). This is recoverable but should be done before any downstream mission inherits the vocabulary.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Brittle warning-string parsing.&lt;/strong&gt; &lt;code dir=&quot;auto&quot;&gt;doctor.py::_collect_doctrine_collisions&lt;/code&gt; regex-parses warning messages to reconstruct structured collision data. If the warning format ever changes, doctor silently drops collisions from its JSON output. The post-mission review flagged this as a follow-up; the architecturally clean fix is to carry structured data as attributes on the &lt;code dir=&quot;auto&quot;&gt;DoctrineLayerCollisionWarning&lt;/code&gt; instance (e.g. &lt;code dir=&quot;auto&quot;&gt;DoctrineLayerCollisionWarning(item_id=..., higher_layer=..., ...)&lt;/code&gt;) and have doctor consume those attributes rather than the formatted message.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code dir=&quot;auto&quot;&gt;_resolve_org_root&lt;/code&gt; is intentionally inert.&lt;/strong&gt; This is correct given the layer rule, but the function exists and is callable; a future reader may assume it is meant to do real work. Adding a &lt;code dir=&quot;auto&quot;&gt;__deprecated__&lt;/code&gt;-style marker, or removing the function and inlining the &lt;code dir=&quot;auto&quot;&gt;None&lt;/code&gt; return at the single call site, would make the intent unambiguous.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;architectural-intent-gaps-the-feature-surfaces&quot;&gt;Architectural intent gaps the feature surfaces&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Multi-pack within the org layer has no explicit “collision policy” UX.&lt;/strong&gt; Today, when packs collide on an artifact ID, the later pack wins silently (subject to warnings). The architecture intent statements in the landscape README emphasise traceability of governance decisions. A future capability — a &lt;code dir=&quot;auto&quot;&gt;pack overrides allow:&lt;/code&gt; policy in &lt;code dir=&quot;auto&quot;&gt;org-charter.yaml&lt;/code&gt;, or an explicit collision policy at registry level — would let governance leads codify &lt;em&gt;which&lt;/em&gt; packs are allowed to override &lt;em&gt;which&lt;/em&gt; others, beyond just observing that they do.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;No DRG-extension fidelity check at the registry boundary.&lt;/strong&gt; &lt;code dir=&quot;auto&quot;&gt;pack validate&lt;/code&gt; checks a single pack; &lt;code dir=&quot;auto&quot;&gt;pack assemble&lt;/code&gt; checks the merged output. There is no operator-facing equivalent of “validate the resolved DRG across all configured packs in this project before installing them”. &lt;code dir=&quot;auto&quot;&gt;doctor doctrine&lt;/code&gt; enumerates packs but does not currently exercise the DRG merge. This is consistent with the mission’s scope (single-pack and assembled-pack validation), but the multi-pack case is the operator’s common one.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id=&quot;recommended-follow-ups&quot;&gt;Recommended follow-ups&lt;/h2&gt;
&lt;p&gt;Ordered by leverage (high-impact items first).&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Update the glossary&lt;/strong&gt; (&lt;code dir=&quot;auto&quot;&gt;docs/context/charter.md&lt;/code&gt; + &lt;code dir=&quot;auto&quot;&gt;governance.md&lt;/code&gt; + &lt;code dir=&quot;auto&quot;&gt;configuration-project-structure.md&lt;/code&gt;) to add the ~30 net-new concepts from the cross-check table and revise the &lt;code dir=&quot;auto&quot;&gt;Charter&lt;/code&gt; entry to acknowledge tiered composition. Replace every &lt;code dir=&quot;auto&quot;&gt;shipped/&lt;/code&gt; path with &lt;code dir=&quot;auto&quot;&gt;built-in/&lt;/code&gt;. Estimated effort: 1 PR; ~300 lines net additions.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Reconcile the mission spec internally&lt;/strong&gt; (&lt;code dir=&quot;auto&quot;&gt;kitty-specs/layered-doctrine-org-layer-01KRNPEE/spec.md&lt;/code&gt;): change FR-001 wording from &lt;code dir=&quot;auto&quot;&gt;shipped&lt;/code&gt; to &lt;code dir=&quot;auto&quot;&gt;built-in&lt;/code&gt;; rename the &lt;code dir=&quot;auto&quot;&gt;DoctrineLayers&lt;/code&gt; and &lt;code dir=&quot;auto&quot;&gt;SourceAttribution&lt;/code&gt; entities accordingly; pick one canonical term among &lt;code dir=&quot;auto&quot;&gt;provenance&lt;/code&gt; vs &lt;code dir=&quot;auto&quot;&gt;source attribution&lt;/code&gt; (recommendation: &lt;code dir=&quot;auto&quot;&gt;provenance&lt;/code&gt;, since that is what the code uses end-to-end). The spec is the source of truth for future maintenance — internal inconsistency multiplies its cost. Estimated effort: 1 small PR.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Amend the predecessor blueprint&lt;/strong&gt; (&lt;code dir=&quot;auto&quot;&gt;docs/development/layered-doctrine-resolution-design.md&lt;/code&gt;) to note that the &lt;code dir=&quot;auto&quot;&gt;ID collision semantics&lt;/code&gt; row was superseded by ADR &lt;code dir=&quot;auto&quot;&gt;2026-05-16-1&lt;/code&gt; and the &lt;code dir=&quot;auto&quot;&gt;Target resolution stack&lt;/code&gt; diagram should describe field-merge with collision warnings. Estimated effort: 5-line edit.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Refactor &lt;code dir=&quot;auto&quot;&gt;DoctrineLayerCollisionWarning&lt;/code&gt; to carry structured data&lt;/strong&gt;, and update &lt;code dir=&quot;auto&quot;&gt;doctor.py::_collect_doctrine_collisions&lt;/code&gt; to consume attributes instead of regex-parsing the message string. This removes the brittleness flagged in MEDIUM-1’s post-review and makes the JSON output schema-stable. Estimated effort: small PR; touches &lt;code dir=&quot;auto&quot;&gt;src/doctrine/base.py&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;src/doctrine/agent_profiles/repository.py&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;src/specify_cli/cli/commands/doctor.py&lt;/code&gt; plus tests.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Add a Journey 006&lt;/strong&gt; to &lt;code dir=&quot;auto&quot;&gt;docs/plans/user_journey/&lt;/code&gt; covering org-pack adoption + collision audit, with the platform lead as actor. Use the existing user-journey template; the workflow content is already implicit in the &lt;code dir=&quot;auto&quot;&gt;docs/guides/create-an-org-doctrine-pack.md&lt;/code&gt; how-to.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Wire &lt;code dir=&quot;auto&quot;&gt;apply_org_charter_to_interview&lt;/code&gt; into the non-interactive &lt;code dir=&quot;auto&quot;&gt;default_interview&lt;/code&gt; compile path&lt;/strong&gt; at &lt;code dir=&quot;auto&quot;&gt;src/specify_cli/cli/commands/charter.py:1385&lt;/code&gt; (the second call site flagged in the HIGH-2 review). Today only the interactive &lt;code dir=&quot;auto&quot;&gt;charter interview&lt;/code&gt; command applies the pre-fill; agent-driven non-interactive bootstraps do not. Estimated effort: 1 small PR; mirrors the HIGH-2 pattern.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Add a dedicated pack-N-over-pack-(N-1) collision test&lt;/strong&gt; (current coverage is incidental in &lt;code dir=&quot;auto&quot;&gt;TestMultiplePackPrecedence&lt;/code&gt;). Future refactors of the org-loop could regress without this guard.&lt;/li&gt;
&lt;/ol&gt;
&lt;hr&gt;
&lt;h2 id=&quot;process-architecture-where-the-glossary--architecture-alignment-failed&quot;&gt;Process architecture: where the glossary / architecture alignment failed&lt;/h2&gt;
&lt;p&gt;The mission shipped 10 well-tested WPs and passed every per-WP review. Three substantive drifts surfaced only at post-merge mission review (HIGH-1 multi-pack, HIGH-2 dead-code wiring, MEDIUM-1 spec vs code on field-merge), and the ~30 glossary terms left unglossed surfaced only when &lt;strong&gt;this&lt;/strong&gt; review was performed.&lt;/p&gt;
&lt;p&gt;The question is: was this an execution error (the people / agents skipped a check that exists), a structural gap (no check exists), or both?&lt;/p&gt;
&lt;p&gt;The evidence below says &lt;strong&gt;both — but the structural gap is primary and reliably reproduces the execution failure&lt;/strong&gt;. Fix the structure and the execution failure becomes unlikely; lecture the operators without fixing the structure and the failure recurs in the next mission.&lt;/p&gt;
&lt;h3 id=&quot;evidence-from-this-mission&quot;&gt;Evidence from this mission&lt;/h3&gt;



































&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Artifact&lt;/th&gt;&lt;th&gt;Status on disk&lt;/th&gt;&lt;th&gt;Implication&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;kitty-specs/.../analysis-report.md&lt;/code&gt; or equivalent&lt;/td&gt;&lt;td&gt;&lt;strong&gt;Absent&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;/spec-kitty.analyze&lt;/code&gt; was never invoked on this mission.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;kitty-specs/.../checklists/requirements.md&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Present&lt;/td&gt;&lt;td&gt;The requirements-quality checklist ran. It is scoped to “do the FRs have IDs, statuses, measurable thresholds” — not to terminology or ADR alignment.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;kitty-specs/.../mission-review-report.md&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Present (from my run)&lt;/td&gt;&lt;td&gt;Mission-review post-merge caught MEDIUM-1 and HIGH-1/HIGH-2. It missed the glossary-vs-spec drift because the skill text does not direct the reviewer to compare against &lt;code dir=&quot;auto&quot;&gt;docs/context/*.md&lt;/code&gt;.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;kitty-specs/.../tasks/WP02-base-repository-org-layer.md&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Contains the line: &lt;em&gt;“Key invariant to preserve: The existing &lt;code dir=&quot;auto&quot;&gt;_merge()&lt;/code&gt; (field-level merge) is used … The same field-level merge is used for org overrides of shipped.”&lt;/em&gt;&lt;/td&gt;&lt;td&gt;The WP02 task file &lt;strong&gt;explicitly ratified field-merge&lt;/strong&gt; as a key invariant. The mission spec (&lt;code dir=&quot;auto&quot;&gt;spec.md&lt;/code&gt; FR-003) &lt;strong&gt;explicitly forbade field-merge&lt;/strong&gt;. No reviewer caught the contradiction between the WP task file and the spec it depends on.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Reviewer profile &lt;code dir=&quot;auto&quot;&gt;reviewer-renata.agent.yaml&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Loads directive &lt;strong&gt;032 Conceptual Alignment&lt;/strong&gt; with rationale: &lt;em&gt;“Terminology in code and docs must align with the project glossary — language drift signals architectural drift.”&lt;/em&gt;&lt;/td&gt;&lt;td&gt;The structural rule for glossary alignment &lt;strong&gt;exists and is loaded by the reviewer’s profile&lt;/strong&gt;. It was not applied — the per-WP review prompts do not surface a glossary checklist step.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;h3 id=&quot;where-each-alignment-should-happen-what-each-tool-does-and-the-gap&quot;&gt;Where each alignment SHOULD happen, what each tool DOES, and the gap&lt;/h3&gt;
&lt;p&gt;Walking the mission lifecycle:&lt;/p&gt;











































































&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Phase&lt;/th&gt;&lt;th&gt;Tool / skill&lt;/th&gt;&lt;th&gt;Theoretical capability&lt;/th&gt;&lt;th&gt;What it actually does&lt;/th&gt;&lt;th&gt;Gap&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;/spec-kitty.specify&lt;/code&gt;&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;.claude/commands/spec-kitty.specify.md&lt;/code&gt; + author&lt;/td&gt;&lt;td&gt;Could require the spec to cite glossary terms; could auto-flag undefined domain language&lt;/td&gt;&lt;td&gt;No glossary check. Does say “do not mix functional and non-functional”; does not say “cite the glossary for any new domain term you introduce”.&lt;/td&gt;&lt;td&gt;&lt;strong&gt;STRUCTURAL&lt;/strong&gt;: no glossary linter on spec-authoring boundary.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;/spec-kitty.plan&lt;/code&gt;&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;.claude/commands/spec-kitty.plan.md&lt;/code&gt; + author&lt;/td&gt;&lt;td&gt;Could require the plan to cite architectural ADRs; could compare the plan’s design decisions against existing ADRs and flag conflicts&lt;/td&gt;&lt;td&gt;No ADR-fit check. The blueprint’s “full-replace” decision contradicted both the existing &lt;code dir=&quot;auto&quot;&gt;_merge()&lt;/code&gt; code and what would later become ADR &lt;code dir=&quot;auto&quot;&gt;2026-05-16-1&lt;/code&gt;; no automation detected this.&lt;/td&gt;&lt;td&gt;&lt;strong&gt;STRUCTURAL&lt;/strong&gt;: no automated “this plan conflicts with ADR X” check.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;/spec-kitty.tasks&lt;/code&gt; + &lt;code dir=&quot;auto&quot;&gt;tasks-finalize&lt;/code&gt;&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;.claude/commands/spec-kitty.tasks.md&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Could require each WP’s &lt;code dir=&quot;auto&quot;&gt;owned_files&lt;/code&gt; to be consistent with the spec / plan invariants&lt;/td&gt;&lt;td&gt;Validates dependency graph + lane assignment. No content checks (no “the WP02 ‘Key invariant to preserve’ note must agree with FR-003”).&lt;/td&gt;&lt;td&gt;&lt;strong&gt;STRUCTURAL&lt;/strong&gt;: WP-level invariant notes are free-form prose; no formal contract that binds them to the spec text.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;/spec-kitty.analyze&lt;/code&gt;&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;.claude/commands/spec-kitty.analyze.md&lt;/code&gt; (CRITICAL: this skill exists and would have caught some drift)&lt;/td&gt;&lt;td&gt;Detection passes include “Terminology drift (same concept named differently across files)” and “Charter Alignment” — &lt;code dir=&quot;auto&quot;&gt;Inconsistency&lt;/code&gt; category F&lt;/td&gt;&lt;td&gt;&lt;strong&gt;It is opt-in and not gated.&lt;/strong&gt; Never invoked on this mission. The skill only checks spec/plan/tasks against each other and against the project charter — &lt;strong&gt;NOT against &lt;code dir=&quot;auto&quot;&gt;docs/context/*.md&lt;/code&gt; or against &lt;code dir=&quot;auto&quot;&gt;docs/adr/2.x/*.md&lt;/code&gt;&lt;/strong&gt;.&lt;/td&gt;&lt;td&gt;&lt;strong&gt;PRIMARY STRUCTURAL + EXECUTION&lt;/strong&gt;: opt-in (executor can skip → did skip) AND scope-limited (would not have caught glossary drift even if run).&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;/spec-kitty.implement&lt;/code&gt; (per-WP)&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;.claude/commands/spec-kitty.implement.md&lt;/code&gt; + per-WP prompt file&lt;/td&gt;&lt;td&gt;Could surface a “consult glossary before introducing terminology” checklist item&lt;/td&gt;&lt;td&gt;The generated prompt focuses on &lt;code dir=&quot;auto&quot;&gt;owned_files&lt;/code&gt;, acceptance criteria, integration verification. No glossary surface.&lt;/td&gt;&lt;td&gt;&lt;strong&gt;STRUCTURAL&lt;/strong&gt;: implement-prompt template does not include a terminology-fidelity item.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;/spec-kitty.review&lt;/code&gt; (per-WP)&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;.claude/commands/spec-kitty.review.md&lt;/code&gt; + reviewer profile&lt;/td&gt;&lt;td&gt;reviewer-renata has directive 032 loaded; the directive’s rationale is “Terminology in code and docs must align with the project glossary”&lt;/td&gt;&lt;td&gt;The review prompt does NOT include a glossary-check step. &lt;strong&gt;Directive loaded ≠ checklist enforced.&lt;/strong&gt; No item in the per-WP review prompt prompts the reviewer to grep the glossary.&lt;/td&gt;&lt;td&gt;&lt;strong&gt;STRUCTURAL + EXECUTION&lt;/strong&gt;: the review prompt template owes the reviewer a glossary checkpoint; it doesn’t have one. The directive is information, not enforcement.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;spec-kitty-mission-review&lt;/code&gt; (post-merge)&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;.claude/skills/spec-kitty-mission-review/SKILL.md&lt;/code&gt; (the skill I ran for this mission)&lt;/td&gt;&lt;td&gt;Step 5 (FR Trace) and Step 6 (Drift and Gap Analysis) could be extended to include a “glossary diff” pass and an “ADR diff” pass&lt;/td&gt;&lt;td&gt;Caught MEDIUM-1 because the spec’s text is internally inconsistent (FR-003 in plan vs FR-003 wording in spec.md). Did NOT catch: (a) &lt;code dir=&quot;auto&quot;&gt;shipped&lt;/code&gt; → &lt;code dir=&quot;auto&quot;&gt;built-in&lt;/code&gt; rename inconsistent across spec sections; (b) &lt;code dir=&quot;auto&quot;&gt;provenance&lt;/code&gt; vs &lt;code dir=&quot;auto&quot;&gt;source attribution&lt;/code&gt; term clash; (c) ~30 doctrine concepts unglossed. The skill’s drift detection is implementation-vs-spec, not spec-vs-glossary.&lt;/td&gt;&lt;td&gt;&lt;strong&gt;STRUCTURAL&lt;/strong&gt;: glossary diff is not a step in the skill.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;spec-kitty-glossary-context&lt;/code&gt; (curation skill)&lt;/td&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;.claude/skills/spec-kitty-glossary-context/SKILL.md&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Pull-based: operator says “update the glossary” or “fix term drift”&lt;/td&gt;&lt;td&gt;It is operator-pull, never auto-invoked on any mission boundary.&lt;/td&gt;&lt;td&gt;&lt;strong&gt;STRUCTURAL&lt;/strong&gt;: the curation tool is not wired into the planning / review pipeline.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;tests/architectural/test_layer_rules.py&lt;/code&gt;&lt;/td&gt;&lt;td&gt;pytestarch static analysis&lt;/td&gt;&lt;td&gt;Enforces import-direction rules at code level&lt;/td&gt;&lt;td&gt;Works correctly. Caught nothing during the mission because the implementer correctly respected the boundary (with one early confusion that was resolved).&lt;/td&gt;&lt;td&gt;(Not a gap — code-level structural check that worked as designed.)&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;h3 id=&quot;verdict-structural-gap-is-primary&quot;&gt;Verdict: structural gap is primary&lt;/h3&gt;
&lt;p&gt;There are &lt;strong&gt;four&lt;/strong&gt; distinct missed checks, of which &lt;strong&gt;three are structural gaps&lt;/strong&gt; and &lt;strong&gt;one is an execution failure that the structural gap created&lt;/strong&gt;:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;STRUCTURAL — Glossary alignment never gates a phase.&lt;/strong&gt; &lt;code dir=&quot;auto&quot;&gt;docs/context/*.md&lt;/code&gt; is treated as a reference document, not as a gate input to any tool. The reviewer profile loads directive 032, but the per-WP review prompt template never surfaces it as a checklist item. The mission-review skill (which I ran) does not include a glossary-diff step. The &lt;code dir=&quot;auto&quot;&gt;spec-kitty-glossary-context&lt;/code&gt; skill is operator-pull, never auto-invoked.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;STRUCTURAL — No planning-time ADR-fit check exists.&lt;/strong&gt; &lt;code dir=&quot;auto&quot;&gt;/spec-kitty.plan&lt;/code&gt; and &lt;code dir=&quot;auto&quot;&gt;/spec-kitty.analyze&lt;/code&gt; validate spec/plan/tasks against each other and against the project charter, never against &lt;code dir=&quot;auto&quot;&gt;docs/adr/2.x/*.md&lt;/code&gt;. The “full-replace vs field-merge” intent drift was thus undetectable until post-merge.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;STRUCTURAL — WP task-file “Key invariant to preserve” notes are unbound to the spec.&lt;/strong&gt; WP02 wrote “field-level merge is the key invariant” while FR-003 said the opposite. There is no contract that binds WP-level invariant notes to the spec they implement; no analyzer cross-checks them.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;EXECUTION — &lt;code dir=&quot;auto&quot;&gt;/spec-kitty.analyze&lt;/code&gt; was not invoked on this mission.&lt;/strong&gt; It is opt-in. The operator skipped it. (Even if invoked, it would only have caught the spec’s internal FR-001 vs FR-003 inconsistency on &lt;code dir=&quot;auto&quot;&gt;shipped&lt;/code&gt; — the structural-gap analysis above explains why everything else was outside its scope.)&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The structural gaps reliably reproduce the execution failure. An operator running &lt;code dir=&quot;auto&quot;&gt;/spec-kitty.analyze&lt;/code&gt; on the next mission would still miss the glossary drift (because analyze doesn’t compare against the glossary). A reviewer applying directive 032 would still skip the glossary check (because the review prompt doesn’t surface it). The only place the failure stops is post-merge mission review — and even my own application of that skill missed the glossary drift.&lt;/p&gt;
&lt;h3 id=&quot;recommended-process-architecture-changes&quot;&gt;Recommended process-architecture changes&lt;/h3&gt;
&lt;p&gt;Ordered by leverage. These are skill / prompt / template changes, not new tooling. None require new modules.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Add a glossary-alignment detection pass to &lt;code dir=&quot;auto&quot;&gt;/spec-kitty.analyze&lt;/code&gt;.&lt;/strong&gt; Extend the skill text to enumerate every domain term used in &lt;code dir=&quot;auto&quot;&gt;spec.md&lt;/code&gt; and grep it against &lt;code dir=&quot;auto&quot;&gt;docs/context/*.md&lt;/code&gt;. Findings go in a new Section G (“Glossary Alignment”) with severity HIGH for “spec introduces term not in glossary” and MEDIUM for “spec uses term with different definition than glossary”. Effort: skill text update; no new code.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Add an ADR-fit detection pass to &lt;code dir=&quot;auto&quot;&gt;/spec-kitty.analyze&lt;/code&gt;.&lt;/strong&gt; Enumerate the decisions in &lt;code dir=&quot;auto&quot;&gt;plan.md&lt;/code&gt;’s “Architecture / stack choices” section and compare against the title lines of &lt;code dir=&quot;auto&quot;&gt;docs/adr/2.x/*.md&lt;/code&gt;. Findings flag any plan decision that contradicts an existing ADR’s title. Effort: skill text update.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Make &lt;code dir=&quot;auto&quot;&gt;/spec-kitty.analyze&lt;/code&gt; a gate before &lt;code dir=&quot;auto&quot;&gt;/spec-kitty.implement&lt;/code&gt;, not an optional pre-flight.&lt;/strong&gt; Today the operator can skip it; the analysis report should be a required artifact (saved to &lt;code dir=&quot;auto&quot;&gt;kitty-specs/&amp;#x3C;mission&gt;/analysis-report.md&lt;/code&gt;) before any WP enters &lt;code dir=&quot;auto&quot;&gt;in_progress&lt;/code&gt;. Implementation: a check in &lt;code dir=&quot;auto&quot;&gt;spec-kitty agent action implement&lt;/code&gt; that errors if &lt;code dir=&quot;auto&quot;&gt;analysis-report.md&lt;/code&gt; is missing OR was generated against an older &lt;code dir=&quot;auto&quot;&gt;spec.md&lt;/code&gt; mtime. Effort: small CLI change + skill update.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Surface directive 032 in the per-WP review prompt.&lt;/strong&gt; The reviewer profile already loads directive 032 (Conceptual Alignment). The per-WP review prompt template (in &lt;code dir=&quot;auto&quot;&gt;src/specify_cli/.../review_prompts/&lt;/code&gt;) should include a step: &lt;em&gt;“For every new domain term in the WP diff, confirm it appears in &lt;code dir=&quot;auto&quot;&gt;docs/context/*.md&lt;/code&gt; with the same meaning. Flag mismatches.”&lt;/em&gt; This converts “directive in profile context” into “checklist item the reviewer cannot skip silently”. Effort: prompt-template addition.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Bind WP task-file “Key invariant to preserve” notes to the spec.&lt;/strong&gt; Either drop the prose-only field (and replace with explicit &lt;code dir=&quot;auto&quot;&gt;requirement_refs&lt;/code&gt; of the FRs the invariant restates), or have &lt;code dir=&quot;auto&quot;&gt;tasks-finalize&lt;/code&gt; parse the prose and emit a warning if the invariant’s claim contradicts the referenced FR’s text. Lighter alternative: forbid the prose field entirely; rely on &lt;code dir=&quot;auto&quot;&gt;requirement_refs&lt;/code&gt; and let &lt;code dir=&quot;auto&quot;&gt;/analyze&lt;/code&gt; do the comparison.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Extend the &lt;code dir=&quot;auto&quot;&gt;spec-kitty-mission-review&lt;/code&gt; skill with a glossary-diff and ADR-diff step.&lt;/strong&gt; Add steps 5.5 (Glossary Diff) and 5.6 (ADR Alignment) to the skill text. These run after the FR Trace and before the verdict. Findings of class GLOSSARY-DRIFT or ADR-CONTRADICTION elevate the report verdict to PASS-WITH-NOTES at minimum.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Auto-invoke &lt;code dir=&quot;auto&quot;&gt;spec-kitty-glossary-context&lt;/code&gt; curation on every &lt;code dir=&quot;auto&quot;&gt;/spec-kitty.specify&lt;/code&gt; boundary.&lt;/strong&gt; When a new spec is created, the skill should be asked to enumerate the spec’s domain terms and propose glossary updates as a separate PR companion. Curator can accept or modify; the mission cannot proceed to &lt;code dir=&quot;auto&quot;&gt;/plan&lt;/code&gt; until the glossary side-PR is at least proposed.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&quot;architects-verdict-on-root-cause&quot;&gt;Architect’s verdict on root cause&lt;/h3&gt;
&lt;p&gt;The implementation team did good work. The drift problems are not “people skipped their checks”; they are “the system does not have a check at the right boundary, so the check that exists in the profile directive never becomes a checklist item the reviewer reads”.&lt;/p&gt;
&lt;p&gt;The single highest-leverage fix is &lt;strong&gt;#4 (surface directive 032 in the per-WP review prompt)&lt;/strong&gt;, because it converts existing latent guidance into actively-applied review work without requiring new tooling or new skills. The second highest-leverage fix is &lt;strong&gt;#3 (make analyze gating, not optional)&lt;/strong&gt;, because it converts a power-user skill into a default gate that catches half the drift before code lands.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&quot;root-cause-is-this-caused-by-a-lack-of-project-charter-or-a-deeper-issue&quot;&gt;Root cause: is this caused by a lack of project charter, or a deeper issue?&lt;/h2&gt;
&lt;p&gt;The project has a charter — &lt;code dir=&quot;auto&quot;&gt;.kittify/charter/charter.md&lt;/code&gt;, 278 lines, version 1.1.5, actively maintained. So the answer to “is this caused by lack of charter” is &lt;strong&gt;no&lt;/strong&gt;. The deeper issue is what the charter itself documents at lines 266-272:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Regression Vigilance (2026-04-06):&lt;/strong&gt; The &lt;code dir=&quot;auto&quot;&gt;--feature&lt;/code&gt; → &lt;code dir=&quot;auto&quot;&gt;--mission&lt;/code&gt; rename has been a persistent source of regressions. Mission 065 swept ~45 user-facing references, &lt;strong&gt;but the pattern keeps recurring because:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;New code copies from old code that still uses &lt;code dir=&quot;auto&quot;&gt;feature&lt;/code&gt; as variable names …&lt;/li&gt;
&lt;li&gt;Error messages and guidance strings are written ad-hoc without checking the canon&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Subagent-implemented code may not see this charter&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/blockquote&gt;
&lt;p&gt;The charter is &lt;strong&gt;conscious of its own enforcement failure&lt;/strong&gt;. It explicitly names the structural problem (point 3) and tries to compensate with “Hyper-vigilance rules” — but those rules are still prose (“Code reviewers MUST grep for …”), not automated gates. What just happened with &lt;code dir=&quot;auto&quot;&gt;shipped → built-in&lt;/code&gt; and &lt;code dir=&quot;auto&quot;&gt;provenance / source attribution&lt;/code&gt; is the same pattern the charter predicted, simply applied to a different term-pair that hasn’t yet earned its own “Regression Vigilance” section.&lt;/p&gt;
&lt;h3 id=&quot;three-nested-causes-deepest-first&quot;&gt;Three nested causes, deepest first&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Dogfood gap (deepest).&lt;/strong&gt; Spec-kitty is the framework that builds layered doctrine pipelines for other projects — three-layer resolution, provenance tagging, charter-context injection, doctrine-pack validation, the whole apparatus. &lt;strong&gt;Spec-kitty does not auto-apply that pipeline to its own missions.&lt;/strong&gt; When the doctrine framework runs on the doctrine framework’s own development, the doctrine layer is read-only context; nothing in the workflow injects the charter’s terminology canon into the per-WP review prompt the way &lt;code dir=&quot;auto&quot;&gt;charter context --action implement&lt;/code&gt; would inject it into a downstream consumer’s agent context. The charter is documentation that humans (and human-driven LLM reviewers) are expected to read; it is not a gate.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Policy-vs-mechanism asymmetry.&lt;/strong&gt; The charter contains policy (“terminology canon”, “regression vigilance rules”, “code reviewers MUST grep for X”). The framework lacks mechanism — there is no &lt;code dir=&quot;auto&quot;&gt;spec-kitty agent action review&lt;/code&gt; step that calls a terminology linter, no &lt;code dir=&quot;auto&quot;&gt;/spec-kitty.analyze&lt;/code&gt; pass that diffs against the charter’s &lt;code dir=&quot;auto&quot;&gt;Terminology Canon&lt;/code&gt; section. The reviewer profile loads directive 032 &lt;em&gt;because directive 032 exists in the doctrine catalog&lt;/em&gt;, but the review prompt template does not render it as a checklist item. Policy without mechanism degrades to empty process.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Drift-prone artefact split.&lt;/strong&gt; The same canonical term lives in five places: &lt;code dir=&quot;auto&quot;&gt;docs/context/*.md&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;charter.md&lt;/code&gt; “Terminology Canon”, individual ADRs, mission spec Domain Language tables, and code symbols. There is no single source of truth and no diff between them. The charter’s “Hyper-vigilance” section is the symptom of recognising this — a senior reviewer noticed the same drift kept recurring across missions and tried to legislate against it. Legislation without an executor is hope.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&quot;why-more-charter-is-not-the-answer&quot;&gt;Why “more charter” is not the answer&lt;/h3&gt;
&lt;p&gt;If we wrote a new charter clause that said “every spec must cite the glossary for any new term” or “every WP review must run a glossary-diff before approval”, we would be solving the wrong problem. The charter already says equivalent things for Mission/Feature and Branch-Intent terminology. The next mission would still drift in some other dimension because charter prose is not what blocks merges — automated gates are. Adding more prose to the charter without adding the gate is what produced the 2026-04-06 “Regression Vigilance” pattern: an honest admission of recurring failure addressed with more prose.&lt;/p&gt;
&lt;h3 id=&quot;what-the-answer-actually-is&quot;&gt;What the answer actually is&lt;/h3&gt;
&lt;p&gt;The structural-gap recommendations from &lt;a href=&quot;#process-architecture-where-the-glossary--architecture-alignment-failed&quot;&gt;Process architecture&lt;/a&gt; above, with one addition: a charter clause that &lt;strong&gt;says spec-kitty must enforce its own charter via gates, not via reviewer attention&lt;/strong&gt;. Specifically:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code dir=&quot;auto&quot;&gt;/spec-kitty.analyze&lt;/code&gt; becomes a gate (not opt-in) AND extends its detection to diff against &lt;code dir=&quot;auto&quot;&gt;charter.md&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;docs/context/*.md&lt;/code&gt;, and &lt;code dir=&quot;auto&quot;&gt;docs/adr/2.x/*.md&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The per-WP &lt;code dir=&quot;auto&quot;&gt;review&lt;/code&gt; prompt template renders directive 032 as an explicit checklist item the reviewer must answer.&lt;/li&gt;
&lt;li&gt;&lt;code dir=&quot;auto&quot;&gt;spec-kitty-mission-review&lt;/code&gt; skill grows a glossary-diff and ADR-diff step.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;These three changes are the mechanism the charter is missing. They convert “Hyper-vigilance rules” (prose appeals to reviewer attention) into “gates that fail loudly when drift is introduced”.&lt;/p&gt;
&lt;h3 id=&quot;one-line-takeaway&quot;&gt;One-line takeaway&lt;/h3&gt;
&lt;p&gt;It is not a charter gap. It is a &lt;strong&gt;dogfood gap&lt;/strong&gt;: spec-kitty’s own missions are not subject to the same auto-applied doctrine pipeline that spec-kitty builds for its users. Closing the dogfood gap is the structural fix; everything else is symptom management.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&quot;empirical-addendum-the-doctrinecharter-pipeline-is-invoked-at-the-implement-boundary--but-what-it-returns-is-degenerate&quot;&gt;Empirical addendum: the doctrine/charter pipeline IS invoked at the implement boundary — but what it returns is degenerate&lt;/h2&gt;
&lt;p&gt;After the first round of analysis above, a sharper read of the question came back: &lt;em&gt;the framework IS being used to build itself; the issue is what the pipeline emits at the entry point&lt;/em&gt;. To answer empirically I installed &lt;code dir=&quot;auto&quot;&gt;spec-kitty-cli==3.1.8&lt;/code&gt; in a fresh venv and inspected (a) what &lt;code dir=&quot;auto&quot;&gt;spec-kitty charter context --action implement&lt;/code&gt; returns and (b) what the WP-prompt builder actually injects into the generated implement prompt.&lt;/p&gt;
&lt;h3 id=&quot;what-the-canonical-lookup-returns&quot;&gt;What the canonical lookup returns&lt;/h3&gt;
&lt;p&gt;Running &lt;code dir=&quot;auto&quot;&gt;spec-kitty charter context --action implement&lt;/code&gt; against this project (a software-dev mission) returns this verbatim:&lt;/p&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame not-content&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;Action: implement (compact)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;Governance:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;- Template set: software-dev-default&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;- Paradigms: (none)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;- Tools: git, spec-kitty&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;Directive IDs:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;- DIR-001&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;- DIR-002&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;- DIR-003&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;- DIR-004&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;Tactic IDs:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;- (none)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;Section Anchors:&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;- Spec Kitty Charter&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;- Purpose&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;- Technical Standards&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;- Languages and Frameworks&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;- Testing Requirements&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;- Performance and Scale&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;- Deployment and Constraints&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;- Architecture: Shared Package Boundaries&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;- ... (35 more section anchors) ...&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;- Terminology Canon (Mission vs Feature)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;- Regression Vigilance (2026-04-06)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;- Diagnostics: No available_tools selection provided; using runtime tool registry fallback. | Template set not selected in charter; fallback &apos;software-dev-default&apos; applied.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;- Languages: python&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span class=&quot;indent&quot;&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;--0:#d6deeb;--1:#403f53&quot;&gt;- Project root: .../.kittify/doctrine&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;h3 id=&quot;what-the-wp-implement-prompt-actually-contains&quot;&gt;What the WP implement prompt actually contains&lt;/h3&gt;
&lt;p&gt;The runtime prompt builder calls this same resolver. &lt;code dir=&quot;auto&quot;&gt;src/specify_cli/next/prompt_builder.py::_build_wp_prompt&lt;/code&gt; invokes &lt;code dir=&quot;auto&quot;&gt;_governance_context(repo_root, action=&quot;implement&quot;)&lt;/code&gt; at line 147 for every implement and review prompt, and the function in turn calls &lt;code dir=&quot;auto&quot;&gt;charter.context.build_charter_context(repo_root, action=action, mark_loaded=True)&lt;/code&gt; at line 273. The output is injected verbatim into the WP prompt above the “CRITICAL: work package ISOLATION RULES” block.&lt;/p&gt;
&lt;p&gt;The implement template at &lt;code dir=&quot;auto&quot;&gt;src/specify_cli/missions/software-dev/command-templates/implement.md:68-71&lt;/code&gt; then &lt;strong&gt;explicitly forbids&lt;/strong&gt; the agent from looking elsewhere for governance:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;“The output of &lt;code dir=&quot;auto&quot;&gt;spec-kitty agent action implement ...&lt;/code&gt; is the authoritative work package prompt and execution context. Do &lt;strong&gt;not&lt;/strong&gt; separately call &lt;code dir=&quot;auto&quot;&gt;spec-kitty charter context&lt;/code&gt; or rummage through unrelated files looking for a ‘newer’ prompt unless the command output tells you to.”&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;So the pipeline IS wired. The entry point exists. The agent is told to trust it.&lt;/p&gt;
&lt;h3 id=&quot;why-compact-wiring--authoritative-still-failed&quot;&gt;Why “compact wiring + authoritative” still failed&lt;/h3&gt;
&lt;p&gt;The resolved context the agent receives is informationally degenerate in four ways that compound:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Section anchors only, not section bodies.&lt;/strong&gt; The &lt;code dir=&quot;auto&quot;&gt;Section Anchors&lt;/code&gt; list contains &lt;code dir=&quot;auto&quot;&gt;Terminology Canon (Mission vs Feature)&lt;/code&gt; and &lt;code dir=&quot;auto&quot;&gt;Regression Vigilance (2026-04-06)&lt;/code&gt; as headings. &lt;strong&gt;The actual hyper-vigilance rules in those sections — the very prose that says “Use Mission as canonical, Feature is prohibited, reviewers MUST grep for —feature” — do not appear in the prompt.&lt;/strong&gt; The agent sees a table of contents and is told to treat it as authoritative.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Charter directive namespace ≠ doctrine catalog directive namespace.&lt;/strong&gt; The lookup returns &lt;code dir=&quot;auto&quot;&gt;DIR-001 / DIR-002 / DIR-003 / DIR-004&lt;/code&gt;. Those are the project’s actual directives, auto-extracted from &lt;code dir=&quot;auto&quot;&gt;charter.md&lt;/code&gt; by &lt;code dir=&quot;auto&quot;&gt;spec-kitty charter sync&lt;/code&gt; (the file &lt;code dir=&quot;auto&quot;&gt;.kittify/charter/directives.yaml&lt;/code&gt; is auto-generated and contains exactly these four). However, the agent profile loaded for the WP (e.g. python-pedro for an implementer) references &lt;strong&gt;doctrine-catalog directives&lt;/strong&gt; in a parallel namespace: &lt;code dir=&quot;auto&quot;&gt;DIRECTIVE_010&lt;/code&gt; (Specification Fidelity), &lt;code dir=&quot;auto&quot;&gt;DIRECTIVE_024&lt;/code&gt; (Locality of Change), &lt;code dir=&quot;auto&quot;&gt;DIRECTIVE_025&lt;/code&gt; (Boy Scout), &lt;code dir=&quot;auto&quot;&gt;DIRECTIVE_030&lt;/code&gt; (Test &amp;#x26; Typecheck Quality Gate), &lt;code dir=&quot;auto&quot;&gt;DIRECTIVE_034&lt;/code&gt; (Test-First). Those &lt;code dir=&quot;auto&quot;&gt;DIRECTIVE_NNN&lt;/code&gt; IDs &lt;strong&gt;do not appear&lt;/strong&gt; in the resolved charter context. The reviewer’s profile references &lt;code dir=&quot;auto&quot;&gt;DIRECTIVE_032&lt;/code&gt; (Conceptual Alignment — the very directive that says “terminology in code and docs must align with the project glossary”). It also does not appear. The charter sync extracts charter-prose directives into the charter namespace; the doctrine catalog directives are never surfaced at the WP-prompt boundary.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;code dir=&quot;auto&quot;&gt;Tactic IDs: (none)&lt;/code&gt; and &lt;code dir=&quot;auto&quot;&gt;Paradigms: (none)&lt;/code&gt;.&lt;/strong&gt; The reviewer-renata profile cares about tactics like &lt;code dir=&quot;auto&quot;&gt;code-review-incremental&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;language-driven-design&lt;/code&gt; (which the profile’s rationale explicitly says: &lt;em&gt;“Detect terminology conflicts in diffs as early signals of architectural problems”&lt;/em&gt;), &lt;code dir=&quot;auto&quot;&gt;reverse-speccing&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;test-readability-clarity-check&lt;/code&gt;. None of these surface. The doctrine catalog has dozens of tactics; the resolver returns zero.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Charter sync fallback diagnostics are buried.&lt;/strong&gt; The resolved context has a &lt;code dir=&quot;auto&quot;&gt;Diagnostics:&lt;/code&gt; line that reveals &lt;strong&gt;two systemic config gaps in this project’s charter&lt;/strong&gt;: &lt;em&gt;“No available_tools selection provided; using runtime tool registry fallback. | Template set not selected in charter; fallback ‘software-dev-default’ applied.”&lt;/em&gt; These diagnostics tell the experienced reader that the charter is under-specifying its own configuration — but they’re at the bottom of the section-anchor list, buried in prose, easy to miss.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Glossary and ADR pointers are absent.&lt;/strong&gt; There is no line that says “consult &lt;code dir=&quot;auto&quot;&gt;docs/context/*.md&lt;/code&gt; for canonical terminology” and no line that says “the ADRs that constrain this work live in &lt;code dir=&quot;auto&quot;&gt;docs/adr/2.x/*.md&lt;/code&gt;”. The agent has no signposted way to discover either, and the template’s “do not rummage” rule actively discourages looking.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&quot;the-mechanism-that-produced-the-recent-drift-in-one-sentence&quot;&gt;The mechanism that produced the recent drift, in one sentence&lt;/h3&gt;
&lt;p&gt;The WP implement / review prompt &lt;strong&gt;invokes the doctrine-charter pipeline, gets back a table of contents with four charter-extracted directives and zero tactics in the wrong ID namespace, and tells the agent that this content-free injection is authoritative.&lt;/strong&gt; No directive, no tactic, no glossary pointer, no ADR pointer — and an explicit instruction not to look elsewhere. The agent then implements code without the governance it would have read if it had been allowed to look.&lt;/p&gt;
&lt;p&gt;This is exactly the past pattern. The Mission-vs-Feature “Regression Vigilance (2026-04-06)” section in &lt;code dir=&quot;auto&quot;&gt;charter.md&lt;/code&gt; is the symptom of the same root cause: when the only place a rule lives is the section body of &lt;code dir=&quot;auto&quot;&gt;charter.md&lt;/code&gt;, and the WP prompt surfaces only the section title, the rule is invisible to the executing agent — by design.&lt;/p&gt;
&lt;h3 id=&quot;what-the-entry-point-is-missing&quot;&gt;What the entry point is missing&lt;/h3&gt;



































&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Component&lt;/th&gt;&lt;th&gt;Current behaviour&lt;/th&gt;&lt;th&gt;Needed behaviour&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;charter context --action implement&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Returns section anchors, charter-extracted directives (DIR-NNN), no tactics, no paradigms, no glossary pointer, no ADR pointer.&lt;/td&gt;&lt;td&gt;Return section anchors &lt;strong&gt;plus&lt;/strong&gt; the body of every section whose anchor is critical for the action (e.g. &lt;code dir=&quot;auto&quot;&gt;Terminology Canon&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;Regression Vigilance&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;Code Review Checklist&lt;/code&gt;); resolve the loaded &lt;strong&gt;agent profile&lt;/strong&gt;’s &lt;code dir=&quot;auto&quot;&gt;directive-references&lt;/code&gt; and &lt;code dir=&quot;auto&quot;&gt;tactic-references&lt;/code&gt; into actual &lt;code dir=&quot;auto&quot;&gt;DIRECTIVE_NNN&lt;/code&gt; and tactic bodies; emit explicit pointers to &lt;code dir=&quot;auto&quot;&gt;docs/context/*.md&lt;/code&gt; and &lt;code dir=&quot;auto&quot;&gt;docs/adr/2.x/*.md&lt;/code&gt;.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;charter sync&lt;/code&gt; (the auto-extractor)&lt;/td&gt;&lt;td&gt;Walks &lt;code dir=&quot;auto&quot;&gt;charter.md&lt;/code&gt; and extracts items it heuristically tags as directives into &lt;code dir=&quot;auto&quot;&gt;directives.yaml&lt;/code&gt; with sequential &lt;code dir=&quot;auto&quot;&gt;DIR-NNN&lt;/code&gt; IDs.&lt;/td&gt;&lt;td&gt;Cross-link extracted directives to doctrine catalog &lt;code dir=&quot;auto&quot;&gt;DIRECTIVE_NNN&lt;/code&gt; IDs when the charter cites them by reference (e.g. “see directive 032”). Today there is no such cross-link; the two namespaces float free.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;_governance_context&lt;/code&gt; in &lt;code dir=&quot;auto&quot;&gt;prompt_builder.py&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Calls &lt;code dir=&quot;auto&quot;&gt;build_charter_context(action=action, mark_loaded=True)&lt;/code&gt; once and injects the compact text.&lt;/td&gt;&lt;td&gt;Additionally render the &lt;strong&gt;loaded agent profile’s&lt;/strong&gt; directive-references and tactic-references inline (the profile is selected for the WP — it should pull its own directives into the prompt).&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;implement.md&lt;/code&gt; runtime template lines 68-71&lt;/td&gt;&lt;td&gt;Explicitly forbids the agent from looking elsewhere.&lt;/td&gt;&lt;td&gt;Either (a) remove the forbid clause now that the prompt is augmented, or (b) keep the forbid clause AND ensure the prompt actually contains the rule bodies, not just anchors.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code dir=&quot;auto&quot;&gt;.kittify/charter/charter.md&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Does not declare a template set, does not declare &lt;code dir=&quot;auto&quot;&gt;available_tools&lt;/code&gt;.&lt;/td&gt;&lt;td&gt;Add an explicit &lt;code dir=&quot;auto&quot;&gt;template_set: software-dev-default&lt;/code&gt; and &lt;code dir=&quot;auto&quot;&gt;available_tools: [...]&lt;/code&gt; block so the diagnostics fallback messages disappear and the resolver knows what to load.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;h3 id=&quot;updated-root-cause&quot;&gt;Updated root cause&lt;/h3&gt;
&lt;p&gt;It is not a charter gap (the charter exists, 278 lines, well-maintained). It is not exactly a dogfood gap either — the pipeline IS invoked. It is a &lt;strong&gt;content gap at the resolution boundary&lt;/strong&gt;: the doctrine-charter lookup returns anchors instead of rules, returns the wrong directive namespace, returns no tactics, and points at no external authority (glossary, ADRs). The implement template then declares this anchor-only injection authoritative and forbids the agent from compensating. Two namespaces (charter &lt;code dir=&quot;auto&quot;&gt;DIR-NNN&lt;/code&gt;, doctrine catalog &lt;code dir=&quot;auto&quot;&gt;DIRECTIVE_NNN&lt;/code&gt;) coexist without a cross-link. The profile’s loaded directives never surface in the prompt the profile’s own agent will read.&lt;/p&gt;
&lt;p&gt;The “missing entry point” the user identified is precisely this: the entry point is wired, but it does not carry the payload. Adding the payload — section bodies, profile-referenced directives and tactics, glossary pointer, ADR pointer — is the structural fix.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&quot;verification&quot;&gt;Verification&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;All 96 architectural layer-rule tests pass (&lt;code dir=&quot;auto&quot;&gt;tests/architectural/&lt;/code&gt;). Confirmed at HEAD on &lt;code dir=&quot;auto&quot;&gt;feat/org-doctrine-layer&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;All 2566 doctrine + charter + specify_cli/doctrine + new collision CLI tests + architectural tests pass.&lt;/li&gt;
&lt;li&gt;&lt;code dir=&quot;auto&quot;&gt;ruff&lt;/code&gt; and &lt;code dir=&quot;auto&quot;&gt;mypy&lt;/code&gt; are clean on the 13 source modules and 6 test modules touched by the three post-mission remediations.&lt;/li&gt;
&lt;li&gt;The full suite reports 17634 passed, 244 failed. The 244 failures are concentrated in &lt;code dir=&quot;auto&quot;&gt;tests/tasks/test_planning_workflow_integration.py&lt;/code&gt;, &lt;code dir=&quot;auto&quot;&gt;tests/tasks/test_tasks_2x_unit.py&lt;/code&gt;, and &lt;code dir=&quot;auto&quot;&gt;tests/test_dashboard/test_scanner.py&lt;/code&gt; — all pre-existing and unrelated to the doctrine / charter / specify_cli.doctrine modules touched by this feature.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The implementation is structurally sound. The work left is documentation alignment, not behavioural correction. The process-architecture changes recommended above are the way to prevent the same pattern in the next mission.&lt;/p&gt;</content>
</entry>
