@sequenceholdings/studio-cli 0.3.0 → 0.4.2

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 (111) hide show
  1. package/README.md +506 -32
  2. package/dist/agents/commands.d.ts +1 -1
  3. package/dist/agents/commands.js +5 -0
  4. package/dist/agents/scaffold.js +5 -7
  5. package/dist/agents/voice-authoring.d.ts +5 -0
  6. package/dist/agents/voice-authoring.js +75 -0
  7. package/dist/agents/voice-publication.d.ts +5 -0
  8. package/dist/agents/voice-publication.js +63 -0
  9. package/dist/agents/voice-shared.d.ts +20 -0
  10. package/dist/agents/voice-shared.js +112 -0
  11. package/dist/agents/voice.d.ts +3 -0
  12. package/dist/agents/voice.js +57 -0
  13. package/dist/app/adapters.d.ts +6 -0
  14. package/dist/app/adapters.js +17 -2
  15. package/dist/app/agent-refs.d.ts +16 -0
  16. package/dist/app/agent-refs.js +36 -0
  17. package/dist/app/application-registration.d.ts +45 -8
  18. package/dist/app/application-registration.js +112 -22
  19. package/dist/app/commands.js +19 -2
  20. package/dist/app/deploy.d.ts +3 -0
  21. package/dist/app/deploy.js +18 -4
  22. package/dist/app/env-bindings.d.ts +21 -0
  23. package/dist/app/env-bindings.js +184 -0
  24. package/dist/app/manifest-validation.d.ts +8 -0
  25. package/dist/app/manifest-validation.js +97 -5
  26. package/dist/app/manifest.d.ts +45 -9
  27. package/dist/app/manifest.js +27 -1
  28. package/dist/app/primitive-scaffold.d.ts +4 -1
  29. package/dist/app/primitive-scaffold.js +4 -4
  30. package/dist/app/readme.js +11 -0
  31. package/dist/app/scaffold-files.js +1 -1
  32. package/dist/app/scaffold.d.ts +6 -4
  33. package/dist/app/scaffold.js +7 -4
  34. package/dist/app/workspace-scaffold.js +12 -7
  35. package/dist/argv.d.ts +7 -0
  36. package/dist/argv.js +56 -0
  37. package/dist/artifact/delegate.js +8 -4
  38. package/dist/atlas-client.d.ts +6 -0
  39. package/dist/atlas-client.js +39 -2
  40. package/dist/auth.d.ts +32 -0
  41. package/dist/auth.js +170 -33
  42. package/dist/bin.js +23 -4
  43. package/dist/command-contract.d.ts +137 -0
  44. package/dist/command-contract.js +43 -0
  45. package/dist/command-help.d.ts +8 -0
  46. package/dist/command-help.js +71 -0
  47. package/dist/functions/commands.d.ts +1 -1
  48. package/dist/functions/commands.js +19 -3
  49. package/dist/functions/deploy-preflight.d.ts +21 -0
  50. package/dist/functions/deploy-preflight.js +58 -0
  51. package/dist/functions/egress-postgres.d.ts +7 -0
  52. package/dist/functions/egress-postgres.js +36 -0
  53. package/dist/functions/manifest.d.ts +8 -0
  54. package/dist/functions/manifest.js +9 -0
  55. package/dist/functions/source-selection.js +4 -1
  56. package/dist/main.js +58 -20
  57. package/dist/orm/delegate.d.ts +16 -0
  58. package/dist/orm/delegate.js +140 -7
  59. package/dist/pipeline/clone-deploy.d.ts +37 -0
  60. package/dist/pipeline/clone-deploy.js +125 -0
  61. package/dist/pipeline/codegen.js +6 -2
  62. package/dist/pipeline/commands.js +21 -5
  63. package/dist/pipeline/lifecycle.d.ts +1 -0
  64. package/dist/pipeline/lifecycle.js +95 -44
  65. package/dist/pipeline/repin-orm.js +6 -2
  66. package/dist/pipeline/stage-secrets.js +1 -1
  67. package/dist/process/build.js +17 -0
  68. package/dist/process/codegen.js +16 -0
  69. package/dist/process/commands.d.ts +15 -7
  70. package/dist/process/commands.js +291 -99
  71. package/dist/process/lint.js +35 -0
  72. package/dist/process/plan-diff.js +9 -0
  73. package/dist/process/simulate.js +8 -0
  74. package/dist/release-age.d.ts +12 -0
  75. package/dist/release-age.js +24 -0
  76. package/dist/repos/commands.d.ts +1 -1
  77. package/dist/repos/commands.js +36 -7
  78. package/dist/scaffold-guidance.d.ts +4 -0
  79. package/dist/scaffold-guidance.js +15 -0
  80. package/dist/storage/commands.js +23 -1
  81. package/dist/storage/gcs-download.d.ts +13 -0
  82. package/dist/storage/gcs-download.js +41 -0
  83. package/dist/storage/import-cycle.d.ts +41 -0
  84. package/dist/storage/import-cycle.js +123 -0
  85. package/dist/storage/import-files.d.ts +30 -0
  86. package/dist/storage/import-files.js +133 -0
  87. package/dist/storage/import-gcloud.d.ts +12 -0
  88. package/dist/storage/import-gcloud.js +54 -0
  89. package/dist/storage/import-identity.d.ts +12 -0
  90. package/dist/storage/import-identity.js +15 -0
  91. package/dist/storage/import-plan.d.ts +120 -0
  92. package/dist/storage/import-plan.js +189 -0
  93. package/dist/storage/import-preflight.d.ts +36 -0
  94. package/dist/storage/import-preflight.js +62 -0
  95. package/dist/storage/import-progress-map.d.ts +5 -0
  96. package/dist/storage/import-progress-map.js +22 -0
  97. package/dist/storage/import-recover.d.ts +97 -0
  98. package/dist/storage/import-recover.js +186 -0
  99. package/dist/storage/import-run.d.ts +14 -0
  100. package/dist/storage/import-run.js +140 -0
  101. package/dist/templates/guidance/AGENTS.md +10 -0
  102. package/dist/templates/guidance/CLAUDE.md +1 -0
  103. package/dist/templates/process/package.json +2 -2
  104. package/dist/templates/process/pnpm-workspace.yaml +7 -4
  105. package/dist/validation-detail.d.ts +2 -0
  106. package/dist/validation-detail.js +20 -0
  107. package/package.json +10 -10
  108. package/templates/guidance/AGENTS.md +10 -0
  109. package/templates/guidance/CLAUDE.md +1 -0
  110. package/templates/process/package.json +2 -2
  111. package/templates/process/pnpm-workspace.yaml +7 -4
package/README.md CHANGED
@@ -27,6 +27,19 @@ seq-studio doctor
27
27
  > Sequence-internal contributors: see `INTERNAL.md` in the monorepo for
28
28
  > rollout SOPs, preview environments, and publishing docs.
29
29
 
30
+ `seq-studio capabilities` prints the versioned command/access summary; pass
31
+ `--json` for automation. It reports this CLI's command groups and does not imply
32
+ that the underlying platform HTTP routes are public contracts.
33
+
34
+ ### Piped output
35
+
36
+ Commands with `--json` write their structured result to stdout. The executable
37
+ allows stdout and stderr to drain before normal exit, including for large
38
+ responses and nonzero command statuses. Check the exit status before using a
39
+ result; an interrupted process or a closed downstream pipe can still leave
40
+ incomplete output. CLI output delivery does not remove a server's row/page cap:
41
+ inspect `truncated` and pagination metadata where present.
42
+
30
43
  ## Install
31
44
 
32
45
  ```bash
@@ -50,6 +63,12 @@ guard.** Stick with pnpm so the policy actually applies.
50
63
  those come from the Studio repo's own publish pipeline, so new `seq-studio`
51
64
  releases install immediately.)
52
65
 
66
+ All initializers include a short `AGENTS.md` pointing to the target environment's
67
+ live `/docs` and `/docs/llms.txt`, plus a `CLAUDE.md` importing it. Agents should
68
+ read those docs at the start of each task and consult them as needed; platform
69
+ instructions stay in the hosted docs rather than being copied into scaffolds.
70
+ Existing agent instruction files are preserved or initialization is refused.
71
+
53
72
  ## Authenticate
54
73
 
55
74
  Run the built-in browser login. `seq-studio` and `seqapi` share short-lived
@@ -67,6 +86,16 @@ seq-studio doctor # confirms config + auth + authori
67
86
  Use `seq-studio logout` to remove the shared Sequence session, or
68
87
  `seq-studio logout --env bsm-staging` to remove only that OpCo realm's session.
69
88
 
89
+ Pipeline plan, deploy and status use the realm and exact origin selected by
90
+ `-e`, just like discovery commands. A login for a different environment is not
91
+ a substitute for that environment's session.
92
+
93
+ `seq-studio doctor` reports the selected environment, auth-cache state, resolved
94
+ CLI/SDK versions and paths, and deployment-access checks without printing
95
+ tokens. Use `--json` for structured output. `--offline` reads local config and
96
+ credential metadata only; it makes no discovery or HTTP requests and does not
97
+ validate whether a credential is currently accepted by Atlas.
98
+
70
99
  ### Headless auth (CI) — M2M
71
100
 
72
101
  When there's no interactive login (CI, automation), set the service-account
@@ -146,12 +175,12 @@ locations, dependencies, and deployment selection.
146
175
 
147
176
  > **Availability:** App orchestration remains an internal workflow. Standalone
148
177
  > primitives retain their documented public/Preview availability. This change
149
- > does not publish app orchestration. Standalone caller-mode Function-to-ORM execution is supported by the SDK helper described below; service-identity execution remains outside that helper.
178
+ > does not publish app orchestration. Function-to-ORM execution is supported by two SDK helpers: `createFunctionOrmExecutor` acts as the invoking user, and `createFunctionServiceOrmExecutor` acts as the function's attached service account (for Lattice steps and other invocations with no human caller).
150
179
 
151
180
  | Command | What it does |
152
181
  |---------|--------------|
153
182
  | `seq-studio init <dir> --with <kinds>` | Scaffold a version 2 app, root pnpm workspace, shared package, README, and selected primitives |
154
- | `seq-studio add <kind> <name> [--depends-on <ids>]` | Add any primitive, including additional ORM namespaces and UIs |
183
+ | `seq-studio add <kind> <name> [--depends-on <ids>] [--template <t>]` | Add any primitive, including additional ORM namespaces and UIs |
155
184
  | `seq-studio add package <name>` | Add a shared TypeScript package to the manifest and pnpm workspace |
156
185
  | `seq-studio deploy -e <env> [--yes] [--only id1,id2] [--dry-run]` | Validate and deploy the selected app graph, including prerequisites |
157
186
 
@@ -160,6 +189,12 @@ a comma-separated `--with` list or boolean flags (`--agent --process`). The firs
160
189
  function defaults to `hello` (`--function-name` changes it). Agent, process, and
161
190
  pipeline folders use the app name. Pipelines default to transformation stages;
162
191
  `--pipeline-type ingestion|transformation|serving` selects another template.
192
+ Artifacts default to the React/Vite template; `--template nextjs` (on `init` or
193
+ `add artifact`) scaffolds a Next.js application instead. A Next.js artifact keeps
194
+ its own `pnpm-workspace.yaml` and `pnpm-lock.yaml` and stays out of the app's root
195
+ workspace, because hosted builds require a standalone lockfile without `workspace:`
196
+ dependencies; run `pnpm install` inside its directory. App deploys send its
197
+ directory (for example `artifacts/admin`) so Atlas builds it from the app repository.
163
198
 
164
199
  ```bash
165
200
  seq-studio init loan-tools --with orm,function,agent,process,artifact
@@ -273,6 +308,11 @@ idempotent upsert by name, so it needs the same authority as applying the file
273
308
  yourself. Workspaces are never part of Application roles: their access depends
274
309
  on the folders and files in them and is managed in Workspaces V2.
275
310
 
311
+ Workspaces V2 stores files; it does not index them yet. Agent `file_search`
312
+ searches Chat Workspaces only, so declaring a workspace primitive does not give
313
+ an app's agents retrieval over its files. Read the files you need from a managed
314
+ function and pass them to the agent explicitly.
315
+
276
316
  ### Runtime dependencies (`uses`)
277
317
 
278
318
  `depends_on` orders deploys. `uses` says what a primitive uses while it runs,
@@ -292,8 +332,14 @@ primitives:
292
332
  ```
293
333
 
294
334
  Every primitive appears in the graph, including agents, pipelines and
295
- workspaces. A workspace that doesn't exist in the target environment is flagged
296
- there. `uses` needs schema version 2 or later.
335
+ workspaces. `seq-studio deploy` and `seq-studio artifact deploy` resolve these
336
+ names in the selected environment and refuse the deployment when source still
337
+ points at another environment. An artifact's `targets.<environment>.url` is
338
+ that environment's API origin. The `targets` map may list every environment.
339
+ Application source may contain only the origin selected by `-e`. A `uses` edge
340
+ to a workspace resolves that workspace by name in the selected environment. A
341
+ workspace UUID in source must be one that exists there; an ID from another
342
+ environment fails the deployment. `uses` needs schema version 2 or later.
297
343
 
298
344
  Before the first ORM deployment, and after changing its schema, run
299
345
  `seq-studio orm generate <namespace-path>` followed by
@@ -340,9 +386,9 @@ Application role gives them everything the app needs: each member's end-user
340
386
  access plus the member roles and capabilities the role bundles. Grants are made
341
387
  in Atlas too, never in the manifest.
342
388
 
343
- - A role's includes can reach `artifact`, `function`, `orm`, and `process`
344
- primitives: a member's end-user access (`invoker` on functions and
345
- processes), one of its registered roles, or one of its capabilities.
389
+ - A role's includes can reach `artifact`, `function`, `orm`, `process`, and
390
+ `agent` primitives: a member's end-user access (`invoker` on functions,
391
+ processes and agents), one of its registered roles, or one of its capabilities.
346
392
  A member role or capability doesn't grant end-user access by itself — as on
347
393
  the primitive, a role needs an explicit end-user include on each member its
348
394
  holders should be able to open.
@@ -352,17 +398,29 @@ in Atlas too, never in the manifest.
352
398
  ```yaml
353
399
  - { id: approval-flow, kind: process, path: processes/approval, only: [loan-approval] }
