unknown-knowledge 2.1.0 → 3.0.0-rc.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.
@@ -42,7 +42,7 @@ score. Reflect is the judgment half, and this threshold is judgment.
42
42
 
43
43
  ### Residue and candidate findings — the misses that become edges
44
44
 
45
- Sessions append two kinds of finding that exist to be minted from
45
+ Sessions append two kinds of finding that can support reviewed repairs
46
46
  (UCS-1160), both through `log-entry.js` like every other fragment:
47
47
 
48
48
  - **Residue** — from `resolve`'s `decomposition.residue`: the non-stopword
@@ -65,9 +65,11 @@ mapped.
65
65
 
66
66
  ## Minting conduct — how a miss becomes a deterministic edge
67
67
 
68
- A corroborated residue cluster is evidence the store has no word for
69
- something the material keeps naming. Minting that word is the loop's whole
70
- point, and it is a governed act. Four vocabularies can be minted from
68
+ A corroborated residue cluster is evidence of recurring retrieval friction,
69
+ not proof that a new word is needed. Diagnose the failed route first (CLUSTER,
70
+ below): existing wording may already reach the concept while its leaf link or
71
+ source pointer is wrong. When a new word is the smallest supported repair,
72
+ minting it is a governed act. Four vocabularies can be minted from
71
73
  reflect: **terms**, **aliases**, **operations**, and **domain classes**.
72
74
 
73
75
  ### What "three distinct fragments" means
@@ -186,6 +188,48 @@ it takes the Disputed-clusters procedure (below) first.
186
188
  derived, never stored; `proposed` fragments keep their prior item
187
189
  membership (see the resume table).
188
190
 
191
+ #### Diagnose the failed route before proposing a repair
192
+
193
+ For each retrieval cluster, distinguish the **same supported problem** from
194
+ mere word overlap. Group by intended concept/leaf and the route that failed;
195
+ unrelated asks sharing a residue token do not corroborate each other. Show the
196
+ session/date events counted and which fragments are duplicates of one event.
197
+ Do not count repeated records of that event again. Missing event identity is
198
+ uncertain evidence, not permission to assume independence.
199
+
200
+ Replay the observed wording through public `resolve`, keeping the query and
201
+ options fixed for a later before/after comparison. Use a privacy-safe fixture
202
+ paraphrase when the original contains private text; never copy user text into
203
+ committed findings. Preserve the CLI output and the recovery route in the
204
+ review evidence. Enter stores through their catalogs/rules and read the
205
+ intended leaf and source, including a candidate's located section. Findings
206
+ report a struggle; only those reads establish what repair the material supports.
207
+
208
+ | Diagnosis | Smallest supported proposal and existing write path |
209
+ |---|---|
210
+ | The wording misses an existing concept | One observed alias on that concept (`alias-addition`), proposal-first ontology review, with the minting Decisions entry and its warrant. Do not enumerate speculative synonyms. |
211
+ | The concept resolves but its intended leaf is absent | The leaf's `concepts` edge (`knowledge-promotion` handoff to kb-build), after checking the leaf is actually about that concept. Do not substitute aliases for a missing relationship. |
212
+ | The leaf itself needs the observed search wording | A minimal `terms` revision (`knowledge-promotion` handoff to kb-build), with the minting Decisions provenance. Even a frontmatter-only leaf change uses kb-build. |
213
+ | The concept reaches an inaccurate source | `ssot-repoint`, with a freshly read replacement pointer and any matching `enumerates.source` change; do not hide the wrong pointer behind a vocabulary change. |
214
+ | Existing material needs an unminted operation or domain | `mint-proposal`, only with literary warrant and the existing registry/Decisions gate. A query miss alone does not warrant a new domain. |
215
+ | The organizational fact is undocumented, or the topic is outside scope | No terminology repair. Keep the fact unknown; route in-scope evidence work through the existing cited kb-build handoff or hold the gap. Expected out-of-scope absence warrants no expansion. General knowledge may explain the topic but cannot establish a company fact. |
216
+
217
+ The recommendation must name its diagnosis, the intended accession/concept,
218
+ why a smaller repair would not suffice, and a nearby query that must **not**
219
+ gain an unrelated match. These are review evidence, not new log fields or a
220
+ new automatic corroboration mechanism. Retain the existing change categories:
221
+ a leaf revision remains a handoff even when accompanied by a vocabulary
222
+ decision; do not duplicate it as a second recommendation just to count a mint.
223
+
224
+ Read prior rejected/resolved fragments and relevant Decisions before raising
225
+ the item. A repeated rejection without changed evidence does not create a new
226
+ proposal. For a real recurrence, re-open the original fragment, carry the old
227
+ reason and any new evidence into review, and honor registry suppressions.
228
+ Preserve that reason in the review evidence before the transition: the helper
229
+ clears the current `reason` on reopening; it does not retain it in the fragment.
230
+ Insufficient corroboration still means hold-and-age, never new siblings to
231
+ manufacture a threshold.
232
+
189
233
  ### 3. RECOMMEND — the evidence-gated list
190
234
 
191
235
  Build the recommendation list. One item per cluster that **meets the
@@ -272,16 +316,29 @@ APPLY; never re-ask a recorded outcome.
272
316
 
273
317
  ### 5. APPLY — approved diffs, then close the loop
274
318
 
