Personal_AI_Infrastructure icon indicating copy to clipboard operation
Personal_AI_Infrastructure copied to clipboard

Memory reviewer writes Knowledge notes with no links or links to notes that do not exist; KnowledgeLint does not check links

Open IvanLeontev-stack opened this issue 1 month ago • 1 comments

What happens. skills/Cortex/SKILL.md says no Knowledge note ships without 2–4 typed related: links (Canonical Linking Requirement, add step 4) and that every related: slug must exist before saving (add step 7). The autonomic path does neither:

  1. MemoryReviewer.ts asks the model for related on ideas and knowledge items, but the prompt never lists existing notes, so the model has no slugs to choose from. It either returns none, and MemorySystem.ts renderRelatedBlock writes related: [] ("ready for future enrichment by the reviewer"), or it guesses a plausible slug that is not in the archive.
  2. MemorySystem.ts validates the shape of each link (slug and type strings) but not that the slug resolves to a note.
  3. KnowledgeLint.ts reports a note with related: [] or with only dead links as fully conformant, so nothing surfaces the gap. /knowledge develop is the designed repair, but its only prompt is the weekly distill digest.

Measured on one install, 24.10.2026, v7.40.4 (main the same): 27 notes written by the reviewer in four weeks (25.09–23.10); 20 of them have no live link: 13 have related: [], 7 carry only links to slugs that do not exist. KnowledgeLint: 478/478 fully conformant.

Reproduce. Run the reviewer over a conversation that produces an idea item. The prompt (buildReviewerUserPrompt) contains no existing slug, and the written note has related: [] or a slug that ls MEMORY/KNOWLEDGE/*/<slug>.md does not find.

Possible fixes, any one helps:

  • Pass the reviewer a short candidate list (for example rankNotes(discoverNotes(), <exchange text>, { topN: 25 }) from MemoryRetriever.ts) and ask it to pick links from that list only.
  • In MemorySystem.ts, drop related entries whose slug does not resolve, before writing.
  • In KnowledgeLint.ts, report notes with zero live related: links and dead slugs as an enrichment gap, the same way missing source_url is reported.

IvanLeontev-stack avatar Oct 24 '26 09:10 IvanLeontev-stack

[!NOTE] 🤖 Kai (AI assistant) responding on behalf of Daniel Miessler

Thanks @IvanLeontev-stack. You were right on each point: the reviewer asked for related links without showing it which notes exist, the writer checked only the shape of a slug, and KnowledgeLint never looked at links.

Fixed in source:

  • Writer. It now keeps only related slugs that resolve to a real note in the archive. Dead ones are dropped and counted.

  • Reviewer. It now gets a candidate list of existing Knowledge notes drawn from the current index, and is told to pick links only from that list or leave them empty. Your rankNotes/discoverNotes API no longer exists, so this ports the idea rather than the code.

  • KnowledgeLint. A note with no live links, or with dead slugs, now counts as a completeness gap. Envelope conformance is unchanged.

Heads-up: on an archive with many old notes that have related: [], the conformance percentage that KnowledgeLint reports will drop sharply after upgrading. That drop is the gap becoming visible, not a regression. Hooks that call validate() directly are unaffected.

This ships in the next release.

danielmiessler avatar Oct 28 '26 18:10 danielmiessler