Public: anyone can read this; the crew can change it.

docs/TECHNICAL.md names every module in src/, and a test fails when a new one is left out #268

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

mason/deal-clock:mason/266-docs-technical-md-names-every-module-in → main 1 commit fork

  • Merged. mason/266-docs-technical-md-names-every-module-in was merged into main as 70811bf.

Review

Sign in to review this change.
2 files changed +18 −1
docs/TECHNICAL.md +8
@@ -265,6 +265,14 @@ decide nothing themselves. `AGENTS.md` says how to add to it.
265265 | `src/server.ts` | boot: open the database, serve |
266266 | `src/tty.ts`, `src/terminal.ts` | the terminal: the pty, and the keys and screen over the same actions |
267267 | `src/env.ts` | what the forge told this process |
268 | `src/coming.ts` | the reminders a deal has yet to draft: a deal, a day and the agent in, up to 10 listed and a count of the rest out, read from `drafts` so it never disagrees; called by the deal page and the terminal |
269 | `src/find.ts` | finding a deal: `query` validates what was typed (100 characters, no control characters), `find` filters deals by address and party details; called by the clock, routes, MCP and the terminal |
270 | `src/guidance.ts` | the one plain line telling a client what to do for an open date: kind and side in, a string out; called by the client timeline and its page |
271 | `src/memo.ts` | work done once per deal content: `print` keys a deal by its rows, `memoizer(limit)` is a bounded cache; called by `src/http.ts`, `src/reminders.ts` and the clock and sheet pages |
272 | `src/money.ts` | the sale price and earnest amount in whole dollars: `amount` validates input, `dollars` formats it one way; called by deals, book, reminders, MCP, routes and the pages |
273 | `src/profile.ts` | the agent's saved details (one `profile` row, the environment as defaults): `agentOf`, `zoneOf`, `getProfile`, `setProfile`, `useDefaults`, with `permit` on the writes; called by deals, MCP, routes, sample, the terminal and the Profile page |
274 | `src/progress.ts` | how far along a deal is: a deal and a day in, dates done of total, overdue count and days to closing out; called by routes and the clock, deal and progress pages |
275 | `src/settled.ts` | what the agent settled today, counted from the records: a database, zone and day in, sent, declined and held counts out; called by routes and the review page |
268276 | `static/app.css`, `static/live.js`, `static/sheets.js` | the look in the tokens' words, the clock that stays current, and a date's sheet fetched when tapped |
269277
270278 ## What every app stands on
src/readme.test.ts +10 −1
@@ -1,5 +1,5 @@
11 import { expect, test } from "bun:test";
2 import { readFileSync } from "node:fs";
2 import { readdirSync, readFileSync } from "node:fs";
33
44 // GitHub-style heading slug: lowercase, punctuation dropped, spaces to hyphens.
55 function slug(heading: string): string {
@@ -53,3 +53,12 @@ test("a broken anchor is reported, a good one and repeated headings are not", ()
5353 "[a](#make-it-yours) [b](#same-1) [c](#nowhere) [d](#top) [e](#%zz) [f](#see-the-docs-now)\n";
5454 expect(brokenAnchors(doc)).toEqual(["nowhere", "%zz"]);
5555 });
56
57 test("every module directly in src/ is named in docs/TECHNICAL.md or AGENTS.md", () => {
58 const docs = readFileSync("docs/TECHNICAL.md", "utf8") + readFileSync("AGENTS.md", "utf8");
59 const modules = readdirSync("src", { withFileTypes: true })
60 .filter((e) => e.isFile() && /\.ts$/.test(e.name) && !/\.test\.ts$/.test(e.name))
61 .map((e) => e.name);
62 const missing = modules.filter((name) => !docs.includes(`src/${name}`));
63 expect(missing).toEqual([]);
64 });

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs