@nurix/etna 0.18.0 → 0.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/README.md +6 -5
  2. package/data/harness-index.json +1 -1
  3. package/data/harnesses/code/CLAUDE.md +7 -18
  4. package/data/harnesses/code/agents/brainstorm.md +3 -3
  5. package/data/harnesses/code/agents/change-review.md +13 -10
  6. package/data/harnesses/code/agents/harness-manager.md +15 -15
  7. package/data/harnesses/code/agents/maintenance.md +10 -3
  8. package/data/harnesses/code/agents/performance-review.md +5 -0
  9. package/data/harnesses/code/harness.json +1 -1
  10. package/data/harnesses/code/rules/general.md +40 -36
  11. package/data/harnesses/code/skills/boundary/SKILL.md +15 -42
  12. package/data/harnesses/code/skills/boundary/references/boundary-taxonomy.md +366 -304
  13. package/data/harnesses/code/skills/brainstorm/README.md +9 -9
  14. package/data/harnesses/code/skills/brainstorm/SKILL.md +15 -15
  15. package/data/harnesses/code/skills/brainstorm/harvest.md +2 -2
  16. package/data/harnesses/code/skills/brainstorm/templates/backlog.md +2 -2
  17. package/data/harnesses/code/skills/brainstorm/templates/build.md +6 -6
  18. package/data/harnesses/code/skills/brainstorm/templates/decisions.md +3 -3
  19. package/data/harnesses/code/skills/brainstorm/templates/doctrine.md +2 -2
  20. package/data/harnesses/code/skills/brainstorm/templates/domain-model.md +2 -2
  21. package/data/harnesses/code/skills/brainstorm/templates/glossary.md +2 -1
  22. package/data/harnesses/code/skills/brainstorm/templates/non-goals.md +3 -7
  23. package/data/harnesses/code/skills/brainstorm/templates/questions.md +6 -5
  24. package/data/harnesses/code/skills/brainstorm/templates/state.md +1 -8
  25. package/data/harnesses/code/skills/brainstorm/templates/tech.md +6 -6
  26. package/data/harnesses/code/skills/brainstorm/templates/thesis.md +2 -2
  27. package/data/harnesses/code/skills/distiller/SKILL.md +48 -177
  28. package/data/harnesses/code/skills/distiller/references/docs-mode.md +116 -343
  29. package/data/harnesses/code/skills/distiller/references/method.md +37 -109
  30. package/data/harnesses/code/skills/documentation/SKILL.md +9 -6
  31. package/data/harnesses/code/skills/documentation/references/examples.md +30 -61
  32. package/data/harnesses/code/skills/documentation/references/style-guide.md +59 -62
  33. package/data/harnesses/code/skills/documentation/references/templates.md +25 -33
  34. package/data/harnesses/code/skills/workflow-mapper/SKILL.md +32 -11
  35. package/data/harnesses/code/skills/workflow-mapper/references/patterns.md +1 -1
  36. package/data/harnesses/code-fable/CLAUDE.md +12 -23
  37. package/data/harnesses/code-fable/agents/brainstorm.md +3 -3
  38. package/data/harnesses/code-fable/agents/change-review.md +13 -10
  39. package/data/harnesses/code-fable/agents/harness-manager.md +15 -15
  40. package/data/harnesses/code-fable/agents/maintenance.md +10 -3
  41. package/data/harnesses/code-fable/agents/performance-review.md +5 -0
  42. package/data/harnesses/code-fable/harness.json +1 -1
  43. package/data/harnesses/code-fable/rules/general.md +40 -36
  44. package/data/harnesses/code-fable/skills/boundary/SKILL.md +15 -42
  45. package/data/harnesses/code-fable/skills/boundary/references/boundary-taxonomy.md +366 -304
  46. package/data/harnesses/code-fable/skills/brainstorm/README.md +9 -9
  47. package/data/harnesses/code-fable/skills/brainstorm/SKILL.md +15 -15
  48. package/data/harnesses/code-fable/skills/brainstorm/harvest.md +2 -2
  49. package/data/harnesses/code-fable/skills/brainstorm/templates/backlog.md +2 -2
  50. package/data/harnesses/code-fable/skills/brainstorm/templates/build.md +6 -6
  51. package/data/harnesses/code-fable/skills/brainstorm/templates/decisions.md +3 -3
  52. package/data/harnesses/code-fable/skills/brainstorm/templates/doctrine.md +2 -2
  53. package/data/harnesses/code-fable/skills/brainstorm/templates/domain-model.md +2 -2
  54. package/data/harnesses/code-fable/skills/brainstorm/templates/glossary.md +2 -1
  55. package/data/harnesses/code-fable/skills/brainstorm/templates/non-goals.md +3 -7
  56. package/data/harnesses/code-fable/skills/brainstorm/templates/questions.md +6 -5
  57. package/data/harnesses/code-fable/skills/brainstorm/templates/state.md +1 -8
  58. package/data/harnesses/code-fable/skills/brainstorm/templates/tech.md +6 -6
  59. package/data/harnesses/code-fable/skills/brainstorm/templates/thesis.md +2 -2
  60. package/data/harnesses/code-fable/skills/distiller/SKILL.md +48 -177
  61. package/data/harnesses/code-fable/skills/distiller/references/docs-mode.md +116 -343
  62. package/data/harnesses/code-fable/skills/distiller/references/method.md +37 -109
  63. package/data/harnesses/code-fable/skills/documentation/SKILL.md +9 -6
  64. package/data/harnesses/code-fable/skills/documentation/references/examples.md +30 -61
  65. package/data/harnesses/code-fable/skills/documentation/references/style-guide.md +59 -62
  66. package/data/harnesses/code-fable/skills/documentation/references/templates.md +25 -33
  67. package/data/harnesses/code-fable/skills/workflow-mapper/SKILL.md +32 -11
  68. package/data/harnesses/code-fable/skills/workflow-mapper/references/patterns.md +1 -1
  69. package/data/harnesses/discover/CLAUDE.md +41 -109
  70. package/data/harnesses/discover/agents/api.md +11 -28
  71. package/data/harnesses/discover/agents/codebase.md +12 -30
  72. package/data/harnesses/discover/agents/community.md +9 -21
  73. package/data/harnesses/discover/agents/deployed-client-bundle.md +16 -67
  74. package/data/harnesses/discover/agents/distribution-artifacts.md +21 -59
  75. package/data/harnesses/discover/agents/docs.md +11 -20
  76. package/data/harnesses/discover/agents/infra-backend-fingerprint.md +28 -68
  77. package/data/harnesses/discover/agents/packages.md +12 -28
  78. package/data/harnesses/discover/agents/session.md +18 -50
  79. package/data/harnesses/discover/agents/website.md +9 -19
  80. package/data/harnesses/discover/agents/wire-capture.md +22 -72
  81. package/data/harnesses/discover/harness.json +1 -1
  82. package/data/harnesses/discover/rules/discovery.md +73 -182
  83. package/data/harnesses/discover/rules/evaluation.md +90 -98
  84. package/data/harnesses/discover/rules/ingestion.md +123 -322
  85. package/data/harnesses/discover/rules/self-correction.md +67 -92
  86. package/data/harnesses/discover/rules/tradecraft.md +201 -172
  87. package/data/harnesses/hr/CLAUDE.md +21 -51
  88. package/data/harnesses/hr/harness.json +1 -1
  89. package/data/harnesses/hr/skills/interview-eval/SKILL.md +23 -11
  90. package/data/harnesses/hr/skills/interview-eval/TEMPLATE.md +49 -29
  91. package/data/harnesses/hr/skills/interview-eval/rubric.md +30 -30
  92. package/data/harnesses/kb-agi/CLAUDE.md +8 -8
  93. package/data/harnesses/kb-agi/agents/kb-agi-init.md +31 -22
  94. package/data/harnesses/kb-agi/agents/kb-catch-stale.md +1 -1
  95. package/data/harnesses/kb-agi/agents/kb-find-gaps.md +1 -1
  96. package/data/harnesses/kb-agi/agents/kb-fix-links.md +1 -1
  97. package/data/harnesses/kb-agi/agents/kb-refresh-summaries.md +2 -2
  98. package/data/harnesses/kb-agi/agents/kb-sync-metadata.md +2 -2
  99. package/data/harnesses/kb-agi/harness.json +1 -1
  100. package/package.json +1 -1
