Skip to content

Latest commit

 

History

History
647 lines (544 loc) · 31.9 KB

development.md

File metadata and controls

647 lines (544 loc) · 31.9 KB

Development and testing

Use Node.js 24.18 or newer. npm 11 is the tested package-manager baseline.

New to the repository? Start with the Developer overview. For browser-test authoring use E2E testing, and for release readiness use the Release process.

Install discipline

Always install, test, and build with NODE_ENV unset:

env -u NODE_ENV npm ci

An exported NODE_ENV=production makes npm omit development dependencies and causes Vitest to resolve React's production build. Typical symptoms are missing Vitest/Playwright modules or React.act is not a function. Reinstall with the command above before debugging the application.

For E2E tests, install the pinned Playwright Chromium if it is not already present:

npx playwright install chromium

Do not commit node_modules, dist, test-results, local state, provider sessions, credentials, Android build output, or generated Capacitor runtime files.

Native Windows

Use Node.js 24.18 or newer and npm 11 from the same installation. In PowerShell, use npm.cmd so PowerShell does not consume npm's forwarded command-line options. Clear NODE_ENV for the current process before running the checks:

Remove-Item Env:NODE_ENV -ErrorAction SilentlyContinue
npm.cmd ci
npm.cmd run typecheck
npm.cmd run test:windows-runtime
npm.cmd test
npm.cmd run build
npm.cmd run test:e2e

Native dependency compilation requires Visual Studio C++ Build Tools and a Windows SDK. If node-gyp cannot discover an installed toolchain, run these commands from its Developer PowerShell. The focused Windows runtime command checks owned-process and notification cleanup, workspace files and search, PowerShell module isolation, staging privacy, terminal recovery, and named-pipe IPC; it complements the broader unit, integration, and browser suites.

The broader suite still contains Unix-only fixture assumptions, including POSIX user IDs, permissions, and shell executables. Record native results and remaining failures rather than treating a Linux pass as Windows qualification. One known native limitation is cleanup after a save's parent directory is moved and replaced concurrently: Windows rejects the save and protects both target files, but can leave its denied .sedes-*.tmp file in the moved directory. The corresponding race assertion remains enabled to track this gap. Task file-link metadata also retains a POSIX-only path rule in frozen Task attachment format v1. Native Windows Task links need a coordinated snapshot and client/sidecar compatibility rollout; do not silently rewrite or drop their paths. Ordinary Files links already use execution-host native paths.

Standard verification

The normal sequence is:

env -u NODE_ENV npm run typecheck
env -u NODE_ENV npm test
env -u NODE_ENV npm run build
env -u NODE_ENV npm run test:e2e
  • typecheck checks repository-local documentation links, generated agent-tool contracts, and the E2E timing baseline before compiling the client and server TypeScript projects without emitting.
  • test first builds the sidecar, Pi sandbox, Claude runtime, and Antigravity history-worker artifacts, then runs unit, component, and integration tests with disposable state. This keeps production-shaped fixtures runnable before a full build on a clean checkout. Use npm test -- <file> for focused runs so the worker prerequisites run too. Keep builds and tests sequential within one checkout: worker builders replace manifests that a running production fixture may need to read. Vitest uses half the logical processors, from four workers up to sixteen, to keep host load bounded. Use npm test -- --maxWorkers=N to explicitly choose a different limit. Most provider boundaries are fake-backed; the Codex lifecycle/TUI fixtures also execute the pinned Linux-x64 Codex artifact against local fixture providers and require /usr/bin/tmux for TUI coverage. They do not use an authenticated external provider account.
  • build checks documentation and generated agent-tool contracts, cleans dist, builds the client, compiles the server/CLIs, builds the SSH operations sidecar artifact, and marks the Sedes, automation, and provider CLI entry points executable.
  • test:e2e builds once, schedules each spec as an isolated job with its own server, port, state, and artifact directory, and merges the results.

Documentation-only changes normally need link/config validation and the proportionate deterministic checks; they do not justify live-provider calls.

