Skip to content

feat(cli): generate warehouse commands from the Management API spec - #7640

Draft
jgoux wants to merge 53 commits into
developfrom
feat/generated-warehouse-commands
Draft

jgoux wants to merge 53 commits into
developfrom
feat/generated-warehouse-commands

Conversation

@jgoux

@jgoux jgoux commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds the first commands generated from the Management API spec, for Warehouse:

  • supabase warehouse enable starts replication and can --wait for setup to finish;
  • supabase warehouse disable starts cleanup and can --wait for it to finish;
  • supabase warehouse status reads the consolidated Warehouse status;
  • supabase warehouse connection reads the Arrow Flight SQL connection details;
  • supabase warehouse teardowns get reads the current cleanup, and can --wait on it;
  • supabase warehouse tables list lists the replicated tables with their replication state and lag;
  • supabase warehouse tables get <table-id> reads one table, including its replication feedback;
  • supabase warehouse tables layout get <table-id> reads a table's saved sorting and partitioning rules beside the layout the DuckLake catalog records;
  • supabase warehouse tables layout update <table-id> changes those rules: --sort-by and --partition-by take a JSON value for their rule, and --reset-table copies the table again when the layout changes;
  • supabase warehouse inspect query-stats reads Warehouse query statistics over a time range (--since, or --from and --to), as labelled sample series;
  • supabase warehouse inspect capacity reads Warehouse capacity, admission and activation measurements over a time range, in the same form;
  • supabase warehouse replication add adds one eligible table (--schema and --table) or a schema's currently eligible tables (--schema alone) to replication;
  • supabase warehouse replication remove removes one selected table or all selected tables of a schema from replication, keeping the data already in Warehouse;
  • supabase warehouse replication resync resets and rebuilds one selected table (--schema and --table). It has no wait, idempotency or revision flags.

They are experimental and hidden unless the project opts in, in the same way as compute:

# supabase/config.toml
[experimental]
warehouse = true

or SUPABASE_EXPERIMENTAL_WAREHOUSE=1 in the shell.

The goal is to settle the full pipeline on one real resource before adding more. That pipeline covers:

  • spec (with x-operation and links) → generated data;
  • generic runtime → the CLI's shared output and error contracts.

New commands should then need only an x-operation entry in the spec. The generator and runtime support exactly the shapes Warehouse uses (path and query parameters, JSON:API envelope bodies, JSON responses) and reject anything else at generation time, so a resource that needs a new shape adds it to the runtime explicitly. This is an alternative to the hand-written warehouse enable in #7528.

How it works

The generator writes data, not code. A build-time script turns the OpenAPI spec plus a small CLI policy file into a committed data module and a generated per-command reference. At startup, one generic runtime builds real Effect CLI commands from that data. There is no per-command handler code.

flowchart LR
  subgraph build["Build time: pnpm generate / api-commands:check"]
    spec["packages/api<br/>openapi.json + typed client"]
    policy["api-command-policy.ts<br/>(allowlist, nouns)"]
    gen["scripts/generate-api-commands.ts<br/>derive + lints"]
    data["generated.ts<br/>(command data)"]
    ref["generated.md<br/>(per-command reference)"]
    spec --> gen
    policy --> gen
    gen --> data
    gen --> ref
  end
  subgraph run["Runtime"]
    rt["runtime.ts<br/>withApiCommands()"]
    root["cli/root.ts<br/>mounts each noun whose feature is enabled"]
    exec["request → send → --wait → output"]
    errs["Output service<br/>(result, task, error)"]
    data --> rt --> root
    rt --> exec --> errs
  end
Loading

Why committed data instead of resolving the spec at runtime

Resolve at runtime Generate code per command Generate data + one runtime (this PR)
Reviewable diff when the spec changes no yes, but noisy yes, data only
Spec loaded in the binary whole spec no only the selected operations
Lints fail the build, not the user no yes yes
Behaviour fixes land once yes regenerate every file yes

api-commands:check is part of check:all. api-package-sync.yml regenerates the data and the reference whenever it syncs the spec, so drift turns up as a reviewable diff.

Adding a command

A command is declared in the spec itself. The CLI keeps a small policy file: a temporary allowlist of generated operations, the nouns, and optional per-command presentation choices. It never overrides what the spec says about an operation, and there is no per-command folder.

A command for an existing noun takes two edits: its x-operation (and links for --wait) in the spec, and its operation ID in generatedOperations. The spec edit lands upstream, or in packages/api/scripts/openapi-overrides.json until it is published. pnpm run generate downloads the spec, applies the overrides and writes the rest. A new noun is one nouns entry; a noun with its own feature also needs that experimental.<feature> key in packages/config/src/experimental.ts and in featureSchemas/featureKeys in apps/cli/src/shared/config/experimental-feature.ts, which ApiNoun.feature enforces at type-check time.

In the spec: x-operation on an operation names its command. Only operations on the CLI allowlist generate a command, so the spec can name every operation for other consumers and a name stays inert until its operation is listed. Off the allowlist, x-operation is read only on an operation that an allowlisted operation links to (see below).

Field Meaning Example
group A dot-separated path that starts with a CLI-declared noun. Each segment becomes a command word, and every sub-group needs help text in the CLI's nouns table. A noun is always a new top-level command. "warehouse" → supabase warehouse …
"warehouse.tables" → supabase warehouse tables …
method The last command word. It is usually a verb such as list, get or enable. A read of a singleton facet is named after the facet, such as status or connection, and a report under an inspect group is named after the report, such as query-stats. Every command word is lowercase kebab-case. Names are reviewed in the allowlist PR through the generated.md diff. "enable" → supabase warehouse enable
poll Optional, on a read (GET) only. Says the read reports the state of a long-running operation. The read itself gets --wait and --timeout. See below

The extension is decoded strictly: an unknown key fails generation, and so does a name with only one of group and method. A name is optional when poll is set. It holds only what another consumer of the spec (for example an MCP server generating tools) would also need. CLI-only choices such as flag names stay in the CLI. The published spec already carries it for enable, disable and the teardown read. openapi-overrides.json renames the setup read to warehouse.setups get and adds its poll.inspect. It also adds the status, connection, tables (list, get, layout get and update), query-stats, capacity and replication (add, remove and resync) operations until they are published.

poll fields:

Field Meaning Warehouse value
status JSON pointer to the status in the read response. "/data/attributes/status"
succeeded Status values that end the wait successfully (exit 0). ["succeeded"]
failed Status values that end the wait as operation_failed (exit 1). ["failed"]
error Optional. JSON pointer to a failure reason. It supplies the message when the wait ends on a failed status; it doesn't end the wait by itself. "/data/attributes/status_error"
inspect Required on a poll-only read and ignored on a generated one, whose own command is named instead. The operation ID of the read-only command that inspects the same state. "v2-get-warehouse-status"

--wait comes from standard OpenAPI links. When a 2xx response has a link to an operation with poll, the command gets --wait and --timeout. Link parameters map as follows:

  • $response.body#/… takes the value from the first response.
  • $request.path.ref reuses the project ref.
  • Any other expression, an unknown target, or more than one polled link fails generation.

A response pointer must be required at every level of the response schema, so --wait always has something to poll with. A response that still lacks the value fails --wait as an internal error (exit 1) instead of a silent success.

An operation either declares poll or links to a polled operation, never both.

A polled read doesn't have to be a command. A status read that only exists to back --wait declares poll and stays off the allowlist: a poll-only read. It may carry a name for other consumers, but it gets no command: the CLI calls it through @supabase/api while waiting. Its poll.inspect names the operation whose command inspects the same state, and a failed or timed-out wait names that command in its suggestion.

The generator finds a poll-only read through the response links of the allowlisted operations, and ignores one that nothing links to. Nothing in the CLI lists these reads: a new one shows up as a diff in the generated data and reference. Poll-only reads go through the same checks as generated operations (experimental stage, GET, poll or links but not both).

Secrets are marked on the field with writeOnly: true, format: "password" or x-sensitive: true. Those fields are masked in --dry-run output whether they come from a flag, --body or --file. Generation fails when a body field looks like a credential (password, secret, token, key, private) and isn't marked. It also fails for a secret the preview can't mask: one held anywhere inside a nested body field, whose JSON value the preview doesn't mask, and any secret header or query parameter.

Flags follow a convention. A flag is the kebab-case field name. An array field with a plural name gets a singular, repeatable flag, so tables becomes --table. Beyond body and query fields:

  • The path parameter besides ref, if there is one, becomes a positional argument. An empty value, . or .. is a usage error before any request.
  • A nested body field (an object, an array of objects or a union) gets a flag that takes a JSON value for that field, null included, so --sort-by '{"kind":"none"}' needs no JSON:API envelope. The value goes through the same schema validation as the rest of the body, before consent.

The warehouse operations carry (every operation is also "x-scalar-stability": "experimental"):

// POST /v2/projects/{ref}/warehouse/enable → supabase warehouse enable
"x-operation": { "group": "warehouse", "method": "enable" },
"responses": { "202": { "links": { "setup": {
  "operationId": "v2-get-warehouse-setup",
  "parameters": { "ref": "$request.path.ref", "selection_id": "$response.body#/data/attributes/selection_id" }
} } } }

