Run native CLI API cases
Use this guide to run targeted public API checks through the native CLI. Each case lists its target, required identity, side effects, and evidence.
The read-only case checks Gateway discovery and the signed-in actor's authorization context. It does not test mutations, model execution, or full P1 acceptance. The API launchers run checked-in case scripts through the native apphost; they do not provide a separate API runner.
Before you begin
You need Node.js 24 and the self-contained native Agentweaver apphost for the source commit you want to test. Use an explicitly approved non-production Gateway. You must already be signed in through the supported CLI flow for the actor and tenant in the case input. The script does not sign in, launch a browser, accept a bearer token, or create fixtures.
The read-only script uses auth status, api operations, api describe, and rest --method GET with the same Gateway target. It makes no resource changes and sends no model request. The rest command still uses normal CLI authentication and Gateway authorization.
Prepare the case input
Copy scripts/acceptance/api/examples/read-only-gateway.json to a new local JSON file. Replace every example value with the approved case data:
sourceCommit: the full 40-character source commit for the apphost.targetCommit: the full 40-character source commit recorded for the target.apphostSha256: the SHA-256 hash of the exact apphost file.approvedNonProduction: set totrueonly after you confirm the target is approved for this test. This field records your approval; the script cannot verify the target's deployment status.expectedActorId: the actor ID authorized for this case.target: the Gateway origin, Broker issuer, client ID, API audience, and tenant ID for that actor.
Do not add credentials, tokens, private payloads, project IDs, or run IDs. The input accepts only the fields in the example. It rejects unknown fields and legacy runner fields.
Validate and run the case
Set
AGENTWEAVER_CLI_PATHto the absolute path of the exact native apphost. Keep the case input and evidence outside the repository. Set$caseRootto a new local directory, then copy the example input there. Set$evidenceto a new directory below$caseRoot.powershell$env:AGENTWEAVER_CLI_PATH = (Resolve-Path .\artifacts\cli\win-x64\publish\agentweaver.exe).Path $caseRoot = Join-Path $HOME 'agentweaver-acceptance' New-Item -ItemType Directory -Force -Path $caseRoot | Out-Null $caseInput = Join-Path $caseRoot 'read-only-gateway.json' Copy-Item .\scripts\acceptance\api\examples\read-only-gateway.json $caseInput $runName = '{0}-{1}' -f (Get-Date -Format 'yyyyMMdd-HHmmss'), ([guid]::NewGuid().ToString('N')) $evidence = Join-Path $caseRoot "read-only-gateway-$runName"Check the source and apphost identities before you run the case.
powershellgit rev-parse HEAD (Get-FileHash $env:AGENTWEAVER_CLI_PATH -Algorithm SHA256).Hash.ToLowerInvariant() & $env:AGENTWEAVER_CLI_PATH --versionPut the full source commit and SHA-256 result in the input. The script checks the apphost hash again before it starts a CLI command. Keep the target commit separate from the source commit.
Validate the input without starting the apphost or contacting the Gateway.
powershellnode scripts\acceptance\api\read-only-gateway.mjs --input $caseInput --output $evidence --dry-runA successful dry run reports
validated-not-run. It does not create the evidence directory. It checks the input, the absolute apphost path and name, the apphost file and its SHA-256 hash, and that the evidence path is new. It does not execute the apphost or contact the Gateway.If the actor is not signed in, use the normal
agentweaver auth logincommand for the same target andapi.readscope. Do this only when browser sign-in is authorized. The script never starts sign-in. Pass the same--gateway-url,--broker-issuer,--client-id,--api-audience, and--tenant-idvalues that appear in the case input.Run the case with a new evidence directory.
powershellnode scripts\acceptance\api\read-only-gateway.mjs --input $caseInput --output $evidenceThe script checks the apphost hash, captures its version, then runs the normal CLI commands as separate processes. It records the apphost and case script hashes, redacted command arguments, output, status, timestamps, and the final result. It does not overwrite an existing evidence directory.
Verify the result
The script writes commands.jsonl and result.json in the new evidence directory. A passed result (exit code 0) means only that the expected actor and tenant were reported, the Gateway listed and described getAuthorizationContext, and rest returned HTTP 200 with the expected actor and tenant.
An unauthenticated actor or missing Gateway operation is blocked (exit code 2). An unexpected response, identity mismatch, timeout, or command error is failed (exit code 1). A failed or interrupted run is not a pass. Review the redacted command records before you retry.
Run workflow generation
The workflow-generation case uses normal agentweaver api invoke commands through the exact native apphost. It checks the current actor and accepted selection, creates or reattaches a durable generation job, polls its status, and verifies the generated draft, artifact hash, and native completion evidence. It checks the stored assistant reply against the workflow completion receipt without keeping the reply text. The job and draft remain stored after the case.
The case sends a model request and cancels the named run after it confirms both caller contexts. Use an explicitly approved non-production Gateway and a disposable run with a bounded model budget. The case is complete only when it verifies that the run reached cancelled and completed runtime cleanup. It does not launch a browser or delete the job or draft.
Before you begin
You need Node.js 24, the self-contained native apphost for the source commit, and an approved non-production Gateway. Prepare a disposable run whose accepted root session and model selection match the case. The same actor and tenant need three CLI identities:
- A run-bound
projects.orchestratoridentity for the exact project and run. - An unbound
projects.orchestratoridentity with no project or run selector. - An unbound
projects.adminidentity withwriteProjectsauthority for the exact project. The Gateway uses this identity for theX-Agentweaver-Project-Authorizationbearer on generation.
The case checks both identities before it submits the generation request. If you need to sign in, use the normal agentweaver auth login flow for each identity. Browser sign-in needs explicit authorization.
Prepare the case input
Copy scripts/acceptance/api/examples/workflow-generation.json to a new local JSON file. Replace its example values with the approved case data:
sourceCommit: the full 40-character source commit for the apphost.targetCommit: the full 40-character source commit recorded for the target.apphostSha256: the SHA-256 hash of the exact apphost file.approvedNonProductionandapprovedDisposableRun: set both totrueafter you approve the target and disposable run.expectedActorId: the actor ID authorized for the project and run.expectedDecisionStateVersion: the current accepted decision-state version.expectedSelection: the exact project configuration revision, model selection reference, and run limits returned by the accepted selection.prompt: the prompt for the draft workflow.target: the Gateway origin, Broker issuer, client ID, API audience, tenant, project, run, and accepted root session IDs.
Do not add credentials, tokens, or private prompt data. The input accepts only the fields in the example and rejects unknown fields.
Validate and run the case
Set
AGENTWEAVER_CLI_PATHto the absolute path of the exact native apphost. Keep the input and evidence outside the repository. Use a new evidence directory:powershell$env:AGENTWEAVER_CLI_PATH = (Resolve-Path .\artifacts\cli\win-x64\publish\agentweaver.exe).Path $caseRoot = Join-Path $HOME 'agentweaver-acceptance' New-Item -ItemType Directory -Force -Path $caseRoot | Out-Null $caseInput = Join-Path $caseRoot 'workflow-generation.json' Copy-Item .\scripts\acceptance\api\examples\workflow-generation.json $caseInput $runName = '{0}-{1}' -f (Get-Date -Format 'yyyyMMdd-HHmmss'), ([guid]::NewGuid().ToString('N')) $evidence = Join-Path $caseRoot "workflow-generation-$runName"Record the apphost source and hash in the input:
powershellgit rev-parse HEAD (Get-FileHash $env:AGENTWEAVER_CLI_PATH -Algorithm SHA256).Hash.ToLowerInvariant() & $env:AGENTWEAVER_CLI_PATH --versionValidate the input without starting the apphost or contacting the Gateway:
powershellnode scripts\acceptance\api\workflow-generation.mjs --input $caseInput --output $evidence --dry-runA successful dry run reports
validated-not-run. It checks the input, apphost path and hash, and evidence path. It does not execute the apphost, contact the Gateway, or create evidence.If any identity is not signed in, use
agentweaver auth loginwith the matching scope and selectors. Sign in toprojects.orchestratoronce with the project and run selectors and once without either selector. Sign in toprojects.adminwithout either selector. Use the same actor, tenant, and target options. The case does not start sign-in.Run the case:
powershellnode scripts\acceptance\api\workflow-generation.mjs --input $caseInput --output $evidenceThe script checks the exact apphost hash, sign-in state, both caller contexts (run-bound and unbound
projects.orchestrator, plus unboundprojects.admin), their required grants, and the accepted selection. Before submission, it checks that the apphost and Gateway support the turn digest read. It then usesapi invoketo submit the generation request, poll job status, and read the completed result. It reads the stored reply's hash, sends onecancelProjectRunrequest with an idempotency key, and pollsreadRunStatusfor up to 90 seconds untilexecutionStateiscancelledandruntimeCleanupiscompletewith a positivetotal,pending: 0, andcomplete === total. If the first submission returns HTTP 503 withworkflow_generation_queue_full, the case sends the same request with the sameIdempotency-Keyonce more. It does not retry other submission failures or timeouts.The command log records submission attempts, turn digest reads, cancellation, and cleanup status reads without their arguments or output. It redacts request bodies and headers for other commands. The log contains the draft returned by the result read and the target IDs. The result records the artifact ID, definition hash, the verified reply's project, run, session, and event IDs and hash, and the four validated
cleanup.runtimeCleanupfields (state,total,pending, andcomplete). Store the evidence with the project's access controls.
Verify the result
The evidence directory contains commands.jsonl and result.json. A passed result (exit code 0) requires a completed generation, matching workflow definition hash and artifact ID, valid native completion evidence, a matching stored reply hash, and verified run cancellation with complete runtimeCleanup (state: "complete", positive total, pending: 0, and complete === total) for the matching project, run, and root session. The result records generation and cleanup separately.
A missing sign-in, missing turn digest support, missing operation, or caller or selection mismatch is blocked (exit code 2). A generation error, timeout, response mismatch, or unverified cleanup is failed (exit code 1). If cancellation returns a lost transport response or HTTP 504 with code: "owner_timeout", the script polls readRunStatus within the same 90-second deadline without sending a second cancellation. When cleanup does not finish before the deadline, inspect the exact run with readRunStatus instead of resubmitting generation. A failed or blocked case is not a pass.
This route-specific case checks workflow generation. It does not replace full P1 API acceptance.
Verify zero-credit workflow generation and cleanup
The workflow-generation-credit-zero case checks a zero-credit workflow-generation denial and verified disposable-run cleanup through the native CLI. It requires a newly provisioned disposable run for each attempt.
Before you begin
Prepare a disposable run on an approved non-production Gateway with:
modelSelection.sourceModeset to"hostedCopilot".runLimits.copilotHardCreditLimitset to numeric0.- A ready root coordinator session in a nonterminal run (
runtimeStartup.state: "ready"). - Initial decision state (
stateVersion: 1) matching the sessionexecutionFence.
Sign in with the run-bound projects.orchestrator identity (for reads), the unbound projects.orchestrator identity (for cancellation), and the unbound projects.admin identity (for the generation project-authorization bearer).
Prepare and run the case
Copy scripts/acceptance/api/examples/workflow-generation-credit-zero.json to a new local JSON file outside the repository and replace the example values. Set expectedDecisionStateVersion to 1 and expectedSelection.runLimits.copilotHardCreditLimit to 0.
Validate the input with --dry-run, then run the case with a new evidence directory:
node scripts\acceptance\api\workflow-generation.mjs --input $caseInput --output $evidence --dry-run
node scripts\acceptance\api\workflow-generation.mjs --input $caseInput --output $evidenceHow the case checks the proof and cleanup
- Preflight checks the apphost hash, both sign-ins, caller context, accepted selection (including
hostedCopilotand an explicit JSON0credit limit), ready root session status, and initial decision state (stateVersion: 1). A failed preflight exits without submitting generation or cancelling the run. - Before submitting generation, the script saves
cancellation-request.json(the target, cancellationIdempotency-Key, and request body) in the evidence directory. It callsgenerateProjectWorkflowonce and never retries generation, even on a timeout orworkflow_generation_queue_full. - It polls
readProjectWorkflowGenerationJoband saves the redactedzeroCreditNoSendproof tozero-credit-proof.jsonbefore cancelling the run. Any completed job, non-null artifact, or mismatched proof fails the case. It never fetches a workflow draft. - It calls
cancelProjectRunand pollsreadRunStatusup to a 90-second deadline, allowing at most two same-key cancellation replays at least five seconds apart after a lost response, HTTP 503runtime_start_queue_full, or pending cleanup. It stops on authority denial, conflict, or mismatched output.
Verify the result
The case passes (exit code 0) only when preflight passes, zeroCreditNoSend matches the ready session registration and fence, readRunStatus reports executionState: "cancelled", and runtimeCleanup reports state: "complete", total > 0, pending: 0, and complete === total. Passing this dedicated case promotes the credit-zero row in numericMatrix to passed.
A missing job ID or missing proof at the deadline leaves credit-zeroblocked (exit code 2) when cleanup completes. If cleanup remains pending, the case fails (exit code 1) and retains cancellation-request.json for authorized follow-up.
Run the full workflow delivery case
The full-flow-delivery case runs one casting proposal, generated workflow, captured backlog task, exact model-generated WorkPlan, child completion, priced usage, and owned cleanup. It uses normal agentweaver sign-in and the native CLI apphost. The WorkPlan operation derives its prompt from the exact confirmed outcome, workflow, and saved task. It returns the native request ID, assistant event, and reply digest. Events message admission is not used as completion evidence.
Copy scripts/acceptance/api/examples/full-flow-delivery.json outside the repository and replace its source, target, actor, selection, casting, workflow, task, and target values. Set approvedNonProduction to true. Set approvedDisposableProjectId to the exact target.projectId.
$env:AGENTWEAVER_CLI_PATH = (Resolve-Path .\artifacts\cli\win-x64\publish\agentweaver.exe).Path
node scripts\acceptance\api\full-flow-delivery.mjs `
--input $caseInput --output $evidence --dry-run
node scripts\acceptance\api\full-flow-delivery.mjs `
--input $caseInput --output $evidenceThe case requires one unbound projects.admin sign-in, one unbound projects.orchestrator sign-in, and one projects.orchestrator sign-in bound to the exact project and run. It proves the disposable project's owner identity, generates and confirms casting and the workflow, captures one task, and derives the WorkPlan ID from the exact saved model reply. It polls the exact persisted result. A pending read returns HTTP 404. AgentHost writes the root completion to the authenticated Orchestrator ledger before it returns success. Recovery reads the original receipt and Events material without sending the model request again. The runner reads the saved assistant reply before parsing the plan. It rejects unknown, fixed, platform, build-test, command, tool, or write steps.
The runner proposes the exact generated plan and confirms that same plan. It then reads the saved proposal and confirmed execution plan before it marks the task ready, claims it, or dispatches it. The planner and generated child turns use a service-owned text-only restriction. The runtime denies every tool call for those turns.
The case requires one plan item because the owner currently returns task completion evidence for one item. After dispatch, the runner reads the exact task and claim again, then verifies child identity, reply digests, priced BYOK usage, and accepted spend budgets. It proves current project-admin identity again before cleanup. It cancels the case-owned run, waits for complete runtime cleanup, resolves only the case-owned proposal, archives the exact approved disposable project, and reads those states back. The evidence directory contains commands.jsonl and result.json; it does not contain model reply text.
Run task model completion
The task-model-completion case dispatches an already claimed task through the public Gateway. It checks the accepted model selection, run limits, owner-derived task completion, the matching child receipt, the stored assistant reply, priced usage, and disposable-run cleanup. When the accepted selection contains a matching USD budget, the case records it as evidence.
The case sends a model request and cancels the named run after it confirms the run identity. Use an approved non-production Gateway and a disposable run.
Before you begin
You need Node.js 24 and the self-contained native Agentweaver apphost for the source commit you want to test. Prepare a disposable run with:
- An accepted root session and a claimed task.
- A confirmed one-item WorkPlan for that task.
- A BYOK model selection pinned to the expected model.
- Run limits that match the case input.
Sign in as the expected actor and tenant with two projects.orchestrator CLI identities:
- A run-bound
projects.orchestratoridentity for the exact project and run. - An unbound
projects.orchestratoridentity, with no project or run selector, to cancel the disposable run.
The case does not sign in or launch a browser. Use the supported CLI login flow before running it. Browser authorization needs explicit approval.
Prepare the case input
Copy scripts/acceptance/api/examples/task-model-completion.json to a new local JSON file outside the repository. Replace the example values:
sourceCommit: the full 40-character source commit for the apphost.targetCommit: the full source commit deployed to the Gateway target.apphostSha256: the SHA-256 hash of the exact apphost file.approvedNonProductionandapprovedDisposableRun: keep bothtrueafter you approve the target and disposable run. These values record your approval; the script cannot determine the target's deployment status.expectedActorId: the actor authorized for the project and run.expectedDecisionStateVersion: the current decision-state version for the confirmed plan.expectedSelection: the exact project configuration revision, model selection reference, model ID, and run limits.expectedTask: the task ID and revision, claim ID, WorkPlan ID, workflow ID and revision, and the task's WorkPlan association ID.target: the Gateway origin, Broker issuer, client ID, API audience, tenant, project, run, and root session IDs.
If the accepted selection has a run-scoped byok.tokens budget in USD, the case records its hard limit and reservePerDispatch as evidence. A missing budget does not block this case. The product applies its configured admission and credit controls before dispatch; the runner adds no test spending cap. An admitted turn can settle above a reserve, so the runner checks that usage is priced and bound to the completed turn instead of comparing final settled usage to a hard limit. The case input accepts only its documented fields. Do not add credentials, tokens, prompts, or task content.
Validate and run the case
Set the native apphost path and create a new input and evidence path outside the repository:
powershell$env:AGENTWEAVER_CLI_PATH = (Resolve-Path .\artifacts\cli\win-x64\publish\agentweaver.exe).Path $caseRoot = Join-Path $HOME 'agentweaver-acceptance' New-Item -ItemType Directory -Force -Path $caseRoot | Out-Null $caseInput = Join-Path $caseRoot 'task-model-completion.json' Copy-Item .\scripts\acceptance\api\examples\task-model-completion.json $caseInput $runName = '{0}-{1}' -f (Get-Date -Format 'yyyyMMdd-HHmmss'), ([guid]::NewGuid().ToString('N')) $evidence = Join-Path $caseRoot "task-model-completion-$runName"Record the apphost source, target commit, and hash in the case input:
powershellgit rev-parse HEAD (Get-FileHash $env:AGENTWEAVER_CLI_PATH -Algorithm SHA256).Hash.ToLowerInvariant() & $env:AGENTWEAVER_CLI_PATH --versionValidate the input without starting the apphost or contacting the Gateway:
powershellnode scripts\acceptance\api\task-model-completion.mjs --input $caseInput --output $evidence --dry-runA successful dry run reports
validated-not-run. It checks the case input, apphost path and hash, and evidence path. It does not execute the apphost, contact the Gateway, or create evidence.Sign in with both identities for the same target. Use the project and run selectors for the run-bound identity. Do not use either selector for the cancellation identity. The case checks both sign-ins, caller contexts, accepted selection, and decision state before it dispatches the task.
Run the case:
powershellnode scripts\acceptance\api\task-model-completion.mjs --input $caseInput --output $evidenceThe case calls
dispatchCoordinatorExecutionatPOST /api/v1/projects/{projectId}/runs/{runId}/coordination/sessions/{sessionId}/actions/dispatch. Each dispatch request keeps the existing ten-minute subprocess limit, or the remaining accepted run wall-time plus polling grace when less time remains. The case does not start a request or sleep at the deadline and rejects completion received at or after it. The case retries the same request while child startup is pending. A terminal dispatch failure stops retries. Before dispatch, the case checks that the apphost supports--turn-content-sha256. It usesapi describeto check the Gateway turn read's required inputs and HTTP 200 JSON response. After dispatch completes, the case reads the assistant turn in the child session once. The stored assistant reply is verified against the child receipt by matching the reply's hash.After it verifies task completion and run usage, the case cancels the named run and waits for
runtimeCleanup.stateto reachcompletewith no pending work. The case also attempts cleanup after a dispatch or turn read failure. It does not dispatch again after a turn read failure.commands.jsonlrecords command steps, timing, and exit status. It does not record arguments, standard output, or standard error.result.jsonrecords the selected model, task and completion hashes, verified turn IDs and hash, separately retained receipt usage IDs, run-level usage totals, and cleanup result. The runner does not match each receipt usage ID to an individual run-usage amount.
Verify the result
The evidence directory contains commands.jsonl and result.json. A passed result (exit code 0) requires matching task-completion evidence and child receipt, a matching stored reply hash, fully priced BYOK run totals, and a cancelled run with complete runtime cleanup. Any accepted product spending limit remains enforced by the product before dispatch; the runner does not compare settled usage with a test-created limit.
A missing sign-in, missing apphost capability or operation, caller mismatch, selection mismatch, or non-dispatchable decision is blocked (exit code 2). A dispatch error, timeout, evidence or usage mismatch, run that does not reach cancelled, or runtime cleanup that remains pending is failed (exit code 1). A failed or blocked case is not a pass.
This route-specific case checks task dispatch and completion. It does not replace full P1 API acceptance.
Run the Workspace repository-read case
The workspace-repository-read case reads one file from the Repo App repository of a project through the agentweaver workspace commands. It makes no changes. It opens three or more browser approvals, so a person must approve each one as the expected actor.
Before you begin, make sure that you have these items:
- An approved non-production target.
- A project that uses a GitHub App repository connection.
- A GitHub App installation that can see the exact
owner/namerepository. - A sign-in as the expected actor with
agentweaver auth login --scope projects.adminand the target options, without--project-idor--run-id.
Copy scripts/acceptance/api/examples/workspace-repository-read.json to a new local JSON file. Set the same fields as the read-only case, and set the fixture fields: projectId, repository (owner/name with the exact case), refKind (branch or tag), refName, commitSha, filePath, byteLength, and sha256 of the file.
$env:AGENTWEAVER_CLI_PATH = "C:\approved\agentweaver.exe"
node scripts/acceptance/api/workspace-repository-read.mjs --input .\workspace-case.json --output .\evidence\workspace-repository-read-001 --interactiveThe script runs --version, api operations, auth status, and rest for the authorization context. If the actor or tenant is not the expected one, the case fails before any approval. Then the script runs workspace refs until it finds the ref, workspace tree, and workspace file. It compares the ref, the commit, the file size, the SHA-256 hash, and the Git blob SHA. It never writes the file content to the evidence. Each workspace command can wait 11 minutes for the browser approvals.
A missing sign-in, a Broker error, or an approval that does not complete in time is blocked (exit code 2). A mismatch or an unexpected response is failed (exit code 1). Until a live run with approved input passes, treat this case as blocked. Do not use internal CLI types, extract a selection code, or bypass sensitive-header guards.
Read back a pending BYOK provider host request
The runtime-byok-provider-readback case checks one known, pending bring-your-own-key (BYOK) model-provider host request through agentweaver platform egress provider-requests list. It does not create, approve, or change any host request. The command reads the listPlatformEgressDestinations operation internally and prints the supported requests and nextCursor result to standard output.
Before you begin
You need Node.js 24, the self-contained native apphost for the source commit, an approved non-production Gateway, and an existing pending BYOK model-provider host request. Sign in as the expected actor with an unbound projects.admin identity that holds readPlatformRuntimeDefaults on platform/default:
agentweaver auth login --scope projects.admin --gateway-url <GATEWAY_URL> --broker-issuer <BROKER_ISSUER> --client-id <CLIENT_ID> --api-audience <API_AUDIENCE> --tenant-id <TENANT_ID>Do not pass --project-id or --run-id.
Prepare and run the case
Copy
scripts/acceptance/api/examples/runtime-byok-provider-readback.jsonto a local JSON file outside the repository. Replace the example values forsourceCommit,targetCommit,apphostSha256,approvedNonProduction,expectedActorId,target, andexpectedRequest(requestId,tenantId,scope,projectId,providerId,providerRevision,host, andport).Set
AGENTWEAVER_CLI_PATHto the absolute path of the native apphost and run a dry run first to check the local input and apphost hash:powershell$env:AGENTWEAVER_CLI_PATH = (Resolve-Path .\artifacts\cli\win-x64\publish\agentweaver.exe).Path node scripts\acceptance\api\runtime-byok-provider-readback.mjs --input .\provider-readback.json --output .\evidence\provider-readback-001 --dry-runA dry run starts no CLI process and creates no evidence directory.
Run the case with a new evidence directory:
powershellnode scripts\acceptance\api\runtime-byok-provider-readback.mjs --input .\provider-readback.json --output .\evidence\provider-readback-001The script removes ambient target, project, and run environment variables, verifies the unbound
projects.adminauthorization context, and pages throughplatform egress provider-requests list. It processes list pages in memory and writes only allowlisted command status, timing summaries, static error codes, and the matched request fields tocommands.jsonlandresult.json. If a run fails, start a new run from page 1 with a new evidence directory.
Verify the result
A passed result (exit code 0) confirms that the unbound actor matched and that the dedicated list command returned the exact expectedRequest on the pending queue. The dedicated CLI validates the upstream request state and origin before it projects the response. A missing sign-in or missing Gateway operation returns blocked (exit code 2). Any identity, binding, pagination, matching, HTTP, parsing, or timeout error returns failed (exit code 1) with a static allowlisted errorCode.
Prepare provider egress journeys
The runtime-provider-egress-journeys runner prepares two command-line cases:
runtime-platform-provider-egresscreates and prices a platform provider, accepts one test key on standard input, approves and reads back the exact host, activates the provider for one disposable priced turn, then restores the prior Policy and removes the owned provider.runtime-project-provider-denied-retrystarts an accepted disposable run with anAvailableproject provider whose host is still pending. The case requires an owner-backed denial and one complete empty native-send range, approves the exact host, waits forenforcedreadback, retries the turn, and restores the prior Policy.
Both cases use the exact native apphost. They execute normal agentweaver provider, egress, Policy, api, and rest commands. The input contains no credential. The platform case reads one API key from standard input and never writes it to command records or evidence.
Prepare the case inputs
Copy the matching example from
scripts/acceptance/api/examples/to a local file outside the repository:runtime-platform-provider-egress.jsonruntime-project-provider-denied-retry.json
Set
sourceCommit,targetCommit,apphostSha256,target, actor, provider, Policy revision, operation IDs, and the accepted disposable run fields for the approved non-production target. For the project case, create the denied run and the retry run from the same exact provider reference.Set
AGENTWEAVER_CLI_PATHto the absolute native apphost path. Validate the local plan without sign-in or network access:powershell$env:AGENTWEAVER_CLI_PATH = (Resolve-Path .\artifacts\cli\win-x64\publish\agentweaver.exe).Path node scripts\acceptance\api\runtime-provider-egress-journeys.mjs ` --input .\provider-case.json ` --output .\evidence\provider-case-001 ` --dry-runA successful dry run prints
validated-not-run. It creates no evidence.When all live runtime dependencies are ready, pipe one test key directly into the platform case. The runner accepts no key from its JSON input:
powershellRead-Host "Provider test key" -MaskInput | node scripts\acceptance\api\runtime-provider-egress-journeys.mjs ` --input .\platform-provider-case.json ` --output .\evidence\platform-provider-case-001
Run the project denied-retry case without a key:
node scripts\acceptance\api\runtime-provider-egress-journeys.mjs `
--input .\project-provider-case.json `
--output .\evidence\project-provider-case-001Read the evidence and remaining dependencies
result.json keeps the two journeys separate. It records the exact apphost, emitted operation set, provider revision, enforced request and Policy revision, bound approval audit, priced-turn result, denial receipt, native no-send receipt, shared dispatch ID, and cleanup result. The denial and complete zero-event no-send fact must match the same attempt and valid, nonzero dispatch ID. A missing, invalid, different, or duplicate dispatch identity fails the pairing. commands.jsonl records only command identity, timing, exit status, and timeout state. A journey fails when its functional checks or owned cleanup fail.
The project case remains a runtime dependency on #2659: the deployed AgentHost must emit the exact provider-host denial and native no-send evidence, and the selected non-production target must expose the matching enforced Policy readback. Every traversed runtime-history page must report complete: true. Incomplete history stops the project approval and retry, but the runner still cleans up the denied disposable run. The checked-in local tests use synthetic data to validate schemas, command plans, key handling, Policy readback, exact denial pairing, incomplete-history behavior, cleanup, and dry-run behavior. They do not send a model request or prove deployed enforcement.
Next step
Use the Testing guide to choose other checks and understand their limits. The read-only case does not prove a live model; the workflow-generation case exercises one model-backed Gateway flow but does not prove full P1 acceptance. To inspect an existing tool-use, root model-turn, or hard-credit observation through normal CLI commands and rest, use the spending, credit, and tool-use limit case.
