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

This commit is contained in:
2026-11-15 15:28:56 +00:00
parent d737e47f82
commit f81b188ce1
22 changed files with 594 additions and 90 deletions
+4
View File
@@ -19,6 +19,8 @@
import { effectiveContents } from './variants.mjs';
/** @typedef {import('./shapes.mjs').LogEvent} LogEvent */
// ~10% of a 256K-class contwin in token terms, grounded on Irene's
// session (84KB of turn content at ~23K prompt tokens). Substrate
// policy, not deployment taste: a constant, not config.
@@ -27,6 +29,7 @@ export const CARRY_BUDGET = 96 * 1024;
const STRIP_BLOCKS = /<(status|agenda|conflict)>[\s\S]*?<\/\1>/g;
// the prose the model will see for one log line in the new contwin
/** @param {LogEvent[]} lines @param {Map<number, string>} eff @param {number} i @returns {number} */
function visibleBytes(lines, eff, i) {
const e = lines[i];
if (e.t === 'msg') {
@@ -58,6 +61,7 @@ function visibleBytes(lines, eff, i) {
// instead of leaving her cue behind in the dead log. When nothing
// fits (the degenerate empty tail) it stays behind and files
// normally.
/** @param {LogEvent[]} lines @returns {number} */
export function tailStart(lines) {
const eff = effectiveContents(lines);
const exchanges = [];