// GET /v2/projects/{ref}/warehouse/setups/current → poll-only read, not on the allowlist
"x-operation": { "group": "warehouse.setups", "method": "get", "poll": {
  "status": "/data/attributes/status", "succeeded": ["succeeded"], "failed": ["failed"],
  "error": "/data/attributes/status_error", "inspect": "v2-get-warehouse-status"
} }

// DELETE /v2/projects/{ref}/warehouse → supabase warehouse disable
"x-operation": { "group": "warehouse", "method": "disable" },
"responses": { "202": { "links": { "teardown": {
  "operationId": "v2-get-warehouse-teardown",
  "parameters": { "ref": "$request.path.ref", "operation_id": "$response.body#/data/id" }
} } } }

// GET /v2/projects/{ref}/warehouse/teardowns/current → supabase warehouse teardowns get
"x-operation": { "group": "warehouse.teardowns", "method": "get", "poll": {
  "status": "/data/attributes/lifecycle_status", "succeeded": ["disabled"], "failed": ["deletion_failed"],
  "error": "/data/attributes/cleanup_error"
} }

// GET /v2/projects/{ref}/warehouse/status → supabase warehouse status
"x-operation": { "group": "warehouse", "method": "status" }

// GET /v2/projects/{ref}/warehouse/connection → supabase warehouse connection
"x-operation": { "group": "warehouse", "method": "connection" }

// GET /v2/projects/{ref}/warehouse/tables → supabase warehouse tables list
"x-operation": { "group": "warehouse.tables", "method": "list" }

// GET /v2/projects/{ref}/warehouse/tables/{table_id} → supabase warehouse tables get <table-id>
"x-operation": { "group": "warehouse.tables", "method": "get" }

// GET /v2/projects/{ref}/warehouse/tables/{table_id}/layout → supabase warehouse tables layout get <table-id>
"x-operation": { "group": "warehouse.tables.layout", "method": "get" }

// PATCH /v2/projects/{ref}/warehouse/tables/{table_id}/layout → supabase warehouse tables layout update <table-id>
"x-operation": { "group": "warehouse.tables.layout", "method": "update" }

// GET /v2/projects/{ref}/warehouse/query-stats → supabase warehouse inspect query-stats
"x-operation": { "group": "warehouse.inspect", "method": "query-stats" }

// GET /v2/projects/{ref}/warehouse/capacity → supabase warehouse inspect capacity
"x-operation": { "group": "warehouse.inspect", "method": "capacity" }

// POST /v2/projects/{ref}/warehouse/replication/add → supabase warehouse replication add
"x-operation": { "group": "warehouse.replication", "method": "add" }

// POST /v2/projects/{ref}/warehouse/replication/remove → supabase warehouse replication remove
"x-operation": { "group": "warehouse.replication", "method": "remove" }

// POST /v2/projects/{ref}/warehouse/replication/resync → supabase warehouse replication resync
"x-operation": { "group": "warehouse.replication", "method": "resync" }

In the CLI: api-command-policy.ts holds:

  • generatedOperations: the operations that generate commands, today v2-get-warehouse-status, v2-get-warehouse-connection, v2-enable-warehouse, v2-disable-warehouse, v2-get-warehouse-teardown, v2-list-warehouse-tables, v2-get-warehouse-table, v2-get-warehouse-table-layout, v2-update-warehouse-table-layout, v2-get-warehouse-query-stats, v2-get-warehouse-capacity, v2-add-warehouse-replication, v2-remove-warehouse-replication and v2-resync-warehouse-replication. It is the only thing that turns an operation into a command, so a spec annotation never reaches the CLI on its own.
  • commandPolicies: CLI presentation choices per operation. Today the only one is confirmDescription, which prints the operation's API description before the interactive consent prompt. The replication commands, disable and tables layout update use it, because their descriptions spell out effects such as pipeline restarts, permanent data deletion or a table recopy that the request values alone don't show.
  • nouns: each top-level group, with the experimental feature that gates it and the help text of the sub-groups the generator creates (Warehouse describes replication, inspect, tables, tables.layout and teardowns). A noun is always a new top-level group: generated commands never join a hand-written one. The group is hidden unless [experimental] <feature> = true or SUPABASE_EXPERIMENTAL_<FEATURE>=1. Startup reads only the feature of the noun being run, or every noun feature for root help and completion.

Generation fails for:

  • an allowlisted operation missing from the spec or left without a name;
  • a link to an operation whose x-operation is invalid;
  • a poll-only read without poll.inspect;
  • an inspect operation that isn't generated, changes state, or needs input beyond the project ref.

The generator takes everything else from the spec:

  • summary and description;
  • flags, with their types, required, repeatability and help text;
  • where each flag goes in the request (/data/attributes/schema, …);
  • the JSON:API envelope type (warehouse_setup);
  • FGA permissions (read at runtime from @supabase/api/permissions, not generated here).

The generator rejects anything the runtime cannot honour, so a bad spec never reaches users. It rejects:

  • operations not marked x-scalar-stability: experimental;
  • operations without a summary;
  • unknown keys in x-operation;
  • groups that don't start with a declared noun, sub-groups without help text, and command words that aren't kebab-case;
  • a noun that is already a hand-written command, collisions between generated commands, and a path that is both a command and a group (a name off the allowlist meets these checks once its operation is listed);
  • non-kebab or duplicate flags, flags that collide with runtime flags such as --body or --wait or with registered global flags such as --profile, and a name used by more than one of path, query and body;
  • server-side dry_run;
  • parameter, body or schema shapes the runtime can't bind: operations without a ref path parameter or with more than one other path parameter, path parameters that aren't strings, cookie parameters, header parameters other than Authorization, Content-Type and Accept, query parameters that aren't scalars, bodies that aren't a JSON:API envelope, and numeric body fields;
  • secrets the dry-run preview can't mask, as described above;
  • success responses that aren't JSON;
  • poll on a non-GET, or together with a link to a polled operation;
  • unsupported links;
  • waits whose pointers don't resolve in the responses or aren't always present, or whose parameters or status values don't match the read operation.

What users get

All generated commands follow the same conventions.

Help comes from the spec, including a PERMISSIONS section that lists the extra permission --wait needs. The CLI builds the EXAMPLES entry from the positional argument and the required flags. A command that takes a body shows --file <path> unless a required flag already sets a body field. Abridged:

$ supabase warehouse enable --help
DESCRIPTION
  …

TARGET
  Remote only. Uses the linked project; pass --remote=<ref|branch> for another.

FLAGS
  --remote[=<ref|branch>]             Target another project: --remote=<ref|branch>. Defaults to the linked project.
  --body string                       Whole request body as JSON; other flags replace fields at their own location.
  --file string                       Read the whole request body from a JSON file, or - for stdin.
  --dry-run                           Print the request that would be sent and send nothing.
  --wait                              Wait until the operation reaches a final status.
  --timeout string                    How long --wait polls, as a duration such as 90s or 10m.
  --warehouse-region string           Optional Warehouse compute region, …
  --destination-project-ref string    Supabase project to use for both the DuckLake PostgreSQL catalog and Supabase Storage. …
  --install-fdw                       Whether to configure and install the Warehouse FDW in the project database. …
  --schema string                     Source PostgreSQL schema. Without tables, selects its currently eligible tables only. Required unless the field is in --body or --file.
  --table string                      Table names in schema. Omit to select the currently eligible tables in that schema.

GLOBAL FLAGS
  …

EXAMPLES
  # Enable Warehouse replication
  supabase warehouse enable --file <path>

PERMISSIONS
  Scoped access token:
    Required:
      project_admin_write
      database_write
    Required with --wait:
      database_read
    May be required:
      projects_read
      …

--dry-run prints the exact request and sends nothing. It needs no consent, and with a literal --remote=<ref> it needs no login either: it builds no API client, makes no request and writes no cache:

$ supabase warehouse enable --remote=abcdefghijklmnopqrst --schema public --table orders --table customers --dry-run --output-format json
{"method":"POST","path":"/v2/projects/abcdefghijklmnopqrst/warehouse/enable","query":{},"headers":{},
 "body":{"data":{"type":"warehouse_setup","attributes":{"schema":"public","tables":["orders","customers"]}}}}

Whole bodies are accepted from --body '<json>', --file body.json or --file - (stdin). Flags then replace fields at their own location. Top-level keys the operation doesn't declare are rejected, so a body can't redirect the request to another project:

$ supabase warehouse enable --remote=abcdefghijklmnopqrst --yes --body '{"ref":"zyxwvutsrqponmlkjihg","data":{}}'
--body/--file has the field "ref", which the request body does not take.
Top-level fields: data.
# exit 1

Output. The format comes from the global resolver, like every other command: --output-format, else json in agent runs, else text. Text renders the result for people. A JSON:API envelope becomes a heading, then aligned fields, and arrays of objects become tables. A table keeps the scalar columns, and each row's nested fields print in a block below it, with - for null. A sample series under a points key shows its last 10 samples, in response order, with a notice of how many were left out; every other list prints in full, and JSON output shows everything. An empty list prints No results. json writes one stdout document: the API response exactly as sent (null for an empty body), so | jq stays stable. stream-json writes one result frame with the same data. A success body that isn't valid JSON fails in both and leaves stdout empty. Progress goes through the output service's tasks: a spinner in text (showing the current status during --wait), stderr lines in json, and log frames in stream-json. A dry run prints the request in the same three forms. The legacy -o/--output flag is a usage error that points to --output-format, since it goes away in V4.

Consent follows ADR 0033. Mutations ask with a default of no, and the question lists the request values (path, query and body fields, from flags, --body or --file), so options such as disable --delete-data or layout update --reset-table show before you confirm. A command with confirmDescription also prints its API description first, so replication add warns that the pipeline restarts before you answer. Non-interactive runs need --yes or SUPABASE_YES. Read-only commands such as status don't ask.

--wait turns the accepted response into a polled status read:

sequenceDiagram
  participant U as supabase warehouse enable --wait
  participant API as Management API
  U->>API: POST /v2/projects/{ref}/warehouse/enable
  API-->>U: 202 {data.attributes.selection_id}
  loop first read immediately, then backoff 1s → 2s → 4s → 8s → 10s cap (Retry-After wins if longer)
    U->>API: GET /v2/projects/{ref}/warehouse/setups/current?selection_id=…
    API-->>U: 200 {status, status_error}
  end
  alt status = succeeded
    U-->>U: print the accepted response, exit 0
  else status = failed
    U-->>U: operation_failed with the status_error message, exit 1
  else read answers non-2xx
    U-->>U: that API error (not_found, conflict, …), exit 1
  else --timeout (default 10m) reached
    U-->>U: wait_timeout, exit 1
  end
Loading

Each read goes through the shared @supabase/api client, which retries a 429 or a 5xx inside the --timeout. A non-2xx that the client returns ends the wait.

Both wait failures include a follow-up command in their suggestion. When the polled read is a command, the suggestion names it with the identity from the accepted response, as in supabase warehouse teardowns get --operation-id <id> --remote=<ref> after disable --wait. When it is a poll-only read, the suggestion names the command of its poll.inspect operation, as in supabase warehouse status --remote=<ref> after enable --wait.

supabase warehouse disable --wait polls the cleanup read the same way. A command prints one result shape with or without --wait: enable --wait and disable --wait print the accepted response once the operation succeeds, and the settled state stays one status or teardowns get away. supabase warehouse teardowns get --wait polls its own route, with its own flags and no change request, and prints the last read, which is its usual shape.

Errors

Generated commands fail through the same path as every other command, so they add no error contract of their own. Text prints the message and its suggestion on stderr. json writes {"_tag":"Error","error":{"code","message","suggestion"?,"entitlement"?}} to stdout, and stream-json writes an error frame. code is the error's tag (ApiCommandStatusError, ApiCommandUsageError, ApiCommandOperationFailedError, ApiCommandWaitTimeoutError, ApiCommandUnexpectedResponseError, or a shared error such as HostedMutationConsentRequiredError). Failures exit 1, and an interrupt exits 130.

$ supabase warehouse disable --remote=abcdefghijklmnopqrst --yes --output-format json
{"_tag":"Error","error":{"code":"ApiCommandStatusError","message":"The selection changed: Re-run enable. (HTTP 409)"}}

A plan-gated 4xx (server body code entitlement_required) carries entitlement: {feature, upgrade_url} in place of the permission suggestion. Text prints the upgrade hint, and cli_upgrade_suggested fires.

Suggestions are built where the information is still available:

  • 401 → Run `supabase login` .
  • 403 → the FGA permissions the operation needs.
  • A hint from the server always takes precedence.

Other changes

  • packages/api. Enable, disable, the setup and teardown reads and their links come from the published spec. openapi-overrides.json adds the status, connection, tables, table, table layout (read and update), query statistics, capacity and replication (add, remove and resync) operations until they are published, and moves the setup read to warehouse.setups get with x-operation.poll.inspect. generate.ts normalizes nullable oneOf unions as it already did anyOf. The typed client, contracts and permissions are regenerated.
  • Config. Adds experimental.warehouse to the config schema and to the document-only local paths in packages/config; apps/cli/schemas/config/v1.json is regenerated.
  • Tooling. Adds the Turbo tasks supabase#api-commands:generate and api-commands:check, which is part of check:all. Root generate regenerates @supabase/api and @supabase/stack first, then runs supabase#api-commands:generate and schemas:generate in a second Turbo run, so the command data is derived from the refreshed spec rather than from a cache keyed on the old one. api-package-sync.yml regenerates command data and the reference together with the spec. oxlint ignores generated.ts.
  • CLI runtime. linkedDbResolverRuntimeLayer becomes lazyManagementApiRuntimeLayer, shared by db, logs, migration, pull and the generated commands, so the API client is built only when a command needs it. main.ts and root.ts resolve the enabled noun features through api-command-features.ts, and the error-tag snapshot gains the five new error tags.
  • Docs. The generated generated.md lists each command's route, experimental gate, flags and bindings, and its --wait read; api-commands:check keeps it in sync. Generated commands get no per-command folder.

Not in this PR

  • More generated resources. Warehouse is the pilot, and its remaining commands follow once their API operations are in the spec.
  • Upstreaming x-operation and the links to the published spec.
  • A machine-readable command surface (surface.json) and a breaking-change gate built on it. An extraction without a CI-checked consumer was dropped from this PR.
  • Generated commands outside the experimental stage.

@jgoux jgoux self-assigned this Nov 16, 2026
@jgoux

jgoux commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

/ai-review

@github-actions github-actions Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Superseded by a newer AI review

🤖 AI Review

Verified all 8 Claude and 5 Codex findings against the PR code and trusted conventions, merging two duplicate pairs into 11 confirmed findings. The main issues concern machine-error rendering, error classification, sensitive previews, overlapping result schemas, and generator/runtime mismatches. Generator and sensitive-field gaps are latent for the current warehouse entries. Newline handling, telemetry documentation, and E2E delay are polish concerns. The unlinked-project message still contains the link guidance, correcting an overstatement in Claude's finding.

Findings

Severity Location Category Sources Claim
🟠 MAJOR apps/cli/src/shared/cli/run.ts:861 error-handling codex Standard failures ignore agent-selected machine output. A TTY invocation with --agent=yes can resolve to JSON output but receive a human-text failure instead of the standard error document.
🟡 MINOR apps/cli/src/shared/cli/standard-errors.ts:174 error-handling claude The standard error mapper misclassifies target-resolution failures as internal_error with exit 1 and hint:null. Project-not-linked and invalid-link-state errors bypass the InvalidInput-only usage mapping; wrapped branch network/status errors also bypass the HTTP mappings.
🟡 MINOR apps/cli/src/command-internal/command-surface/command-surface.ts:213 schema-contract codex The result schema's oneOf rejects valid warehouse documents that satisfy both the accepted-response and waited-response schemas.
🟡 MINOR apps/cli/src/commands/api/api-command-request.ts:226 redaction claude+codex For a generated body field marked sensitive, supplying its value solely through --body or --file bypasses dry-run masking.
🟡 MINOR apps/cli/scripts/api-command-derive.ts:458 correctness claude The generator accepts operations without a ref path parameter even though the runtime always supplies ref. A generated operation whose input schema has no ref field then fails strict input decoding.
🟡 MINOR apps/cli/src/commands/api/runtime.ts:245 command-generation claude+codex The generator accepts nested noun paths that the runtime silently omits when constructing command groups.
🟡 MINOR apps/cli/src/commands/api/api-command.errors.ts:40 telemetry claude Operation failures and wait timeouts are classified as invalid user input in telemetry even though they arise after a valid request has been sent.
⚪ NIT apps/cli/scripts/api-command-derive.ts:350 correctness claude Wait-schema lookup rejects +json response media types that the generator otherwise supports as JSON.
⚪ NIT apps/cli/src/commands/api/api-command-execute.ts:155 output claude JSON response passthrough emits no trailing newline when the API body lacks one, leaving terminal output and line-oriented consumers with an unterminated final line.
⚪ NIT apps/cli/src/commands/api/warehouse/enable/SIDE_EFFECTS.md:70 docs claude The telemetry documentation incorrectly says only target and runtime flag names appear in flags. Generated flags, body, and file also appear as redacted entries, and timeout's value is redacted.
⚪ NIT apps/cli/src/commands/api/api-commands.e2e.test.ts:162 test-quality codex The subprocess wait test incurs a real one-second polling delay for a transition already covered by controlled-clock tests.

Stats

Claude findings: 8 · Codex findings: 5 · Confirmed: 11 · Refuted: 0 · Uncertain: 0


Models: claude-opus-5-5 + gpt-6.1-sol · Trigger: manual · Workflow run

This review runs once per PR. A maintainer can request another with a /ai-review comment.

Comment thread apps/cli/src/shared/cli/run.ts Resolved
Comment thread apps/cli/scripts/api-command-derive.ts Resolved
Comment thread apps/cli/scripts/api-command-derive.ts Resolved
Generated Management API commands now take their names and polling
behaviour from an `x-operation` extension and standard response
`links` in the OpenAPI spec. Secrets are marked on the field, and
flags follow a naming convention. The CLI keeps the noun allowlist,
the verb vocabulary and an override table, which is empty today.
Only operations listed in generatedOperations generate commands. x-operation on
any other operation is ignored until the spec metadata design settles.
- Agent runs on a terminal report failures as the standard JSON document.
- Unlinked-project and branch-resolution failures map to usage, network
  and API error codes instead of internal_error.
- Operation-failed and wait-timeout errors classify as API status.
- --dry-run masks sensitive fields supplied through --body or --file.
- Result schemas combine branches with anyOf.
- Generation rejects nested groups and operations without a ref path
  parameter, and reads +json success schemas for wait pointers.
- SIDE_EFFECTS telemetry wording matches what is recorded.
@jgoux

jgoux commented Nov 16, 2026

Copy link
Copy Markdown
Contributor Author

/ai-review

@github-actions github-actions Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Superseded by a newer AI review

🤖 AI Review

Verified all three findings against the checked-out code and trusted conventions. Both Codex findings are confirmed as minor correctness issues; Claude's missing-newline finding is confirmed as a formatting nit. No findings overlap.

Findings

Severity Location Category Sources Claim
🟡 MINOR apps/cli/src/commands/api/api-command-execute.ts:101 error-handling codex Generated commands discard plan-gate entitlement metadata, losing upgrade guidance, structured entitlement details, and the associated telemetry.
🟡 MINOR apps/cli/scripts/api-command-derive.ts:384 correctness codex Wait validation rejects valid JSON Pointers containing escaped property names.
⚪ NIT apps/cli/src/commands/api/api-command-execute.ts:155 output-consistency claude JSON success responses without a trailing newline leave stdout unterminated, unlike dry-run previews and text or empty responses in JSON mode.

Stats

Claude findings: 1 · Codex findings: 2 · Confirmed: 3 · Refuted: 0 · Uncertain: 0


Models: claude-opus-5-5 + gpt-6.1-sol · Trigger: manual · Workflow run

This review runs once per PR. A maintainer can request another with a /ai-review comment.

Comment thread apps/cli/scripts/api-command-derive.ts Resolved
…ator

Generated commands gain nested groups, one positional argument, header
flags, action verbs, file-only body fields and reads that poll
themselves, so `warehouse status --wait` waits for a final status.

The generator rejects what the runtime cannot send safely: a secret held
at any depth of a body field without a masked flag, secret header or
query parameters, non-string positionals, nullable wait pointers and
link expressions other than the project ref and response pointers. The
runtime rejects an empty or dot-segment positional before any request.

The command surface moves under `src/cli`, and the shared API command
errors and stage annotation move under `src/command-internal`. The
command policy replaces the override table, and the dry-run preview
lists headers.
…generated commands

Generated commands now parse the Management API entitlement_required body on a
4xx, carry the entitlement in the standard error document, print the upgrade
hint in text mode, and fire cli_upgrade_suggested. The generator decodes ~1 and
~0 in --wait link pointers the same way the runtime does.
bnjjj and others added 2 commits November 17, 2026 15:56
Add generated `warehouse disable` and `warehouse teardowns get` commands
with explicit `--delete-data`, bounded waiting, and the existing
Warehouse feature gate.

Retain data by default, poll the accepted cleanup identity, and include
the last observed lifecycle state in timeout errors. Reuse shared
targeting, consent, output, and error handling.

`warehouse teardowns get` reads current cleanup without an ID. Optional
`--operation-id` pins observation; `warehouse disable --wait` supplies
its ID automatically.

Stacks on #7640. Depends on
supabase/platform#42016.

Implements PIPE-1447. Keeps the local request-preview contract; resolved
impact previews remain follow-up work.
bnjjj and others added 3 commits November 17, 2026 22:21
Generate `warehouse status` from `GET
/v2/projects/{ref}/warehouse/status`, preserving readiness,
capabilities, zero-target enablement and unavailable observations
through the shared runtime.

Preserve `warehouse enable --wait` with selection-bound setup polling.
Discover internal polling targets from response links without exposing a
`warehouse setups get` command; status has no wait flags. Retain
teardown waiting.

Keep text output on terminals, raw JSON when piped or requested, and
YAML through `-o yaml`.

Stacked on #7640 (including merged #7660). Depends on
supabase/platform#42039.

Implements PIPE-1445.

---------

Co-authored-by: Julien Goux <hi@jgoux.dev>
Generate `warehouse connection` from `GET
/v2/projects/{ref}/warehouse/connection`. It prints the Arrow Flight SQL
endpoint, the TLS requirement and source-database login guidance: use a
database role with its existing password (`postgres` uses the project's
database password) and `supabase_warehouse_reader` membership. The
command never fetches or prints a password, and a disabled, unconfigured
or unavailable Warehouse shows no connection string.

Text output on terminals, raw JSON when piped or requested, and YAML
through `-o yaml`, as for the other generated Warehouse commands. Help
includes a usql recipe.

Add `connection` to the generated command vocabulary and render `TLS` as
an acronym in text labels. The contract comes from an OpenAPI override
until it ships in the deployed Management API specification.

Stacked on #7671. Depends on
supabase/platform#42053.

Implements PIPE-1449.

---------

Co-authored-by: Julien Goux <hi@jgoux.dev>
Drive the experimental gate for generated command groups from the policy
nouns instead of a warehouse-specific resolver, and replace the
per-command warehouse SIDE_EFFECTS docs with a shared contract plus a
generated per-command reference kept in sync by the generator check.
jgoux and others added 7 commits November 18, 2026 14:41
A read that a `--wait` polls without being a command now carries
`x-operation: { poll: { ..., inspect } }` with no `group`/`method`.
The generator finds it through the response links of the generated
operations, and `poll.inspect` names the operation whose command the
failure and timeout hint points to.

This replaces the `pollTargets` map in the command policy. The runtime
and the generated command files are unchanged.
The deployed Management API spec now includes the Warehouse disable
route, the teardown read and its response schema, so the overrides that
added them collided and spec regeneration failed. The regenerated
files differ only in ordering.
Only the generated operations list decides whether an operation becomes
a command, and a generated name still goes through every collision
check. A polled read the CLI does not generate may keep its own name
next to poll and inspect, so the spec can name every operation for
other consumers. The setup read's override now names it
warehouse.setups get.
…oined

Generated commands rebuild the group they join, which bypassed the stack
group's own Command.provide. Each stack subcommand now provides the stack
runtime layer itself, so the sealed-group list and its generator check go.
Generate `warehouse tables list` from `GET
/v2/projects/{ref}/warehouse/tables`. It lists the tables selected for
Warehouse replication with their freshness:

- `status`: `syncing`, `live`, `error`, `stopped` or `unknown`;
- the raw replication state;
- when the state was observed;
- `lag_ms`, the flush lag of the replication slot that carries the
table.

Text output shows one row per table. `-o json` and `-o yaml` also
include the full replication feedback. That feedback includes
`flush_lag_bytes`, which reads 0 for a caught-up slot whose lag time
Postgres no longer reports.

Also generate `warehouse tables get <table-id>` from `GET
/v2/projects/{ref}/warehouse/tables/{table_id}`. It reads one of those
tables by the source OID that `warehouse tables list` shows as its ID,
with the same attributes. Its text output also shows the nested
replication feedback, and a table that isn't replicated is an API error.
This is the first generated command with a positional argument on a real
operation, so the generic bindings test now supplies positional path
parameters.

Two generic changes to the text output of generated commands:

- an empty collection prints `No results` instead of `Data  -`;
- a column that holds a nested object in any row is left out of the
table. Before, rows with a nested object printed it as compact JSON
while rows with `null` printed `-`.

The tables contracts, and `flush_lag_bytes` in the status contract, come
from OpenAPI overrides until they ship in the deployed Management API
specification.

Stacked on #7640. Depends on
supabase/platform#42055 and
supabase/platform#42108.

Implements PIPE-1451 and PIPE-1453.

---------

Co-authored-by: Julien Goux <hi@jgoux.dev>
Metrics commands get one range form instead of combining since with from/to, the
metadata assertion that mirrored the surface under test is gone, and commands whose
inputs are all required no longer repeat the same request.
… in consent

Generated commands now take their presentation from --output-format and the
TTY alone, the same rule failures use, and reject -o/--output with a pointer
to --output-format. YAML output goes away with it.

Consent lists the validated request's path, query and body values, so
destructive options such as --delete-data and --reset-table show in the
prompt. A passed --timeout is validated even without --wait.
A dry run against a literal ref now needs no access token, sends no request
and leaves the linked-project cache untouched. Generated commands build
the Management API client through the lazy factory, so the client exists
only once a request is about to be sent. The lazy runtime layer has a new
name that fits both of its consumers.

A --wait poll now parses each response once.
Warehouse, the only generated noun, owns its whole subtree, so merging
generated commands into hand-written groups had no consumer. The join path,
its generator exemptions and its fixture tests are removed; a noun that
collides with a hand-written root command still fails generation. The
Stack group gets its single group-level layer provide back.
The command surface reads bindings and stage from the generated entry, so the
mounted annotation carries only the operation id and the stage annotation is
gone. Body-bound flags are no longer reported as required on the command line,
and the side-effects doc covers stack-mode project state and the workdir order.
bnjjj and others added 11 commits November 19, 2026 20:26
Adds experimental `warehouse replication add`, `remove` and `resync`
commands on top of #7640.

All three use the generated request/runtime path and preserve the
immediate API response. All support `--dry-run` as a local request
preview, with no server-side dry-run contract. Resync has no
idempotency, revision or wait flags.

The shared generator/runtime gains CLI policy for API impact
descriptions in consent. Local previews use the existing shared
behavior. No hand-written command handlers are added.

Depends on #7640 and the companion Management API endpoints.

---------

Co-authored-by: Julien Goux <hi@jgoux.dev>
…oute help

An ambiguous --remote maps only 401, 403 and token failures to auth
documents; a 404 branch listing stays a usage error. The --wait spinner
status and a non-JSON text-mode success body are escaped for display,
while JSON output keeps the original bytes. Routing args drop a leading
help so `help warehouse` and `help compute` resolve their feature, and
the stack backend reuses that. Help tests assert the cache and poll
permissions outside dry runs.
The noun's gate field is now `experimental`, matching the `experimental.<name>` config key it
reads. Entries no longer copy it; the reference reads the noun and prints how to enable it.
Develop removed every per-command SIDE_EFFECTS.md; the generated per-command
reference and the tests now carry the generated command contract.
…n contract

The description contract test now builds the warehouse command tree, and the
warehouse connection example is wrapped in a code span so `<host>` no longer
parses as HTML.
@jgoux

jgoux commented Nov 19, 2026

Copy link
Copy Markdown
Contributor Author

/ai-review

@github-actions github-actions Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Superseded by a newer AI review

🤖 AI Review

CLI reference prose guidance: snapshot supabase/supabase@6f13230 supplied to reviewers (advisory, not a style pass).

A malformed polling response can leave a warehouse operation waiting until the default ten-minute timeout. The review also confirmed that dry runs can contact the Management API during target resolution, warehouse success output bypasses NDJSON framing, and the generators have several edge cases. The reported silent overwrite of upstream OpenAPI entries is refuted by an explicit collision guard. Both independent reviews and the pinned prose guidance were available. The adjudication was static, with no test execution.

Findings

Severity Location Category Sources Claim
🟠 MAJOR apps/cli/src/commands/api/api-command-execute.ts:229 error-handling codex A malformed successful polling response is treated as an operation still in progress. After the mutation has been accepted, repeated malformed responses can consume the default ten-minute wait and surface a timeout instead of the response error.
🟡 MINOR apps/cli/src/commands/api/api-command-request.ts:254 security codex The generated-command runtime can echo rejected values for fields marked sensitive when it formats request validation failures.
🟡 MINOR apps/cli/src/commands/api/runtime.ts:112 cli-help codex --dry-run promises to “send nothing,” but resolving the target can still send Management API requests.
🟡 MINOR apps/cli/scripts/generate-api-commands.ts:4 code-generation codex The command generator requires its own TypeScript output to load before it can recreate that file or report it missing in check mode.
🟡 MINOR apps/cli/scripts/api-command-derive.ts:449 code-generation codex A valid operation-level override of a path-item query parameter can fail command generation with a duplicate flag.
🟡 MINOR apps/cli/scripts/api-command-derive.ts:207 code-generation codex Reordering properties in one anyOf branch can make the command generator reject an otherwise equivalent request schema.
🟡 MINOR apps/cli/scripts/api-command-derive.ts:1038 code-generation codex The generator can approve a linked wait when a success response lacks the value needed to poll. A mutation can then succeed before the CLI exits with a defect.
🟡 MINOR packages/api/scripts/generate.ts:340 correctness codex Normalizing a nullable oneOf that already has an explicit null branch adds a second null branch. The resulting exclusive union has two matches for null.
🟡 MINOR apps/cli/scripts/api-command-reference.ts:30 documentation codex The generated reference inserts a literal backslash into the copyable Flight SQL connection example.
🟡 MINOR apps/cli/src/commands/api/api-commands.integration.test.ts:2237 test-coverage codex The test named “keeps JSON for success and failure when --output-format text is piped” does not verify that the failure is rendered as JSON.
⚪ NIT apps/cli/src/commands/api/api-command-execute.ts:165 output-consistency claude A warehouse success response can be emitted without a record terminator under --output-format stream-json, which advertises NDJSON.
⚪ NIT apps/cli/src/commands/api/api-commands.e2e.test.ts:200 test-coverage codex Two subprocess tests repeat the same successful enable-and-wait sequence. One invocation can cover piped output selection and assert the linked request paths.
⚪ NIT apps/cli/src/shared/cli/run.ts:48 style codex The patch changes Tty to a value import even though the file only uses it as a type.
⚪ NIT apps/cli/src/commands/api/generated.ts:11 docs-style codex The connection help uses “Login” in prose and omits the Oxford comma in its list of values the API excludes.
⚪ NIT apps/cli/src/commands/api/generated.ts:369 docs-style codex Warehouse help uses “PostgreSQL” in descriptive prose where the snapshot calls for “Postgres.”
⚪ NIT apps/cli/src/commands/api/generated.ts:267 docs-style codex Query-stats help refers to since, from, and to without the -- prefixes readers need to enter those CLI flags.
⚪ NIT apps/cli/src/commands/api/generated.ts:28 docs-style codex The disable help gives the API query field for permanent deletion and introduces “FDW” without expansion.
⚪ NIT apps/cli/src/commands/api/api-command-policy.ts:46 docs-style codex The top-level warehouse description uses “Manage” where it could name the actions the command group supports.
Refuted findings (kept for transparency, not posted as review comments)
  • packages/api/scripts/openapi-overrides.json:157 (code-generation): The temporary Warehouse add overrides will silently replace upstream path items and schemas published under the same keys.
    Refuted: This repository’s override implementation rejects existing object keys and identifies the conflicting pointer. A collision fails regeneration before any replacement occurs.

Stats

Claude findings: 1 · Codex findings: 18 · Confirmed: 18 · Refuted: 1 · Uncertain: 0


Models: claude-opus-5-5 + gpt-6.2-sol · Trigger: manual · Workflow run

This review runs once per PR. A maintainer can request another with a /ai-review comment.

Comment thread apps/cli/src/commands/api/runtime.ts Resolved
Comment thread apps/cli/scripts/api-command-derive.ts Resolved
Comment thread apps/cli/src/commands/api/generated.ts Resolved
Comment thread apps/cli/src/commands/api/generated.ts Resolved
Comment thread apps/cli/src/commands/api/generated.ts Resolved
Comment thread apps/cli/src/commands/api/generated.ts Resolved
Fail --wait right away when a poll response has no readable status, instead of
polling until the timeout. Drop the reference escaping that broke the copyable
connection example, reword the --dry-run help, revert the unused nullable oneOf
normalization, and tighten the piped-output tests.
@jgoux

jgoux commented Nov 20, 2026

Copy link
Copy Markdown
Contributor Author

/ai-review

@github-actions github-actions Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Superseded by a newer AI review

🤖 AI Review

CLI reference prose guidance: snapshot supabase/supabase@a76a577 supplied to reviewers (advisory, not a style pass).

Static review confirmed 15 of 17 findings. The highest-priority issues are unvalidated API response bytes reaching an interactive terminal and --wait reporting an internal error without a recovery command after a mutation has been accepted. The two refuted findings are covered by UUID validation and the OpenAPI patch loader’s existing-path guard. The supplied prose snapshot supports four advisory help findings. The changed-file list contained no CLI reference overlays, and the supplied next context showed no fundamental conflict. Tests were not run.

Findings

Severity Location Category Sources Claim
🔴 CRITICAL apps/cli/src/commands/api/api-command-execute.ts:166 security codex Selecting JSON or stream-JSON output on a terminal lets a malformed successful API response write server-controlled terminal sequences to stdout.
🟠 MAJOR apps/cli/src/commands/api/api-command-execute.ts:300 error-handling codex An accepted Warehouse mutation can report internal_error with no recovery command under --wait when the API omits the identifier needed to poll.
🟡 MINOR apps/cli/src/commands/api/runtime.ts:227 error-handling claude With a valid request and a resolved project, a Warehouse mutation checks credentials before consent. A noninteractive caller without credentials or --yes receives unauthenticated with exit 1 instead of usage_error with exit 2. An interactive caller without credentials cannot reach the consent prompt.
🟡 MINOR apps/cli/src/shared/cli/standard-errors.ts:269 terminal-output codex An invalid request file can inject control characters into an interactive usage error.
🟡 MINOR apps/cli/scripts/api-command-derive.ts:1064 generator-validation codex The generator accepts a polling status pointer that resolves to a non-string field the runtime can never use as a status.
🟡 MINOR apps/cli/scripts/api-command-derive.ts:449 generator-parameters codex An OpenAPI operation-level parameter override can cause command generation to fail as a duplicate parameter.
🟡 MINOR apps/cli/src/commands/api/api-command-request.ts:253 redaction codex The generic request validator can echo a rejected credential for operations that use the generator’s sensitive-field support.
🟡 MINOR apps/cli/src/commands/api/runtime.ts:273 side-effects codex Rejecting a request or declining Warehouse consent can still trigger a Management API lookup and a local project-cache write.
🟡 MINOR apps/cli/src/commands/api/generated.ts:84 command-help codex The help for three warehouse enable flags describes their behavior using an unexplained targets input.
🟡 MINOR apps/cli/src/commands/api/api-commands.integration.test.ts:2251 test-coverage codex The terminal --output-format stream-json test can pass if CLI startup stops applying the flag to output presentation.
🟡 MINOR apps/cli/src/commands/api/api-commands.e2e.test.ts:175 test-coverage codex The Warehouse subprocess suite repeats successful status and wait behavior already covered at the handler boundary and exceeds the documented one-to-three golden-path guidance.
⚪ NIT apps/cli/src/commands/api/api-command-policy.ts:46 docs-style codex The Warehouse and replication group help uses a vague verb where it could name the available operations.
⚪ NIT apps/cli/src/commands/api/generated.ts:11 docs-style codex The Warehouse connection help uses “Login” in prose and omits Oxford commas.
⚪ NIT apps/cli/src/commands/api/generated.ts:530 docs-style codex Warehouse help uses “PostgreSQL” for prose references to the source database where the terminology guide calls for “Postgres.”
⚪ NIT apps/cli/src/commands/api/runtime.ts:101 docs-style codex The --body help leaves readers to infer which flags override which JSON fields.
Refuted findings (kept for transparency, not posted as review comments)
  • apps/cli/src/commands/api/api-command-execute.ts:274 (output-sanitization): Warehouse polling recovery hints can interpolate an API-returned identifier containing whitespace, shell metacharacters, or control characters.
    Refuted: The teardown hint can include only a validated UUID and project ref. The setup poll uses the public warehouse status hint without forwarding the API-returned selection ID, as shown in apps/cli/src/commands/api/api-command-execute.ts:326–327 and apps/cli/src/commands/api/generated.ts:711–717.
  • packages/api/scripts/openapi-overrides.json:157 (api-sync): The temporary Warehouse path overrides can silently replace upstream contracts when the Management API starts publishing them.
    Refuted: This implementation rejects an existing object member. The guard aborts generation and identifies the path when upstream begins publishing it.

Stats

Claude findings: 2 · Codex findings: 15 · Confirmed: 15 · Refuted: 2 · Uncertain: 0


Models: claude-opus-5-5 + gpt-6.2-sol · Trigger: manual · Workflow run

This review runs once per PR. A maintainer can request another with a /ai-review comment.

Comment thread apps/cli/src/commands/api/runtime.ts Outdated
Comment on lines +227 to +236
const api = yield* (yield* CommandPlatformApiFactory).make;
if (!entry.readOnly) {
yield* requireHostedMutationConsent({
action: summaryText(entry),
details: [
...(entry.confirmDescription && entry.description ? [entry.description] : []),
...consentDetails(entry, decoded),
],
});
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 MINOR · error-handling · source: claude

With a valid request and a resolved project, a Warehouse mutation checks credentials before consent. A noninteractive caller without credentials or --yes receives unauthenticated with exit 1 instead of usage_error with exit 2. An interactive caller without credentials cannot reach the consent prompt.

Evidence: apps/cli/src/commands/api/runtime.ts:227 constructs the client before lines 228–236 check consent. apps/cli/src/auth/command-platform-api.layer.ts:51–54 fails if no token is available. apps/cli/src/shared/cli/standard-errors.ts:175–179 and 194–195 map consent and authentication failures to their separate codes.

Suggested fix: Move API client construction after the mutation consent check and keep target resolution and request validation before the prompt.

Comment on lines +166 to +173
if (format === "json") return yield* output.rawBytes(response.bytes);
const text = textDecoder.decode(response.bytes);
const parsed = decodeJsonText(text);
if (Option.isNone(parsed)) {
const lines = text.endsWith("\n") ? text.slice(0, -1) : text;
return yield* output.raw(`${lines.split("\n").map(singleLine).join("\n")}\n`);
}
return yield* output.raw(renderResponseText(parsed.value));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 CRITICAL · security · source: codex

Selecting JSON or stream-JSON output on a terminal lets a malformed successful API response write server-controlled terminal sequences to stdout.

Evidence: apps/cli/src/commands/api/runtime.ts:202 selects JSON based on Output.interactive. Both machine layers set it to false and write raw bytes directly in apps/cli/src/shared/output/output.layer.ts:616–618, 674, 707–709, and 772. apps/cli/src/commands/api/api-command-execute.ts:166 writes before parsing. The regression test at apps/cli/src/commands/api/api-commands.integration.test.ts:528–537 explicitly expects control bytes in a non-JSON response to pass through.

Suggested fix: Validate nonempty machine-mode responses as UTF-8 JSON. Return a typed API error for malformed bodies and escape terminal control characters when stdout is a TTY. Preserve valid response bytes for redirected or piped output.

Comment on lines +300 to +310
const changedBody = parseResponse(input.changed);
const readInput: Record<string, unknown> = { ref: input.ref };
for (const [param, pointer] of Object.entries(input.wait.params)) {
const value = readPointer(changedBody, pointer);
if (value === undefined || value === null) {
return yield* Effect.die(
new Error(
`${input.changedOperationId} did not return ${pointer}, which ${input.wait.read} needs to wait.`,
),
);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 MAJOR · error-handling · source: codex

An accepted Warehouse mutation can report internal_error with no recovery command under --wait when the API omits the identifier needed to poll.

Evidence: apps/cli/src/commands/api/runtime.ts:243–250 sends the mutation before extracting its polling inputs. apps/cli/src/commands/api/api-command-execute.ts:300–310 dies with a plain Error if the identifier is missing or null. apps/cli/src/shared/cli/standard-errors.ts:233 maps that error to internal_error without a hint. A schema-invalid identifier also stops at line 325, before hint construction.

Suggested fix: Return a typed unexpected-response error for missing or invalid polling metadata. Say that the mutation was accepted and point to warehouse status or warehouse teardowns get so the caller can inspect the outcome before retrying.

Comment on lines +269 to +274
const renderStandardFailure = (pending: PendingStandardFailure): string => {
if (pending.machine) return `\n${JSON.stringify(pending.document)}\n`;
const { message, hint, entitlement } = pending.document;
return `${styleText("red", message)}\n${hint === null ? "" : `${hint}\n`}${
entitlement === undefined ? "" : `${upgradeHint(entitlement.upgrade_url)}\n`
}`;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 MINOR · terminal-output · source: codex

An invalid request file can inject control characters into an interactive usage error.

Evidence: apps/cli/src/commands/api/api-command-request.ts:117–120 inserts an unknown, decoded JSON key directly into the message. apps/cli/src/shared/cli/standard-errors.ts:172–173 preserves that message and lines 269–282 write it to stderr in the human-readable path.

Suggested fix: Escape control characters in untrusted values such as request keys and file paths when constructing diagnostics. Preserve intentional formatting in the surrounding message.

Comment on lines +1064 to +1078
const readResponse = successSchema(spec, readOperation);
const status = resolvePointer(spec, readResponse, wait.status);
if (status === undefined) {
fail(`wait.status pointer "${wait.status}" does not resolve in the ${wait.read} response`);
}
if (wait.error !== undefined && resolvePointer(spec, readResponse, wait.error) === undefined) {
fail(`wait.error pointer "${wait.error}" does not resolve in the ${wait.read} response`);
}
if (wait.succeeded.length === 0) fail("wait.succeeded must list at least one status");
const statusValues = asRecord(status)?.enum;
if (statusValues !== undefined) {
const allowed = asArray(statusValues);
for (const value of [...wait.succeeded, ...wait.failed]) {
if (!allowed.includes(value)) {
fail(`wait status "${value}" is not in the status enum of ${wait.read}`);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 MINOR · generator-validation · source: codex

The generator accepts a polling status pointer that resolves to a non-string field the runtime can never use as a status.

Evidence: apps/cli/scripts/api-command-derive.ts:1064–1078 checks that the pointer resolves and validates status choices only when the target has an enum. apps/cli/src/commands/api/api-command-execute.ts:230–233 accepts only a string, and lines 245–250 fail the poll otherwise.

Suggested fix: Validate that the status pointer resolves to a required, non-null string in the supported polling response schemas.

Comment on lines +175 to +216
it.live("warehouse status keeps consolidated API bytes when stdout is piped", () =>
Effect.gen(function* () {
const response = json(200, {
data: {
type: "warehouse_context",
id: REF,
attributes: {
enabled: true,
status: "ready",
configured_readiness: "ready",
query_connectivity: "not_checked",
tables: { status: "available", items: [] },
replication: { status: "not_started", apply_lag: null },
capabilities: { replication_add: false, replication_remove: false },
},
},
});
const { result, requests } = yield* runWarehouse(["status"], () => response);

requireCliSuccess(result, "warehouse status");
expect(result.stdout, result.stderr).toBe(response.body);
expect(requests).toEqual([`GET /v2/projects/${REF}/warehouse/status`]);
}).pipe(Effect.provide(BunServices.layer)),
);

it.live(
"warehouse enable --wait --output-format text keeps the final JSON response when piped",
() =>
Effect.gen(function* () {
const final = statusBody("succeeded");
const { result, requests } = yield* runWarehouse(
["enable", "--schema", "public", "--wait", "--yes", "--output-format", "text"],
(request) =>
request.method === "POST"
? json(202, { data: { attributes: { selection_id: SEL } } })
: final,
);

requireCliSuccess(result, "warehouse enable --wait --output-format text");
expect(result.stdout, result.stderr).toBe(final.body);
expect(requests).toEqual([`POST ${ENABLE_PATH}`, `GET ${SETUP_PATH}`]);
}).pipe(Effect.provide(BunServices.layer)),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 MINOR · test-coverage · source: codex

The Warehouse subprocess suite repeats successful status and wait behavior already covered at the handler boundary and exceeds the documented one-to-three golden-path guidance.

Evidence: apps/cli/src/commands/api/api-commands.e2e.test.ts:110–252 defines seven subprocess cases, counting both inspect rows. The status and wait cases at lines 175–216 overlap with apps/cli/src/commands/api/api-commands.integration.test.ts:500–514 and 2228–2248. trusted/CLAUDE.md:166–173 reserves subprocess E2E coverage for one to three golden-path workflows.

Suggested fix: Consolidate the subprocess suite around the distinct compiled entrypoint, exit and stderr, and stdin contracts. Keep one check of real piped output and cover the remaining route and response variants in handler integration.

Comment on lines +46 to +49
description: "Manage the data warehouse for a project",
experimental: "warehouse",
groups: {
replication: "Manage Warehouse replication selections and rebuilds",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚪ NIT · docs-style · source: codex

The Warehouse and replication group help uses a vague verb where it could name the available operations.

Evidence: apps/cli/src/commands/api/api-command-policy.ts:46 says Manage the data warehouse for a project and line 49 says Manage Warehouse replication selections and rebuilds. The guide recommends naming the operations and uses Manage as an example of a vague verb. https://github.com/supabase/supabase/blob/a76a577e963d95814aea220a6cd8008c36e9ec7b/apps/docs/style-guide/01-voice-and-tone.md#be-specific-and-concrete

Suggested fix: Use Enable or disable Warehouse, inspect its status, and configure table replication and Add, remove, or resync tables selected for Warehouse replication.

definition: "v2GetWarehouseConnection",
summary: "Get Warehouse Flight SQL connection details",
description:
"Returns the public Arrow Flight SQL endpoint resolved from the project's Warehouse routing, with TLS required on port 443. Status is configured availability and query connectivity is not checked, so DNS readiness does not prove a query will succeed. Login uses a role in the source project database with that role's existing password (postgres uses the project database password), including when the catalog and storage are in another project. The role needs supabase_warehouse_reader membership, which is separate from Management API authorization. No passwords, tokens, catalog credentials or private endpoints are returned, and endpoint, host and port are null unless status is available or pending. Example client: `usql -W 'flightsql://postgres@<host>:443?tls=enabled'`.",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚪ NIT · docs-style · source: codex

The Warehouse connection help uses “Login” in prose and omits Oxford commas.

Evidence: apps/cli/src/commands/api/generated.ts:11 says Login uses a role in the source project database, No passwords, tokens, catalog credentials or private endpoints are returned, and endpoint, host and port are null. The snapshot calls for “sign in” in prose and the Oxford comma in lists. https://github.com/supabase/supabase/blob/a76a577e963d95814aea220a6cd8008c36e9ec7b/apps/docs/style-guide/WORD_LIST.md#login-and-log-in https://github.com/supabase/supabase/blob/a76a577e963d95814aea220a6cd8008c36e9ec7b/apps/docs/style-guide/01-voice-and-tone.md#use-the-oxford-comma

Suggested fix: Use Sign in with a role in the source project database and that role’s existing password. This applies even when the catalog and storage are in another project. For the postgres role, use the project database password. Use The response omits passwords, tokens, catalog credentials, and private endpoints. The endpoint, host, and port fields are null unless the status is available or pending. Update the source description and regenerate the help.

readOnly: true,
argument: {
name: "table-id",
description: "Source PostgreSQL table OID, as returned by the Warehouse tables list.",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚪ NIT · docs-style · source: codex

Warehouse help uses “PostgreSQL” for prose references to the source database where the terminology guide calls for “Postgres.”

Evidence: apps/cli/src/commands/api/generated.ts:530 and 557 say Source PostgreSQL table OID. Lines 108, 369, 420, and 471 use PostgreSQL in source schema descriptions. The terminology entry calls for Postgres in prose and preserves code and literal third-party names. https://github.com/supabase/supabase/blob/a76a577e963d95814aea220a6cd8008c36e9ec7b/apps/docs/style-guide/WORD_LIST.md#postgres

Suggested fix: Use Source Postgres table OID and source Postgres schema in the originating descriptions, then regenerate the CLI help.

body: Flag.optional(
Flag.String("body").pipe(
Flag.withDescription(
"Whole request body as JSON; other flags replace fields at their own location.",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚪ NIT · docs-style · source: codex

The --body help leaves readers to infer which flags override which JSON fields.

Evidence: apps/cli/src/commands/api/runtime.ts:101 says other flags replace fields at their own location. apps/cli/src/commands/api/api-command-request.ts:148–155 writes body-bound flag values to their corresponding JSON fields. The guide recommends naming the operation and the affected object. https://github.com/supabase/supabase/blob/a76a577e963d95814aea220a6cd8008c36e9ec7b/apps/docs/style-guide/01-voice-and-tone.md#be-specific-and-concrete

Suggested fix: Use Pass the full request body as JSON. Flags that set body fields override the corresponding JSON values.

jgoux and others added 4 commits November 23, 2026 13:29
…uards

Ask for hosted consent before creating the API client, fall back to the
status hint when the API sends a blank one, reject non-JSON success bodies
in JSON output, name the argument or flag in validation errors, keep --file
in help examples unless a required flag fills the body, and render the -o
rejection as JSON for every -o value.

The generator now rejects envelope data fields other than type and
attributes, and waits whose operation or poll target declares several 2xx
responses.
…ehouse-commands

# Conflicts:
#	packages/api/src/generated/contracts.ts
…ands

Generated commands now resolve the format with the global resolver, fail
through the existing error document and exit codes, emit stream-json result
and log frames, and print the same result with or without --wait. The
bespoke standard-errors envelope is removed.
@jgoux

jgoux commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

/ai-review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI Review

CLI reference prose guidance: snapshot supabase/supabase@9b1af5b supplied to reviewers (advisory, not a style pass).

Both independent reviews were available. The Warehouse restart command makes the hosted-consent snapshot stale, and malformed machine output can tell users to repeat a mutation the API already accepted. The typed Warehouse status client rejects the previous response shape, but current deployment behavior could not be verified. The override loader already rejects collisions with upstream definitions, and the subprocess tests exercise stdout behavior that the handler tests replace with a mock. The CLI prose findings were checked against the pinned guidance. The PR description was unavailable, and the repository test suite was not run.

Findings

Severity Location Category Sources Claim
🟠 MAJOR apps/cli/src/command-internal/hosted-consent/hosted-consent-coverage.unit.test.ts:140 test-regression claude+codex The hosted-consent snapshot will fail because it omits the new warehouse replication restart mutation.
🟠 MAJOR apps/cli/src/commands/api/api-command-execute.ts:169 error-handling codex A malformed 2xx body in machine-output mode tells users to retry an accepted mutation, including a Warehouse table resync that can reset the table again.
🟡 MINOR packages/api/src/generated/contracts.ts:15267 api-compatibility codex The typed Warehouse status method rejects responses that conformed to the previous status schema.
🟡 MINOR apps/cli/src/commands/api/api-command-execute.ts:334 error-handling codex An accepted mutation ends in an internal defect if its response lacks usable polling metadata.
🟡 MINOR apps/cli/scripts/generate-api-commands.ts:4 code-generation codex The API command generator cannot recreate generated.ts when the file is missing or syntactically invalid.
🟡 MINOR apps/cli/src/commands/api/api-command-execute.ts:195 output codex --output-format json can return success while writing invalid UTF-8 to stdout.
🟡 MINOR apps/cli/src/commands/api/api-command-request.ts:246 redaction codex The shared runtime can echo a value marked sensitive when request-schema validation fails.
🟡 MINOR apps/cli/scripts/api-command-derive.ts:1059 code-generation codex API command generation accepts wait links whose source schema cannot satisfy the polling input, and it can accept a non-string status field.
🟡 MINOR apps/cli/scripts/api-command-derive.ts:206 code-generation codex Reordering equivalent JSON Schema properties can make API command generation reject an otherwise supported anyOf envelope.
🟡 MINOR apps/cli/src/commands/api/generated.ts:28 help-text codex Warehouse help uses API field names where users need CLI flag syntax.
⚪ NIT apps/cli/src/commands/api/api-command-execute.ts:303 error-handling claude The shared wait runtime prints follow-up commands with unquoted argument values, so a future polling input containing spaces or shell metacharacters can produce an unsafe or incorrect command to paste.
⚪ NIT apps/cli/src/commands/api/generated.ts:11 docs-style codex Warehouse connection help uses “Login” in prose and places a password instruction in parentheses.
⚪ NIT apps/cli/src/commands/api/generated.ts:108 docs-style codex Warehouse flag and argument help uses “PostgreSQL” in general prose.
⚪ NIT apps/cli/src/commands/api/api-command-policy.ts:71 docs-style codex The Warehouse group descriptions use “Manage” where they could name the available operations.
⚪ NIT apps/cli/src/commands/api/generated.ts:28 docs-style codex The disable and teardown help use unfamiliar abbreviations on first mention.
⚪ NIT apps/cli/src/commands/api/generated.ts:458 docs-style codex The restart and resync help omit serial commas in lists of states or effects.
⚪ NIT apps/cli/src/commands/api/generated.ts:293 docs-style codex The query-stats interval help omits the thousands separator from the point limit.
Refuted findings (kept for transparency, not posted as review comments)
  • packages/api/scripts/openapi-overrides.json:157 (api-sync): The Warehouse add overrides would silently replace upstream paths and schemas after they appear in the deployed specification.
    Refuted: packages/api/scripts/download-openapi.ts:145–148 throws if the object key already exists, before assignment. packages/api/scripts/download-openapi.unit.test.ts:104 covers an existing-key collision. The sync fails visibly if upstream adds either key.
  • apps/cli/src/commands/api/api-commands.e2e.test.ts:263 (test-coverage): The subprocess cases for status output and enable polling duplicate the corresponding handler integration coverage.
    Refuted: The handler and subprocess cases share success outcomes, but they cover different output boundaries. The compiled cases exercise actual feature wiring, raw stdout, and NDJSON serialization. The handler tests observe mock output calls. The targeted subprocess coverage fits trusted/apps/cli/CLAUDE.md:285–291.

Stats

Claude findings: 2 · Codex findings: 18 · Confirmed: 17 · Refuted: 2 · Uncertain: 0


Models: claude-opus-5-5 + gpt-6.2-sol · Trigger: manual · Workflow run

This review runs once per PR. A maintainer can request another with a /ai-review comment.

Comment on lines +140 to +143
"warehouse replication add": "no",
"warehouse replication remove": "no",
"warehouse replication resync": "no",
"warehouse tables layout update": "no",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 MAJOR · test-regression · source: claude+codex

The hosted-consent snapshot will fail because it omits the new warehouse replication restart mutation.

Evidence: The test enables Warehouse at line 14, collects consenting leaves at lines 17–26, and snapshots the result at line 87. Lines 140–143 skip warehouse replication restart. apps/cli/src/commands/api/generated.ts:453–460 registers that leaf with readOnly: false, and apps/cli/src/commands/api/runtime.ts:349 assigns it consent: "no".

Suggested fix: Add "warehouse replication restart": "no" to the inline snapshot.

Comment on lines +169 to +173
const invalidJsonResponse = () =>
new ApiCommandUnexpectedResponseError({
message: "The API returned a success response that is not valid JSON.",
suggestion: "Retry the command; if it keeps failing, report it with the command you ran.",
});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 MAJOR · error-handling · source: codex

A malformed 2xx body in machine-output mode tells users to retry an accepted mutation, including a Warehouse table resync that can reset the table again.

Evidence: apps/cli/src/commands/api/api-command-execute.ts:154–162 accepts the 2xx response before rendering. Lines 169–173 and 195–207 return the Retry the command suggestion when the JSON parse fails in machine mode. apps/cli/src/commands/api/generated.ts:476 explicitly says that repeating a resync may reset the table again.

Suggested fix: Pass the operation's read or mutation policy to the renderer. For a mutation that returned 2xx, report that the API accepted the request and direct the user to inspect the resource before retrying.

}),
Schema.Null,
]),
replication_restart: Schema.Boolean,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 MINOR · api-compatibility · source: codex

The typed Warehouse status method rejects responses that conformed to the previous status schema.

Evidence: trusted/packages/api/src/generated/contracts.ts:15643–15650 shows the previous capabilities shape without replication_restart. The PR makes it mandatory at packages/api/src/generated/contracts.ts:15267 and adds further required keys at lines 15371, 15637, and 15668. packages/api/src/generated/effect-client.ts:3223–3235 uses the typed execution path, which decodes JSON against the output schema at packages/api/src/internal/client.ts:695–699 and 742–747.

Suggested fix: Keep the new response keys optional during rollout, or tighten the schema after confirming that all supported deployments return them.

Comment on lines +334 to +343
const changedBody = parseResponse(input.changed);
const readInput: Record<string, unknown> = { ref: input.ref };
for (const [param, pointer] of Object.entries(input.wait.params)) {
const value = readPointer(changedBody, pointer);
if (value === undefined || value === null) {
return yield* Effect.die(
new Error(
`${input.changedOperationId} did not return ${pointer}, which ${input.wait.read} needs to wait.`,
),
);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 MINOR · error-handling · source: codex

An accepted mutation ends in an internal defect if its response lacks usable polling metadata.

Evidence: apps/cli/src/commands/api/runtime.ts:237–248 sends the mutation before extracting the polling input. apps/cli/src/commands/api/api-command-execute.ts:334–343 calls Effect.die for missing or null metadata, and lines 355–359 turn polling input schema failures into defects.

Suggested fix: Return a typed unexpected-response error that tells the user the request was accepted. Include a status command when the available arguments can construct one.

import { BunRuntime, BunServices } from "@effect/platform-bun";
import { Console, Data, Effect, FileSystem, Path, Predicate, Schema, Stream } from "effect";
import { ChildProcess, ChildProcessSpawner } from "effect/process";
import { rootCommandForFeatures } from "../src/cli/root.ts";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 MINOR · code-generation · source: codex

The API command generator cannot recreate generated.ts when the file is missing or syntactically invalid.

Evidence: apps/cli/scripts/generate-api-commands.ts:4 statically imports the CLI root. apps/cli/src/cli/root.ts:29 imports the API command runtime, which statically imports ./generated.ts at apps/cli/src/commands/api/runtime.ts:52. The generator only checks or writes the output at lines 113–123.

Suggested fix: Collect the handwritten root command names through a module that does not import the generated API command runtime.

repeatable: false,
required: true,
description:
"Source PostgreSQL schema. Without tables, selects its currently eligible tables only.",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚪ NIT · docs-style · source: codex

Warehouse flag and argument help uses “PostgreSQL” in general prose.

Evidence: apps/cli/src/commands/api/generated.ts:108 says Source PostgreSQL schema, and line 548 says Source PostgreSQL table OID. The pinned word list uses “Postgres” outside code and literal third-party names. https://github.com/supabase/supabase/blob/9b1af5be91ccfac0e7d449eccc2532069f2d18b3/apps/docs/style-guide/WORD_LIST.md#postgres

Suggested fix: Use “Source Postgres schema” and “Object identifier (OID) of the source Postgres table, as returned by the Warehouse tables list” in the source descriptions.

Comment on lines +71 to +74
description: "Manage the data warehouse for a project",
experimental: "warehouse",
groups: {
replication: "Manage Warehouse replication selections and rebuilds",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚪ NIT · docs-style · source: codex

The Warehouse group descriptions use “Manage” where they could name the available operations.

Evidence: apps/cli/src/commands/api/api-command-policy.ts:71 says Manage the data warehouse for a project, and line 74 says Manage Warehouse replication selections and rebuilds. The pinned guide directs writers to name concrete operations and gives “Manage” as an example to avoid. https://github.com/supabase/supabase/blob/9b1af5be91ccfac0e7d449eccc2532069f2d18b3/apps/docs/style-guide/01-voice-and-tone.md#be-specific-and-concrete

Suggested fix: Use “Enable, inspect, or disable a project's Warehouse” and “Add or remove tables, restart replication, or rebuild a table.”

definition: "v2DisableWarehouse",
summary: "Disable Warehouse replication and access",
description:
"Stops replication and removes the Warehouse publication, FDW and dependent foreign tables, reader group, catalog access and query routing asynchronously. Stored Warehouse data is retained by default. Set delete_data=true to permanently delete the managed catalog schema and dedicated Storage bucket; destination SQL and Storage write permissions are also required. Legacy shared buckets and source Postgres tables are preserved. Reader memberships are not restored on re-enablement. Safe retries return the existing cleanup identity; changing an in-progress data policy returns a conflict. Poll the linked teardown for completion or partial cleanup failures.",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚪ NIT · docs-style · source: codex

The disable and teardown help use unfamiliar abbreviations on first mention.

Evidence: apps/cli/src/commands/api/generated.ts:28 says FDW and dependent foreign tables, and line 716 says without contacting ETL or inspecting the FDW. The pinned word list calls for expanding unfamiliar abbreviations at first use. https://github.com/supabase/supabase/blob/9b1af5be91ccfac0e7d449eccc2532069f2d18b3/apps/docs/style-guide/WORD_LIST.md#abbreviations

Suggested fix: Write “foreign data wrapper and dependent foreign tables” in the disable description. In teardown help, use “without contacting the extract, transform, and load (ETL) service or inspecting the foreign data wrapper.”

definition: "v2RestartWarehouseReplication",
summary: "Start or restart Warehouse replication",
description:
"Starts a stopped managed pipeline or restarts a starting, started or failed pipeline, preserving the selected tables and saved layouts. Restart interrupts replication; in-progress initial copies may restart from scratch. If lost-slot recreation is configured, startup can rebuild destination tables. The response confirms acceptance only. Inspect warehouse status for runtime diagnostics and observed table progress; these observations do not identify completion of this request. Inspect state before retrying an uncertain response.",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚪ NIT · docs-style · source: codex

The restart and resync help omit serial commas in lists of states or effects.

Evidence: apps/cli/src/commands/api/generated.ts:458 says a starting, started or failed pipeline, and line 476 says Source rows, saved layouts and completed replication state. The pinned guide uses the Oxford comma. https://github.com/supabase/supabase/blob/9b1af5be91ccfac0e7d449eccc2532069f2d18b3/apps/docs/style-guide/01-voice-and-tone.md#use-the-oxford-comma

Suggested fix: Use “a starting, started, or failed pipeline” and “Source rows, saved layouts, and completed replication state” in the source descriptions.

repeatable: false,
required: false,
description:
"Defaults to 1m. The effective step increases to stay within 1441 points per series. Rate and latency windows are at least 5m.",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚪ NIT · docs-style · source: codex

The query-stats interval help omits the thousands separator from the point limit.

Evidence: apps/cli/src/commands/api/generated.ts:293 says The effective step increases to stay within 1441 points per series. The pinned word list groups digits in large numbers with commas. https://github.com/supabase/supabase/blob/9b1af5be91ccfac0e7d449eccc2532069f2d18b3/apps/docs/style-guide/WORD_LIST.md#numbers

Suggested fix: Use “The effective step increases to stay within 1,441 points per series” in the source description.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-preview-packages Publish pkg.pr.new preview CLI packages for this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants