selflore 0.0.2 → 0.2.0

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 (51) hide show
  1. package/README.md +80 -17
  2. package/dist/cli.js +87 -17
  3. package/dist/hooks/capture-worker.js +27 -0
  4. package/dist/hooks/io.js +6 -1
  5. package/dist/hooks/session-start.js +2 -8
  6. package/dist/hooks/stop.js +3 -21
  7. package/dist/hooks/user-prompt-submit.js +10 -0
  8. package/dist/init.js +84 -18
  9. package/dist/lib/background.js +173 -0
  10. package/dist/lib/capture-prompt.js +39 -0
  11. package/dist/lib/commands.js +321 -67
  12. package/dist/lib/config.js +84 -5
  13. package/dist/lib/entries.js +82 -3
  14. package/dist/lib/heat.js +141 -0
  15. package/dist/lib/hook-logic.js +107 -0
  16. package/dist/lib/index-cache.js +46 -0
  17. package/dist/lib/install.js +2 -3
  18. package/dist/lib/links.js +58 -0
  19. package/dist/lib/logo.js +6 -0
  20. package/dist/lib/notes-graph.js +585 -0
  21. package/dist/lib/notes-html.js +148 -330
  22. package/dist/lib/notes-page-css.js +279 -0
  23. package/dist/lib/notes-page-js.js +959 -0
  24. package/dist/lib/notes.js +19 -6
  25. package/dist/lib/nudge.js +8 -1
  26. package/dist/lib/paths.js +6 -0
  27. package/dist/lib/question.js +19 -0
  28. package/dist/lib/queue.js +6 -4
  29. package/dist/lib/recall.js +149 -0
  30. package/dist/lib/results.js +11 -1
  31. package/dist/lib/retag.js +150 -0
  32. package/dist/lib/server-launch.js +73 -0
  33. package/dist/lib/server.js +120 -0
  34. package/dist/lib/session.js +27 -1
  35. package/dist/lib/settings.js +5 -1
  36. package/dist/lib/signals.js +51 -0
  37. package/dist/lib/stats.js +72 -40
  38. package/dist/lib/struggle.js +120 -0
  39. package/dist/lib/surface.js +75 -0
  40. package/dist/lib/transcript.js +205 -37
  41. package/dist/lib/ui.js +127 -0
  42. package/dist/notes-server.js +39 -0
  43. package/dist/sl.js +33 -14
  44. package/dist/vendor/graph3d.js +5402 -0
  45. package/package.json +6 -3
  46. package/skill/SKILL.md +29 -14
  47. package/skill/references/capture.md +16 -12
  48. package/skill/references/log.md +2 -2
  49. package/skill/references/recall.md +44 -0
  50. package/skill/references/stats.md +5 -1
  51. package/skill/references/test.md +49 -31
@@ -2,6 +2,54 @@ import fs from "node:fs";
2
2
  import path from "node:path";
3
3
  import { paths } from "./paths.js";
4
4
  export const KINDS = ["bug", "decision", "concept", "pattern"];
5
+ export const LEVELS = ["detail", "design"];
6
+ /** Entries from before `level` existed: decisions are design-level, everything else detail. */
7
+ export function inferLevel(kind) {
8
+ return kind === "decision" ? "design" : "detail";
9
+ }
10
+ /** How an entry came to exist: the user asked for an explanation, a fail → fix loop, a dependency change, or a large write. */
11
+ export const ORIGINS = ["asked", "bugfix", "dependency", "write"];
12
+ /** Entries from before `origin` existed: a root-caused bug was a bug fix, everything else a write. */
13
+ export function inferOrigin(kind) {
14
+ return kind === "bug" ? "bugfix" : "write";
15
+ }
16
+ /** One spelling per topic ("React " and "react" are the same hub): trimmed, lowercased, single spaces. */
17
+ export function normalizeSkill(s) {
18
+ return String(s ?? "").trim().toLowerCase().replace(/\s+/g, " ");
19
+ }
20
+ export const MAX_TOPICS = 3;
21
+ /**
22
+ * Words that say what kind of work it was, not what it was about. They made every entry
23
+ * "architecture" or "debugging"; a topic names the technology or the concept instead.
24
+ */
25
+ export const GENERIC_TOPICS = new Set("architecture debugging fundamentals design bug bugs bugfix decision concept pattern code coding programming software general misc other".split(" "));
26
+ /**
27
+ * An entry's topics from whatever was stored: a list, a comma-separated string, or (entries from
28
+ * before topics existed) the single `skill`. Normalised, de-duplicated, at most MAX_TOPICS, and
29
+ * generic words dropped whenever a real topic is there too.
30
+ */
31
+ export function normalizeTopics(topics, skill) {
32
+ const raw = Array.isArray(topics) ? topics : typeof topics === "string" && topics.trim() ? topics.split(",") : [];
33
+ let list = [...new Set(raw.map(normalizeSkill).filter(Boolean))];
34
+ if (!list.length && normalizeSkill(skill))
35
+ list = [normalizeSkill(skill)];
36
+ const real = list.filter((t) => !GENERIC_TOPICS.has(t));
37
+ return (real.length ? real : list).slice(0, MAX_TOPICS);
38
+ }
39
+ /**
40
+ * Does an entry fall in one of the user's keep-sharp areas? A stack name matches a topic; the
41
+ * built-in areas match the kind of work, since they are no longer used as topic names.
42
+ */
43
+ export function isSharp(e, keepSharp) {
44
+ return keepSharp.map(normalizeSkill).some((k) => e.topics.includes(k) ||
45
+ (k === "debugging" && e.kind === "bug") ||
46
+ (k === "architecture" && (e.level === "design" || e.kind === "decision")) ||
47
+ (k === "fundamentals" && e.kind === "concept"));
48
+ }
49
+ /** True when an entry has no real topic yet (only generic words, or nothing). */
50
+ export function needsTopics(topics) {
51
+ return !topics.some((t) => !GENERIC_TOPICS.has(t));
52
+ }
5
53
  export const MAX_BODY_WORDS = 150; // PRD says ~120; small grace before rejecting
6
54
  export const MAX_SNIPPET_LINES = 40;
