diff --git a/AGENTS.md b/AGENTS.md index e04416e8..ef4577eb 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -421,7 +421,9 @@ `profiles.is_digital_twin` required; see PipeTooling's `docs/DIGITAL_TWINS_PLAN.md`), `manage-user` (the CT↔PT user bridge — PipeTooling is the system of record for people and commands account provisioning/flagging/retirement here over - `X-Bridge-Secret` / `CT_MANAGE_USER_SECRET`; server→server only, never a browser), + `X-Bridge-Secret` / `CT_MANAGE_USER_SECRET`; server→server only, never a browser; since + 2026-11-26 its `roster` verb sends `is_overseer` and `is_lead` beside `is_admin`, and + `set_flags` sets a seat's admin, overseer and lead flags, never switching off the last admin), `import-takeoff` (the agent door for a headless takeoff: an agent POSTs a `takeoff.json` and the marks land as a normal, twin-owned project; contract in [TAKEOFF_IMPORT.md](TAKEOFF_IMPORT.md), scorer in takeoff-eval.js); diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index 1d55ddee..2a81ca5d 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -17,7 +17,7 @@ Implementation history (the sync-hardening work + the modularization arc) lives ## Large-file map (decomposition status) -Current first-party line counts (`wc -l`, 2026-10-15 — the **numbers and this +Current first-party line counts (`wc -l`, 2026-12-02 — the **numbers and this date are GENERATED** by `npm run build:filemap` ([scripts/build-filemap.js](scripts/build-filemap.js)); `npm run check` fails when they drift, so don't edit counts by hand. Which files are listed and every @@ -28,9 +28,9 @@ off — and where it doesn't. | File | Lines | Status / verdict | |------|------:|------------------| -| [app.js](app.js) | 7,321 | **The remaining monolith** — down from 16.2k (9.9k after save-engine Stage 6, 8.1k after the Tier-2 splits, then −987 from the canvas-draw extraction). The only file worth actively shrinking; the region table below says what's left and in what order. | +| [app.js](app.js) | 7,322 | **The remaining monolith** — down from 16.2k (9.9k after save-engine Stage 6, 8.1k after the Tier-2 splits, then −987 from the canvas-draw extraction). The only file worth actively shrinking; the region table below says what's left and in what order. | | [save-engine.js](save-engine.js) | 3,263 | Done — the extracted save/sync seam module (Stages 1–7), 91 node tests. R21 (2026-09-26) folded its repeated blocks inside the file; do not split it. Large but modular and fully node-testable; no further action. | -| [pdf-tile-cache.js](pdf-tile-cache.js) | 867 | Done (stage 1, 2026-07-30) — the PDF raster-cache substrate extracted from app.js's "PDF render bitmap cache" section (`createPdfTileCache(ctx)`, the save-engine seam recipe): page-bitmap LRU, downsample pyramid, persisted zoom rungs, idle prefetch, full-document warm-up. Pinned by nine Playwright specs (page-switch-cache, pyramid, pyramid-persist, rung-prefetch, doc-warmup, zoom-ladder, commit-tile, crop-tile, tile-grid). Stage 2 (later): the Sharp crop tile / tile grid section. | +| [pdf-tile-cache.js](pdf-tile-cache.js) | 949 | Done (stage 1, 2026-07-30) — the PDF raster-cache substrate extracted from app.js's "PDF render bitmap cache" section (`createPdfTileCache(ctx)`, the save-engine seam recipe): page-bitmap LRU, downsample pyramid, persisted zoom rungs, idle prefetch, full-document warm-up. Pinned by nine Playwright specs (page-switch-cache, pyramid, pyramid-persist, rung-prefetch, doc-warmup, zoom-ladder, commit-tile, crop-tile, tile-grid). Stage 2 (later): the Sharp crop tile / tile grid section. | | [canvas-draw.js](canvas-draw.js) | 1,417 | Done — the unified annotation draw core (`createCanvasDraw(deps)` + `drawAnnotationsCore`), node-tested, guarded by [render-pixels.spec.js](render-pixels.spec.js). Both draw paths are thin env-builders over it. | | [app/index.html](app/index.html) | 3,882 | The shell: HTML structure + every modal, no inline JS. Flat markup with no build step to split it; grows roughly linearly with modal count. Leave. | | [styles.css](styles.css) | 2,881 | All CSS, token-organized. Leave. | @@ -86,7 +86,7 @@ modules. Candidates in priority order: | [annotation-model.js](annotation-model.js) | **The canvas/annotation data model** (Tier-2 item 7) — exports `createAnnotationModel(ctx)` + `createUndoStack(ctx)`, the same seam recipe as the save engine. Classic `