@sequenceholdings/studio-cli 0.9.20 → 0.9.22

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.
Files changed (65) hide show
  1. package/README.md +159 -12
  2. package/dist/app/commands.js +37 -7
  3. package/dist/app/deploy.js +2 -0
  4. package/dist/app/lockfile-preflight.d.ts +31 -0
  5. package/dist/app/lockfile-preflight.js +47 -0
  6. package/dist/app/repository-index.d.ts +5 -1
  7. package/dist/app/repository-index.js +9 -3
  8. package/dist/app/scaffold.d.ts +3 -1
  9. package/dist/app/scaffold.js +5 -3
  10. package/dist/auth.d.ts +13 -9
  11. package/dist/auth.js +98 -20
  12. package/dist/cli-errors.js +6 -1
  13. package/dist/command-contract.d.ts +13 -1
  14. package/dist/command-contract.js +3 -1
  15. package/dist/command-help.d.ts +1 -1
  16. package/dist/command-help.js +8 -1
  17. package/dist/config.d.ts +14 -0
  18. package/dist/config.js +29 -3
  19. package/dist/docs/commands.d.ts +16 -0
  20. package/dist/docs/commands.js +168 -0
  21. package/dist/docs/help.d.ts +2 -0
  22. package/dist/docs/help.js +12 -0
  23. package/dist/envs/commands.js +10 -2
  24. package/dist/host-token.d.ts +19 -4
  25. package/dist/host-token.js +50 -10
  26. package/dist/main.d.ts +1 -0
  27. package/dist/main.js +20 -2
  28. package/dist/orm/discover-operations.d.ts +1 -1
  29. package/dist/orm/discover-operations.js +3 -3
  30. package/dist/orm/discover-schema.d.ts +0 -5
  31. package/dist/orm/discover-schema.js +0 -3
  32. package/dist/pipeline/commands.d.ts +0 -7
  33. package/dist/pipeline/commands.js +16 -67
  34. package/dist/pipeline/discovery.d.ts +1 -1
  35. package/dist/pipeline/discovery.js +6 -6
  36. package/dist/process/build.d.ts +2 -5
  37. package/dist/process/build.js +4 -49
  38. package/dist/repos/commands.d.ts +11 -1
  39. package/dist/repos/commands.js +78 -11
  40. package/dist/repos/git-credential.d.ts +12 -5
  41. package/dist/repos/git-credential.js +63 -36
  42. package/dist/repos/github-connect-command.d.ts +35 -0
  43. package/dist/repos/github-connect-command.js +250 -0
  44. package/dist/repos/github-init-command.d.ts +16 -0
  45. package/dist/repos/github-init-command.js +116 -0
  46. package/dist/repos/github-init.d.ts +146 -0
  47. package/dist/repos/github-init.js +355 -0
  48. package/dist/repos/init-github.d.ts +50 -0
  49. package/dist/repos/init-github.js +181 -0
  50. package/dist/repos/pulls.d.ts +5 -1
  51. package/dist/repos/pulls.js +31 -9
  52. package/dist/scaffold-guidance.d.ts +10 -2
  53. package/dist/scaffold-guidance.js +27 -2
  54. package/dist/templates/github/pr-type.mjs +285 -0
  55. package/dist/templates/github/pr-types.json +40 -0
  56. package/dist/templates/guidance/AGENTS.md +15 -8
  57. package/package.json +7 -7
  58. package/release-summary.json +3 -1
  59. package/templates/github/pr-type.mjs +285 -0
  60. package/templates/github/pr-types.json +40 -0
  61. package/templates/guidance/AGENTS.md +15 -8
  62. package/dist/pipeline/active-orm-contracts.d.ts +0 -16
  63. package/dist/pipeline/active-orm-contracts.js +0 -36
  64. package/dist/pipeline/repin-orm.d.ts +0 -2
  65. package/dist/pipeline/repin-orm.js +0 -207
package/README.md CHANGED
@@ -379,8 +379,13 @@ versioned packages and depend on registry versions.
379
379
 
380
380
  Scaffolds write no `.npmrc` (CLI **0.9.2**+ also drops the `functions init`
381
381
  one), so `pnpm install` resolves from the registry your user configuration
382
- selects, `@sequenceholdings` packages included. Commit `pnpm-lock.yaml`:
383
- repository CI installs from the registry the lockfile was resolved against.
382
+ selects, `@sequenceholdings` packages included. Commit `pnpm-lock.yaml`.
383
+ Hosted repository CI installs only from Chainguard Libraries
384
+ (`https://libraries.cgr.dev/javascript/`), so a lockfile resolved against
385
+ another registry fails its frozen install. `init` (after installing) and
386
+ `deploy` name any such lockfile and the command that regenerates it:
387
+ `pnpm install --registry=https://libraries.cgr.dev/javascript/` with Chainguard
388
+ credentials in `~/.npmrc`.
384
389
 
385
390
  Workspace deployments outside `local` require the root lockfile. Staging keeps
386
391
  its registry resolutions and overrides; the existing Managed Functions registry
@@ -926,7 +931,7 @@ compiled to canonical SQL before registration.
926
931
  | `seq-studio orm generate [dir]` | Generate `schema.graphql`, `operations.manifest.json`, `typePolicies.gen.ts`, `namespace.contract.json`, `sql-operations.gen.ts`, and consumer codegen when `codegen.ts` is present. |
927
932
  | `seq-studio orm generate [dir] --migration-export [--check]` | Export `orm.migration.json` after validating the committed ORM migration. Pipeline migration planning recompiles these declarative inputs. `--check` compares against the current source and operations without writing; use it in CI. |
928
933
  | `seq-studio orm validate [dir]` | Parse and compile the namespace, then verify its committed migration chain is current. |
929
- | `seq-studio orm plan [dir] -e <env>` | Compare the compiled namespace with registry state without applying database changes; when available, print the live activation's source and provenance. |
934
+ | `seq-studio orm plan [dir] -e <env>` | Print fresh-schema DDL using current names, including tables with retained rename hints, and compare registry versions without writes. This is not an incremental live migration diff; when available, print the live activation's source and provenance. |
930
935
  | `seq-studio orm diff [dir] [--check]` | Author the next committed migration, or verify the migration/snapshot chain offline for CI. |
931
936
  | `seq-studio orm apply [dir] -e <env> [--timeout <duration>] [--no-wait] [--unverified-source "<reason>"] [--source-env <env>]` | Author a migration if needed, register/apply the namespace, activate its operation set, publish its declared capabilities, and refresh generated outputs. Waits until the new version is live (prints `live:`; default up to 20m); `--no-wait` returns once queued. `--source-env` verifies a checkout of another registered environment's Git Service; sign in there first. |
932
937
  | `seq-studio orm history <namespace> -e <env> [--limit N] [--json]` | List every change to the namespace's live schema and operations, newest first, with the actor and the Git Service source. `apply` from a clone of the target environment's Git Service (or `--repo`) sends its commit and package path; Atlas checks it and records `verified`, `ci`, `break_glass` or `reported`. Environments with `ORM_REQUIRE_VERIFIED_SOURCE=1`, and namespaces pinned with `--mode source`, refuse unverified applies; a namespace admin can override with `orm apply --unverified-source "<reason>"`. |
@@ -1880,6 +1885,29 @@ server, `artifactWorkspaceId(name)` from `@sequenceholdings/artifact-studio/serv
1880
1885
  returns the environment's ID for a declared workspace, instead of a hardcoded
1881
1886
  per-environment map; `artifact dev` does not set it.
1882
1887
 
1888
+ Name another artifact by its project slug in a per-artifact API capability, so
1889
+ the same manifest targets each environment's copy of it:
1890
+
1891
+ ```yaml
1892
+ server:
1893
+ capabilities:
1894
+ api:
1895
+ read:
1896
+ - /api/custom-roles/artifact/relationships-migration/current-scope
1897
+ - /api/custom-roles/artifact/relationships-migration/reporting-scope
1898
+ ```
1899
+
1900
+ This applies to `/api/custom-roles/artifact/<target>/resolve`, `current-scope`
1901
+ and `reporting-scope` in `server.capabilities.api` and an ingress's
1902
+ `capabilities.api`. A UUID-shaped target is a project ID; any other is a
1903
+ project slug. Atlas resolves each slug when it admits the deployment and records
1904
+ the ID-keyed path, so the broker and rollbacks see IDs. The slug must belong to
1905
+ exactly one deployed project in that environment: none, or more than one (slugs
1906
+ are unique per owner), fails admission with a 409, because the target decides
1907
+ the caller's authority. On a deployed Next.js server,
1908
+ `artifactReferenceId(slug)` from `@sequenceholdings/artifact-studio/server`
1909
+ returns the ID to call; `artifact dev` does not set it.
1910
+
1883
1911
  `pull` writes the **active deployment's** source files (default out dir:
1884
1912
  `./<project-id>`) and errors when the project has no active deployment.
1885
1913
  `promote` and `rollback` resolve the target project from the current
@@ -2006,7 +2034,7 @@ Browser ORM admission controls are planned for Studio CLI 0.4.7 and Artifact
2006
2034
  Studio 0.6.7, together with matching platform support. Confirm package
2007
2035
  publication and environment rollout before using them; this remains part of
2008
2036
  the internal Next.js pilot. In a schema-v2 manifest, browser
2009
- `capabilities.data.operations` optionally lists up to 256 exact
2037
+ `capabilities.data.operations` optionally lists up to 512 exact
2010
2038
  `namespace/ops/Operation` references. Omission retains table-based admission;
2011
2039
  an explicit empty list denies all browser ORM operations. Browser `data.read`
2012
2040
  and `data.write` declarations still bound table and mutation reach.
@@ -2202,7 +2230,11 @@ git push
2202
2230
  No PAT is required. `repos clone` configures a repository-local credential helper
2203
2231
  that reads your current login token for that exact environment and repository.
2204
2232
  It never stores the token in the remote URL or Git config, and does not pass it
2205
- to inherited credential stores. Keep `seq-studio` installed on your `PATH`.
2233
+ to inherited credential stores. The helper runs the `seq-studio` that cloned
2234
+ (an installed launcher, `SEQ_STUDIO_LAUNCHER`, or `node <path>/bin.js`); if a
2235
+ clone fails, nothing is left behind. For a checkout made with plain `git clone`,
2236
+ or after an upgrade moved `seq-studio`, run
2237
+ `seq-studio repos attach-login [dir] -e <env>` to bind the helper to it.
2206
2238
  Once your session expires, run `seq-studio login --env <env>` and retry;
2207
2239
  Git itself does not open a browser or silently switch to a machine identity.
2208
2240
  Repository grants and protected-branch rules still apply.
@@ -2232,6 +2264,86 @@ a human identity or extend a human login's expiry.
2232
2264
  Add `--help` to a repo command to read its usage offline, without an
2233
2265
  environment or credentials.
2234
2266
 
2267
+ ### Start an app in a new GitHub repository (`init --github`)
2268
+
2269
+ `seq-studio init <dir> --github <owner>/<name> --org <org>` starts an app in its own new private GitHub repository, ready
2270
+ for seq-ci, in one step:
2271
+
2272
+ 1. checks that `gh` is installed and signed in, `<owner>/<name>` doesn't exist yet, and `<dir>` is new or empty and
2273
+ not inside another Git checkout;
2274
+ 2. `git init`s `<dir>` on the release branch and scaffolds the app into it (the same scaffold as `init`, including
2275
+ `--with` and the other scaffold options);
2276
+ 3. creates the repository with `gh repo create --private` (only after the scaffold succeeded) and sets it as `origin`;
2277
+ 4. writes the files of `repo init` below for `--org`, with `--dev`/`--release` branches if given.
2278
+
2279
+ ```bash
2280
+ seq-studio init loan-tools --github my-org/loan-tools --org <org> -e <env>
2281
+ ```
2282
+
2283
+ Nothing is committed or pushed: it prints the commands to commit, push both branches, apply the branch rulesets
2284
+ (`repo init --apply-github`, or pass `--apply-github` to `init` to do it in the same step) and `repo connect` each
2285
+ stage. `-e` only fills in those printed `repo connect` lines.
2286
+
2287
+ Creating a repository is opt-in. Without `--github` (or `--repo` for a platform git-service repository), `init`
2288
+ creates no repository, so an app that belongs in an existing repository is scaffolded into it with plain
2289
+ `seq-studio init <subdir>`. `--github` inside an existing checkout is refused for the same reason; use `repo init` to
2290
+ set up an existing GitHub checkout.
2291
+
2292
+ ### Set up a GitHub repository (`repo init`)
2293
+
2294
+ `seq-studio repo init --org <org>` makes a GitHub checkout a Sequence repository. It writes, and afterwards manages:
2295
+
2296
+ | File | Purpose |
2297
+ |---|---|
2298
+ | `.seq/github.yml` | The repository's org, dev and release branches (default `staging` and `main`) and the exact `seq-ci` release |
2299
+ | `.github/workflows/seq.yml` | Checks on pull requests and deploys from the dev and release branches, through `sequenceholdings/seq-ci` |
2300
+ | `.github/workflows/seq-promote.yml` | The Promote button that fast-forwards the release branch |
2301
+ | `renovate.json` | Keeps the `seq-ci` release and CLI pin current |
2302
+ | `.claude/skills/sequence-platform/SKILL.md` | Points agents at the platform docs; `AGENTS.md` gets a one-line pointer |
2303
+ | `.github/workflows/seq-pr-type.yml`, `.github/scripts/seq-pr-type.mjs`, `.github/pr-types.json` | The `pr-type` check: every pull request needs exactly one `type: bug`, `type: performance`, `type: enhancement`, `type: feature` or `type: chore` label. With no label it asks Claude to pick one when the repository can read an `ANTHROPIC_API_KEY` secret, and otherwise fails naming the labels to add. A push of `.github/pr-types.json` to the dev branch creates the labels |
2304
+
2305
+ It writes only what's missing or stale and never overwrites a file it doesn't manage. `--check` reports the same and writes nothing (exit 3 when anything is missing or stale). Rerunning keeps the existing org and branches. Branch rulesets (`seq / checks` and `pr-type` required on the dev branch; the release branch updatable only by the Sequence CI GitHub App, which Promote pushes as) and secret scanning need admin rights on the repository, which its creator has; no org owner is needed. `--apply-github` applies them with `gh` and confirms the repository can read seq-ci's `SEQ_CI_*` org secrets (`SEQ_CI_IMAGE_PULL_KEY`, the read-only key that pulls seq-ci's images, and `SEQ_CI_REGISTRY_AUTH`, a read-only dependency-registry pull token). Both are visible to every private repository in the org, as the Sequence CI App is installed on every repository. If an org owner has narrowed either to selected repositories, an owner's `--apply-github` (`gh auth refresh -s admin:org`) adds the repository. Anyone else gets an error naming the secret, and exit 1. Otherwise the ruleset commands are printed for an admin. Commit and push the files yourself.
2306
+
2307
+ ### Deploy a GitHub repository (`repo connect`, `repo status`)
2308
+
2309
+ `seq-studio repo connect -e <env> --stage staging|prod` lets the checkout's GitHub repository deploy to one stage of
2310
+ that Atlas: the dev branch to staging, the release branch to prod (from `.seq/github.yml`). Each plan uses the images
2311
+ pinned by the repository's `seq-ci` release, so a new release needs no reconnect. Connect each Atlas once, for example a BankSouth repository to `staging.banksouth` with `--stage
2312
+ staging` and to `banksouth` with `--stage prod`. release group (Sequence Staff) only.
2313
+
2314
+ Moving a repository from git-service: `--adopt <namespace>/<repo>:<branch>` hands that branch's deployments to the
2315
+ GitHub branch in the same step. Its bindings and every resource it controls move, and it drops to checks-only so it
2316
+ can't deploy them again. Needs merge rights on the git-service repository.
2317
+
2318
+ Resources deployed by hand before the repository deployed from CI: run `seq-studio repo bind -e <env> --stage
2319
+ staging|prod` after `connect` and before the first deploy. It binds each target to the one existing, ready resource of
2320
+ exactly its name that you may deploy (`--dry-run` previews); otherwise every existing resource plans as a new create.
2321
+ Only targets that stage's plan deploys are bound: a target scoped to other stages, by its own `stages` or its
2322
+ Application's in `.seq/repository.yml`, is skipped and reported (`Skipped <key> (stages: staging)`), so the branch
2323
+ never becomes the controller of a resource its CI does not deploy to that stage.
2324
+ A `kind: process` resource whose folder holds several processes (`<path>/<dir>/process.ts`), with no process of exactly
2325
+ its name, binds as a process group: each deploy registers its bundle once and promotes every process it defines,
2326
+ after checking editor on each existing one and Can create on Lattice for new ones; nothing is promoted if any is
2327
+ refused. A process belongs to one target: a group refuses one another target already deploys.
2328
+ Managed Pipelines are released under a name, set with `seq-studio repo init --release-repository <namespace>/<name>`
2329
+ before `connect`. A git-service repository of that name on the Atlas keeps releasing them (its identity receipt and
2330
+ merge rights are checked); with none, `connect` claims the name for this GitHub repository, so no git-service
2331
+ repository is needed.
2332
+
2333
+ `seq-studio repo status -e <env> [--stage staging|prod]` lists the repository's releases there, newest first, with each
2334
+ target's deployment state. `seq-studio repo disconnect -e <env>` stops every GitHub deploy of it to that Atlas,
2335
+ including queued and retried ones.
2336
+
2337
+ Deploys run in GitHub Actions: a push to the dev branch deploys staging; Promote moves the release branch and deploys
2338
+ prod. Prod deploys only through Promote.
2339
+
2340
+ Reusing pull-request builds: with `pull_request_builds: reuse` in `.seq/github.yml` (`repo init`'s default; `repo init
2341
+ --pull-request-builds rebuild` turns it off), `connect --stage staging` lets the dev branch's deploys reuse what a
2342
+ same-repository pull request's CI built and checked, instead of building and checking again, when the deployed tree
2343
+ carries every change that pull request's run tested (merges since then may change other files). The deploy log says per target whether it was built or reused
2344
+ from a pull request. Prod never reuses them. This is sound only while the dev branch requires no approvals, as `repo
2345
+ init`'s ruleset sets it: once it requires reviews, set `rebuild` and rerun `connect`.
2346
+
2235
2347
  ### Scaffold into a repository (`--repo`)
2236
2348
 
2237
2349
  Source you build belongs in a platform git-service repository, not only on one
@@ -2414,6 +2526,7 @@ JSON API — the same repos `--repo <ns>/<name>` sources build from.
2414
2526
  | `seq-studio repos identity <ns>/<name> -e <env> [--write --dir .]` | inspect the server-issued identity; `--write` restores its receipt at the matching clone's Git worktree root; admin-only `--adopt --write --yes` binds a legacy repository once |
2415
2527
  | `seq-studio repos create <ns>/<name> -e <env> [--default-branch <b>] [--git-backend walgit]` | create a repo, seeded with a README on `main`. The server picks the backend (walgit wherever it is configured). `--git-backend walgit` creates it empty, for pushing existing history. Needs namespace write. Returns once the repo resolves by name (the lookup `clone`, `show`, and `pull` use), so `repos clone` can follow at once. |
2416
2528
  | `seq-studio repos clone <ns>/<name> \| --url <clone-url> \| --id <uuid> -e <env> [--ref <r>] [--output <dir>] [--force] [--full] [--transport auto\|git\|json]` | smart-HTTP `git clone --depth 1` using login (`--full` fetches history; a commit SHA stays full). Configures login for subsequent Git commands. Use files-only `--transport json` for `<ns>/<name>`. `--out` remains an alias for `--output`. |
2529
+ | `seq-studio repos attach-login [<dir>] -e <env> [--remote origin]` | bind the login credential helper to an existing checkout whose remote is a git-service clone URL on `<env>` |
2417
2530
  | `seq-studio repos pull <ns>/<name> -e <env> [--ref <r>] [--out <dir>] [--force]` | always materialize via JSON API (no `.git` dir); refuses a non-empty destination unless `--force` |
2418
2531
  | `seq-studio repos delete <ns>/<name> -e <env> [--yes]` | delete a repo — interactive confirm unless `--yes` |
2419
2532
  | `seq-studio repos ci init [--dir <repository>]` | create `.seq/pipeline.yml` with native defaults; offline, preserves existing configuration |
@@ -2602,13 +2715,12 @@ root, stage identities, deployment admission or rollback provenance.
2602
2715
  | `seq-studio pipeline search <text> -e <env> [--target <id>] [--repo <namespace>/<slug>] [--limit <count>] [--offset <count>] [--json]` | Search deployed asset and column names/descriptions without contacting Databricks; default 20 assets, maximum 100 |
2603
2716
  | `seq-studio pipeline describe <assetId> -e <env> [--target <id>] [--repo <namespace>/<slug>] [--json]` | Read an active deployment's table description, documented/declared columns, and source provenance without contacting Databricks |
2604
2717
  | `seq-studio pipeline assets -e <env> [--repo <namespace>/<slug>] [--json]` | Export assets from the latest registered declarations for contract inspection; an asset need not be deployed |
2605
- | `seq-studio pipeline schema <assetId> -e <env> [--target <id>] [--json]` | Inspect the deployed asset's columns, types, nullability, and table/column descriptions when returned by the server |
2606
- | `seq-studio pipeline sample <assetId> -e <env> [--target <id>] [--limit <rows>] [--json]` | Preview rows from the deployed asset; default 25, capped at 100 by the server |
2607
- | `seq-studio pipeline query <assetId> --sql <sql> -e <env> [--target <id>] [--limit <rows>] [--json]` | Run a read-only query against the virtual relation `asset`; default and maximum 1,000 result rows |
2718
+ | `seq-studio pipeline schema <assetId> -e <env> [--target <id>] [--repo <namespace>/<name>] [--json]` | Inspect the deployed asset's columns, types, nullability, and table/column descriptions when returned by the server |
2719
+ | `seq-studio pipeline sample <assetId> -e <env> [--target <id>] [--repo <namespace>/<name>] [--limit <rows>] [--json]` | Preview rows from the deployed asset; default 25, capped at 100 by the server |
2720
+ | `seq-studio pipeline query <assetId> --sql <sql> -e <env> [--target <id>] [--repo <namespace>/<name>] [--limit <rows>] [--json]` | Run a read-only query against the virtual relation `asset`; default and maximum 1,000 result rows |
2608
2721
  | `seq-studio pipeline init --type ingestion\|transformation\|serving <name> [--dir <dir>]` | Scaffold `<name>.stage.yml` in the first configured stage directory (or package root without config), plus a package-root-relative `src/` Databricks-notebook entrypoint stub (begins with `# Databricks notebook source`; serving stages are declarative — no stub). Refuses to overwrite an existing spec |
2609
2722
  | `seq-studio pipeline codegen tables [--from <authoring.ts>] [--dir <dir>] [--dry-run] [--force]` | Generate one ingestion stage spec per table from a `PerTableIngestionAuthoring` TypeScript module. `--from` defaults to `authoring.tables.ts`; `--dir` defaults to the current package root and writes into its first configured stage directory (or the root without config). `--dry-run` lists output files without writing; existing files are preserved unless `--force` is supplied |
2610
- | `seq-studio pipeline validate [dir] [--assets <file\|url>] [--orm-contracts <file\|url>] [--json]` | Run the full offline spec gate: envelope + body validation, `schema_ref` resolution, repo-level graph validation, and optional `pipeline.yml` native workflow validation (DAG dependencies and manual stage membership). Auto-loads `orm-contracts.json` from the pipeline dir when present. Exit 0/1 |
2611
- | `seq-studio pipeline repin-orm [dir] -e <env> [--target <id>] [--dry-run]` | Resolve the environment's pipeline target (or use `--target` when ambiguous), fetch its active ORM v2 contracts, verify those serving projections remain compatible, then update `orm-contracts.json` and their `satisfies.content_hash` pins. Refuses to write when compatibility fails |
2723
+ | `seq-studio pipeline validate [dir] [--assets <file\|url>] [--json]` | Run the full offline spec gate: envelope + body validation, `schema_ref` resolution, repo-level graph validation, and optional `pipeline.yml` native workflow validation (DAG dependencies and manual stage membership). Ignores legacy `orm-contracts.json`; no ORM version or contract is required. Exit 0/1 |
2612
2724
  | `seq-studio pipeline plan --repo <namespace>/<slug> --ref <sha\|branch> [--source-env <env>] [--root <directory>] -e <env> [--target <id>] [--json]` | Enqueue and poll a durable Pipeline plan (materialize → SDK/`validateSpecGraph` → compile → live-diff → provision findings). `<namespace>` is `pipelines`, `apps`, or your own namespace. Fails closed listing **every** missing target binding (alert channels, workspace, Databricks `source.credential`) plus Data Sync edge-worker machine/operation/`credEnvFamilies` mismatches before registry writes. Does **not** run Databricks `bundle validate` (that is a Trigger deploy-path hard gate). Exit 1 on destructive findings (CI-safe). `--json` emits the completed stable plan envelope |
2613
2725
  | `seq-studio pipeline deploy --repo <namespace>/<slug> --ref <sha\|branch> [--source-env <env>] [--root <directory>] -e <env> [--target <id>] [--approved-by <sub>] [--allow-destructive <resource-key> ...] [--run-now] [--wait-timeout <duration>] [--no-wait] [--json]` | Plan then enqueue deploy; Trigger runs `bundle validate` then `bundle deploy` against reviewed bytes. `<namespace>` is `pipelines`, `apps`, or your own namespace. Default is plant-only (jobs are created, not run). `--run-now` runs in-unit producer roots after bundle deploy; serving refresh provisioning completes before producer trigger.after tasks can run. If a producer fails, the terminal status includes the remote Databricks task/event error when available. `--allow-destructive` is repeatable and must exactly name every deletion/recreation finding in the immutable plan; only authenticated `@seqholdings.com` users may authorize it; permission, ownership, schedule-drift, and provisioning blockers cannot be overridden. Polls to terminal unless `--no-wait`. Targets that require approval need `--approved-by` naming the authenticated caller. |
2614
2726
 
@@ -3431,7 +3543,8 @@ on deployment. These operations do not issue credentials.
3431
3543
  ### Repository Pulls
3432
3544
 
3433
3545
  ```bash
3434
- seq-studio repos pulls create <namespace/name> --head <branch> --base main --title "Build task app" --body-file review.md -e <env>
3546
+ seq-studio repos pulls create <namespace/name> --head <branch> --base main --title "Build task app" --body-file review.md --type feature -e <env>
3547
+ seq-studio repos pulls edit <namespace/name> <number> --type bug -e <env>
3435
3548
  seq-studio repos pulls list <namespace/name> --state open -e <env>
3436
3549
  seq-studio repos pulls show <namespace/name> <number> -e <env>
3437
3550
  seq-studio repos pulls diff <namespace/name> <number> -e <env>
@@ -3470,6 +3583,22 @@ merged and closed Pulls, and prints the updated Pull like `show` (with `url`).
3470
3583
  `close` needs authorship or repository write and is idempotent.
3471
3584
  `repos pull` remains the singular source-snapshot command.
3472
3585
 
3586
+ ## Developer docs
3587
+
3588
+ Read the developer docs published by an environment from the terminal. Each
3589
+ environment serves the docs for the platform version it runs:
3590
+
3591
+ ```bash
3592
+ seq-studio docs search "deploy a managed function" -e <env> [--limit N] [--json]
3593
+ seq-studio docs read <slug> -e <env> [--json] # full page as Markdown; `index` is the homepage
3594
+ seq-studio docs list -e <env> [--json]
3595
+ ```
3596
+
3597
+ A cached login is sent when present; the command never opens a browser.
3598
+ `init` commands and `repos clone` add an `AGENTS.md` (plus a `CLAUDE.md` that
3599
+ imports it) telling coding agents to use these commands. Neither overwrites an
3600
+ existing `AGENTS.md`.
3601
+
3473
3602
  ## Agent feedback
3474
3603
 
3475
3604
  Report errors, confusing behavior, missing docs or capabilities, repeated retries, and
@@ -3582,10 +3711,28 @@ and delegated agent sessions are separate from human users. These are API
3582
3711
  activity observations, **not command counts**.
3583
3712
 
3584
3713
  Coverage includes the native Atlas client, its operator SDK adapter, and
3585
- pipeline assets/contracts fetches to authenticated configured Atlas origins.
3714
+ pipeline assets fetches to authenticated configured Atlas origins.
3586
3715
  Delegated Artifact Studio and ORM CLI transports, Git subprocess traffic,
3587
3716
  third-party storage transfers, login/discovery, and offline commands are not
3588
3717
  instrumented by this change. The Artifact Studio deployment `cliVersion` field
3589
3718
  continues to identify that SDK, not seq-studio. Versions released before this
3590
3719
  instrumentation cannot be identified retroactively. A claimed client/version
3591
3720
  is descriptive telemetry, never proof of which software made a request.
3721
+
3722
+ ### Isolated pipeline release validation
3723
+
3724
+ `seq-studio pipeline validate <directory>` uses the SDK release-contract gate.
3725
+ It automatically reads `<directory>/external-assets.json`; an explicit `--assets`
3726
+ flag takes precedence. Parent-directory files are not a fallback. External
3727
+ serving sources and typed transformation inputs must include full producer
3728
+ columns, not an asset name reconstructed from the consumer projection.
3729
+
3730
+ Pipeline validation never reads ORM contracts. Legacy `orm-contracts.json` and
3731
+ `satisfies` metadata do not gate publication. The `--orm-contracts`,
3732
+ `--scoped-orm-contracts` and `pipeline repin-orm` interfaces have been removed.
3733
+ Publish the backing schema first; the ORM validates its consumer definition
3734
+ when it activates.
3735
+
3736
+ This offline check does not prove existing view shape, backing availability,
3737
+ runtime permissions, or a successful publication. Use hosted plans/rehearsals and
3738
+ actual caller reads to qualify those boundaries.
@@ -15,6 +15,7 @@ import { planRepositoryDeclaration, REPOSITORY_INDEX_PATH, writeRepositoryDeclar
15
15
  import { addSharedPackageToApp } from './workspace-scaffold.js';
16
16
  import { APP_MANIFEST_FILENAME, isPrimitiveKind, PRIMITIVE_KINDS, slugifyAppId, } from './manifest.js';
17
17
  import { addPrimitiveToApp, defaultScaffoldNames, initAppMonorepo, printInitNextSteps, printOrmPreparation, } from './scaffold.js';
18
+ import { warnOnLockfilesOffHostedRegistry } from './lockfile-preflight.js';
18
19
  const LOG = '[seq-studio]';
19
20
  export const APP_INIT_USAGE = `usage:
20
21
  seq-studio init <dir> [options]
@@ -50,10 +51,20 @@ export const APP_INIT_USAGE = `usage:
50
51
  missing: clone it into <dir>, or set it as origin when
51
52
  <dir> is inside a Git checkout. Needs -e (or an agent
52
53
  sandbox). Prints the commit and push commands.
54
+ --github <owner>/<name>
55
+ start the app in its own new private GitHub repository:
56
+ creates it with gh (signed in), git-inits <dir> (new or
57
+ empty, not inside a checkout), scaffolds, sets origin and
58
+ writes the seq-ci files of seq-studio repo init. Needs
59
+ --org <org> (the Sequence org it deploys for). Optional
60
+ --dev/--release branches and --apply-github (rulesets).
61
+ Without --github or --repo no repository is created, so
62
+ an app inside an existing repository stays in it.
53
63
 
54
64
  Examples:
55
65
  seq-studio init pokedex
56
66
  seq-studio init pokedex --repo apps/pokedex -e staging
67
+ seq-studio init pokedex --github my-org/pokedex --org acme
57
68
  seq-studio init . --template nextjs
58
69
  seq-studio init reports # a new app inside an existing repository
59
70
  seq-studio init pokedex --with orm,function,artifact
@@ -235,8 +246,27 @@ function publishedTemplateRequest({ flags, kinds }) {
235
246
  export async function runAppInitCommand(args) {
236
247
  return initApp({ args, intoCheckout: false });
237
248
  }
238
- /** `intoCheckout`: the target is the git-service checkout `--repo` just prepared. */
239
- async function initApp({ args, intoCheckout }) {
249
+ /**
250
+ * `--github` (a new GitHub repository) or `--repo` (a git-service repository): prepare the checkout, then scaffold
251
+ * into it. Undefined when neither flag is given, so the app is scaffolded where it is, inside any existing repository.
252
+ */
253
+ async function initIntoRepository({ args, target }) {
254
+ if (args.flags.github !== undefined) {
255
+ const { runInitWithGitHub, withoutGitHubFlags } = await import('../repos/init-github.js');
256
+ return runInitWithGitHub({
257
+ args,
258
+ target,
259
+ scaffold: (root) => initApp({ args: { ...withoutGitHubFlags(args), positional: [root] }, intoCheckout: true, githubSteps: true }),
260
+ });
261
+ }
262
+ if (args.flags.repo !== undefined) {
263
+ const { runInitWithRepo, withoutRepoFlag } = await import('../repos/init-repo.js');
264
+ return runInitWithRepo({ args, target, scaffold: () => initApp({ args: withoutRepoFlag(args), intoCheckout: true }) });
265
+ }
266
+ return undefined;
267
+ }
268
+ /** `intoCheckout`: the target is the checkout `--repo` or `--github` just prepared. */
269
+ async function initApp({ args, intoCheckout, githubSteps }) {
240
270
  if (args.flags.help === true || args.flags.h === true) {
241
271
  console.log(APP_INIT_USAGE);
242
272
  return 0;
@@ -257,10 +287,9 @@ async function initApp({ args, intoCheckout }) {
257
287
  console.error(APP_INIT_USAGE);
258
288
  return 1;
259
289
  }
260
- if (args.flags.repo !== undefined) {
261
- const { runInitWithRepo, withoutRepoFlag } = await import('../repos/init-repo.js');
262
- return runInitWithRepo({ args, target, scaffold: () => initApp({ args: withoutRepoFlag(args), intoCheckout: true }) });
263
- }
290
+ const intoRepository = await initIntoRepository({ args, target });
291
+ if (intoRepository !== undefined)
292
+ return intoRepository;
264
293
  if (published) {
265
294
  try {
266
295
  const { initFromTemplate } = await import('../templates/commands.js');
@@ -320,12 +349,13 @@ async function initApp({ args, intoCheckout }) {
320
349
  return 1;
321
350
  }
322
351
  const prepared = args.flags['skip-install'] === true ? false : await prepareApp({ appRoot, manifest });
323
- printInitNextSteps({ appRoot, manifest, prepared });
352
+ printInitNextSteps({ appRoot, manifest, prepared, githubSteps });
324
353
  return prepared === 'failed' ? 1 : 0;
325
354
  }
326
355
  async function prepareApp({ appRoot, manifest }) {
327
356
  try {
328
357
  await prepareScaffoldedApp({ appRoot, manifest });
358
+ await warnOnLockfilesOffHostedRegistry({ rootDir: appRoot, manifest });
329
359
  return true;
330
360
  }
331
361
  catch (error) {
@@ -25,6 +25,7 @@ import { defaultDeployOrder, loadAppManifest, usesAppGraph, } from './manifest.j
25
25
  import { warnOnManifestRoles } from '../manifest-roles-notice.js';
26
26
  import { assertAppEnvironmentBindings } from './env-bindings.js';
27
27
  import { assertAppRepositoryAdmission } from './repository-admission.js';
28
+ import { warnOnLockfilesOffHostedRegistry } from './lockfile-preflight.js';
28
29
  const LOG = '[seq-studio]';
29
30
  const APP_MANIFEST_HINT = 'sequence.app.yml';
30
31
  /**
@@ -124,6 +125,7 @@ async function runDeployApp(options) {
124
125
  console.log(`${LOG} - ${entry.kind.padEnd(9)} ${entry.id} (${entry.path})`);
125
126
  }
126
127
  assertAppDeploymentSource({ manifest, options, rootDir, entries });
128
+ await warnOnLockfilesOffHostedRegistry({ rootDir, manifest, env: options.env });
127
129
  try {
128
130
  await assertAppEnvironmentBindings({
129
131
  manifest,
@@ -0,0 +1,31 @@
1
+ import { type LockfileOrigin } from '../functions/lockfile-origin.js';
2
+ import type { AppManifest } from './manifest.js';
3
+ /**
4
+ * The registry hosted repository CI installs from. Its sandbox reaches only
5
+ * Chainguard Libraries, so a frozen install of a lockfile resolved elsewhere
6
+ * fails there (missing hosts, or integrity mismatches on rebuilt packages).
7
+ */
8
+ export declare const HOSTED_CI_NPM_REGISTRY = "https://libraries.cgr.dev/javascript/";
9
+ export interface LockfileRegistryFinding {
10
+ /** Lockfile path relative to the app root. */
11
+ path: string;
12
+ origin: Exclude<LockfileOrigin, 'chainguard'>;
13
+ }
14
+ /**
15
+ * Every committed-to-be lockfile in an app (the root one and each primitive's
16
+ * own, such as a standalone Next.js artifact) that was not resolved against
17
+ * Chainguard. Mirrors the hosted install gate: only a lockfile carrying a
18
+ * Chainguard tarball pin counts as resolved there.
19
+ */
20
+ export declare function findLockfilesOffHostedRegistry({ rootDir, manifest }: {
21
+ rootDir: string;
22
+ manifest: Pick<AppManifest, 'primitives'>;
23
+ }): Promise<LockfileRegistryFinding[]>;
24
+ /** Copy explaining which lockfiles hosted CI would reject and how to regenerate them. */
25
+ export declare function describeLockfileFindings(findings: readonly LockfileRegistryFinding[]): string[];
26
+ /** Print the findings for an app as warnings; a deployment to `local` never reaches hosted CI. */
27
+ export declare function warnOnLockfilesOffHostedRegistry({ rootDir, manifest, env }: {
28
+ rootDir: string;
29
+ manifest: Pick<AppManifest, 'primitives'>;
30
+ env?: string;
31
+ }): Promise<void>;
@@ -0,0 +1,47 @@
1
+ import { existsSync } from 'node:fs';
2
+ import { readFile } from 'node:fs/promises';
3
+ import { join, relative } from 'node:path';
4
+ import { classifyLockfileOrigin } from '../functions/lockfile-origin.js';
5
+ /**
6
+ * The registry hosted repository CI installs from. Its sandbox reaches only
7
+ * Chainguard Libraries, so a frozen install of a lockfile resolved elsewhere
8
+ * fails there (missing hosts, or integrity mismatches on rebuilt packages).
9
+ */
10
+ export const HOSTED_CI_NPM_REGISTRY = 'https://libraries.cgr.dev/javascript/';
11
+ /**
12
+ * Every committed-to-be lockfile in an app (the root one and each primitive's
13
+ * own, such as a standalone Next.js artifact) that was not resolved against
14
+ * Chainguard. Mirrors the hosted install gate: only a lockfile carrying a
15
+ * Chainguard tarball pin counts as resolved there.
16
+ */
17
+ export async function findLockfilesOffHostedRegistry({ rootDir, manifest }) {
18
+ const candidates = [join(rootDir, 'pnpm-lock.yaml'), ...manifest.primitives.map((entry) => join(rootDir, entry.path, 'pnpm-lock.yaml'))];
19
+ const findings = [];
20
+ for (const path of new Set(candidates)) {
21
+ if (!existsSync(path))
22
+ continue;
23
+ const origin = classifyLockfileOrigin(await readFile(path, 'utf8'));
24
+ if (origin !== 'chainguard')
25
+ findings.push({ path: relative(rootDir, path) || 'pnpm-lock.yaml', origin });
26
+ }
27
+ return findings;
28
+ }
29
+ /** Copy explaining which lockfiles hosted CI would reject and how to regenerate them. */
30
+ export function describeLockfileFindings(findings) {
31
+ if (findings.length === 0)
32
+ return [];
33
+ return [
34
+ `hosted repository CI installs only from Chainguard (${HOSTED_CI_NPM_REGISTRY}); these lockfiles were resolved elsewhere and its frozen install would fail:`,
35
+ ...findings.map(({ path, origin }) => ` ${path} (${origin === 'npm' ? 'pins registry.npmjs.org tarballs' : 'no Chainguard resolutions'})`),
36
+ 'Regenerate each in its directory with Chainguard credentials in ~/.npmrc, then commit it:',
37
+ ` rm pnpm-lock.yaml && pnpm install --registry=${HOSTED_CI_NPM_REGISTRY}`,
38
+ ];
39
+ }
40
+ /** Print the findings for an app as warnings; a deployment to `local` never reaches hosted CI. */
41
+ export async function warnOnLockfilesOffHostedRegistry({ rootDir, manifest, env }) {
42
+ if (env === 'local')
43
+ return;
44
+ for (const line of describeLockfileFindings(await findLockfilesOffHostedRegistry({ rootDir, manifest }))) {
45
+ console.warn(`[seq-studio] ${line}`);
46
+ }
47
+ }
@@ -6,7 +6,11 @@ export interface RepositoryDeclaration {
6
6
  content: string;
7
7
  created: boolean;
8
8
  }
9
- export declare function findGitRoot(start: string): string | null;
9
+ /**
10
+ * The nearest directory at or above `start` holding `.git`. Honors Git's
11
+ * `GIT_CEILING_DIRECTORIES`: the search never moves up into a listed directory.
12
+ */
13
+ export declare function findGitRoot(start: string, env?: NodeJS.ProcessEnv): string | null;
10
14
  /** Same containment rule as repository CI: equal, or a descendant of a non-root path. */
11
15
  export declare function under({ path, root }: {
12
16
  path: string;
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import { existsSync } from 'node:fs';
8
8
  import { mkdir, readFile, writeFile } from 'node:fs/promises';
9
- import { dirname, join, relative, resolve, sep } from 'node:path';
9
+ import { delimiter, dirname, isAbsolute, join, relative, resolve, sep } from 'node:path';
10
10
  import { isSeq, parseDocument } from 'yaml';
11
11
  import { z } from 'zod';
12
12
  import { APP_MANIFEST_FILENAME } from './manifest.js';
@@ -16,11 +16,17 @@ const indexSchema = z.looseObject({
16
16
  applications: z.array(z.looseObject({ path: z.string().min(1) })).nullish(),
17
17
  ignore: z.array(z.string().min(1)).nullish(),
18
18
  });
19
- export function findGitRoot(start) {
19
+ /**
20
+ * The nearest directory at or above `start` holding `.git`. Honors Git's
21
+ * `GIT_CEILING_DIRECTORIES`: the search never moves up into a listed directory.
22
+ */
23
+ export function findGitRoot(start, env = process.env) {
24
+ const ceilings = new Set((env.GIT_CEILING_DIRECTORIES ?? '').split(delimiter).filter(isAbsolute).map((path) => resolve(path)));
20
25
  for (let directory = resolve(start);; directory = dirname(directory)) {
21
26
  if (existsSync(join(directory, '.git')))
22
27
  return directory;
23
- if (dirname(directory) === directory)
28
+ const parent = dirname(directory);
29
+ if (parent === directory || ceilings.has(parent))
24
30
  return null;
25
31
  }
26
32
  }
@@ -41,9 +41,11 @@ export declare function firstMissingDirectory({ appRoot, absPath }: {
41
41
  export declare function printOrmPreparation({ primitives }: {
42
42
  primitives: readonly PrimitiveEntry[];
43
43
  }): void;
44
- export declare function printInitNextSteps({ appRoot, manifest, prepared, }: {
44
+ export declare function printInitNextSteps({ appRoot, manifest, prepared, githubSteps, }: {
45
45
  appRoot: string;
46
46
  manifest: AppManifest;
47
47
  /** true: dependencies installed and migrations authored; false: skipped; 'failed': partly done. */
48
48
  prepared: boolean | 'failed';
49
+ /** `init --github` prints its own repository steps after these. */
50
+ githubSteps?: boolean;
49
51
  }): void;
@@ -189,7 +189,7 @@ export function printOrmPreparation({ primitives }) {
189
189
  console.log(` # review and commit ${entry.path}/migrations/ before deploying`);
190
190
  }
191
191
  }
192
- export function printInitNextSteps({ appRoot, manifest, prepared, }) {
192
+ export function printInitNextSteps({ appRoot, manifest, prepared, githubSteps = false, }) {
193
193
  const rel = relative(process.cwd(), appRoot);
194
194
  const display = !rel || rel.startsWith('..') ? appRoot : rel;
195
195
  console.log(`${LOG} scaffolded app "${manifest.app.id}" in ${display}`);
@@ -208,8 +208,10 @@ export function printInitNextSteps({ appRoot, manifest, prepared, }) {
208
208
  console.log(' pnpm install');
209
209
  printOrmPreparation({ primitives: manifest.primitives });
210
210
  }
211
- console.log(' Push a branch and open a PR; checks run automatically, and merging to main publishes the app.');
212
- console.log(` No repository yet? seq-studio repos create <namespace>/${manifest.app.id} -e <env> (your team's namespace), then push this app to it.`);
211
+ if (!githubSteps) {
212
+ console.log(' Push a branch and open a PR; checks run automatically, and merging to main publishes the app.');
213
+ console.log(` No repository yet? seq-studio repos create <namespace>/${manifest.app.id} -e <env> (your team's namespace), or seq-studio init <dir> --github <owner>/<name> --org <org> for a new GitHub repository.`);
214
+ }
213
215
  console.log(' # add another primitive later:');
214
216
  console.log(' seq-studio add function list-types');
215
217
  console.log(' seq-studio add package contracts');
package/dist/auth.d.ts CHANGED
@@ -102,16 +102,20 @@ export declare class NotLoggedInError extends Error {
102
102
  constructor(realmName?: string, reason?: string);
103
103
  }
104
104
  /**
105
- * Return a valid access token for an environment's auth realm.
106
- *
107
- * Precedence (default `SEQAPI_AUTH_MODE=auto`), matching seqapi:
108
- * 1. Valid cached user access token
109
- * 2. M2M client-credentials when the realm's secret env var is set
110
- * 3. Bounded PKCE login when browser auto-login is enabled
111
- *
112
- * Set `SEQAPI_AUTH_MODE=m2m` to skip the user token. No `env` (or a built-in
113
- * Sequence env) means the shared Sequence realm.
105
+ * A devbox that receives owner tokens has no live one for this hosted
106
+ * deployment, and no live login of the user's own stood in for it (absent or
107
+ * expired alike). Raised instead of falling back to the shared M2M service
108
+ * account, which would silently act as an admin machine identity rather than
109
+ * the box owner.
114
110
  */
111
+ export declare class DevboxOwnerTokenMissingError extends NotLoggedInError {
112
+ constructor({ realmName, envName, host, tokenFile, }: {
113
+ realmName: string;
114
+ envName: string;
115
+ host: string | null;
116
+ tokenFile: string | null;
117
+ });
118
+ }
115
119
  export declare class UnsafeAuthTargetError extends Error {
116
120
  }
117
121
  /**