7
55
  const FIELD_ORDER = [
@@ -11,8 +59,12 @@ const FIELD_ORDER = [
11
59
  "project",
12
60
  "commit",
13
61
  "kind",
62
+ "level",
14
63
  "skill",
64
+ "topics",
65
+ "origin",
15
66
  "paths",
67
+ "sig",
16
68
  "testable",
17
69
  "suppressed",
18
70
  ];
@@ -92,8 +144,12 @@ export function validateEntry(e) {
92
144
  errors.push("missing `testable` — if you cannot write a test question, the moment is not worth logging");
93
145
  if (!e.kind || !KINDS.includes(e.kind))
94
146
  errors.push(`\`kind\` must be one of ${KINDS.join(" | ")}`);
95
- if (!e.skill || !String(e.skill).trim())
96
- errors.push("missing `skill`");
147
+ if (e.level !== undefined && !LEVELS.includes(e.level))
148
+ errors.push(`\`level\` must be one of ${LEVELS.join(" | ")}`);
149
+ if (!normalizeTopics(e.topics, e.skill).length)
150
+ errors.push("missing `topics` (1–3: the technology, then the concept)");
151
+ if (e.origin !== undefined && !ORIGINS.includes(e.origin))
152
+ errors.push(`\`origin\` must be one of ${ORIGINS.join(" | ")}`);
97
153
  const { prose, snippet } = splitBody(e.body ?? "");
98
154
  const words = prose.split(/\s+/).filter(Boolean).length;
99
155
  if (words === 0)
@@ -159,6 +215,7 @@ export function listEntries() {
159
215
  .filter((e) => e !== null);
160
216
  }
161
217
  function normalize(p, id) {
218
+ const topics = normalizeTopics(p.topics, p.skill);
162
219
  return {
163
220
  id: p.id ?? id,
164
221
  date: String(p.date ?? id.slice(0, 10)),
@@ -166,10 +223,32 @@ function normalize(p, id) {
166
223
  project: String(p.project ?? ""),
167
224
  commit: String(p.commit ?? ""),
168
225
  kind: (p.kind ?? "concept"),
169
- skill: String(p.skill ?? ""),
226
+ level: LEVELS.includes(p.level) ? p.level : inferLevel(p.kind),
227
+ skill: topics[0] ?? "",
228
+ topics,
229
+ origin: ORIGINS.includes(p.origin) ? p.origin : inferOrigin(p.kind),
170
230
  paths: Array.isArray(p.paths) ? p.paths.map(String) : p.paths ? [String(p.paths)] : [],
231
+ sig: typeof p.sig === "string" ? p.sig : "",
171
232
  testable: String(p.testable ?? ""),
172
233
  suppressed: p.suppressed === true,
173
234
  body: p.body ?? "",
174
235
  };
175
236
  }
237
+ // Question scaffolding that says nothing about the topic ("why does … happen if …").
238
+ const STOPWORDS = new Set("the and for are was were why what when where which who how does did doesn don isn can could would should will this that these those with without from into than then there here have has had not but its it's you your our they them their about after before over under also just only use used using happen happens happened instead break breaks".split(" "));
239
+ export function words(s) {
240
+ return new Set(s.toLowerCase().match(/[a-z0-9_]+/g)?.filter((w) => w.length > 2 && !STOPWORDS.has(w)) ?? []);
241
+ }
242
+ /** Jaccard similarity of the word sets of two strings (words of 3+ chars). */
243
+ export function similarity(a, b) {
244
+ const wa = words(a);
245
+ const wb = words(b);
246
+ if (!wa.size || !wb.size)
247
+ return 0;
248
+ let inter = 0;
249
+ for (const w of wa)
250
+ if (wb.has(w))
251
+ inter++;
252
+ return inter / (wa.size + wb.size - inter);
253
+ }
254
+ export const MERGE_SIMILARITY = 0.5;
@@ -0,0 +1,141 @@
1
+ import { DAY_MS, REASK_AFTER_DAYS } from "./signals.js";
2
+ import { normPath } from "./struggle.js";
3
+ /**
4
+ * Heat: where the user gets stuck, read from what they did. One number per entry, 0 (cool,
5
+ * settled) to 1 (hot), or null when there is no signal either way. It is a map, not a grade:
6
+ * nothing here says "weak" or "failing", and every piece of evidence fades with a 30-day
7
+ * half-life, so nothing stays hot (or cool) forever without new evidence.
8
+ */
9
+ export const HALF_LIFE_DAYS = 30;
10
+ /** Below this much surviving evidence, an entry is neutral again. */
11
+ const MIN_EVIDENCE = 0.05;
12
+ const STEEPNESS = 2;
13
+ // How much each kind of evidence counts. Positive heats, negative cools.
14
+ const W = {
15
+ originAsked: 0.35, // you asked for this explanation: warm from day one
16
+ originBugfix: 0.3, // it came out of a fail → fix loop
17
+ ask: 0.3, // a note was needed to answer you
18
+ reask: 0.8, // …and needed again a week or more later
19
+ loop: 0.5, // a fail → fix loop on its files
20
+ missed: 1.0,
21
+ partial: 0.6,
22
+ got: -0.9,
23
+ touch: -0.3, // its files were edited with no trouble
24
+ };
25
+ function day(ts) {
26
+ return new Date(ts).toLocaleDateString("en-US", { month: "short", day: "numeric" });
27
+ }
28
+ function plural(n, one, many) {
29
+ return n === 1 ? one : `${n} ${many}`;
30
+ }
31
+ /** Heat for every entry. Suppressed entries get none. */
32
+ export function computeHeat({ entries, results, signals, now }) {
33
+ const t = now.getTime();
34
+ const byEntry = new Map();
35
+ const add = (id, e) => byEntry.set(id, [...(byEntry.get(id) ?? []), e]);
36
+ const live = entries.filter((e) => !e.suppressed);
37
+ for (const e of live) {
38
+ const [y, m, d] = e.date.split("-").map(Number);
39
+ const captured = new Date(y, m - 1, d, 12).getTime();
40
+ if (e.origin === "asked")
41
+ add(e.id, { w: W.originAsked, ts: captured, label: "you asked to have this explained" });
42
+ else if (e.origin === "bugfix")
43
+ add(e.id, { w: W.originBugfix, ts: captured, label: "it came out of a fix that took several tries" });
44
+ }
45
+ for (const r of results) {
46
+ const ts = new Date(r.ts).getTime();
47
+ if (r.grade === "got")
48
+ add(r.entry_id, { w: W.got, ts, label: `answered right (${day(ts)})` });
49
+ else
50
+ add(r.entry_id, { w: r.grade === "missed" ? W.missed : W.partial, ts, label: `${r.grade === "missed" ? "missed" : "partly right"} in a test (${day(ts)})` });
51
+ }
52
+ // Asks, in order: the first is mild, one a week or more after an earlier ask is a re-ask.
53
+ const asks = new Map();
54
+ for (const s of signals)
55
+ if (s.type === "ask")
56
+ asks.set(s.entry_id, [...(asks.get(s.entry_id) ?? []), new Date(s.ts).getTime()]);
57
+ for (const [id, times] of asks) {
58
+ times.sort((a, b) => a - b);
59
+ times.forEach((ts, i) => {
60
+ const again = i > 0 && ts - times[0] >= REASK_AFTER_DAYS * DAY_MS;
61
+ add(id, again ? { w: W.reask, ts, label: `asked about it again (${day(ts)})` } : { w: i === 0 ? W.ask : W.ask / 2, ts, label: `asked about it (${day(ts)})` });
62
+ });
63
+ }
64
+ // Loops and trouble-free edits, matched to entries through their files.
65
+ const byFile = new Map();
66
+ for (const e of live)
67
+ for (const p of e.paths)
68
+ byFile.set(`${e.project}\n${normPath(p)}`, [...(byFile.get(`${e.project}\n${normPath(p)}`) ?? []), e]);
69
+ for (const s of signals) {
70
+ if (s.type !== "loop" && s.type !== "touch")
71
+ continue;
72
+ const ts = new Date(s.ts).getTime();
73
+ const hit = new Set();
74
+ for (const p of s.paths)
75
+ for (const e of byFile.get(`${s.project}\n${normPath(p)}`) ?? [])
76
+ hit.add(e.id);
77
+ for (const id of hit)
78
+ add(id, s.type === "loop" ? { w: W.loop, ts, label: `a fix in its files took several tries (${day(ts)})` } : { w: W.touch, ts, label: `its files were edited without trouble (${day(ts)})` });
79
+ }
80
+ const out = new Map();
81
+ for (const e of live) {
82
+ const ev = (byEntry.get(e.id) ?? []).map((x) => ({ ...x, now: x.w * 0.5 ** (Math.max(0, t - x.ts) / DAY_MS / HALF_LIFE_DAYS) }));
83
+ const total = ev.reduce((sum, x) => sum + Math.abs(x.now), 0);
84
+ if (total < MIN_EVIDENCE) {
85
+ out.set(e.id, { heat: null, why: [] });
86
+ continue;
87
+ }
88
+ const net = ev.reduce((sum, x) => sum + x.now, 0);
89
+ const heat = 1 / (1 + Math.exp(-STEEPNESS * net));
90
+ // The reasons that point the way the entry ended up, strongest first.
91
+ const side = ev.filter((x) => (heat >= 0.5 ? x.now > 0 : x.now < 0)).sort((a, b) => Math.abs(b.now) - Math.abs(a.now));
92
+ out.set(e.id, { heat: Math.round(heat * 100) / 100, why: side.slice(0, 3).map((x) => x.label) });
93
+ }
94
+ return out;
95
+ }
96
+ /** Heat of a group: pulled toward its hottest entry, so one real trouble spot shows from a distance. Null if no entry has a signal. */
97
+ export function groupHeat(values) {
98
+ const known = values.filter((v) => v !== null);
99
+ if (!known.length)
100
+ return null;
101
+ const mean = known.reduce((a, b) => a + b, 0) / known.length;
102
+ return Math.round((0.6 * mean + 0.4 * Math.max(...known)) * 100) / 100;
103
+ }
104
+ // From here up an entry counts as a place the user gets stuck. Set above what a warm start alone
105
+ // can reach: being captured from a bug fix, or asked about once, is not yet "stuck".
106
+ export const HOT = 0.7;
107
+ /** The hottest project + topic groups, for "where you get stuck". Only groups with a hot entry are listed. */
108
+ export function hotAreas(entries, heat, opts = {}) {
109
+ const groups = new Map();
110
+ for (const e of entries) {
111
+ if (e.suppressed || (opts.project && e.project !== opts.project))
112
+ continue;
113
+ const key = `${e.project}\n${e.skill}`;
114
+ groups.set(key, [...(groups.get(key) ?? []), e]);
115
+ }
116
+ const areas = [];
117
+ for (const [key, list] of groups) {
118
+ const [project, topic] = key.split("\n");
119
+ const values = list.map((e) => heat.get(e.id)?.heat ?? null);
120
+ const h = groupHeat(values);
121
+ const hot = list.filter((e) => (heat.get(e.id)?.heat ?? 0) >= HOT);
122
+ if (h === null || !hot.length)
123
+ continue;
124
+ // What heated it, across its hot entries: "missed in a test (Nov 3)" ×2 → counted once per label kind.
125
+ const kinds = new Map();
126
+ for (const e of hot)
127
+ for (const w of heat.get(e.id).why)
128
+ kinds.set(w.replace(/ \([^)]*\)$/, ""), (kinds.get(w.replace(/ \([^)]*\)$/, "")) ?? 0) + 1);
129
+ const why = [...kinds.entries()].sort((a, b) => b[1] - a[1]).slice(0, 3).map(([label, n]) => (n > 1 ? `${label} ×${n}` : label));
130
+ areas.push({ project, topic, heat: h, notes: list.length, hot_notes: hot.length, why });
131
+ }
132
+ return areas.sort((a, b) => b.heat - a.heat || b.hot_notes - a.hot_notes || a.topic.localeCompare(b.topic)).slice(0, opts.limit ?? 5);
133
+ }
134
+ export function renderHotAreas(areas, showProject) {
135
+ if (!areas.length)
136
+ return ["Where you get stuck", " nothing stands out yet"];
137
+ return [
138
+ "Where you get stuck",
139
+ ...areas.map((a) => ` ${a.topic}${showProject ? ` · ${a.project}` : ""} — ${plural(a.hot_notes, "1 note", "notes")} of ${a.notes}: ${a.why.join("; ")}`),
140
+ ];
141
+ }
@@ -0,0 +1,107 @@
1
+ import { configExists, readConfig } from "./config.js";
2
+ import { keepWriteFor, spawnWorker } from "./background.js";
3
+ import { isCapturing, readSession, takeAnnounce, updateSession } from "./session.js";
4
+ import { anyTrigger, describeTriggers, detectTriggers, MIN_LINES, readTranscriptFrom } from "./transcript.js";
5
+ import { listEntries } from "./entries.js";
6
+ import { sessionStartContext } from "./nudge.js";
7
+ import { slCommand } from "./install.js";
8
+ import { projectOf, surface } from "./surface.js";
9
+ import { appendSignal, readSignals } from "./signals.js";
10
+ import { clearPending, pendingFor, recordWork, struggleLine } from "./struggle.js";
11
+ /**
12
+ * The Stop hook. It never blocks the turn: it only looks at work since the last capture and,
13
+ * if that work has triggers, either starts a detached background capture or (quiet mode)
14
+ * leaves a hint for the next prompt.
15
+ */
16
+ export function handleStop(input, deps = {}) {
17
+ if (!input.session_id || !configExists())
18
+ return "none";
19
+ const config = readConfig();
20
+ if (config.capture === "off")
21
+ return "off";
22
+ const now = deps.now ?? new Date();
23
+ const session = readSession(input.session_id);
24
+ // Don't advance past work a running capture hasn't finished; it'll be picked up next turn.
25
+ if (config.capture === "background" && isCapturing(session, now))
26
+ return "locked";
27
+ const cwd = input.cwd ?? process.cwd();
28
+ const { text, start, end } = readTranscriptFrom(input.transcript_path, session.scanned_offset);
29
+ const triggers = detectTriggers(text, {
30
+ minLines: MIN_LINES[config.capture_intensity],
31
+ keepWrite: deps.keepWrite ?? keepWriteFor(cwd),
32
+ });
33
+ // What the work itself says: loops on the same files, and edits that went without trouble.
34
+ recordWork({ session: input.session_id, cwd, triggers, offers: config.offers, now });
35
+ // No triggers: leave the offset where it is, so small steps across turns are judged together.
36
+ if (!anyTrigger(triggers))
37
+ return "none";
38
+ if (config.capture === "quiet") {
39
+ updateSession(input.session_id, { scanned_offset: end, pending: describeTriggers(triggers) });
40
+ return "pending";
41
+ }
42
+ const ok = (deps.spawn ?? spawnWorker)({
43
+ session: input.session_id,
44
+ transcript: input.transcript_path,
45
+ from: start,
46
+ to: end,
47
+ cwd,
48
+ });
49
+ if (!ok)
50
+ return "spawn-failed";
51
+ updateSession(input.session_id, { scanned_offset: end, capturing_since: now.toISOString() });
52
+ return "spawned";
53
+ }
54
+ /**
55
+ * UserPromptSubmit. Two independent jobs, both silent when there is nothing to say:
56
+ * - a question the user's notes may answer → the candidate notes (and, on a re-ask, one offer);
57
+ * - quiet capture mode → one line asking Claude to log at a natural pause.
58
+ */
59
+ export function handlePromptSubmit(input, now = new Date()) {
60
+ if (!input.session_id || !configExists())
61
+ return "";
62
+ const config = readConfig();
63
+ const session = readSession(input.session_id);
64
+ const lines = [];
65
+ const found = surface({
66
+ prompt: input.prompt,
67
+ cwd: input.cwd ?? process.cwd(),
68
+ session: input.session_id,
69
+ sl: slCommand(),
70
+ now,
71
+ mayOffer: config.offers && !session.offered,
72
+ });
73
+ if (found.text)
74
+ lines.push(found.text);
75
+ let offered = found.offered;
76
+ // A struggle offer queued by the Stop hook: delivered once, in the project it is about.
77
+ if (config.offers && !session.offered && !offered) {
78
+ const project = projectOf(input.cwd ?? process.cwd());
79
+ const pending = pendingFor(project, now, readSignals());
80
+ if (pending) {
81
+ lines.push(struggleLine(pending, project, slCommand()));
82
+ appendSignal({ type: "offer", ts: now.toISOString(), session: input.session_id, project, kind: "struggle", key: pending.area });
83
+ clearPending(project);
84
+ offered = true;
85
+ }
86
+ }
87
+ if (offered)
88
+ updateSession(input.session_id, { offered: true });
89
+ if (config.capture === "quiet" && session.pending) {
90
+ updateSession(input.session_id, { pending: null });
91
+ lines.push(`selflore: recent work had ${session.pending}. At a natural pause in this task (not mid-step, and never instead of answering the user), ` +
92
+ `use the selflore skill to log any lore-worthy moments (session_id=${input.session_id}). Don't mention this unless you log something.`);
93
+ }
94
+ return lines.join("\n");
95
+ }
96
+ export function handleSessionStart(input, now = new Date()) {
97
+ if (!configExists())
98
+ return "";
99
+ const config = readConfig();
100
+ const oldest = listEntries()[0]?.date ?? null; // ids are date-prefixed, so sorted oldest first
101
+ const lines = [sessionStartContext(input.session_id, config, oldest, now)];
102
+ const captured = takeAnnounce();
103
+ if (captured > 0)
104
+ lines.push(`selflore: captured ${captured} ${captured === 1 ? "entry" : "entries"} in the background since the last session. ` +
105
+ "Mention this once, in one short line, at the start of your first reply; then don't bring it up again.");
106
+ return lines.filter(Boolean).join("\n");
107
+ }
@@ -0,0 +1,46 @@
1
+ import fs from "node:fs";
2
+ import path from "node:path";
3
+ import { listEntries } from "./entries.js";
4
+ import { readJson, writeJson } from "./fsutil.js";
5
+ import { paths } from "./paths.js";
6
+ import { toDoc } from "./recall.js";
7
+ /**
8
+ * The recall index, cached on disk. The prompt hook runs on every message, so it must not parse
9
+ * every entry file each time: it stats them, and rebuilds only when one was added, removed or
10
+ * rewritten. Suppressed entries are left out.
11
+ */
12
+ const VERSION = 1;
13
+ /** Changes whenever an entry file is added, removed or rewritten. */
14
+ export function entriesStamp() {
15
+ let files;
16
+ try {
17
+ files = fs.readdirSync(paths.entries()).filter((f) => f.endsWith(".md"));
18
+ }
19
+ catch {
20
+ return `${VERSION}:0:0`;
21
+ }
22
+ let newest = 0;
23
+ for (const f of files) {
24
+ try {
25
+ newest = Math.max(newest, fs.statSync(path.join(paths.entries(), f)).mtimeMs);
26
+ }
27
+ catch {
28
+ // removed between readdir and stat
29
+ }
30
+ }
31
+ return `${VERSION}:${files.length}:${Math.round(newest)}`;
32
+ }
33
+ export function readIndex() {
34
+ const stamp = entriesStamp();
35
+ const cached = readJson(paths.index(), null);
36
+ if (cached && cached.stamp === stamp && Array.isArray(cached.docs))
37
+ return cached.docs;
38
+ const docs = listEntries().filter((e) => !e.suppressed).map(toDoc);
39
+ try {
40
+ writeJson(paths.index(), { stamp, docs });
41
+ }
42
+ catch {
43
+ // a read-only home still gets answers, just without the cache
44
+ }
45
+ return docs;
46
+ }
@@ -41,8 +41,7 @@ export function removeFiles(purge) {
41
41
  fs.rmSync(paths.skill(), { recursive: true, force: true });
42
42
  if (purge)
43
43
  fs.rmSync(selfloreHome(), { recursive: true, force: true });
44
- else {
44
+ // Session state is data: keeping it means a remove + init doesn't re-trigger capture for old sessions.
45
+ else
45
46
  fs.rmSync(paths.app(), { recursive: true, force: true });
46
- fs.rmSync(paths.state(), { recursive: true, force: true });
47
- }
48
47
  }
@@ -0,0 +1,58 @@
1
+ import { similarity } from "./entries.js";
2
+ /** Questions this alike are about the same idea even when they touch different files. */
3
+ export const LINK_SIMILARITY = 0.3;
4
+ /** Links kept per entry, so a project with many entries in one folder doesn't become a hairball. */
5
+ export const MAX_LINKS_PER_ENTRY = 4;
6
+ const PATH_BONUS = 0.3;
7
+ function dirOf(p) {
8
+ const clean = p.replace(/\\/g, "/").replace(/^\.\//, "").replace(/\/+$/, "");
9
+ const i = clean.lastIndexOf("/");
10
+ return i > 0 ? clean.slice(0, i) : "";
11
+ }
12
+ /** Two entries touch the same code: a shared file, or files in the same folder (not the repo root). */
13
+ export function pathsOverlap(a, b) {
14
+ for (const pa of a) {
15
+ for (const pb of b) {
16
+ if (pa === pb)
17
+ return true;
18
+ const da = dirOf(pa);
19
+ if (da && da === dirOf(pb))
20
+ return true;
21
+ }
22
+ }
23
+ return false;
24
+ }
25
+ /**
26
+ * Related entries for the notes graph: same project, and either overlapping paths or a similar
27
+ * question. Each entry keeps its strongest few links; a pair is kept when either side keeps it.
28
+ */
29
+ export function computeLinks(entries) {
30
+ const live = entries.filter((e) => !e.suppressed);
31
+ const byProject = new Map();
32
+ for (const e of live)
33
+ byProject.set(e.project, [...(byProject.get(e.project) ?? []), e]);
34
+ const candidates = new Map();
35
+ const push = (id, other, score) => candidates.set(id, [...(candidates.get(id) ?? []), { other, score }]);
36
+ for (const group of byProject.values()) {
37
+ for (let i = 0; i < group.length; i++) {
38
+ for (let j = i + 1; j < group.length; j++) {
39
+ const a = group[i];
40
+ const b = group[j];
41
+ const sim = similarity(a.testable, b.testable);
42
+ const overlap = pathsOverlap(a.paths, b.paths);
43
+ if (!overlap && sim < LINK_SIMILARITY)
44
+ continue;
45
+ const score = sim + (overlap ? PATH_BONUS : 0);
46
+ push(a.id, b.id, score);
47
+ push(b.id, a.id, score);
48
+ }
49
+ }
50
+ }
51
+ const keep = new Set();
52
+ for (const [id, list] of candidates) {
53
+ list.sort((x, y) => y.score - x.score || x.other.localeCompare(y.other));
54
+ for (const { other } of list.slice(0, MAX_LINKS_PER_ENTRY))
55
+ keep.add(id < other ? `${id}\n${other}` : `${other}\n${id}`);
56
+ }
57
+ return [...keep].sort().map((k) => k.split("\n"));
58
+ }
@@ -0,0 +1,6 @@
1
+ // Generated by scripts/logo/make.py from public/selflore-logo.png. Do not edit by hand.
2
+ /** The selflore mark as an alpha mask: the page paints it in its own text colour. */
3
+ export const LOGO_MASK = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGUAAABUCAYAAACbWvnHAAAW3klEQVR42u1daZQc1XX+qrpn1S60IQlrAySBZKyAMSDAbOIEg2UCBEs2OyQWxo7txElwknMSxzg4OQlODCYhmEUGDDgmiRwrEHBYBAKELFlhE4uEEGi1tpFmRjPT3VUvP+p74cv1q+7RSGhGoD6nz0xv1VXve/fe7373vteRcw4H8K3Avwn/HgLg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axv0F01y/V8hDHmNr4e788c48MIigJTQtY1uVF+H8UXp35Ad1U4UKzjQNzrvtp2ipOYsW9EVi4Yh0wpjg9EQADgfwHVZP7q/UTUOwAAAABJRU5ErkJggg==";
4
+ export const LOGO_MASK_RATIO = 1.2024; // width / height
5
+ /** The mark on its black tile, for the browser tab. */
6
+ export const FAVICON = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAARUElEQVR42u2be3CUV/nHP+++e82ySQgGAuQGCQ0CbeXWijSUAOES2iIGSFGMlwFm1DI644XpgIWOM05LncZ2wDqK2okGqTFYCYQWC9JfQkSMRILhknQSmmw25Aq5bDa777vv+f3R7HGXSyEYHCs9M2eyefecs8/znOfyfZ73HIWbN2WoG0P/ZwIrgQXAdCAaEENj/htaiJZeoBb4P+AwUD70vWlojLiTxUxhn/OGFjPCFviodGOI9rxb8HbTpg79nQAcuW5BHQh+BBgPDtEa/uzIEE/hPN6S+bmAJ4xp/SO4++Im9HuGeLupEEKq8QjQPTRB+wgzfn0P8dI9xGOEOZiGegLQFiY58T/WQzy1DfEa4luqw9v/gzt/K014+3pTWHMfMH+9ENaEx/y/DoUN/T4QgD7E619DOCZzSCrGfcB8OEbQgEwT8BRgDkN996xZLBZU9V8RaNq0abz66qs0NDTg9/u5du0aJ06cYO3atRFzbDbbSJNiDPH8FMDJMAAx4tJWVVVYLJaIZytWrBBFRUWis7NT3KwFg0Fx/PhxkZubG7GOzWYbSbAkhnin716pWjjBFotFLFy4UPzoRz8S586dE8FgUDJsGIbQNE0Eg0ERDAaFYRjyu5MnT4oNGzbcK1PoU+40QRhuU1WVYDCIzWZj6dKlLFiwgEmTJqHrOm63G0VRSE1NJSMjgylTpmC1WgEIBoMoyr9yLJPpA7xy6tQpCgsLKS0tpbW1VY79t+kEdox0VmexWNB1nWeeeYbXX3+dvLw87HY7brebzs5OnE4nvb29HDp0iO9///scPnwYTdNITk7G5XKhKApCCIQQBINBVFUlMTGRmTNncu7cOS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