Blame

a7b6ae Claude (Dev) 2026-03-13 01:51:46
[mcp] Port original PRD note schema section to wiki
1
---
2
category: reference
3
tags: [meta, design, prd, schema]
4
last_updated: 2026-03-12
5
confidence: high
6
---
7
8
# Original PRD Note Schema
9
10
> This page is part of the original single-tenant PRD, split across five wiki pages:
ada4de Claude (MCP) 2026-03-13 17:49:50
[mcp] Normalize spaces to underscores
11
> [[Design/Research_Wiki]] | [[Design/Rest Api]] | [[Design/Semantic_Search]] | [[Design/Mcp Server]] | [[Design/Note_Schema]]
a7b6ae Claude (Dev) 2026-03-13 01:51:46
[mcp] Port original PRD note schema section to wiki
12
13
---
14
15
## Note Schema
16
17
All wiki pages should use YAML frontmatter. This is a convention, not enforced by the system, but the Chroma plugin extracts metadata from it for filtering.
18
19
```yaml
20
---
21
category: actor | variable | trend | proposition | event | reference | index
22
tags: [tag1, tag2]
23
last_updated: 2026-03-09
24
confidence: high | medium | low | speculative
25
---
26
```
27
28
### Field definitions
29
30
- **category**: What kind of note this is. Maps to the analytical framework:
31
- `actor` — a state, organization, leader, or entity (e.g., "Iran", "Trump", "IRGC")
32
- `variable` — a tracked parameter or measurable quantity (e.g., "WTI Oil Price", "Interceptor Stockpiles")
33
- `trend` — an ongoing dynamic or trajectory (e.g., "Desalination Targeting Ratchet")
34
- `proposition` — a testable analytical claim with observable indicators (e.g., "Iran is rationing ballistic missiles")
35
- `event` — a specific dated occurrence (e.g., "Israel Strikes Tehran Oil Depots")
36
- `reference` — an external source, report, or dataset (e.g., "USDA Prospective Plantings Report")
37
- `index` — a hub or overview page that links to related notes
38
- **tags**: Freeform tags for filtering. Examples: `military`, `economic`, `food-security`, `p1-third-clock`, `p2-interceptor-race`, `p3-infrastructure`, `p4-economic-transmission`
39
- **last_updated**: Date of last substantive update (ISO 8601 date, e.g., `2026-03-09`).
40
- **confidence**: Epistemic status of the note's core claims.
41
42
### Cross-references: WikiLinks are the single source of truth
43
44
Related notes are expressed **only** as `[[WikiLinks]]` in the body text, NOT in frontmatter. There is no `related` frontmatter field. The link graph is derived entirely by parsing WikiLinks in page content. This avoids the divergence problem where a frontmatter list and inline links get out of sync.
45
46
### Page organization
47
48
Pages are organized in subdirectories by category:
49
50
```
51
Actors/
52
Iran.md
53
Trump.md
54
China.md
55
Russia.md
56
Gulf States.md
57
Variables/
58
WTI Oil Price.md
59
Interceptor Stockpiles.md
60
US Gas Prices.md
61
Iranian Civilian Casualties.md
62
Trends/
63
Desalination Targeting Ratchet.md
64
Iran Attrition Strategy.md
65
Economic Double Wave.md
66
Propositions/
67
Iran Rationing Ballistic Missiles.md
68
Fertilizer Supply Chain Disruption.md
69
Events/
70
2026-03-01 US Strikes Begin.md
71
2026-03-07 Israel Strikes Tehran Oil Depots.md
72
References/
73
USDA Prospective Plantings.md
74
FAO Food Price Index.md
75
```
76
77
### Cross-referencing
78
79
Use Otterwiki's native `[[WikiLink]]` syntax. Examples:
80
81
```markdown
82
The [[Actors/Iran|Iran]] [[Trends/Iran Attrition Strategy|attrition strategy]]
83
involves a multi-phase approach: cheap drones to drain
84
[[Variables/Interceptor Stockpiles|interceptor stockpiles]], followed by
85
ballistic missiles against high-value targets.
86
```
87
88
### Page size guidance
89
90
Notes should be **250–800 words** (roughly 400–1200 tokens). This is a soft target, not a hard limit. The rationale is context window efficiency: the AI assistant pulls multiple notes per session. If individual notes are 3,000+ words, pulling five of them consumes most of the context window. Short, atomic notes let the AI pull 10–20 relevant notes and still have room for conversation, analysis, and system prompts.
91
92
If a note grows beyond ~1000 words, it should probably be split into multiple notes linked together. For example, a long "Iran" actor note should be decomposed into "Iran — Military Doctrine", "Iran — Political Leadership", "Iran — Nuclear Program", etc., with an "Iran" index page linking them.
93
94
That said, longer notes are not a system-level problem. The Chroma plugin chunks pages for embedding (see Component 2), so semantic search quality is unaffected by page length. The guidance is about keeping individual notes focused and context-window-friendly, not a technical constraint.
95
96
### Complete example page
97
98
Here is what `Trends/Iran Attrition Strategy.md` looks like on disk:
99
100
```markdown
101
---
102
category: trend
103
tags: [military, p2-interceptor-race, p3-infrastructure]
104
last_updated: 2026-03-08
105
confidence: high
106
---
107
108
# Iran Attrition Strategy
109
110
Iran is executing a multi-phase attrition campaign designed to degrade
111
Gulf state and US defensive capacity before committing high-value
112
ballistic missile assets.
113
114
## Phase structure
115
116
**Phase 1 — Drone saturation.** Cheap Shahed-series drones launched in
117
large salvos to force expenditure of expensive interceptor missiles.
118
The cost asymmetry is extreme: a $20,000 drone forces the use of a
119
$1–3M interceptor. See [[Variables/Interceptor Stockpiles]].
120
121
**Phase 2 — Radar blinding.** Anti-radiation missiles and electronic
122
warfare to degrade air defense radar networks, creating gaps in
123
defensive coverage.
124
125
**Phase 3 — Ballistic strikes on high-value targets.** Once interceptor
126
stockpiles are depleted and radar coverage is degraded, Iran commits
127
ballistic missiles against infrastructure targets. The 86% drop in
128
ballistic missile launch rates in the first week reflects deliberate
129
rationing, not destroyed capability. See
130
[[Propositions/Iran Rationing Ballistic Missiles]].
131
132
## Evidence
133
134
- Ballistic missile launch rate dropped ~86% after initial salvos
135
(Days 1–3 vs Days 4–9), while drone launch rates remained constant
136
or increased.
137
- [[Actors/Iran|IRGC]] messaging emphasizes "patience" and
138
"strategic depth."
139
- Historical precedent: Iran used similar phased approach in late
140
stages of Iran-Iraq War.
141
142
## Implications
143
144
This strategy means the most dangerous phase of the conflict for
145
Gulf infrastructure is still ahead, not behind. The current period
146
of relatively low ballistic missile activity is the preparation
147
phase, not the resolution. See [[Trends/Desalination Targeting Ratchet]]
148
for emerging target categories.
149
```
150
151
---
152
153
## Master Index Convention
154
155
### Purpose
156
157
The master index solves the "you don't know what you don't know" problem. At session start, the AI assistant reads one page and gets a complete map of the wiki's contents. This replaces the current protocol of reading all project PDFs.
158
159
### Structure
160
161
`Index/Master.md` is a single page listing every note in the wiki, organized by category, with a one-line description per note. It is maintained by both the human and the AI. When either party creates a new note, they should add it to the master index.
162
163
### Example
164
165
```markdown
166
---
167
category: index
168
tags: [meta]
169
last_updated: 2026-03-09
170
confidence: high
171
---
172
173
# Master Index
174
175
## Actors
176
- [[Actors/Iran]] — military doctrine, IRGC command, attrition strategy, nuclear posture
177
- [[Actors/Trump]] — surrender framing, "no time limits" rhetoric, Third Clock dynamics
178
- [[Actors/China]] — hedging calculus, summit positioning, semiconductor leverage
179
- [[Actors/Russia]] — targeting intelligence provision, diplomatic posture
180
- [[Actors/Gulf States]] — defensive capacity, desalination vulnerability, alliance strain
181
182
## Variables (P1–P4)
183
- [[Variables/Third Clock]] — P1: Trump tolerance timeline ⚠️ STALLED as of Day 9
184
- [[Variables/Interceptor Stockpiles]] — P2: Gulf-wide Patriot/THAAD depletion tracking
185
- [[Variables/Iran Strike Intent]] — P3: ballistic/drone ratio, targeting pattern evolution
186
- [[Variables/WTI Oil Price]] — P4: $90.90 as of Day 9, record weekly gain
187
- [[Variables/US Gas Prices]] — P4: $3.45 as of Day 9
188
- [[Variables/Iranian Civilian Casualties]] — 1,200+ as of Day 9
189
190
## Trends
191
- [[Trends/Iran Attrition Strategy]] — multi-phase: drones → radar blinding → ballistic strikes
192
- [[Trends/Desalination Targeting Ratchet]] — confirmed both sides, precedent difficult to walk back
193
- [[Trends/Economic Double Wave]] — immediate oil shock + delayed harvest-time food prices (Q3–Q4)
194
195
## Propositions
196
- [[Propositions/Iran Rationing Ballistic Missiles]] — 86% launch rate drop = rationing, not destruction
197
- [[Propositions/Fertilizer Supply Chain Disruption]] — no strategic reserve, spring window biologically fixed
198
199
## Events (recent)
200
- [[Events/2026-03-07 Israel Strikes Tehran Oil Depots]] — first Israeli strike on Tehran
201
- [[Events/2026-03-08 New Iranian Supreme Leader Selected]] — unnamed successor
202
- [[Events/2026-03-08 Russia Providing Targeting Intelligence]] — confirmed
203
204
## References
205
- [[References/USDA Prospective Plantings]] — March 31 report, anchors food security monitoring
206
- [[References/FAO Food Price Index]] — April 3 update
207
```
208
209
### Size budget
210
211
At ~15 words per entry, 200 notes ≈ 3,000 words ≈ 4,500 tokens. This fits comfortably in a single tool call. The master index only needs to be fragmented into sub-indexes if the wiki exceeds ~500 pages.
212
213
### Orphan detection
214
215
The `find_orphaned_notes` MCP tool compares the full page list against pages referenced in all `category: index` pages. Pages that exist but aren't linked from any index are "orphans." This is used during periodic gardening sessions (see below), not at every session start.
216
217
### Session start protocol
218
219
When beginning a research session, the AI assistant should:
220
221
1. `read_note("Index/Master")` — load the full map
222
2. `list_notes(updated_since=<last_session_date>)` — see what changed since last check-in
223
3. Based on the day's research question, `read_note` the 5–15 most relevant pages
224
4. Proceed with web search for new developments, as per existing protocol
225
226
### Gardening sessions
227
228
Periodically (likely automated), a dedicated session focuses solely on wiki maintenance:
229
230
- `find_orphaned_notes()` — add orphans to the appropriate index or flag for review
231
- Review notes with stale `last_updated` dates
232
- Check for broken WikiLinks (Otterwiki also has built-in housekeeping for this)
233
- Update confidence levels on propositions based on accumulated evidence
234
- Identify notes that have grown too long and should be split
235
- Ensure tag consistency (catch typos like `p2-interceptor_race` vs `p2-interceptor-race`)
236
- Update the master index
237
238
The gardening protocol will be refined once the system is running and we understand the actual maintenance patterns.
239
240
---
241
242
## Open Questions
243
244
1. **Plugin blueprint support** — This is the critical unknown. Phase 1 resolves it. Read `otterwiki/plugins.py` and `docs/plugin_examples/` before writing any code.
245
2. **Chroma embedding model**`all-MiniLM-L6-v2` is the pragmatic default (runs locally, no API key). The chunking strategy sizes chunks to fit within the model's input window, so the exact max sequence length matters for tuning `target_tokens` in the chunker. Verify the actual limit at implementation time and adjust accordingly. Could upgrade to a larger model later if retrieval quality is poor.
246
3. **Frontmatter parsing** — Otterwiki has a community-contributed YAML frontmatter renderer plugin (noted in v2.10 changelog). Investigate whether it already handles frontmatter parsing that can be reused. If not, use PyYAML to parse the `---` delimited block at the top of page content.
247
4. **Concurrent edit safety** — The API should check the page revision before saving and return 409 on conflict. Otterwiki's web editor already handles this with a draft system. For the initial implementation, last-write-wins is acceptable — add optimistic locking later if it causes problems in practice.
248
5. **WikiLink direction** — Otterwiki's syntax docs show `[[Text to display|WikiPage]]` (target is second). Verify this against the actual rendering code before implementing the parser, since getting this backwards would silently corrupt the link graph.