@@ -5,215 +5,86 @@ description: The one place captured session lessons are distilled into colder, h
5
5
 
6
6
  # Distiller Skill
7
7
 
8
- The one place a repo's **captured session lessons** are distilled into colder,
9
- higher-signal knowledge. The memory inbox (`docs/memory/inbox/{actor}.md`) is a
10
- per-actor queue of lessons the `session-reflect` hook extracted at session end;
11
- the distiller reconciles the *surprising* part of it into atomic, self-contained,
12
- provenance-linked **fact-cards** (`docs/memory/facts/`) and consumes the entries
13
- it digests. Volume falls, signal rises — one hop down the distillation gradient.
14
-
15
- The methods this skill runs are **stolen, not invented** — surprisal-based
16
- retention (Nemori), non-lossy EDU fact-cards (EMem), per-fact ADD/UPDATE/
17
- SUPERSEDE/NOOP reconciliation (Mem0), and bi-temporal supersession (Zep/
18
- Graphiti). They live in exactly one place:
19
-
20
- > **Read [`references/method.md`](references/method.md) first, in every mode.**
21
- > It carries the four mechanisms verbatim-grade (with their arXiv ids — provenance
22
- > matters here of all places), the fact-card format, and the inbox-consumption
23
- > protocol. This SKILL.md only orchestrates those mechanisms over the inbox.
24
-
25
- The reason the two modes are one skill: **both read one algorithm root.** Two
26
- components would mean two copies of the surprisal/reconciliation/supersession
27
- model that drift apart. One skill, one spec, zero drift.
8
+ The one place a repo's **captured session lessons** are distilled into colder, higher-signal knowledge. The memory inbox (`docs/memory/inbox/{actor}.md`) is a per-actor queue of lessons the `session-reflect` hook extracted at session end; the distiller reconciles the _surprising_ part of it into atomic, self-contained, provenance-linked **fact-cards** (`docs/memory/facts/`) and consumes the entries it digests. Volume falls, signal rises — one hop down the distillation gradient.
9
+
10
+ The methods this skill runs are **stolen, not invented** — surprisal-based retention (Nemori), non-lossy EDU fact-cards (EMem), per-fact ADD/UPDATE/ SUPERSEDE/NOOP reconciliation (Mem0), and bi-temporal supersession (Zep/ Graphiti). They live in exactly one place:
11
+
12
+ > **Read [`references/method.md`](references/method.md) first, in every mode.** It carries the four mechanisms verbatim-grade (with their arXiv ids — provenance matters here of all places), the fact-card format, and the inbox-consumption protocol. This SKILL.md only orchestrates those mechanisms over the inbox.
13
+
14
+ The reason the two modes are one skill: **both read one algorithm root.** Two components would mean two copies of the surprisal/reconciliation/supersession model that drift apart. One skill, one spec, zero drift.
28
15
 
