counterparts 0.3.1 → 0.3.2
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.
- package/CHANGELOG.md +49 -1
- package/docs/module-map.md +2 -0
- package/package.json +1 -1
- package/src/adapters/claude-code/NOTES.md +32 -0
- package/src/adapters/claude-code/bin/hook.ts +15 -2
- package/src/adapters/claude-code/bin/runner.ts +3 -1
- package/src/adapters/claude-code/config.ts +23 -0
- package/src/adapters/claude-code/doctor.ts +39 -20
- package/src/adapters/claude-code/hooks.ts +32 -12
- package/src/adapters/claude-code/index.ts +1 -0
- package/src/adapters/cli/commands.ts +178 -59
- package/src/adapters/cli/export.ts +27 -3
- package/src/adapters/cli/help.ts +22 -8
- package/src/adapters/cli/install.ts +3 -5
- package/src/adapters/cli/mechanisms.ts +295 -0
- package/src/adapters/cli/repair-dates.ts +3 -1
- package/src/adapters/dashboard/CONTRACT.md +13 -9
- package/src/adapters/dashboard/NOTES.md +3 -2
- package/src/adapters/dashboard/activity.ts +2 -1
- package/src/adapters/dashboard/bin/dashboard.ts +18 -3
- package/src/adapters/dashboard/upgrade.ts +23 -0
- package/src/adapters/dashboard/web/README.md +153 -0
- package/src/adapters/dashboard/web/actions.ts +631 -0
- package/src/adapters/dashboard/web/app.html +40 -1703
- package/src/adapters/dashboard/web/app.js +55 -0
- package/src/adapters/dashboard/web/mechanisms/association/index.js +15 -0
- package/src/adapters/dashboard/web/mechanisms/association/panel.js +17 -0
- package/src/adapters/dashboard/web/mechanisms/consolidation/index.js +15 -0
- package/src/adapters/dashboard/web/mechanisms/consolidation/panel.js +23 -0
- package/src/adapters/dashboard/web/mechanisms/decay/index.js +15 -0
- package/src/adapters/dashboard/web/mechanisms/decay/panel.js +45 -0
- package/src/adapters/dashboard/web/mechanisms/emotional/index.js +15 -0
- package/src/adapters/dashboard/web/mechanisms/episodic-semantic/index.js +15 -0
- package/src/adapters/dashboard/web/mechanisms/index.js +60 -0
- package/src/adapters/dashboard/web/mechanisms/interference/index.js +15 -0
- package/src/adapters/dashboard/web/mechanisms/picture.js +28 -0
- package/src/adapters/dashboard/web/mechanisms/prospective/index.js +15 -0
- package/src/adapters/dashboard/web/mechanisms/reconsolidation/index.js +15 -0
- package/src/adapters/dashboard/web/mechanisms/reconsolidation/panel.js +15 -0
- package/src/adapters/dashboard/web/mechanisms/regions.js +30 -0
- package/src/adapters/dashboard/web/mechanisms/retrieval/index.js +15 -0
- package/src/adapters/dashboard/web/mechanisms/retrieval/panel.js +20 -0
- package/src/adapters/dashboard/web/mechanisms/salience/index.js +15 -0
- package/src/adapters/dashboard/web/mechanisms/salience/panel.js +14 -0
- package/src/adapters/dashboard/web/mechanisms/schema/index.js +15 -0
- package/src/adapters/dashboard/web/narrate.ts +10 -10
- package/src/adapters/dashboard/web/pages/flow/flow.css +38 -0
- package/src/adapters/dashboard/web/pages/flow/index.js +117 -0
- package/src/adapters/dashboard/web/pages/flow/sections/blind.js +12 -0
- package/src/adapters/dashboard/web/pages/flow/sections/detail.js +45 -0
- package/src/adapters/dashboard/web/pages/flow/sections/diagram.js +291 -0
- package/src/adapters/dashboard/web/pages/flow/sections/feed.js +11 -0
- package/src/adapters/dashboard/web/pages/flow/sections/fired.js +41 -0
- package/src/adapters/dashboard/web/pages/flow/sections/heatmap.js +25 -0
- package/src/adapters/dashboard/web/pages/flow/sections/records.js +24 -0
- package/src/adapters/dashboard/web/pages/flow/sections/symmetry.js +17 -0
- package/src/adapters/dashboard/web/pages/flow/state.js +3 -0
- package/src/adapters/dashboard/web/pages/health/health.css +93 -0
- package/src/adapters/dashboard/web/pages/health/index.js +41 -0
- package/src/adapters/dashboard/web/pages/health/sections/archive.js +84 -0
- package/src/adapters/dashboard/web/pages/health/sections/checks.js +172 -0
- package/src/adapters/dashboard/web/pages/health/sections/cycle.js +37 -0
- package/src/adapters/dashboard/web/pages/health/sections/verify.js +54 -0
- package/src/adapters/dashboard/web/pages/home/brain.js +375 -0
- package/src/adapters/dashboard/web/pages/home/home.css +134 -0
- package/src/adapters/dashboard/web/pages/home/index.js +84 -0
- package/src/adapters/dashboard/web/pages/home/sections/explorer.js +206 -0
- package/src/adapters/dashboard/web/pages/home/sections/hero.js +22 -0
- package/src/adapters/dashboard/web/pages/home/sections/live-activity.js +25 -0
- package/src/adapters/dashboard/web/pages/home/sections/recent-chapters.js +13 -0
- package/src/adapters/dashboard/web/pages/home/sections/tiles.js +52 -0
- package/src/adapters/dashboard/web/pages/memories/index.js +75 -0
- package/src/adapters/dashboard/web/pages/memories/memories.css +143 -0
- package/src/adapters/dashboard/web/pages/memories/sections/constellation.js +178 -0
- package/src/adapters/dashboard/web/pages/memories/sections/kinds.js +42 -0
- package/src/adapters/dashboard/web/pages/memories/sections/list.js +114 -0
- package/src/adapters/dashboard/web/pages/memories/sections/search.js +102 -0
- package/src/adapters/dashboard/web/pages/memories/sections/tools.js +155 -0
- package/src/adapters/dashboard/web/pages/memories/state.js +22 -0
- package/src/adapters/dashboard/web/pages/self/diff.js +79 -0
- package/src/adapters/dashboard/web/pages/self/index.js +43 -0
- package/src/adapters/dashboard/web/pages/self/markdown.js +61 -0
- package/src/adapters/dashboard/web/pages/self/sections/journal.js +32 -0
- package/src/adapters/dashboard/web/pages/self/sections/page.js +149 -0
- package/src/adapters/dashboard/web/pages/self/sections/settling.js +150 -0
- package/src/adapters/dashboard/web/pages/self/sections/stories.js +47 -0
- package/src/adapters/dashboard/web/pages/self/sections/wake.js +74 -0
- package/src/adapters/dashboard/web/pages/self/self.css +182 -0
- package/src/adapters/dashboard/web/server.ts +305 -28
- package/src/adapters/dashboard/web/shared/absence.js +14 -0
- package/src/adapters/dashboard/web/shared/actions.js +48 -0
- package/src/adapters/dashboard/web/shared/api.js +17 -0
- package/src/adapters/dashboard/web/shared/base.css +34 -0
- package/src/adapters/dashboard/web/shared/canvas.js +68 -0
- package/src/adapters/dashboard/web/shared/colors.js +6 -0
- package/src/adapters/dashboard/web/shared/dom.js +4 -0
- package/src/adapters/dashboard/web/shared/event-modal.js +25 -0
- package/src/adapters/dashboard/web/shared/fonts/OFL-courier-prime.txt +93 -0
- package/src/adapters/dashboard/web/shared/fonts/OFL-outfit.txt +93 -0
- package/src/adapters/dashboard/web/shared/fonts/courier-prime-latin-400.woff2 +0 -0
- package/src/adapters/dashboard/web/shared/fonts/courier-prime-latin-700.woff2 +0 -0
- package/src/adapters/dashboard/web/shared/fonts/outfit-latin-wght.woff2 +0 -0
- package/src/adapters/dashboard/web/shared/format.js +31 -0
- package/src/adapters/dashboard/web/shared/layout.css +32 -0
- package/src/adapters/dashboard/web/shared/memory-modal.js +124 -0
- package/src/adapters/dashboard/web/shared/modal.css +24 -0
- package/src/adapters/dashboard/web/shared/modal.js +22 -0
- package/src/adapters/dashboard/web/shared/state.js +12 -0
- package/src/adapters/dashboard/web/shared/tip.css +4 -0
- package/src/adapters/dashboard/web/shared/tip.js +12 -0
- package/src/adapters/dashboard/web/shared/tokens.css +50 -0
- package/src/adapters/dashboard/web/shared/type.css +52 -0
- package/src/adapters/dashboard/web/shared/utilities.css +5 -0
- package/src/adapters/dashboard/web/shared/vendor/MIT-three.txt +21 -0
- package/src/adapters/dashboard/web/shared/vendor/three.module.min.js +6 -0
- package/src/adapters/dashboard/web/shared/widgets/bar.css +9 -0
- package/src/adapters/dashboard/web/shared/widgets/card.css +6 -0
- package/src/adapters/dashboard/web/shared/widgets/chapters.js +15 -0
- package/src/adapters/dashboard/web/shared/widgets/chart.css +4 -0
- package/src/adapters/dashboard/web/shared/widgets/confirm.css +31 -0
- package/src/adapters/dashboard/web/shared/widgets/confirm.js +52 -0
- package/src/adapters/dashboard/web/shared/widgets/feed.css +13 -0
- package/src/adapters/dashboard/web/shared/widgets/feed.js +41 -0
- package/src/adapters/dashboard/web/shared/widgets/light.css +4 -0
- package/src/adapters/dashboard/web/shared/widgets/light.js +15 -0
- package/src/adapters/dashboard/web/shared/widgets/rows.css +7 -0
- package/src/adapters/dashboard/web/shared/widgets/table.css +17 -0
- package/src/adapters/dashboard/web/shared/widgets/tiles.css +14 -0
- package/src/adapters/dashboard/web/shell/pages.js +15 -0
- package/src/adapters/dashboard/web/shell/pulse.js +86 -0
- package/src/adapters/dashboard/web/shell/tabs.js +49 -0
- package/src/adapters/dashboard/web/static.ts +76 -0
- package/src/adapters/dashboard/web/views/activity.ts +80 -0
- package/src/adapters/dashboard/web/views/archive-words.ts +57 -0
- package/src/adapters/dashboard/web/views/flow-view.ts +217 -0
- package/src/adapters/dashboard/web/views/health.ts +328 -0
- package/src/adapters/dashboard/web/views/mechanism-panel.ts +370 -0
- package/src/adapters/dashboard/web/views/mechanisms.ts +302 -0
- package/src/adapters/dashboard/web/views/memories.ts +342 -0
- package/src/adapters/dashboard/web/views/memory.ts +210 -0
- package/src/adapters/dashboard/web/views/meta.ts +64 -0
- package/src/adapters/dashboard/web/views/mind.ts +729 -0
- package/src/adapters/dashboard/web/views/overview.ts +282 -0
- package/src/adapters/dashboard/web/views/pulse.ts +19 -0
- package/src/adapters/dashboard/web/views/rows.ts +207 -0
- package/src/adapters/dashboard/web/views/search.ts +62 -0
- package/src/adapters/dashboard/web/views/shared.ts +161 -0
- package/src/adapters/dashboard/web/views.ts +34 -1724
- package/src/adapters/fired.ts +28 -17
- package/src/adapters/mcp/NOTES.md +43 -0
- package/src/adapters/mcp/bin/serve.ts +5 -1
- package/src/adapters/mcp/index.ts +3 -0
- package/src/adapters/mcp/server.ts +163 -6
- package/src/adapters/mcp/tools.ts +42 -0
- package/src/adapters/mcp/write-up.ts +1 -1
- package/src/core/counterpart.ts +30 -1
- package/src/core/feelings-wheel.ts +218 -0
- package/src/core/mint.ts +14 -2
- package/src/core/prospective/INTERFACE-GAPS.md +10 -0
- package/src/core/prospective/windows.ts +10 -48
- package/src/core/self/NOTES.md +17 -0
- package/src/core/self/calendar.ts +7 -78
- package/src/core/self/episodes.ts +7 -8
- package/src/core/self/index.ts +32 -11
- package/src/core/self/writer.ts +22 -22
- package/src/core/sleep/cycle.ts +8 -2
- package/src/core/store/CONTRACT.md +26 -7
- package/src/core/store/NOTES.md +142 -0
- package/src/core/store/errors.ts +15 -0
- package/src/core/store/feelings.ts +182 -0
- package/src/core/store/index.ts +297 -45
- package/src/core/store/operational.ts +133 -11
- package/src/core/store/owner-op-seam.ts +13 -3
- package/src/core/store/pre-migration.ts +3 -1
- package/src/core/store/prose.ts +8 -1
- package/src/core/store/render.ts +3 -0
- package/src/core/time.ts +374 -0
- package/src/core/types.ts +13 -0
- package/src/adapters/dashboard/web/brain.html +0 -463
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/* ───────────────────────────────────────────────────────────────────────────
|
|
2
|
+
The dashboard's one entry module. No dependencies, no bundler, no network
|
|
3
|
+
beyond this origin. Every panel is a pure function of one JSON view; nothing
|
|
4
|
+
is cached between loads, because the whole point of render-time resolution
|
|
5
|
+
is that a memory removed a minute ago stops resolving on the next request.
|
|
6
|
+
|
|
7
|
+
Where things live: `README.md` beside this file.
|
|
8
|
+
─────────────────────────────────────────────────────────────────────────── */
|
|
9
|
+
import { api, fail } from "./shared/api.js";
|
|
10
|
+
import { $ } from "./shared/dom.js";
|
|
11
|
+
import { mountModal } from "./shared/modal.js";
|
|
12
|
+
import { live, tabs } from "./shared/state.js";
|
|
13
|
+
import { PAGE, PAGES, TABS } from "./shell/pages.js";
|
|
14
|
+
import { poll } from "./shell/pulse.js";
|
|
15
|
+
import { mountNav, showTab } from "./shell/tabs.js";
|
|
16
|
+
|
|
17
|
+
// Each page writes its own markup into its section and wires its listeners.
|
|
18
|
+
for (const page of PAGES) page.mount($("tab-" + page.name));
|
|
19
|
+
mountNav();
|
|
20
|
+
mountModal();
|
|
21
|
+
|
|
22
|
+
let resizeTimer = null;
|
|
23
|
+
addEventListener("resize", () => {
|
|
24
|
+
clearTimeout(resizeTimer);
|
|
25
|
+
resizeTimer = setTimeout(() => {
|
|
26
|
+
const page = PAGE[tabs.current];
|
|
27
|
+
if (page && page.resize) page.resize();
|
|
28
|
+
}, 120);
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
(async function boot() {
|
|
32
|
+
try {
|
|
33
|
+
const meta = await api("/api/meta");
|
|
34
|
+
// The NAME of the store, not its address. A temp path in the header is in
|
|
35
|
+
// every screenshot this dashboard produces, and it says nothing about the
|
|
36
|
+
// store — the full path is one hover away for the moment it matters.
|
|
37
|
+
const name = meta.dir.replace(/\/+$/, "").split("/").pop() || meta.dir;
|
|
38
|
+
$("dir").textContent = name;
|
|
39
|
+
$("dir").title = "reading " + meta.dir;
|
|
40
|
+
$("clock").textContent = "day " + meta.day;
|
|
41
|
+
live.fingerprint = { rows: meta.rows, day: meta.day };
|
|
42
|
+
} catch (e) { fail("The header", e); }
|
|
43
|
+
showTab(location.hash.slice(1) || "home", false);
|
|
44
|
+
// Every tab is built once, up front: a screenshot of any of them should never
|
|
45
|
+
// be waiting on a fetch, and the flow diagram needs its data before it can be
|
|
46
|
+
// drawn at all.
|
|
47
|
+
await Promise.all(TABS.filter((t) => !tabs.loaded[t]).map((t) => { tabs.loaded[t] = true; return PAGE[t].render(); }));
|
|
48
|
+
// A canvas draws with whatever face is loaded at that moment; once the
|
|
49
|
+
// self-hosted faces have arrived, the tab on screen is redrawn with them.
|
|
50
|
+
try { await document.fonts.ready; } catch { /* no FontFaceSet: the fallback face stands */ }
|
|
51
|
+
const current = PAGE[tabs.current];
|
|
52
|
+
if (current.redraw) current.redraw();
|
|
53
|
+
setInterval(poll, 4000);
|
|
54
|
+
document.documentElement.dataset.loaded = "1";
|
|
55
|
+
})();
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/* Association. `explainer` is what Counterparts actually does, checked against
|
|
2
|
+
docs/research/mechanism-audit-2026-09-24.md; `built` / `inDevelopment` are the
|
|
3
|
+
audit plus #215/#218/#220, in plain words; `tagline` and `inDev` are the
|
|
4
|
+
site's (regions.ts). Its light comes from `/api/mechanisms`. */
|
|
5
|
+
export default {
|
|
6
|
+
id: "association",
|
|
7
|
+
family: "retrieval",
|
|
8
|
+
name: "Association",
|
|
9
|
+
short: "Association",
|
|
10
|
+
tagline: "Recalling one thing pulls its neighbours along with it.",
|
|
11
|
+
inDev: true,
|
|
12
|
+
explainer: "Memories used together in the same turn get linked, and a link can lift its partner later. It only lifts a memory the conversation already reached; a link cannot bring one to mind by itself.",
|
|
13
|
+
built: ["Memories used together in the same turn get linked after the session."],
|
|
14
|
+
inDevelopment: ["A link only lifts a memory the turn already reached; it cannot bring one to mind on its own.", "Links form only from use, so on most stores there are few."],
|
|
15
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/* Association, pictured: the graph hubs — the memories the most is wired to,
|
|
2
|
+
by summed link weight. (Moved here from the memories page.) */
|
|
3
|
+
import { esc } from "../../shared/dom.js";
|
|
4
|
+
import { bar, memLink, nothingYet, two } from "../picture.js";
|
|
5
|
+
|
|
6
|
+
export function picture(p) {
|
|
7
|
+
if (!p || p.hubs.length === 0) {
|
|
8
|
+
return nothingYet("Nothing has been wired together yet. Links form when memories are used in the same turn.");
|
|
9
|
+
}
|
|
10
|
+
const top = Math.max(...p.hubs.map((h) => h.weight), 0.0001);
|
|
11
|
+
return '<div class="pic-hubs">' + p.hubs.map((h) =>
|
|
12
|
+
'<div class="r">' + memLink(h, 90) +
|
|
13
|
+
'<div class="pic-two">' + bar(h.weight / top, "#ffc94d") +
|
|
14
|
+
'<span class="pic-meta">wired to ' + h.degree + " · weight " + two(h.weight) + "</span></div></div>"
|
|
15
|
+
).join("") + "</div>" +
|
|
16
|
+
'<p class="pic-cap">' + esc(p.links + " " + (p.links === 1 ? "link" : "links") + " in all. When one of these comes to mind, it can nudge its neighbours along.") + "</p>";
|
|
17
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/* Consolidation. `explainer` is what Counterparts actually does, checked against
|
|
2
|
+
docs/research/mechanism-audit-2026-09-24.md; `built` / `inDevelopment` are the
|
|
3
|
+
audit plus #215/#218/#220, in plain words; `tagline` and `inDev` are the
|
|
4
|
+
site's (regions.ts). Its light comes from `/api/mechanisms`. */
|
|
5
|
+
export default {
|
|
6
|
+
id: "consolidation",
|
|
7
|
+
family: "transformation",
|
|
8
|
+
name: "Consolidation",
|
|
9
|
+
short: "Consolidation",
|
|
10
|
+
tagline: "Memories aren’t saved when they’re made. They’re rebuilt, offline, while you sleep.",
|
|
11
|
+
inDev: true,
|
|
12
|
+
explainer: "Every few lived days a short “sleep” runs: exact duplicates are merged, and a memory that scored high and was used on three separate days becomes a core memory.",
|
|
13
|
+
built: ["A sleep pass every three lived days strengthens memories that held up and merges exact duplicates.", "A memory scored high and used on three separate days becomes a core memory."],
|
|
14
|
+
inDevelopment: ["Near-duplicates are not merged, on purpose, and few memories ever reach core (skills and places never can)."],
|
|
15
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/* Consolidation, pictured: memories climbing toward the core, and how far each
|
|
2
|
+
has to go. Becoming core takes both at once — a strong enough base, and real
|
|
3
|
+
use on separate lived days. */
|
|
4
|
+
import { esc } from "../../shared/dom.js";
|
|
5
|
+
import { bar, memLink, nothingYet, two } from "../picture.js";
|
|
6
|
+
|
|
7
|
+
export function picture(p) {
|
|
8
|
+
if (!p) return "";
|
|
9
|
+
const rows = p.climbing.length === 0
|
|
10
|
+
? nothingYet("Nothing is climbing toward the core yet.")
|
|
11
|
+
: '<ul class="pic-climb">' + p.climbing.map((c) =>
|
|
12
|
+
"<li>" + memLink(c, 90) +
|
|
13
|
+
'<div class="pic-two">' +
|
|
14
|
+
'<span class="pic-lab">strength ' + two(c.base) + " · needs " + two(p.threshold) + "</span>" + bar(c.base / p.threshold, "#b388ff") +
|
|
15
|
+
'<span class="pic-lab">used on ' + c.days + (c.days === 1 ? " day" : " days") + " · needs " + p.requiredDays + "</span>" + bar(c.days / p.requiredDays, "#00e5ff") +
|
|
16
|
+
"</div></li>"
|
|
17
|
+
).join("") + "</ul>";
|
|
18
|
+
const made = p.promoted.length === 0 ? "" :
|
|
19
|
+
'<div class="pic-head pic-gap">Recently became core</div><ul class="pic-list">' +
|
|
20
|
+
p.promoted.map((m) => "<li>" + memLink(m, 90) + '<span class="pic-meta">day ' + m.day + "</span></li>").join("") + "</ul>";
|
|
21
|
+
return rows + made +
|
|
22
|
+
'<p class="pic-cap">' + esc(p.core + " core " + (p.core === 1 ? "memory" : "memories") + " now. A memory becomes core when it is strong enough and has been used on " + p.requiredDays + " separate days.") + "</p>";
|
|
23
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/* Decay & forgetting. `explainer` is what Counterparts actually does, checked against
|
|
2
|
+
docs/research/mechanism-audit-2026-09-24.md; `built` / `inDevelopment` are the
|
|
3
|
+
audit plus #215/#218/#220, in plain words; `tagline` and `inDev` are the
|
|
4
|
+
site's (regions.ts). Its light comes from `/api/mechanisms`. */
|
|
5
|
+
export default {
|
|
6
|
+
id: "decay",
|
|
7
|
+
family: "storage",
|
|
8
|
+
name: "Decay & forgetting",
|
|
9
|
+
short: "Forgetting",
|
|
10
|
+
tagline: "Forgetting isn’t a failure of memory. It’s one of its jobs.",
|
|
11
|
+
inDev: false,
|
|
12
|
+
explainer: "Unused memories fade over the days you actually work together, not calendar days. Very faint ones are archived, not deleted, and memories in the core identity band do not fade at all.",
|
|
13
|
+
built: ["Unused memories fade on the days you actually work together, and restart the curve when used.", "Very faint ones are archived, never deleted; the core identity band does not fade.", "Cards for people and projects fade gently after months of silence (people slower), and naming one again in a saved memory keeps it or brings it back."],
|
|
14
|
+
inDevelopment: [],
|
|
15
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/* Forgetting, pictured: the fade curves of a few of this store's own memories,
|
|
2
|
+
from their last use to sixty lived days ahead, as the physics computes them.
|
|
3
|
+
Solid is what has happened; dashed is what will, if nobody uses it. */
|
|
4
|
+
import { esc } from "../../shared/dom.js";
|
|
5
|
+
import { memLink, nothingYet, two } from "../picture.js";
|
|
6
|
+
|
|
7
|
+
const COLOURS = ["#00e5ff", "#b388ff", "#ffd740", "#00bfa5"];
|
|
8
|
+
|
|
9
|
+
export const caption = "A few of my own memories, fading on the days we work together. Used again, a curve starts over.";
|
|
10
|
+
|
|
11
|
+
export function picture(p) {
|
|
12
|
+
if (!p || p.curves.length === 0) return nothingYet("There is nothing here that can fade yet.");
|
|
13
|
+
const W = 560, H = 190, L = 34, R = 10, T = 10, B = 26;
|
|
14
|
+
const span = Math.max(1, p.to - p.from);
|
|
15
|
+
const x = (d) => L + ((d - p.from) / span) * (W - L - R);
|
|
16
|
+
const y = (s) => T + (1 - Math.max(0, Math.min(1, s))) * (H - T - B);
|
|
17
|
+
const path = (pts) => pts.map((q, i) => (i === 0 ? "M" : "L") + x(q[0]).toFixed(1) + " " + y(q[1]).toFixed(1)).join(" ");
|
|
18
|
+
let svg = '<svg class="pic-svg" viewBox="0 0 ' + W + " " + H + '" role="img" aria-label="Fade curves of ' + p.curves.length + ' memories">';
|
|
19
|
+
// the two lines a memory crosses on its way down
|
|
20
|
+
svg += '<line class="pic-guide" x1="' + L + '" x2="' + (W - R) + '" y1="' + y(p.semanticFloor) + '" y2="' + y(p.semanticFloor) + '"/>' +
|
|
21
|
+
'<text class="pic-tick" x="' + (L + 4) + '" y="' + (y(p.semanticFloor) - 4) + '">settled knowledge above this line</text>' +
|
|
22
|
+
'<line class="pic-guide" x1="' + L + '" x2="' + (W - R) + '" y1="' + y(p.archiveLine) + '" y2="' + y(p.archiveLine) + '"/>' +
|
|
23
|
+
'<text class="pic-tick" text-anchor="end" x="' + (W - R) + '" y="' + (y(p.archiveLine) - 4) + '">archived below this line (kept, not deleted)</text>';
|
|
24
|
+
svg += '<line class="pic-now" x1="' + x(p.day) + '" x2="' + x(p.day) + '" y1="' + T + '" y2="' + (H - B) + '"/>' +
|
|
25
|
+
'<text class="pic-tick" x="' + (x(p.day) + 4) + '" y="' + (H - B - 4) + '">today</text>';
|
|
26
|
+
svg += '<text class="pic-tick" x="' + L + '" y="' + (H - 8) + '">day ' + p.from + "</text>" +
|
|
27
|
+
'<text class="pic-tick" text-anchor="end" x="' + (W - R) + '" y="' + (H - 8) + '">day ' + p.to + "</text>" +
|
|
28
|
+
'<text class="pic-tick" text-anchor="end" x="' + (L - 6) + '" y="' + (y(1) + 4) + '">1</text>' +
|
|
29
|
+
'<text class="pic-tick" text-anchor="end" x="' + (L - 6) + '" y="' + (y(0) + 4) + '">0</text>';
|
|
30
|
+
p.curves.forEach((c, i) => {
|
|
31
|
+
const col = COLOURS[i % COLOURS.length];
|
|
32
|
+
const past = c.points.filter((q) => q[0] <= p.day);
|
|
33
|
+
const ahead = c.points.filter((q) => q[0] >= p.day);
|
|
34
|
+
if (past.length > 1) svg += '<path d="' + path(past) + '" fill="none" stroke="' + col + '" stroke-width="2"/>';
|
|
35
|
+
if (ahead.length > 1) svg += '<path d="' + path(ahead) + '" fill="none" stroke="' + col + '" stroke-width="1.6" stroke-dasharray="4 4" opacity=".8"/>';
|
|
36
|
+
svg += '<circle cx="' + x(p.day) + '" cy="' + y(c.now) + '" r="3.5" fill="' + col + '"/>';
|
|
37
|
+
});
|
|
38
|
+
svg += "</svg>";
|
|
39
|
+
const legend = p.curves.map((c, i) =>
|
|
40
|
+
'<li><span class="pic-swatch" style="background:' + COLOURS[i % COLOURS.length] + '"></span><span>' + memLink(c, 90) +
|
|
41
|
+
'<span class="pic-meta">strength ' + two(c.now) + " now · last used day " + c.lastUsedDay +
|
|
42
|
+
(c.now < p.archiveLine ? " · already below the archive line" : c.archiveDay === null ? "" : " · reaches the archive line around day " + c.archiveDay + " if unused") + "</span></span></li>"
|
|
43
|
+
).join("");
|
|
44
|
+
return svg + '<ul class="pic-legend">' + legend + "</ul>" + '<p class="pic-cap">' + esc(caption) + "</p>";
|
|
45
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/* Emotional modulation. `explainer` is what Counterparts actually does, checked against
|
|
2
|
+
docs/research/mechanism-audit-2026-09-24.md; `built` / `inDevelopment` are the
|
|
3
|
+
audit plus #215/#218/#220, in plain words; `tagline` and `inDev` are the
|
|
4
|
+
site's (regions.ts). Its light comes from `/api/mechanisms`. */
|
|
5
|
+
export default {
|
|
6
|
+
id: "emotional",
|
|
7
|
+
family: "encoding",
|
|
8
|
+
name: "Emotional modulation",
|
|
9
|
+
short: "Emotion",
|
|
10
|
+
tagline: "The moments that mattered are the ones you keep. Feeling is the encoder’s thumb on the scale.",
|
|
11
|
+
inDev: true,
|
|
12
|
+
explainer: "A memory its author scored as emotional comes back more easily while you are expressing a feeling. The quoted feeling itself is kept as a label and does not add weight yet.",
|
|
13
|
+
built: ["A memory its author scored as emotional comes back more easily while you are expressing a feeling."],
|
|
14
|
+
inDevelopment: ["A quoted feeling is kept as a label only; it adds no weight.", "The score is dropped unless all three salience parts are given, and the feeling classifier is switched off."],
|
|
15
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/* Episodic ↔ semantic. `explainer` is what Counterparts actually does, checked against
|
|
2
|
+
docs/research/mechanism-audit-2026-09-24.md; `built` / `inDevelopment` are the
|
|
3
|
+
audit plus #215/#218/#220, in plain words; `tagline` and `inDev` are the
|
|
4
|
+
site's (regions.ts). Its light comes from `/api/mechanisms`. */
|
|
5
|
+
export default {
|
|
6
|
+
id: "episodic-semantic",
|
|
7
|
+
family: "transformation",
|
|
8
|
+
name: "Episodic ↔ semantic",
|
|
9
|
+
short: "Gist",
|
|
10
|
+
tagline: "“I met her on Tuesday” slowly becomes “I know her” — the event fades, the meaning stays.",
|
|
11
|
+
inDev: true,
|
|
12
|
+
explainer: "Not built yet. Memories carry a band label, but nothing turns many specific sessions into general knowledge.",
|
|
13
|
+
built: [],
|
|
14
|
+
inDevelopment: ["Nothing yet: memories carry a band label, but nothing distils many sessions into general knowledge."],
|
|
15
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/* The memory mechanisms, in the site's order (counterparts-site
|
|
2
|
+
features/home-v2/content/regions.ts, the two parked ones left out), and the
|
|
3
|
+
four families they are grouped by. One folder per mechanism; each module's
|
|
4
|
+
default export is { id, family, name, short, tagline, inDev, explainer,
|
|
5
|
+
built, inDevelopment } (the last two: plain-word bullets).
|
|
6
|
+
Whether it is firing comes from `/api/mechanisms` (views/mechanisms.ts).
|
|
7
|
+
|
|
8
|
+
A mechanism with a picture of this store's own data has a `panel.js` beside
|
|
9
|
+
its `index.js` (export `picture(payload)`, pure markup from
|
|
10
|
+
`/api/mechanism?id=`); PANELS below is the one place they are gathered, so a
|
|
11
|
+
mechanism built later ships its folder and one line here. */
|
|
12
|
+
import salience from "./salience/index.js";
|
|
13
|
+
import emotional from "./emotional/index.js";
|
|
14
|
+
import decay from "./decay/index.js";
|
|
15
|
+
import interference from "./interference/index.js";
|
|
16
|
+
import retrieval from "./retrieval/index.js";
|
|
17
|
+
import association from "./association/index.js";
|
|
18
|
+
import prospective from "./prospective/index.js";
|
|
19
|
+
import consolidation from "./consolidation/index.js";
|
|
20
|
+
import reconsolidation from "./reconsolidation/index.js";
|
|
21
|
+
import episodic_semantic from "./episodic-semantic/index.js";
|
|
22
|
+
import schema from "./schema/index.js";
|
|
23
|
+
import * as associationPanel from "./association/panel.js";
|
|
24
|
+
import * as consolidationPanel from "./consolidation/panel.js";
|
|
25
|
+
import * as decayPanel from "./decay/panel.js";
|
|
26
|
+
import * as reconsolidationPanel from "./reconsolidation/panel.js";
|
|
27
|
+
import * as retrievalPanel from "./retrieval/panel.js";
|
|
28
|
+
import * as saliencePanel from "./salience/panel.js";
|
|
29
|
+
|
|
30
|
+
export const MECHANISMS = [salience, emotional, decay, interference, retrieval, association, prospective, consolidation, reconsolidation, episodic_semantic, schema];
|
|
31
|
+
|
|
32
|
+
/** The pill groups, in the order a memory lives through them — the site's colours. */
|
|
33
|
+
export const FAMILIES = [
|
|
34
|
+
{ key: "encoding", label: "Encoding", color: "#00e5ff" },
|
|
35
|
+
{ key: "storage", label: "Storage", color: "#80a8ff" },
|
|
36
|
+
{ key: "retrieval", label: "Retrieval", color: "#ffc94d" },
|
|
37
|
+
{ key: "transformation", label: "Transformation", color: "#b387ff" },
|
|
38
|
+
];
|
|
39
|
+
|
|
40
|
+
/** Each mechanism's picture, by id. A mechanism missing here shows no picture. */
|
|
41
|
+
export const PANELS = {
|
|
42
|
+
salience: saliencePanel,
|
|
43
|
+
decay: decayPanel,
|
|
44
|
+
retrieval: retrievalPanel,
|
|
45
|
+
association: associationPanel,
|
|
46
|
+
consolidation: consolidationPanel,
|
|
47
|
+
reconsolidation: reconsolidationPanel,
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* "See how it works": the mechanism's plate in the site's Field Guide
|
|
52
|
+
* (counterparts.ai/ecosystem, each plate carries its mechanism id as its
|
|
53
|
+
* anchor). The Field Guide has no association plate, so that one links the
|
|
54
|
+
* home page's own mechanism panel instead.
|
|
55
|
+
*/
|
|
56
|
+
const SITE = "https://counterparts.ai";
|
|
57
|
+
const NO_PLATE = { association: SITE + "/#brain" };
|
|
58
|
+
export function guideUrl(id) {
|
|
59
|
+
return NO_PLATE[id] || SITE + "/ecosystem/#" + id;
|
|
60
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/* Interference. `explainer` is what Counterparts actually does, checked against
|
|
2
|
+
docs/research/mechanism-audit-2026-09-24.md; `built` / `inDevelopment` are the
|
|
3
|
+
audit plus #215/#218/#220, in plain words; `tagline` and `inDev` are the
|
|
4
|
+
site's (regions.ts). Its light comes from `/api/mechanisms`. */
|
|
5
|
+
export default {
|
|
6
|
+
id: "interference",
|
|
7
|
+
family: "storage",
|
|
8
|
+
name: "Interference",
|
|
9
|
+
short: "Interference",
|
|
10
|
+
tagline: "New memories crowd out old ones. Old ones distort new ones. They compete.",
|
|
11
|
+
inDev: true,
|
|
12
|
+
explainer: "Not built yet. Today only exact duplicates are merged; similar memories sit side by side without competing.",
|
|
13
|
+
built: [],
|
|
14
|
+
inDevelopment: ["Nothing yet: only byte-identical memories merge, and similar ones sit side by side without competing."],
|
|
15
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/* Small pieces every mechanism's picture is drawn from. Pure: each returns
|
|
2
|
+
markup, touches no DOM and fetches nothing, so a picture is a function of the
|
|
3
|
+
`/api/mechanism` payload alone. A memory is always clickable (the page's
|
|
4
|
+
`openMemory`), and a withheld one reads as withheld. */
|
|
5
|
+
import { esc } from "../shared/dom.js";
|
|
6
|
+
|
|
7
|
+
/** A memory's words, clickable. `width` trims long ones for a tight row. */
|
|
8
|
+
export function memLink(m, width) {
|
|
9
|
+
const text = width && m.text.length > width ? m.text.slice(0, width - 1).trimEnd() + "…" : m.text;
|
|
10
|
+
const cls = "pic-mem" + (m.confidential ? " withheld" : "");
|
|
11
|
+
return '<span class="' + cls + '" role="button" tabindex="0" title="' + esc(m.text) + '" onclick="openMemory(\'' +
|
|
12
|
+
esc(m.id) + '\')" onkeydown="if(event.key===\'Enter\')openMemory(\'' + esc(m.id) + '\')">' + esc(text) + "</span>";
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/** A thin horizontal bar, `frac` of the way, with a mark at `mark` if given. */
|
|
16
|
+
export function bar(frac, colour, mark) {
|
|
17
|
+
const w = Math.max(0, Math.min(1, frac || 0)) * 100;
|
|
18
|
+
return '<span class="pic-bar"><span class="pic-fill" style="width:' + w.toFixed(1) + "%;background:" + colour + '"></span>' +
|
|
19
|
+
(mark === undefined ? "" : '<span class="pic-mark" style="left:' + (Math.max(0, Math.min(1, mark)) * 100).toFixed(1) + '%"></span>') +
|
|
20
|
+
"</span>";
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/** The line a picture shows when this store has nothing to draw yet. */
|
|
24
|
+
export function nothingYet(text) {
|
|
25
|
+
return '<p class="pic-none">' + esc(text) + "</p>";
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const two = (x) => (typeof x === "number" && isFinite(x) ? x.toFixed(2) : "—");
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/* Prospective memory. `explainer` is what Counterparts actually does, checked against
|
|
2
|
+
docs/research/mechanism-audit-2026-09-24.md; `built` / `inDevelopment` are the
|
|
3
|
+
audit plus #215/#218/#220, in plain words; `tagline` and `inDev` are the
|
|
4
|
+
site's (regions.ts). Its light comes from `/api/mechanisms`. */
|
|
5
|
+
export default {
|
|
6
|
+
id: "prospective",
|
|
7
|
+
family: "retrieval",
|
|
8
|
+
name: "Prospective memory",
|
|
9
|
+
short: "Prospective",
|
|
10
|
+
tagline: "Remembering to do something later — the memory that fires itself at the right moment.",
|
|
11
|
+
inDev: true,
|
|
12
|
+
explainer: "Not built yet. A memory can carry a date, like a launch next Tuesday, but nothing brings it back on the day.",
|
|
13
|
+
built: ["Dated reminders can be stored and have their own records."],
|
|
14
|
+
inDevelopment: ["Nothing live can put a date on a memory yet, and nothing brings one back on the day."],
|
|
15
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/* Reconsolidation. `explainer` is what Counterparts actually does, checked against
|
|
2
|
+
docs/research/mechanism-audit-2026-09-24.md; `built` / `inDevelopment` are the
|
|
3
|
+
audit plus #215/#218/#220, in plain words; `tagline` and `inDev` are the
|
|
4
|
+
site's (regions.ts). Its light comes from `/api/mechanisms`. */
|
|
5
|
+
export default {
|
|
6
|
+
id: "reconsolidation",
|
|
7
|
+
family: "transformation",
|
|
8
|
+
name: "Reconsolidation",
|
|
9
|
+
short: "Reconsolidation",
|
|
10
|
+
tagline: "Recall makes a memory briefly editable. Then it’s re-stored, sometimes rewritten.",
|
|
11
|
+
inDev: false,
|
|
12
|
+
explainer: "When a new memory says it corrects a belief or a core line, that adds pressure, and once enough builds up over several days the old one is revised, with the old version kept for 90 lived days. Remembering alone changes nothing.",
|
|
13
|
+
built: ["When a new memory declares it corrects a belief or a core line, the correction adds pressure; past a bar, over several days for slow kinds, the old one is revised.", "The old version is kept for 90 lived days."],
|
|
14
|
+
inDevelopment: ["Nothing detects a contradiction by itself: the writer has to declare it.", "Just remembering does not change a memory."],
|
|
15
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/* Reconsolidation, pictured: recent corrections weighed against an old memory,
|
|
2
|
+
and how far each pushed toward the bar it would take to change it. */
|
|
3
|
+
import { esc } from "../../shared/dom.js";
|
|
4
|
+
import { bar, memLink, nothingYet, two } from "../picture.js";
|
|
5
|
+
|
|
6
|
+
export function picture(p) {
|
|
7
|
+
if (!p || p.revisions.length === 0) return nothingYet("Nothing new has argued with an old memory yet.");
|
|
8
|
+
return '<ul class="pic-climb">' + p.revisions.map((r) =>
|
|
9
|
+
'<li><div class="pic-head">day ' + r.day + (r.crossed ? ' · <span class="pic-crossed">changed my mind</span>' : " · holding for now") + "</div>" +
|
|
10
|
+
'<div class="pic-rev">' + memLink(r.challenger, 70) + ' <span class="pic-meta">argued with</span> ' + memLink(r.target, 70) + "</div>" +
|
|
11
|
+
'<div class="pic-two"><span class="pic-lab">pressure ' + two(r.pressure) + " of " + two(r.bar) + "</span>" +
|
|
12
|
+
bar(r.bar > 0 ? r.pressure / r.bar : 0, r.crossed ? "#ffd740" : "#00bfa5") + "</div></li>"
|
|
13
|
+
).join("") + "</ul>" +
|
|
14
|
+
'<p class="pic-cap">' + esc("An old memory changes only when new evidence adds up past its bar. The old version is kept, so you can see what I used to think.") + "</p>";
|
|
15
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/* The brain's regions and which mechanisms happen where — the site's mapping
|
|
2
|
+
(counterparts-site features/home-v2/content/regions.ts), with the two parked
|
|
3
|
+
mechanisms (identity, storage) left out, as the site leaves them out of its
|
|
4
|
+
pills. The home page's brain is drawn from this table; clicking a region
|
|
5
|
+
picks its first mechanism, and clicking it again steps to the next.
|
|
6
|
+
|
|
7
|
+
`col` is rgb 0..1 as the shader wants it; `anchor` is where the region's
|
|
8
|
+
point sits in the model's space. The cerebellum is drawn for anatomy and has
|
|
9
|
+
nothing to click. */
|
|
10
|
+
export const REGIONS = [
|
|
11
|
+
{ key: "prefrontal", name: "Prefrontal cortex", role: "Sense of self", col: [0.16, 0.8, 1.0], anchor: [0.0, 0.35, 1.2], active: true,
|
|
12
|
+
mechanisms: ["reconsolidation", "prospective", "schema"] },
|
|
13
|
+
{ key: "amygdala", name: "Amygdala", role: "What matters", col: [1.0, 0.42, 0.52], anchor: [0.42, -0.42, 0.42], active: true,
|
|
14
|
+
mechanisms: ["salience", "emotional"] },
|
|
15
|
+
{ key: "hippocampus", name: "Hippocampus", role: "Making memories last", col: [0.72, 0.53, 1.0], anchor: [0.38, -0.3, -0.2], active: true,
|
|
16
|
+
mechanisms: ["consolidation", "association", "interference"] },
|
|
17
|
+
{ key: "thalamus", name: "Thalamus", role: "What comes to mind", col: [1.0, 0.8, 0.32], anchor: [0.0, 0.05, 0.05], active: true,
|
|
18
|
+
mechanisms: ["retrieval"] },
|
|
19
|
+
{ key: "brainstem", name: "Brainstem", role: "The body clock", col: [0.55, 0.66, 0.85], anchor: [0.0, -0.8, -0.35], active: true,
|
|
20
|
+
mechanisms: ["decay"] },
|
|
21
|
+
{ key: "cortex", name: "Cortex", role: "Where memories live", col: [0.25, 1.0, 0.72], anchor: [-0.7, 0.55, -0.2], active: true,
|
|
22
|
+
mechanisms: ["episodic-semantic"] },
|
|
23
|
+
{ key: "cerebellum", name: "Cerebellum", role: "Movement and timing", col: [0.3, 0.42, 0.5], anchor: [0.0, -0.6, -0.85], active: false,
|
|
24
|
+
mechanisms: [] },
|
|
25
|
+
];
|
|
26
|
+
|
|
27
|
+
/** The region a mechanism happens in. */
|
|
28
|
+
export function regionOf(mechanismId) {
|
|
29
|
+
return REGIONS.find((r) => r.mechanisms.includes(mechanismId)) || null;
|
|
30
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/* Retrieval & strengthening. `explainer` is what Counterparts actually does, checked against
|
|
2
|
+
docs/research/mechanism-audit-2026-09-24.md; `built` / `inDevelopment` are the
|
|
3
|
+
audit plus #215/#218/#220, in plain words; `tagline` and `inDev` are the
|
|
4
|
+
site's (regions.ts). Its light comes from `/api/mechanisms`. */
|
|
5
|
+
export default {
|
|
6
|
+
id: "retrieval",
|
|
7
|
+
family: "retrieval",
|
|
8
|
+
name: "Retrieval & strengthening",
|
|
9
|
+
short: "Retrieval",
|
|
10
|
+
tagline: "Every time you remember something, you make it a little stronger.",
|
|
11
|
+
inDev: false,
|
|
12
|
+
explainer: "As you talk, it checks your words and their meaning for cues, and a few related memories come along. The ones a reply actually opens or quotes get stronger and fade more slowly; being shown alone earns nothing.",
|
|
13
|
+
built: ["Each turn your words, and their meaning from the turn before, cue a few related memories.", "A memory the reply opens or quotes gets stronger and fades more slowly."],
|
|
14
|
+
inDevelopment: ["Just being shown earns a memory nothing."],
|
|
15
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/* Retrieval, pictured: the last turns that brought memories to mind — which
|
|
2
|
+
were said out loud and which were kept as footnotes — and whether each has
|
|
3
|
+
actually been used since (read off the memory itself: its last credited use
|
|
4
|
+
is on or after that day). */
|
|
5
|
+
import { esc } from "../../shared/dom.js";
|
|
6
|
+
import { memLink, nothingYet } from "../picture.js";
|
|
7
|
+
|
|
8
|
+
export function picture(p) {
|
|
9
|
+
if (!p || p.turns.length === 0) return nothingYet("No turn has brought a memory to mind yet.");
|
|
10
|
+
return '<div class="pic-turns">' + p.turns.map((t) =>
|
|
11
|
+
'<div class="pic-turn"><div class="pic-head">day ' + t.day + " · turn " + t.turn + "</div><ul>" +
|
|
12
|
+
t.memories.map((m) =>
|
|
13
|
+
'<li><span class="pic-tag' + (m.said ? " on" : "") + '">' + (m.said ? "said" : "footnote") + "</span>" +
|
|
14
|
+
memLink(m, 80) +
|
|
15
|
+
'<span class="pic-used' + (m.usedSince ? " yes" : "") + '">' + (m.usedSince ? "used since" : "not used since") + "</span></li>"
|
|
16
|
+
).join("") +
|
|
17
|
+
"</ul></div>"
|
|
18
|
+
).join("") + "</div>" +
|
|
19
|
+
'<p class="pic-cap">' + esc("Said out loud means it came into the conversation; a footnote was near enough to mention. Only the ones actually used get stronger.") + "</p>";
|
|
20
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/* Encoding & salience. `explainer` is what Counterparts actually does, checked against
|
|
2
|
+
docs/research/mechanism-audit-2026-09-24.md; `built` / `inDevelopment` are the
|
|
3
|
+
audit plus #215/#218/#220, in plain words; `tagline` and `inDev` are the
|
|
4
|
+
site's (regions.ts). Its light comes from `/api/mechanisms`. */
|
|
5
|
+
export default {
|
|
6
|
+
id: "salience",
|
|
7
|
+
family: "encoding",
|
|
8
|
+
name: "Encoding & salience",
|
|
9
|
+
short: "Salience",
|
|
10
|
+
tagline: "Not everything that happens is worth keeping. Something has to decide.",
|
|
11
|
+
inDev: false,
|
|
12
|
+
explainer: "Every memory gets an importance score as it is written, set by the AI that lived the conversation, and now also by how new it is next to what is already stored. Small stuff fades fast; what mattered sticks.",
|
|
13
|
+
built: ["Every memory is scored as it is written: importance from the AI that lived the conversation, plus how new it is next to what is already stored (computed locally, no key)."],
|
|
14
|
+
inDevelopment: ["Novelty is blank while the store has no neighbours yet.", "Diary entries become memories without this scoring, by design."],
|
|
15
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* Salience, pictured: the most recent memories, each dot sized by the
|
|
2
|
+
importance score it was written with. */
|
|
3
|
+
import { esc } from "../../shared/dom.js";
|
|
4
|
+
import { memLink, nothingYet, two } from "../picture.js";
|
|
5
|
+
|
|
6
|
+
export function picture(p) {
|
|
7
|
+
if (!p || p.memories.length === 0) return nothingYet("Nothing has been written yet, so nothing has been scored.");
|
|
8
|
+
return '<ul class="pic-sal">' + p.memories.map((m) => {
|
|
9
|
+
const size = 6 + Math.round(Math.sqrt(Math.max(0, Math.min(1, m.salience))) * 22);
|
|
10
|
+
return '<li><span class="pic-dotwrap"><span class="pic-dot" style="width:' + size + "px;height:" + size + 'px"></span></span>' +
|
|
11
|
+
"<span>" + memLink(m, 90) + '<span class="pic-meta">score ' + two(m.salience) + " · " + esc(m.memKind) + " · born day " + m.bornDay + "</span></span></li>";
|
|
12
|
+
}).join("") + "</ul>" +
|
|
13
|
+
'<p class="pic-cap">' + esc("My newest memories, sized by how much each mattered when it was written. Small ones fade fast; what mattered sticks.") + "</p>";
|
|
14
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/* Schema & assimilation. `explainer` is what Counterparts actually does, checked against
|
|
2
|
+
docs/research/mechanism-audit-2026-09-24.md; `built` / `inDevelopment` are the
|
|
3
|
+
audit plus #215/#218/#220, in plain words; `tagline` and `inDev` are the
|
|
4
|
+
site's (regions.ts). Its light comes from `/api/mechanisms`. */
|
|
5
|
+
export default {
|
|
6
|
+
id: "schema",
|
|
7
|
+
family: "transformation",
|
|
8
|
+
name: "Schema & assimilation",
|
|
9
|
+
short: "Schemas",
|
|
10
|
+
tagline: "New facts don’t land on blank ground. They’re folded into what you already believe.",
|
|
11
|
+
inDev: true,
|
|
12
|
+
explainer: "Not built yet. It keeps cards for the people and projects it knows, but does not form beliefs about them from many memories.",
|
|
13
|
+
built: ["Cards for the people, projects and places it knows, which fade and come back with use."],
|
|
14
|
+
inDevelopment: ["Beliefs about them, weighed against new evidence, have no live producer yet."],
|
|
15
|
+
};
|
|
@@ -459,7 +459,7 @@ export const NARRATORS = {
|
|
|
459
459
|
? ""
|
|
460
460
|
: ` The cap set aside ${trimmed} element${trimmed === 1 ? "" : "s"} that would not fit.`;
|
|
461
461
|
return notable(
|
|
462
|
-
`The crash fallback read a transcript as ME: ${elements} element${elements === 1 ? "" : "s"} of my wake, ${num(bytes)} bytes, went in front of ${chunks} chunk${chunks === 1 ? "" : "s"}.${cut}${held}`,
|
|
462
|
+
`The crash fallback read a transcript as ME: ${elements} element${elements === 1 ? "" : "s"} of my wake, ${num(bytes, 0)} bytes, went in front of ${chunks} chunk${chunks === 1 ? "" : "s"}.${cut}${held}`,
|
|
463
463
|
);
|
|
464
464
|
},
|
|
465
465
|
|
|
@@ -509,12 +509,12 @@ export const NARRATORS = {
|
|
|
509
509
|
const bytes = n(t, "bytes") ?? 0;
|
|
510
510
|
const budget = n(t, "budget") ?? 0;
|
|
511
511
|
const trimmed = n(t, "trimmedTotal") ?? 0;
|
|
512
|
-
const where = budget > 0 ? ` of the ${num(budget)} bytes the host said it could carry` : "";
|
|
512
|
+
const where = budget > 0 ? ` of the ${num(budget, 0)} bytes the host said it could carry` : "";
|
|
513
513
|
if (trimmed === 0) {
|
|
514
|
-
return calm(`I rewrote my wake: ${num(bytes)} bytes${where}, with nothing trimmed.`);
|
|
514
|
+
return calm(`I rewrote my wake: ${num(bytes, 0)} bytes${where}, with nothing trimmed.`);
|
|
515
515
|
}
|
|
516
516
|
return calm(
|
|
517
|
-
`I rewrote my wake: ${num(bytes)} bytes${where}, after setting aside ${trimmed} element${trimmed === 1 ? "" : "s"} that would not fit.`,
|
|
517
|
+
`I rewrote my wake: ${num(bytes, 0)} bytes${where}, after setting aside ${trimmed} element${trimmed === 1 ? "" : "s"} that would not fit.`,
|
|
518
518
|
);
|
|
519
519
|
},
|
|
520
520
|
|
|
@@ -534,7 +534,7 @@ export const NARRATORS = {
|
|
|
534
534
|
? "the nightly writer revised my page"
|
|
535
535
|
: "I amended my page";
|
|
536
536
|
const because = why === null || why.length === 0 ? "" : `, ${why}`;
|
|
537
|
-
return calm(`${who}: ${num(bytes)} bytes${because}.`);
|
|
537
|
+
return calm(`${who}: ${num(bytes, 0)} bytes${because}.`);
|
|
538
538
|
},
|
|
539
539
|
"self.page.refused": (t) => {
|
|
540
540
|
const why = s(t, "reason") ?? "refused";
|
|
@@ -560,7 +560,7 @@ export const NARRATORS = {
|
|
|
560
560
|
case "started":
|
|
561
561
|
return calm(`A windowless session of me was started to revise my page from ${about}.`);
|
|
562
562
|
case "revised":
|
|
563
|
-
return calm(`My page was revised from ${about}${read}: ${num(n(t, "bytesBefore") ?? 0)} bytes became ${num(n(t, "bytesAfter") ?? 0)}.`);
|
|
563
|
+
return calm(`My page was revised from ${about}${read}: ${num(n(t, "bytesBefore") ?? 0, 0)} bytes became ${num(n(t, "bytesAfter") ?? 0, 0)}.`);
|
|
564
564
|
case "nothing-to-say":
|
|
565
565
|
return calm(`I read ${about}${read} and left my page as it stands — nothing about who I am moved that day.`);
|
|
566
566
|
case "refused":
|
|
@@ -582,7 +582,7 @@ export const NARRATORS = {
|
|
|
582
582
|
const created = t.p["created"] === true;
|
|
583
583
|
const days = n(t, "lifeDays") ?? 0;
|
|
584
584
|
return calm(
|
|
585
|
-
`I left a handoff for the next session in this directory: ${num(bytes)} bytes, ` +
|
|
585
|
+
`I left a handoff for the next session in this directory: ${num(bytes, 0)} bytes, ` +
|
|
586
586
|
`${created ? "the first one here" : "replacing the one that stood"}, showing for ${num(days)} days of use.`,
|
|
587
587
|
);
|
|
588
588
|
},
|
|
@@ -590,12 +590,12 @@ export const NARRATORS = {
|
|
|
590
590
|
const age = n(t, "ageDays");
|
|
591
591
|
const bytes = n(t, "bytes") ?? 0;
|
|
592
592
|
const when = age === null ? "" : age === 0 ? ", written today" : `, written ${num(age)} days of use ago`;
|
|
593
|
-
return calm(`I woke here and was handed the pointer to this directory's handoff${when} (${num(bytes)} bytes of the wake).`);
|
|
593
|
+
return calm(`I woke here and was handed the pointer to this directory's handoff${when} (${num(bytes, 0)} bytes of the wake).`);
|
|
594
594
|
},
|
|
595
595
|
"handoff.cleared": (t) => {
|
|
596
596
|
const bytes = n(t, "bytes") ?? 0;
|
|
597
597
|
return calm(
|
|
598
|
-
`I finished the work in this directory and retired its handoff (${num(bytes)} bytes). The next session here is handed nothing.`,
|
|
598
|
+
`I finished the work in this directory and retired its handoff (${num(bytes, 0)} bytes). The next session here is handed nothing.`,
|
|
599
599
|
);
|
|
600
600
|
},
|
|
601
601
|
"handoff.refused": (t) => {
|
|
@@ -603,7 +603,7 @@ export const NARRATORS = {
|
|
|
603
603
|
if (why === "no-room") {
|
|
604
604
|
const budget = n(t, "budget") ?? 0;
|
|
605
605
|
return calm(
|
|
606
|
-
`There was no room in this wake for the handoff pointer (the bundle would have been ${num(n(t, "bytes") ?? 0)} bytes against a ceiling of ${num(budget)}), so it was left off whole.`,
|
|
606
|
+
`There was no room in this wake for the handoff pointer (the bundle would have been ${num(n(t, "bytes") ?? 0, 0)} bytes against a ceiling of ${num(budget, 0)}), so it was left off whole.`,
|
|
607
607
|
);
|
|
608
608
|
}
|
|
609
609
|
return calm(`A handoff was turned away (${why}). Nothing was left for the next session here.`);
|