Vibe builds and previews
Prerequisites to submit a build
Section titled “Prerequisites to submit a build”Who can do this
- A caller whose actor and tenant are derived from session data and who passes build authorization for the target project, app, and environment.
- On transactional authorization, build access maps to developer
editaccess on the app. For build access, registration may be required unless the principal has theapps:CUDscope.
Prerequisites
- Managed build submission must be enabled at both levels:
- The organization setting must be on.
- The project setting must be on.
- The target must identify a project, app, and environment.
- The request must include a UUID request ID for idempotency.
- The submitted source must validate and must match the target app name.
- Source size is capped by installed profile:
- default
gadget-v1-no-packages: 2 MiB isolated-project-v1: 48 MiB
- default
Expected result
- If all checks pass, AOS inserts a build record and returns public status fields including
buildId,sourceDigest,state,createdAt, andupdatedAt. - A newly inserted build is later eligible for dispatch only if it remains in
queuedstate.
Useful failures and safe next steps
PRECONDITION_FAILED: organization setting off. Ask an organization owner or admin to enable managed build submission, then retry with a new request after confirmation.PRECONDITION_FAILED: project setting off. Ask a project admin to enable it for the project, then retry.FORBIDDEN/NOT_AUTHORIZED: verify the caller has app developer access needed for build/edit operations and any required registration, then retry.NOT_FOUND: confirm the project and app IDs belong together and the tenant owns the project.BAD_REQUEST/INVALID_SOURCE: verify source format, source size, and that the source app ID matches the target app name before resubmitting.CONFLICT/IDEMPOTENCY_CONFLICT: reuse the same request only for the exact same project, app, environment, and source digest; otherwise generate a new request ID.TOO_MANY_REQUESTS/BUILD_QUOTA: wait until active or time-window counts fall below limits, then retry.- If the build submission error explicitly says the result is uncertain and instructs a retry, keep the same request ID and identical input. Do not treat every internal error as permission to create a fresh build.
Submission and queue states: compile request is separate from later publication
Section titled “Submission and queue states: compile request is separate from later publication”Build submission flow
- Submit the source through your configured AOS build client. The following steps describe server behavior, not a public method to call directly.
- AOS validates the request shape, authorization, source bytes, and source snapshot.
- AOS checks idempotency using project, actor, and request ID.
- AOS reads current limits and current counts.
- If admitted, AOS inserts a new build row.
Expected result
- The inserted build returns a public state from the build record. Dispatch logic later shows that newly admitted work must be in
queuedstate to be claimed.
State meanings supported by source
queued: admitted and waiting for dispatch; onlyqueuedbuilds can be claimed by the dispatcher.dispatching: capacity has been claimed and a dispatch token has been written before any external launch request.running: a launch was recorded with a non-null execution ID.failed: the build has a recorded failure. The dispatcher can record this before launch; this list describes dispatch transitions and is not an exhaustive catalogue of compilation or completion failures.requires-review: AOS uses this when launch outcome is unknown, launch acknowledgement is lost, dispatch bookkeeping fails, or controller/database handling is uncertain.
Useful failures and safe next steps
- If dispatch returns
not-queued, do not assume a build started. Re-read build status for the samebuildIdto determine its persisted state. - If dispatch returns
failed, inspect the recorded failure first. Resolve the specific source, authorization, configuration, or provider problem before submitting a fresh request. Do not assume every failure is a source-code error. - If dispatch returns
requires-review, do not retry launch automatically. The controller comments say an unknown launch must never be treated as a fresh dispatch and must never retry unknown provider outcomes.
Compile, staging, review, and preview are distinct
Section titled “Compile, staging, review, and preview are distinct”Compile/build execution
- Submission validates source and creates a queued build record.
- Dispatch then revalidates source digest, source size, and app identity before launch.
- Before launch, the controller stages build inputs and prepares the execution request. This preparation is separate from the completed build reaching the
stagedstate.
Staging
- The controller has explicit
stageandprepareservice steps beforestart. - A later preview authorization check requires a related build release to be
publishedand the build state to bestagedbefore preview access is allowed.
Review
requires-reviewis not approval. It is a safety state used when AOS cannot safely conclude launch state or when controller/storage interactions are uncertain.- Separate review-related submission failures can block building before submission completes, such as stale import review, changed repository/import state, or a required AOS compatibility review for a custom server entry.
Preview publication
- Preview visibility is separate from compile success.
- Public preview status is only calculated for builds in the
previewenvironment. - Even when preview state is
ready, AOS may report it assupersededif the app is stopped, activation is in progress, or the currently active preview activation does not match the release.
Safe next steps
- After
requires-review, do not assume approval or deployment. Re-check persisted build status and have a human review the launch outcome or related runtime state. - If the server reports repository/import state changed, refresh the review before building.
- If the server reports compatibility review required for a custom server entry, complete that review before attempting another build.
Preview readiness is not general deployment or production publication
Section titled “Preview readiness is not general deployment or production publication”What preview requires
- The request is explicitly for preview authorization.
- The runtime app must exist, match host/workspace/project, and not be stopped.
- The caller must have read developer access.
- No stop operation may be in progress.
- The preview environment head must be installed, have no active operation, and point to a valid current revision.
- Exactly one matching succeeded preview activation must exist for the current fencing token.
- The referenced release must be published, belong to a preview build, and that build must be in
stagedstate. - Attestation content, key validity, digest matching, and supported release profile checks must all pass.
Expected result
- If all checks pass, AOS returns preview authorization details including
environment: "preview"and an app path like/preview/APP_ID/. - Public preview status may return
readywith an app path,superseded, ornullwhen no qualifying preview record exists.
Useful failures and safe next steps
- If preview is denied or status is not ready, do not infer a deployment problem was auto-approved or auto-retried. Check whether the app is stopped, whether an activation is still active, whether the release is published, and whether the build reached
stagedstate. - If preview is
superseded, treat that preview result as no longer current; fetch current build and preview status rather than reusing the old preview URL as proof of active publication.
Limits, defaults, and ceilings
Section titled “Limits, defaults, and ceilings”AOS reads effective per-project build limits from instance settings. Stored settings take precedence over the legacy server fallback. Use the Limits and quotas guide for the editable defaults and ceilings; the internal legacy monthly argument’s 1–100 range is not the Settings monthly ceiling.
How limits apply:
- Admission counts
queued,dispatching, andrunningas active. Builds awaiting review do not count as active submissions. - Daily usage is a rolling 24-hour window. Monthly usage, when enabled, is the current UTC calendar month. Both count accepted builds even if compilation later fails.
- Dispatch separately counts
dispatching,running, andrequires-review. An uncertain launch reserves execution capacity until reconciled; do not assume it is safe to launch another copy. - Dispatch also applies the worker’s installed
maxActivePerProjectceiling, validated from 1 to 10, alongside the stored running limit.
If quota blocks submission, check which limit was reached. Wait for active work to drain or for the applicable time window to free capacity, or ask an instance administrator to review the saved limits. A rolling daily window does not reset at midnight.
The default source profile is gadget-v1-no-packages; a server may install isolated-project-v1. These code paths do not establish that a working build provider is configured in every installation.