@oxy-hq/cli 0.12.1 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1031 -71
- package/dist/main.mjs +21844 -4166
- package/dist/main.mjs.map +1 -1
- package/dist/{mcp-CJWQm-yd.mjs → mcp-bxf7JBJu.mjs} +2 -2
- package/dist/mcp-bxf7JBJu.mjs.map +1 -0
- package/json-schemas/agent-test.json +116 -3
- package/json-schemas/agentic.json +81 -1
- package/json-schemas/config.json +2 -1
- package/json-schemas/flow-test.json +11 -2
- package/json-schemas/topic.json +252 -0
- package/json-schemas/view.json +473 -0
- package/package.json +9 -5
- package/skills/oxy-agents/SKILL.md +98 -54
- package/skills/oxy-agents/references/quick-reference.md +22 -20
- package/skills/oxy-agents/templates/agentic-template.yml +34 -90
- package/skills/oxy-airway-pipelines/SKILL.md +35 -2
- package/skills/oxy-automations/SKILL.md +42 -28
- package/skills/oxy-cli/SKILL.md +15 -7
- package/skills/oxy-custom-apps/SKILL.md +413 -7
- package/skills/oxy-custom-apps/references/app-calls.md +98 -0
- package/skills/oxy-custom-apps/references/phone-layout.md +16 -2
- package/skills/oxy-custom-apps/references/sandbox-agent-loop.md +8 -8
- package/skills/oxy-evals/SKILL.md +112 -46
- package/skills/oxy-evals/references/diagnosis.md +18 -21
- package/skills/oxy-evals/references/results-json.md +30 -18
- package/skills/oxy-evals/references/writing-expected.md +5 -4
- package/skills/oxy-experiments/SKILL.md +4 -3
- package/skills/oxy-semantic-modeling/SKILL.md +14 -12
- package/template/.claude/hooks/oxyc-cloud-session.sh +40 -8
- package/template/.github/workflows/publish.yaml +5 -5
- package/template/.github/workflows/validate.yaml +125 -199
- package/template/README.md +50 -21
- package/template/_gitignore +4 -4
- package/template/config.yml +2 -2
- package/dist/mcp-CJWQm-yd.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -10,9 +10,10 @@ manages customer workspace repos.
|
|
|
10
10
|
- **Customer workspaces** — `list`, `new`, `import`, `doctor`, `update`, `adopt`, `launch`
|
|
11
11
|
- **Your workspace's repository** — `workspace clone`
|
|
12
12
|
- **Custom apps** — `publish`, `init-ci`, `proxy`, `apps`
|
|
13
|
-
- **Checks** — `checks run`
|
|
13
|
+
- **Checks** — `checks run`, `checks show`
|
|
14
14
|
- **Sandboxes** — `env`, `fn dev`, `fn call`, `invocations`, `logs`
|
|
15
15
|
- **Workspace previews** — `preview`
|
|
16
|
+
- **The CI compile gate** — `compile`
|
|
16
17
|
- **Development** — `validate`, `mcp`, `guide`, `skills`
|
|
17
18
|
|
|
18
19
|
## Install
|
|
@@ -57,8 +58,8 @@ and `cache`.
|
|
|
57
58
|
| `--env <name\|url>` | `production` | deployment to target |
|
|
58
59
|
| `--target <url>` | — | explicit base URL; overrides `--env` |
|
|
59
60
|
| `--token-env <VAR>` | `OXY_TOKEN` | env var holding the bearer: any credential. **Named, it is the only source** — an unset variable is exit `4`, never a fallback to your login |
|
|
60
|
-
| `--api-key-env <VAR>` | `OXY_API_KEY` | env var holding the
|
|
61
|
-
| `--service-account <id>` | `OXY_SERVICE_ACCOUNT` | in GitHub Actions
|
|
61
|
+
| `--api-key-env <VAR>` | `OXY_API_KEY` | env var holding the API token for `/external/api` |
|
|
62
|
+
| `--service-account <id>` | `OXY_SERVICE_ACCOUNT` | in GitHub Actions, or with `OXY_OIDC_TOKEN_FILE`: the **ID** of the service account the trusted-access exchange acts as |
|
|
62
63
|
| `--org <slug>` | — | value for the `{org}` placeholder |
|
|
63
64
|
| `--workspace <id>` | — | value for the `{workspace}` placeholder |
|
|
64
65
|
| `--project <id>` | — | value for the `{project}` placeholder |
|
|
@@ -121,8 +122,8 @@ the server.
|
|
|
121
122
|
|
|
122
123
|
**Surfaces.** The path selects how the credential is sent. `/api/**` sends it
|
|
123
124
|
as a bearer — whichever one [resolves](#authentication). `/external/api/**`
|
|
124
|
-
sends `X-API-Key` from `$OXY_API_KEY`, which holds
|
|
125
|
-
|
|
125
|
+
sends `X-API-Key` from `$OXY_API_KEY`, which holds an API token (`oxy_pat_…`,
|
|
126
|
+
`oxy_sat_…`, `oxy_ci_…`). With none set, an
|
|
126
127
|
`OXY_TOKEN` holding either of those stands in for it, so one `OXY_TOKEN` covers
|
|
127
128
|
both surfaces. A session token never does.
|
|
128
129
|
|
|
@@ -180,9 +181,10 @@ oxyc logout # revoke the cached token, then forget it
|
|
|
180
181
|
oxyc tokens list [--json] # your personal access tokens
|
|
181
182
|
oxyc tokens revoke <id>
|
|
182
183
|
oxyc tokens revoke --current # end the token in OXY_TOKEN
|
|
183
|
-
oxyc tokens create # opens
|
|
184
|
+
oxyc tokens create # opens Settings → Organization → API tokens
|
|
184
185
|
oxyc tokens create --sandbox-agent --app <org>/<app> [--app …] [--hours 8] [--name …] [--browser | --no-browser [--approver <email>]]
|
|
185
186
|
oxyc tokens create --agent [--standing] [--hours 8] [--name …] [--browser | --no-browser [--approver <email>]]
|
|
187
|
+
oxyc tokens create --org-service-account <org>/<account> [--role member|admin] [--token-name …] [--expires-in-days 90] [--set-app-secret <org>/<app> --key <KEY> [--app-env production|staging]] [--browser | --no-browser [--approver <email>]]
|
|
186
188
|
```
|
|
187
189
|
|
|
188
190
|
**An agent runs on its own token, never on the person's `oxyc login`.** Which
|
|
@@ -204,10 +206,12 @@ variable exits `4` instead of quietly running on the person's cached login.
|
|
|
204
206
|
1. **`OXY_TOKEN`** (or the variable `--token-env` names). It holds any
|
|
205
207
|
credential, and all are sent as a bearer: an API token — a personal access
|
|
206
208
|
token (`oxy_pat_…`), a service account token (`oxy_sat_…`), a CI token
|
|
207
|
-
(`oxy_ci_…`) or a sandbox agent token (`oxy_sbx_…`) — a
|
|
208
|
-
|
|
209
|
+
(`oxy_ci_…`) or a sandbox agent token (`oxy_sbx_…`) — a publish token, or a
|
|
210
|
+
session token. A blank value counts as
|
|
209
211
|
unset. An agent token is a personal access token by its prefix: only its
|
|
210
|
-
own description tells it from a login (`oxyc whoami`).
|
|
212
|
+
own description tells it from a login (`oxyc whoami`). The value
|
|
213
|
+
`from-proxy` means the token is not on this machine at all: see
|
|
214
|
+
[A token the proxy adds](#a-token-the-proxy-adds).
|
|
211
215
|
2. **The login cache** — what `oxyc login` stored for this deployment.
|
|
212
216
|
3. **GitHub OIDC**, in a GitHub Actions job granted `id-token: write`: the job's
|
|
213
217
|
OIDC token is exchanged, once per process, for a fifteen-minute token acting
|
|
@@ -223,15 +227,15 @@ machine. A person who wants `oxyc mcp` on their own login starts it with
|
|
|
223
227
|
`--login`. `OXY_API_KEY` is unaffected: a command that can use one on its own
|
|
224
228
|
(`checks run`, the sandbox verbs) still does.
|
|
225
229
|
|
|
226
|
-
`OXY_API_KEY` holds
|
|
227
|
-
|
|
230
|
+
`OXY_API_KEY` holds an API token, and is honoured where it always was — the
|
|
231
|
+
`/external/api` surface, and `checks run`. The name is historical: it held a
|
|
232
|
+
legacy API key until those were removed.
|
|
228
233
|
|
|
229
|
-
**Legacy API keys
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
`Legacy API key
|
|
234
|
-
Settings → Workspace → Legacy API keys. Use an API token for anything new.
|
|
234
|
+
**Legacy API keys were removed.** The older `oxy_…` key reached everything its
|
|
235
|
+
owner could and couldn't be limited to workspaces. A request carrying one is now
|
|
236
|
+
answered `401` naming its replacement, so if an integration of yours stopped
|
|
237
|
+
working, mint a token and set it where the key was — the header is the same.
|
|
238
|
+
`oxyc whoami` still calls one a `Legacy API key`, and adds that it was removed.
|
|
235
239
|
|
|
236
240
|
**`login`** runs a browser loopback flow. Against a current deployment it
|
|
237
241
|
receives a one-time code and exchanges it (PKCE) for a **personal access
|
|
@@ -250,8 +254,8 @@ it from this machine whatever the server said. It never touches `OXY_TOKEN`.
|
|
|
250
254
|
rather than reading as fine from the cache. For a token it also prints what the
|
|
251
255
|
token is and what it can reach — `all access`, or one line per grant with the
|
|
252
256
|
role it is capped at, and any organization whose policy blocks it. For a legacy
|
|
253
|
-
API key it prints `Legacy API key`, and that
|
|
254
|
-
|
|
257
|
+
API key it prints `Legacy API key`, and that legacy keys were removed. For an
|
|
258
|
+
agent token it says `agent token`, who approved it, whether it
|
|
255
259
|
carries their staff or partner access, and when it expires. When a token in
|
|
256
260
|
`OXY_TOKEN` is refused (exit `4`), the advice is never to log in — a login
|
|
257
261
|
cannot replace what is in the variable. An agent stops and reports.
|
|
@@ -264,8 +268,10 @@ since the output is the token. It still expires in fifteen minutes.
|
|
|
264
268
|
**`tokens`** manages personal access tokens, and the server allows that from a
|
|
265
269
|
**browser session only**: a token that could list, mint or revoke tokens could
|
|
266
270
|
outlive its own revocation. Since `login` now stores a token, `tokens list` and
|
|
267
|
-
`tokens revoke` usually answer with a pointer to the web app (
|
|
268
|
-
Personal access tokens,
|
|
271
|
+
`tokens revoke` usually answer with a pointer to the web app (Settings →
|
|
272
|
+
Organization → API tokens → Personal access tokens,
|
|
273
|
+
`<deployment>/?settings=account.tokens`, an old link the web app still sends
|
|
274
|
+
there); they work
|
|
269
275
|
from a login that stored a session token. `tokens create` always opens that
|
|
270
276
|
page — a new token's secret is shown once, and a terminal is the wrong place.
|
|
271
277
|
|
|
@@ -339,8 +345,9 @@ is collected, refused or lapses (ten minutes). `--browser` skips it.
|
|
|
339
345
|
anything else is a usage error, exit `2`) names who must approve, so nobody
|
|
340
346
|
has to hand them a URL: the platform tells that person itself, by push,
|
|
341
347
|
email and Slack DM where their organization connected it, and in their
|
|
342
|
-
Oxygen inbox.
|
|
343
|
-
|
|
348
|
+
Oxygen inbox. The notice never holds the code, so hand them the link from
|
|
349
|
+
your output, which carries it (one click), or they type the code on the
|
|
350
|
+
approval page. The notice links to `/cli-auth/device` without it, and
|
|
344
351
|
the request is then theirs alone: anyone else who finds the page is told
|
|
345
352
|
there is no such request. `oxyc` prints `Approval request sent to <email>`
|
|
346
353
|
beside the code and the URL; it prints that whether or not the deployment
|
|
@@ -412,6 +419,45 @@ must carry no standing that was not asked for. A deployment that predates agent
|
|
|
412
419
|
tokens would otherwise hand back an ordinary ninety-day login. On any mismatch
|
|
413
420
|
the command prints nothing, revokes what was minted, and exits `8`.
|
|
414
421
|
|
|
422
|
+
**`tokens create --org-service-account <org>/<account>`** mints a token
|
|
423
|
+
(`oxy_sat_…`) of an **organization's service account**: a credential that
|
|
424
|
+
belongs to the organization rather than a person, such as the one a custom
|
|
425
|
+
app's function holds to call that organization's admin routes. The account is
|
|
426
|
+
reused when the organization has one of that name, and created otherwise —
|
|
427
|
+
as a `member` unless `--role admin`. An existing account at another role is
|
|
428
|
+
refused, never changed. The token carries one grant over the whole organization
|
|
429
|
+
at the account's role, and lives `--expires-in-days` (default 90; the
|
|
430
|
+
organization's token policy may cap it).
|
|
431
|
+
|
|
432
|
+
```bash
|
|
433
|
+
oxyc tokens create --org-service-account acme/store-ops-tablets --role admin \
|
|
434
|
+
--set-app-secret acme/store-ops --key TABLETS_API_KEY --env dev
|
|
435
|
+
```
|
|
436
|
+
|
|
437
|
+
Creating an account or minting its token is browser-session-only on the server:
|
|
438
|
+
a token asking gets `403 session_required`, so a leaked one can never mint its
|
|
439
|
+
successor. So this is the same browser approval as `--agent`, and it is
|
|
440
|
+
approved by an **owner or admin of that organization** (or staff in an assume
|
|
441
|
+
session for it), on a page that first asks the server what approving would
|
|
442
|
+
create — the organization, the account (new or existing) and its role, the
|
|
443
|
+
token's name, lifetime and reach — and shows that.
|
|
444
|
+
|
|
445
|
+
Where the token goes:
|
|
446
|
+
|
|
447
|
+
- without `--set-app-secret`, stdout is the token and nothing else, printed once;
|
|
448
|
+
- with `--set-app-secret <org>/<app> --key <KEY>`, it is written straight into
|
|
449
|
+
that app's secret (`--app-env production`, the default, or `staging`) with
|
|
450
|
+
`POST /api/customer-apps/{id}/secrets`, on this machine's own `oxyc login`
|
|
451
|
+
(an owner or app admin), and **never printed**. The app is resolved before
|
|
452
|
+
the browser opens, and must be in the account's organization.
|
|
453
|
+
|
|
454
|
+
Never written to the credentials file. What comes back is checked first — a
|
|
455
|
+
whole `oxy_sat_`, described by the server as that account's token with one
|
|
456
|
+
org-wide grant at the asked role, expiring no later than asked — and on a
|
|
457
|
+
mismatch, or a secret that could not be stored, the token is revoked with
|
|
458
|
+
itself and nothing is printed. Not `--service-account`: that global flag names
|
|
459
|
+
the account a GitHub Actions run acts as.
|
|
460
|
+
|
|
415
461
|
Credentials live in the OS config directory under **`oxy`** — the same file the
|
|
416
462
|
Rust `oxy login` wrote before it was removed, so an existing login still works:
|
|
417
463
|
|
|
@@ -452,8 +498,8 @@ Stdout is the URL and nothing else; what the link is goes to stderr.
|
|
|
452
498
|
and cannot manage tokens.
|
|
453
499
|
- **It needs a personal access token** (`oxy_pat_…`) — what `oxyc login`
|
|
454
500
|
stores. Any other credential is exit `4` with the next step: a session token
|
|
455
|
-
from an older login, a service account, CI or publish token, a
|
|
456
|
-
key. A sandbox agent token is exit `2`, before any request. A deployment that
|
|
501
|
+
from an older login, a service account, CI or publish token, or a removed
|
|
502
|
+
legacy API key. A sandbox agent token is exit `2`, before any request. A deployment that
|
|
457
503
|
predates sign-in links is exit `5`.
|
|
458
504
|
- **`--next <path>`** is where the browser lands: a path on the deployment
|
|
459
505
|
starting with a single `/`. A URL, `//host` or a backslash is exit `2`, and
|
|
@@ -462,6 +508,40 @@ Stdout is the URL and nothing else; what the link is goes to stderr.
|
|
|
462
508
|
**`--open`** also opens the link in your default browser — which uses it, so
|
|
463
509
|
the printed URL will not work a second time.
|
|
464
510
|
|
|
511
|
+
### A token the proxy adds
|
|
512
|
+
|
|
513
|
+
`OXY_TOKEN=from-proxy` says an egress proxy adds the credential to each
|
|
514
|
+
request on its way out, and `oxyc` sends none. Use it in a Claude Code cloud
|
|
515
|
+
environment whose Oxy token is a **network secret**: the token stays in
|
|
516
|
+
Anthropic's proxy, never in the VM, so neither the agent nor a log can read it.
|
|
517
|
+
|
|
518
|
+
1. In the cloud environment's settings, add a network secret: **Allowed
|
|
519
|
+
websites** `app.oxygen-hq.com` (and `*.oxy.tech` for dev and staging),
|
|
520
|
+
header `Authorization`, prefix `Bearer`, value a personal access token or a
|
|
521
|
+
service account token.
|
|
522
|
+
2. In its environment variables, set `OXY_TOKEN=from-proxy`. It is not a
|
|
523
|
+
secret.
|
|
524
|
+
3. `oxyc whoami --env <env>` prints who the secret is, and a `via` line naming
|
|
525
|
+
the network secret.
|
|
526
|
+
|
|
527
|
+
What changes under the sentinel:
|
|
528
|
+
|
|
529
|
+
- **No `Authorization` and no `X-API-Key` is sent** by any command, and the
|
|
530
|
+
login cache and GitHub OIDC are not tried. A host the secret does not list
|
|
531
|
+
gets a request with no credential.
|
|
532
|
+
- **The token's kind is unknown here.** `oxyc` reads a kind off a token's
|
|
533
|
+
prefix to choose a path before it asks (a sandbox agent token's limits, a
|
|
534
|
+
service account's machine surface). Under `from-proxy` none of those apply,
|
|
535
|
+
and the deployment decides. `whoami` asks the server, so it still reports
|
|
536
|
+
the token; the sandbox loop needs its `oxy_sbx_` token in the variable.
|
|
537
|
+
- **A refusal names the secret, not `oxyc login`.** A 401 says to check the
|
|
538
|
+
secret's hosts, header and prefix, and that the token may have expired.
|
|
539
|
+
- **`tokens revoke --current` refuses.** It would end the secret's token for
|
|
540
|
+
every session in the environment; revoke it in the web app, then delete the
|
|
541
|
+
secret.
|
|
542
|
+
- A token minted into `~/.config/oxy/agent-token.env` (the cloud hook's file)
|
|
543
|
+
sets `OXY_TOKEN` before every command, so it replaces the sentinel.
|
|
544
|
+
|
|
465
545
|
### CI without a stored secret
|
|
466
546
|
|
|
467
547
|
In a GitHub Actions job granted `id-token: write`, with no `OXY_TOKEN` set,
|
|
@@ -489,7 +569,7 @@ sign-in at all; use `OXY_TOKEN` there.
|
|
|
489
569
|
What makes the deployment honour the job is a
|
|
490
570
|
**trust policy** on that service account, naming the repository, the workflow
|
|
491
571
|
file and the job's `environment:` — registered by `oxyc init-ci`, or in the web
|
|
492
|
-
app under Organization
|
|
572
|
+
app under Settings → Organization → API tokens → Service accounts → *the
|
|
493
573
|
account* → Trusted access.
|
|
494
574
|
|
|
495
575
|
**The account is always named, never guessed.** Anyone can register a trust
|
|
@@ -506,8 +586,8 @@ same account name under it and register a policy on your repository's public
|
|
|
506
586
|
ids. A workflow that said `acme/deployer` would then be naming *their*
|
|
507
587
|
account. An ID never changes hands, so it is the only thing the deployment
|
|
508
588
|
takes: anything else answers `400 service_account_required`, and `oxyc` does
|
|
509
|
-
not fall back from that. The ID is shown in the web app (Organization
|
|
510
|
-
→ API
|
|
589
|
+
not fall back from that. The ID is shown in the web app (Settings → Organization
|
|
590
|
+
→ API tokens → Service accounts → *the account*), and `oxyc init-ci` writes it
|
|
511
591
|
for you. `oxyc` passes the value through untouched; the answer still says
|
|
512
592
|
`<org>/<name>`, so the log reads as it did.
|
|
513
593
|
|
|
@@ -548,6 +628,42 @@ in `publish` and `checks run`, which fall back to the app's registered
|
|
|
548
628
|
publisher, as they also do on `no_matching_policy` and when no account is
|
|
549
629
|
named.
|
|
550
630
|
|
|
631
|
+
### A service on another platform without a stored secret
|
|
632
|
+
|
|
633
|
+
A service whose platform signs identity tokens for it — ferret on ECS, through
|
|
634
|
+
AWS IAM outbound identity federation — signs in the same way, with its own
|
|
635
|
+
token instead of GitHub's. Write a token requested for the audience
|
|
636
|
+
`oxy:<the deployment's host>` to a file, set `OXY_OIDC_TOKEN_FILE` to that file
|
|
637
|
+
and `OXY_SERVICE_ACCOUNT` to the account's ID; `oxyc` reads the file, posts it to
|
|
638
|
+
`/api/auth/oidc/exchange`, and uses the fifteen-minute `oxy_ci_…` token that
|
|
639
|
+
comes back. When both are set, the file wins over GitHub's variables.
|
|
640
|
+
|
|
641
|
+
```sh
|
|
642
|
+
# On AWS: the workload's IAM role needs sts:GetWebIdentityToken. A regional
|
|
643
|
+
# STS endpoint, and RS256 (the signature Oxygen verifies).
|
|
644
|
+
aws sts get-web-identity-token \
|
|
645
|
+
--region "$AWS_REGION" --endpoint-url "https://sts.$AWS_REGION.amazonaws.com" \
|
|
646
|
+
--audience oxy:app.oxygen-hq.com --signing-algorithm RS256 --duration-seconds 300 \
|
|
647
|
+
--query WebIdentityToken --output text > /tmp/oxy-token
|
|
648
|
+
|
|
649
|
+
OXY_SERVICE_ACCOUNT=3f2504e0-4f89-41d3-9a0c-0305e82c3301 \
|
|
650
|
+
OXY_OIDC_TOKEN_FILE=/tmp/oxy-token \
|
|
651
|
+
oxyc api /api/orgs --target https://app.oxygen-hq.com
|
|
652
|
+
```
|
|
653
|
+
|
|
654
|
+
An org admin registers the issuer, then a trust policy on the account saying
|
|
655
|
+
which of its tokens may act as it (Settings → Organization → API tokens →
|
|
656
|
+
Service accounts → Trusted access). For AWS that is the account's issuer URL and
|
|
657
|
+
the IAM role's ARN; the policy's menu shows these commands filled in. Any other
|
|
658
|
+
OIDC issuer works through **Custom OIDC**: its keys, and the claims a token must
|
|
659
|
+
have. The file is read again on each exchange, so whatever writes it picks the
|
|
660
|
+
token; an issuer registered as single use (the AWS preset is) refuses the same
|
|
661
|
+
token twice. A token must be asked for with a life of at most an hour.
|
|
662
|
+
Refusals name what to fix: `unknown_issuer` (the issuer is not registered in
|
|
663
|
+
the account's org), `replayed`, `token_lifetime_too_long`, `wrong_audience` (it
|
|
664
|
+
says which audience to ask for), `no_matching_policy` (no policy's conditions,
|
|
665
|
+
for AWS the role, match the token), `ambiguous_policy` (more than one does).
|
|
666
|
+
|
|
551
667
|
## Acting as an organization
|
|
552
668
|
|
|
553
669
|
```bash
|
|
@@ -575,10 +691,92 @@ oxyc oltp status [--org <slug|uuid|url>] [--json]
|
|
|
575
691
|
oxyc oltp provision --org <slug|uuid|url> --writer app:<slug> [--writer pipeline:<source> …] [--yes] [--json]
|
|
576
692
|
oxyc oltp provision --org <slug|uuid|url> --branch staging [--yes] [--json]
|
|
577
693
|
oxyc oltp reset --org <slug|uuid|url> --branch staging [--yes] [--json]
|
|
694
|
+
oxyc oltp dsn --org <slug|uuid|url> [--role analyst|app:<slug>|pipeline:<source>] [--json]
|
|
695
|
+
oxyc oltp connect --org <slug|uuid|url> [--role analyst|app:<slug>|pipeline:<source>]
|
|
696
|
+
oxyc oltp expose --org <slug|uuid|url> --writer app:<slug>|pipeline:<source> [--revoke] [--json]
|
|
697
|
+
oxyc oltp deprovision --org <slug|uuid|url> [--writer app:<slug>|pipeline:<source>] --yes [--json]
|
|
698
|
+
oxyc oltp audit --org <slug|uuid|url> [--json]
|
|
699
|
+
oxyc oltp rotate --org <slug|uuid|url> --role app:<slug>|pipeline:<source> --yes [--json]
|
|
700
|
+
oxyc oltp apply --org <slug|uuid|url> [--workspace <id>] --yes [--json]
|
|
701
|
+
oxyc oltp changes resync <org-slug>/<app-slug> [--table <name>] [--app-env production] --yes [--json]
|
|
702
|
+
oxyc oltp changes interval <org-slug>/<app-slug> --seconds <n> | --clear [--json]
|
|
703
|
+
oxyc oltp changes sync <org-slug>/<app-slug> [--json]
|
|
704
|
+
oxyc oltp changes status <org-slug>/<app-slug> [--backlog] [--json]
|
|
578
705
|
```
|
|
579
706
|
|
|
580
707
|
`status` lists every org, with a database or without; with `--org` it shows
|
|
581
|
-
that org's store and writers
|
|
708
|
+
that org's store and writers, and its Postgres major (`pg 17 (provisioning now
|
|
709
|
+
uses 18)` when a managed tenant differs from the default; `--json` carries
|
|
710
|
+
`pg_version`, `default_pg_version` and `pg_version_drift`). `status`, `provision` and `reset` never print a
|
|
711
|
+
credential.
|
|
712
|
+
|
|
713
|
+
`dsn` prints a connection string, bare on stdout so a script can capture it
|
|
714
|
+
(`--json` gives `{role, dsn, writable}`). `connect` runs the local `psql` with
|
|
715
|
+
it, passing the password in `PGPASSWORD` rather than on the command line, and
|
|
716
|
+
exits `1` if `psql` fails (`7` if `psql` is not installed). Both default to the
|
|
717
|
+
read-only `analyst`; a writer role is a live write credential to one schema.
|
|
718
|
+
Each disclosure is audited on the server. There is no `--role owner`: the
|
|
719
|
+
migration owner's credential is not handed out.
|
|
720
|
+
|
|
721
|
+
`expose` lets the read-only analyst read a writer's schema (`app_*` is hidden
|
|
722
|
+
by default, `raw_*` visible); `--revoke` withdraws it.
|
|
723
|
+
|
|
724
|
+
`deprovision --writer` drops one writer's schema, role and data and leaves the
|
|
725
|
+
rest of the database; without `--writer` it destroys the org's whole database
|
|
726
|
+
at the provider. Both are irreversible, so both print what they would destroy
|
|
727
|
+
and exit `8` unless `--yes` is given; there is no prompt. An org with no
|
|
728
|
+
database is a no-op that exits `0`.
|
|
729
|
+
|
|
730
|
+
`audit` reads every role in the org's database from `pg_roles` — whether it
|
|
731
|
+
is still confined (no `superuser`, `createdb`, `createrole`, `bypassrls`,
|
|
732
|
+
`replication`, and no membership) and what it can reach outside its own schema
|
|
733
|
+
— and exits `9` when it finds any violation, `--json` included (the report is
|
|
734
|
+
the server's, its verdict in `clean`). It opens a session as the owner, so it
|
|
735
|
+
wakes a suspended compute; a database that would not open one exits `7`.
|
|
736
|
+
|
|
737
|
+
`rotate` re-mints one writer's password, reseals it and re-asserts its
|
|
738
|
+
confinement. The old password stops working at once and the new one is never
|
|
739
|
+
shown (`--json` gives `{writer, role, schema}`), so it exits `8` without
|
|
740
|
+
`--yes`. Only writers rotate; the analyst and the owner are re-minted by
|
|
741
|
+
`provision`. Both are audited on the server, and both replaced the Rust `oxy
|
|
742
|
+
oltp audit | rotate`, whose blanket exit `1` is now `9` / `8` / the table's.
|
|
743
|
+
|
|
744
|
+
`apply` runs the workspace's compiled `schemas/*.sql` that the org's database
|
|
745
|
+
has not run, as its owner, then re-grants every writer over its schema (so it
|
|
746
|
+
also repairs `permission denied for table`). It reads the workspace's newest
|
|
747
|
+
successful compile on the server, never a checkout; `--workspace` names it when
|
|
748
|
+
the org has more than one (otherwise exit `6`). DDL is not undone, so it exits
|
|
749
|
+
`8` without `--yes` and sends nothing. A migration that fails exits `9`,
|
|
750
|
+
`--json` included (the server's body: `applied`, `already_applied`, `failed`,
|
|
751
|
+
`ok`; `applied` names the files this call committed before the failure, which
|
|
752
|
+
stay applied). Another apply holding the org's lock exits `7`, and so does an
|
|
753
|
+
apply the server cut off after 50 seconds (`timed_out: true`, with `applied`
|
|
754
|
+
naming what landed): a re-run resumes at the first file the database has not
|
|
755
|
+
run. It is audited on the server (a row before the DDL and
|
|
756
|
+
one after), and replaced the Rust `oxy oltp apply`.
|
|
757
|
+
|
|
758
|
+
`changes resync` re-baselines an app's captured tables in the OLTP change stream
|
|
759
|
+
(`--table` for one, else every captured table) and removes the holds that
|
|
760
|
+
resolves. The unshipped log rows of a held table are discarded, since its new
|
|
761
|
+
baseline replaces them, and each table with its row count is printed; a writer
|
|
762
|
+
held past the relay's ceiling is baselined whole, whichever table is named. It
|
|
763
|
+
exits `8` without `--yes` and sends nothing. Only production has a change
|
|
764
|
+
stream (`--app-env production`, the default); a `409` means the org's
|
|
765
|
+
`oltp_changes` flag is off or a generation bump is re-stamping.
|
|
766
|
+
|
|
767
|
+
`changes interval` paces the app's org's change-stream passes to at least
|
|
768
|
+
`--seconds` apart (0 to 86400), so a busy store ships fewer, larger commits;
|
|
769
|
+
`--clear` goes back to the relay's own cadence (a pass about every 10 seconds
|
|
770
|
+
while the store is written). The interval is the org's, for every app it has.
|
|
771
|
+
A write after the store sat idle past the interval still ships at the next
|
|
772
|
+
sweep. One of `--seconds` and `--clear` is required (exit `2`, nothing sent).
|
|
773
|
+
It can be set before the org's `oltp_changes` flag is on. `changes sync`
|
|
774
|
+
queues a pass now, whatever the interval; a `409` means the flag is off.
|
|
775
|
+
`changes status` prints the org's relay mark (its interval, last change, last
|
|
776
|
+
drain, how long work has waited, failures) and the app's holds; `--backlog`
|
|
777
|
+
also counts the rows waiting in the org's store by table, which opens the store
|
|
778
|
+
and so wakes a suspended compute. All three are staff only; `interval` and
|
|
779
|
+
`sync` are audited on the server.
|
|
582
780
|
|
|
583
781
|
`provision` prints what it will create and asks first, because it calls a paid
|
|
584
782
|
provider; without a terminal it refuses unless `--yes`. It is idempotent — an
|
|
@@ -600,14 +798,15 @@ without a terminal).
|
|
|
600
798
|
## Airhouse tenants
|
|
601
799
|
|
|
602
800
|
Staff can see a workspace's Airhouse tenant — the warehouse behind
|
|
603
|
-
`ctx.airhouse` and `type: airhouse_managed` —
|
|
604
|
-
console. The server provisions a workspace's tenant itself; `provision` is the
|
|
801
|
+
`ctx.airhouse` and `type: airhouse_managed` — repair it, and rotate its
|
|
802
|
+
service account, without the admin console or a database URL. The server provisions a workspace's tenant itself; `provision` is the
|
|
605
803
|
repair and backfill tool, for a workspace that predates that or whose tenant or
|
|
606
804
|
service account did not come up.
|
|
607
805
|
|
|
608
806
|
```bash
|
|
609
807
|
oxyc airhouse status [--workspace <id>] [--json]
|
|
610
808
|
oxyc airhouse provision --workspace <id> [--yes] [--json]
|
|
809
|
+
oxyc airhouse rotate-sa --workspace <id> --yes [--json]
|
|
611
810
|
```
|
|
612
811
|
|
|
613
812
|
`status` lists every workspace, with a tenant or without; with `--workspace` it
|
|
@@ -624,10 +823,225 @@ workspace's UUID. A 404 can be a workspace outside your staff grant's scope, a
|
|
|
624
823
|
503 is a deployment with no Airhouse configured, and an active `assume` session
|
|
625
824
|
closes `/admin`.
|
|
626
825
|
|
|
826
|
+
`rotate-sa` is the response to a suspected bearer leak: it revokes the
|
|
827
|
+
workspace's service account at Airhouse and mints a fresh one under the same
|
|
828
|
+
name. The old account stops working at once (credentials already minted under
|
|
829
|
+
it last until they expire, 24h at most), so it always needs `--yes`, terminal
|
|
830
|
+
or not, and exits `8` without it after printing what it would revoke. `--json`
|
|
831
|
+
prints `{ workspace_id, old_sa_id, new_sa_id, rotated_at }`; the new bearer is
|
|
832
|
+
never shown. 404 is no workspace, no tenant, or one outside your grant; 409 is
|
|
833
|
+
a tenant with no service account (provision first); a 502 may have revoked the
|
|
834
|
+
old account without binding a new one, so run it again (the revoke is
|
|
835
|
+
idempotent). It replaced the Rust `oxy admin airhouse rotate-sa`.
|
|
836
|
+
|
|
837
|
+
## Evals
|
|
838
|
+
|
|
839
|
+
Run a workspace's `.test.yml` evals (LLM-judged, over its `.agentic.yml`
|
|
840
|
+
agents) on a deployment: the counterpart of `oxy test`, which runs them on a
|
|
841
|
+
local checkout.
|
|
842
|
+
|
|
843
|
+
```bash
|
|
844
|
+
oxyc evals run [<file>.test.yml] --workspace <id> [--case <c>] [--tag <t>] [--regrade <results.json>] [--min-accuracy N] [--threshold-mode average|all] [--wait [s]] [--detach] [--json] [--output-json [file]]
|
|
845
|
+
oxyc evals wait <run_id> --workspace <id> [--min-accuracy N] [--threshold-mode average|all] [--wait [s]] [--json] [--output-json [file]]
|
|
846
|
+
```
|
|
847
|
+
|
|
848
|
+
`run` queues the eval for the deployment's worker fleet
|
|
849
|
+
(`POST /api/{workspace_id}/evals/runs`) and polls it to the end. The deployment
|
|
850
|
+
runs the test files and agents the workspace has **compiled**, so push a new or
|
|
851
|
+
edited test file first (a file it has not compiled answers exit `5`). With no
|
|
852
|
+
file it runs every compiled test file. `--json` prints the results document and
|
|
853
|
+
`--output-json` writes it — byte for byte what `oxy test --output-json` wrote,
|
|
854
|
+
to the same default path (`<file>.results.json`, or `test-results.json`).
|
|
855
|
+
`--min-accuracy` exits `9` when the average (or, with `--threshold-mode all`,
|
|
856
|
+
any test file's) accuracy is below it; a failed, cancelled or timed-out run
|
|
857
|
+
exits `1`; `--wait <s>` gives up after `s` seconds with exit `7` while the run
|
|
858
|
+
goes on. `--detach` prints the run id; `wait <run_id>` reports it later.
|
|
859
|
+
|
|
860
|
+
## Airway pipelines
|
|
861
|
+
|
|
862
|
+
Run, backfill and inspect a workspace's airway ELT pipelines on a deployment,
|
|
863
|
+
and recover a pipeline whose single-flight lease is stuck. These replaced the
|
|
864
|
+
Rust `oxy airway` (deleted 2026-11-21), which ran pipelines from a local file
|
|
865
|
+
with the database URL.
|
|
866
|
+
|
|
867
|
+
```bash
|
|
868
|
+
oxyc airway run <pipeline_ref> --workspace <id> [--resources a,b] [--variables <json|@file|->] [--detach] [--json]
|
|
869
|
+
oxyc airway backfill <pipeline_ref> --workspace <id> --from <rfc3339> --to <rfc3339> [--granularity month|week|day] [--resources a,b] [--wait <s>] [--json]
|
|
870
|
+
oxyc airway backfill --resume <range_id> --workspace <id> [--wait <s>] [--json]
|
|
871
|
+
oxyc airway coverage <pipeline_ref> --workspace <id> [--json]
|
|
872
|
+
oxyc airway coverage --range <range_id> --workspace <id> [--json]
|
|
873
|
+
oxyc airway leases --workspace <id> [--json]
|
|
874
|
+
oxyc airway release-lease <pipeline_name> --workspace <id> [--yes | --force] [--json]
|
|
875
|
+
```
|
|
876
|
+
|
|
877
|
+
`run` starts the pipeline the deployment has **compiled** for the workspace's
|
|
878
|
+
served revision — queued for the worker fleet, never a `.airway.yml` on your
|
|
879
|
+
machine — then streams its events until a terminal one, and exits with the run
|
|
880
|
+
row's outcome: `0` done (a partial failure included), `1` failed, cancelled or
|
|
881
|
+
timed out. `--json` prints one `{seq, event_type, payload}` object per event
|
|
882
|
+
(the server adds `attempt` to each payload). Nothing from your shell's
|
|
883
|
+
environment is sent: a pipeline's `{{ VAR }}` templates render from
|
|
884
|
+
`--variables` only, which is stored with the run — credentials go through
|
|
885
|
+
`*_var` keys and the workspace's secrets. A backfill takes no variables.
|
|
886
|
+
Ctrl-C stops watching, not the run. To
|
|
887
|
+
try an unmerged edit, push a branch and use `oxyc preview run <branch>
|
|
888
|
+
airway_sample <ref>`. A pipeline already running answers `409` (exit `6`); a
|
|
889
|
+
ref the served revision does not have yet answers `503` (exit `7`).
|
|
890
|
+
|
|
891
|
+
`backfill` records a range of `[from, to)` split into chunks and queues its
|
|
892
|
+
drive, then returns; `--wait` polls the range until it settles and exits `1`
|
|
893
|
+
if chunks were left not done. Each call is a new range; `--resume <range_id>`
|
|
894
|
+
re-drives a range's not-done chunks (an unfinished range for the same window
|
|
895
|
+
is named before a new one is started). `coverage <ref>` lists the pipeline's
|
|
896
|
+
ranges; `--range` shows one range's missing periods.
|
|
897
|
+
|
|
898
|
+
`leases` lists what holds each pipeline, flagging lapsed rows (which block
|
|
899
|
+
nothing). `release-lease` takes the pipeline's NAME as `leases` prints it,
|
|
900
|
+
shows the holder and asks first; with no terminal it refuses (exit `8`) unless
|
|
901
|
+
`--yes` (release the holder it just listed, and only that run) or `--force`
|
|
902
|
+
(release whatever holds it). If the holder changed before the delete, nothing
|
|
903
|
+
is released and it exits `6` naming who holds it now. Both need a workspace
|
|
904
|
+
admin; staff act inside a tenant through `oxyc assume`.
|
|
905
|
+
|
|
906
|
+
## Agentic agents
|
|
907
|
+
|
|
908
|
+
Ask a workspace's agentic agent a question on a deployment, follow and steer
|
|
909
|
+
its run, and read the workspace's runs. These replaced the Rust `oxy agentic`
|
|
910
|
+
(a one-release stub from 2026-11-24, deleted 2026-11-26), which ran a `.agentic.yml` from a local checkout with the database URL
|
|
911
|
+
and the LLM keys in your shell.
|
|
912
|
+
|
|
913
|
+
```bash
|
|
914
|
+
oxyc agentic run <agent> -q <question> --workspace <id> [--thinking-mode auto|extended_thinking] [--json]
|
|
915
|
+
oxyc agentic events <run_id> --workspace <id> [--after-seq <n>] [--json]
|
|
916
|
+
oxyc agentic answer <run_id> --answer <text> --workspace <id>
|
|
917
|
+
oxyc agentic cancel <run_id> --workspace <id>
|
|
918
|
+
oxyc agentic list --workspace <id> [--limit <n>] [--json]
|
|
919
|
+
oxyc agentic inspect <run_id> --workspace <id> [--json]
|
|
920
|
+
oxyc agentic status --workspace <id> [--active] [--watch <s>] [--json]
|
|
921
|
+
```
|
|
922
|
+
|
|
923
|
+
`run` starts the agent the deployment has **compiled** for the workspace's
|
|
924
|
+
served revision (`POST …/analytics/runs`, the chat's route), with the
|
|
925
|
+
workspace's own secrets and LLM keys — never a file on your machine, so push a
|
|
926
|
+
change before running it. `<agent>` is the agent's path inside the workspace
|
|
927
|
+
(`agents/sales.agentic.yml`, or `agents/sales`). Each run is a chat: it opens a
|
|
928
|
+
thread in your history, as the web app does. It streams the run's events
|
|
929
|
+
(`GET …/runs/{id}/events`) until `done` (exit `0`), `error` or `cancelled`
|
|
930
|
+
(exit `1`; the Rust command exited `0`), or a question: a run that stops to ask
|
|
931
|
+
something is suspended, and `run` exits `0` once the stream has been quiet for
|
|
932
|
+
a moment after it, naming `oxyc agentic answer`. `--json` prints the Rust
|
|
933
|
+
command's lines, one compact `{"seq","event_type","payload"}` object per event,
|
|
934
|
+
with three additions from the route: `attempt` in each payload, a
|
|
935
|
+
`recovery_resumed` event when the run was re-driven after a restart, and a
|
|
936
|
+
terminal event built from the run row when the run ended without one. A start
|
|
937
|
+
the agent cannot make answers `400` (exit `6`); a workspace not compiled yet
|
|
938
|
+
`503` (exit `7`).
|
|
939
|
+
|
|
940
|
+
`events` replays a run (from `--after-seq`), and follows it when it is still
|
|
941
|
+
going; it exits `0` whatever the run did. `answer` delivers the text and the run
|
|
942
|
+
resumes on the deployment (the Rust command only marked the row running); a run
|
|
943
|
+
not waiting for one is exit `6`. `cancel` asks the run's driver to stop.
|
|
944
|
+
|
|
945
|
+
`list`, `inspect` and `status` read the Orchestrator Dashboard
|
|
946
|
+
(`…/analytics/coordinator/{runs, active-runs, runs/{id}/tree}`), an Oxygen
|
|
947
|
+
Nexus surface: org owners and admins, Oxy staff, and members Oxy granted the
|
|
948
|
+
workspace; anyone else is `403 factory_access_required` (exit `4`). Their
|
|
949
|
+
`--json` keeps the Rust keys the routes carry: `list` is
|
|
950
|
+
`[{run_id, status, source_type, question, created_at}]`; `inspect` drops
|
|
951
|
+
`metadata`, `event_count` and `extension` and adds `agent_id`, `task_status`,
|
|
952
|
+
`attempt`, `trigger` and `llm_usage`; `status` drops `event_count` and adds
|
|
953
|
+
`task_status`. Timestamps are RFC 3339. `status` reads one run tree per listed
|
|
954
|
+
run, so it expands at most 20 runs, four at a time, and `--watch` refreshes no
|
|
955
|
+
faster than every 2 s.
|
|
956
|
+
|
|
957
|
+
## Running SQL and automations
|
|
958
|
+
|
|
959
|
+
Run a `.sql` file or an automation on a deployment. It replaced the Rust
|
|
960
|
+
`oxy run` (2026-11-24; its one-release stub was deleted 2026-11-26).
|
|
961
|
+
|
|
962
|
+
```bash
|
|
963
|
+
oxyc run <file.sql> [--database <name>] [-v KEY=VALUE ...] [--json] --workspace <id>
|
|
964
|
+
oxyc run <file.automation.yml> [-v KEY=VALUE ...] [--json] [--detach] [--timeout <s>] --workspace <id>
|
|
965
|
+
```
|
|
966
|
+
|
|
967
|
+
A SQL file's text is read here and sent to `POST /api/{workspace_id}/sql/query`;
|
|
968
|
+
it runs against the **deployed** database of that name, with the workspace's
|
|
969
|
+
secrets and your identity. `--database` is checked against
|
|
970
|
+
`GET …/databases` (unknown: exit `5`) and may be left out only when the
|
|
971
|
+
workspace has one database. `-v` renders the file's `{{ name }}` placeholders,
|
|
972
|
+
and only when given; any other Jinja, or a placeholder with no value, exits `2`
|
|
973
|
+
and sends nothing. The output is a table; `--json` prints the route's rows
|
|
974
|
+
(arrays of strings, header row first). The route stops at 10,000 rows, and
|
|
975
|
+
`oxyc` warns when a result reaches that.
|
|
976
|
+
|
|
977
|
+
An automation runs the definition the deployment has **compiled** for its
|
|
978
|
+
served revision, on the worker fleet, not the file here: push it first, or try
|
|
979
|
+
a branch with `oxyc preview run <branch> procedure <ref>`. The file's path from
|
|
980
|
+
the checkout root (the nearest directory above it holding `config.yml`) is its
|
|
981
|
+
ref. `oxyc` reads the deployed definition first (`404` exits `5`), starts the
|
|
982
|
+
run with `-v` as its `variables`, and polls it until it ends; `done` prints
|
|
983
|
+
`✓ <file>` and each task's result in task order, `--json` the final snapshot,
|
|
984
|
+
`--detach` just the run id. Exit `1` a run that failed, was cancelled or timed
|
|
985
|
+
out, or `--timeout` (default 3600s) ran out with the run still going (re-running
|
|
986
|
+
would start a second run; a failed status read is retried meanwhile), `4` not
|
|
987
|
+
signed in or not a member, `6` a failed query, `7` retryable, before anything
|
|
988
|
+
started. `--dry-run`, `--retry` and `--retry-from`
|
|
989
|
+
did not come across.
|
|
990
|
+
|
|
991
|
+
## Database schema sync
|
|
992
|
+
|
|
993
|
+
Write a workspace's `.databases/` schema files (each dataset's DDL and one
|
|
994
|
+
`<table>.schema.yml` per table) into your checkout. The server introspects the
|
|
995
|
+
warehouses the **deployed** `config.yml` names, with the workspace's secrets,
|
|
996
|
+
and renders the files; `oxyc` writes them. It replaced the Rust `oxy sync`
|
|
997
|
+
(2026-11-21; its one-release stub was deleted 2026-11-26).
|
|
998
|
+
|
|
999
|
+
```bash
|
|
1000
|
+
oxyc sync [database] --workspace <id> [-d <dataset>]... [--tables <schema.table>]... [-o] [--dry-run] [--dir <checkout>] [--json]
|
|
1001
|
+
```
|
|
1002
|
+
|
|
1003
|
+
Run it from the checkout's root (or pass `--dir`). Each request renders one
|
|
1004
|
+
database (`POST /api/{workspace_id}/databases/sync` → `[{ path, content }]`);
|
|
1005
|
+
with no database named, `oxyc` lists them and asks for each, so one failure
|
|
1006
|
+
does not stop the rest, and a type sync cannot introspect (`airhouse_managed`,
|
|
1007
|
+
`airhouse`, `mysql`) is skipped with a warning. An existing file is skipped
|
|
1008
|
+
unless `-o`/`--overwrite`, which also prunes a stale file from each `models/`
|
|
1009
|
+
directory it writes (never the database directory); with `--tables`,
|
|
1010
|
+
`--overwrite` replaces only those tables' models, prunes nothing and keeps an
|
|
1011
|
+
existing dataset `.sql`. `--dry-run` prints the
|
|
1012
|
+
plan and writes nothing; `--json` prints `{dry_run, databases, files}`. Every
|
|
1013
|
+
path is checked before anything is written: one outside `.databases/` in the
|
|
1014
|
+
checkout, symlinks included, exits `8` and writes nothing. Exit `4` not signed
|
|
1015
|
+
in or not a workspace admin, `5` no such database, `6` it cannot connect as
|
|
1016
|
+
configured (or, named, cannot be synced), `7` the warehouse failed or the
|
|
1017
|
+
sync outlasted the server's limit (narrow it with `-d`).
|
|
1018
|
+
|
|
1019
|
+
## Looker integrations
|
|
1020
|
+
|
|
1021
|
+
Check a Looker integration's credentials on a deployment. This replaced the
|
|
1022
|
+
Rust `oxy looker test` (a one-release stub from 2026-11-21, deleted
|
|
1023
|
+
2026-11-26), which read
|
|
1024
|
+
`config.yml` from a checkout and the credentials from your shell.
|
|
1025
|
+
|
|
1026
|
+
```bash
|
|
1027
|
+
oxyc looker test <name> --workspace <id> [--json]
|
|
1028
|
+
```
|
|
1029
|
+
|
|
1030
|
+
The server checks what it serves: the integration from the workspace's
|
|
1031
|
+
compiled `config.yml`, the client ID and secret from the workspace's secrets.
|
|
1032
|
+
It signs in to Looker and lists the LookML models, and prints the first five.
|
|
1033
|
+
One integration per call. A check that ran answers `200` with its verdict, and
|
|
1034
|
+
a failed one exits `9`, naming the stage: `resolve` (a secret is missing),
|
|
1035
|
+
`client`, `auth` (Looker refused the credentials), `connect` or `timeout`
|
|
1036
|
+
(`base_url` did not answer). `--json` prints
|
|
1037
|
+
`{ ok, stage, error, integration, base_url, models: [{ name, explores }], elapsed_ms }`,
|
|
1038
|
+
on a failure too. `5` is no Looker integration by that name; `4` is a caller
|
|
1039
|
+
who is not a workspace admin (staff act inside a tenant through `oxyc assume`).
|
|
1040
|
+
|
|
627
1041
|
## Feature flags
|
|
628
1042
|
|
|
629
|
-
Staff-only control of the flags Oxy declares in code
|
|
630
|
-
|
|
1043
|
+
Staff-only control of the flags Oxy declares in its server code (the
|
|
1044
|
+
registry `GET /api/admin/feature-flags` lists): the kill switch and the
|
|
631
1045
|
targeting rules — per-org / per-user overrides plus a weighted fallthrough for
|
|
632
1046
|
A/B splits. Flags are not created at runtime. **Every write hits the
|
|
633
1047
|
deployment `--env` names (production by default) and takes effect for real
|
|
@@ -687,7 +1101,6 @@ oxyc experiments status <name> # flips, guardrails, complian
|
|
|
687
1101
|
oxyc experiments abort <name> --reason <text> [--levers off|keep] [--yes]
|
|
688
1102
|
oxyc experiments interim <name> [--refresh [--wait]] # the reading so far, badged not final
|
|
689
1103
|
oxyc experiments result <name> # sealed until reported
|
|
690
|
-
oxyc experiments write-back <name> # branch writing the coefficient back
|
|
691
1104
|
```
|
|
692
1105
|
|
|
693
1106
|
A candidate is one design to price, tagged by `shape`:
|
|
@@ -709,8 +1122,8 @@ prints that it is sealed and exits 0: there is deliberately no effect number
|
|
|
709
1122
|
before `reported`. `interim` is the registered analysis over the periods
|
|
710
1123
|
finished so far on a live or closing run, labelled not final (its interval is
|
|
711
1124
|
the fixed-horizon one, so reading it early overstates confidence); `--refresh`
|
|
712
|
-
asks for a fresh one and a run not in progress exits 0 with its state.
|
|
713
|
-
workspace's
|
|
1125
|
+
asks for a fresh one and a run not in progress exits 0 with its state. A proposed coefficient
|
|
1126
|
+
(`write_back` in the result) is applied by editing the workspace's repository and pushing. Staff reach a tenant workspace only inside an
|
|
714
1127
|
`oxyc assume` session.
|
|
715
1128
|
|
|
716
1129
|
## Home layout
|
|
@@ -865,9 +1278,9 @@ oxyc bootstrap verify poke-house --env dev --json \
|
|
|
865
1278
|
|
|
866
1279
|
```bash
|
|
867
1280
|
oxyc publish [--env <e>] [--dir <path>] [--promote] [--build-only | --prebuilt] [--json] [--allow-function-lint] [--app-env <dev-handle>]
|
|
868
|
-
oxyc promote <app> [--from staging|dev-<handle>] [--build <id>] [--remove-schedule <fn>]… [--dry-run] [--yes] [--json]
|
|
1281
|
+
oxyc promote <app> [--from staging|dev-<handle>] [--build <id>] [--remove-schedule <fn>]… [--override-checks "<reason>"] [--no-wait] [--dry-run] [--yes] [--json]
|
|
869
1282
|
oxyc rollback <app> --app-env staging|production [--to <build>] [--remove-schedule <fn>]… [--dry-run] [--yes] [--json]
|
|
870
|
-
oxyc init-ci [--app <org>/<app>] [--environment <name>] [--promote] [--force] [--no-register] [--setup-action]
|
|
1283
|
+
oxyc init-ci [--app <org>/<app>] [--environment <name>] [--promote] [--force] [--no-register] [--setup-action] [--browser | --no-browser [--approver <email>] [--no-wait]]
|
|
871
1284
|
oxyc proxy [--app <org>/<app> --app-env staging|dev-<handle>] [--port <n>] [--allow-writes] [--allow-events] [--yes]
|
|
872
1285
|
```
|
|
873
1286
|
|
|
@@ -878,7 +1291,12 @@ the target's public `build-config`, and uploads the bundle — to the **draft**
|
|
|
878
1291
|
channel (staging). `--env` defaults to **production**; name it. Ship it with
|
|
879
1292
|
`oxyc promote`, below. `--promote` still publishes and promotes in one request,
|
|
880
1293
|
through the same server-side path, and the server answers it with a
|
|
881
|
-
deprecation warning: it shows nobody the plan.
|
|
1294
|
+
deprecation warning: it shows nobody the plan. It meets the blockers `oxyc
|
|
1295
|
+
promote` meets — confirm each production schedule it retires with
|
|
1296
|
+
`--remove-schedule <function>` — and a blocker refuses the whole publish
|
|
1297
|
+
(exit `6`, each blocker named with what to do): nothing lands, staging
|
|
1298
|
+
included. With the app's second-person rule on, `--promote` is always refused:
|
|
1299
|
+
publish to staging and have someone else promote.
|
|
882
1300
|
|
|
883
1301
|
- **The manifest** is read strictly: `oxy-app.json` is validated against the
|
|
884
1302
|
JSON Schema `@oxy-hq/sdk` generates from its `OxyAppManifest` type (the same
|
|
@@ -900,7 +1318,10 @@ deprecation warning: it shows nobody the plan.
|
|
|
900
1318
|
- **Kit versions**: an app whose `@oxy-hq/sdk` or `@oxy-hq/vite-plugin` is more
|
|
901
1319
|
than one minor behind the versions this `oxyc` was built beside gets one
|
|
902
1320
|
warning per package before the build, naming the `pnpm add`. Read from the
|
|
903
|
-
app's `package.json` (the installed copy when there is one); no network.
|
|
1321
|
+
app's `package.json` (the installed copy when there is one); no network. The
|
|
1322
|
+
same read is sent as the upload's `sdk_version` field (the installed
|
|
1323
|
+
version, else the declared range's floor; left out when the app does not
|
|
1324
|
+
depend on the SDK), which the build's design-system check reads.
|
|
904
1325
|
- **`--dir`** publishes a pre-built directory instead of building; functions are
|
|
905
1326
|
still bundled into it. **`--build-only`** stops after building and bundling —
|
|
906
1327
|
no credential, no network unless the org must come from `--project`.
|
|
@@ -960,7 +1381,9 @@ person, and writes the ID into the workflow with the name beside it as a
|
|
|
960
1381
|
comment (`OXY_SERVICE_ACCOUNT: 3f25…3301 # acme/deployer`). When it cannot
|
|
961
1382
|
look the ID up — nobody logged in, no such account yet — it writes a
|
|
962
1383
|
`<service-account-id>` placeholder and says so; it never writes the name as
|
|
963
|
-
the value. `--
|
|
1384
|
+
the value. A `--force` re-run that cannot look it up (a member may not list
|
|
1385
|
+
the org's accounts) keeps the ID the existing workflow already names for that
|
|
1386
|
+
same account instead. `--promote` makes the publish go live. **No `checks run` step is
|
|
964
1387
|
written**, even when the manifest declares a check: the job's service-account
|
|
965
1388
|
token is answered `403` on the check routes, which sit behind platform gates a
|
|
966
1389
|
service account never passes, so the step could not succeed. The workflow
|
|
@@ -973,21 +1396,41 @@ says so when it writes one.
|
|
|
973
1396
|
|
|
974
1397
|
*The registration* is a trust policy on that service account — this repository,
|
|
975
1398
|
the workflow file, the environment — granted publishing this one app and
|
|
976
|
-
nothing else.
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
account
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
1399
|
+
nothing else. When the account (the `deployer` account if none was named) or
|
|
1400
|
+
the policy is missing, **an owner or admin of the org approves both once**, in
|
|
1401
|
+
the browser or by device code (`--no-browser`, `--approver <email>`): the same
|
|
1402
|
+
`/cli-auth` approval `tokens create` uses, for a `trust_policy`. The page shows
|
|
1403
|
+
the org, the account (new or existing), the repository as GitHub names it, the
|
|
1404
|
+
workflow, the environment and the one app it may publish, and the deployment
|
|
1405
|
+
writes them **at the approval**, under the approver's session. **Nothing is
|
|
1406
|
+
minted**: the CLI collects only what was written, and the account's ID goes
|
|
1407
|
+
into the workflow. The person running `init-ci` need not be an admin: when it
|
|
1408
|
+
may not list the org's apps or accounts it names the app by slug, and the
|
|
1409
|
+
approver's deployment resolves it.
|
|
1410
|
+
|
|
1411
|
+
**With no one waiting at the terminal** — an agent in a Claude Code remote
|
|
1412
|
+
session, a remote box — `--no-wait` (the default under `CLAUDE_CODE_REMOTE`)
|
|
1413
|
+
asks, prints the link, writes the workflow with a placeholder and exits; add
|
|
1414
|
+
`--approver <email>` and the admin is told by push, email and Slack. A later
|
|
1415
|
+
`oxyc init-ci --force` collects the answer (with `--no-wait`, it checks once and
|
|
1416
|
+
says if it is still waiting) and writes the account's ID. Because the approval
|
|
1417
|
+
itself writes the rows, an answer nobody collects is not lost: a run that may
|
|
1418
|
+
read the org's accounts finds them and asks nobody.
|
|
1419
|
+
|
|
1420
|
+
It is idempotent: a run that finds both in place asks nobody, and the deployment
|
|
1421
|
+
reuses what is already there. A named account is never created, and must be
|
|
1422
|
+
one of the app's own org — an account's grants never reach another org, so
|
|
1423
|
+
`init-ci` refuses one. A service account's name is lowercase words joined by
|
|
1424
|
+
single hyphens, starting with a letter, 2–40 characters.
|
|
1425
|
+
|
|
1426
|
+
Creating either row is still browser-session-only on the server: `init-ci`
|
|
1427
|
+
never calls those routes with its token. When no approval can happen (declined,
|
|
1428
|
+
a CI runner with nobody to approve, offline, a deployment that predates it,
|
|
1429
|
+
`--no-register`), the workflow is still written and the command prints the
|
|
1430
|
+
exact steps instead: re-running where a browser can open, where in the web app,
|
|
1431
|
+
the `oxyc api` calls with every id it managed to learn filled in, and the older
|
|
1432
|
+
`…/publishers` registration for a deployment without trust policies.
|
|
1433
|
+
Registration never fails the command.
|
|
991
1434
|
|
|
992
1435
|
**`--app-env <dev-handle>`** moves one sandbox's build pointer instead of the
|
|
993
1436
|
draft/live channel — see [Sandboxes](#sandboxes). It needs a staff credential
|
|
@@ -1007,11 +1450,74 @@ sending the plan's build and `expect_current` back — `409 target_moved` if the
|
|
|
1007
1450
|
target moved in between. `--dry-run` stops at the plan. A plan with blockers is
|
|
1008
1451
|
refused before any act (exit `6`): `staging_never_served` (production only
|
|
1009
1452
|
serves a build staging has served), `validation_not_passed`,
|
|
1010
|
-
`required_secrets_unset`,
|
|
1011
|
-
schedule with `--remove-schedule <function
|
|
1453
|
+
`required_secrets_unset`, `schedule_removal_unconfirmed` — name each retired
|
|
1454
|
+
schedule with `--remove-schedule <function>` — and `same_person_promote` (the
|
|
1455
|
+
app requires a second person to promote, and you published the build; a
|
|
1456
|
+
rollback to a build production served before is exempt). `--build` names an older build the
|
|
1012
1457
|
source served (publish id or UUID). Promoting the build already served is
|
|
1013
1458
|
`409 already_serving`.
|
|
1014
1459
|
|
|
1460
|
+
**Where the app's org holds promotes on a build's checks**, a promote to
|
|
1461
|
+
production does three more things. (An org without that gate sees none of
|
|
1462
|
+
this: the plan carries no `checks`, and nothing below prints or waits.)
|
|
1463
|
+
|
|
1464
|
+
1. **The plan lists the build's checks**, in the dry run and before it asks:
|
|
1465
|
+
one line per check of the build's newest staging attempt, the required ones
|
|
1466
|
+
marked, then how many screens differ from production and whether a person
|
|
1467
|
+
has seen them, and the summary a model wrote, marked as a model's.
|
|
1468
|
+
|
|
1469
|
+
```text
|
|
1470
|
+
checks (attempt 2): failed
|
|
1471
|
+
✓ Builds and validates bundle valid
|
|
1472
|
+
✓ required Its checks pass 3 of 3 passed
|
|
1473
|
+
✓ required It loads, desk and phone ready in 0.9s desk, 1.1s phone
|
|
1474
|
+
✗ required Follows the design system assets/index.css:68 restates --card
|
|
1475
|
+
✓ required Every screen opens 14 screens, 0 errors
|
|
1476
|
+
✓ What changed 4 of 28 screens differ
|
|
1477
|
+
4 of 28 screens differ · not seen by a person yet
|
|
1478
|
+
```
|
|
1479
|
+
|
|
1480
|
+
2. **Three blockers come from the checks**, each followed by what to do next
|
|
1481
|
+
(and refused before any act, exit `6`, like every blocker):
|
|
1482
|
+
- `checks_not_passed`: a required check failed, could not run, or the build
|
|
1483
|
+
was never checked. Fix what it found and publish again (`oxyc checks show
|
|
1484
|
+
<app> --build <id>` prints each finding), or run the checks again from the
|
|
1485
|
+
app's Builds page.
|
|
1486
|
+
- `checks_running`: a required check has no verdict yet. `oxyc checks show
|
|
1487
|
+
<app> --build <id> --wait`, then promote again.
|
|
1488
|
+
- `changes_not_seen`: the app needs a person to look at the changed screens
|
|
1489
|
+
first. Open the app's Builds page, look, mark them seen, promote again.
|
|
1490
|
+
|
|
1491
|
+
**`--override-checks "<reason>"`** promotes past those three and nothing
|
|
1492
|
+
else. It is for an owner or admin of the app's org (or Oxy staff acting in
|
|
1493
|
+
an assume session); a publish token, a CI token and a service account are
|
|
1494
|
+
answered `403 override_not_allowed`. The reason is kept in the audit log, so
|
|
1495
|
+
one under 10 characters is refused before any request (exit `2`), and the
|
|
1496
|
+
plan then shows `overridden` with it. The checks themselves stay as they
|
|
1497
|
+
are. The override is offered in the "next" line only when the plan says the
|
|
1498
|
+
caller may use it. A rollback is exempt from all three and takes no such
|
|
1499
|
+
flag.
|
|
1500
|
+
|
|
1501
|
+
3. **After the move it waits for production's own check.** The platform checks
|
|
1502
|
+
production once it serves the build ("Production opens after promote": every
|
|
1503
|
+
screen opened, against what production showed before). The command reads
|
|
1504
|
+
that attempt (`GET …/builds/{build}/checks?environment=production`) every
|
|
1505
|
+
5 s for up to 5 minutes, prints it as `checks show` would, and **exits `9`
|
|
1506
|
+
when it failed**, naming `oxyc rollback <app> --app-env production`. The
|
|
1507
|
+
move has happened either way: `9` says production serves the build and its
|
|
1508
|
+
check failed. `--no-wait` skips the wait. If no production check was
|
|
1509
|
+
started within 30 s (the app has it turned off), or none had a verdict in
|
|
1510
|
+
time, a warning says which and the exit is `0`. With `--json` the plan is
|
|
1511
|
+
printed once, after the wait, with `production_check: { state, attempt }`
|
|
1512
|
+
added (`state` is `passed`, `failed`, `running`, `none` or `unreadable`).
|
|
1513
|
+
|
|
1514
|
+
**Exit codes of `promote`:** `0` the move happened (and production's check
|
|
1515
|
+
passed, was not waited for, or had no verdict in time), or `--dry-run`
|
|
1516
|
+
printed the plan; `9` the move happened and production's check failed; `6` a
|
|
1517
|
+
blocker, or a request the server refused (`target_moved`, `already_serving`);
|
|
1518
|
+
`8` not confirmed; `4` not authenticated, or an override this caller may not
|
|
1519
|
+
use; `2` a bad flag, including a reason under 10 characters.
|
|
1520
|
+
|
|
1015
1521
|
**`rollback`** moves `--app-env` (staging or production; never a sandbox) back
|
|
1016
1522
|
to the build it served before its current one — twice swaps back — or `--to`
|
|
1017
1523
|
one it served earlier. Same plan, prompt and `--yes`. A rollback never reverses
|
|
@@ -1023,6 +1529,43 @@ Both need a staff credential: a publish token, a service account's and a sandbox
|
|
|
1023
1529
|
agent token are refused before any request (exit `2`). `--json` prints the
|
|
1024
1530
|
server's plan verbatim.
|
|
1025
1531
|
|
|
1532
|
+
## App events
|
|
1533
|
+
|
|
1534
|
+
```bash
|
|
1535
|
+
oxyc events ls [org] [--json]
|
|
1536
|
+
oxyc events show <event-id> [--chain] [--json]
|
|
1537
|
+
oxyc events find <type> --key <key> [--app-env <env>] [--json]
|
|
1538
|
+
oxyc events tail <org>/<app> [--app-env <env>] [--json]
|
|
1539
|
+
oxyc events dead <org>/<app> [--app-env <env>] [--json]
|
|
1540
|
+
oxyc events redeliver [<event-id>] [--to <app>/<fn> --status dead|expired|held [--since <t>]] [--dry-run] [--json]
|
|
1541
|
+
oxyc events replay <type> --since <t> [--until <t>] --to <app>/<fn> [--app-env <env>] [--dry-run] [--json]
|
|
1542
|
+
oxyc events resync <org>/<app> <function> [--app-env <env>] [--backfill] [--dry-run] [--json]
|
|
1543
|
+
oxyc events discard --until <t> [--type <type>] [--to <app>/<fn>] [--yes] [--json]
|
|
1544
|
+
oxyc events purge <type> [--key <key>] [--before <t>] [--yes] [--json]
|
|
1545
|
+
```
|
|
1546
|
+
|
|
1547
|
+
Staff commands over an org's app events (the org's `app_events` flag).
|
|
1548
|
+
|
|
1549
|
+
**`ls`** lists every event type with its publisher and each listener's health,
|
|
1550
|
+
stuck ones first. A second block, **Table subscriptions**, lists each function
|
|
1551
|
+
that runs on a table (`on: { "table": "<database>:<schema>.<table>" }`): the
|
|
1552
|
+
table, listener, environment, state (`active`, `BEHIND HORIZON`, `BROKEN` or
|
|
1553
|
+
`PAUSED`), the cursor (the last snapshot delivered), the table's newest snapshot,
|
|
1554
|
+
the lag in snapshots, and, for a state that needs a person, why. `--json` prints
|
|
1555
|
+
the server's reply, with the same rows as `tables`; an older server has none.
|
|
1556
|
+
|
|
1557
|
+
**`resync`** is the way out of every table state. It moves each table the
|
|
1558
|
+
function watches in `--app-env` (default production) to the newest snapshot, so
|
|
1559
|
+
what changed meanwhile is **skipped, not replayed**; it clears `behind_horizon`
|
|
1560
|
+
(the cursor's next snapshot was expired), `broken` (a column of the table was
|
|
1561
|
+
removed, renamed or retyped) and `paused` (the circuit breaker stopped a
|
|
1562
|
+
subscription that ran above a sustained rate). `--backfill` then runs the
|
|
1563
|
+
function once with an event whose `data.backfill` is `true` and which carries no
|
|
1564
|
+
rows, so it can re-derive what it keeps from the whole table. `--dry-run` prints
|
|
1565
|
+
where each cursor would move and changes nothing. It also forgets the columns
|
|
1566
|
+
the watch held as its contract, so a column removed on purpose stops being a
|
|
1567
|
+
break. Audited.
|
|
1568
|
+
|
|
1026
1569
|
## Apps
|
|
1027
1570
|
|
|
1028
1571
|
Read-only except `domains add | verify | remove`: every other request these make
|
|
@@ -1217,7 +1760,7 @@ trust policy first, the app's registered publisher second — and drives
|
|
|
1217
1760
|
`/api/customer-apps/**`, the same three routes a person's credential uses. A
|
|
1218
1761
|
service account's token (`oxy_sat_…`, `oxy_ci_…`) or a publish token set in
|
|
1219
1762
|
`OXY_TOKEN` is used without minting. What differs is the app lookup: a
|
|
1220
|
-
personal token
|
|
1763
|
+
personal token or a session can list apps to resolve
|
|
1221
1764
|
`<org>/<app>`; a machine credential may not, so it names the app by UUID or
|
|
1222
1765
|
through its own grants. `OXY_API_KEY` is read **before** OIDC here: a job that set one has said
|
|
1223
1766
|
which credential it means.
|
|
@@ -1264,11 +1807,346 @@ it) but does need `<org-slug>/<app-slug>`, since it is registered by slug.
|
|
|
1264
1807
|
**Exit codes:** `0` every check passed; `9` (`CHECK_FAILED`) at least one check
|
|
1265
1808
|
failed or timed out; `1` the app declares no checks; `5` the app was not
|
|
1266
1809
|
found; `4` no credential resolved, or the API rejected it (401/403 — an
|
|
1267
|
-
expired
|
|
1810
|
+
expired API token, or a removed legacy API key, reads this way, not as a
|
|
1811
|
+
missing one); `2` a bad
|
|
1268
1812
|
`--timeout`, or a slug where the credential needs a UUID; `7` (`UNAVAILABLE`)
|
|
1269
1813
|
the deployment answered the OIDC exchange without an `app_id`, meaning it
|
|
1270
1814
|
predates trusted checks.
|
|
1271
1815
|
|
|
1816
|
+
### A build's promote checks: `checks run --build`
|
|
1817
|
+
|
|
1818
|
+
```bash
|
|
1819
|
+
oxyc checks run <app-id> --build <build> --attempt <n> --report --env dev
|
|
1820
|
+
oxyc checks run acme/store --build 9087d7b --report --json # a person, by hand: the newest attempt
|
|
1821
|
+
oxyc checks run <app-id> --build <build> --attempt <n> --environment production --report # after a promote
|
|
1822
|
+
```
|
|
1823
|
+
|
|
1824
|
+
Every build that reaches an app's staging gets its checks (the ones `checks
|
|
1825
|
+
show` prints, below): four of them everywhere, and two more where the app's
|
|
1826
|
+
org holds promotes on its checks. The platform keeps the rows and the console;
|
|
1827
|
+
a runner drives them with this one command. The platform starts that runner
|
|
1828
|
+
itself, a GitHub Actions run per attempt
|
|
1829
|
+
(`.github/workflows/custom-app-build-checks.yaml`), and a person may run the
|
|
1830
|
+
same command by hand. The command runs **only what the claim leaves open**, so
|
|
1831
|
+
an attempt with four checks is driven exactly as before.
|
|
1832
|
+
|
|
1833
|
+
`--build` is the build's row id or its `build_id`; `--attempt` is which attempt
|
|
1834
|
+
of its checks, the newest when absent. **`--report` is required**: this mode
|
|
1835
|
+
writes verdicts to the platform, and without the flag it refuses before any
|
|
1836
|
+
request (`checks show --build` is the way to read them).
|
|
1837
|
+
**`--environment`** is `staging` (the default) or `production`: a build has
|
|
1838
|
+
staging attempts, and, once a promote moved production to it, production
|
|
1839
|
+
attempts with one check of their own (below). What a staging attempt does:
|
|
1840
|
+
|
|
1841
|
+
1. **Claims** the attempt (`POST …/builds/{build}/checks/claim`), naming the
|
|
1842
|
+
runner: the GitHub Actions run and its link, or "run by hand". The platform
|
|
1843
|
+
keeps that name only from its own checker; anyone else's run is stored as
|
|
1844
|
+
"<who>, by hand" from who the platform knows them to be, and each of their
|
|
1845
|
+
reports is audited. The platform
|
|
1846
|
+
then writes **Builds and validates** and starts the build's `"check": true`
|
|
1847
|
+
functions. An attempt whose every check already has a verdict answers `409
|
|
1848
|
+
attempt_closed`: the command says nothing is left to check and exits `0`.
|
|
1849
|
+
2. **Its checks pass** is the platform's verdict. The command asks for it every
|
|
1850
|
+
2 s (`POST …/checks/functions/settle`), for at most 6 minutes, while it
|
|
1851
|
+
does the next step.
|
|
1852
|
+
3. **It loads, desk and phone**: headless Chromium opens the build's staging
|
|
1853
|
+
page at 1440x900 and 390x844, one fresh context each, and waits up to 30 s
|
|
1854
|
+
for the runtime's `oxy-app-ready` beacon. It fails on a navigation error, a
|
|
1855
|
+
page served by another environment or another build, no beacon, or an
|
|
1856
|
+
uncaught page error; a failed request, or one the check refused to send
|
|
1857
|
+
(below), is a warning. The verdict is written at once (`POST
|
|
1858
|
+
…/checks/report`).
|
|
1859
|
+
4. **Follows the design system**: the build's `index.html` and CSS (`GET
|
|
1860
|
+
…/checks/stylesheets`) go through the SDK's theme guard, the one
|
|
1861
|
+
`@oxy-hq/sdk/testing` gives an app's own tests, read as built CSS. Any
|
|
1862
|
+
finding fails the build, and so does an SDK below the platform's floor; a
|
|
1863
|
+
build with no recorded SDK version and a clean guard is `skipped`. Written
|
|
1864
|
+
at once too, so the console fills in as each check finishes.
|
|
1865
|
+
5. **Every screen opens** (`smoke`, where the attempt has it): each screen of
|
|
1866
|
+
the build at 1440x900 and 390x844, held to the rule step 3 holds the root
|
|
1867
|
+
to. The screens are the ones the build declares (`checks.screens` in
|
|
1868
|
+
`oxy-app.json`, app-relative paths, `""` the root, each with the query it
|
|
1869
|
+
was declared with: `?module=waste` is opened as written and named so in
|
|
1870
|
+
the detail and in its files); a build that declares
|
|
1871
|
+
none has its root page's links read once it is ready: every same-app `<a
|
|
1872
|
+
href>` target, each once, query and hash dropped, the root first, at most
|
|
1873
|
+
the claim's `limits.screens` (30). **Nothing is clicked**, a link that
|
|
1874
|
+
downloads or points at a file is no screen, and a `fn/` path is never
|
|
1875
|
+
opened. One browser for the check, one fresh context per viewport, the two
|
|
1876
|
+
viewports side by side. The summary reads `14 screens, 0 errors` or `2 of
|
|
1877
|
+
14 screens have errors`; the detail says whether the list was `discovered`
|
|
1878
|
+
and how many screens the cap left out. Each opened screen's links are read
|
|
1879
|
+
at desk width too, and the detail names the screens of the app they point
|
|
1880
|
+
to that the list does not hold (`screens_unlisted`, the first 50, and
|
|
1881
|
+
`screens_unlisted_total`): none of them is opened, and `oxyc checks show`
|
|
1882
|
+
and the app's Builds page say how many, so "every screen" is never read as
|
|
1883
|
+
more than the list. Reported as soon as staging has been opened, before
|
|
1884
|
+
production is.
|
|
1885
|
+
6. **What changed** (`changes`, where the attempt has it): each of those
|
|
1886
|
+
screens is pictured on staging and on production (the full page, cut at
|
|
1887
|
+
4,000 px tall, animations off, once its requests have gone quiet and its
|
|
1888
|
+
fonts have loaded), and the two pictures are compared pixel by pixel
|
|
1889
|
+
**inside that browser** (a canvas in a blank page; no image library). A
|
|
1890
|
+
pixel differs when a channel differs by more than 3 of 255; `ratio` is the
|
|
1891
|
+
share of differing pixels, and a screen is `changed` past `0.001`, or when
|
|
1892
|
+
the two pictures' sizes differ. The check **passes whenever it ran** (it
|
|
1893
|
+
informs; `4 of 28 screens differ`) and is `skipped` when production serves
|
|
1894
|
+
nothing, or this same build. The staging pictures are the ones taken in
|
|
1895
|
+
step 5: staging is opened once.
|
|
1896
|
+
|
|
1897
|
+
The evidence is kept **on the platform** (`PUT …/checks/files/{name}`),
|
|
1898
|
+
never on the runner's disk and never in its log:
|
|
1899
|
+
`shot-<environment>-<slug>-<viewport>.png` for both pictures of every
|
|
1900
|
+
screen, `diff-<slug>-<viewport>.png` where it changed, and for a changed
|
|
1901
|
+
screen `text-<environment>-<slug>-<viewport>.json` (`{"text": …}`, the
|
|
1902
|
+
page's visible text, at most 4,000 characters), which the platform's
|
|
1903
|
+
advisory notes read. `<slug>` is the path with `/` as `--` and the root as
|
|
1904
|
+
`root`, lower-cased, any other character as `-`. Once per attempt,
|
|
1905
|
+
`css-digest.json`: the declarations of the build's CSS that set a literal
|
|
1906
|
+
colour or a font size (`{"rules": [{"file", "selector", "within"?,
|
|
1907
|
+
"declarations": ["color: #1a1a1a"]}], "omitted": n}`, at most 64 KB; the
|
|
1908
|
+
SDK theme's own names, Tailwind's palette and the SDK's `.oxy-…` rules are
|
|
1909
|
+
left out). A file over the claim's `limits.file_bytes`, one past
|
|
1910
|
+
`limits.files`, or one the platform would not take is **a warning in the
|
|
1911
|
+
detail, not a failed check**; its name is then `null` in its row.
|
|
1912
|
+
|
|
1913
|
+
**A production attempt** (`--environment production`) has one check,
|
|
1914
|
+
**Production opens after promote** (`production_smoke`), which the platform
|
|
1915
|
+
queues when a promote or a rollback moves production:
|
|
1916
|
+
|
|
1917
|
+
1. The claim names `"environment": "production"`. A deployment that answers a
|
|
1918
|
+
staging attempt instead is refused (exit `1`): it predates production
|
|
1919
|
+
checks.
|
|
1920
|
+
2. **It waits until production serves the build**: the root page is re-read in
|
|
1921
|
+
a fresh browser context every 5 s, each signed read asking for an uncached
|
|
1922
|
+
copy, until `window.__OXY_APP__.buildId` is the attempt's build. A page of
|
|
1923
|
+
the build before, still cached somewhere, is never judged. Three minutes
|
|
1924
|
+
without it is `error`.
|
|
1925
|
+
3. Every screen is opened as in step 5 above, and compared with the claim's
|
|
1926
|
+
`baseline` (what the build's **What changed** run saw on production before
|
|
1927
|
+
the move). It is `failed` when a screen has an error the baseline did not
|
|
1928
|
+
have for that screen and viewport, or was ready in the baseline and is not
|
|
1929
|
+
now. With no baseline (a promoting publish moves staging and production
|
|
1930
|
+
together, so **What changed** never ran; or a build was promoted before it
|
|
1931
|
+
did) nothing can be called new: production's errors are listed as warnings
|
|
1932
|
+
and the check is `skipped` (`3 errors on 2 of 14 screens, and no baseline
|
|
1933
|
+
from before the move to tell new ones apart`), so an error production
|
|
1934
|
+
already had neither tells anyone nor rolls production back. **The same
|
|
1935
|
+
holds screen by screen**: an error is called new only against the
|
|
1936
|
+
baseline's own entry for that screen and viewport. Where the baseline has
|
|
1937
|
+
none (its pass ran out of time before that screen, or production links to
|
|
1938
|
+
other screens now), what the screen shows is a warning (`… (not in the
|
|
1939
|
+
baseline: not called new)`), and a check with no new error but some of
|
|
1940
|
+
those is `skipped` (`2 errors on 1 of 14 screens the baseline from before
|
|
1941
|
+
the move cannot tell apart: not called new`), never `failed`. A baseline
|
|
1942
|
+
keeps at most ten errors a screen and viewport, so against an entry whose
|
|
1943
|
+
list is full an uncaught error it does not hold is not called new either
|
|
1944
|
+
(`… (the baseline's list of errors is full: not called new)`); a document
|
|
1945
|
+
that fails now, and a screen that was ready and is not, still are. A failed
|
|
1946
|
+
request or a refused one never fails it. The summary reads `14 screens, no
|
|
1947
|
+
new errors` or `2 new errors on 1 of 14 screens`, and `new_errors` lists
|
|
1948
|
+
each as `{path, viewport, error}`. No picture is taken and no file is kept.
|
|
1949
|
+
|
|
1950
|
+
On production **no environment header is sent** (production is what the URL
|
|
1951
|
+
serves unnamed), and the requests that carry the credential are exactly the
|
|
1952
|
+
ones a staging attempt signs. Every other rule below is the same on both.
|
|
1953
|
+
|
|
1954
|
+
**The page is opened as a reader.** The credential and `X-Oxy-App-Env: staging`
|
|
1955
|
+
go only to reads under the app's base path, the ready beacon, and the app's own
|
|
1956
|
+
data reads (`/api/projects/<its workspace>/query` and `/semantic-query`, which
|
|
1957
|
+
also name the app). Any other read on the deployment's origin goes unsigned,
|
|
1958
|
+
as an anonymous visitor's would. **A write the page attempts is never sent**:
|
|
1959
|
+
a `/fn` call, a form post, an `/api` write. Each is recorded as a warning
|
|
1960
|
+
(`write-refused`, `refused_writes` in the viewport's detail), and a page that
|
|
1961
|
+
needed one to mount fails on the beacon, not silently. So a screen that loads
|
|
1962
|
+
its data through a function shows that call refused: a warning, never a
|
|
1963
|
+
failure by itself.
|
|
1964
|
+
|
|
1965
|
+
**The page reaches the deployment's own origin and nothing else.** It can read
|
|
1966
|
+
the app's data as the checker, so it is given nowhere to send what it read: a
|
|
1967
|
+
request to any other origin is never sent, whatever its method and whatever
|
|
1968
|
+
it is for (a script, a font, an image, a `fetch`, a beacon, a frame, a popup,
|
|
1969
|
+
a navigation), on staging and on production alike. Each is recorded as a
|
|
1970
|
+
warning (`off-origin-refused`, `refused_off_origin` in the viewport's detail)
|
|
1971
|
+
and never fails a check by itself. A loopback, private or internal-only
|
|
1972
|
+
address is refused by a rule of its own. **So an app that loads a font, a
|
|
1973
|
+
script or a tag from another host is checked without it.** A font falls back,
|
|
1974
|
+
on staging and on production alike, so **What changed** compares the two
|
|
1975
|
+
fallbacks. An app that cannot mount without a script from another host fails
|
|
1976
|
+
**It loads** and **Every screen opens**, and the failure names what was not
|
|
1977
|
+
sent (`…; not sent: GET https://cdn.example.com/lib.js (another origin)`):
|
|
1978
|
+
serve it from the app's own bundle. A document redirected to another origin
|
|
1979
|
+
(a sign-in on another host) is not followed, and is named as that.
|
|
1980
|
+
|
|
1981
|
+
Nothing a page showed reaches the job log or the runner's disk: no trace, no
|
|
1982
|
+
response body, only statuses, URLs and the first line of an error. The
|
|
1983
|
+
pictures and text of **What changed** are held in memory and sent to the
|
|
1984
|
+
platform, where the app console shows them to people who may open that app's
|
|
1985
|
+
staging.
|
|
1986
|
+
|
|
1987
|
+
**The page is a tenant's code, and the checker's token can read every org's
|
|
1988
|
+
staging**, so five more things hold in this mode:
|
|
1989
|
+
|
|
1990
|
+
- **Chromium's sandbox is on.** Playwright starts Chromium without it unless
|
|
1991
|
+
told. A browser that cannot have one (on Linux it needs unprivileged user
|
|
1992
|
+
namespaces, and a user that is not root) makes each check that needs the
|
|
1993
|
+
browser an `error` that names the sandbox. It is never started without one.
|
|
1994
|
+
- **The browser's environment holds no credential.** It is started with only
|
|
1995
|
+
what a browser needs (`PATH`, `HOME`, the temp directories, the display and
|
|
1996
|
+
locale variables, fonts and certificates, Playwright's own settings, a
|
|
1997
|
+
proxy's address without a password). `OXY_API_KEY`, `OXY_TOKEN`, whatever
|
|
1998
|
+
`--api-key-env` or `--token-env` named, and a CI's own tokens are not passed
|
|
1999
|
+
on.
|
|
2000
|
+
- **A redirect never carries the credential, and its next hop is judged
|
|
2001
|
+
first.** Every request the check sends, signed or passed, is sent once, from
|
|
2002
|
+
outside the page, with redirects off, and its answer is handed to the
|
|
2003
|
+
browser whole. A `3xx` goes back as a `3xx`, and the browser follows it as
|
|
2004
|
+
its own request with none of the checker's headers. Before it is handed
|
|
2005
|
+
over, its next hop is held to the rules above: a hop to another origin or a
|
|
2006
|
+
private address, or one that would repeat a write (a `307` or `308` of a
|
|
2007
|
+
`POST`), is refused and recorded, and the page's request fails instead. So
|
|
2008
|
+
a sign-in redirect on the deployment is unsigned, and so is a hop that lands
|
|
2009
|
+
under the app's base again. The hops after that one are the browser's own:
|
|
2010
|
+
they are reads, and the browser can find no host for them but the
|
|
2011
|
+
deployment's (below).
|
|
2012
|
+
- **No socket is opened.** A `WebSocket` a page or a frame constructs is
|
|
2013
|
+
handed to the check, which ends it (close code `1008`) before anything is
|
|
2014
|
+
sent, on the deployment's own origin too, and records it like any other
|
|
2015
|
+
refused request (`WS /api/live`, or `WS wss://… (another origin)`). That
|
|
2016
|
+
needs Playwright 1.48 or later; with an older one no page is opened, and
|
|
2017
|
+
each check that needs the browser is an `error` that says so.
|
|
2018
|
+
`WebSocketStream`, the other way to the same socket, is switched off in the
|
|
2019
|
+
browser. One socket is left: a worker's own `WebSocket` to the deployment's
|
|
2020
|
+
origin, which Playwright does not hand over. It reaches the platform as an
|
|
2021
|
+
anonymous visitor's would, and no other host.
|
|
2022
|
+
- **The browser cannot find another host.** Not every way a page reaches the
|
|
2023
|
+
network is a request the check is shown: Chromium follows a redirect, opens
|
|
2024
|
+
a WebSocket from a worker or a WebTransport session, and acts on a
|
|
2025
|
+
speculation rule, a `preconnect` or a `dns-prefetch` without asking. Each
|
|
2026
|
+
needs an address, so Chromium is started with a resolver that answers only
|
|
2027
|
+
for the deployment's own host and port (`--host-resolver-rules`, and
|
|
2028
|
+
`--no-proxy-server` so that no proxy resolves in its place). An IP literal
|
|
2029
|
+
goes through the same resolver and fails the same way, as does the same
|
|
2030
|
+
host on another port. A peer connection (WebRTC) needs no name: its
|
|
2031
|
+
constructors are taken out of every frame before the page's code runs, and
|
|
2032
|
+
UDP that is not proxied is off
|
|
2033
|
+
(`--force-webrtc-ip-handling-policy=disable_non_proxied_udp`). The browser
|
|
2034
|
+
uses no system or environment proxy.
|
|
2035
|
+
|
|
2036
|
+
A check that throws here is written as `error` with why, so a row is never left
|
|
2037
|
+
open by a crash. A request the platform could not take (the network, a 5xx, a
|
|
2038
|
+
429) is sent again up to three times, 1 s, 2 s and 4 s apart (a file, once).
|
|
2039
|
+
|
|
2040
|
+
**How long it takes.** Each pass over the screens stops opening them after
|
|
2041
|
+
2.5 minutes and says how far it got: a screen it never opened is not called
|
|
2042
|
+
fine (`smoke` is then `error` unless a screen it did open failed). A staging
|
|
2043
|
+
attempt's own waits end inside 9 minutes, a production attempt's inside 6.5.
|
|
2044
|
+
|
|
2045
|
+
Human mode prints one line per check to stderr as it lands; `--json` prints one
|
|
2046
|
+
summary object to stdout (`checks[]` with each check's `kind`, `by`
|
|
2047
|
+
(`platform` or `runner`), `status`, `summary` and, for a runner's check,
|
|
2048
|
+
whether it was `reported`; then the platform's `state` and what is still
|
|
2049
|
+
`open`). `--timeout`, `--app-env`, `--browser` and `--expect-selector` belong
|
|
2050
|
+
to the other mode; the last three are refused with `--build`.
|
|
2051
|
+
|
|
2052
|
+
**Auth.** The platform's checker: its service token in `OXY_API_KEY`, sent as
|
|
2053
|
+
`X-API-Key` when no bearer resolves (the workflow passes `--token-env` a
|
|
2054
|
+
variable that is never set, so none does). Or a person who may open the app's
|
|
2055
|
+
staging, on their own login. With an app id there is no lookup at all, which
|
|
2056
|
+
is what lets the checker run it: that token may not list apps. `<org>/<app>`
|
|
2057
|
+
is resolved by the app listing, so it needs a person. A sandbox agent token is
|
|
2058
|
+
refused before any request. Playwright is resolved from the working directory,
|
|
2059
|
+
as for `--browser`.
|
|
2060
|
+
|
|
2061
|
+
**Exit codes:** `0` every check has a verdict and none failed, or the attempt
|
|
2062
|
+
was already closed; `9` (`CHECK_FAILED`) a check's verdict is `failed` or
|
|
2063
|
+
`error`; `2` `--build` without `--report`, `--report`, `--attempt` or
|
|
2064
|
+
`--environment` without `--build`, a bad `--attempt`, or an `--environment`
|
|
2065
|
+
that is neither `staging` nor `production`; `4`, `5`, `6` a refused request (no or a
|
|
2066
|
+
rejected credential, an unknown app, build or attempt, a malformed request);
|
|
2067
|
+
`7` the platform was unreachable, a verdict could not be written after the
|
|
2068
|
+
repeats, or the check functions had no verdict within 6 minutes. A verdict
|
|
2069
|
+
that could not be written outranks `9`: the run broke, whatever the checks say.
|
|
2070
|
+
|
|
2071
|
+
### What the checks found on a build: `checks show`
|
|
2072
|
+
|
|
2073
|
+
```bash
|
|
2074
|
+
oxyc checks show <org-slug>/<app-slug> # the build staging serves
|
|
2075
|
+
oxyc checks show acme/store --build 9087d7b # a build by its build_id (or row id)
|
|
2076
|
+
oxyc checks show acme/store --attempt 1 # an earlier attempt of the checks
|
|
2077
|
+
oxyc checks show acme/store --wait --timeout 900 # poll until nothing is queued or running
|
|
2078
|
+
oxyc checks show acme/store --environment production # the check that followed a promote
|
|
2079
|
+
```
|
|
2080
|
+
|
|
2081
|
+
Every build that reaches an app's staging is checked, and the results stay on
|
|
2082
|
+
the build: **Builds and validates**, **Its checks pass** (the
|
|
2083
|
+
`"check": true` functions), **It loads, desk and phone**, and **Follows the
|
|
2084
|
+
design system** (the theme guard over the bundle's CSS, and the SDK version
|
|
2085
|
+
`oxyc publish` recorded). A runner the platform starts drives them (`checks run
|
|
2086
|
+
--build`, above). `checks show` reads them back from
|
|
2087
|
+
`GET /api/customer-apps/{id}/builds/{build}/checks`; without `--build` the build
|
|
2088
|
+
is the one staging serves (the `is_draft` row of `GET …/builds`). It prints who
|
|
2089
|
+
ran the checks (with the link to the run when there is one), one line per
|
|
2090
|
+
check, the findings under one that failed or could not run, and the result:
|
|
2091
|
+
|
|
2092
|
+
```text
|
|
2093
|
+
acme/store · build 9087d7b · staging · attempt 2
|
|
2094
|
+
run by GitHub Actions run #1482 · https://github.com/…/actions/runs/123
|
|
2095
|
+
✓ Builds and validates bundle valid
|
|
2096
|
+
✓ Its checks pass 3 of 3 passed
|
|
2097
|
+
✓ It loads, desk and phone desk 1.2s · phone 1.4s
|
|
2098
|
+
✗ Follows the design system src/index.css:68 restates --card
|
|
2099
|
+
src/index.css:68 restates --card, which theme.css defines; remove it
|
|
2100
|
+
failed · 1 failed, 3 passed
|
|
2101
|
+
```
|
|
2102
|
+
|
|
2103
|
+
`✓` passed, `✗` failed, `!` the check could not run (error), `-` skipped, `…`
|
|
2104
|
+
queued or running. Where the app's org holds promotes on its checks, the list
|
|
2105
|
+
also has **Every screen opens** and **What changed**, and rows a model wrote:
|
|
2106
|
+
|
|
2107
|
+
```text
|
|
2108
|
+
✓ Every screen opens 14 screens, 0 errors
|
|
2109
|
+
✓ What changed 4 of 28 screens differ · not seen by a person yet (advisory)
|
|
2110
|
+
note by a model (claude-…):
|
|
2111
|
+
Looks intended: /reorder.
|
|
2112
|
+
Look here first: /stores at phone.
|
|
2113
|
+
summary by a model (claude-…): Adds a reorder screen; the stores table moved a column.
|
|
2114
|
+
```
|
|
2115
|
+
|
|
2116
|
+
**What changed** says how many screens differ from production and whether a
|
|
2117
|
+
person has seen them (`seen by <who>` once someone marked them in the app
|
|
2118
|
+
console). A **note** is a model's advice under a check, and the build's
|
|
2119
|
+
summary is a model's too: each is marked as one, and neither is a verdict.
|
|
2120
|
+
`checks show` does not say which checks hold a promote: that is the plan's to
|
|
2121
|
+
say, `oxyc promote <app> --dry-run`.
|
|
2122
|
+
|
|
2123
|
+
**`--environment production`** reads the attempts that follow a promote
|
|
2124
|
+
instead: one check, **Production opens after promote**, on the build
|
|
2125
|
+
production serves (the `is_published` row of `GET …/builds`) unless `--build`
|
|
2126
|
+
names one. The request adds `environment=production`.
|
|
2127
|
+
|
|
2128
|
+
When no runner picked an attempt up, or one stopped before it finished, the
|
|
2129
|
+
platform closes its open checks as errors and `checks show` says so in one
|
|
2130
|
+
line: `! the runner did not answer (…): run the checks again from the app's
|
|
2131
|
+
Builds page`.
|
|
2132
|
+
`--json` prints the server's body as it came, one object on stdout.
|
|
2133
|
+
`--wait` re-reads the same build every few seconds while any check is queued or
|
|
2134
|
+
running, up to `--timeout` seconds (default 600), and prints only the final
|
|
2135
|
+
answer.
|
|
2136
|
+
|
|
2137
|
+
**Auth.** The checks are a staging build's evidence, so the server answers
|
|
2138
|
+
only a caller who may open the app's staging (Oxy staff holding `develop_apps`
|
|
2139
|
+
over its org): a person's login, or a token carrying that standing. A publish
|
|
2140
|
+
token is answered not-found (exit 5), as when it reads back a run queued in
|
|
2141
|
+
staging; a sandbox agent token is refused before any request.
|
|
2142
|
+
|
|
2143
|
+
**Exit codes:** `0` the checks passed, are still running, or none have run; `9`
|
|
2144
|
+
(`CHECK_FAILED`) they failed; `7` with `--wait`, `--timeout` passed with checks
|
|
2145
|
+
still running (they carry on server-side); `5` the app or build was not found,
|
|
2146
|
+
or the environment serves no build; `2` a bad `--attempt`, `--timeout` or
|
|
2147
|
+
`--environment`, or a slug where the credential needs a UUID; `4` no
|
|
2148
|
+
credential, or the API rejected it.
|
|
2149
|
+
|
|
1272
2150
|
## Sandboxes
|
|
1273
2151
|
|
|
1274
2152
|
```bash
|
|
@@ -1290,6 +2168,8 @@ oxyc fn run <app> <function> [--app-env <name>] [--as-schedule] [--data …] [--
|
|
|
1290
2168
|
oxyc checks run <app> --app-env <name> # see "Checks" above
|
|
1291
2169
|
|
|
1292
2170
|
oxyc invocations list <app> [--app-env] [--build] [--function] [--limit]
|
|
2171
|
+
# an invocation another app's call started (mode `call`)
|
|
2172
|
+
# prints `parent <id>`; --json carries `parent_invocation_id`
|
|
1293
2173
|
oxyc invocations held <app> <invocation-id>
|
|
1294
2174
|
oxyc logs <app> [--app-env] [--invocation] [--request] [--hours] [--limit]
|
|
1295
2175
|
oxyc logs <app> [--app-env <name>] --follow [--timeout <seconds>] [--json]
|
|
@@ -1532,10 +2412,39 @@ is: the server's own `code` rides along on the thrown error, and the exit
|
|
|
1532
2412
|
class follows the usual HTTP-status mapping (`400`/`409` → `6`, `404` → `5`).
|
|
1533
2413
|
Full contract: `internal-docs/workspace-previews.md`.
|
|
1534
2414
|
|
|
2415
|
+
## The CI compile gate
|
|
2416
|
+
|
|
2417
|
+
```bash
|
|
2418
|
+
oxyc compile <branch> --workspace <id> [--wait] [--timeout <s>] [--json]
|
|
2419
|
+
```
|
|
2420
|
+
|
|
2421
|
+
Asks the deployment to compile `<branch>` of the workspace — the commit GitHub
|
|
2422
|
+
has for it, as the workspace's registered subdirectory — into a **staging**
|
|
2423
|
+
revision, which is never promoted, and with `--wait` polls until it is `ready`
|
|
2424
|
+
or `failed`. It is the customer repo's `validate.yaml` gate, and replaced the
|
|
2425
|
+
`oxy compile --skip-migrations --json` that job ran against a throwaway
|
|
2426
|
+
Postgres; `oxy compile` itself stays, for a local database.
|
|
2427
|
+
|
|
2428
|
+
`--json` prints `{status, workspace_id, branch, git_sha, revision_id,
|
|
2429
|
+
file_count_seen, file_count_compiled, file_count_failed, failures, error}`;
|
|
2430
|
+
`failures` is always an array of `{path, kind, message}`, the shape
|
|
2431
|
+
`oxy compile --json` printed (pinned in `compile.test.ts`). Exit `0` compiled
|
|
2432
|
+
(or, without `--wait`, queued), `9` compiled and recorded file failures, `1`
|
|
2433
|
+
failed with no file failure (the compile did not run to the end; re-run), `4`
|
|
2434
|
+
not signed in or not allowed, `5` no such workspace or a branch GitHub does not
|
|
2435
|
+
have, `7` `--wait` ran out.
|
|
2436
|
+
|
|
2437
|
+
Who may: a person with Factory access and editor standing in the workspace, or
|
|
2438
|
+
— in GitHub Actions, through trusted access (`OXY_SERVICE_ACCOUNT`,
|
|
2439
|
+
`id-token: write`) — the org's service account whose trust policy grants it a
|
|
2440
|
+
workspace grant (`viewer` is enough; it adds this and nothing else). The
|
|
2441
|
+
template's README ("What CI checks") has the setup.
|
|
2442
|
+
|
|
1535
2443
|
## Development commands
|
|
1536
2444
|
|
|
1537
2445
|
```bash
|
|
1538
2446
|
oxyc validate [-f <file>] [--json]
|
|
2447
|
+
oxyc migrate-automations [path] [--dry-run]
|
|
1539
2448
|
oxyc mcp
|
|
1540
2449
|
oxyc guide
|
|
1541
2450
|
oxyc skills install | list
|
|
@@ -1544,17 +2453,48 @@ oxyc exit-codes
|
|
|
1544
2453
|
```
|
|
1545
2454
|
|
|
1546
2455
|
**`validate`** checks workspace YAML against `json-schemas/*.json`, which are
|
|
1547
|
-
generated from the Rust config types
|
|
2456
|
+
generated from the Rust config types, and then as the runtime checks each file
|
|
2457
|
+
once it has loaded. No network, no token. It replaced `oxy validate`, whose
|
|
2458
|
+
one-release stub was deleted 2026-11-26.
|
|
1548
2459
|
|
|
1549
2460
|
| File | Schema |
|
|
1550
2461
|
| --- | --- |
|
|
1551
|
-
| `config.yml` / `config.yaml` | `config.json` |
|
|
1552
|
-
| `*.automation.yml`, `*.procedure.yml` (`*.workflow.yml` is not a recognised kind; `
|
|
2462
|
+
| `config.yml` / `config.yaml` at a workspace root | `config.json` |
|
|
2463
|
+
| `*.automation.yml`, `*.procedure.yml` (`*.workflow.yml` is not a recognised kind; `oxyc migrate-automations` renames it) | `workflow.json` |
|
|
1553
2464
|
| `*.agentic.yml` | `agentic.json` |
|
|
1554
2465
|
| `*.agent.test.yml` | `agent-test.json` |
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
2466
|
+
| `*.view.yml`, `*.topic.yml`, anywhere the compiler finds them (`.yml` only) | `view.json`, `topic.json` |
|
|
2467
|
+
|
|
2468
|
+
Past the schema:
|
|
2469
|
+
|
|
2470
|
+
- **References**, against the `config.yml` of the workspace each file is in (the
|
|
2471
|
+
outermost one the walk finds above it; with `--file`, the nearest one above
|
|
2472
|
+
the directory you run in, as `oxy` read it).
|
|
2473
|
+
An automation's `execute_sql` `database:` and `omni_query` / `looker_query`
|
|
2474
|
+
`integration:` must name an entry of that kind, including inside a
|
|
2475
|
+
`loop_sequential`. An agentic agent's `databases:` and `llm.ref` must name a
|
|
2476
|
+
database and a model; the Rust command never checked those.
|
|
2477
|
+
- **Rules** the runtime applies to an automation: a non-empty `tasks:` and task
|
|
2478
|
+
`name:`, an `export:` format the task kind supports, `http_request`
|
|
2479
|
+
`timeout_secs` from 1 to 120, `dry_run_limit` at least 1, and a
|
|
2480
|
+
`consistency_prompt` that parses as a template (a structural check of the
|
|
2481
|
+
template, not minijinja's full grammar).
|
|
2482
|
+
- **Views and topics**: no `inherits_from:` or `{{ globals.* }}` (removed), and
|
|
2483
|
+
every `{{variables...}}` well formed.
|
|
2484
|
+
|
|
2485
|
+
A `config.yml` nested inside a workspace (an Airform project's, say) is not
|
|
2486
|
+
checked as a workspace config. Workspace files with no `config.yml` above them
|
|
2487
|
+
are one `missing` finding. Each finding in `--json` has a `kind`: `parse` (the
|
|
2488
|
+
file does not load), `ref`, `rule` or `missing`. Where a generated schema is
|
|
2489
|
+
stricter or looser than the runtime's deserializer (an alias, `serde(other)`, a
|
|
2490
|
+
`deny_unknown_fields` `schemars` cannot see), `src/validate/serde-leniency.ts`
|
|
2491
|
+
patches it, and `fixtures/validate-parity/` pins every verdict against the one
|
|
2492
|
+
`oxy validate` gave.
|
|
2493
|
+
|
|
2494
|
+
**Exit codes:** `0` clean; `9` (`CHECK_FAILED`) at least one finding — `oxy
|
|
2495
|
+
validate` exited `1`, so a script testing `$? -eq 1` changes; `1` nothing could
|
|
2496
|
+
be read; `2` a kind `--file` cannot check; `5` a `--file` path that does not
|
|
2497
|
+
exist.
|
|
1558
2498
|
|
|
1559
2499
|
Every **`oxy-app.json`** it finds is checked for data placement — the shape of
|
|
1560
2500
|
the data picks the store: facts and history in Airhouse (`ctx.airhouse`),
|
|
@@ -1638,6 +2578,25 @@ A **sandbox agent token** must pass `--app <org>/<app> --app-env dev-<handle>`
|
|
|
1638
2578
|
oxyc proxy --app acme/store --app-env dev-a1 # then open the printed URL
|
|
1639
2579
|
```
|
|
1640
2580
|
|
|
2581
|
+
**`migrate-automations`** renames every `*.procedure.yml` / `*.workflow.yml`
|
|
2582
|
+
under `path` (default `.`) to `*.automation.yml`, then rewrites references to
|
|
2583
|
+
the old extensions — `src:`, `workflow_ref:`, glob includes — in every `.yml` /
|
|
2584
|
+
`.yaml` / `.sql` file. Local only: no network, no token. `--dry-run` prints the
|
|
2585
|
+
rename plan and writes nothing. It replaced the Rust `oxy migrate-automations`,
|
|
2586
|
+
whose one-release stub was deleted 2026-11-26.
|
|
2587
|
+
|
|
2588
|
+
- **It never overwrites.** A file whose `.automation.yml` target already exists,
|
|
2589
|
+
or two files that map to one name (`x.procedure.yml` beside `x.workflow.yml`),
|
|
2590
|
+
is a collision: listed on stderr, skipped, and left for you. Collisions alone
|
|
2591
|
+
still exit `0`.
|
|
2592
|
+
- **The rewrite is a plain substring replace**, so a reference to a collided
|
|
2593
|
+
file is rewritten too, and points at a name that exists only once you resolve
|
|
2594
|
+
the collision. References are rewritten only on a run that renamed something.
|
|
2595
|
+
- It skips `.git`, `.worktrees`, `.oxy_state`, `target`, `node_modules`, `dist`,
|
|
2596
|
+
`build`, `.venv` and every other dot-directory, and leaves a file that is not
|
|
2597
|
+
UTF-8 alone. Only the `.yml` spellings are renamed.
|
|
2598
|
+
- A path that does not exist exits `5`; a path that is a file exits `2`.
|
|
2599
|
+
|
|
1641
2600
|
**`mcp`** serves the API over stdio as four generic tools — `oxy_routes`,
|
|
1642
2601
|
`oxy_schema`, `oxy_request`, `oxy_whoami` — rather than one per endpoint, so
|
|
1643
2602
|
those schemas cost ~2 KB per turn and reach endpoints added after this
|
|
@@ -1697,7 +2656,7 @@ written in `skills/` here; see `internal-docs/platform-skills.md`.
|
|
|
1697
2656
|
6 the request was malformed (4xx other than 401/403/404)
|
|
1698
2657
|
7 unavailable — 5xx, a timeout, or the network failed. Retryable.
|
|
1699
2658
|
8 refused — the operation would have destroyed or overwritten something
|
|
1700
|
-
9 a check ran and
|
|
2659
|
+
9 a check ran and the answer was no (`oxyc checks run`, `oxyc checks show`, `oxyc bootstrap verify`, `oxyc looker test`, `oxyc evals run --min-accuracy`, `oxyc validate`; `oxyc promote` when production moved and its check after the promote failed)
|
|
1701
2660
|
```
|
|
1702
2661
|
|
|
1703
2662
|
`4` almost always means the wrong `--env`. A person logs in again. An agent on
|
|
@@ -1709,9 +2668,10 @@ its own token (`tokens create --agent` or `--sandbox-agent`) does not: there,
|
|
|
1709
2668
|
|
|
1710
2669
|
| Variable | Default | Meaning |
|
|
1711
2670
|
| --- | --- | --- |
|
|
1712
|
-
| `OXY_TOKEN` | — | any credential, sent as a bearer; overrides the login cache and GitHub OIDC |
|
|
1713
|
-
| `OXY_API_KEY` | — |
|
|
1714
|
-
| `OXY_SERVICE_ACCOUNT` | — | the **ID** of the service account a
|
|
2671
|
+
| `OXY_TOKEN` | — | any credential, sent as a bearer; overrides the login cache and GitHub OIDC. `from-proxy`: an egress proxy adds it, so none is sent ([A token the proxy adds](#a-token-the-proxy-adds)) |
|
|
2672
|
+
| `OXY_API_KEY` | — | an API token, for the `/external/api` surface and for `checks run`; with `checks run --build`, the platform checker's service token (the name is historical: it held a legacy API key until those were removed) |
|
|
2673
|
+
| `OXY_SERVICE_ACCOUNT` | — | the **ID** of the service account a trusted-access exchange acts as (`--service-account`); never `<org>/<name>` |
|
|
2674
|
+
| `OXY_OIDC_TOKEN_FILE` | — | a file holding a token from an OIDC issuer the org registered, traded at the exchange instead of GitHub's ([A service on another platform without a stored secret](#a-service-on-another-platform-without-a-stored-secret)) |
|
|
1715
2675
|
| `OXY_AGENT` | detected | the name of the agent driving `oxyc`, sent in the user agent — see below |
|
|
1716
2676
|
| `OXY_CREDENTIALS_PATH` | OS config dir | the shared `credentials.json` |
|
|
1717
2677
|
| `OXYC_ORG` | `oxy-hq` | GitHub org the customer repos live in |
|
|
@@ -1736,7 +2696,7 @@ its own token (`tokens create --agent` or `--sandbox-agent`) does not: there,
|
|
|
1736
2696
|
|
|
1737
2697
|
**In a Claude Code cloud session,** the repo's SessionStart hook installs
|
|
1738
2698
|
`oxyc` and keeps an agent token across shell calls. The environment must allow
|
|
1739
|
-
the Oxy hosts
|
|
2699
|
+
the Oxy hosts, or hold a network secret for them with `OXY_TOKEN=from-proxy`. Setup: the `oxy-custom-apps` skill, "Headless and cloud
|
|
1740
2700
|
sessions".
|
|
1741
2701
|
|
|
1742
2702
|
**An agent should set `OXY_AGENT`.** Every request `oxyc` makes to a deployment
|