docs/tests.md
Tests
Run commands from the repository root. The justfile owns recurring commands; the documentation index routes to code and contract owners. Choose coverage before running it.
Commands
| Command | Coverage |
|---|---|
just test-go-package PACKAGE *ARGS | One Go package or package pattern, with optional Go test flags |
just test-go *ARGS | Default Go coverage: non-AgentHub root packages and the nested module, with Go's normal result cache |
just test-go-fresh | Same non-AgentHub Go coverage with -count=1 for deliberate fresh execution |
just test-go-agenthub *ARGS | AgentHub-owned Go packages only |
just test-go-all *ARGS | Complete root and nested Go coverage, including AgentHub |
just test-ruby-source | Ruby source tests using an existing bundled interpreter |
just test-dist | Isolated Linux distribution archive and installer fixtures |
just test-agenthub-fixtures | Independent AgentHub literal checks |
just test-agenthub-e2e | Shipped Hub process tests using isolated fixtures |
just test-quick | Non-AgentHub Go, Ruby source tests, Python quick cases |
just test-full-offline | Root/nested Go, Ruby source tests, AgentHub literals, all provider-free Python cases |
just test | Full aggregate, including AgentHub literals and ordinary configured-model Python cases |
just test-llm | Provider-dependent Python cases, with live OpenAI separately opt-in |
just test-remote-muse-live | Opt-in real local then AF_UNIX-relayed Muse Spark responses, using existing built artifacts |
just test-remote-claude-live | Opt-in real two-daemon Claude acceptance with consumer tools/plugins, user/tool PDFs and warm continuation, using existing built artifacts |
just test-claude-native-live | Opt-in Haiku structured-interface checks with the shared MCP proxy and a fake host |
just test-claude-catalog-live | Opt-in installed Claude model listing through the built bridge, without inference |
just test-claude-restore-native | Opt-in installed-native transcript loading and cleanup under private login-free roots, without a user prompt or inference |
just test-claude-entrypoint-native | Opt-in installed-native request attribution against a local fake API under private roots, with a dummy key and no Anthropic inference |
just test-claude-bridge-live | Opt-in bounded Haiku bridge catalog/usage, cold signed-history restoration and loaded-Agent end-to-end cases, using the built Claude bridge |
just test-claude-media-live | Only the bounded Haiku user/tool image/PDF, held-tool media steer and warm-media journey, using the built Claude bridge |
*ARGS means optional arguments, not a literal argument. Go recipes do not build
shipped binaries. Aggregate and ordinary LLM recipes build first. The Muse live
recipe never builds. The Ruby source recipe
requires the bundled interpreter to have been built.
Use test-go or test-quick for unrelated development. AgentHub-owned Go
packages are internal/agenthub/..., cmd/ez-agent-hub/...,
internal/hubfeature/... and pkg/ezhubapi/.... They remain in place and run
through test-go-agenthub; shared CLI, frontend and TUI regressions stay in the
default set. Run the Hub scope when changing those packages or shared code
whose behavior affects Hub TLS, transport, storage or lifecycle. A focused
test-go-package selection is still appropriate while editing.
test-go-all, test-full-offline and test explicitly include AgentHub. Do not
use those full-repository checks for unrelated work unless that coverage is
requested. test-full-offline includes the Go, Ruby and Python quick coverage;
do not precede it with another Go aggregate or follow it with an E2E suite it
already contains. Ordinary just test also includes configured-model tests;
test-llm selects only Python llm cases, not Go/Ruby unit tests. Live OpenAI
remains separately opt-in.
Arguments to test, test-quick, test-full-offline and test-llm go to Python,
not Go. A leading suite, path or node selector runs only that Python scope after
building. A leading option such as -k retains the aggregate language stages.
Friendly aliases live in tests/run_tests.py.
| 1 | just test-full-offline protocol |
| 2 | just test-full-offline tests/suites/test_builtin.py::TestBuiltinSubprocess::test_hello_and_announce_on_startup |
| 3 | just test-llm plugin-queries::test_leaf_stats_and_history_after_one_prompt --model=ollama/YOUR_MODEL |
Offline recipes pass --no-llm and cannot execute provider-dependent cases.
Run online or LLM-dependent tests only when the user explicitly requests them.
just vet includes native vet and maintained AgentHub/frontend cross-platform
compile and vet checks. Cross-compilation does not establish runtime coverage.
The nested cd ez-agent-ruby && just test remains available for source-lock and
toolchain-cache shell checks as well as Go packages. Repository aggregates invoke
nested Go unit tests directly. A new Ruby runtime tree may run
ez-agent-ruby/runtime/profile-test.sh during its build; the quick recipe adds
neither another profile nor a forced cold rebuild.
Live Muse local and relay acceptance
just test-remote-muse-live makes four completions with muse-spark-1.3 at
minimal thinking. Each local and relayed leaf answers an initial prompt, then
handles a separate background-completion steer on the same loaded leaf. It does
not use a fake provider or treat discovery as a completion. Run it only with
explicit permission to spend those four live completions.
Ordinary test runs skip this case unless --live-muse is supplied; --no-llm
still skips it even with that flag.
Prerequisites are Linux, Python test dependencies, the built client, service,
builtin and Muse bridge in build/, and the official installed Muse launcher
at /home/developer/.local/bin/muse with an existing native login entitled to
Muse Spark 1.3. The launcher must already have its native binary installed.
Acceptance never runs login, installs or updates Muse, or reads/copies an auth
file. Before launching anything, it reads only the official installation's
non-secret .muse-version metadata beside the resolved launcher and checks the
selected executable muse-bin-<version>. Missing/invalid metadata and missing
or non-executable payloads fail with their paths. Login/entitlement and network
availability are established only by the real completions, not a preflight
catalog. A missing prerequisite is a blocked acceptance, not a mock pass.
| 1 | just test-remote-muse-live |
| 2 | # Override only when the official installation or its native config is elsewhere: |
| 3 | just test-remote-muse-live --muse-command=/absolute/path/to/muse --muse-native-config-home=/home/USER/.config |
| 4 | # Offline checks for the acceptance flow, without rebuilding or contacting Muse: |
| 5 | python3 tests/run_tests.py remote-muse-fixture --no-llm |
| 6 | python3 tests/run_tests.py remote-providers --no-llm |
The test creates two fresh EzAgent configs, with separate config/state/runtime
directories and no LLM credentials supplied to either daemon. Builtin startup
may create its normal empty auth template. Only the host's isolated config
directory contains a muse symlink to the existing native configuration,
defaulting to ~/.config/muse. A host-only wrapper records native process
ownership without changing XDG directories. It does not restore the running
EzAgent configuration, runtime or state.
The host uses the real built bridge and exports muse/muse-spark-1.3; the consumer
saves only host/muse/muse-spark-1.3 and the host's isolated AF_UNIX socket.
Each completion must persist its unique requested token and the selected model
identity. The real bridge additionally requires native session/start to report
the requested model ID. The test checks consumer-owned roots, parent/tip turns,
one leaf per daemon, unchanged host history after relay use, and unchanged saved
selections. A registered background owner retains each leaf between executions;
the second completion comes through the normal finalized steer path. Exactly
one native process per leaf must handle both completions. It disables offered
tools/plugins and uses _suppress_auto_title.
Both daemons stop through the isolated built client on success or failure. Native
process-group termination stays with the bridge, which owns its native child
until it signals and reaps it. The wrapper's historical group numbers support
only an independent disappearance check. A still-present group fails the test;
the harness never sends a destructive signal based on a historical PID record.
No live-orchestrator client or stop is used.
On completion failure, pytest reports terminal frames and stored error-turn text
before deleting temporary state. Use that reported evidence, not paths into the
deleted temporary database. A native session-start failure can mean the existing
login cannot access the requested model. Missing installed-payload prerequisites
are reported separately before any daemon or native process starts.
Do not respond by copying credentials into the consumer or by retrying login in
the test. Remote unavailable flags point to socket/export discovery; confirm
the host config has remote_eligible: true and the socket points at the isolated
host. There are no automatic completion retries. Fix the prerequisite before
deliberately rerunning the two-request acceptance.
Claude bridge integration
just build-claude-bridge builds only the Claude executable in build/.
just test-claude-catalog-live uses that artifact and installed Claude to read
the native initialization catalog through the external discovery parser. It
isolates all three XDG roots, sends no user input, disables native session
persistence and checks that the bridge advertises only supported settings without
inventing token ceilings. It neither tests entitlement nor spends inference usage.
Offline internal/claudebridge tests cover controlled initialization replies,
aliases, omitted/malformed metadata, catalog bounds and cancellation/reaping.
just test-claude-bridge-live requires that artifact and explicitly spends the
provided claude-haiku-5-5 subscription. It does not build or run an aggregate.
The adapter case covers cumulative per-API usage and warm tool additions,
removals and schema updates while an old result is held. The loaded-Agent cases
use real storage, normal finalization and tool admission to cover text/thinking,
processed results, idle continuation, native restart, independent checkpoint
forks, lost-session readable recovery, held-tool cancellation and user steers
accepted while a host tool is blocked. The steer regression checks native
priority-next input, preserved input order and one host execution. Offline native
fixtures also complete a tool message and then exit or report failure before
opening its MCP handler, proving prompt failure without host dispatch.
just test-claude-media-live selects only the attachment journey. It runs through
real Agent storage, FiletypeGate and the built bridge at Haiku high thinking.
Small deterministic PNG/PDF fixtures check fresh user media, a steer while the
tool is held, finalized tool image/PDF results and a new attachment-bearing warm
prompt on the same owner. PDF markers appear only inside their bytes, not prompt
labels. The tool ID remains the original native ID and the host runs it once.
Offline tests cover mixed text/image/PDF order and metadata, labeled recovery
ownership, checkpoint suffix-only media, malformed/unsupported inline data,
FiletypeGate warnings and Muse's unchanged MCP text default. Loaded-owner gate
transition regressions cover enabling/disabling images or PDFs after idle and
while a result is held. They require successful newly gated recovery, preserved
tool-result IDs/media, one host execution and no restart for equivalent settings.
Native documents in
tool results use the supported owned PostToolUse replacement, not a user message.
The bounded TestClaudeBridgeErrorMediaLive case checks the distinct MCP error
path. Claude 2.1.322 omits that media and does not call PostToolUse. The bridge
must report the limitation and retain no unconsumable replacement, while the
canonical result and error flag remain intact. Offline cases cover accumulated
media above the former installed-history limit, recovery with that history,
documented encoded image-size accounting, no invented image-count/PDF ceiling,
and unchanged direct Anthropic acceptance. These are controlled data checks, not
live capacity stress or proof of a native maximum.
These cases preserve the installed native login. They isolate XDG directories,
use private temporary projects and record only owned CWD/launch-flag names, not
prompts, stderr, transcripts, tool data or credentials. Cleanup stops owned
children and invokes official claude purge for those exact temporary projects.
Ordinary Go runs skip live inference. Deterministic fixtures cover private-only
and redacted messages, split records, serial tool blocks, malformed associations,
post-boundary crashes, result matching and interrupt/drain. The socket relay also
has an offline native-transport check.
Two-service Claude acceptance
just test-remote-claude-live runs only the bounded real service-to-service case
in tests/suites/test_remote_claude_live.py. It requires existing service, client,
builtin and Claude bridge artifacts plus the official claude on PATH and an
existing native login. It neither builds nor runs a local-host completion first.
Only the host configures and exports the Claude provider. The consumer has only
the remote provider, a new empty HOME, no native state link, and a controlled PATH
where neither Claude nor the bridge resolves. Each daemon has
separate XDG config, state and runtime roots; only the host links its Claude
application state to the existing native directory. No auth files are read or
copied by the test.
The consumer discovers and selects the exported Haiku model at high thinking. A normal consumer capability peer executes one deterministic offered tool. Its plugin replaces the raw result with a unique finalized receipt, which must reach the real hosted model. Small user and tool PDFs come from the same fixture generator as the Go attachment checks. The test requires real text/thinking stream events, consumer-side assistant/native/history persistence, exact native tool/result association and the expected source-route tag. A generic background owner keeps the leaf loaded for a second prompt with a new token. One bridge launch, one native launch and one native session prove healthy warm continuation. The host's conversation database must remain unchanged, and a same-name host tool must never run. The capability IPC call ID and native tool-use ID are checked at their respective boundaries, not equated.
Both isolated daemons stop through the standard fixture. Claude's owned native
group and the bridge's PID are checked separately with read-only probes. Only
after both retire and daemon teardown succeeds does official claude purge
remove the recorded test project. A failed retirement/teardown check skips purge.
Offline fixtures inject native-group, bridge-PID and daemon teardown failures to
cover that ordering. This tests the existing
trusted AF_UNIX provider relay, not SSH, remote onboarding or a native feature
matrix. --live-claude is mandatory, and --no-llm still overrides it. The
remote-claude-fixture suite checks that opt-in guard and the real two-daemon
capability setup without inference.
Claude native interface checks
just test-claude-native-live uses the official claude on PATH, its existing
subscription setup, and claude-haiku-5-5. Run it only with explicit permission
for live inference. It does not build or launch an EzAgent daemon. Default
internal/claudebridge tests use a controlled native child and never infer.
The bounded live cases cover structured controls, native thinking capture, pre-tool IDs and serialized MCP calls, completed-record/stream ordering, warm input, checkpoint forks and source-session resume. They check finalized MCP results rather than exact final-answer wording. High adaptive thinking may omit thinking on a trivial tool prompt; a short reasoning follow-up checks signed capture when needed. Rare redacted blocks and error/race cases use fakes.
The fixture isolates all three XDG directories and a fresh workspace, retains
the installed native login without reading credentials, and reproduces the
installed state link. Native transcripts can still live outside XDG. After the
exact children stop, claude purge removes only the owned temporary project's
native data. See native bridge ownership and mapping.
Focused checks
During implementation, test the changed behavior and relevant callers. Select named regressions or the owning package rather than running every aggregate. For example, dispatcher changes can use these alternative selections:
| 1 | just test-go-package ./internal/agenthub/peer -run '^TestTypedDispatchDuplicateAndAbandonedInboxes$' |
| 2 | just test-go-package ./internal/agenthub/peer -race -run '^TestTypedDispatch' |
Use focused race coverage for changed concurrent ownership, cancellation or
shutdown. Broader race and maximum-capacity runs need an assigned owner and a
specific uncovered risk. Do not self-assign them as completion gates.
When Go tests build helper processes separately, parent -race alone does not
instrument those helpers. Follow the fixture's instrumentation support.
For Python-only feedback with current binaries already in build/, avoid an
unnecessary aggregate rebuild:
| 1 | python3 tests/run_tests.py protocol --no-llm |
python3 tests/run_tests.py cwd-activity --no-llm covers cwd summary alignment,
temporary/empty-leaf exclusion, empty-root startup cleanup, persisted unloaded
status after restart, and running/background/idle projection convergence
through shipped daemon sockets. Running work uses the controlled local provider
from the background suite, not an online model. Assertions poll the asynchronous
projection with bounded deadlines rather than treating acknowledgements as a
publication barrier.
Keep durable regressions for supported behavior. Test verification, persistence,
security and lifecycle guarantees at meaningful boundaries; do not mock the
behavior under assertion. Controlled fakes can supply dependencies, clocks,
transport results and failures while the real wrapper or API logic runs. Test
our policy and ownership rules rather than repeating the TLS library's own
coverage. Keep focused real-TLS tests for role wiring, certificate-disclosure
ordering and authenticated shutdown; shared connection machinery should not
require a separate full integration matrix for every caller.
Remove one-off probes after investigation. Keep tests
and their data with code, not under docs/. Review skill prose as documentation,
not as wording to freeze in tests.
In multi-agent work, assign one owner for each validation scope. Implementers
report focused commands, results and untested scope. Reviewers reuse those
results and check missing coverage rather than repeating the same tests.
At merge review, the integration owner runs the authoritative just build and
one selected offline aggregate after assembly and review. Standalone contributors
own that integration step; finishing an editing task needs focused checks, not
a separate aggregate. If integration finds a regression, fix it with spot tests
before the integration owner reruns the necessary validation.
Documentation-only edits need relevant content/link checks. Rebuild when validating embedded resources.
Cache and timing
Keep recurring commands and flags consistent so Go can reuse passing results.
Do not add -count=1 or repetition counts by default. Use fresh execution
deliberately for reproduction, timing or flake investigation, either on a
focused selection or through just test-go-fresh for an assigned Go aggregate.
For deliberate fresh AgentHub or complete Go measurements, use
just test-go-agenthub -count=1 or just test-go-all -count=1. These commands
disable test-result caching, not Go's build cache.
Reuse a result only when its tested source, helpers and relevant environment are unchanged. Failed packages, changed test binaries and different selections need new results. A cached pass is useful regression evidence, not fresh timing or flake evidence. Report the command, source revision, relevant environment, result and any coverage excluded from the selection.
Routine repeat validation should fit within ten minutes, including necessary build and focused race work. This is a budget, not a claim that current commands already meet it. An all-cached pass or renaming a slow run does not demonstrate that budget. Reduce duplicate setup and obsolete coverage while preserving distinct TLS/security, persistence and lifecycle assertions.
The Go recipes use EZ_AGENT_GO_TEST_TIMEOUT, defaulting to 30m per package.
That is a failure bound, not a whole-command runtime guarantee or an extension
of production deadlines. Aggregate arguments cannot set Go flags; use the
environment variable for their Go package timeout. Focused Go recipes accept an
explicit -timeout override.
AgentHub fixtures
Executable fixtures and literals live under
internal/agenthub/testdata. Run
just test-agenthub-fixtures for their independent checks. These fixtures use
public deterministic test material, not user credentials.
| Corpus | Owner and scope |
|---|---|
| trust | Identity, signed records, pairing, invitations, TLS exporters, storage, gateway, configuration and application literals |
| private | Private administration vectors, configuration and accounting checks |
| circuit | Bootstrap, DATA/ACK, fixed-session and recovery literals |
| carrier | Endpoint envelopes and restricted pairing carrier literals |
| routing | Routing bytes, path selection and rejection cases |
| relay | Relay setup, attachment and control literals |
The local-control corpus is pkg/ezhubapi/testdata/control.json, consumed by pkg/ezhubapi/literal_test.go. Its contract owners are the typed library and local control.
Literal checks establish bytes and codec behavior, not production service
lifecycle or security acceptance. Package *_test.go files own runtime
regressions alongside the AgentHub packages.
AgentHub testkit owns reusable package fixtures;
process suites own shipped-process integration.
The contract inventory routes to behavior owners.
Isolation
Prefer the standard fixtures. tests/conftest.py owns
isolated daemon startup, readiness, model injection and shutdown.
tests/client.py owns the socket JSONL test client.
Package fixtures use test-owned state and join their runtime owners at cleanup.
The controlled global OnStart test checks listener availability with a real Unix
connection from its helper. Hub deployment tests separately require application
API readiness, one shipped Hub child, Hub control readiness, and application
socket creation before control socket creation. OnStart is asynchronous: those
observations need not precede fixture yield and do not prove that application
Accept ran before the child started.
The AgentHub service parallelServiceFixture helper limits concurrent fixtures
to four, including cleanup. Use it for independent fixtures, before allocating
resources and at only one test nesting level; nested acquisition can deadlock.
A table parent that only launches independent gated subtests can call
t.Parallel() without taking another fixture slot. Otherwise, Go waits for that
whole table before starting the next one, leaving fixture slots unused.
Opt-in directory and mux ownership fixtures advance a separate peer scheduling clock to recorded retry deadlines after attempt cleanup. Real TCP/TLS, directory exchange and transport deadlines remain in use; peer tests retain backoff-boundary coverage. Entry-retry pacing checks distinguish the settled NoRoute refresh from the admission deadline and wait for route publication to be consumed before comparing them; the absolute attempt timing and stale-token assertions remain enforced. Circuit recovery clock jumps likewise wait for the scheduler's absolute timer arm before advancing virtual time. Dropped-LIVE coverage requires matched PING/PONG progress without extending the original grace deadline, including eligibility one nanosecond before expiry and timeout at equality. The routing refresh/expiry fixture completes the incoming initial commit before releasing outgoing SyncEnd. This prevents an initial table notification from rearming the writer across a virtual clock jump. It still checks refresh at 20 seconds, stale replay at 59 seconds, presence at 78 seconds, and expiry at 79 seconds.
Pairing shutdown and handoff fixtures hold semantic time fixed during setup while retaining real TLS and runtime deadlines. Security-clock boundary tests own final-append refusal; lifecycle tests must reach their accepted state before cancelling it or deliberately advancing to their tested decision deadline. Accepted Add Hub outcome tests use the same semantic setup fence before testing alias-sidecar failure or expired carrier handoff. The handoff test also verifies the exact stored request and Context commit revision after carrier retirement. Pairing uncertainty fixtures likewise hold semantic setup time fixed and require the intended committed-WAL count, exactly one injected failure, and the matching Add Hub outcome before asserting freeze, shutdown and strict reopen behavior. Routed Prepared-path fixtures also prove that the injected Context refusal fired and the target accepted the exact request before cancellation or restart; a local Prepared checkpoint alone does not establish either precondition. The routed physical-loss fixture makes one Add Hub call and proves an exact unapproved Accepted checkpoint with one live held owner before closing transit. It then joins that owner and requires the durable row to remain unchanged. The forged-prefix quota fixture holds joining and target semantic setup time for one healthy Add Hub call. It requires exact unapproved Accepted evidence while both hostile channels remain live and all three connection reservations coexist. It restores semantic callbacks only after joining the healthy owner, both hostile channels and pairing capacity. TLS, runtime and handshake deadlines remain live. Outbound-only target fixtures use one Add Hub call and one semantic setup second through Context and Completion. They restore semantic callbacks after pairing owners join, preserving exact routed Q, ceremony, deadline and retention while runtime/TLS clocks stay live and no-inbound assertions remain unchanged. Post-restart and fresh-ceremony checks retain live clocks and recover the same durable request to Accepted instead of replaying Add Hub or assuming one check must persist Context. The idle/restart regression observes zero TCP accepts across both scheduler-sized windows. It then drops one explicitly requested recovery connection and verifies that the caller releases its owner and capacity without changing the stored checkpoint or approval. Subsequent exact-request checks belong to the caller, not a daemon scheduler, and must reach the expected durable phase. The day-eight active scenario also forces one failed carrier during setup and reviews both exact checkpoints before one caller-owned activation check. Only that activation commit pins semantic time; the fixture restores the live callback before the retention jump, and runtime/TLS clocks stay live throughout. A boundary regression advances wall time at append and checks that the restored clocks see it. Durable active access and preserved approvals are required before advancing to retention; the final retention-boundary and no-dial assertions remain strict. Retained-Completion success cases use production control handlers on a test-owned socket with a commit instant sampled after the approval cutoff and before retention. They do not override service, runtime or TLS clocks. A separate API-boundary regression holds the API clock through preparation, then advances it at the WAL cut for refusal or leaves it fixed for success. It requires exactly one preparation, carrier and WAL-cut entry with the original evidence. Service time advances at both validation and the WAL cut, and semantic, runtime and TLS clocks must observe both advances. The fixture starts at second 59 and reserves a security horizon covering both advances before opening the carrier, so the final TLS check does not depend on a background maintenance tick. The socket late-cancellation Completion case also fixes only the API commit instant. Before cancellation, it requires the exact request to be Active with installed access while holding its recovery owner at retirement. Reaching that gate alone does not prove Completion committed. The completed-check writer-lock test uses the same API-only clock control and requires a newer committed revision before taking the writer lock and cancelling. Its result must still report the original observed revision when cancellation prevents the final revision read. Blocked-carrier cancellation and abrupt EOF still use the service's normal control socket and live clocks.
Direct service lifecycle setup drives typed CheckPairing while joining
approval delivery is pending, as an open pairing view does. Local approval is
not proof of remote delivery. The shutdown regression refuses one target
approval append and requires status-first recovery of the stored signature,
without replaying the local approval command.
Lost-approval restart coverage requires Accepted state and a held owner before
target shutdown, then one durable local Approval and joined carrier before live
clock restoration. It observes exact-Q status followed by the original stored
signature on real recovery frames after restart, without replaying approval.
Directory-topology pairing uses one semantic commit second while keeping TLS and
runtime clocks live. Bilateral repair waits for initial carrier retirement, then
drives exact-request Completion checks until both sides are Active before waiting
for normal peer links. Only Completion setup pins joining semantic time, and it
restores the callback afterward. The repair checks preserve Q, consent, deadline
and retention across activation.
Peer-removal setup re-reviews the exact genesis, head, generation and pairing
request before a fresh decision. Only a direct typed conflict with no result
permits another attempt, not raw, wrapped or uncertain errors. The three-peer
lifecycle fixture exercises this policy through its asynchronous control-call
barrier, with one injected refusal before real removal and late-result release
on cancellation. Blocked diagnostic-consumer tests inspect and join each removal
attempt before waiting for the closure event it causes; a refused removal must
not be reported as a missing diagnostic. The sink remains blocked through
successful removal, link retirement and shutdown.
Lost-approved-result authorization recovery waits for the approval's signed
access-revision update to converge before a fresh list/select operation. The
fixture also requires the pre-approval admission snapshot to fail recheck; a live
route does not make a stale authorization snapshot usable.
Routine circuit-admission regressions use small component fixtures. They exercise configured policy, budget reservation, invocation-worker joins and relay settlement together, without repeating Hub onboarding, TLS or application roundtrips. Startup/configuration tests check that saved policy reaches those owners. Focused TLS/security and application-drain tests retain their distinct assertions. The Python-owned shipped-process journeys cover executable wiring and user-visible behavior; do not repeat that journey for every ownership case or add another end-to-end matrix for each configuration setting.
Shipped registration, invitation and approval setup can receive a definite conflict when preparation crosses a security second. The fixtures make a bounded new decision only after re-reading unchanged revision, authority and inventory; transport uncertainty, success output and other errors still fail. Composed journeys separately allow an explicitly unsent stale review to be observed afresh under the same authority. The typed process fixture applies the same rule to registration, deletion and admission-invitation creation: a direct API conflict with no result and the same revision permits a new decision only after a full unchanged status review. Each decision uses a fresh request; the intentional stale-revision rejection remains outside this helper. TUI model-command setup waits for rendered completions, not just an outgoing model-inventory request. JOIN cards are read in full and validated with the shipped parser, including its hyphenated words.
Typed peer-dispatch rejection tests join the exact link's drain signal before inspecting required-channel retirement. A remote OPEN_ERROR can arrive before the local link owner publishes draining. The unknown-setup case still requires rejection without draining.
The authenticated application maximum retains its full population behind
EZ_AGENT_MAXIMUM_CAPACITY=1. It is an explicit capacity check, not a routine
control journey repeated in the package suite.
The 2,048-circuit and 1 GiB retained-ciphertext fixtures are explicit stress profiles, not shipped defaults or fixed product maxima. Keep their meaningful transport, persistence, lifecycle and security scope rather than scaling their populations to the 524,288 logical admission default. Configurable counter tests cover global and trusted-key policy, independent adapter admission and raised positive-int64 settings. Allocation tests cover demand-grown queues, RX body and adapter charges, release and joined reuse. Registry tests cover prepaid metadata, ordered pagination and churn without maximum-sized scratch arrays. These are admitted-accounting assertions, not RSS or OOM-safety tests.
Unused-carrier tests advance the fixture's circuit clock to the TLS deadline recorded on the real carrier, rather than sleeping through the handshake bound. They still join every owner and assert released capacity. Separate handshake expiry and production-deadline cases retain real wall-clock coverage.
start_daemon waits up to 10 seconds for hello_ack with ready: true, retrying
early maintenance replies and connection failures rather than treating socket
acceptance as readiness. restart_daemon waits for the new listener to accept
connections. Both create test-specific runtime/state directories and stop their
isolated daemon cleanly.
Standalone subprocess tests use read_frame in tests/conftest.py. It reads
stdout descriptors directly and retains unread frames and partial lines across
calls, with a monotonic timeout. Do not mix it with buffered reads on the same
stdout pipe. test_subprocess_frames.py covers batching, partial lines, and EOF.
Ruby source tests use test_helper.rb
to replace XDG_CONFIG_HOME, XDG_STATE_HOME, and XDG_RUNTIME_DIR with private
temporary directories before loading the API. This applies to the source runner
and direct runs of individual test files. Children inherit those isolated paths
unless supplied their own fixture paths. Intentional API failures write tombstones
only into test state, not the caller's live audit directory. The helper drains
the shared incident recorder and removes its temporary tree on exit or failure.
The provider-free workflow service-exit test gates its Ruby history observer on
the held provider stream starting. Admission is then durably sent, so history
hydration cannot race the ready-to-sent transition. Observer failures terminate
the seed process and preserve its output in the Python failure report.
Before any manual client/service launch or ad hoc daemon test, isolate all three
of XDG_CONFIG_HOME, XDG_STATE_HOME and XDG_RUNTIME_DIR. Subagents inherit
the running orchestrator's environment. Use built binaries under build/, not
$AGENTCLI, for test launches and shutdown. Stop only the exact test daemon with
the built client under the same isolated XDG environment. Never stop the live
orchestrator or use broad pkill/killall. Use kill only for a specific
unresponsive test daemon.
Never inspect, read, copy, hash, print or probe auth files. Config helpers may
copy config.yaml and record an external auth path, but only the service's
protected auth loader accesses credentials. Test config directories use mode
0700, including under a group-writable umask. Offline fixtures use synthetic,
provider-free configuration without reading user auth.
Computer-use checks
Requested manual and agent-driven tmux cases are in Computer-use checks. Select the affected interaction; they are not an automatic coding or merge gate.
Rendered regressions live in pkg/tui; native ownership and handoff
regressions live in internal/frontend.
The AgentHub process suite provides
scripted shipped-process coverage. just test-agenthub-e2e selects it explicitly;
do not repeat it if the selected offline aggregate already ran it. Its optional
tmux captures require explicit opt-in and an owned test session.
Live OpenAI
The live suite tests the public
OpenAI Responses runtime. Ordinary just test-llm skips live_openai cases.
Selecting openai-live through the friendly runner adds --live-openai;
direct pytest use must supply that option. Run only with explicit user approval.
Repeat --live-openai-subscription-ref and --live-openai-api-ref for configured
provider/model refs. Each ref is an independent case, so a missing subscription
model does not gate paid API cases. The labels describe the intended auth route;
configure that route in config.yaml. There are no dialect selectors or fixed
model rosters.
| 1 | just test-llm openai-live --live-openai-config-home="$HOME/.config" \ |
| 2 | --live-openai-subscription-ref=openai/gpt-6-luna \ |
| 3 | --live-openai-api-ref=paid/gpt-6-luna |
These aliases and model names are examples, not required entries. Explicit refs
replace the provider fallback for their route. Without subscription refs,
--live-openai-subscription-provider defaults to openai and expands that alias
to openai/gpt-6-luna; an empty value disables it. The optional
--live-openai-api-provider uses the same model fallback. Either provider option
also accepts a full ref unchanged.
For paid API only, disable the subscription fallback and repeat API refs:
| 1 | python3 -m pytest -q tests/suites/test_openai_live_acceptance.py --live-openai \ |
| 2 | --live-openai-config-home="$HOME/.config" \ |
| 3 | --live-openai-subscription-provider= \ |
| 4 | --live-openai-api-ref=paid/gpt-6-luna \ |
| 5 | --live-openai-api-ref=paid/YOUR_OTHER_MODEL |
Repeatable --live-openai-http-ref selects refs already configured with
responses.websocket: false. The suite does not change transport settings.
For HTTP only, disable the subscription fallback and select the configured ref:
| 1 | just test-llm openai-live --live-openai-config-home="$HOME/.config" \ |
| 2 | --live-openai-subscription-provider= \ |
| 3 | --live-openai-http-ref=http-optout/gpt-6-luna |
Each case checks local model configuration before provider I/O, then exercises a
no-tool prompt, a buffer read of a harmless prepared /tmp file, and a follow-up.
The buffer prompt specifies operator="read" and the exact file:/tmp/... name.
A successful durable result is required, not an exact number of retries or calls.
WebSocket cases require full initial context, incremental continuation on the
same socket, and full context after daemon restart. Configured HTTP optouts
require HTTP before and after restart. Checks use secret-free transport telemetry.
--live-openai-config-home selects the source XDG config home, not its ez-agent
subdirectory. Without it, the fixture uses inherited XDG_CONFIG_HOME, falling
back to ~/.config. It copies only that home's ez-agent/config.yaml into a
private test config home and isolates config, state and runtime XDG paths.
Config directories have mode 0700. An explicit absolute auth_file stays
external; otherwise the default is the source home's ez-agent/auth.yaml.
Relative auth paths and %USER_CONFIG_DIR% are anchored to the source config
directory. The test rig never reads or copies auth. Only the service's protected
auth loader accesses it. The standard daemon fixture owns shutdown and teardown;
ordinary offline fixtures are unchanged.
Offline subscription regressions
pkg/service/config/chatgpt_lifecycle_test.go owns stateful local HTTP coverage
of login, signed OIDC, protected save/reload, refresh generations across restart,
and Responses inference. The Linux suite
tests/suites/test_chatgpt_offline_application.py uses test-only overlays and
standard isolated daemons to exercise configurator handoff, normal prompts,
rotations, and shutdown during consumed renewal. Narrow OAuth pairing, redaction,
permissions, cross-process exclusion, and authorization watcher tests remain
separate. Use fixture-supported GOFLAGS=-race when instrumenting separately
compiled helpers; parent go test -race alone does not instrument them.
Synthetic routing and expiry acceleration never ship or change production TLS
or scheduling. These tests do not establish live OpenAI renewal success.
Background bash regressions
tests/suites/test_background.py is full-offline coverage for generic ownership
RPCs, correlated conflicts, client state/configuration eligibility, abort/delete
kill routing, sticky late-completion rejection, provider loss, and the builtin's
initial-result/completion/buffer/removal contract. Package tests in
pkg/service/background_test.go, pkg/ezagentapi/background_test.go, and
cmd/ez-agent-builtin/internal/builtin/runcommand/background_test.go cover unloaded
registration, eviction/deletion races, detached cancellation, live and empty
captures, timeout while registration waits, completion admission ordering,
terminal status, rejected steers, and shutdown joining. Buffer and compaction
regressions exercise read-only task metadata and registry reminders.
Integration uses a deterministic local HTTP model to hold a foreground command beyond the completion RPC budget beside a fast background command, with and without parallel scheduling. Service tests hold success/idle terminalization and cover cancellation, preservation of the claimed model outcome, and registration/ removal versus abort snapshots. Held terminal triggers and a controlled tip change must still produce exactly one stored completion and model delivery before ownership removal. Manual compaction preserves live tasks, registry reminders, buffers, and the original completion destination. The CLI background suite also checks bundled Ruby Workflow waiting and follow-up. If its first model request misses the admission deadline, it captures startup markers and output even from a live child, plus pre-cleanup process status, the executable path where available, and the daemon-log path. If the child is still the public Go launcher on Linux, failure-only capture records process and lock state and requests a stack dump from the pidfd-pinned child before bounded cleanup. Lock holders are inspected, never signalled. Capture drains both output pipes and preserves partial output and the original failure if diagnostics fail. It does not extend the admission deadline, retry the request, or trace successful runs.
Shared-connection tests hold one leaf gate while another admits its tool result, completion, and removal; timeout/disconnect must not create late ghost ownership. Gate tests cancel queued acquisition and real SQLite pool waits. Bash tests distinguish missing-leaf statistics from explicit RPC failure.