354
400
  ```
401
+ - An `agent` primitive likewise offers only end-user access (chatting with it
402
+ and starting jobs), and a role can include it only when the entry deploys
403
+ exactly one agent — a directory with one agent, or `only: [<agent-id>]`. Its
404
+ member ref is the agent id that entry deploys to the target environment, so
405
+ the deploy refuses a role that reaches an entry deploying several agents.
406
+ Seeing other people's conversations with the agent is never bundled.
355
407
  - The Application registers after every primitive deploys; if one fails, it
356
408
  is skipped. Registering requires capability admin on every member (owner,
357
- for a process), checked on every deploy.
409
+ for a process or an agent), checked on every deploy.
358
410
  - Members are synced every deploy. Removing one removes every role's access
359
411
  into it.
360
412
  - A Next.js artifact is an ordinary `artifact` member. Its server calls ORM and
361
- functions as the signed-in user unless it declares `service_account`, so a
362
- role that includes it should also include `end_user` on every namespace and
363
- `invoker` on every function its `server.capabilities` reach (the same holds
364
- for any artifact's browser `capabilities`). The deploy prints an
365
- `access_gap` warning for each one a role misses; it never adds them for you.
413
+ functions, and starts processes, as the signed-in user unless it declares
414
+ `service_account`, so a role that includes it should also include `end_user`
415
+ on every namespace and `invoker` on every function and process its
416
+ `server.capabilities` reach (the same holds for any artifact's browser
417
+ `capabilities`). The deploy prints an `access_gap` warning for each missing
418
+ namespace, function or process grant. It never adds grants for you.
419
+ - An agent runs as whoever uses it, so a role giving "Can use" on an agent
420
+ should also include its subagents and managed functions. The deploy prints
421
+ an `access_gap` warning for each one missing, saying whether the agent
422
+ requires it (runs are refused) or not (runs go ahead without it), then a
423
+ link to the Application's Runtime access, where each gap is one click to fix.
366
424
 
367
425
  #### Deprecated: role definitions in YAML
368
426
 
@@ -410,10 +468,43 @@ and inherits only other collaborator roles.
410
468
  | `function` | `reader`, `editor` |
411
469
  | `orm` | `reader`, `writer` |
412
470
  | `process` (exactly one, `only: [<process-id>]`) | `editor` |
471
+ | `pipeline` (needs `repo`) | `viewer`, `operator`, `editor` |
472
+ | `agent` (exactly one agent) | `editor` |
473
+ | secret (listed under `secrets:`) | `editor` |
474
+ | service account (listed under `service_accounts:`) | `actor` |
413
475
 
414
476
  - Never `admin` or `owner`: admin can share a member and bundle it into other
415
477
  Applications, so it stays a direct grant. Workspaces are never bundled.
416
- - Every tier includes use, so a maintainer can always use what they maintain.
478
+ - Every tier includes the ones below it, and use where the member has any, so a
479
+ maintainer can always use what they maintain. A pipeline runs as a service
480
+ principal, so it has nothing to use and appears only in collaborator roles:
481
+ `viewer` sees its runs, `operator` runs its stages, `editor` deploys it.
482
+ - A pipeline member is its release unit, the same id deploy registers:
483
+ `pipelines/<name>`, or `apps/<name>@<path>` for one of an app's pipelines.
484
+ - Secrets the app's functions and pipelines read are listed under a top-level
485
+ `secrets:` block by their name in each environment. Deploy doesn't create or
486
+ set them — use `seq-studio secrets` — it bundles them so a collaborator role
487
+ can give `editor` (set the value, roll back, attach and pin it; values stay
488
+ write-only). Like a pipeline, a secret has nothing to use: functions and
489
+ stages read it through their own attachments whether or not it's listed,
490
+ so it appears only in collaborator roles. A `uses` edge may point at one.
491
+ - Service accounts the app's members run as are listed under a top-level
492
+ `service_accounts:` block by slug (`- { id: runtime, slug: loan-desk-runtime }`).
493
+ A collaborator role may give `actor`, which every deploy that runs code as
494
+ the account requires. Actor is close to the account's own access, so its
495
+ admins see what the account holds before they allow it. Members run as the
496
+ account whether or not it's listed.
497
+
498
+ ```yaml
499
+ secrets:
500
+ - { id: candescent-oauth, name: CANDESCENT_OAUTH }
501
+ collaborators:
502
+ definitions:
503
+ maintainer:
504
+ includes:
505
+ - { primitive: desk-api, tier: editor }
506
+ - { primitive: candescent-oauth, tier: editor }
507
+ ```
417
508
  - Consent is stricter than for runtime roles: bundling a member's tiers needs
418
509
  **admin** on it (owner, for a process), checked on every deploy.
419
510
  - Only the Application's admins create, edit and grant collaborator roles in
@@ -473,6 +564,122 @@ pnpm exec seq-studio agents apply -e <env>
473
564
  Use `--repo agents/<name> [--ref <ref>]` or `--git-url <url>` instead of
474
565
  `--dir` to materialize reviewed source from the platform git service.
475
566
 
567
+ ### Voice authoring (internal staging demo)
568
+
569
+ `agents voice` is restricted to the internal synthetic demo in the configured
570
+ Sequence staging environment. It is not a customer-facing Voice release. Use a
571
+ human `seq-studio login` session with current demo participant and Agent editor
572
+ access; publication additionally requires a demo operator. Machine/M2M credentials
573
+ are rejected. All network commands require an explicit environment. The server
574
+ uses the same authorization, supported catalogs, source resolution, dependency
575
+ reviews and publication service as the Atlas Voice builder.
576
+
577
+ Voice uses the same `defineAgent(...)`/`agent.ts` format and offline compiler as
578
+ text Agents. An Agent ID has one immutable mode. Generic `agents apply` does not
579
+ activate Voice; use `agents voice save` for revision-checked draft authoring and
580
+ the separate publication command when ready. No command creates a Skill or a
581
+ Managed Function. Create those with their existing authoring tools, then attach
582
+ their references. The built-in banking examples are documented in the contributor
583
+ guide; they contain fictional data and unresolved catalog/Skill placeholders.
584
+
585
+ | Command (append `-e <env>`) | Result |
586
+ |---|---|
587
+ | `agents voice inspect <id> [--out inspection.json]` | Captured draft, current source drift/access, supported catalogs and publication permission |
588
+ | `agents voice export <id> [--out agent.ts]` | Exact captured authored definition using the builder's source serializer |
589
+ | `agents voice save <id> --expected-revision <N\|new> [--dir .] [--yes]` | Compile that ID and save only its draft; `new` means create-only, `0` is a real revision |
590
+ | `agents voice capture <id> --request-file capture.json [--yes]` | Explicitly attach or refresh the current native Skill text |
591
+ | `agents voice validate <id> --expected-revision N [--out review.json]` | Current authored/projection hashes, source status and concrete tool bindings requiring review |
592
+ | `agents voice publish <id> --request-file publication.json [--yes]` | One explicit, revision-checked publication attempt |
593
+ | `agents voice status <id> --key <uuid>` or `--operation <uuid>` | Read-only recovery; never dispatches publication |
594
+ | `agents voice retry <id> --operation <uuid> [--yes]` | Resume the recorded publication under current operator/dependency checks |
595
+
596
+ `save` also accepts the usual `--repo agents/<name>` or `--git-url <url>` source,
597
+ `--ref`, and `--target <APP_ENV>`. It selects exactly the positional Agent ID after
598
+ environment selection. Output files are created with restricted permissions and
599
+ never overwrite an existing file. Export includes only the strict authored
600
+ definition, including captured SOP text, native source references and declared
601
+ Agent permissions. It excludes provider resource IDs, runtime grants, credentials,
602
+ call state and draft audit metadata. Treat source text as untrusted and review it
603
+ before executing anything from a repository.
604
+
605
+ Start in your existing standalone typed-Agent repository:
606
+
607
+ ```sh
608
+ seq-studio agents voice help
609
+ seq-studio login
610
+ seq-studio agents voice inspect <id> -e staging --out inspection.json
611
+ seq-studio agents voice export <id> -e staging --out agent.ts
612
+ # Edit agent.ts, retaining its Voice mode and the same ID.
613
+ seq-studio agents validate --dir .
614
+ seq-studio agents voice save <id> -e staging --dir . --expected-revision 3
615
+ seq-studio agents voice inspect <id> -e staging
616
+ # Use the actual returned draft revision, not the illustrative number here.
617
+ seq-studio agents voice validate <id> -e staging --expected-revision 4 --out review.json
618
+ ```
619
+
620
+ `inspect` never replaces captured text when a source Skill changes. `save` checks
621
+ current Skill access but also preserves that text. For an explicit refresh, write
622
+ `capture.json` using the actual ID/revision and the procedure's declared references:
623
+
624
+ ```json
625
+ {
626
+ "agentId": "680000000000000000000001",
627
+ "expectedDraftRevision": 4,
628
+ "action": "REFRESH",
629
+ "skillId": "native-skill-id",
630
+ "procedureKey": "replacement_card",
631
+ "activationDescription": "When asked to request a replacement for an eligible fictional card.",
632
+ "toolAliases": ["prepare_demo_service_request", "confirm_demo_service_request"],
633
+ "subprocedures": []
634
+ }
635
+ ```
636
+
637
+ Run `agents voice capture <id> -e staging --request-file capture.json`, inspect the
638
+ new draft and validate its returned revision. Use `ATTACH` for a new local key;
639
+ `REFRESH` must identify the Skill already attached to that key. Cross-environment
640
+ Skill or function references are not silently mapped. Resolve `SOURCE_MISSING`,
641
+ `SOURCE_FORBIDDEN` or `INVALID_BINDING` in the target environment before publication.
642
+ Editing captured text recalculates its content hash; restoring older source from
643
+ Git retains its text but still requires current access and dependency review.
644
+
645
+ Read `review.json`, including each binding's function version and authority policy.
646
+ Create `publication.json` with its actual draft/deployment revisions, a fresh UUID
647
+ for this intentional publication, and only the exact tool aliases/binding hashes
648
+ you reviewed. `toolReviewConfirmations` may be empty only when no confirmation is
649
+ required. `--yes` confirms the displayed action; it never manufactures reviews.
650
+
651
+ ```json
652
+ {
653
+ "agentId": "680000000000000000000001",
654
+ "expectedDraftRevision": 5,
655
+ "expectedDeploymentRevision": 2,
656
+ "idempotencyKey": "ea9d0f81-75c3-4a15-bbef-dbac20c4353c",
657
+ "toolReviewConfirmations": []
658
+ }
659
+ ```
660
+
661
+ Each confirmation has shape `{"toolAlias":"alias","bindingHash":"<64-hex hash from review>"}`.
662
+ Generate your own UUID (for example `node -e 'console.log(crypto.randomUUID())'`);
663
+ the example key is illustrative. Keep the exact request file before dispatch:
664
+
665
+ ```sh
666
+ seq-studio agents voice publish <id> -e staging --request-file publication.json
667
+ seq-studio agents voice status <id> -e staging --key <uuid-from-file>
668
+ # Only when the recorded operation requires an explicit retry:
669
+ seq-studio agents voice retry <id> -e staging --operation <returned-operation-uuid>
670
+ ```
671
+
672
+ Calls time out after 30 seconds and responses are bounded to 8 MiB. Voice requests
673
+ never automatically retry a 503, timeout or lost response. A status response may
674
+ be preparing/waiting; a successful CLI exit means the request/status was read,
675
+ not that publication is active. Status exits `2` when no operation is recorded;
676
+ an in-flight request may still arrive. Keep checking the same key. If retrying the
677
+ initial dispatch is necessary, explicitly resend the **unchanged** publication
678
+ file; do not allocate a new key to escape uncertainty. After a stale-revision
679
+ rejection, inspect and validate current state before preparing a different request.
680
+ Saving, capturing or publishing never enrolls callers, provisions phone numbers,
681
+ opens call admission, places calls, or changes the demo limits.
682
+
476
683
  ## ORM commands
477
684
 
478
685
  `seq-studio orm` authors and deploys governed ORM v2 namespaces: TypeScript
@@ -484,7 +691,7 @@ compiled to canonical SQL before registration.
484
691
  | Command | What it does |
485
692
  |---------|--------------|
486
693
  | `seq-studio orm init <dir>` | Scaffold one v2 namespace package (`sequence.config.ts`, `schema/*.ts`, `graphql/**`, and codegen config). |
487
- | `seq-studio orm generate [dir]` | Generate `schema.graphql`, `operations.manifest.json`, `typePolicies.gen.ts`, and consumer codegen when `codegen.ts` is present. |
694
+ | `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. |
488
695
  | `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. |
489
696
  | `seq-studio orm validate [dir]` | Parse and compile the namespace, then verify its committed migration chain is current. |
490
697
  | `seq-studio orm plan [dir] -e <env>` | Compare the compiled namespace with registry state without applying database changes. |
@@ -492,6 +699,7 @@ compiled to canonical SQL before registration.
492
699
  | `seq-studio orm apply [dir] -e <env>` | Author a migration if needed, register/apply the namespace, activate its operation set, publish roles/capabilities, and refresh generated outputs. |
493
700
  | `seq-studio orm execute <operation> [dir] --variables-file <file> -e <env>` | Execute one named persisted operation from `operations.manifest.json` with variables from a JSON object file, as the signed-in caller. |
494
701
  | `seq-studio orm migrate-from-yaml <dir>` | Convert a legacy YAML namespace to TypeScript authoring while preserving its committed migrations. |
702
+ | `seq-studio orm import [dir] --spec <file>` | Plan a batched copy from an existing Postgres relation (a synced warehouse table) into an owned ORM table. Writes a SQL script; it does not connect or apply row policies. |
495
703
 
496
704
  Install the CLI and ORM package together:
497
705
 
@@ -518,10 +726,48 @@ the target environment's data. `apply --no-create` is the CI guard that refuses
518
726
  to provision a missing namespace. Destructive DDL requires explicit
519
727
  `--allow-destructive` consent.
520
728
 
729
+ Queued rehearsals wait at most 35 minutes for a recorded verdict. If that wait
730
+ expires, the CLI reports an unknown status; it does not apply the schema or
731
+ retry the job. Inspect the printed run ID and disposable-branch cleanup before
732
+ starting another rehearsal.
733
+
521
734
  > **Preview:** ORM v2 is a Preview workflow. The generated namespace package
522
735
  > depends on `@sequenceholdings/orm@^2.0.0`; use the matching published major
523
736
  > version and keep generated manifests and migrations committed with source.
524
737
 
738
+ ### Registered SQL operations in development builds
739
+
740
+ Development builds containing SQL operation support also discover exported
741
+ `defineOperation({ language: 'sql', kind: 'query', ... })` definitions under
742
+ `operations/**/*.ts`, or equivalent `*.operation.json` files. Import the
743
+ authoring helper from `@sequenceholdings/orm/authoring`. This addition is not yet
744
+ available in the published package versions listed above.
745
+
746
+ For runtime SQL, declare `mode: 'runtime'`, namespace, operation capability,
747
+ `ontology.read` object references, and `maxRows`. Register this contract once;
748
+ execute it with `{ sql, parameters: { name: { type: 'text', value: '...' } } }`
749
+ as the operation variables. Different projections, joins, and unions use the same
750
+ operation hash. Each query is compiled against the declared objects and checked
751
+ against current caller permissions. A cached plan never caches authorization or
752
+ parameter values. Runtime contracts require matching IR v5 compiler/runtime builds.
753
+
754
+ Fixed SQL remains supported: omit `mode`, declare `parameters` and `sql` in the
755
+ definition, and supply only parameter values at runtime. Bind values with
756
+ `:parameterName`; quote camelCase properties. `orm generate` emits
757
+ `sql-operations.gen.ts` with typed operation handles and
758
+ `namespace.contract.json` for cross-namespace composition, in addition to the
759
+ shared manifest. `orm apply` and `orm execute` use the same lifecycle as GraphQL.
760
+
761
+ SQL reads currently support inner/left/right/full joins with `ON`, cross joins,
762
+ `UNION`/`UNION ALL`, correlated EXISTS, non-recursive CTEs,
763
+ grouping, supported aggregates, ordering, and limits. Unsupported SQL and
764
+ unsupported policies fail compilation. Results use column metadata plus row
765
+ arrays, with bigint and numeric values represented as strings. SQL writes,
766
+ DDL, `INTERSECT`/`EXCEPT`, window functions, `NATURAL`/`USING`/lateral joins,
767
+ implicit source refresh, and cross-database joins are not
768
+ supported. Materialized policy scans prioritize isolation; benchmark large
769
+ datasets before adopting this path for latency-sensitive reads.
770
+
525
771
  ## Process commands
526
772
 
527
773
  | Command | What it does |
@@ -957,25 +1203,33 @@ successfully. Help does not initialize files, authenticate, or deploy.
957
1203
  | `seq-studio artifact deploy [dir] -e <env> [--skip-unchanged] [--no-create] [--project <id>]` | `deploy [dir] --env <env>` — `--skip-unchanged` no-ops (before building) when the remote active deployment's `sourceHash` **and** CLI/atlas-ui peer versions already match; `--no-create` errors instead of creating a missing project; `--project <id>` targets a project directly when duplicate slugs make the lookup ambiguous (slug must still match the manifest) |
958
1204
  | `seq-studio artifact dev [dir] -e <env> [--link <pkgDir>[,<pkgDir>]] [--port <port>]` | React/HTML: rebuild preview on changes. Next.js: local development server and owner-only Atlas tunnel; `--port` selects its loopback port. |
959
1205
  | `seq-studio artifact pull <project-id> -e <env> [--out <dir>]` | `pull <project-id> --env <env> [--out <dir>]` |
960
- | `seq-studio artifact list -e <env>` | `list --env <env>` — projects visible on the environment (slug, id, active version, visibility) |
961
- | `seq-studio artifact show <slug-or-id> -e <env>` | `show <slug-or-id> --env <env>` — one project's detail incl. active deployment, git provenance, and (for newer deployments) the building `artifact-studio` / force-aliased `atlas-ui` versions |
1206
+ | `seq-studio artifact list -e <env> [--json]` | `list --env <env>` — projects visible on the environment (slug, id, active version, visibility); `--json` emits the response object |
1207
+ | `seq-studio artifact show <slug-or-id> -e <env> [--json]` | `show <slug-or-id> --env <env>` — one project's detail incl. active deployment, git provenance, and (for newer deployments) the building `artifact-studio` / force-aliased `atlas-ui` versions; `--json` emits the response object |
1208
+
962
1209
  | `seq-studio artifact promote <deployment-id> -e <env>` | `promote <deployment-id> --env <env>` |
963
1210
  | `seq-studio artifact rollback <deployment-id> -e <env>` | `rollback <deployment-id> --env <env>` |
964
1211
 
1212
+ Artifact commands reject unknown options before authentication or network
1213
+ access, so a misspelled flag cannot be silently ignored. `seq-studio artifact
1214
+ deploy` also refuses source that still points at another environment's API
1215
+ origin or workspace UUID. Declare each environment's API origin under
1216
+ `targets.<environment>.url`. A workspace UUID in source must exist in the
1217
+ environment selected by `-e`.
1218
+
965
1219
  `pull` writes the **active deployment's** source files (default out dir:
966
1220
  `./<project-id>`) and errors when the project has no active deployment.
967
1221
  `promote` and `rollback` resolve the target project from the current
968
1222
  directory's `.artifact-studio/config.json` — run them from the linked artifact
969
1223
  folder (or run `seq-studio artifact link` first).
970
1224
 
971
- **React/HTML active (official) deploys to deployed environments require `main` with a
972
- resolved git commit and a clean artifact source directory** for both Git
973
- Service (`--repo`) and local sources. When a local source is nested in a larger
974
- checkout, dirty files outside that source directory are ignored with a warning.
975
- Deployments targeting `local` may use any branch, including dirty working
976
- trees. Feature branches, dirty artifact source trees, non-git sources, and
977
- detached checkouts that cannot be attributed to `main` are preview-only for
978
- deployed environments
1225
+ **React/HTML active (official) deploys to deployed environments require `main`,
1226
+ or `staging` when the target is a staging environment, with a resolved git
1227
+ commit and a clean artifact source directory** for both Git Service (`--repo`)
1228
+ and local sources. When a local source is nested in a larger checkout, dirty
1229
+ files outside that source directory are ignored with a warning. Deployments
1230
+ targeting `local` may use any branch, including dirty working trees. Feature
1231
+ branches, dirty artifact source trees, non-git sources, and detached checkouts
1232
+ that cannot be attributed to an allowed branch are preview-only for deployed environments
979
1233
  (`seq-studio artifact dev` / preview channel); promotion applies the same
980
1234
  provenance check.
981
1235
 
@@ -1103,10 +1357,17 @@ Git Service verification required for an official release:
1103
1357
  | `--repo <ns>/<name>` | a repo in the platform Git Service, e.g. `--repo artifacts/accounts` |
1104
1358
  | `--git-url <url>` | a public, credential-free HTTPS git URL (cloned to a temp dir) |
1105
1359
 
1360
+ `--path <dir>` selects the application directory inside a `--repo` / `--git-url`
1361
+ repository (default: its root), for example `--repo apps/loan-tools --path artifacts/admin`.
1362
+ A Next.js release from a Git Service repository records that directory with the
1363
+ commit. A local `[dir]` nested in a Git Service checkout is sent the same way,
1364
+ relative to the checkout root.
1365
+
1106
1366
  For React/HTML, `--ref <branch\|tag\|commit>` selects the revision for `build` and `plan`
1107
1367
  (default: the repo's default branch). Active deploys to deployed environments
1108
- require `main`; local active deploys scope dirty-file checks to the source
1109
- directory and warn about unrelated changes elsewhere in the checkout.
1368
+ require `main`, or `staging` when the target is a staging environment; local
1369
+ active deploys scope dirty-file checks to the source directory and warn about
1370
+ unrelated changes elsewhere in the checkout.
1110
1371
  `--env local` accepts any local source ref. Other refs are preview-only for
1111
1372
  deployed environments. A remote source is materialized to a
1112
1373
  temp dir, built, and torn down;
@@ -1178,6 +1439,19 @@ The raw token is printed **once** on create.
1178
1439
 
1179
1440
  ## Repos commands
1180
1441
 
1442
+ `repos create` creates the hosted repository; it does not configure Git in your
1443
+ current folder. For a new local checkout, use `repos clone` with `ATLAS_GIT_PAT`
1444
+ and `--full` to get `origin`, branch tracking, and complete history for your
1445
+ editor's Git graph. For an existing folder, discover the clone URL with
1446
+ `repos show`, inspect `git remote -v`, and add a missing `origin` with
1447
+ `git remote add origin <clone-url>`, then `git fetch origin`. Fetching does not
1448
+ set an upstream: inspect the local and remote histories before using
1449
+ `git branch --set-upstream-to=origin/<remote-branch> <local-branch>`.
1450
+ See [Connect an existing folder](https://docs.seqholdings.com/seq-studio/repositories#connect-an-existing-folder)
1451
+ for handling folders with no commits or separate local history. Verify with
1452
+ `git branch -vv` and `git status --short --branch`. Plain Git needs its own
1453
+ credential-manager or PAT prompt setup; it does not read `ATLAS_GIT_PAT`.
1454
+
1181
1455
  `seq-studio repos <sub>` manages repos in the platform Git Service over the
1182
1456
  JSON API — the same repos `--repo <ns>/<name>` sources build from.
1183
1457
 
@@ -1187,7 +1461,7 @@ JSON API — the same repos `--repo <ns>/<name>` sources build from.
1187
1461
  | `seq-studio repos namespaces [create <slug>] -e <env>` | list namespaces, or create one (creator becomes owner) |
1188
1462
  | `seq-studio repos show <ns>/<name> -e <env>` | detail: id, branches, clone URL; artifact project id when slug matches |
1189
1463
  | `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. |