29
16
  ---
30
17
 
31
18
  ## Picking a mode
32
19
 
33
20
  | You want to… | Mode | Ships |
34
- |---|---|---|
21
+ | --- | --- | --- |
35
22
  | Distill new inbox entries into fact-cards | **`facts`** | now |
36
23
  | Distill fact-cards into proposed doc deltas | **`docs`** | now — procedure in [`references/docs-mode.md`](references/docs-mode.md) |
37
24
 
38
- Both modes read [`references/method.md`](references/method.md); each mode's
39
- procedure that sequences it lives in its own section below.
25
+ Both modes read [`references/method.md`](references/method.md); each mode's procedure that sequences it lives in its own section below.
40
26
 
41
27
  ## Execution model — pure skill, never autonomous
42
28
 
43
- Runs **in the main session** — no standing sub-agents, no daemon, no cron, no
44
- watch. The harness **proposes**, the user **disposes**: this skill runs only when
45
- the user asks, when the **Completion flow** invokes it (the kit `CLAUDE.md`
46
- Completion step distils the just-finished plan's trail — `facts` if the inbox
47
- holds entries, then `docs` which still drafts for approval), or when the user
48
- accepts the `maintenance` agent's threshold proposal (≥5 undigested inbox
49
- entries). It never schedules itself, never runs on a hook, never gates anything.
29
+ Runs **in the main session** — no standing sub-agents, no daemon, no cron, no watch. The harness **proposes**, the user **disposes**: this skill runs only when the user asks, when the **Completion flow** invokes it (the kit `CLAUDE.md` Completion step distils the just-finished plan's trail — `facts` if the inbox holds entries, then `docs` which still drafts for approval), or when the user accepts the `maintenance` agent's threshold proposal (≥5 undigested inbox entries). It never schedules itself, never runs on a hook, never gates anything.
50
30
 
51
31
  ---
52
32
 
53
33
  ## Mode: `facts` (inbox → fact-cards)
54
34
 
55
- Distill the inbox's undigested entries into fact-cards. The algorithm is in
56
- [`references/method.md`](references/method.md) — follow it; this section is the
57
- procedure that sequences it.
58
-
59
- 1. **Collect the inbox.** Read every entry block
60
- (`## <timestamp> · session <id> · <repo>@<branch>`) across
61
- `docs/memory/inbox/*.md`. The inbox is a consume-on-digest queue — what is
62
- present is exactly what is undigested, so there is no separate high-water
63
- mark. An immediate second run finds an empty inbox and is a clean NOOP.
64
-
65
- **Thin or empty inbox ⇒ not a NOOP — distill the decision record.** A
66
- project whose sessions produced no reflected lessons is **not** a project
67
- with nothing to distill. Architecture decisions and reversals are
68
- high-surprisal by nature — they exist precisely because they were *not*
69
- predictable. So when the inbox is thin/empty, also ingest, as surprisal
70
- sources for steps 2–5:
71
- - `docs/architecture/adr/**` — each accepted ADR is a surprising decision
72
- (its `Decision` + **Options Considered** — the rejected-alternatives section
73
- in the `documentation` §10 ADR template — carry the prediction error).
74
- - `docs/memory/brainstorm.md` — owner pronouncements, reversals, and
75
- discovered constraints recorded outside the inbox.
76
- Provenance points at the ADR file / brainstorm section, not a session id.
77
- These sources are **never consumed** — reconciliation (step 4) is what keeps
78
- a re-run over them idempotent.
79
-
80
- 2. **Surprisal filter → survivors** (method §1). Present the LLM with (a) a
81
- summary of the *current* fact-set, (b) the undigested entries. Keep only
82
- what is **surprising** relative to (a). Predictable ⇒ dropped — no importance
83
- scores, no templates, prediction error is the only retention signal. Inbox
84
- entries arrive semi-distilled (the reflection hook already dropped routine
85
- work), so the filter's job here is narrower: drop what the existing fact-set
86
- already predicts. (First run, empty fact-set: keep decisions, reversals,
87
- discovered constraints, and failures with a cause worth remembering.)
88
-
89
- 3. **Decompose survivors → EDU candidates** (method §2). Each survivor becomes
90
- **one** atomic, self-contained statement — entity names normalized, minimal
91
- context baked into the sentence — with `provenance` pointing at the session
92
- ids and commits its inbox entry names. Decomposition, **not** summarization:
93
- one survivor may yield several cards; no information is destroyed; everything
94
- stays auditable back to its session and commits.
95
-
96
- 4. **Reconcile each candidate against existing cards** (method §3). Query the
97
- existing facts for semantic neighbors, then decide
98
- **ADD / UPDATE / SUPERSEDE / NOOP** for each. Gate on the **facts collection
99
- holding cards**, not on the binary and not on the collection merely being
100
- registered — a present qmd whose `{repo}-facts` collection is *registered but
101
- empty* (the common first run: harness-manager's baseline registers + embeds
102
- `{repo}-facts` over a freshly-scaffolded `docs/memory/facts/` that has zero
103
- cards) returns nothing useful, exactly like an unregistered collection.
104
- - **Cards present** — `command -v qmd` succeeds **and** `docs/memory/facts/`
105
- holds at least one card (`docs/memory/facts/*.md` is non-empty): query
106
- scoped to the collection —
107
- `qmd query --format json -c {repo}-facts "<the candidate statement>"`.
108
- `{repo}` = the repo's directory name. Scope with `-c` always. (If the query
109
- returns nothing on a non-empty card set, the collection is registered-but-
110
- unbuilt — treat that as the fallback trigger below, not as "no neighbors.")
111
- - **No cards to query** (qmd absent, **or** `docs/memory/facts/*.md` empty —
112
- the common first-run case where the facts dir was scaffolded but never
113
- distilled into): fall back to filename/grep similarity over
114
- `docs/memory/facts/*.md` (slug overlap + entity-name grep), and **note in
115
- the report** that reconciliation ran without semantic retrieval. Step 7
116
- builds/refreshes the collection at the end of the run, so the *next* run —
117
- with cards now present — reconciles semantically.
35
+ Distill the inbox's undigested entries into fact-cards. The algorithm is in [`references/method.md`](references/method.md) — follow it; this section is the procedure that sequences it.
36
+
37
+ 1. **Collect the inbox.** Read every entry block (`## <timestamp> · session <id> · <repo>@<branch>`) across `docs/memory/inbox/*.md`. The inbox is a consume-on-digest queue — what is present is exactly what is undigested, so there is no separate high-water mark. An immediate second run finds an empty inbox and is a clean NOOP.
38
+
39
+ **Thin or empty inbox ⇒ not a NOOP — distill the decision record.** A project whose sessions produced no reflected lessons is **not** a project with nothing to distill. Architecture decisions and reversals are high-surprisal by nature — they exist precisely because they were _not_ predictable. So when the inbox is thin/empty, also ingest, as surprisal sources for steps 2–5:
40
+ - `docs/architecture/adr/**` — each accepted ADR is a surprising decision (its `Decision` + **Options Considered** — the rejected-alternatives section in the `documentation` §10 ADR template — carry the prediction error).
41
+ - `docs/memory/brainstorm.md` — owner pronouncements, reversals, and discovered constraints recorded outside the inbox. Provenance points at the ADR file / brainstorm section, not a session id. These sources are **never consumed** — reconciliation (step 4) is what keeps a re-run over them idempotent.
42
+
43
+ 2. **Surprisal filter → survivors** (method §1). Present the LLM with (a) a summary of the _current_ fact-set, (b) the undigested entries. Keep only what is **surprising** relative to (a). Predictable ⇒ dropped — no importance scores, no templates, prediction error is the only retention signal. Inbox entries arrive semi-distilled (the reflection hook already dropped routine work), so the filter's job here is narrower: drop what the existing fact-set already predicts. (First run, empty fact-set: keep decisions, reversals, discovered constraints, and failures with a cause worth remembering.)
44
+
45
+ 3. **Decompose survivors → EDU candidates** (method §2). Each survivor becomes **one** atomic, self-contained statement — entity names normalized, minimal context baked into the sentence — with `provenance` pointing at the session ids and commits its inbox entry names. Decomposition, **not** summarization: one survivor may yield several cards; no information is destroyed; everything stays auditable back to its session and commits.
46
+
47
+ 4. **Reconcile each candidate against existing cards** (method §3). Query the existing facts for semantic neighbors, then decide **ADD / UPDATE / SUPERSEDE / NOOP** for each. Gate on the **facts collection holding cards**, not on the binary and not on the collection merely being registered — a present qmd whose `{repo}-facts` collection is _registered but empty_ (the common first run: harness-manager's baseline registers + embeds `{repo}-facts` over a freshly-scaffolded `docs/memory/facts/` that has zero cards) returns nothing useful, exactly like an unregistered collection.
48
+ - **Cards present** — `command -v qmd` succeeds **and** `docs/memory/facts/` holds at least one card (`docs/memory/facts/*.md` is non-empty): query scoped to the collection — `qmd query --format json -c {repo}-facts "<the candidate statement>"`. `{repo}` = the repo's directory name. Scope with `-c` always. (If the query returns nothing on a non-empty card set, the collection is registered-but- unbuilt — treat that as the fallback trigger below, not as "no neighbors.")
49
+ - **No cards to query** (qmd absent, **or** `docs/memory/facts/*.md` empty — the common first-run case where the facts dir was scaffolded but never distilled into): fall back to filename/grep similarity over `docs/memory/facts/*.md` (slug overlap + entity-name grep), and **note in the report** that reconciliation ran without semantic retrieval. Step 7 builds/refreshes the collection at the end of the run, so the _next_ run — with cards now present — reconciles semantically.
118
50
 
119
51
  5. **Write the results** (method §4 — bi-temporal, never delete).
120
52
  - **ADD** → write a new card `docs/memory/facts/{kebab-slug}.md` in the format.
121
- - **UPDATE** → refine the existing card's statement in place; extend its
122
- `provenance`.
123
- - **SUPERSEDE** → on the **old** card set `invalid_from:` (today) and
124
- `superseded_by:` (the new fact-id); write the **new** card with `valid_from:`
125
- today. The old file stays in place — history stays queryable, nothing
126
- vanishes.
127
- - **Self-contained reversal** (one input states X-then-reversed-to-Y, no old
128
- card exists yet) → emit **two** cards in one pass: a born-invalid historical
129
- card for X (`invalid_from` + `superseded_by` → Y) and a live card for Y.
130
- See method.md §4 "Self-contained reversal."
53
+ - **UPDATE** → refine the existing card's statement in place; extend its `provenance`.
54
+ - **SUPERSEDE** → on the **old** card set `invalid_from:` (today) and `superseded_by:` (the new fact-id); write the **new** card with `valid_from:` today. The old file stays in place — history stays queryable, nothing vanishes.
55
+ - **Self-contained reversal** (one input states X-then-reversed-to-Y, no old card exists yet) → emit **two** cards in one pass: a born-invalid historical card for X (`invalid_from` + `superseded_by` → Y) and a live card for Y. See method.md §4 "Self-contained reversal."
131
56
  - **NOOP** → the fact is already known; write nothing.
132
57
 
133
- 6. **Consume the digested entries LAST.** Only after every card is written,
134
- delete exactly the entry blocks this run digested from
135
- `docs/memory/inbox/*.md` (keep each file's header; never touch undigested
136
- blocks). Last, so a crash mid-run leaves the entries in place and the re-run
137
- re-digests them — reconciliation NOOPs the already-written cards. This
138
- consumption is the only bookkeeping; there is no `.digest-state.md`.
139
-
140
- 7. **If qmd present, refresh the lens** (skip silently if `command -v qmd`
141
- finds nothing):
142
- - `qmd collection add docs/memory/facts --name {repo}-facts` — register the
143
- collection. Re-adding an existing name exits non-zero with "already exists";
144
- **treat that as success.** Never register `docs/memory` as a whole — that
145
- would sweep the raw inbox queue into the index.
146
- - `qmd context add qmd://{repo}-facts/ "Distilled recent decisions/observations, provenance-linked"`
147
- — upserts, safe to re-run.
148
- - `qmd update` — **re-scan the collection for the cards you just wrote.** In
149
- qmd 2.5.3 `collection add` on an already-registered name does NOT re-index
150
- new files; `qmd update` is what picks them up. Skipping this leaves the new
151
- cards invisible to retrieval (to the `prompt-recall` hook, and to distill②).
152
- - `qmd embed -c {repo}-facts` — regenerate vectors for the new/changed cards.
153
- Always scope with `-c`; a bare `qmd embed` re-embeds every repo on the
154
- machine. The `prompt-recall` hook's vector fallback only sees embedded
155
- cards, so skipping this hides new cards from prompt-time recall.
156
-
157
- 8. **Report** (in chat). Cards added / updated / superseded / NOOP'd, the
158
- entries consumed per actor, and — if reconciliation fell back to
159
- filename/grep (qmd absent, **or** `{repo}-facts` registered but holding no
160
- cards yet — the first-run-on-a-scaffolded-facts-dir case) — the one advisory
161
- line saying so. Fire this advisory whenever semantic retrieval was effectively
162
- unavailable, even if the collection appeared in `qmd collection list`: a
163
- registered-but-empty collection is not semantic retrieval. A run that finds
164
- nothing surprising is **valid**: say
165
- "no surprising entries in the inbox," don't pad.
58
+ 6. **Consume the digested entries LAST.** Only after every card is written, delete exactly the entry blocks this run digested from `docs/memory/inbox/*.md` (keep each file's header; never touch undigested blocks). Last, so a crash mid-run leaves the entries in place and the re-run re-digests them — reconciliation NOOPs the already-written cards. This consumption is the only bookkeeping; there is no `.digest-state.md`.
59
+
60
+ 7. **If qmd present, refresh the lens** (skip silently if `command -v qmd` finds nothing):
61
+ - `qmd collection add docs/memory/facts --name {repo}-facts` — register the collection. Re-adding an existing name exits non-zero with "already exists"; **treat that as success.** Never register `docs/memory` as a whole — that would sweep the raw inbox queue into the index.
62
+ - `qmd context add qmd://{repo}-facts/ "Distilled recent decisions/observations, provenance-linked"` — upserts, safe to re-run.
63
+ - `qmd update` — **re-scan the collection for the cards you just wrote.** In qmd 2.5.3 `collection add` on an already-registered name does NOT re-index new files; `qmd update` is what picks them up. Skipping this leaves the new cards invisible to retrieval (to the `prompt-recall` hook, and to distill②).
64
+ - `qmd embed -c {repo}-facts` — regenerate vectors for the new/changed cards. Always scope with `-c`; a bare `qmd embed` re-embeds every repo on the machine. The `prompt-recall` hook's vector fallback only sees embedded cards, so skipping this hides new cards from prompt-time recall.
65
+
66
+ 8. **Report** (in chat). Cards added / updated / superseded / NOOP'd, the entries consumed per actor, and — if reconciliation fell back to filename/grep (qmd absent, **or** `{repo}-facts` registered but holding no cards yet — the first-run-on-a-scaffolded-facts-dir case) — the one advisory line saying so. Fire this advisory whenever semantic retrieval was effectively unavailable, even if the collection appeared in `qmd collection list`: a registered-but-empty collection is not semantic retrieval. A run that finds nothing surprising is **valid**: say "no surprising entries in the inbox," don't pad.
166
67
 
167
68
  ---
168
69
 
169
70
  ## Mode: `docs` (fact-cards → proposed doc deltas)
170
71
 
171
- Distill fact-cards into proposed edits to `docs/` (the cold, human-owned SSoT) —
172
- the next hop down the gradient from `facts`. The full procedure (input selection,
173
- delta drafting, digestion marking, the pillar escape valve, trigger wiring) is in
174
- [`references/docs-mode.md`](references/docs-mode.md) — follow it; reuses
175
- `method.md`'s surprisal / EDU / reconciliation / bi-temporal vocabulary unchanged.
176
- It NEVER writes a doc on its own — it **drafts and presents**; the human disposes.
72
+ Distill fact-cards into proposed edits to `docs/` (the cold, human-owned SSoT) — the next hop down the gradient from `facts`. The full procedure (input selection, delta drafting, digestion marking, the pillar escape valve, trigger wiring) is in [`references/docs-mode.md`](references/docs-mode.md) — follow it; reuses `method.md`'s surprisal / EDU / reconciliation / bi-temporal vocabulary unchanged. It NEVER writes a doc on its own — it **drafts and presents**; the human disposes.
177
73
 
178
74
  ---
179
75
 
180
76
  ## Rules
181
77
 
182
- - **One algorithm root.** Every mode reads `references/method.md`. Extend the
183
- spec there — never inline a divergent copy of the four methods in a mode.
184
- - **Consume, never rewrite.** `docs/memory/inbox/` is a queue owned by the
185
- `session-reflect` capture hook. The distiller deletes exactly the entry blocks
186
- it digested this run — no edits, no reordering, no touching undigested blocks.
187
- Beyond that consumption it writes only under `docs/memory/facts/`.
188
- - **Idempotent via consumption.** What is in the inbox is what is undigested.
189
- Consume last; a second run finds an empty inbox and is a NOOP.
190
- - **Cards are atomic and provenance-linked.** One self-contained statement per
191
- card; every card resolves back to the session ids and commits it came from.
192
- Decompose — never lossily summarize.
193
- - **Supersede ≠ delete.** Bi-temporal only: set `invalid_from:` +
194
- `superseded_by:` on the old card and leave the file in place. Nothing is ever
195
- removed from `docs/memory/facts/`.
196
- - **Findings are questions, not verdicts.** When a candidate appears to
197
- contradict an existing card, phrase it as a question (is X now superseded by
198
- Y?) — never assert staleness or falsity.
199
- - **Never auto-runs.** Invoked by the user, by the Completion flow (kit
200
- `CLAUDE.md`), or by accepting the maintenance proposal. No cron, no daemon, no
201
- hook self-trigger — a workflow step the agent runs is not a self-trigger.
202
- - **qmd is strictly optional.** Guard every qmd call on `command -v qmd`; absent
203
- ⇒ silent skip. Reconciliation additionally needs the `{repo}-facts` collection
204
- to hold **cards** — not merely to be registered. "Unbuilt" here means **no
205
- cards** (`docs/memory/facts/*.md` empty), not "unregistered": harness-manager's
206
- baseline registers + embeds `{repo}-facts` over an empty scaffolded facts dir,
207
- so on a qmd-equipped, freshly-baselined repo the collection *appears in*
208
- `qmd collection list` yet indexes zero cards. Binary present but collection
209
- cardless (first run) falls back to filename/grep too, same as qmd being absent.
78
+ - **One algorithm root.** Every mode reads `references/method.md`. Extend the spec there — never inline a divergent copy of the four methods in a mode.
79
+ - **Consume, never rewrite.** `docs/memory/inbox/` is a queue owned by the `session-reflect` capture hook. The distiller deletes exactly the entry blocks it digested this run — no edits, no reordering, no touching undigested blocks. Beyond that consumption it writes only under `docs/memory/facts/`.
80
+ - **Idempotent via consumption.** What is in the inbox is what is undigested. Consume last; a second run finds an empty inbox and is a NOOP.
81
+ - **Cards are atomic and provenance-linked.** One self-contained statement per card; every card resolves back to the session ids and commits it came from. Decompose — never lossily summarize.
82
+ - **Supersede ≠ delete.** Bi-temporal only: set `invalid_from:` + `superseded_by:` on the old card and leave the file in place. Nothing is ever removed from `docs/memory/facts/`.
83
+ - **Findings are questions, not verdicts.** When a candidate appears to contradict an existing card, phrase it as a question (is X now superseded by Y?) — never assert staleness or falsity.
84
+ - **Never auto-runs.** Invoked by the user, by the Completion flow (kit `CLAUDE.md`), or by accepting the maintenance proposal. No cron, no daemon, no hook self-trigger — a workflow step the agent runs is not a self-trigger.
85
+ - **qmd is strictly optional.** Guard every qmd call on `command -v qmd`; absent ⇒ silent skip. Reconciliation additionally needs the `{repo}-facts` collection to hold **cards** — not merely to be registered. "Unbuilt" here means **no cards** (`docs/memory/facts/*.md` empty), not "unregistered": harness-manager's baseline registers + embeds `{repo}-facts` over an empty scaffolded facts dir, so on a qmd-equipped, freshly-baselined repo the collection _appears in_ `qmd collection list` yet indexes zero cards. Binary present but collection cardless (first run) falls back to filename/grep too, same as qmd being absent.
210
86
 
211
87
  ## Output locations
212
88
 
213
- - `facts` reads `docs/memory/inbox/`, writes fact-cards to
214
- `docs/memory/facts/{kebab-slug}.md`, and deletes the consumed entry blocks
215
- from the inbox; the report goes to chat.
216
- - `docs` presents doc deltas in chat and, **only on approval**, writes the accepted
217
- prose into the target doc under `docs/` (+ a new `docs/history/changelog/` entry if
218
- drafted) and appends `digested_into:` to each consumed card in `docs/memory/facts/`.
219
- See [`references/docs-mode.md`](references/docs-mode.md).
89
+ - `facts` reads `docs/memory/inbox/`, writes fact-cards to `docs/memory/facts/{kebab-slug}.md`, and deletes the consumed entry blocks from the inbox; the report goes to chat.
90
+ - `docs` presents doc deltas in chat and, **only on approval**, writes the accepted prose into the target doc under `docs/` (+ a new `docs/history/changelog/` entry if drafted) and appends `digested_into:` to each consumed card in `docs/memory/facts/`. See [`references/docs-mode.md`](references/docs-mode.md).