On Linux, the test suite runs real Bubblewrap boundary tests by default. If the test environment cannot mount /proc or set a sandbox hostname, explicitly skip those launches with:

SEDES_SKIP_SANDBOX_TESTS=1 env -u NODE_ENV npm test

Only the exact value 1 opts out. This skips the real launches in the Pi Bubblewrap boundary and worker-runtime suites and the Grok probe harness and offline tranche suites. Sandbox policy, launch-plan validation, and tests that do not launch Bubblewrap remain active. The flag does not alter production sandbox protections or the standalone Grok probe commands. Report these checks as skipped; run them with the flag unset in an environment that supports the required Bubblewrap operations before claiming sandbox boundary verification.

Run the documentation check directly with:

env -u NODE_ENV npm run check:docs

The unit suite parses every checked-in backend configuration example through the strict top-level schema, reference checks, and compiled provider-module preparation without opening storage or starting provider processes.

Playwright topology and artifacts

In parallel mode the npm coordinator treats each .spec.ts file as one indivisible job with its own loopback port, disposable state, and production-shaped server. With --lanes=1, matching specs run together as one server job. Output always stays beneath the printed test-results/e2e-runs/run-* directory; parallel jobs live under jobs/NNN-of-NNN, while a single job writes directly beneath its run directory. Failure screenshots and traces (plus opt-in failure video with SEDES_E2E_VIDEO=1), explicit review screenshots, logs, and the final report remain within that invocation.

Use test:e2e:serial to diagnose ordering, test:e2e:prebuilt for one-lane iteration against an already verified build, and test:e2e:parallel:prebuilt for the normal isolated schedule without rebuilding. By default the coordinator runs one lane per four logical processors, from four lanes up to eight. Explicit --lanes=N values from 1 through 16 remain available; use more than eight only on a host provisioned for that many concurrent servers and browsers. Run these npm commands, not raw Playwright. Every spec must be independently runnable and must not rely on another spec's process, state, workspace, or order.

The committed rounded timing baseline is a scheduling input, not an acceptance threshold. Adding, renaming, or removing a spec requires updating it from an explicitly selected successful full run. Inspect changed screenshots, including an in-flight streaming state. The complete authoring, isolation, artifact, and timing contract is in E2E testing.

Generated contracts

Agent-tool schemas and adapter metadata are generated from the canonical manifest and checked automatically before typecheck/build:

env -u NODE_ENV npx tsx \
  src/server/agent-tools/schema/check-agent-tool-artifacts.ts --write
env -u NODE_ENV npm run check:agent-tool-contracts

Use the write form only after deliberately changing the canonical tool catalog or schema version. Review the checked-in artifacts, bundled skill consumers, live named-command paths, schema-derived CLI parameter/help behavior, CLI adapters, and server definitions as one contract change. CLI command-path normalization is startup-validated and must remain unique after dots are split and underscores become hyphens.

Codex protocol artifacts are pinned separately:

env -u NODE_ENV npm run check:codex-protocol

Use generate:codex-protocol only for an intentional protocol-baseline update. Review the generated manifest, hashes, stable method inventory, codecs, release evidence, and corresponding backend tests as one change. A production build also runs check:codex-generated-runtime against its emitted server binding so the checked source profile and the executable artifact cannot silently diverge.

ACP bindings and the reviewed Grok release/profile have independent checks:

env -u NODE_ENV npm run generate:acp-protocol
env -u NODE_ENV npm run check:acp-protocol
env -u NODE_ENV npm run check:grok-source-routes
env -u NODE_ENV npm run check:grok-profile

Run the ACP generator only for an intentional pinned SDK/binding update, then review the generated runtime types and all ACP-backed providers. The Grok checks validate the checked-in source-route extraction, artifact hashes, reviewed release/build identity, and admitted profile; they do not contact a live provider. Do not use the capture or probe commands as routine generation or release gates.

The sidecar can be built and checked independently:

