API contract
Ready CI's released CLI is the supported public integration boundary. The HTTP service is pre-release: endpoint shapes may change together with the CLI and Go contracts, and there is not yet a separately versioned third-party SDK or OpenAPI compatibility promise. Prefer CLI JSON unless an integration needs streaming or direct resource access.
Base URL and authentication
The hosted base URL is https://api.readyci.com. Authenticated customer
endpoints accept a scoped Ready CI bearer token:
Authorization: Bearer pfl_...
Accept: application/json
Never send the bearer token to presigned object-store upload/download URLs. The
CLI deliberately omits it for those origins. Admin, worker, webhook, and
internal evidence routes use different credentials and are not customer APIs.
The /v1/auth/ browser-login endpoints are intentionally public and establish
their own short-lived state and callback checks.
CLI login uses a separate S256 PKCE binding from the API's OIDC exchange.
GET /v1/auth/cli/login requires a loopback redirect_uri, a code_challenge,
and code_challenge_method=S256. The CLI retains the corresponding verifier.
POST /v1/auth/cli/exchange accepts code, code_verifier, and optional name;
only the matching verifier can redeem the code, once. Missing or malformed
proof is rejected. Older CLIs without this binding must be upgraded before
logging in again.
Device login adds POST /v1/auth/cli/device/start with an S256
code_challenge. It returns a private device_code, public matching user_code,
verification_uri, expiry and polling interval. verification_uri is the plain
approval page; there is no verification_uri_complete, and no URL carries the
user code, the device code or the verifier. Clients print the URL and the code
separately, and the user types the code. A link that carried the code would let
anyone who starts a request phish a one-click approval (RFC 8628 §5.4).
POST /v1/auth/cli/device/poll supplies device_code and
code_verifier; states are pending, slow_down, denied, expired, or
approved with a single-use credential response. Increase the interval by five
seconds after slow_down; stop on denial or expiry. A decision recorded before
the request expired is still delivered for two polling intervals (10 seconds)
afterwards, so keep polling until the API answers expired. Redemption consumes
the request; later polls report expired.
Browser review uses GET /v1/auth/cli/device/review?code=... with a live web
session. The response includes the account, team_id and team_name, the
exact scopes an approval grants, and requester. requester contains the
ip the API saw after trusted-proxy handling (empty when unknown), a sanitized
user_agent of at most 160 printable ASCII characters, requested_at and
age_seconds. Approval/denial uses POST on the same endpoint with CSRF protection,
user_code, approve, and the reviewed user_id/team_id and scopes. Identity or access changes
require a fresh review. Approved requests use the existing entitlement, SSO,
membership, scope, expiry and active-token-limit checks during redemption.
Device approval happens on a different machine from the requesting terminal, so
device credentials receive a narrower, fixed scope set than browser login. That
set is runs:create, runs:read, cache:read, projects:read,
policies:read, policies:propose and account:read, limited further to the
approver's own access. It covers setup, check, verify, run, logs, artifacts,
cache usage and policy proposals. Projects are created by their first run.
Device credentials never receive tokens:*, members:*, secrets:*,
cache:purge, projects:write, policies:write, feedback:write or
runs:create_with_secrets. Approval and redemption both enforce the set; use
browser login or a dashboard token for those operations.
The project settings endpoint accepts one approval operation per request.
Use add_trusted_secret_command_hashes to add pairs or remove_trusted_secret_command_hashes
to revoke exact pairs. Both operations are atomic, and adding is safe to retry.
Revoking a pair the project does not hold returns HTTP 400 request_invalid
naming the pair, so a mistyped pair cannot look revoked. This includes a retry
after a revocation that already committed; read the settings to confirm.
Set clear_trusted_secret_command_hashes to true to revoke every grant. Each entry has the form
sha256:<command hash>@sha256:<workspace digest>. Updates require
projects:write and secrets:write and allow 128 distinct grants per project.
The command hash of a plain command is the hash of its text. A check with cache
paths, environment or matrix variables, prepare, post or always phases, or
keep_failed runs a generated wrapper instead. Its node run then carries
command_source: the check's own command and those settings. The service
renders that source again and returns HTTP 400 unless the result equals the
node's command. The command hash is then the hash of the source, so an
approval covers the check as configured and is unaffected by changes to the
generated wrapper. readyci project set --trusted-secret-check NAME computes
it. The service reads command_source only on runs that request secrets and
drops it from other runs. A secret run's secret_policy.command_hash shows
the hash the service computed.
Standalone POST /v1/runs rejects secrets_requested: true with HTTP 400.
Execution and verification sessions validate the workspace before secret release.
A secret-bearing node may set artifact_paths only when the server authorized
its plan from the registered verification policy; otherwise the claim is denied.
PUT /v1/projects/{project}/secrets/{name} takes value, requires_approval,
or both, and needs secrets:write. Setting requires_approval to false also
needs projects:write, as adding a secret approval does. A new secret needs a value and requires
approval unless requires_approval is false. An omitted field keeps the
stored setting, so rotating a value keeps its approval rule. A request with
neither field, a null field, an empty or too-short value, or only
requires_approval for a missing secret returns HTTP 400 and changes nothing. Secret summaries include requires_approval. A run whose
command and workspace have no approval receives only secrets with
requires_approval: false, and only when it runs with network_mode none or
the network allowlist of a registered verification policy. In run detail,
spec.secret_release records what the claim released: all for an approved
run, approval_free for this narrower release. secret_policy describes
current policy, so its release field says what a claim would release now.
Removing a project's last Git restriction needs secrets:write when the
project has secret approvals or secrets that need no approval.
GET /v1/projects/{project}/verification-policy/source-binding accepts
change_mode, an optional check, and scope_protocol=readyci.source-scopes.v1
for clients supporting combined component scopes. A mixed policy rejects clients
without that protocol before returning an upload contract; unknown protocol
values fail fast. An explicit check returns
the upload filter in active, including any dependency scope, and the named
check's execution filter in check_source. Unknown checks and incompatible scopes return
verification_source_policy_changed (HTTP 412). Omitting check returns either
one shared binding or a canonical active.scopes set for a mixed registered
policy. The CLI uploads only the admitted union, with its manifest as the first
archive entry, and retains that set under recipe.source.source_scopes for
currentness. While validating the upload, the service derives each selected
node's exact source view and seals its workspace digest, changed paths, baseline
key, source policy and projected manifest_digest under plan.nodes[].source.
Worker downloads stream that view from the retained upload, and receipts bind
its digest. A worker's conditional download is answered from the sealed digest
without reading the upload, but still requires a live claim and the retained
upload. The session result binds the complete upload,
combined coverage and immutable plan. The sealed recipe retains explicit check
selection, so source authorization and retained-source retries reject a binding
from another component. Installer selection is rebuilt from registered
configuration, with no project secrets and the explicit warm network policy.
Supported customer resource groups
| Resource | HTTP paths | Preferred CLI |
|---|---|---|
| Account and usage | /v1/account, /v1/account/, /v1/account/test-status, /v1/account/usage-series |
readyci usage, dashboard |
| Authentication | /v1/auth/ |
readyci login, readyci auth |
| Billing session | /v1/billing/checkout, /v1/billing/portal, /v1/billing/prepaid |
dashboard |
| Feedback | /v1/feedback |
readyci feedback |
| Projects, settings, secrets, policy | /v1/projects, /v1/projects/ |
readyci project, readyci secrets, dashboard |
| Runs | /v1/runs, /v1/runs/, /v1/runs/summary, /v1/runs/artifacts, /v1/runs/events/tails |
readyci run, check, runs |
| Run groups | /v1/run-groups/latest, /v1/run-groups/ |
readyci groups |
| Verification sessions | /v1/verification-sessions, /v1/verification-sessions/ |
readyci verify, sessions |
| Artifacts | /v1/artifacts, run artifact subresources |
readyci artifacts |
| Worker capability | /v1/workers/capability |
readyci doctor |
Path presence does not grant permission. The server enforces team/project ownership, token scopes, policy, plan limits, idempotency, and valid state transitions independently of the CLI request.
Run summaries include run_group_id and run_group_kind for grouped runs.
Matrix runs also include matrix_variant; consumers should use it to distinguish
variants even when their check aliases are identical.
Verification-session attempts have kind verification_session, so dashboards can
keep their failure history attached to the session instead of treating each
attempt as an independent failing check.
GET and PUT /v1/projects/{project}/settings return available_regions: the
default region plus every region with a registered worker, sorted. A
home_region outside that list is rejected with 400 request_invalid. Run and
verification-session creation, server-planned nodes, and session retries apply
the same rule to the effective region of each run, so a misspelled or retired
region fails immediately instead of returning a retryable worker_unavailable
or queueing work nothing claims. A node admitted later (after a dependency
or for a retry attempt) is checked again: if its sealed region has lost every
registered worker by then, the session is blocked with precondition_failed
naming the node and the available regions, instead of queueing a run that
would never be claimed. This applies to optional nodes too, and the session's
in-flight attempts are cancelled. The default region is always accepted; whether a live
worker is available there is reported separately.
POST /v1/workers/capability accepts { "spec": <RunSpec> } with the selected
image, region, size, timeout, cache, network, Docker, services, runtime requirements,
environment requirements,
and secret-request settings. Its policy result contains allowed and, when denied, the admission
status_code, code, and message. It uses the same resource validation and
effective deployment/team limits as run admission. A policy-denied recipe has
claimable: false and upload_capable: false even when matching workers exist.
The request is read-only: it does not reserve capacity, create a session, or
authorize a later run. runtime_requirements is a bounded map of runtime names
to version constraints, also retained in run/session requests and execution
evidence. Worker matching uses image-specific, authenticated installed inventory.
environment_requirements is a controlled list of guest filesystem/network
features. Matching requires image- and network-mode-specific acceptance bound
to the kernel, rootfs and promoted worker release; ordinary worker labels cannot
establish support. Requirements are retained through run/session requests,
retries and execution evidence, and probed again before repository preparation.
A worker may separately advertise approved Go, Node and pnpm archive providers
whose capabilities include the exact catalog digests. For a missing numeric
version, the service and worker resolve the same deterministic catalog artifacts
only when the sealed network policy already permits every download origin.
An exact pnpm VERSION+sha512.HEX requirement preserves the full npm tarball
digest; installed version metadata alone cannot satisfy it. The bounded pnpm 12
catalog composes its wrapper and native distributions without an install script.
runtime_preparation reports the possible approved archives for matching
workers, including runtime kind, version, fixed URL, size, SHA-256 and, for Node
and pnpm, SHA-512. It is an observation, not caller authority or a reservation. Arbitrary
URLs, checksums, moving release queries and missing unsupported runtime
families cannot bypass admission. The catalog digests are bound to the approved
worker isolation/release identity and the existing requirement/network fields
remain part of the canonical execution digest.
Setup imports save numeric runtime requirements only; setup never resolves
moving selectors. Explicit user runtime_pins and runtime_notes are
setup-report fields, are not part of the run or session execution contract, and
are rejected as unknown execution fields. A saved imported check records its
pins under imported_from, which only setup previews read; a pin counts there
only while the check's runtime_requirements still apply it. The server and worker enforce
runtime_requirements and approved archive digests as usual.
scratch_size_bytes reports the conservative per-run scratch device capacity
for matching workers, or zero when unknown; filesystem metadata reduces usable
space. The observation reserves no disk or compute capacity. Source authorization,
current queue/cache capacity, and normal admission are checked again when
execution starts.
Project test status
GET /v1/projects/{url-encoded-project-id}/test-status requires runs:read and
returns { "project_id": "owner/repo", "completed_test": true }. It is scoped to
the authenticated team and requested project. Completion means a retained
terminal job with verdict checks_passed or verified contains a successfully
executed verify-phase check. Preparation-only jobs, skipped checks and failed
jobs do not count. This is onboarding history, not proof that the current
workspace is verified. The dashboard polls incomplete status and stops once
completion is confirmed. With several projects and none selected, it uses
GET /v1/account/test-status with the same runs:read scope and response shape.
An empty project_id in that response means any project in the authenticated
team; it never includes another team's test history.
Prepaid compute
GET /v1/billing/prepaid requires account:read and returns the configured
pack offer, billing_hold_active, and the latest team purchase statuses.
The active hold blocks purchases; past review statuses remain in purchase history
after the hold is released. POST requires
billing:manage, a current owner/admin membership, and an active paid
subscription. Send {"packs":1,"checkout_attempt_id":"<UUID>"}; the server
selects the product, customer, price, currency, and team. Reuse the UUID on
retries. Each pack grants 5,000 slot-minutes for $20 plus applicable tax,
valid for 12 months. Checkout returns a provider URL; credit arrives only
following a matching signed successful payment webhook.
Purchase summaries include checkout_expires_at for confirmed checkout
sessions. A purchaser's unexpired pending order also includes
checkout_attempt_id, so they can resume the same checkout in another browser.
Other team members can see the status but cannot resume that user's purchase.
/v1/account includes monthly_remaining_slot_minutes,
prepaid_remaining_slot_minutes, and reserved_slot_minutes. These are
available balances and pending maximum run budgets; compute_slot_minutes
remains measured month-to-date usage. Included minutes are used first, and
unused reservations are released at authoritative attempt settlement. Credits
persist through renewal, plan changes, and cancellation until expiry. An active
paid plan is required to use them; other plan limits remain in force.
Usage series
GET /v1/account/usage-series requires account:read and breaks the current usage
period's compute slot-minutes down by UTC day, project, and check:
period_start, period_end, total_slot_minutes, days[] (date as
YYYY-MM-DD, slot_minutes, runs), by_project[], and by_check[] (top 20;
check is empty for runs submitted without a check name). Days are zero-filled
from the period start through today. Quantities use the same period-bounded
proration as /v1/account, so total_slot_minutes equals that response's
usage.compute_slot_minutes for the same period; an attempt that crosses the
period start is prorated, and runs counts billed attempts, so retries count
separately. Usage not linked to a run has an empty project_id. Deployments
without metered account usage answer 501.
Cache insights
GET /v1/projects/{project}/cache (scope cache:read) returns insights with the
lanes: over the last window_days (7), warm_runs attached a lane image already
on the worker, cold_runs started with a new image, and unreported_runs
attached a lane without a reported state (older workers, or runs that stopped
before the VM was ready). hit_rate is warm / (warm + cold) and is omitted until
a run has reported. checks[] (at most 10, ordered by estimated saving, then run
count; an empty check means no check name) compares succeeded warm and cold runs
by median claim-to-finish time; estimated_saved_ms is
max(0, cold median − warm median) × warm runs, summed over every check, and is
omitted when no check has both warm and cold successes. It is an estimate: it
cannot separate cache effects from code changes between runs.
Workers report the state in the agent_ready event payload as
cache_lane_state (warm or cold). Other values, or a state for a claim with no
cache lane, are rejected as invalid run events.
Test insights
GET /v1/projects/{project}/test-insights?days=7|14|30 requires runs:read;
days defaults to 14 and any other value is rejected with 400. It aggregates the
structured JUnit and supported xUnit.net XML results of the project's newest runs created in the window —
at most 300 runs and 50,000 raw result observations, with runs_truncated set when older runs are excluded by either bound — and returns
runs_analyzed, tests_observed, uncapped flaky_count and failing_count, and
three lists of at most 25 tests: flaky, failing, and slowest. Tests are
keyed by their stable result id, check alias (check), and matrix_variant.
A run contributes one observation per test. Counts and ranked rows represent
these distinct histories: results from different checks or matrix variants never
affect each other's failure status, flips, retries, or duration statistics.
flaky:flaky_retries(run groups where the test failed on one attempt and passed on a later attempt of the same check) is above zero, orflips(pass/fail changes between consecutive observations, skipped results ignored) is at least 2.failing: the latest observation failed or errored.slowest: ordered byp95_duration_ms; durations are observed values with skipped results excluded.
History is bounded by artifact availability (30 days), and insights are diagnostics, not a verification verdict.
Artifact previews
GET /v1/runs/{id}/artifacts/manifest (scope runs:read) lists the files in the
run's retained archive, sorted by path, each with size_bytes and a preview
kind (image, text, or none). It answers 404 when the run has no unexpired
archive, and state: "unavailable" with no files for archives uploaded before
manifests were recorded.
GET /v1/runs/{id}/artifacts/file?path=<exact manifest path> returns one entry
whose kind is not none. Images are PNG, JPEG, GIF, or WebP up to 10 MiB (413
above that); SVG is never previewable. Text types (txt, log, json, xml, md, csv,
tsv, yaml/yml, html/htm, js, ts, css, out, err) are always served as
text/plain; charset=utf-8 — HTML is source, never rendered — and anything over
1 MiB returns its first 1 MiB with X-ReadyCI-Preview-Truncated: true, a header
readable cross-origin. Responses carry
Content-Disposition: attachment and Cache-Control: private, no-store. A
missing, blank, or repeated path is 400; any path that is not a previewable
manifest entry is 404. The archive is read through the same checksum-verified
spool as downloads, so integrity failures answer 500 and a full spool 503. One
verified pass captures the archive's previewable entries in a bounded in-memory
cache keyed by artifact and checksum, so previewing several files of one archive
verifies it once; authorization and manifest matching still run on every request.
Stable machine documents
GET /v1/runs/{run-id}/tests requires runs:read and enforces the same tenant
ownership as run details. Use ?status=failed (or passed, error, skipped)
to filter indexed results; counts describe all indexed tests. The response binds
the diagnostics to the run, project, snapshot, check, attempt, and retained
archive checksum. It is diagnostic data, not an execution or coverage verdict.
Indexes expire with their evidence and historical archives without an index
report unavailable. Individual run detail responses, including a singular
idempotency-key lookup, include test_results and timings. The
include_children=true idempotency-key family lookup omits these diagnostics
to keep the response bounded; fetch an individual run or its /tests resource
for the full index.
Test report ingestion parses at most 32 MiB of XML across plain and compressed reports per upload, and retains up to 64 reports, 4 MiB per report, 10,000 indexed tests,
and a 2 MiB total index. Failure messages are limited to 4 KiB. Limits and parsing
failures are disclosed; the original archive remains available under its normal
retention policy. The service does not resolve XML entities or use reported
paths to read source files. Absolute or unsafe source locations are omitted.
JUnit outcomes use failure, error, and skipped children of a testcase;
unsupported outcome attributes or suite-level errors mark the report invalid
instead of being interpreted as passing tests.
The xunit adapter recognizes xUnit.net XML Format v2
reports rooted at assemblies. Test result values Pass, Fail, and Skip
map to passed, failed, and skipped. The display name, class, available
duration/source location, failure details and skip reason are retained within
the same limits. Repeated display identities remain separate report occurrences
through ordinal. NotRun, unknown outcomes and environmental assembly errors
are unsupported and make the report invalid; no test cases are synthesized.
Indexing happens at upload; parser updates do not rewrite historical indexes.
If the XML type cannot be determined within the bounded discovery prefix, the
report remains visible as partial with selection.scan_complete: false.
Bounded discovery continues after the retained report or testcase limit, giving
failed/error reports and cases priority over passing results. selection
separates reports_observed, reports_omitted, results_observed and
results_omitted from retained counts. selection.observed_counts describes
all test case elements from fully parsed valid reports, including reports with
declared-count mismatches and cases omitted from the index. Observed reports
also include recognized invalid or limited report candidates. If an invalid or
limited report or compressed container prevents complete inspection,
selection.scan_complete is false and the observed and omitted numbers are
lower bounds. These observations describe retained artifacts only; separate
collection metadata discloses files missing from the archive. A successful
command still emits execution_report_conflict when valid report failures were
observed but their individual cases could not be retained in the index.
Retained .xml.gz files and explicitly named .junit.tar.gz or .junit.tgz
archives also support native indexing. These report archives contain regular XML files
with normalized relative member paths and optional empty directory entries.
Links, sparse files, nested compressed files, duplicate members and conflicting
paths are rejected for indexing; raw evidence remains retained. Generic archives
are not searched for test reports. Compressed reports share a 512 MiB diagnostic
expansion budget across the upload, including tar headers, metadata and padding,
plus 1,024 visible entries and 2,048 metadata/header blocks. These bounds do not
increase artifact collection limits or the per-report/result/index limits above.
Container validation completes before any of its results enter the index.
reports[].path and results[].report_path identify the retained artifact file.
member_path and report_member_path identify XML inside a report archive.
Report summaries bind complete uncompressed XML bytes with content_sha256 and
size_bytes. Counts describe indexed test case elements only. A complete report
whose declared test total disagrees with observed cases retains those cases in
a partial index and exposes count_mismatch: declared and observed counts for
the first inconsistent suite plus the number of inconsistent suites. No test
cases are invented to match declarations. Missing declared cases and inconsistent
failure, error or skipped totals remain invalid. Collection omissions, parser
truncation and inconsistent suite metadata are separate diagnostic conditions;
none replaces the execution verdict.
Timing fields use milliseconds and explicit null for unavailable measurements,
with reasons under unavailable. Their basis is server_event_observations;
they are not independently attested performance measurements.
Use the schemas under cli/schema for versioned documents:
| Schema version | Purpose |
|---|---|
readyci.cli.v1 |
Structured CLI failure before a verification session exists. |
readyci.verification.v0alpha1 |
Agent plan, durable session, verify result, explanation, and artifact handoff. |
readyci.evidence.v0alpha1 |
Evidence manifest binding execution claims and files. |
readyci.test-result.v0alpha1 |
Normalized test-result record. |
v0alpha1 means breaking changes are still possible before general availability.
Consumers must reject an unknown schema_version instead of guessing.
Errors and recovery
Raw HTTP errors use this envelope:
{"code":"request_invalid","error":"human-readable detail"}
Use code before HTTP status. Retry-After is an HTTP header when supplied.
The richer message, classification, retryable, and
retry_after_seconds fields belong to normalized CLI error/session documents,
not the raw HTTP error envelope.
General status classes:
400/422: request or configuration is invalid; do not retry unchanged.401: bearer missing, invalid, or expired.402: the account needs an active subscription or more machine-time allowance.403: authenticated but scope, role, project ownership, policy, or billing denies the operation.404: resource absent or not visible in the authenticated tenant.409: state/idempotency conflict; fetch current state before acting.410: retained source or another resource has expired.413: request or source payload exceeds the accepted bound.423: the account/resource is locked pending an explicit state change.429: plan/rate limit; honorRetry-After.5xx: transient service/intermediary failure unless a stable code says otherwise.
Unknown non-empty Ready CI error codes are contract errors. Do not silently map them to a familiar retry class.
Idempotency
Run/session creation accepts an idempotency key through the supported CLI surface. Reusing a key with the same canonical request returns/reconciles the existing durable work; reusing it for different work is a conflict. Use one key per logical task attempt and retain it with the returned session ID.
readyci verify --json --idempotency-key "$SESSION_KEY"
readyci runs latest --json --by-idempotency-key "$SESSION_KEY"
Verification source upload
Verification session creation returns an authenticated preparation endpoint. The preparation response yields a short-lived conditional object-store PUT. Upload the exact declared bytes without the Ready CI bearer, then call the authenticated completion endpoint. Completion reopens the object, checks size and SHA-256, validates the bundle and sealed snapshot, and authorizes policy before scheduling nodes.
The retired API-body source upload route must not be used. Receipts explicitly
identify direct_object_store or server_copy; an absent/unknown mode is a
contract failure.
Event streams
Run and group event endpoints support server-sent event streaming with cursor recovery. Clients must:
- preserve the last accepted cursor;
- reconnect with bounded exponential backoff;
- suppress duplicate lifecycle transitions;
- fetch durable status after stream failure or a terminal-looking disconnect;
- keep logs separate from structured status/diagnosis.
The CLI implements this behavior. Prefer readyci runs logs --jsonl or
sessions watch --json unless building a dedicated UI.
Cancellation and successors
Cancellation is an authenticated state transition and may require a reason. It
is idempotent for already-terminal work. A verification retry is a server-owned
successor that reuses retained source and frozen policy; a rerun packages current
source/current policy. Never create a retry by replaying a historical RunSpec.
Go request and response types
The public Go wire types live in cli/pkg/preflightapi. Direct HTTP clients
should pin the same released CLI module revision, send only documented customer
routes, and preserve unknown response fields during proxying. The private
handlers under platform are implementation, not a customer SDK.
Before building against raw HTTP, verify that CLI JSON cannot satisfy the use case. That boundary carries versioned schemas, safe upload behavior, streaming recovery, error classification, and current server requirements together.
Ordinary execution jobs
run, check, affected, and warm create the same durable sessions as verify,
with immutable recipe.purpose: execution. This purpose preserves the client's
requested commands and never grants verification authority. All server run
permissions, quotas, network policy, secret checks, idempotency, and source
validation still apply. Successful requested checks return checks_passed with
classification requested_checks; CLI execution returns zero. verify continues
to require authoritative coverage and evidence for its successful verdicts.
Execution source recipes can name upload_baseline_session_id. The create
response acknowledges source_upload_baseline_session_id only for an accessible,
retained terminal session in the same project. The client sends a full bundle if
that hint is absent. Storage lookup errors are returned as errors, and a response
naming an unexpected baseline is a protocol error; neither triggers a full-upload
fallback. A delta is reconstructed by the service, bounded by
upload validation and spool quotas, then checked against the sealed snapshot and
changed-file digest before scheduling. The source ingress stays immutable. The
service retains a full materialized source so retry and recovery do not depend on
the earlier baseline's lifetime; source cleanup removes both objects.
CLI timings are observations of packaging, upload and validation, remote wait,
and total elapsed time, with actual compressed upload bytes. They are not evidence
or claims of cache hits. Existing run timestamps and events remain the detailed
queue, worker preparation, command, and finalization diagnostics.
Snapshot retry recovery
A session GET exposes source_ready, reflecting the server's persisted source
validation. A terminal predecessor linked by the snapshot-retry operation may
also expose snapshot_retry with successor_id and action (resume or
open_successor). This mutable recovery projection is outside the immutable
result digest. Resume by replaying the existing predecessor retry endpoint; do
not create another successor or infer recoverability from browser-local state.
A workspace rerun is a separate operation and receives no snapshot-resume projection.
Saved policy proposals
POST /v1/projects/{project}/verification-policy/proposals accepts
{"config_yaml":"..."} with policies:propose. The server validates the complete
configuration and returns proposal_id, review_url, digest, active_digest,
config_yaml, changes (path segments and nullable before/after strings), and
created_at/expires_at. The response also includes the usual policy preview
check lists and warnings. Submission does not activate a policy. Proposals are
scoped to the authenticated team and project, expire in seven days, and are
limited to 20 actionable pending proposals per project. Approved, stale, and
already-active proposals do not consume pending capacity. Matching content and
active digest reuse the same pending proposal until expiry, retaining the original
submitter. Approval records approved_at atomically with publication; approved
proposals stay out of the inbox and cannot be activated again, even after a rollback
restores their original base. Submitting those changes again creates a new pending
review and identity.
submitted_by contains trusted user/token IDs and available current display names
and email; personal display fields are resolved at read time rather than copied
into the saved configuration. Field comparisons preserve scalar spelling used by
execution string fields, including YAML boolean and numeric-looking strings.
Comparisons expand aliases and merges, so they are bounded separately from the
512 KiB source limit: after expansion, the proposed and active policies may each
contain at most 200,000 YAML nodes and 4 MiB of key and scalar text, and one
proposal may record at most 20,000 changes with at most 4 MiB of path segments
and rendered values. Submission also fails when the expanded comparison does not
decode to exactly the configuration its source decodes to, for example a mapping
tag or a merge that the YAML decoder resolves differently for typed keys. Both
failures return 400 request_invalid with a message naming the limit or policy,
and nothing is saved.
GET /v1/projects/{project}/verification-policy/proposals/{id} requires
policies:read. Missing, expired, and other-tenant proposals return not found.
Every proposal carries a dashboard review link, so creating, reading, and listing proposals require a server with browser sign-in and a configured dashboard URL. Without one, those requests return 503 after authorization and nothing is saved; discarding a proposal does not depend on it.
GET /v1/projects/{project}/verification-policy/proposals requires policies:read
and returns {project_id, proposals: [...]} with newest pending proposals first.
Each summary includes proposal_id, digest, change_count, check_count,
submitted_by, created_at, expires_at, and review_url; configuration bytes
and field values are omitted. The list excludes expired proposals, proposals
whose base differs from the active policy, previously approved proposals, and
proposals already active.
DELETE /v1/projects/{project}/verification-policy/proposals/{id} requires an
owner/admin browser session with policies:write and CSRF validation. It discards
the saved proposal and frees pending capacity without changing the active policy.
The response is {"discarded":true}. Missing, expired, and other-tenant IDs return
not found. Bearer credentials cannot discard proposals.
The existing browser-only PUT /v1/projects/{project}/verification-policy also
accepts proposal_id, preview_digest, and expected_active_digest (omit the
latter when no policy was active). Omit config_yaml when approving a proposal:
the server loads its immutable saved bytes. The supplied digest and base must
match the proposal, and the active digest must still match under the activation
lock. A conflict requires a fresh proposal/review. Bearer tokens cannot activate,
even if they can submit proposals. Browser activation retains role, plan, and
CSRF checks.
Check groups
GET /v1/verification-sessions requires runs:read and lists the authenticated
team's server-owned sessions. Optional purpose=execution selects ordinary
readyci check, readyci run, and warm jobs; purpose=verification selects
verification sessions, whose recipe purpose is empty. Omitting the filter lists
both purposes. Unsupported purposes return 400. project_id, limit (1–100,
default 50), and opaque cursor select a page. The response has sessions,
has_more, and optional next_page_cursor, ordered by update time and ID
descending. Filtering happens before pagination. Sessions in the dashboard
provides separate Verification sessions and Check groups lists using this API;
both open the session's detail, retry, and cancellation flow.