1190
- | `seq-studio repos clone <ns>/<name> \| --url <clone-url> \| --id <uuid> -e <env> [--ref <r>] [--output <dir>] [--force] [--full]` | smart-HTTP `git clone --depth 1` when `ATLAS_GIT_PAT` is set (`--full` fetches history; a commit SHA stays full). `--url`/`--id` need no seqapi. Otherwise JSON materialize + PAT hint. `--out` remains an alias for `--output`. |
1464
+ | `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` when `ATLAS_GIT_PAT` is set (`--full` fetches history; a commit SHA stays full). `--url`/`--id` need no seqapi. Otherwise JSON materialize + PAT hint. `--out` remains an alias for `--output`. |
1191
1465
  | `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` |
1192
1466
  | `seq-studio repos delete <ns>/<name> -e <env> [--yes]` | delete a repo — interactive confirm unless `--yes` |
1193
1467
  | `seq-studio repos ci show <ns>/<name> -e <env> [--ref <r>]` | preview CI checks discovered from the ref |
@@ -1232,6 +1506,18 @@ Validation logic lives in
1232
1506
  install it alongside the CLI for local spec authoring and validation. The
1233
1507
  discovery and data-reading commands below do not require the optional SDK.
1234
1508
 
1509
+ Pipeline packages discover `*.stage.yml` and `*.stage.yaml` files from their
1510
+ root by default. To place stage specs in specific subdirectories, add a
1511
+ `pipeline.config.yml` at the package root with `schema_version: 1` and an
1512
+ explicit `stage_directories` list, for example `config/stages`. Paths are
1513
+ relative to the package root; absolute paths, traversal, duplicates, and
1514
+ symlinks escaping the package are rejected. `documentation/` and `migrations/`
1515
+ are reserved metadata roots and cannot contain stage directories. Only listed
1516
+ directories are scanned. Stage `entrypoint` paths and `src/` resources remain
1517
+ relative to the package root. Validation, planning, deployment, migrations,
1518
+ and ORM repinning share the same loader. `pipeline init` scaffolds into the
1519
+ first listed stage directory; without config it keeps using the package root.
1520
+
1235
1521
  | Command | What it does |
