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.
Files changed (179) hide show
  1. package/CHANGELOG.md +49 -1
  2. package/docs/module-map.md +2 -0
  3. package/package.json +1 -1
  4. package/src/adapters/claude-code/NOTES.md +32 -0
  5. package/src/adapters/claude-code/bin/hook.ts +15 -2
  6. package/src/adapters/claude-code/bin/runner.ts +3 -1
  7. package/src/adapters/claude-code/config.ts +23 -0
  8. package/src/adapters/claude-code/doctor.ts +39 -20
  9. package/src/adapters/claude-code/hooks.ts +32 -12
  10. package/src/adapters/claude-code/index.ts +1 -0
  11. package/src/adapters/cli/commands.ts +178 -59
  12. package/src/adapters/cli/export.ts +27 -3
  13. package/src/adapters/cli/help.ts +22 -8
  14. package/src/adapters/cli/install.ts +3 -5
  15. package/src/adapters/cli/mechanisms.ts +295 -0
  16. package/src/adapters/cli/repair-dates.ts +3 -1
  17. package/src/adapters/dashboard/CONTRACT.md +13 -9
  18. package/src/adapters/dashboard/NOTES.md +3 -2
  19. package/src/adapters/dashboard/activity.ts +2 -1
  20. package/src/adapters/dashboard/bin/dashboard.ts +18 -3
  21. package/src/adapters/dashboard/upgrade.ts +23 -0
  22. package/src/adapters/dashboard/web/README.md +153 -0
  23. package/src/adapters/dashboard/web/actions.ts +631 -0
  24. package/src/adapters/dashboard/web/app.html +40 -1703
  25. package/src/adapters/dashboard/web/app.js +55 -0
  26. package/src/adapters/dashboard/web/mechanisms/association/index.js +15 -0
  27. package/src/adapters/dashboard/web/mechanisms/association/panel.js +17 -0
  28. package/src/adapters/dashboard/web/mechanisms/consolidation/index.js +15 -0
  29. package/src/adapters/dashboard/web/mechanisms/consolidation/panel.js +23 -0
  30. package/src/adapters/dashboard/web/mechanisms/decay/index.js +15 -0
  31. package/src/adapters/dashboard/web/mechanisms/decay/panel.js +45 -0
  32. package/src/adapters/dashboard/web/mechanisms/emotional/index.js +15 -0
  33. package/src/adapters/dashboard/web/mechanisms/episodic-semantic/index.js +15 -0
  34. package/src/adapters/dashboard/web/mechanisms/index.js +60 -0
  35. package/src/adapters/dashboard/web/mechanisms/interference/index.js +15 -0
  36. package/src/adapters/dashboard/web/mechanisms/picture.js +28 -0
  37. package/src/adapters/dashboard/web/mechanisms/prospective/index.js +15 -0
  38. package/src/adapters/dashboard/web/mechanisms/reconsolidation/index.js +15 -0
  39. package/src/adapters/dashboard/web/mechanisms/reconsolidation/panel.js +15 -0
  40. package/src/adapters/dashboard/web/mechanisms/regions.js +30 -0
  41. package/src/adapters/dashboard/web/mechanisms/retrieval/index.js +15 -0
  42. package/src/adapters/dashboard/web/mechanisms/retrieval/panel.js +20 -0
  43. package/src/adapters/dashboard/web/mechanisms/salience/index.js +15 -0
  44. package/src/adapters/dashboard/web/mechanisms/salience/panel.js +14 -0
  45. package/src/adapters/dashboard/web/mechanisms/schema/index.js +15 -0
  46. package/src/adapters/dashboard/web/narrate.ts +10 -10
  47. package/src/adapters/dashboard/web/pages/flow/flow.css +38 -0
  48. package/src/adapters/dashboard/web/pages/flow/index.js +117 -0
  49. package/src/adapters/dashboard/web/pages/flow/sections/blind.js +12 -0
  50. package/src/adapters/dashboard/web/pages/flow/sections/detail.js +45 -0
  51. package/src/adapters/dashboard/web/pages/flow/sections/diagram.js +291 -0
  52. package/src/adapters/dashboard/web/pages/flow/sections/feed.js +11 -0
  53. package/src/adapters/dashboard/web/pages/flow/sections/fired.js +41 -0
  54. package/src/adapters/dashboard/web/pages/flow/sections/heatmap.js +25 -0
  55. package/src/adapters/dashboard/web/pages/flow/sections/records.js +24 -0
  56. package/src/adapters/dashboard/web/pages/flow/sections/symmetry.js +17 -0
  57. package/src/adapters/dashboard/web/pages/flow/state.js +3 -0
  58. package/src/adapters/dashboard/web/pages/health/health.css +93 -0
  59. package/src/adapters/dashboard/web/pages/health/index.js +41 -0
  60. package/src/adapters/dashboard/web/pages/health/sections/archive.js +84 -0
  61. package/src/adapters/dashboard/web/pages/health/sections/checks.js +172 -0
  62. package/src/adapters/dashboard/web/pages/health/sections/cycle.js +37 -0
  63. package/src/adapters/dashboard/web/pages/health/sections/verify.js +54 -0
  64. package/src/adapters/dashboard/web/pages/home/brain.js +375 -0
  65. package/src/adapters/dashboard/web/pages/home/home.css +134 -0
  66. package/src/adapters/dashboard/web/pages/home/index.js +84 -0
  67. package/src/adapters/dashboard/web/pages/home/sections/explorer.js +206 -0
  68. package/src/adapters/dashboard/web/pages/home/sections/hero.js +22 -0
  69. package/src/adapters/dashboard/web/pages/home/sections/live-activity.js +25 -0
  70. package/src/adapters/dashboard/web/pages/home/sections/recent-chapters.js +13 -0
  71. package/src/adapters/dashboard/web/pages/home/sections/tiles.js +52 -0
  72. package/src/adapters/dashboard/web/pages/memories/index.js +75 -0
  73. package/src/adapters/dashboard/web/pages/memories/memories.css +143 -0
  74. package/src/adapters/dashboard/web/pages/memories/sections/constellation.js +178 -0
  75. package/src/adapters/dashboard/web/pages/memories/sections/kinds.js +42 -0
  76. package/src/adapters/dashboard/web/pages/memories/sections/list.js +114 -0
  77. package/src/adapters/dashboard/web/pages/memories/sections/search.js +102 -0
  78. package/src/adapters/dashboard/web/pages/memories/sections/tools.js +155 -0
  79. package/src/adapters/dashboard/web/pages/memories/state.js +22 -0
  80. package/src/adapters/dashboard/web/pages/self/diff.js +79 -0
  81. package/src/adapters/dashboard/web/pages/self/index.js +43 -0
  82. package/src/adapters/dashboard/web/pages/self/markdown.js +61 -0
  83. package/src/adapters/dashboard/web/pages/self/sections/journal.js +32 -0
  84. package/src/adapters/dashboard/web/pages/self/sections/page.js +149 -0
  85. package/src/adapters/dashboard/web/pages/self/sections/settling.js +150 -0
  86. package/src/adapters/dashboard/web/pages/self/sections/stories.js +47 -0
  87. package/src/adapters/dashboard/web/pages/self/sections/wake.js +74 -0
  88. package/src/adapters/dashboard/web/pages/self/self.css +182 -0
  89. package/src/adapters/dashboard/web/server.ts +305 -28
  90. package/src/adapters/dashboard/web/shared/absence.js +14 -0
  91. package/src/adapters/dashboard/web/shared/actions.js +48 -0
  92. package/src/adapters/dashboard/web/shared/api.js +17 -0
  93. package/src/adapters/dashboard/web/shared/base.css +34 -0
  94. package/src/adapters/dashboard/web/shared/canvas.js +68 -0
  95. package/src/adapters/dashboard/web/shared/colors.js +6 -0
  96. package/src/adapters/dashboard/web/shared/dom.js +4 -0
  97. package/src/adapters/dashboard/web/shared/event-modal.js +25 -0
  98. package/src/adapters/dashboard/web/shared/fonts/OFL-courier-prime.txt +93 -0
  99. package/src/adapters/dashboard/web/shared/fonts/OFL-outfit.txt +93 -0
  100. package/src/adapters/dashboard/web/shared/fonts/courier-prime-latin-400.woff2 +0 -0
  101. package/src/adapters/dashboard/web/shared/fonts/courier-prime-latin-700.woff2 +0 -0
  102. package/src/adapters/dashboard/web/shared/fonts/outfit-latin-wght.woff2 +0 -0
  103. package/src/adapters/dashboard/web/shared/format.js +31 -0
  104. package/src/adapters/dashboard/web/shared/layout.css +32 -0
  105. package/src/adapters/dashboard/web/shared/memory-modal.js +124 -0
  106. package/src/adapters/dashboard/web/shared/modal.css +24 -0
  107. package/src/adapters/dashboard/web/shared/modal.js +22 -0
  108. package/src/adapters/dashboard/web/shared/state.js +12 -0
  109. package/src/adapters/dashboard/web/shared/tip.css +4 -0
  110. package/src/adapters/dashboard/web/shared/tip.js +12 -0
  111. package/src/adapters/dashboard/web/shared/tokens.css +50 -0
  112. package/src/adapters/dashboard/web/shared/type.css +52 -0
  113. package/src/adapters/dashboard/web/shared/utilities.css +5 -0
  114. package/src/adapters/dashboard/web/shared/vendor/MIT-three.txt +21 -0
  115. package/src/adapters/dashboard/web/shared/vendor/three.module.min.js +6 -0
  116. package/src/adapters/dashboard/web/shared/widgets/bar.css +9 -0
  117. package/src/adapters/dashboard/web/shared/widgets/card.css +6 -0
  118. package/src/adapters/dashboard/web/shared/widgets/chapters.js +15 -0
  119. package/src/adapters/dashboard/web/shared/widgets/chart.css +4 -0
  120. package/src/adapters/dashboard/web/shared/widgets/confirm.css +31 -0
  121. package/src/adapters/dashboard/web/shared/widgets/confirm.js +52 -0
  122. package/src/adapters/dashboard/web/shared/widgets/feed.css +13 -0
  123. package/src/adapters/dashboard/web/shared/widgets/feed.js +41 -0
  124. package/src/adapters/dashboard/web/shared/widgets/light.css +4 -0
  125. package/src/adapters/dashboard/web/shared/widgets/light.js +15 -0
  126. package/src/adapters/dashboard/web/shared/widgets/rows.css +7 -0
  127. package/src/adapters/dashboard/web/shared/widgets/table.css +17 -0
  128. package/src/adapters/dashboard/web/shared/widgets/tiles.css +14 -0
  129. package/src/adapters/dashboard/web/shell/pages.js +15 -0
  130. package/src/adapters/dashboard/web/shell/pulse.js +86 -0
  131. package/src/adapters/dashboard/web/shell/tabs.js +49 -0
  132. package/src/adapters/dashboard/web/static.ts +76 -0
  133. package/src/adapters/dashboard/web/views/activity.ts +80 -0
  134. package/src/adapters/dashboard/web/views/archive-words.ts +57 -0
  135. package/src/adapters/dashboard/web/views/flow-view.ts +217 -0
  136. package/src/adapters/dashboard/web/views/health.ts +328 -0
  137. package/src/adapters/dashboard/web/views/mechanism-panel.ts +370 -0
  138. package/src/adapters/dashboard/web/views/mechanisms.ts +302 -0
  139. package/src/adapters/dashboard/web/views/memories.ts +342 -0
  140. package/src/adapters/dashboard/web/views/memory.ts +210 -0
  141. package/src/adapters/dashboard/web/views/meta.ts +64 -0
  142. package/src/adapters/dashboard/web/views/mind.ts +729 -0
  143. package/src/adapters/dashboard/web/views/overview.ts +282 -0
  144. package/src/adapters/dashboard/web/views/pulse.ts +19 -0
  145. package/src/adapters/dashboard/web/views/rows.ts +207 -0
  146. package/src/adapters/dashboard/web/views/search.ts +62 -0
  147. package/src/adapters/dashboard/web/views/shared.ts +161 -0
  148. package/src/adapters/dashboard/web/views.ts +34 -1724
  149. package/src/adapters/fired.ts +28 -17
  150. package/src/adapters/mcp/NOTES.md +43 -0
  151. package/src/adapters/mcp/bin/serve.ts +5 -1
  152. package/src/adapters/mcp/index.ts +3 -0
  153. package/src/adapters/mcp/server.ts +163 -6
  154. package/src/adapters/mcp/tools.ts +42 -0
  155. package/src/adapters/mcp/write-up.ts +1 -1
  156. package/src/core/counterpart.ts +30 -1
  157. package/src/core/feelings-wheel.ts +218 -0
  158. package/src/core/mint.ts +14 -2
  159. package/src/core/prospective/INTERFACE-GAPS.md +10 -0
  160. package/src/core/prospective/windows.ts +10 -48
  161. package/src/core/self/NOTES.md +17 -0
  162. package/src/core/self/calendar.ts +7 -78
  163. package/src/core/self/episodes.ts +7 -8
  164. package/src/core/self/index.ts +32 -11
  165. package/src/core/self/writer.ts +22 -22
  166. package/src/core/sleep/cycle.ts +8 -2
  167. package/src/core/store/CONTRACT.md +26 -7
  168. package/src/core/store/NOTES.md +142 -0
  169. package/src/core/store/errors.ts +15 -0
  170. package/src/core/store/feelings.ts +182 -0
  171. package/src/core/store/index.ts +297 -45
  172. package/src/core/store/operational.ts +133 -11
  173. package/src/core/store/owner-op-seam.ts +13 -3
  174. package/src/core/store/pre-migration.ts +3 -1
  175. package/src/core/store/prose.ts +8 -1
  176. package/src/core/store/render.ts +3 -0
  177. package/src/core/time.ts +374 -0
  178. package/src/core/types.ts +13 -0
  179. package/src/adapters/dashboard/web/brain.html +0 -463
