Sub #1 of Epic #12456 (AiConfig-SSOT antipattern cleanup). PRIO 0 — the read-gate keystone; every other sub + every reviewer depends on it. Graduated from Discussion #12453; Decision Record: REQUIRED per ADR 0005. Drafted ADR content already exists: discussion comment DC_kwDODSospM4BBglP (the raw material for this PR).
Backfill (operator OQ1 reversal, 2026-06-04): learn/agentos/AiConfigModel.md is public-facing docs (learn/tree.json is its nav) and is PRESERVED unchanged — the ADR complements it, it is NOT absorbed/retired. The new ADR file is registered in learn/tree.json. This body is backfilled to match the shipped shape (PR #12458 head 249bc5ebf).
Context
Reading the 3 primitive files (src/state/Provider.mjs + src/state/createHierarchicalDataProxy.mjs + ai/BaseConfig.mjs) to understand AiConfig before touching ai/ config is too heavy for a hot fix — so it gets skipped, and authors/reviewers pattern-match the broken surrounding code instead (the #12420 broken-window: 4 defects, 0 caught across 2 reviews). The structural fix is a sharp ADR distillation authors read instead of the 3 files, made un-skippable by a turn-loaded one-line trigger.
The Problem
Without (a) a lean authority and (b) a mechanical read-gate, the antipattern cluster re-rots after cleanup. "I'll be more careful" is empirically falsified (4/4 #12420 defects missed). The ADR is the sanctioned-pattern reference a reviewer + the lint (sub #2) check against; the AGENTS.md trigger makes the ADR-read un-skippable for every family.
The Architectural Reality
- ADR path (deterministic):
learn/agentos/decisions/0019-aiconfig-reactive-provider-ssot.md (next number after 0018). Registered in learn/tree.json under Architectural Decision Records (a new learn/ file must appear in the docs nav).
- Turn-loaded hook placement (verified):
.claude/CLAUDE.md is a symlink → ../AGENTS.md (no generator in buildScripts//workflows/). One edit to AGENTS.md §edge_case_triggers covers all families. Net loaded-byte delta negative — one line replaces a 3-file primitive read.
- Compaction discipline: ADR 0007 (high-frequency trigger in the turn-loaded layer, depth in the ADR).
AiConfigModel.md (public guide): it overlaps the ADR's how-it-works, but it is public-facing docs → preserved, not absorbed. The ADR carries its own maintainer-facing how-it-works (§2.1) and cross-references the guide.
The Fix
- Author ADR 0019 from the drafted content (
DC_kwDODSospM4BBglP), structured per ADR 0005 §2.4 (lean, executable authority — NOT a Discussion paste): primitive model (leaf/hierarchy/formulas/proxy/merge:deep) + the A/B/C antipattern catalog with each ID tagged live-on-dev vs #12420-proposed + the ⭐ B4 safety-critical danger + sanctioned patterns + the V-B-A pre-flight read-gate.
- OQ1 (operator-reversed): preserve
learn/agentos/AiConfigModel.md (public docs guide); the ADR complements it (maintainer audience) and carries the examples/stateProvider/advanced read-up/write-to-owner link into §2.1; register ADR 0019 in learn/tree.json.
- OQ3 (opus V-B-A
DC_kwDODSospM4BBgm5): the ai/ daemons are entrypoints (they import Neo/_export/AiConfig), so their path re-derivation is A1, not C1; the single genuine C1×B5 site is TaskDefinitions.mjs. Frame C1 as bootstrap-weight (entrypoints read AiConfig directly; only genuine non-entrypoint helpers use the pure-defaults module). Catalog tags A1-with-AiConfig-imported vs genuine-C1.
- Add the one-line trigger to
AGENTS.md §edge_case_triggers; cite ADR 0007 + substrate-accretion defense in the PR body.
Contract Ledger Matrix
| Target Surface |
Source of Authority |
Proposed Behavior |
Fallback |
Docs |
Evidence |
AGENTS.md §edge_case_triggers — AiConfig read-gate (one line) |
this ticket / ADR 0007 |
turn-loaded: "Before working with AiConfig inside ai/ you MUST read ADR 0019." |
always-loaded (no fallback needed) |
ADR 0019 |
.claude/CLAUDE.md→AGENTS.md symlink verified (ls -la) |
learn/agentos/decisions/0019-…md |
this ticket (graduated #12453) |
new durable ADR authority for AiConfig SSOT |
— |
self |
ADR 0005 ADR-at-graduation |
learn/tree.json |
this ticket |
register ADR 0019 node under Architectural Decision Records (docs nav) |
— |
self |
git -C <clone> ... tree.json parses |
learn/agentos/AiConfigModel.md |
operator (OQ1 reversal) |
PRESERVED unchanged (public docs guide); ADR 0019 complements, does NOT replace |
— |
self |
git diff origin/dev empty (byte-identical) |
Acceptance Criteria
Out of Scope
- The fail-build lint (= sub #2).
- The exhaustive
ai/ fan-out inventory + cleanup subs (post-merge; operator-gated).
- Backfilling ADRs 0002–0018 into
learn/tree.json (pre-existing docs-nav gap; separate follow-up).
Decision Record impact
produces ADR 0019; aligned-with ADR 0007; depends-on ADR 0005; complements (does not replace) learn/agentos/AiConfigModel.md.
Related
- Parent: Epic #12456. Origin: Discussion #12453 (ADR draft
DC_kwDODSospM4BBglP; V-B-A refinement DC_kwDODSospM4BBgl2). gpt STEP_BACK: DC_kwDODSospM4BBgl_. opus OQ3 daemon-A1 V-B-A: DC_kwDODSospM4BBgm5.
- Complements (does not replace):
learn/agentos/AiConfigModel.md (public configuration-model guide).
Origin Session ID
3ecb40bf-bfef-40b1-8693-a8aae5afa1b7
Handoff Retrieval Hints
query_raw_memories: "ADR 0019 AiConfig SSOT read-gate AGENTS.md trigger", "AiConfig participation prerequisite primitive".
- The complete drafted ADR content is Discussion #12453 comment
DC_kwDODSospM4BBglP.
Sub #1 of Epic #12456 (AiConfig-SSOT antipattern cleanup). PRIO 0 — the read-gate keystone; every other sub + every reviewer depends on it. Graduated from Discussion #12453;
Decision Record: REQUIREDper ADR 0005. Drafted ADR content already exists: discussion commentDC_kwDODSospM4BBglP(the raw material for this PR).Context
Reading the 3 primitive files (
src/state/Provider.mjs+src/state/createHierarchicalDataProxy.mjs+ai/BaseConfig.mjs) to understandAiConfigbefore touchingai/config is too heavy for a hot fix — so it gets skipped, and authors/reviewers pattern-match the broken surrounding code instead (the #12420 broken-window: 4 defects, 0 caught across 2 reviews). The structural fix is a sharp ADR distillation authors read instead of the 3 files, made un-skippable by a turn-loaded one-line trigger.The Problem
Without (a) a lean authority and (b) a mechanical read-gate, the antipattern cluster re-rots after cleanup. "I'll be more careful" is empirically falsified (4/4 #12420 defects missed). The ADR is the sanctioned-pattern reference a reviewer + the lint (sub #2) check against; the AGENTS.md trigger makes the ADR-read un-skippable for every family.
The Architectural Reality
learn/agentos/decisions/0019-aiconfig-reactive-provider-ssot.md(next number after 0018). Registered inlearn/tree.jsonunder Architectural Decision Records (a newlearn/file must appear in the docs nav)..claude/CLAUDE.mdis a symlink →../AGENTS.md(no generator inbuildScripts//workflows/). One edit toAGENTS.md§edge_case_triggerscovers all families. Net loaded-byte delta negative — one line replaces a 3-file primitive read.AiConfigModel.md(public guide): it overlaps the ADR's how-it-works, but it is public-facing docs → preserved, not absorbed. The ADR carries its own maintainer-facing how-it-works (§2.1) and cross-references the guide.The Fix
DC_kwDODSospM4BBglP), structured per ADR 0005 §2.4 (lean, executable authority — NOT a Discussion paste): primitive model (leaf/hierarchy/formulas/proxy/merge:deep) + the A/B/C antipattern catalog with each ID taggedlive-on-devvs#12420-proposed+ the ⭐ B4 safety-critical danger + sanctioned patterns + the V-B-A pre-flight read-gate.learn/agentos/AiConfigModel.md(public docs guide); the ADR complements it (maintainer audience) and carries theexamples/stateProvider/advancedread-up/write-to-owner link into §2.1; register ADR 0019 inlearn/tree.json.DC_kwDODSospM4BBgm5): theai/daemons are entrypoints (theyimport Neo/_export/AiConfig), so their path re-derivation is A1, not C1; the single genuine C1×B5 site isTaskDefinitions.mjs. Frame C1 as bootstrap-weight (entrypoints readAiConfigdirectly; only genuine non-entrypoint helpers use the pure-defaults module). Catalog tagsA1-with-AiConfig-importedvsgenuine-C1.AGENTS.md §edge_case_triggers; cite ADR 0007 + substrate-accretion defense in the PR body.Contract Ledger Matrix
AGENTS.md §edge_case_triggers— AiConfig read-gate (one line)ai/you MUST read ADR 0019.".claude/CLAUDE.md→AGENTS.mdsymlink verified (ls -la)learn/agentos/decisions/0019-…mdlearn/tree.jsongit -C <clone> ... tree.jsonparseslearn/agentos/AiConfigModel.mdgit diff origin/devempty (byte-identical)Acceptance Criteria
learn/agentos/decisions/0019-aiconfig-reactive-provider-ssot.mdauthored (Status: Draft → Accepted on human merge), lean per ADR 0005 §2.4.live-on-devvs#12420-proposed.chromaTestIsolationby-construction).TaskDefinitions.mjs; catalog tagsA1-with-AiConfig-importedvsgenuine-C1; pure-defaults-module sanctioned shape named.AiConfigModel.mdpreserved unchanged (public guide); ADR 0019 complements it (OQ1 reversal) and carries itsexamples/stateProvider/advancedlink into §2.1.learn/tree.json(docs nav).AGENTS.md §edge_case_triggers→ ADR 0019; PR body declares net-negative loaded-byte delta + cites ADR 0007.Out of Scope
ai/fan-out inventory + cleanup subs (post-merge; operator-gated).learn/tree.json(pre-existing docs-nav gap; separate follow-up).Decision Record impact
produces ADR 0019; aligned-with ADR 0007; depends-on ADR 0005; complements (does not replace)
learn/agentos/AiConfigModel.md.Related
DC_kwDODSospM4BBglP; V-B-A refinementDC_kwDODSospM4BBgl2). gpt STEP_BACK:DC_kwDODSospM4BBgl_. opus OQ3 daemon-A1 V-B-A:DC_kwDODSospM4BBgm5.learn/agentos/AiConfigModel.md(public configuration-model guide).Origin Session ID
3ecb40bf-bfef-40b1-8693-a8aae5afa1b7Handoff Retrieval Hints
query_raw_memories: "ADR 0019 AiConfig SSOT read-gate AGENTS.md trigger", "AiConfig participation prerequisite primitive".DC_kwDODSospM4BBglP.