Core without documents: no slugs; a node's top; targets by titles from the library root

The model has no slug any more (field, ops, canonical row, slugFor, freeSlug, RESERVED,
findDoc). The child of the root a node is under is a derived relation, topOf (docOf and
documents stay as deprecated aliases for the UI until step 2); ancestorsInDoc becomes
ancestorsBelowRoot. Slug keys and a target's old `doc` in stored libraries are ignored.

A node target's path is the titles down from the library root; `rel` marks a path read
below a top (a file being imported, what the agent or a person typed). Where two sections
share a title, the one the link is written in wins. The text format writes /Top title/…,
and ./… inside the exported subtree. The agent may give a node id as a target.

renderContext renders the top's outline in an <outline> tag, and steps down the focus
path when even titles are over budget. Prompts, the reviewer and the scanner speak of
the library, trees and tops; the scanner's unit is the top, with the same behaviour
(scripts/linkEval.ts gives identical metrics).

src/core/library.ts keeps a slug-free shim for the UI's document features (names made
from titles) until step 2 removes them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014yB6q4BHMwptTX3YFtkRab
This commit is contained in:
thalladaandClaude Opus 5.5 committed 2026-11-16 23:32:08 -05:00
1 parent 626dc19e1b
commit 44d2e437eb
32 files changed
+634 -577

No files matched your search

+2 -2
View File
@@ -147,7 +147,7 @@ describe("the reviewer", () => {
return { p, list: out };
}
it("judges many proposals a call, grouped by document and section, with what it takes to judge each", async () => {
it("judges many proposals a call, grouped by tree and section, with what it takes to judge each", async () => {
const { doc, minds, arms, stars } = library();
const { p, list } = proposals(doc, [minds, arms, stars], BATCH * 2 + 10);
const { llm, calls } = counting();
@@ -163,7 +163,7 @@ describe("the reviewer", () => {
expect(rep.fallback).toBeUndefined();
const first = calls[0];
expect(first).toMatchObject({ schema: "review", system: REVIEW_SYSTEM, effort: "low" });
expect(first.prompt).toContain("# Document: Octopus minds");
expect(first.prompt).toContain("# Tree: Octopus minds");
expect(first.prompt).toContain("## Section: Arms");
expect(first.prompt).toContain("“cephalopod” → Wikipedia article “T4” [scanner: unsure]");
expect(first.prompt).toContain("in: “The cephalopod arm tastes what it touches.”");