@@ -0,0 +1,153 @@
1
+ # `web/` — where the dashboard's pieces live
2
+
3
+ A working map, not a rulebook. Split out of one 1,731-line `app.html` on
4
+ 2026-09-25 with no visible change; move things when a better shape shows up.
5
+
6
+ The page is plain browser ES modules and stylesheets — no bundler, no build
7
+ step, no dependencies. `server.ts` serves them as files (see "Serving" below).
8
+
9
+ ## Server side (TypeScript, runs in bun)
10
+
11
+ | file | what it is |
12
+ |---|---|
13
+ | `server.ts` | `node:http` on 127.0.0.1, the Host allowlist, `router()` (GET: `/`, `/brain` (now a redirect to `/#home`), the favicon, `/api/*`, the static files), and the POST hand-off to `actions.ts`. A store waiting for its one-time upgrade (v6 met by v7, `../upgrade.ts`) gets one calm page instead, and is tried again on every request |
14
+ | `actions.ts` | managing: `POST /api/action/<name>` — the same-origin + per-launch-token guard, argument validation, and the console's own `run()` (loaded lazily; never handed the observer source). `ACTIONS` lists them: `ask`, `note`, `remove`, `backup`, `export`, `scope`, `rebrief`, `verify`, and `doctor` (a read: the health tab's checklist, `doctor --json`) |
15
+ | `static.ts` | `resolveStatic()`: which URL paths are static files and where they live (pure; no fs) |
16
+ | `views.ts` | the index of `views/`: re-exports every view, so callers import from here |
17
+ | `views/<name>.ts` | one module per `/api` view: `meta`, `overview` (the home tab's), `memories` (`/api/memories` + `/api/memories/list`), `memory`, `search`, `mind` (the self tab's), `activity`, `flow-view` (`/api/flow` + `/api/node`), `health`, `pulse`, `mechanisms`, `mechanism-panel` (`/api/mechanism?id=`) |
18
+ | `views/archive-words.ts` | why a memory was archived, in plain words: one table (`ARCHIVE_WORDS`, a group phrase and a single-row phrase per reason) and one fallback for a reason nobody mapped; health's bar, the memories list and home's archived count read it |
19
+ | `views/mechanisms.ts` | `/api/mechanisms`: each mechanism's light (grey = not built, green = fired in the last 7 lived days, amber = built and quiet), one evidence line, the newest backing event `seq`s. `MECHANISM_PROOFS` is the one table saying which durable rows count as a mechanism firing |
20
+ | `views/shared.ts` | the census and small counters every view leans on |
21
+ | `views/rows.ts` | row shapes and builders more than one view uses (band bars, contested beliefs, chapters, lived days) |
22
+ | `flow.ts` | the diagram's static shape: nodes, edges, which event lights which node |
23
+ | `narrate.ts` | a durable event → one first-person sentence |
24
+ | `reveal.ts` | id → words at render time, withholding confidential rows |
25
+ | `fired.ts` | `/api/fired`, the what-fired panel |
26
+
27
+ ## Client side (browser modules)
28
+
29
+ ```
30
+ app.html the shell: header, one empty <section> per tab, #tip, #overlay,
31
+ the <link>s (their ORDER is the cascade order) and one <script type=module>
32
+ app.js entry: mounts every page, the nav, the modal; boot; resize; starts the pulse
33
+ shell/
34
+ pages.js the page registry (nav order) and the page-module interface
35
+ tabs.js nav strip + showTab
36
+ pulse.js the 4-second poll: new events → live feeds + page hooks; store moved → page.refresh()
37
+ shared/
38
+ tokens.css @font-face + colour/type variables (:root) — the site's look (counterparts.ai)
39
+ type.css which face goes where: Outfit (--sans) for anything read as words; Courier (--mono) only for big numbers, ids, record names; loaded LAST
40
+ vendor/ three.module.min.js (0.169.0, MIT) for the home brain
41
+ fonts/ Outfit (variable, latin) + Courier Prime 400/700 (latin) .woff2, with their OFL licences
42
+ base.css layout.css utilities.css reset, header/nav, headings, the .cols grids, .foot/.tone-*/#err
43
+ tip.css modal.css the tooltip and the overlay card
44
+ dom.js $ esc
45
+ format.js n2 n3 pct said livedSpan headline
46
+ colors.js COL BANDCOL ACCENT (canvas needs JS values)
47
+ absence.js emptyBox absenceLine — the "(none yet)" / "(never run)" block
48
+ api.js api() (looking: GET only) and fail()
49
+ actions.js act() (managing: the one POST, with the page's token) and resultHtml()
50
+ canvas.js FACE (the canvas's face, Outfit) fit hitTest roundRect clip wrapText
51
+ tip.js modal.js showTip/hideTip; openModal/closeModal/section
52
+ memory-modal.js openMemory, copyId, removeMemory (window globals: rows use inline onclick)
53
+ event-modal.js openEvent (window global)
54
+ state.js tabs {current, loaded}; live {lastSeq, fingerprint}
55
+ widgets/ card rows table chart tiles bar feed light .css;
56
+ feed.js (renderFeed, live-feed registry), chapters.js (chapterRows),
57
+ confirm.js + .css (confirmTyped: type a phrase back to confirm),
58
+ light.js (the status dot: green / amber / grey)
59
+ pages/<tab>/ tabs: home (was overview), memories, self (was mind), flow, health;
60
+ #overview and #mind still land (shell/tabs.js RENAMED)
61
+ index.js default export { name, mount(section), render(), refresh?, show?,
62
+ resize?, redraw?, onEvents?, onDeposit? }; composes its sections' markup
63
+ sections/*.js one panel each: `export const markup` (its <h2> + container) and
64
+ `paint(d)` (or `render()` when it fetches for itself)
65
+ <tab>.css styles only this page uses (home, memories, self, flow, health)
66
+ mechanisms/
67
+ index.js MECHANISMS (the site's eleven, in its order) and FAMILIES (its four, with colours)
68
+ <id>/index.js default export { id, family, name, short, tagline, inDev, explainer };
69
+ the light comes from /api/mechanisms
70
+ <id>/panel.js picture(payload): the Explorer panel's picture, where one is drawn
71
+ picture.js the pictures' shared pieces
72
+ regions.js brain regions → mechanisms, as the site maps them
73
+ ```
74
+
75
+ Moving a section between pages: import its module in the other page's
76
+ `index.js`, put `${section.markup}` where it should sit, call its `paint` from
77
+ that page's `render` with the right payload (the data comes from that page's
78
+ `/api` view — a section may need its view to grow a field). Its CSS may live in
79
+ a page stylesheet; move that too.
80
+
81
+ A hash can carry more than the tab: `#self/settling` (an anchor) or
82
+ `#memories?state=archived` (a query). `shell/tabs.js#parseRoute` splits it, and
83
+ the page's optional `route({ anchor, params })` is called once the page is
84
+ drawn. The home hero's four counts are links of this kind.
85
+
86
+ The home page is the site's hero plus Explorer. `pages/home/brain.js` is the
87
+ three.js brain, imported statically from `shared/vendor/three.module.min.js`
88
+ (0.169.0, MIT, `MIT-three.txt` beside it; never a CDN). It sets
89
+ `#home-brain[data-ready]` once it is drawing or has fallen back to a sentence.
90
+ `mechanisms/regions.js` maps brain regions to mechanisms, as the site does.
91
+ `sections/explorer.js` owns the pills and the inline panel. The panel's picture
92
+ comes from `mechanisms/<id>/panel.js` (export `picture(payload)`, pure markup),
93
+ gathered in `PANELS` in `mechanisms/index.js` beside `guideUrl(id)`. Its data
94
+ comes from `/api/mechanism?id=` (`views/mechanism-panel.ts`: last firings
95
+ narrated, plus a `picture`, both read-only). `mechanisms/picture.js` holds the
96
+ pictures' shared pieces. A mechanism built later gets a `panel.js`, one line in
97
+ `PANELS`, and a case in `mechanism-panel.ts`.
98
+
99
+ `pages/memories/` — the memories tab. `state.js` holds the page's filters
100
+ (live/archived/all, kind, band, page offset) and notifies the list when they
101
+ change; `counterparts:changed` (a window event, fired after a note and after a
102
+ removal on the memory card) makes the page re-read at once. Sections:
103
+ `search.js` (search by words, plus Ask via `act("ask", {json:true})` rendered
104
+ as a list), `tools.js` (write a note, and the back-up/export folder dialog),
105
+ `constellation.js` (the one picture: the scatter, band chips that filter,
106
+ strength-by-band in the right margin), `kinds.js` (six kinds in words; click to
107
+ filter), `list.js` (every memory, newest first, paged on the server by
108
+ `/api/memories/list` in `views/memories.ts`, whose archive reasons are put into
109
+ plain words by `archiveWords` from `views/archive-words.ts`).
110
+
111
+ `pages/self/`: the self tab. `sections/page.js` is the self page (rendered by
112
+ `markdown.js`, which escapes first) and its history as a timeline; clicking a
113
+ dot diffs that version against the one before with `diff.js` (line comparison,
114
+ then words, no deps). `sections/settling.js` covers the core, protected and
115
+ contested memories, plus the closest candidates for the core; the view computes
116
+ them with `physics#promotionEligibility` and counts memories that can't get
117
+ there by use separately. `sections/wake.js` is the wake folded to one line and
118
+ a stacked bar of its parts (`wakeParts` in `views/mind.ts`, cut at the lane
119
+ headings from `self/`), plus the rebrief button. `sections/journal.js` shows
120
+ chapters by day with their model. `sections/stories.js` is only `storyCard`,
121
+ opened in the overlay. The view is still `views/mind.ts` / `/api/mind`.
122
+
123
+ The health tab answers "is it working?": `pages/health/sections/checks.js` runs
124
+ `counterparts doctor --json` through the actions seam (a read; a dashboard
125
+ opened on a bare `--dir` arms the explicit-dir guard for that run, so the
126
+ settings line reads "not checked") and draws its findings as a checklist,
127
+ folding the non-headline greens the way `cli/report.ts` does; `cycle.js` is the
128
+ last sleep cycle as one line with a dot per phase; `archive.js` is one stacked
129
+ bar of `archived_reason` (plain phrases in the shared archive-words module,
130
+ unknown reasons get their own segment); `verify.js` is "Check the index"
131
+ (`verify` through the seam). The developer panels (band symmetry, what fired,
132
+ every durable record, the day × event grid, what I cannot see) live under the
133
+ flow diagram as "Under the hood"
134
+ (`pages/flow/sections/{symmetry,fired,records,heatmap,blind}.js`), still fed by
135
+ `/api/health` and `/api/fired`. On a bare `--dir` dashboard every action runs
136
+ with the explicit-dir guard, COUNTERPARTS_CONFIG removed, and home pointed at a
137
+ nonexistent dir (doctor keeps the real home for its ~/.claude check), so no
138
+ action can reach a default config.
139
+
140
+ Harness hooks `tools/visual-loop` relies on: `window.tileValue`,
141
+ `window.flowState`, `window.particleCount`, `document.documentElement.dataset.loaded`,
142
+ `#home-brain[data-ready]`, and the element ids it clicks (`#mlist .mrow`, `#flowcv`, `#overlay`, …).
143
+
144
+ ## Serving
145
+
146
+ `resolveStatic` serves only `/app.js` and files under `/shared/`, `/shell/`,
147
+ `/pages/`, `/mechanisms/`, with extension `.js`, `.css` or `.woff2`; every path
148
+ segment must be plain (no `..`, dotfiles, `%`-escapes left after one decode,
149
+ backslashes, NUL). A new top-level folder or extension means editing
150
+ `static.ts` (and its test). Everything is `cache-control: no-store`, so an edit
151
+ shows on reload. `test/dashboard-web.test.ts` checks that every file the shell
152
+ reaches exists and is served, and that no `.js`/`.css` under `web/` is orphaned.
153
+ `test/dashboard.test.ts`'s source scan covers the `.js` files too.