env -u NODE_ENV npm run build:sidecar
env -u NODE_ENV npm run check:sidecar-build-repeatability
env -u NODE_ENV npm run build:pi-sandbox-worker
env -u NODE_ENV npm run check:pi-sandbox-worker-build-repeatability
env -u NODE_ENV npm run build:claude-runtime-worker
env -u NODE_ENV npm run check:claude-runtime-worker-build-repeatability
env -u NODE_ENV npm run build:antigravity-history-worker
env -u NODE_ENV npm run check:antigravity-history-worker-build-repeatability

A source development server configured for the managed SSH sidecar requires an existing valid dist/sidecar/manifest.json. A normal production build creates it. The Pi sandbox worker is likewise a pinned, self-contained artifact; its repeatability check rebuilds it twice and verifies identical bytes, manifest, digest, size, and restrictive modes. The standard production build gate runs that check before cleaning and creating the final build outputs.

Antigravity's native-history worker is also required for local source runs. npm run dev, npm test, and the production build prepare it automatically. After changing its reader or build helper, rebuild the worker before invoking individual tests directly. Sidecars embed the same verified worker artifact.

Remote terminal assets require the matching architecture, Node ABI, and glibc profile. Follow Sidecar native builds to build and verify portable Linux PTY assets; incompatible terminal assets must leave management, Files, and provider connections independently available.

Local Claude targets launch the separate provider-private dist/claude-runtime-worker artifact; its repeatability check also audits the bundle's provider-owned source boundary. SSH Claude targets use the persistent sidecar build, which embeds the same source-audited worker and manifest beside the backend-private runtime host. They do not launch the local worker over an attachment-owned SSH subprocess.

Specialized deterministic gates

Principal Tool client changes require the repository/service credential, scope/race, HTTP, CLI, normalized provenance, and Settings component tests. When the UI or CLI surface changes, also run the production-built CLI integration and the agent-tool-policy.spec.ts browser job. Credential visual artifacts must remain masked; inspect desktop/narrow screenshots and scan the run directory for issued hatc1_ values rather than relying only on DOM assertions. Management/provenance DTO changes require one deliberate browser protocol advance with strict old-version rejection, never a dual parser.

Database migrations for Tool client policy/verifiers and immutable initiating client provenance are one-way. Migration tests must exercise direct database invariants, wrong tenant/principal denial, expected-revision races, verifier generation changes, and backup/rollback expectations. Thread-reference restart coverage must close and reconstruct production composition rather than merely replace one authority object.

npm run test:c5c-production-lifecycle builds and exercises production-shaped shutdown/restart, external UDS/TCP survival, unavailable-target isolation, and owned-stdio process-group/native-lock ordering. It currently requires Linux x64, procfs, and a compatible operator-installed Codex command.

The OpenCode v2 qualification suite uses an explicitly selected supported stable opencode2 binary (minimum 2.3.0, tested through 2.3.0) with disposable configuration/storage and loopback model/MCP fixtures. Its page-preview image qualification uses the pinned Playwright Chromium installed for browser tests, with the production preview sandbox enabled; it does not require an operator-owned Sedes preview-browser installation. Run npx playwright install chromium first and use a host that supports sandboxed Chromium. It never uses a native account or external inference. It is excluded from ordinary npm test and self-gates before launching the binary. Build Sedes first: the production-carrier and MCP bridge checks execute its compiled ownership and CLI helpers.

env -u NODE_ENV npm run build
SEDES_RUN_REAL_OPENCODE=1 \
  SEDES_REAL_OPENCODE_EXECUTABLE=/absolute/path/to/opencode2 \
  env -u NODE_ENV npm run test:real-opencode

