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:
1 parent
626dc19e1b
commit
44d2e437eb
32 files changed
+634
-577
No files matched your search
+2
-2
@@ -1,5 +1,5 @@
|
||||
import { useEffect, useLayoutEffect, useReducer, useRef, useState } from "preact/hooks";
|
||||
import { ancestors, ancestorsInDoc, docOf, label, sections, staleness, type Conflict, type NodeId } from "../core/model";
|
||||
import { ancestors, ancestorsBelowRoot, docOf, label, sections, staleness, type Conflict, type NodeId } from "../core/model";
|
||||
import { verifyHistory, type Commit } from "../core/repo";
|
||||
import { clip, plain } from "../core/text";
|
||||
import { hostOf } from "../core/ref";
|
||||
@@ -219,7 +219,7 @@ function Jump() {
|
||||
<ul>
|
||||
{hits.map((id, k) => {
|
||||
const d = docOf(snap, id);
|
||||
const within = ancestorsInDoc(snap, id).reverse().slice(1);
|
||||
const within = ancestorsBelowRoot(snap, id).reverse().slice(1);
|
||||
return (
|
||||
<li key={id} class={k === i ? "selected" : ""} onClick={() => store.jumpTo(id)}>
|
||||
<span class="t">{label(snap, id)}</span>
|
||||
|
||||
Reference in new issue
Block a user