275
- Apply each approved diff (as modified, if approve-with-modification), then
276
- re-run **both validators filtered to exactly the concepts the diff
277
- touched** an id left off the list is a check that never ran:
319
+ Apply each approved ontology/Decisions diff (as modified, if
320
+ approve-with-modification). Knowledge-leaf changes, including only `terms`,
321
+ `concepts`, `paths`, or citations, go through kb-build; reflect never writes
322
+ them directly. Approval of a reflect handoff does not promote the downstream
323
+ draft: kb-build's citation check, draft stage and human gate still apply.
324
+
325
+ Run full structural validation so leaf, registry and Decisions changes are
326
+ checked even when no ontology concept changed:
327
+
328
+ ```
329
+ node unknown-knowledge/engine/validate.js --root .
330
+ ```
331
+
332
+ For changed concepts, also re-run **both validators filtered to exactly the
333
+ concepts the diff touched** — an id left off the list is a check that never ran:
278
334
 
279
335
  ```
280
336
  node unknown-knowledge/engine/validate.js --concepts K-110 --root .
281
337
  node unknown-knowledge/engine/validate-values.js --concepts K-110 --root .
282
338
  ```
283
339
 
284
- - **Exit 0 + 0** — the loop is closed: transition the item's findings
340
+ - **All required validators exit 0** — continue to the discovery verification
341
+ below. Only after it passes, transition the item's findings
285
342
  `proposed → resolved` (the helper stamps `verified` with the run date).
286
343
  A finding is never resolved ahead of the green re-run — green first,
287
344
  then the transition.
@@ -299,6 +356,36 @@ to apply here: their findings stay `proposed` and resolve when the
299
356
  downstream gate (kb-build / new-kind pipeline) lands — reflect reports
300
357
  them as handed off.
301
358
 
359
+ For a retrieval repair, close the loop over the final approved records,
360
+ including any completed kb-build handoff:
361
+
362
+ 1. Regenerate and check disposable discovery using the same injected date
363
+ (`protocol/derived-layer.md`), never by editing generated files:
364
+
365
+ ```
366
+ node unknown-knowledge/engine/derive.js --root . --today 2026-09-10 --write
367
+ node unknown-knowledge/engine/derive.js --root . --today 2026-09-10 --check
368
+ ```
369
+
370
+ 2. Replay the saved public resolver query/options and the nearby negative
371
+ query. Verify the intended ID and navigable leaf/source, fewer recovery
372
+ steps, and no incorrect broadened match. A green derive check alone does
373
+ not prove recall: the resolver reads authored stores, not the derived index.
374
+ 3. For the acceptance walkthrough, run a **fresh agent** on the same request
375
+ with no proposed alias, target ID, answer, or earlier trace in its prompt.
376
+ Preserve actual commands, consulted sources/leaves, leaf-specific preflight
377
+ with the injected date, answer, and navigation steps. Compare correctness
378
+ and recovery effort, not just matching scores. A checklist or static prompt
379
+ assertion is not an agent trial; if a required trial cannot run, report it
380
+ pending rather than claiming completion.
381
+
382
+ Nonzero checks, an unrepaired route, or a new incorrect match keep the findings
383
+ unresolved. Use the failure/reopen procedure above for an applied defective
384
+ repair; an exit-2 check still stops the run. Preserve original authored records
385
+ as the source of truth and attach the before/after evidence to the reflect PR.
386
+ An interrupted retrieval repair must finish these checks before resolution,
387
+ even if its concept validators passed before the interruption.
388
+
302
389
  Completion criterion: every approved item is either resolved over a green
303
390
  filtered re-run, reverted-and-re-opened with the failure recorded, or
304
391
  handed off — and no fragment was ever edited by hand (`log-entry.js` is
@@ -1,15 +1,14 @@
1
1
  ---
2
- description: unknown-knowledge store — read {{root}}/protocol/AGENTS.md before working
2
+ description: First action — read {{root}}/protocol/AGENTS.md before recursive product-source discovery
3
3
  alwaysApply: true
4
4
  ---
5
5
 
6
6
  ## unknown-knowledge
7
7
 
8
- This repository carries an unknown-knowledge store at `{{root}}/` — three
9
- governed YAML stores that map the system and a deterministic engine that
10
- checks the map.
8
+ **First action on every request: read `{{root}}/protocol/AGENTS.md`** before
9
+ recursive product-source filename or content discovery. Follow that canonical
10
+ navigation contract to reach source through the knowledge base.
11
11
 
12
- Before working in this repository, read `{{root}}/protocol/AGENTS.md` the
13
- platform-agnostic navigation contract and follow its five-step runtime loop
14
- on every request. That file is the single source of truth for the protocol;
15
- this wrapper is a thin pointer and intentionally repeats none of it.
12
+ The seeded kit is at `{{root}}/`, relative to the repository root. The protocol
13
+ owns the navigation rules and runtime loop; this wrapper is only its entry
14
+ pointer.
@@ -1,10 +1,9 @@
1
1
  ## unknown-knowledge
2
2
 
3
- This repository carries an unknown-knowledge store at `{{root}}/` — three
4
- governed YAML stores that map the system and a deterministic engine that
5
- checks the map.
3
+ **First action on every request: read `{{root}}/protocol/AGENTS.md`** before
4
+ recursive product-source filename or content discovery. Follow that canonical
5
+ navigation contract to reach source through the knowledge base.
6
6
 
7
- Before working in this repository, read `{{root}}/protocol/AGENTS.md` the
8
- platform-agnostic navigation contract and follow its five-step runtime loop
9
- on every request. That file is the single source of truth for the protocol;
10
- this wrapper is a thin pointer and intentionally repeats none of it.
7
+ The seeded kit is at `{{root}}/`, relative to the repository root. The protocol
8
+ owns the navigation rules and runtime loop; this wrapper is only its entry
9
+ pointer.