Harden the post link parser after the refactorer handoff: - add start-of-text and leading-token boundary unit tests and drop a redundant range guard, killing the isBareDomainBoundary survivors - replace the mutable React key counter with React.Children.toArray and assert the embedded iframe is fullscreen, killing both PostContent mutation survivors - record the client verification pass and the review summary By architect.
7.3 KiB
Architect Process Notes
ROLE-SCOPED — ARCHITECT ONLY. DO NOT FOLLOW.
This file is the architect role's private working notes. It records process exceptions, tooling behavior, and observations specific to how the architect runs its workflow. It is not shared guidance and is not intended for the specifier, coder, or refactorer roles. If you are not the architect, ignore this file entirely — do not treat anything here as a directive, convention, or requirement for your own role. Your role's instructions come only from your own role prompt and the constitution.
Durable notes on process exceptions, tooling behavior, and recurring
observations discovered while running the architect workflow. These are
process-level notes (how the tools behave, what to expect, what to watch for),
distinct from per-task verification results, which live in
docs/reviews/<task>-summary.md.
Tooling behavior / runtime
-
Bare
dry4javascriptruns the full test suite (~1m50s). It is a DRY analysis that invokes tests, so running it with no arguments is a slow full-suite run, not a fast readiness probe. Never use it as a startup smoke check. Usedry4javascript --help(fast, ~0.6s) to confirm the binary is present and runnable.architect-startup.shand the startup cheat-sheet must both use--helpfor this check. -
architect-startup.shnow runs in ~5s. After thedry4javascript --helpfix, the only remaining cost is thegit fetchon the four tool repos (~3.7s). That fetch is a network call and can hang in sandboxed environments; if a hang is ever observed, add atimeoutto the fetch loop. The smoke test (mutate4javascript usage, dry4javascript --help, gherkin-parser --help) is the fast readiness probe; the full startup script is optional confirmation. -
Mutation runs dominate wall-clock time. Each
mutate4javascript <file>invocation runs the full test suite as a baseline (coverage refresh) before running mutations, then runs mutations in parallel with--max-workers 8. Because the baseline re-runs the whole suite, mutating N files costs roughly N full-suite runs. Plan for this: batch the affected files, run them sequentially, and use--max-workers 8to keep the mutation phase fast. The DRY and soft-Gherkin-mutation steps are comparatively quick. -
mutate4javascriptcopies the whole project into each worker, includingtmp/. The worker copy skips only.git,node_modules, andtarget. A staletmp/acceptance(LevelDB dirs from prior acceptance runs) can be ~1.5G, so with 8 workers the copy alone is ~12G of file I/O and the run appears to hang (process inDstate, no mutation progress lines). Before any mutation run,rm -rf <component>/tmp/acceptance target/mutation-workersto keep the worker copies tiny. This cut a notifications-query mutation run from 20+ minutes to ~2 minutes. -
Which directories bloat and how to keep them clean. The two directories that grow without bound are
<component>/tmp/acceptance(LevelDB dirs from acceptance runs, up to ~1.5G) and<component>/target/mutation-workers(per-run worker copies, up to ~14G). Both are gitignored build artifacts. Clean them before any mutation run:rm -rf psf-memo-db/tmp/acceptance psf-memo-db/target/mutation-workers \ psf-memo-client/tmp/acceptance psf-memo-client/target/mutation-workersarchitect-startup.shnow checks these and reports them as[FAIL]when they exceed a size threshold, so a bloated dir is caught before it slows a mutation run. -
memo-db.js(client HTTP adapter) is excluded from mutation testing. It uses ESM + a directory import (../config) that is only resolvable via react-scripts/webpack, so it cannot be loaded under plainnode --test. Its read behavior is exercised end-to-end via the DB acceptance tests. This is a standing precedent (also applied to the search task); do not attempt to force mutation coverage on it. -
Soft Gherkin acceptance mutation survivors are usually genuine equivalents. For read-only features, single-character case mutations of example values (addresses, text, txids) survive because each example value is used consistently on both the setup and assertion sides of its scenario. These are intrinsic equivalents, not implementation gaps; document them in the review summary and do not chase them.
-
DRY reports pre-existing pattern-boilerplate. The layered conventions (follow/mute/poll controllers, route-registration
index.js, memo-follow/ memo-mute services) produce score-1.00 duplicates that prior reviews left as-is. A shared controller base would be a broad cross-module refactor beyond any single handoff. Only reduce duplication that is local to the task at hand. -
mutate4javascriptdefault differential run can under-select after a function-set change. With a manifest present, the default run is differential (effectiveSinceLastRun) and selected only 1 changed site forpost-query.jsafter a review addedlistChildTxidsand removedbuildLikeCountMap;--scanalso reportedChanged mutation sites: 1. Re-running the same file with--mutate-allran all 37 sites (all killed). When a file adds or removes functions, run--mutate-allfor that file (or confirmSelected mutation sitesequalsTotal mutation sites) so new mutations are not silently skipped. -
Capture the
gherkin-mutatorreport with--jsonredirected to a file. The text report (write-text-report!, which usesprint) did not appear in the captured output before the tool'sSystem/exit; the JSON report (--json) did. Redirect stdout to a file and use--jsonfor a reliable, parseable record of killed/survived mutations.
Workflow observations
-
**
architect-startup.shcheckstmp/apsrelative to the worktree, butensure-aps.shresolves the single canonical APS checkout to the git common root'stmp/aps(the main checkout). In a role worktree the two disagree, so the startup script reports[FAIL] tmp/aps missingeven though the tools run. Local workaround: symlink the worktree's ignoredtmp/apsto the canonical checkout,ln -sfn <common-root>/tmp/aps tmp/aps. Proper fix (for a task that owns tooling): havearchitect-startup.shcaptureAPS_DIR="$(ensure-aps.sh --update)"and check/run against$APS_DIRinstead of the relative path. -
Review summaries must be force-added.
docs/is in the root.gitignore, sogit add -Asilently skipsdocs/reviews/<task>-summary.md. The role requires the summary to be committed with the byline in the same commit as the review changes, so usegit add -f docs/reviews/<task>-summary.md(orgit add -f docs/process-notes.md) before committing. This has silently dropped 8 of 13 summaries in the past; verify withgit ls-files docs/reviews/after committing. -
ready_for_next.sh/done_with_current.share the source of truth for queued work.done_with_current.shprintsNO_TASKwhen the queue is empty; stop waiting for work in that case. -
Handoff
commitfield must be exactly 10 hex chars.swarm_handoff.shrejects shorter abbreviations; usegit rev-parse --short=10 HEAD. -
Run per-component verification for every component a task touches before handing off (client, db, indexer), per the monorepo rules.