## Signal-stopped Claude Code requests After building unchanged main and the candidate separately, run `scripts/e2e-signal-exit.mjs` with the explicit paths and private read-only credential source documented in [the signal-exit evidence](docs/maintenance/SIGNAL_EXIT_TRANSIENT.md). It drives the actual Pi provider, Meridian CLI, SDK and live Haiku 5.5 on Linux, without starting a Pi session. Require the baseline streamed signal exit to be non-retryable, the candidate's to be retryable, and the candidate's normal drain to finish admitted work while refusing new turns with 503. This qualifies the provider/error policy, not Pi's outer automatic retry loop or interactive UI. Review all state-root isolation before starting; never target a managed service. ## Pi extension (#1408) Three harnesses use the actual Pi CLI with the extension that `meridian setup --client pi` installs, or loads directly, in a scratch `PI_CODING_AGENT_DIR`: - `node scripts/e2e-pi-startup.mjs --pi=` needs no credentials or internet access and makes no model calls (#1476). Against a loopback Meridian that accepts connections but never replies, Pi must answer RPC `get_state` within 2 s: with a cold catalog, with a stored one, and offline without contacting Meridian. With a cold catalog it must also select a built-in Meridian model, through `--model meridian/…` and through `defaultProvider`/`defaultModel` beside an Anthropic key. It must keep that model after the background discovery is abandoned, and in print mode send the turn to Meridian without requesting its catalog. Against a responsive stub it must persist the discovered catalog. Every case runs and reports. `--extension=/plugin/pi/index.ts` runs it against another tree's extension. - `bun scripts/e2e-pi-extension-side-calls.mjs --pi=` needs no credentials. It drives Pi's RPC mode against a recording stub with canned SSE replies, through two prompts, a manual `compact` and a third prompt. Each primary request must carry Pi's own session ID as `x-session-affinity`, no `x-meridian-source` and a `pi1` attestation that Meridian verifies for that session, with a distinct turn per prompt. Every compaction request must carry a fresh session key, `x-meridian-source: fork-side-call` and no attestation. - `E2E_PLUGIN_PATH=/dist/index.js bun scripts/e2e-pi-extension.mjs --pi=` runs Pi print mode through an in-process Meridian and real Claude: a Haiku tool loop, a `MERIDIAN_SOURCE=subagent-e2e` child and Opus 5.5 at high effort. Meridian loads only the named Pi scrub (`E2E_SCRUB_VERSION` pins its version), which must be active and must process the requests. Print mode never discovers, so the harness first runs the extension's discovery against that Meridian and stores the result; `--cold-catalog` skips that, runs every turn on the extension's built-in catalog and asserts that no Meridian catalog is persisted. (That print mode requests no catalog is asserted by the startup harness.) It asserts the wire identity and Meridian's adapter/source telemetry, and reports generation separately. Pass the Pi executable explicitly. A version manager can select a project-local Pi from the working directory. Run under a qualified SQLite runtime (see `src/proxy/session/bookkeeping/nativeDatabase.ts`). Recorded 2026-11-01 on Darwin arm64, Node 22.22.3, Pi 1.4.0 and 1.3.0 (#1476): - **Startup harness:** all seven cases pass with the built-in catalog. - main's extension, which fetches the catalog during the cache-only phase, waits 3.6–3.9 s for the hung Meridian and fails every cold Meridian-model case. In print mode it requests the catalog, and on some runs Pi exits before the catalog arrives. - The PR's first head (strict cache-only, `ef3ac97e`) fails the three cold Meridian-model cases. - **Interactive mode** has no harness and was checked by hand. - Setup: a scratch `PI_CODING_AGENT_DIR` holding only `settings.json` (and the Anthropic store seed the startup harness writes). `MERIDIAN_BASE_URL` points at a loopback server that accepts connections and never replies. - Run Pi under a terminal (or `python3 -c 'import pty,sys; pty.spawn(sys.argv[1:])' pi …`) with `--no-session --no-extensions -e plugin/pi/index.ts --model meridian/claude-haiku-5-5`. - Result: with the built-in catalog the TUI stays up past 8 s; `ef3ac97e` exits 1 with `Model … not found`. - **Side-call harness:** passes on both versions. - **Live run:** the Claude harness with `--cold-catalog` (pi-scrub 0.2.3, Pi 1.4.0, read-only credentials, included usage) ran from a cold catalog. The Haiku tool loop stayed on one signed turn, the `subagent-e2e` child kept its source, and Opus 5.5 at high effort answered, with every identity assertion passing. No Meridian catalog was persisted. The scrub processed all 4 requests. Recorded 2026-10-25 on Darwin arm64, Bun 1.3.14, Node 22.22.3: the side-call harness passed on Pi 1.4.0 and 1.3.0, with two compaction requests each. The Claude harness passed every identity assertion on Pi 1.4.0, but that first run omitted the Pi scrub, and Claude refused all three generations as third-party traffic. Rerun the same day with pi-scrub 0.2.2, the harness passed: the Haiku tool loop continued on one signed turn and returned the fixture, the `subagent-e2e` child answered on the base tier, and Opus 5.5 at high effort answered on `opus[1m]`. The scrub was active and processed every request without errors. Without the scrub, the same Pi request through the extension was still refused; in the first run a plain request through the same server succeeded. Paid Extra Usage stayed off. Recorded 2026-10-25 against the owner's launchd Meridian (main `cb767de`, pi-scrub 0.2.0) with Pi 1.4.0 on Claude Max: `pi -c` resumed a saved session as `lineage=continuation` with cache reads, and recalled its codeword. An in-process foreground child of pi-subagents 0.82.1's builtin `delegate` agent went out as `fork-side-call` on `opus[1m]`. That agent appends its prompt, so its `` marker sits inside Pi's `` section; the extension now reads it there, and the same run sent `subagent-delegate` on the base `opus` tier while the parent stayed signed on `opus[1m]` ([evidence](docs/maintenance/evidence/pi-subagents-addendum-20261025/README.md)). A live `next-user-turn` promotion remains unqualified: it needs the priority account to run out. The promotion path is covered by `src/__tests__/priority-routing-integration.test.ts`. ## Recovered passthrough streaming outcome logs `node scripts/e2e-passthrough-handoff-logging.mjs` compares an unchanged build with the candidate through the actual installed Pi AI provider, SDK and native Claude Code. It makes two real Haiku requests, each declaring exactly one non-deferred client tool; it does not start a Pi session. Set the explicit build/provider/executable/credential/scratch parameters and complete the pre-start isolation proof described in [the evidence record](docs/maintenance/PASSTHROUGH_HANDOFF_LOGGING.md). Require identical client-visible tool handoffs (`tool_use`, no SSE error), baseline `upstream.failed` plus `proxy.anthropic.error`, and candidate only `upstream.completed` with `sdkTermination=max_turns` and `recovery=tool_use`. The HTTP integration tests additionally cover uncaptured handoffs, truncation, empty turns, process-exit stderr, rate-limit refusals and publication conflicts. ## Oh My Pi regrouped user messages `node scripts/e2e-lineage-regroup-omp.mjs --omp= --agent-dir= --log= [--model=opus] [--expect=resume|replay]` drives the real omp client against a running Meridian (a built tree on a spare port with its own `MERIDIAN_CONFIG_DIR` and `MERIDIAN_SESSION_DIR`, output teed to `--log`). `--agent-dir` is a scratch `PI_CODING_AGENT_DIR` whose `models.yml` points the anthropic provider at that port with `x-meridian-agent: pi`. It inserts a reminder-only user message into the scratch session file before the second turn and removes it before the third, as omp's idle rebuild and a restart did on 2026-11-07, then asserts the third turn resumes. `--expect=replay` asserts the pre-fix fresh replay for a before run. Recorded 2026-11-07 on Linux x64, Node 24.22.2, omp 18.18.0, Claude Code 2.1.316, `opus` on the owner's Claude subscription: upstream main `cafdcf78` replayed the third turn (`lineage=new diverged=modified-history`, prefix overlap 2/4, cache_write 7k), the fix resumed it (`lineage=continuation`, `Regrouped user messages … 1 run, stored 4 -> incoming 3; resuming.`, cache_read 16k, cache_write 46). ## Oh My Pi side calls `node scripts/e2e-omp-side-call.mjs --omp= --agent-dir= --log= [--model=opus] [--expect=fork|auxiliary|turn]` drives the real omp client against a running Meridian set up as for the regrouped-messages harness above. A scratch hook runs one side call through omp's own `runEphemeralTurn` (the path of its idle recap and composer predictions) after the first turn, then `omp -c` sends the second turn. With `fork` (the default) it asserts the side call is served as `lineage=continuation … auxiliary=fork`, reads more cache than it writes, and that the second turn resumes the same session the side call forked. `auxiliary` asserts a fresh-replay side call, `turn` the behaviour without side-call support (the side call resumes the conversation as a turn). Recorded 2026-11-16 on Linux x64, Node 24.22.3, omp 18.20.3, Claude Code 2.1.316, `opus`: the side call read 15k and wrote 125 cache tokens (2k as a fresh replay before); the second turn started while the side call was still answering and resumed the first turn's session (`lineage=continuation`, read 15k, wrote 63). [Evidence](docs/maintenance/evidence/1553-omp-side-call-fork-20261116/README.md). ## Priority affinity across a restart `node scripts/e2e-priority-restart.mjs --omp= --profiles=, [--cli=dist/cli.js] [--port=3791] [--model=opus] [--expect=retain|move] [--profiles-json=]` starts a built Meridian itself (`npm run build` first) on a free port with its own config and session dirs, read-only credentials, none of the operator's `MERIDIAN_*` variables, and the profile list from `~/.config/meridian/profiles.json` (two non-default profiles). Under priority order A,B the real omp client sends the first turn; the harness restarts Meridian with the order reversed and `omp -c` sends the second. `retain` (the default) asserts the second turn stays on A and resumes the session (`lineage=continuation`, no refused resume); `move` asserts the behaviour before the fix (on B, `diverged=not-found`). Recorded 2026-11-20 on Linux x64, Node 24.22.3, omp 19.0.1, Claude Code 2.1.322, `opus`: on main the second turn moved to the other account and replayed; with the fix it stayed and read 16k, wrote 72 cache tokens. [Evidence](docs/maintenance/evidence/priority-restart-affinity-20261120/README.md). ## Claude Code's own tool search in passthrough (#1478) `node scripts/e2e-claude-code-tool-search.mjs` runs the real Claude Code client against a built Meridian (`npm run build` first). Set `E2E_CLAUDE_BIN` to an absolute Claude Code executable. The client gets a stdio MCP server with 22 `ledger_*` tools and `ENABLE_TOOL_SEARCH` on or off, and is asked to call specific tools. - **Assertion:** the MCP server's own call log, never model wording. For `--expect=pass`, every target tool was called with the fixture arguments, in order in `--mode=chain`. For `--expect=fail`, none was (the unchanged-main control). - **Upstream:** `--upstream=scripted` (the default) points Meridian at a scripted Messages API that applies the API's `tool_reference` rule: a `defer_loading` tool becomes callable only once a reference names it. It needs no credentials and makes no model calls. `--mode=bare-name` scripts a model that copies the name from a `[Tool reference: …]` note verbatim (the #1107 failure). `--upstream=live` uses the default Claude login read-only and requires `E2E_ALLOW_LIVE_MODEL=1`. It sets `MERIDIAN_OPUS_MODEL=opus` so an Opus run cannot bill the `[1m]` variant as Extra Usage. - **Exit codes:** 0 for the expected outcome, 1 otherwise, and 2 on a usage, billing or auth refusal. On 2, stop: do not retry on another account. Recorded 2026-11-02 on Darwin arm64 with Claude Code 2.1.316, Agent SDK 0.2.141 and Node 22.22.3, during the #1478 review: - **Live:** with tool search on, unchanged main fails on Sonnet 5.5, and the fix passes on Sonnet 5.5 and Opus 5.5. The tool-search-off control passes (`deferred=40/44`). - **E41:** all four modes pass on the fix and on main. - **Scripted:** see the self-test below. Self-test of this script from the repository, scripted upstream, no model calls: - **main `7a971fd1`:** `single`, `chain`, `parallel` and `bare-name` with tool search on, and `single` with it off, all pass. Every rendered reference names the registered `mcp__oc__…` tool. - **Before #1478 (`c6ec3a92`):** `single` with tool search on fails as expected: no MCP call, and the inner CLI replaces the reference with `Tool references removed`. ## Asynchronous JSON store and SQLite transaction parity (#1220) Run the isolated `proxy-session-store-locking`, `priority-session-store`, `execution-history-store`, `bookkeeping-cache-publication` and `session-cache-clear-completion` test files. JSON gates exercise real file-handle sync waits, lock contention, ordered mutations and rollback fallback ownership. SQLite gates require synchronous publication callbacks, atomic rollback and commit-ordered cache/priority effects. Deliberately yielding the native result continuation must fail the SQL authority tests; delaying the headerless rollback key capture must fail its JSON store-error fallback test. Restore source bytes before qualification. These checks do not resolve #1220's original live Opus cache-prefix discrepancy. Keep the unchanged E41 threshold and original actual-client/model/platform gates; recorded metadata and later green runs are not a causal explanation. ## Awaited session-cache cleanup (#1244/#1277) Run `bun test src/__tests__/session-cache-clear-completion.test.ts` with a qualified SQLite runtime. The real native-writer control checks immediate memory reset, pending-owner retention, earlier/later FIFO publications and best-effort COMMIT failures. Two isolated negative controls remove the cache epoch fence or move reset after `await`; both must fail before source bytes are restored. For affected-flow evidence, extend all four E41 modes using `scripts/fixtures/session-cache-clear-gate.mjs`. After the existing live tool/history/cache assertions, pass the host's real public `clearSessionCache`, durable snapshot and supported SDK `getSessionMessages` helpers. The fresh turn uses the same installed client plugin and session key with a new human turn ID. Assert a completion promise, empty durable mappings, a distinct new SDK session and unchanged original history. Preserve the exact controller, versions, model identities and joined processes with the evidence. Use the independently installed package's exported function for the package arm. ## Antigravity completed-conversation idle window (#1341) Run `node scripts/e2e-antigravity-idle-conversation.mjs