The process fixtures require Linux procfs to identify and clean up marked descendants, including children in detached process groups. Run this opt-in suite on a host with visible process ancestry and without concurrently starting non-dumpable same-account processes (such as SSH agents or control masters) whose ownership cannot be excluded. Hidden procfs ancestry or an ambiguous unreadable process makes cleanup unproved and retains the isolated native directory for inspection. The detached-child cleanup regression belongs to this same opt-in suite; ordinary npm test performs no such machine-wide scan. The suite combines native characterization with production adapter qualification. Characterization includes reproducing missing idle filtering, MCP catalog readiness races, and synthetic credential environment exposure. Production checks exercise native codecs, resident ownership, history, delivery, mutation recovery, MCP ingress, scoped shell environments, images, compaction and usage. The fixture records the actual admitted executable version. Qualify both the minimum and tested-through releases when updating the SDK/profile or runtime policy. These loopback fixtures do not qualify authenticated external model providers. The production-carrier job uses built provider/sidecar artifacts and covers local, actual OpenSSH and paired outbound connections in both ownership modes. Build first; its SSH cells require an executable /usr/sbin/sshd plus ssh and ssh-keygen. Fixtures use disposable account homes, host-local password files and native stores. Main-side native identity and password resolvers are denied during remote cases so sharing a test-machine UID cannot conceal incorrect main-side native access. See the OpenCode operator guide.

After client, Capacitor dependency/configuration, or native Android changes, run:

env -u NODE_ENV npm run android:verify

That requires JDK 21 plus Android SDK Platform 36. See Android for the exact native-project and device boundaries. Electron platform, packaging, or shared-client changes also require:

env -u NODE_ENV npm run electron:verify

That command syncs the exact built frontend, packages the current-host application and Local server runtime, inspects its content/native-module boundary, and runs the actual unpacked application outside the source tree under Xvfb. The smoke covers Local health/session validation and cleanup plus Electron HTTP/SSE/WS, managed SSH, switching/rollback, and native file download. See Electron for the platform and release-artifact contract.

Live-provider suites

Do not run commands matching test:real-pi*, test:real-codex*, test:real-claude*, test:real-grok*, test:live-pi-native, test:live-opencode, or test:live-antigravity by default. They consume live provider capacity or exercise authenticated external state and require explicit user authorization for the relevant backend change. The test:real-pi-native offline exception is described below; it makes no authenticated provider requests.

The native Pi qualification suite launches an explicitly selected stock Pi stable >=1.4.0 executable with disposable HOME, agent, session, and workspace directories. It uses loopback model/MCP fixtures and passes no operator credentials or ambient provider configuration to the child. It exercises the production owned process host and normalized conversation driver, including native skills, code mode, nested tool policy, native MCP approvals, scoped Sedes tools, interruption, resume, detached history, and inclusive fork boundaries. It also builds the release sidecar bundle and verifies a running native session survives replacement of its framed carrier. Session-file interoperability checks use the same stock installation and the embedded SDK without calling providers. It is excluded from ordinary npm test and does not replace live provider gates:

SEDES_REAL_PI_NATIVE_EXECUTABLE=/absolute/path/to/pi \
  env -u NODE_ENV npm run test:real-pi-native

OpenCode's authenticated gate is separate from both npm test and the entirely local test:real-opencode suite. After authorization, select an exact reviewed OpenAI-compatible provider endpoint/model and the name of an existing credential environment variable. The command below contains no credential value:

SEDES_RUN_LIVE_OPENCODE=1 \
  SEDES_REAL_OPENCODE_EXECUTABLE=/absolute/path/to/opencode2 \
  SEDES_LIVE_OPENCODE_MODEL_ID=exact-model-id \
  SEDES_LIVE_OPENCODE_BASE_URL=https://provider.example/v1 \
  SEDES_LIVE_OPENCODE_API_KEY_ENV=MY_PROVIDER_API_KEY \
  env -u NODE_ENV npm run test:live-opencode

The OpenCode 2.3.0 profile records the stock 2.3.0 loopback qualification, the incompatible 2.2.6 global event and the authorized AW Qwen read-only canary runs on 2026-11-27. The 2.2.6 profile records the previous canary pass on 2026-11-08. Historical 2.1.1 results remain intermittent: three attempts produced one two-model-step guard stop and two passes under unchanged limits. No finish diagnostic was retained for the first attempt; its cause was not established. These bounded results do not establish general live-provider reliability.

