variant round: roll retired, chance is variant literature (strict parse, crypto pick on reception, picked-only rendering, /story variance metric); entity round: /story the whole deliverable, /table the play projection, the slidwin carry (smart contwin cutoff, whole exchanges, housekeeper reads session-minus-tail); dormant-session rework: universal session lifecycle (dormant->live->finished, sessions/<n> storage), move-at-stop, start lint + auto-send rule, rebaseable housekeeping, turn-0 -> carryover.jsonl, seed -> memory.json, draft-only save-package; format house rules enforced by the nine-rule check-repo (ascii bytes, no text-mutating css); smoke 105/105 + restart + reminder + browser pass green, irene hand-migrated to the new layout
2026-11-15 14:35:00 +00:00
|
|
|
// test/check-repo.mjs -- the repo's rules, enforced. Static scan of
|
|
|
|
|
// git-tracked files; no server needed:
|
|
|
|
|
// node test/check-repo.mjs
|
|
|
|
|
//
|
2026-11-19 09:56:56 +00:00
|
|
|
// 1. ASCII bytes everywhere (developer, 2026-11-15). No unicode in any
|
2026-11-19 10:31:03 +00:00
|
|
|
// tracked file; gitignored state (runs/, state/) is
|
variant round: roll retired, chance is variant literature (strict parse, crypto pick on reception, picked-only rendering, /story variance metric); entity round: /story the whole deliverable, /table the play projection, the slidwin carry (smart contwin cutoff, whole exchanges, housekeeper reads session-minus-tail); dormant-session rework: universal session lifecycle (dormant->live->finished, sessions/<n> storage), move-at-stop, start lint + auto-send rule, rebaseable housekeeping, turn-0 -> carryover.jsonl, seed -> memory.json, draft-only save-package; format house rules enforced by the nine-rule check-repo (ascii bytes, no text-mutating css); smoke 105/105 + restart + reminder + browser pass green, irene hand-migrated to the new layout
2026-11-15 14:35:00 +00:00
|
|
|
// per-deployment and exempt. The ENCODING is the problem, never
|
|
|
|
|
// the visual: rendered glyphs travel ASCII-safe (\u escapes in
|
|
|
|
|
// JS, entities in HTML), never verbatim bytes.
|
2026-11-19 09:56:56 +00:00
|
|
|
// 2. No text-mutating CSS (developer, 2026-11-15). Rendered text must
|
variant round: roll retired, chance is variant literature (strict parse, crypto pick on reception, picked-only rendering, /story variance metric); entity round: /story the whole deliverable, /table the play projection, the slidwin carry (smart contwin cutoff, whole exchanges, housekeeper reads session-minus-tail); dormant-session rework: universal session lifecycle (dormant->live->finished, sessions/<n> storage), move-at-stop, start lint + auto-send rule, rebaseable housekeeping, turn-0 -> carryover.jsonl, seed -> memory.json, draft-only save-package; format house rules enforced by the nine-rule check-repo (ascii bytes, no text-mutating css); smoke 105/105 + restart + reminder + browser pass green, irene hand-migrated to the new layout
2026-11-15 14:35:00 +00:00
|
|
|
// match authored text: no text-transform (any value, inline
|
|
|
|
|
// styles included), no generated content (content:, ::before and
|
|
|
|
|
// ::after included), no caps font variants. Authored content is
|
|
|
|
|
// fine -- want caps on screen, write caps in the source.
|
2026-11-19 09:56:56 +00:00
|
|
|
// 3. No HTML comments in prose or prompt files (developer, 2026-11-14):
|
variant round: roll retired, chance is variant literature (strict parse, crypto pick on reception, picked-only rendering, /story variance metric); entity round: /story the whole deliverable, /table the play projection, the slidwin carry (smart contwin cutoff, whole exchanges, housekeeper reads session-minus-tail); dormant-session rework: universal session lifecycle (dormant->live->finished, sessions/<n> storage), move-at-stop, start lint + auto-send rule, rebaseable housekeeping, turn-0 -> carryover.jsonl, seed -> memory.json, draft-only save-package; format house rules enforced by the nine-rule check-repo (ascii bytes, no text-mutating css); smoke 105/105 + restart + reminder + browser pass green, irene hand-migrated to the new layout
2026-11-15 14:35:00 +00:00
|
|
|
// purpose descriptions live in README, AGENTS, or code comments.
|
2026-11-19 09:56:56 +00:00
|
|
|
// gm.md files are exempt -- the run's GM's private file, authored
|
|
|
|
|
// content: flagged to the developer, never assistant-edited.
|
variant round: roll retired, chance is variant literature (strict parse, crypto pick on reception, picked-only rendering, /story variance metric); entity round: /story the whole deliverable, /table the play projection, the slidwin carry (smart contwin cutoff, whole exchanges, housekeeper reads session-minus-tail); dormant-session rework: universal session lifecycle (dormant->live->finished, sessions/<n> storage), move-at-stop, start lint + auto-send rule, rebaseable housekeeping, turn-0 -> carryover.jsonl, seed -> memory.json, draft-only save-package; format house rules enforced by the nine-rule check-repo (ascii bytes, no text-mutating css); smoke 105/105 + restart + reminder + browser pass green, irene hand-migrated to the new layout
2026-11-15 14:35:00 +00:00
|
|
|
// 4. Retired terms stay retired (DICTIONARY rules the terms). The
|
2026-11-19 09:56:56 +00:00
|
|
|
// rule is about the substrate (developer, 2026-11-19): README and the
|
2026-11-19 08:35:23 +00:00
|
|
|
// root prompts never say the wrap, prelude, paper (the old
|
|
|
|
|
// status), window (the old session; a line naming contwin may
|
|
|
|
|
// gloss it as the context window), turn-0, seed (memory.json is
|
2026-11-19 09:56:56 +00:00
|
|
|
// the name), agent and LLM (every inferencer seat is named in the roles
|
|
|
|
|
// inventory; the filename AGENTS.md is consumed as-is, like
|
|
|
|
|
// "Windows" the OS). A banned word in a package's prose is fine -- the
|
2026-11-19 08:35:23 +00:00
|
|
|
// packages are the fiction, and their words are the story's.
|
|
|
|
|
// Historical records keep the vocabulary of their day; gm.md is
|
2026-11-19 09:56:56 +00:00
|
|
|
// the run's GM's private file, flagged never fixed.
|
|
|
|
|
// 5. Zero-dependency runtime (developer, 2026-11-13, amended 2026-11-15):
|
jsdoc typing round, phases 1-2: tsc as a no-emit checker over plain mjs (checkJs, strict), the shared shapes in server/shapes.mjs (log events as a tagged union, wire messages, manifests, job state, the ctx), all 12 server modules annotated; requireOwner/requireSuperuser as JSDoc assertion functions so the router guarantee narrows without callsite churn; runtime stays zero-dependency (typescript + @types/node as pinned devDeps, node_modules gitignored, QUESTIONS #4 amended: dev tooling exempt); every non-annotation delta audited onto a small intended list (clerk status ?? 1, dead 401 guards, async wraps on enqueue callsites); smoke 105/105 + restart + repo checks green; the clerk and web/ are the next phases
2026-11-15 15:28:56 +00:00
|
|
|
// every import is node: builtin or relative -- no runtime deps,
|
|
|
|
|
// no package-manager requirement to run. Dev tooling is exempt
|
|
|
|
|
// (typescript rides devDependencies; nothing imports it).
|
2026-11-19 09:56:56 +00:00
|
|
|
// 6. UTC discipline (developer, 2026-11-14): no locale- or timezone-
|
variant round: roll retired, chance is variant literature (strict parse, crypto pick on reception, picked-only rendering, /story variance metric); entity round: /story the whole deliverable, /table the play projection, the slidwin carry (smart contwin cutoff, whole exchanges, housekeeper reads session-minus-tail); dormant-session rework: universal session lifecycle (dormant->live->finished, sessions/<n> storage), move-at-stop, start lint + auto-send rule, rebaseable housekeeping, turn-0 -> carryover.jsonl, seed -> memory.json, draft-only save-package; format house rules enforced by the nine-rule check-repo (ascii bytes, no text-mutating css); smoke 105/105 + restart + reminder + browser pass green, irene hand-migrated to the new layout
2026-11-15 14:35:00 +00:00
|
|
|
// dependent date formatting in code. No time zones, ever.
|
|
|
|
|
// 7. web/ static files never start with "api" -- the server's route
|
|
|
|
|
// guard matches the /api prefix, so web/api.mjs 404s as a bogus
|
|
|
|
|
// API route (bit once, 2026-11-14).
|
2026-11-19 09:56:56 +00:00
|
|
|
// 8. The bundle boundary (developer, 2026-11-14): server/bundle.mjs names
|
|
|
|
|
// neither gm.md (never model-facing) nor housekeeper.md (the
|
|
|
|
|
// internal inferencers' prompts never enter the bundle).
|
|
|
|
|
// 9. Seeds carry no date keys (developer, 2026-11-14): no model-facing
|
variant round: roll retired, chance is variant literature (strict parse, crypto pick on reception, picked-only rendering, /story variance metric); entity round: /story the whole deliverable, /table the play projection, the slidwin carry (smart contwin cutoff, whole exchanges, housekeeper reads session-minus-tail); dormant-session rework: universal session lifecycle (dormant->live->finished, sessions/<n> storage), move-at-stop, start lint + auto-send rule, rebaseable housekeeping, turn-0 -> carryover.jsonl, seed -> memory.json, draft-only save-package; format house rules enforced by the nine-rule check-repo (ascii bytes, no text-mutating css); smoke 105/105 + restart + reminder + browser pass green, irene hand-migrated to the new layout
2026-11-15 14:35:00 +00:00
|
|
|
// surface renders a date; story time lives in prose.
|
2026-11-19 09:56:56 +00:00
|
|
|
// 10. No laptop-visible facts (developer, 2026-11-15): this machine's
|
the access round: spectator mode removed and reads made story-only -- the table, raw session, carryover, files, status, and the notepad are owner-only; the story is the one public read (any signed-in user, fork button on it that copies the run that made the story, never the view); #28's human-side open read overturned with the ruling, gm.md stays never model-facing; non-owners land in the story view (play/setup redirect on the 403, home cards link there directly), the story view names its owner and stands alone on the story response, which now carries display/owner/ownerName; the table gains a raw tab -- the whole log as it rode the wire (thinking, every variant block, every reminder copy, full tool results, rides inline) next to the curated projection, live sessions only, sticky across turn re-renders; --debug mode for easy testing: every request is a fixed superuser that bypasses the users db entirely, no invite dance, loopback-bound regardless of config (found live: the SPA boot only asked the server who it was when a token existed, so tokenless browsers never learned they were the debug user -- boot now always asks); lint rule 10: no laptop-visible facts anywhere and all commits always from Mute -- the username and home paths are derived at runtime so the checker never contains them, scanned over the tracked tree, every historical blob, and commit messages, identity enforced on author and committer on every ref plus git config; the queue split: resolved questions relocated to DECISIONS.md verbatim by number (day's words kept, reversals annotate never rewrite, the agenda/reminder trio gets its own section), QUESTIONS is open items only (stale OPENs resolved on the way: #10 by the 2026-11-13 pairing default, #11 by the raw tab); smoke reworked to the story-only battery -- ash 403s on every run surface, 200 on the story alone, the ownerless-run check rides the runs list; all twelve QUESTIONS-number citations re-pointed at DECISIONS; smoke ALL PASS in a worktree (111 checks), two-user browser pass (the non-owner's whole run surface is a 403 detail and a 200 story, back-to-table hidden, owner views intact), raw-tab browser pass (curated table leak-free, raw shows the whole variants block, tabs vanish on dormancy), typecheck green on both programs, check-repo clean
2026-11-15 22:37:06 +00:00
|
|
|
// username and home paths appear nowhere -- tracked tree,
|
|
|
|
|
// historical blobs, commit messages -- and every commit is
|
|
|
|
|
// always from Mute (author and committer, name and email, every
|
|
|
|
|
// ref, git config included). The facts are derived at runtime;
|
|
|
|
|
// writing them into the checker would leak them itself.
|
variant round: roll retired, chance is variant literature (strict parse, crypto pick on reception, picked-only rendering, /story variance metric); entity round: /story the whole deliverable, /table the play projection, the slidwin carry (smart contwin cutoff, whole exchanges, housekeeper reads session-minus-tail); dormant-session rework: universal session lifecycle (dormant->live->finished, sessions/<n> storage), move-at-stop, start lint + auto-send rule, rebaseable housekeeping, turn-0 -> carryover.jsonl, seed -> memory.json, draft-only save-package; format house rules enforced by the nine-rule check-repo (ascii bytes, no text-mutating css); smoke 105/105 + restart + reminder + browser pass green, irene hand-migrated to the new layout
2026-11-15 14:35:00 +00:00
|
|
|
|
|
|
|
|
import { execFileSync } from 'node:child_process';
|
|
|
|
|
import { readFileSync } from 'node:fs';
|
the access round: spectator mode removed and reads made story-only -- the table, raw session, carryover, files, status, and the notepad are owner-only; the story is the one public read (any signed-in user, fork button on it that copies the run that made the story, never the view); #28's human-side open read overturned with the ruling, gm.md stays never model-facing; non-owners land in the story view (play/setup redirect on the 403, home cards link there directly), the story view names its owner and stands alone on the story response, which now carries display/owner/ownerName; the table gains a raw tab -- the whole log as it rode the wire (thinking, every variant block, every reminder copy, full tool results, rides inline) next to the curated projection, live sessions only, sticky across turn re-renders; --debug mode for easy testing: every request is a fixed superuser that bypasses the users db entirely, no invite dance, loopback-bound regardless of config (found live: the SPA boot only asked the server who it was when a token existed, so tokenless browsers never learned they were the debug user -- boot now always asks); lint rule 10: no laptop-visible facts anywhere and all commits always from Mute -- the username and home paths are derived at runtime so the checker never contains them, scanned over the tracked tree, every historical blob, and commit messages, identity enforced on author and committer on every ref plus git config; the queue split: resolved questions relocated to DECISIONS.md verbatim by number (day's words kept, reversals annotate never rewrite, the agenda/reminder trio gets its own section), QUESTIONS is open items only (stale OPENs resolved on the way: #10 by the 2026-11-13 pairing default, #11 by the raw tab); smoke reworked to the story-only battery -- ash 403s on every run surface, 200 on the story alone, the ownerless-run check rides the runs list; all twelve QUESTIONS-number citations re-pointed at DECISIONS; smoke ALL PASS in a worktree (111 checks), two-user browser pass (the non-owner's whole run surface is a 403 detail and a 200 story, back-to-table hidden, owner views intact), raw-tab browser pass (curated table leak-free, raw shows the whole variants block, tabs vanish on dormancy), typecheck green on both programs, check-repo clean
2026-11-15 22:37:06 +00:00
|
|
|
import { homedir, userInfo } from 'node:os';
|
variant round: roll retired, chance is variant literature (strict parse, crypto pick on reception, picked-only rendering, /story variance metric); entity round: /story the whole deliverable, /table the play projection, the slidwin carry (smart contwin cutoff, whole exchanges, housekeeper reads session-minus-tail); dormant-session rework: universal session lifecycle (dormant->live->finished, sessions/<n> storage), move-at-stop, start lint + auto-send rule, rebaseable housekeeping, turn-0 -> carryover.jsonl, seed -> memory.json, draft-only save-package; format house rules enforced by the nine-rule check-repo (ascii bytes, no text-mutating css); smoke 105/105 + restart + reminder + browser pass green, irene hand-migrated to the new layout
2026-11-15 14:35:00 +00:00
|
|
|
|
|
|
|
|
let failures = 0;
|
|
|
|
|
const fail = (msg) => { console.log(`FAIL ${msg}`); failures++; };
|
|
|
|
|
|
|
|
|
|
const files = execFileSync('git', ['ls-files'], { encoding: 'utf8' }).split('\n').filter(Boolean);
|
|
|
|
|
const ROOT_PROMPTS = new Set(['system.md', 'invariants.md', 'handbook.md', 'housekeeper.md', 'reminder.md']);
|
2026-11-19 09:56:56 +00:00
|
|
|
// rule 4's scope: the substrate's prose only (developer, 2026-11-19) --
|
2026-11-19 08:35:23 +00:00
|
|
|
// README and the root prompts. The packages are the fiction; a
|
|
|
|
|
// banned word there is the story's own business
|
|
|
|
|
const substrateProse = (f) => f === 'README.md' || ROOT_PROMPTS.has(f);
|
variant round: roll retired, chance is variant literature (strict parse, crypto pick on reception, picked-only rendering, /story variance metric); entity round: /story the whole deliverable, /table the play projection, the slidwin carry (smart contwin cutoff, whole exchanges, housekeeper reads session-minus-tail); dormant-session rework: universal session lifecycle (dormant->live->finished, sessions/<n> storage), move-at-stop, start lint + auto-send rule, rebaseable housekeeping, turn-0 -> carryover.jsonl, seed -> memory.json, draft-only save-package; format house rules enforced by the nine-rule check-repo (ascii bytes, no text-mutating css); smoke 105/105 + restart + reminder + browser pass green, irene hand-migrated to the new layout
2026-11-15 14:35:00 +00:00
|
|
|
// the checker's own source names what it bans (the rule patterns and
|
|
|
|
|
// their comments); it is exempt from the rules it defines
|
|
|
|
|
const isSelf = (f) => f === 'test/check-repo.mjs';
|
|
|
|
|
|
the access round: spectator mode removed and reads made story-only -- the table, raw session, carryover, files, status, and the notepad are owner-only; the story is the one public read (any signed-in user, fork button on it that copies the run that made the story, never the view); #28's human-side open read overturned with the ruling, gm.md stays never model-facing; non-owners land in the story view (play/setup redirect on the 403, home cards link there directly), the story view names its owner and stands alone on the story response, which now carries display/owner/ownerName; the table gains a raw tab -- the whole log as it rode the wire (thinking, every variant block, every reminder copy, full tool results, rides inline) next to the curated projection, live sessions only, sticky across turn re-renders; --debug mode for easy testing: every request is a fixed superuser that bypasses the users db entirely, no invite dance, loopback-bound regardless of config (found live: the SPA boot only asked the server who it was when a token existed, so tokenless browsers never learned they were the debug user -- boot now always asks); lint rule 10: no laptop-visible facts anywhere and all commits always from Mute -- the username and home paths are derived at runtime so the checker never contains them, scanned over the tracked tree, every historical blob, and commit messages, identity enforced on author and committer on every ref plus git config; the queue split: resolved questions relocated to DECISIONS.md verbatim by number (day's words kept, reversals annotate never rewrite, the agenda/reminder trio gets its own section), QUESTIONS is open items only (stale OPENs resolved on the way: #10 by the 2026-11-13 pairing default, #11 by the raw tab); smoke reworked to the story-only battery -- ash 403s on every run surface, 200 on the story alone, the ownerless-run check rides the runs list; all twelve QUESTIONS-number citations re-pointed at DECISIONS; smoke ALL PASS in a worktree (111 checks), two-user browser pass (the non-owner's whole run surface is a 403 detail and a 200 story, back-to-table hidden, owner views intact), raw-tab browser pass (curated table leak-free, raw shows the whole variants block, tabs vanish on dormancy), typecheck green on both programs, check-repo clean
2026-11-15 22:37:06 +00:00
|
|
|
// rule 10's patterns, derived at runtime so this file never contains
|
|
|
|
|
// the facts it bans (a literal here would be the leak itself). The
|
|
|
|
|
// username is matched as a plain substring -- recall over precision;
|
|
|
|
|
// the home path rides along in both separator spellings.
|
|
|
|
|
const esc = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
|
|
|
const piiSrc = [
|
|
|
|
|
esc(userInfo().username),
|
|
|
|
|
homedir().split(/[\\/]+/).map(esc).join('[\\\\/]+'),
|
|
|
|
|
].join('|');
|
|
|
|
|
const piiRe = new RegExp(piiSrc, 'i');
|
|
|
|
|
// the pseudonymous identity every commit carries, no exceptions
|
|
|
|
|
const ID_NAME = 'Mute';
|
|
|
|
|
const ID_EMAIL = 'codename.mute@proton.me';
|
|
|
|
|
|
variant round: roll retired, chance is variant literature (strict parse, crypto pick on reception, picked-only rendering, /story variance metric); entity round: /story the whole deliverable, /table the play projection, the slidwin carry (smart contwin cutoff, whole exchanges, housekeeper reads session-minus-tail); dormant-session rework: universal session lifecycle (dormant->live->finished, sessions/<n> storage), move-at-stop, start lint + auto-send rule, rebaseable housekeeping, turn-0 -> carryover.jsonl, seed -> memory.json, draft-only save-package; format house rules enforced by the nine-rule check-repo (ascii bytes, no text-mutating css); smoke 105/105 + restart + reminder + browser pass green, irene hand-migrated to the new layout
2026-11-15 14:35:00 +00:00
|
|
|
for (const f of files) {
|
|
|
|
|
const buf = readFileSync(f);
|
|
|
|
|
if (buf.includes(0)) continue; // binary -- no text rules to enforce
|
|
|
|
|
const text = buf.toString('utf8');
|
|
|
|
|
|
|
|
|
|
// rule 1: ascii bytes
|
|
|
|
|
text.split('\n').forEach((line, i) => {
|
|
|
|
|
for (const ch of line) {
|
|
|
|
|
if (ch.charCodeAt(0) > 0x7f) {
|
|
|
|
|
fail(`${f}:${i + 1} non-ascii U+${ch.charCodeAt(0).toString(16).padStart(4, '0')} "${ch}"`);
|
|
|
|
|
break; // one report per line is plenty
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// rule 2: no text-mutating css. text-transform is linted in every
|
|
|
|
|
// code file (it only ever appears as a css property -- inline
|
|
|
|
|
// style attributes included); content: and font-variant are css
|
|
|
|
|
// file checks (content is a common js object key, and the docs
|
|
|
|
|
// discuss the rule by name)
|
|
|
|
|
if (/\.(css|html|mjs|js)$/.test(f) && !isSelf(f)) {
|
|
|
|
|
text.split('\n').forEach((line, i) => {
|
|
|
|
|
if (/text-transform/i.test(line)) {
|
|
|
|
|
fail(`${f}:${i + 1} text-mutating css: text-transform`);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
if (f.endsWith('.css')) {
|
|
|
|
|
const stripped = text.replace(/\/\*[\s\S]*?\*\//g, ''); // comments are prose, not style
|
|
|
|
|
stripped.split('\n').forEach((line, i) => {
|
|
|
|
|
if (/(?<![-\w])content:\s/.test(line)) {
|
|
|
|
|
fail(`${f}:${i + 1} text-mutating css: generated content (${line.trim().slice(0, 60)})`);
|
|
|
|
|
}
|
|
|
|
|
if (/font-variant[^;]*caps/.test(line)) {
|
|
|
|
|
fail(`${f}:${i + 1} text-mutating css: caps font variant`);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// rule 3: no html comments in prose/prompt files
|
|
|
|
|
if (f.endsWith('.md') && !f.endsWith('gm.md')) {
|
|
|
|
|
text.split('\n').forEach((line, i) => {
|
|
|
|
|
if (line.includes('<!--')) fail(`${f}:${i + 1} html comment in a prose file`);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// rule 4: retired terms in living prose
|
2026-11-19 08:35:23 +00:00
|
|
|
if (substrateProse(f)) {
|
variant round: roll retired, chance is variant literature (strict parse, crypto pick on reception, picked-only rendering, /story variance metric); entity round: /story the whole deliverable, /table the play projection, the slidwin carry (smart contwin cutoff, whole exchanges, housekeeper reads session-minus-tail); dormant-session rework: universal session lifecycle (dormant->live->finished, sessions/<n> storage), move-at-stop, start lint + auto-send rule, rebaseable housekeeping, turn-0 -> carryover.jsonl, seed -> memory.json, draft-only save-package; format house rules enforced by the nine-rule check-repo (ascii bytes, no text-mutating css); smoke 105/105 + restart + reminder + browser pass green, irene hand-migrated to the new layout
2026-11-15 14:35:00 +00:00
|
|
|
text.split('\n').forEach((line, i) => {
|
|
|
|
|
if (/\bthe wrap\b/i.test(line)) fail(`${f}:${i + 1} retired term: "the wrap" (housekeeping)`);
|
|
|
|
|
if (/prelude/i.test(line)) fail(`${f}:${i + 1} retired term: "prelude" (turn-0)`);
|
|
|
|
|
if (/\bpaper\b/i.test(line)) fail(`${f}:${i + 1} retired term: "paper" (status)`);
|
|
|
|
|
// lowercase "window(s)" is the retired session; "Windows" the OS
|
|
|
|
|
// is consumed as-is; a line naming contwin may gloss its meaning
|
|
|
|
|
if (!/contwin/i.test(line) && /\bwindows?\b/.test(line)) {
|
|
|
|
|
fail(`${f}:${i + 1} retired term: "window" (session / contwin)`);
|
|
|
|
|
}
|
|
|
|
|
if (/turn-0/i.test(line)) fail(`${f}:${i + 1} retired term: "turn-0" (the carryover)`);
|
|
|
|
|
if (/\bseed(ed|s|ing)?\b/i.test(line)) fail(`${f}:${i + 1} retired term: "seed" (memory.json -- her starting memories)`);
|
2026-11-19 09:56:56 +00:00
|
|
|
// lowercase "agent(s)" is retired (developer, 2026-11-19): the
|
|
|
|
|
// word did too many jobs at once -- every inferencer seat is named in
|
|
|
|
|
// the roles inventory (the assistant, the housekeeper, the
|
|
|
|
|
// curator, the player). The filename AGENTS.md is consumed
|
|
|
|
|
// as-is, exactly like "Windows" the OS.
|
|
|
|
|
if (/\bagents?\b/.test(line)) {
|
|
|
|
|
fail(`${f}:${i + 1} retired term: "agent" (the named seats -- DICTIONARY's roles inventory)`);
|
|
|
|
|
}
|
|
|
|
|
// "LLM" joins agent in retirement (developer, 2026-11-19): the
|
|
|
|
|
// class word is "inferencer(s)", the seats are named. "model"
|
|
|
|
|
// stays the machinery's noun -- a registry entry, a provider's
|
|
|
|
|
// listed model -- never a seat.
|
|
|
|
|
if (/\bLLMs?\b/.test(line)) {
|
|
|
|
|
fail(`${f}:${i + 1} retired term: "LLM" (inferencer -- the class word, DICTIONARY's roles inventory)`);
|
|
|
|
|
}
|
variant round: roll retired, chance is variant literature (strict parse, crypto pick on reception, picked-only rendering, /story variance metric); entity round: /story the whole deliverable, /table the play projection, the slidwin carry (smart contwin cutoff, whole exchanges, housekeeper reads session-minus-tail); dormant-session rework: universal session lifecycle (dormant->live->finished, sessions/<n> storage), move-at-stop, start lint + auto-send rule, rebaseable housekeeping, turn-0 -> carryover.jsonl, seed -> memory.json, draft-only save-package; format house rules enforced by the nine-rule check-repo (ascii bytes, no text-mutating css); smoke 105/105 + restart + reminder + browser pass green, irene hand-migrated to the new layout
2026-11-15 14:35:00 +00:00
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// rule 5: zero-dependency imports
|
|
|
|
|
if (f.endsWith('.mjs')) {
|
|
|
|
|
for (const m of text.matchAll(/from\s+['"]([^'"]+)['"]/g)) {
|
|
|
|
|
const spec = m[1];
|
|
|
|
|
if (!spec.startsWith('node:') && !spec.startsWith('./') && !spec.startsWith('../')) {
|
|
|
|
|
fail(`${f}: non-builtin import "${spec}" -- the stack is zero-dependency`);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// rule 6: utc discipline
|
|
|
|
|
if (/\.(mjs|js)$/.test(f) && !isSelf(f)) {
|
|
|
|
|
text.split('\n').forEach((line, i) => {
|
|
|
|
|
if (/toLocale|getTimezoneOffset/.test(line)) {
|
|
|
|
|
fail(`${f}:${i + 1} locale/timezone-dependent formatting (UTC everywhere)`);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// rule 7: web static naming
|
|
|
|
|
if (f.startsWith('web/') && f.split('/').pop().startsWith('api')) {
|
|
|
|
|
fail(`${f}: a web/ static name starting with "api" 404s as a bogus API route`);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// rule 8: the bundle boundary
|
|
|
|
|
if (f === 'server/bundle.mjs') {
|
|
|
|
|
text.split('\n').forEach((line, i) => {
|
|
|
|
|
if (/gm\.md|housekeeper\.md/.test(line)) {
|
|
|
|
|
fail(`${f}:${i + 1} the bundle must not name gm.md or housekeeper.md`);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// rule 9: dateless memory -- no model-facing surface renders a date;
|
|
|
|
|
// story time lives in prose
|
|
|
|
|
if (f === 'memory.json' || (f.startsWith('packages/') && f.endsWith('memory.json'))) {
|
|
|
|
|
text.split('\n').forEach((line, i) => {
|
|
|
|
|
if (/"[^"]*date[^"]*"\s*:/i.test(line)) {
|
|
|
|
|
fail(`${f}:${i + 1} a memory manifest carries a date key -- story time lives in prose`);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
the access round: spectator mode removed and reads made story-only -- the table, raw session, carryover, files, status, and the notepad are owner-only; the story is the one public read (any signed-in user, fork button on it that copies the run that made the story, never the view); #28's human-side open read overturned with the ruling, gm.md stays never model-facing; non-owners land in the story view (play/setup redirect on the 403, home cards link there directly), the story view names its owner and stands alone on the story response, which now carries display/owner/ownerName; the table gains a raw tab -- the whole log as it rode the wire (thinking, every variant block, every reminder copy, full tool results, rides inline) next to the curated projection, live sessions only, sticky across turn re-renders; --debug mode for easy testing: every request is a fixed superuser that bypasses the users db entirely, no invite dance, loopback-bound regardless of config (found live: the SPA boot only asked the server who it was when a token existed, so tokenless browsers never learned they were the debug user -- boot now always asks); lint rule 10: no laptop-visible facts anywhere and all commits always from Mute -- the username and home paths are derived at runtime so the checker never contains them, scanned over the tracked tree, every historical blob, and commit messages, identity enforced on author and committer on every ref plus git config; the queue split: resolved questions relocated to DECISIONS.md verbatim by number (day's words kept, reversals annotate never rewrite, the agenda/reminder trio gets its own section), QUESTIONS is open items only (stale OPENs resolved on the way: #10 by the 2026-11-13 pairing default, #11 by the raw tab); smoke reworked to the story-only battery -- ash 403s on every run surface, 200 on the story alone, the ownerless-run check rides the runs list; all twelve QUESTIONS-number citations re-pointed at DECISIONS; smoke ALL PASS in a worktree (111 checks), two-user browser pass (the non-owner's whole run surface is a 403 detail and a 200 story, back-to-table hidden, owner views intact), raw-tab browser pass (curated table leak-free, raw shows the whole variants block, tabs vanish on dormancy), typecheck green on both programs, check-repo clean
2026-11-15 22:37:06 +00:00
|
|
|
|
|
|
|
|
// rule 10a: laptop-visible facts never enter the tracked tree
|
|
|
|
|
text.split('\n').forEach((line, i) => {
|
|
|
|
|
if (piiRe.test(line)) {
|
|
|
|
|
fail(`${f}:${i + 1} laptop-visible fact (this machine's username or home path)`);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// rule 10b: the same facts never entered history -- every blob on
|
|
|
|
|
// every ref; one report per path+content, not one per commit
|
|
|
|
|
{
|
|
|
|
|
const revs = execFileSync('git', ['rev-list', '--all'], { encoding: 'utf8' }).split('\n').filter(Boolean);
|
|
|
|
|
let out = '';
|
|
|
|
|
try {
|
|
|
|
|
out = execFileSync('git', ['grep', '-I', '-i', '-E', piiSrc, ...revs], { encoding: 'utf8' });
|
|
|
|
|
} catch (e) {
|
|
|
|
|
out = `${e.stdout || ''}`; // grep exits 1 on zero matches
|
|
|
|
|
}
|
|
|
|
|
const seen = new Set();
|
|
|
|
|
for (const line of out.split('\n').filter(Boolean)) {
|
|
|
|
|
const rest = line.slice(line.indexOf(':') + 1); // "rev:path:content" -> "path:content"
|
|
|
|
|
if (!seen.has(rest)) {
|
|
|
|
|
seen.add(rest);
|
|
|
|
|
fail(`history ${rest.slice(0, 80)}: laptop-visible fact in a historical blob`);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// rule 10c: commit messages stay clean too
|
|
|
|
|
execFileSync('git', ['log', '--all', '--format=%s %b'], { encoding: 'utf8' })
|
|
|
|
|
.split('\n')
|
|
|
|
|
.forEach((line) => {
|
|
|
|
|
if (piiRe.test(line)) fail(`commit message: laptop-visible fact (${line.trim().slice(0, 60)})`);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// rule 10d: every commit is from Mute -- author and committer, name
|
|
|
|
|
// and email, on every ref
|
|
|
|
|
for (const row of execFileSync('git', ['log', '--all', '--format=%h%x00%an%x00%ae%x00%cn%x00%ce'], { encoding: 'utf8' }).split('\n').filter(Boolean)) {
|
|
|
|
|
const [h, an, ae, cn, ce] = row.split('\x00');
|
|
|
|
|
if (an !== ID_NAME || ae !== ID_EMAIL || cn !== ID_NAME || ce !== ID_EMAIL) {
|
|
|
|
|
fail(`commit ${h}: identity is "${an} <${ae}>" -- all commits are always from ${ID_NAME}`);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// rule 10e: and the configured identity keeps it that way
|
|
|
|
|
for (const [key, want] of [['user.name', ID_NAME], ['user.email', ID_EMAIL]]) {
|
|
|
|
|
let val = '(unset)';
|
|
|
|
|
try {
|
|
|
|
|
val = execFileSync('git', ['config', key], { encoding: 'utf8' }).trim();
|
|
|
|
|
} catch { /* unset -- the fail below reports it */ }
|
|
|
|
|
if (val !== want) fail(`git config ${key} is "${val}" -- all commits are always from ${ID_NAME}`);
|
variant round: roll retired, chance is variant literature (strict parse, crypto pick on reception, picked-only rendering, /story variance metric); entity round: /story the whole deliverable, /table the play projection, the slidwin carry (smart contwin cutoff, whole exchanges, housekeeper reads session-minus-tail); dormant-session rework: universal session lifecycle (dormant->live->finished, sessions/<n> storage), move-at-stop, start lint + auto-send rule, rebaseable housekeeping, turn-0 -> carryover.jsonl, seed -> memory.json, draft-only save-package; format house rules enforced by the nine-rule check-repo (ascii bytes, no text-mutating css); smoke 105/105 + restart + reminder + browser pass green, irene hand-migrated to the new layout
2026-11-15 14:35:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
console.log(failures ? `\n${failures} VIOLATIONS` : 'ALL CLEAN');
|
|
|
|
|
process.exit(failures ? 1 : 0);
|