1236
1522
  |---------|--------------|
1237
1523
  | `seq-studio pipeline list -e <env> [--limit <count>] [--offset <count>] [--json]` | List available pipelines and their source repositories; default 50 results, maximum 200, with the next offset shown when more exist |
@@ -1241,24 +1527,168 @@ discovery and data-reading commands below do not require the optional SDK.
1241
1527
  | `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 |
1242
1528
  | `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 |
1243
1529
  | `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 |
1244
- | `seq-studio pipeline init --type ingestion\|transformation\|serving <name> [--dir <dir>]` | Scaffold `<name>.stage.yml` (commented per-kind template) plus a `src/` Databricks-notebook entrypoint stub (begins with `# Databricks notebook source`; serving stages are declarative — no stub). Refuses to overwrite an existing spec |
1530
+ | `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 |
1531
+ | `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 |
1245
1532
  | `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, and repo-level graph validation (reference resolution, single-writer, cycles, column subsets, serving projection checks). Auto-loads `orm-contracts.json` from the pipeline dir when present. Exit 0/1 |
1246
1533
  | `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 |
1247
1534
  | `seq-studio pipeline plan --repo <namespace>/<slug> --ref <sha\|branch> [--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` or `apps`. 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 |
1248
- | `seq-studio pipeline deploy --repo <namespace>/<slug> --ref <sha\|branch> [--root <directory>] -e <env> [--target <id>] [--approved-by <sub>] [--allow-destructive <resource-key> ...] [--run-now] [--wait-timeout <duration>] [--no-wait]` | Plan then enqueue deploy; Trigger runs `bundle validate` then `bundle deploy` against reviewed bytes. `<namespace>` is `pipelines` or `apps`. 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. |
1535
+ | `seq-studio pipeline deploy --repo <namespace>/<slug> --ref <sha\|branch> [--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` or `apps`. 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. |
1249
1536
 
1250
1537
  `--root` selects a contained Pipeline package inside the repository. The directory becomes the package and Databricks bundle root, so its `*.stage.yml`, `src/`, manifests, contracts, schemas, and extra resources keep their normal root-relative layout. Each repository/root pair is an independent release unit; sibling pipelines and unrelated app files are not included in its bundle. Omitting `--root` preserves the historical whole-repository release unit.
1538
+
1539
+ `seq-studio pipeline deploy --dir <checkout> --repo <namespace>/<slug> -e <env>` publishes a clean local checkout into that environment's git service, then deploys the published commit through the same path. It is available on targets that do not require approval (`dev`, `staging`). BankSouth and production still deploy a commit that already exists in that environment's git service. Set `ATLAS_GIT_PAT` (repo:write) before publishing. Do not pass `--ref` with `--dir`. When the repository is created by this command, `main` is set to the published commit so a later clone without `--ref` resolves; an existing repository's default branch is left unchanged.
1251
1540
  | `seq-studio pipeline status --deployment-id <id> -e <env> [--json]` | Fetch the current remote deployment status without changing it. Use this public command to continue monitoring after local polling stops |
1252
1541
  | `seq-studio pipeline adopt --stage <slug> --ref <sha\|branch> [--root <directory>] -e <env> [--target <id>] --native-id <id> --approved-by <you> [--resource-key <key>] [--kind job\|dlt_pipeline] [--old-source-removal-pr <url>] [--repo <namespace>/<slug>]` | Bind a live Databricks job/pipeline into the stage without recreation (`bundle deployment bind` on Trigger). Always requires `--approved-by` naming the caller. When the key is still in the monorepo DAB, pass `--old-source-removal-pr` and follow the returned cutover checklist: unbind the old bundle state without deleting the remote, then remove its DAB declaration and add the target-specific adopted-resource entry in the same PR before redeploying. |
1253
1542
  | `seq-studio pipeline unbind --stage <slug> --ref <sha\|branch> [--root <directory>] -e <env> [--target <id>] --approved-by <you> [--resource-key <key>] [--repo <namespace>/<slug>]` | Release an adopted binding on Trigger; the remote object stays live (never deleted) |
1254
1543
  | `seq-studio pipeline run-now --stage <slug> -e <env> [--target <id>] [--repo <namespace>/<slug>] [--json]` | Run the stage's active job or DLT pipeline immediately and print its Databricks run URL |
1255
- | `seq-studio pipeline promote --stage <slug> --version <v> -e <env> [--target <id>] [--repo <namespace>/<slug>] [--approved-by <you>] [--wait-timeout <duration>] [--no-wait]` | Promote a validated version to another target. Targets that require approval need `--approved-by`; `--repo` disambiguates a slug that exists in multiple Pipelines |
1256
- | `seq-studio pipeline rollback --stage <slug> -e <env> [--target <id>] [--repo <namespace>/<slug>] [--approved-by <you>] [--wait-timeout <duration>] [--no-wait]` | Redeploy the previously retired deployment's version. Targets that require approval need `--approved-by`. |
1544
+ | `seq-studio pipeline promote --stage <slug> --version <v> -e <env> [--target <id>] [--repo <namespace>/<slug>] [--approved-by <you>] [--wait-timeout <duration>] [--no-wait] [--json]` | Promote a validated version to another target. Targets that require approval need `--approved-by`; `--repo` disambiguates a slug that exists in multiple Pipelines |
1545
+ | `seq-studio pipeline rollback --stage <slug> -e <env> [--target <id>] [--repo <namespace>/<slug>] [--approved-by <you>] [--wait-timeout <duration>] [--no-wait] [--json]` | Redeploy the previously retired deployment's version. Targets that require approval need `--approved-by`. |
1257
1546
 
1258
1547
  `-e/--env` selects the Atlas connection. `--target` selects the logical
1259
1548
  pipeline target advertised by that endpoint. It is optional when the alias
1260
1549
  matches a target id or when the endpoint has exactly one target.
1261
1550
 
1551
+ If Git authentication fails for a named repository, inspect its source with
1552
+ `seq-studio repos clone pipelines/<name> -e <env> --transport json --output ./source`.
1553
+ This explicitly uses your Atlas session and creates no `.git` directory. It is
1554
+ suitable for source inspection; obtain a Git checkout with a PAT valid for that
1555
+ environment when you need to push commits. URL/id-only clones require Git
1556
+ transport and a PAT. Avoid issuing more PATs without diagnosing the rejection.
1557
+
1558
+ ### Run a repository through the managed pipeline workflow
1559
+
1560
+ Start with `seq-studio doctor --offline --json` and `seq-studio capabilities --json`
1561
+ to check the executable version, resolved SDK paths, cached environment, and
1562
+ available commands. If installed commands differ from the guide, update the CLI
1563
+ and SDK packages before retrying. `doctor -e <env>` checks the selected connection
1564
+ and authentication without opening a browser. A cache permission error needs a
1565
+ filesystem fix; an expired session needs login. Complete one login before retrying.
1566
+
1567
+ Edit and commit locally, then push to the selected environment's git service.
1568
+ For targets that allow local-checkout publishing, the CLI can publish and deploy:
1569
+
1570
+ ```bash
1571
+ seq-studio pipeline deploy --dir . --repo pipelines/<name> -e <env> --run-now --json > deployment.json
1572
+ ```
1573
+
1574
+ Otherwise deploy the pushed commit with `--repo pipelines/<name> --ref <commit>`.
1575
+ `--run-now` uses the managed worker to run in-unit producers in dependency order.
1576
+ Closing the local client stops polling; the remote work continues. Retain the
1577
+ returned deployment id and inspect it with `pipeline status --deployment-id <id>`.
1578
+ Deployment, serving provisioning, registry activation, and ORM readiness are
1579
+ separate phases; a failure after bundle deployment can leave native resources
1580
+ updated. Follow the returned remediation and check the serving/ORM read path.
1581
+
1582
+ For `plan`, `deploy`, `promote`, and `rollback`, `--json` writes one result to
1583
+ stdout and progress to stderr. A waited deployment returns its terminal detail,
1584
+ including failure detail with exit code 1. `--no-wait --json` returns the enqueue
1585
+ receipt. Keep stderr visible when redirecting or piping stdout.
1586
+
1587
+ ```bash
1588
+ seq-studio pipeline plan --repo pipelines/<name> --ref <commit> -e <env> --json > plan.json
1589
+ seq-studio pipeline plan --plan-request-id <id> -e <env> --json > plan.json
1590
+ ```
1591
+
1592
+ The second command reads the original durable plan; it does not enqueue another
1593
+ plan or attach credentials. Use it after a local poll/output failure, with the
1594
+ request id printed on stderr. Do not combine it with source, target, migration,
1595
+ or provisioning options. Completing a read of the plan does not deploy it.
1596
+
1597
+ ### Declared external source schema checks
1598
+
1599
+ Transformation stages can opt into `source_contracts` in their stage spec (see
1600
+ `@sequenceholdings/pipeline-spec`). `pipeline validate` validates these declarations
1601
+ offline. `pipeline plan` checks the selected native column names/types against
1602
+ Unity Catalog metadata in the destination environment and includes all discovered
1603
+ mismatches in its provisioning findings. Missing tables, required columns,
1604
+ incompatible types, or unavailable metadata block the enrolled deployment; added
1605
+ unused columns are compatible.
1606
+
1607
+ Managed deployment pins the reviewed declarations and repeats the schema check
1608
+ before provisioning, before bundle deployment, and before producers requested by
1609
+ `deploy --run-now`. A plan created without the declaration fingerprint must be
1610
+ recreated before deploying stages with source contracts. Stages without source
1611
+ contracts keep their existing behavior and have no new source verification claim.
1612
+
1613
+ Execution rechecks persist source-preflight receipts with target, revision,
1614
+ contract fingerprint, phase, time, and structured findings. This includes early
1615
+ manual-run refusals without creating an invocation. `pipeline status
1616
+ --deployment-id <id> -e <env> --json` returns the latest 50 observations for that
1617
+ deployment in `sourcePreflightChecks`; the reviewed plan keeps plan-time findings.
1618
+ Receipt storage failure blocks the affected deployment or native submission.
1619
+
1620
+ These checks prove metadata compatibility only. They do not prove SELECT access
1621
+ as the job identity, row/key validity, or that arbitrary Python reads only declared
1622
+ sources. Standalone `pipeline run-now` rechecks the active stage before invocation
1623
+ creation and immediately before native submission. These manual checks cover
1624
+ that stage only; downstream trigger tails, native scheduled runs, and unmanaged
1625
+ Databricks execution still need runtime enforcement. Checks do not freeze source data or
1626
+ prevent schemas changing after observation.
1627
+
1628
+ ### Generic serving installation lifecycle (draft)
1629
+
1630
+ This lifecycle has unit/PGlite coverage; it has not been exercised against a
1631
+ live installation as part of this change. Backing/dependent-view access checks
1632
+ cover captured dependencies, ORM ownership, explicit grants, and runtime role
1633
+ membership. A physical column/type/key audit is separate future hardening.
1634
+ Generic producer outputs and ORM source references accept safe lowercase
1635
+ `schema.table` identifiers, with each component limited to 63 characters.
1636
+ Syntax does not prove existence or authorize a relation: enrollment is limited
1637
+ to an active same-repo transformation producer and pins the exact declared
1638
+ output plus resolved physical relation. External/cross-repo sources are not
1639
+ supported. Legacy serving declarations and existing installations are
1640
+ unchanged.
1641
+
1642
+ Generic `serving` stages require an explicitly registered destination and an
1643
+ enrollment that pins both the serving version and its active producer. This is
1644
+ an operator-mediated handoff, not destination provisioning: registration
1645
+ inspects an existing UC catalog/schema and Lakebase schema, and fails closed if
1646
+ their identity or owner-only access checks do not match. It does not create a
1647
+ schema, change ACLs, accept connection details, or grant public access. Only a
1648
+ Sequence platform operator can register/revoke installations or enroll serving
1649
+ versions; ordinary Pipeline editor access and ORM namespace-admin access are
1650
+ also checked where applicable. The `reviewRef` is audit metadata, not proof of
1651
+ permission.
1652
+
1653
+ The intended bootstrap sequence is:
1654
+
1655
+ 1. As a Sequence platform operator, register the already-existing private
1656
+ destination with `POST /api/data-pipelines/serving-installations`, supplying
1657
+ only `environment`, `catalog`, `schema`, and `reviewRef`. Save the returned
1658
+ server-minted `key`; do not choose the key yourself.
1659
+ 2. With that installation key, register the serving stage shell and immutable
1660
+ serving version using the stage and stage-version APIs. Its transformation
1661
+ producer must already have an active deployment in the same repo and
1662
+ environment. Register the immutable ORM candidate without activating it;
1663
+ candidate registration does not require the serving backing to exist.
1664
+ 3. Enroll the immutable serving stage version with
1665
+ `POST /api/data-pipelines/serving-installations/<key>/enrollments`, supplying
1666
+ `servingRepo`, `servingStage`, `sourceCommit`, and `reviewRef`. For
1667
+ `orm_only` or `both` exposure, also supply the explicit immutable
1668
+ `ormVersionId`; dataset-only enrollment must omit it. The server resolves
1669
+ and verifies source deployments, candidate table contracts, and serving
1670
+ pins. An unchanged retry is idempotent.
1671
+ 4. Use the normal `pipeline plan` and reviewed deploy flow.
1672
+ Initial private creation retains acknowledgement
1673
+ and pending checks. Materialized resources must pass adoption verification
1674
+ before an active binding is advertised. Do not bypass the acknowledgement
1675
+ gate by switching exposure or directly writing registry rows.
1676
+
1677
+ To intentionally enroll a new serving version, use `PUT` on the same
1678
+ `/<key>/enrollments` path. Include the POST fields plus the
1679
+ `expectedPreviousSpecHash`, `expectedPreviousContractHash`,
1680
+ `expectedPreviousSourceSpecHash`, `expectedPreviousSourceContractHash`, and
1681
+ `expectedPreviousOrmVersionId` (UUID or `null`) returned by the prior
1682
+ enrollment. These compare-and-swap pins prevent a stale update from replacing
1683
+ a concurrent source or ORM-candidate repin. A revoked/expired enrollment cannot
1684
+ be reactivated by PUT; revoke an installation with
1685
+ `DELETE /api/data-pipelines/serving-installations?key=<key>` when retiring it.
1686
+ After changing the serving declaration or enrollment, re-plan before deploying.
1687
+
1688
+ Manual refresh uses the existing `pipeline run-now --stage <slug> -e <env>`
1689
+ flow. Refresh execution rechecks the active installation/enrollment and source
1690
+ pins. A revoked, expired, changed, or unmaterialized binding fails closed.
1691
+
1262
1692
  ### Discover inputs before authoring
1263
1693
 
1264
1694
  For both people and agents, search deployed documentation to find likely inputs,
@@ -1486,6 +1916,30 @@ For local Atlas development, `-e local` uses the server's isolated `dev`
1486
1916
  deployment target. Plan, deploy, and `run-now` therefore operate on the same
1487
1917
  personal dev Databricks catalog and Lakebase branch configured for local Atlas.
1488
1918
 
1919
+ ## Ontology consumer contracts
1920
+
1921
+ Artifact Studio manifests, `managed-function.yml`, and Pipeline `*.stage.yml`
1922
+ specs may opt into an explicit ontology dependency declaration:
1923
+
1924
+ ```yaml
1925
+ ontology:
1926
+ version: 1
1927
+ read: [lending/loans]
1928
+ write: [lending/loan_summary]
1929
+ invoke: [refresh-loan-index]
1930
+ ```
1931
+
1932
+ Object references are exact `namespace/object` names, without wildcards;
1933
+ function references are slugs. `produce` uses the same object-reference form
1934
+ but is valid only in Pipeline stage specs. The block is optional, so omitting
1935
+ it preserves legacy behavior. When present, deployment checks declared
1936
+ objects against active ORM definitions and functions against the registered
1937
+ functions; unresolved declarations fail deployment, including previews.
1938
+
1939
+ This records explicit consumer intent. It does not replace capabilities or
1940
+ permissions, and this release does not enforce declarations on runtime ORM
1941
+ requests.
1942
+
1489
1943
  ## Authorization
1490
1944
 
1491
1945
  The CLI carries no permissions of its own: every request is authorized
@@ -1510,6 +1964,9 @@ Opt in with `cache: { enabled: true }` in `managed-function.yml` for a dedicated
1510
1964
  `seq-studio functions dev --dir ./my-function --port 8080` compiles the project's TypeScript and starts a local HTTP server with the same context. Enabled caching without an explicit Valkey configuration uses bounded per-process TTL/LRU memory, only in this local harness. It never allocates cloud resources. See the Managed Functions SDK README for contracts, failure semantics, and optional private Valkey development connections.
1511
1965
  ## Blob storage / Workspaces V2
1512
1966
 
1967
+ Workspaces V2 is file storage, separate from Chat Workspaces. It has no content
1968
+ search yet, and agent `file_search` cannot read it.
1969
+
1513
1970
  The initial storage package and CLI additions are pending publication and public
1514
1971
  contract review. With a CLI build containing this feature, use the normal Atlas
1515
1972
  environment and credentials:
@@ -1519,6 +1976,7 @@ seq-studio storage init application-documents
1519
1976
  seq-studio storage validate workspace.yml
1520
1977
  seq-studio storage apply workspace.yml -e local
1521
1978
  seq-studio storage upload ./report.pdf --workspace <id> --path reports/report.pdf -e local
1979
+ seq-studio storage import ./exports --workspace <id> --path imported --yes -e local
1522
1980
  seq-studio storage list --workspace <id> -e local
1523
1981
  seq-studio storage download --workspace <id> --node <file-id> --out ./copy.pdf -e local
1524
1982
  ```
@@ -1538,6 +1996,18 @@ replaces content with optimistic concurrency; it preserves prior immutable versi
1538
1996
  Ctrl-C stops transfer without throwing away the resumable session. `storage abort`
1539
1997
  explicitly cancels it. Do not log session URLs or signed downloads.
1540
1998
 
1999
+ `storage import <directory|gs://bucket/prefix>` copies many objects into one
2000
+ workspace. It always prints where it will write (Atlas URL, environment, gcloud
2001
+ identity, source, workspace, and the pending-upload caps) and does nothing else
2002
+ until `--yes`. A GCS source uses your gcloud credentials to read objects; the CLI
2003
+ uploads those bytes with the sessions Atlas reserves in batches of 20. Applying a
2004
+ workspace does not cut an application over from its old bucket. Point the
2005
+ application at the workspace id after the import, and keep or delete the old
2006
+ bucket separately. `storage uploads` lists your unfinished sessions, and
2007
+ `storage reconcile --abort-incomplete` releases ones whose bytes never arrived.
2008
+ Re-run the same import to resume; progress defaults to
2009
+ `storage-import-progress.json`.
2010
+
1541
2011
  `storage trash` and `restore` are reversible. `purge --yes` and workspace
1542
2012
  `delete --yes` return durable Temporal receipts; inspect `storage operations` and
1543
2013
  use `--retry <operation-id>` after correcting a failed cleanup. Each destructive
@@ -1566,6 +2036,10 @@ unreleased packages do not prove a public-registry workflow.
1566
2036
  authority. Construct it inside the handler, supply the trusted configured
1567
2037
  environment origin, and declare a service-account binding and data scopes.
1568
2038
  It does not choose service mode or authenticate arbitrary public HTTP ingress.
2039
+ - `createFunctionServiceOrmExecutor({request, baseUrl, namespace, manifest})`
2040
+ from the same module acts as the function's attached service account. Use it
2041
+ for a Lattice step or another invocation with no human caller; declare data
2042
+ scopes and enforce any per-user rule in the handler.
1569
2043
  - The shared execution dependency contains no ORM authoring/compiler dependencies.
1570
2044
  Keep namespace generation in the development package, outside the Function runtime.
1571
2045