The endpoint must use HTTPS without embedded credentials, query or fragment. The native provider ID is fixed to sedes-live-gate, so stock built-in provider plugins cannot substitute another transport or reshape the rehearsed request. Set SEDES_LIVE_OPENCODE_TOKEN_FIELD to max_completion_tokens if that endpoint requires it; the default is max_tokens. For the AW Qwen endpoint, set SEDES_LIVE_OPENCODE_REASONING_FORMAT=chat-template to send its explicit low-reasoning chat-template settings. No provider or model is auto-selected. The gate places a 256-token limit in the actual request body, with a 16 KiB observed text limit, two logical model steps, a 45-second total runner deadline including setup, and native 20-second request/10-second chunk timeouts. A synchronous check refuses to submit if setup exhausted that deadline. The test harness reserves additional time for bounded native startup settlement and independent cleanup after cancellation. The native runtime can retry transient failures internally; the first observed retry fails the gate and requests Stop. The gate checks parsed events before closing its observation and settles that monitor before success; the local cutoff cannot prove that every server-side retry was observed. These are exposure limits, not a guaranteed monetary cap: interrupted or retried remote requests can still be billed, and endpoint token limit behavior remains provider-specific.

The gate starts an isolated Sedes-owned stock daemon, configuration, HOME/XDG directories, native store and session. Only the explicitly referenced credential is copied into its process environment; the operator's native account/configuration is not used. This has the ordinary same-account process-environment trust boundary. Native permissions deny everything except reading one disposable canary file. Automatic title/compaction work is suppressed. The gate submits once, reconciles that same operation if necessary, and requires exact consumed-input evidence, successful canary read, matching completed turn, and stable history after reattach. It attempts runtime shutdown even if handle/observation cleanup fails, closes SQLite independently, and retains native state if process cleanup is unproved.

tests/real-opencode/live-gate-rehearsal.test.ts exercises this same runner with a loopback model: it checks exclusive wire token-limit fields, canary content in the model's tool result after the allowed read, and a denied read outside the canary path without external inference. This rehearsal does not qualify a real provider or its billing behavior.

The Antigravity qualification instructions cover the separate stock CLI gate, test:live-antigravity, and its optional loopback SSH case. The suite builds the production application before testing against disposable native conversations.

When a backend-specific change affects protocol handling, streaming, history, lifecycle, tools, interactions, or provider integration, ask whether to run the relevant live suite. The main Pi gate is self-limiting: it refuses to prompt until exactly one authenticated AW Qwen aw-qwen-3-8-27b/aw-qwen-3-8-27b provider/model pair is available at low reasoning with read-only tools. Do not weaken the gate, substitute a model, or point it at an existing session.

env -u NODE_ENV npm run test:real-pi

The CLI-specific Pi gate also requires the explicit test opt-in:

SEDES_RUN_REAL_PI_CLI=1 env -u NODE_ENV npm run test:real-pi-cli

The separate native Pi live gate uses stock stable Pi >=1.4.0 through the production owned host and driver. It requires the same exact authenticated AW Qwen model, verifies low reasoning and the read-only tool set before prompting, and checks code-mode reads plus detach/resume. Its temporary agent directory references the native models.json and auth.json files without copying credentials; operator extensions, MCP servers, settings, and existing sessions are not loaded. Run only after explicit authorization:

SEDES_RUN_LIVE_PI_NATIVE=1 \
  SEDES_LIVE_PI_NATIVE_EXECUTABLE=/absolute/path/to/pi \
  env -u NODE_ENV npm run test:live-pi-native

Codex live scripts include private fixture coverage and optional authenticated sub-gates, but repository policy still treats the entire test:real-codex* family as opt-in. Some create disposable provider threads and archive only the exact native ID they created. Never point a live gate at an existing user thread or weaken its model/settings safety checks.

Important opt-ins include:

  • SEDES_RUN_REAL_CODEX_AGENT_TOOLS=1 for the generated CLI skill exercise and both Native MCP modes, where codex exec receives the same mcp_servers.sedes entry Sedes sends in thread config and calls a real Sedes listener;
  • an absolute SEDES_REAL_CODEX_UDS_SOCKET together with SEDES_REAL_CODEX_UDS_MODEL=gpt-5.6-luna for an operator socket;
  • an absolute SEDES_REAL_CODEX_TUI_HOME for a disposable authenticated managed-TUI thread; and
  • SEDES_REAL_CODEX_SSH_HOST, canonical absolute SEDES_REAL_CODEX_SSH_UDS_SOCKET and SEDES_REAL_CODEX_SSH_WORKSPACE, plus SEDES_REAL_CODEX_SSH_MODEL=gpt-5.6-luna for SSH UDS.

If a container prevents Codex from cleaning its own stale arg0 temporary directories, the CLI skill test can opt in to SEDES_ALLOW_CODEX_ARG0_CLEANUP_WARNING=1. This permits only the exact stderr line WARNING: failed to clean up stale arg0 temp dirs: Permission denied (os error 13) and reports when it was ignored. Strict stderr checking remains the default; all other diagnostics, process exit status, command sequencing, source identity, HTTP calls, and result assertions remain enforced. This test-only setting neither changes Codex permissions nor repairs its temporary files.

The persistent-runtime canary uses a disposable bundled sidecar around an existing authenticated UDS provider. It creates one Luna-low, read-only thread, disconnects during streaming, reopens the application receipt database, and verifies the same runtime, durable outcome recovery, and complete native history:

SEDES_REAL_CODEX_PERSISTENT=1 \
SEDES_REAL_CODEX_UDS_SOCKET=/canonical/absolute/path/to/codex.sock \
SEDES_REAL_CODEX_UDS_MODEL=gpt-5.6-luna \
  env -u NODE_ENV npm run test:real-codex -- \
  -t "retains a real Luna turn"

It stops its disposable sidecar and unsubscribes its new thread, leaving the native thread retained. It never stops the shared app-server. The outer carrier is local Unix, so this live canary does not qualify actual SSH networking; controlled OpenSSH integration tests cover that carrier separately.

The live execution-settings test uses disposable OpenSSH and a packaged sidecar. It adds the first Claude backend during a streaming Luna-low turn and sends one Haiku 5.5-low prompt through the new backend. It checks both responses and the original sidecar incarnation and controller epoch. This gate uses authenticated capacity and leaves the new native conversations in their provider stores. Run it with permission for both providers.

env -u NODE_ENV \
  SEDES_LIVE_EXECUTION_SETTINGS=1 \
  SEDES_REAL_CODEX_UDS_SOCKET=/canonical/absolute/path/to/codex.sock \
  SEDES_REAL_CODEX_UDS_MODEL=gpt-5.6-luna \
  SEDES_REAL_CLAUDE_EXECUTABLE=/absolute/path/to/claude \
  SEDES_REAL_CLAUDE_CONFIG_DIRECTORY=/absolute/provider-home \
  npm test -- tests/integration/outbound-production-composition.test.ts -t 'authenticated Luna streams'

The generated-image canary is a further opt-in inside the Codex live suite. It requires the approved shared UDS endpoint and exact Luna model, asks the live provider to generate one image, and exercises the normalized artifact path:

SEDES_REAL_CODEX_GENERATED_IMAGE=1 \
SEDES_REAL_CODEX_UDS_SOCKET=/canonical/absolute/path/to/codex.sock \
SEDES_REAL_CODEX_UDS_MODEL=gpt-5.6-luna \
  env -u NODE_ENV npm run test:real-codex -- \
  -t "publishes one real generated image"

This consumes authenticated model and image-generation capacity. It creates a non-ephemeral native Codex thread, unsubscribes from it, and leaves it retained; it does not archive or delete the provider thread. Run it only with explicit authorization that includes that retained-session and capacity impact.

If a relevant live suite is not run, say so explicitly in the handoff and do not imply that the backend was live-verified.

The Claude gate uses the externally authenticated subscription and makes a real model request only after its exact executable, account, model, effort, and tool-safety preflight succeeds:

SEDES_REAL_CLAUDE_EXECUTABLE=/absolute/path/to/claude \
SEDES_REAL_CLAUDE_CONFIG_DIRECTORY=/absolute/provider-home \
  env -u NODE_ENV npm run test:real-claude

It requires a logged-in first-party claude.ai subscription with a nonempty subscription type and no API-key override, exactly one claude-haiku-5-5/low catalog entry, dontAsk, an empty tool list, and no MCP servers. It creates two disposable provider sessions and retains their native history. The Native MCP file adds a third: the production ClaudeSdkSession with no built-in tools, strict MCP configuration, and only the thread's sedes server, in default permission mode approving only mcp__sedes__* calls. It verifies the server connects, the reference stays out of the CLI arguments, and one Individual tool call round-trips through a real Sedes listener. The native-history file pins the currently available claude-haiku-5-5/low entry with the same subscription checks; its detached-history case allows no tools and verifies that reading a closed session creates no query and leaves the native transcript unchanged. The driver test covers reopen; the managed-worker test completes an active turn while the main client is detached, then reattaches without resubmitting. That test uses real worker stdio with local framed sockets standing in for the SSH carrier; it does not verify a remote SSH server or login.

That bounded live gate verifies text streaming, persistence, usage, and reopen; it deliberately does not claim live coverage for native image input, semantic tool projection, subagents, skills, or manual compaction. Those paths use deterministic official-SDK-shaped unit, integration, and browser fixtures. A separately reviewed, capacity-bounded live canary still requires explicit authorization.

To qualify the account usage control on its own, set SEDES_REAL_CLAUDE_ACCOUNT_USAGE=1 and run env -u NODE_ENV npm run test:real-claude -- tests/real-claude/claude-account-usage.test.ts. It checks the subscription windows and confirms that the CLI received zero model inputs and reported zero API time and cost.

The focused claude-manual-compaction-live.test.ts gate separately requires SEDES_REAL_CLAUDE=1, subscription authentication, and exactly claude-haiku-5-5 with low effort. It disables tools, MCP servers, hooks, plugins, and setting sources; bounds the session budget and duration; and verifies manual compaction, a following prompt, and native resume. It retains the disposable native history. This is distinct from claude-compaction-native.test.ts, which verifies the SDK and CLI against an isolated loopback API without authenticated provider capacity.

The Grok gate uses the production owned-stdio runtime, curated child environment, native HOME/GROK_HOME account state, and cached-token authentication. The lifecycle canary selects and verifies the catalog default, exercises unrestricted tools, subagents, cancellation, restart recovery, and authoritative replay in a disposable workspace. A separate focused attachment test submits one deterministic PNG plus one staged text-file resource link and checks both an image-sensitive response and the exact file canary. Neither test deletes the retained native session. Both consume authenticated provider capacity and remain explicitly opt-in.

SEDES_REAL_GROK=1 \
  SEDES_REAL_GROK_EXECUTABLE=/canonical/absolute/path/to/grok \
  env -u NODE_ENV npm run test:real-grok

Append -- tests/real-grok/grok-image-input.test.ts to run only the focused user-attachment regression.

Grok generated-image output has a separate double gate. It asks the live provider to call ImageGen, reads the resulting local JPEG through the exact native-session authority, and verifies normalized artifact publication:

SEDES_REAL_GROK=1 \
SEDES_REAL_GROK_GENERATED_IMAGE=1 \
SEDES_REAL_GROK_EXECUTABLE=/canonical/absolute/path/to/grok \
  env -u NODE_ENV npm run test:real-grok -- \
  tests/real-grok/grok-generated-image-output.test.ts

This consumes authenticated model, tool, and image-generation capacity. It closes the active session after the assertion but does not delete the retained native Grok session. Authorization must cover both the capacity use and the retained provider state.

Live installation helpers

The live streaming smoke and thread measurement scripts are operational tools, not deterministic test fixtures. measure:thread is read-only; test:smoke-live-streaming creates and sends a real thread and does not clean it up. Their safe use is documented in Operations.

Backend-facing changes

Before changing a backend-facing or cross-cutting contract, follow Backend integration rules. Audit all seven compiled backends—Pi SDK, native Pi, Codex, Claude, Grok, OpenCode, and Antigravity—preserve provider-private protocols, update truthful capabilities, and test both implemented and intentionally unsupported paths.