@sequenceholdings/studio-cli 0.2.2 → 0.4.1

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 (128) hide show
  1. package/README.md +616 -78
  2. package/dist/access/commands.d.ts +3 -0
  3. package/dist/access/commands.js +91 -0
  4. package/dist/agents/commands.d.ts +1 -1
  5. package/dist/agents/commands.js +5 -0
  6. package/dist/agents/scaffold.js +5 -7
  7. package/dist/agents/voice-authoring.d.ts +5 -0
  8. package/dist/agents/voice-authoring.js +75 -0
  9. package/dist/agents/voice-publication.d.ts +5 -0
  10. package/dist/agents/voice-publication.js +63 -0
  11. package/dist/agents/voice-shared.d.ts +20 -0
  12. package/dist/agents/voice-shared.js +112 -0
  13. package/dist/agents/voice.d.ts +3 -0
  14. package/dist/agents/voice.js +57 -0
  15. package/dist/app/adapters.d.ts +6 -0
  16. package/dist/app/adapters.js +17 -2
  17. package/dist/app/agent-refs.d.ts +16 -0
  18. package/dist/app/agent-refs.js +36 -0
  19. package/dist/app/application-registration.d.ts +36 -6
  20. package/dist/app/application-registration.js +60 -15
  21. package/dist/app/commands.js +19 -2
  22. package/dist/app/deploy.d.ts +3 -0
  23. package/dist/app/deploy.js +22 -6
  24. package/dist/app/env-bindings.d.ts +21 -0
  25. package/dist/app/env-bindings.js +184 -0
  26. package/dist/app/manifest-validation.js +8 -0
  27. package/dist/app/manifest.d.ts +32 -14
  28. package/dist/app/manifest.js +16 -6
  29. package/dist/app/primitive-scaffold.d.ts +4 -1
  30. package/dist/app/primitive-scaffold.js +4 -4
  31. package/dist/app/readme.js +1 -0
  32. package/dist/app/scaffold-files.js +1 -1
  33. package/dist/app/scaffold.d.ts +6 -4
  34. package/dist/app/scaffold.js +7 -4
  35. package/dist/app/workspace-scaffold.js +12 -7
  36. package/dist/argv.d.ts +7 -0
  37. package/dist/argv.js +56 -0
  38. package/dist/artifact/delegate.js +8 -4
  39. package/dist/atlas-client.d.ts +6 -0
  40. package/dist/atlas-client.js +39 -2
  41. package/dist/auth-cmds/commands.d.ts +1 -1
  42. package/dist/auth-cmds/commands.js +16 -0
  43. package/dist/auth.d.ts +32 -0
  44. package/dist/auth.js +170 -33
  45. package/dist/bin.js +23 -4
  46. package/dist/command-contract.d.ts +137 -0
  47. package/dist/command-contract.js +43 -0
  48. package/dist/command-help.d.ts +8 -0
  49. package/dist/command-help.js +71 -0
  50. package/dist/command-input.d.ts +15 -0
  51. package/dist/command-input.js +33 -0
  52. package/dist/functions/commands.d.ts +2 -1
  53. package/dist/functions/commands.js +78 -33
  54. package/dist/functions/deploy-preflight.d.ts +21 -0
  55. package/dist/functions/deploy-preflight.js +58 -0
  56. package/dist/functions/egress-postgres.d.ts +7 -0
  57. package/dist/functions/egress-postgres.js +36 -0
  58. package/dist/functions/manifest.d.ts +15 -1
  59. package/dist/functions/manifest.js +49 -12
  60. package/dist/functions/secret-reconcile.d.ts +3 -3
  61. package/dist/functions/secret-reconcile.js +5 -7
  62. package/dist/functions/source-selection.js +4 -1
  63. package/dist/main.d.ts +2 -0
  64. package/dist/main.js +75 -25
  65. package/dist/manifest-roles-notice.d.ts +33 -0
  66. package/dist/manifest-roles-notice.js +75 -0
  67. package/dist/orm/delegate.d.ts +16 -0
  68. package/dist/orm/delegate.js +142 -7
  69. package/dist/pipeline/clone-deploy.d.ts +37 -0
  70. package/dist/pipeline/clone-deploy.js +125 -0
  71. package/dist/pipeline/codegen.js +6 -2
  72. package/dist/pipeline/commands.js +21 -5
  73. package/dist/pipeline/lifecycle.d.ts +1 -0
  74. package/dist/pipeline/lifecycle.js +95 -44
  75. package/dist/pipeline/repin-orm.js +6 -2
  76. package/dist/pipeline/stage-secrets.d.ts +4 -1
  77. package/dist/pipeline/stage-secrets.js +7 -3
  78. package/dist/process/build.js +17 -0
  79. package/dist/process/codegen.js +16 -0
  80. package/dist/process/commands.d.ts +15 -7
  81. package/dist/process/commands.js +294 -98
  82. package/dist/process/lint.js +35 -0
  83. package/dist/process/plan-diff.js +9 -0
  84. package/dist/process/simulate.js +8 -0
  85. package/dist/release-age.d.ts +12 -0
  86. package/dist/release-age.js +24 -0
  87. package/dist/repos/commands.d.ts +10 -1
  88. package/dist/repos/commands.js +42 -8
  89. package/dist/repos/pulls.d.ts +3 -0
  90. package/dist/repos/pulls.js +131 -0
  91. package/dist/scaffold-guidance.d.ts +4 -0
  92. package/dist/scaffold-guidance.js +15 -0
  93. package/dist/secrets/commands.d.ts +1 -1
  94. package/dist/secrets/commands.js +97 -16
  95. package/dist/service-accounts/commands.d.ts +3 -0
  96. package/dist/service-accounts/commands.js +50 -0
  97. package/dist/storage/commands.js +23 -1
  98. package/dist/storage/gcs-download.d.ts +13 -0
  99. package/dist/storage/gcs-download.js +41 -0
  100. package/dist/storage/import-cycle.d.ts +41 -0
  101. package/dist/storage/import-cycle.js +123 -0
  102. package/dist/storage/import-files.d.ts +30 -0
  103. package/dist/storage/import-files.js +133 -0
  104. package/dist/storage/import-gcloud.d.ts +12 -0
  105. package/dist/storage/import-gcloud.js +54 -0
  106. package/dist/storage/import-identity.d.ts +12 -0
  107. package/dist/storage/import-identity.js +15 -0
  108. package/dist/storage/import-plan.d.ts +120 -0
  109. package/dist/storage/import-plan.js +189 -0
  110. package/dist/storage/import-preflight.d.ts +36 -0
  111. package/dist/storage/import-preflight.js +62 -0
  112. package/dist/storage/import-progress-map.d.ts +5 -0
  113. package/dist/storage/import-progress-map.js +22 -0
  114. package/dist/storage/import-recover.d.ts +97 -0
  115. package/dist/storage/import-recover.js +186 -0
  116. package/dist/storage/import-run.d.ts +14 -0
  117. package/dist/storage/import-run.js +140 -0
  118. package/dist/templates/guidance/AGENTS.md +10 -0
  119. package/dist/templates/guidance/CLAUDE.md +1 -0
  120. package/dist/templates/process/package.json +2 -2
  121. package/dist/templates/process/pnpm-workspace.yaml +7 -4
  122. package/dist/validation-detail.d.ts +2 -0
  123. package/dist/validation-detail.js +20 -0
  124. package/package.json +9 -9
  125. package/templates/guidance/AGENTS.md +10 -0
  126. package/templates/guidance/CLAUDE.md +1 -0
  127. package/templates/process/package.json +2 -2
  128. 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 make function-to-ORM service-account access a public runtime contract.
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
@@ -332,34 +378,20 @@ root pnpm workspace if you want shared builds. Adding an agent, process, or pipe
332
378
 
333
379
  ### Application roles (schema version 3)
334
380
 
335
- Version 3 is version 2 plus `roles`. Deploying it also registers the app with
336
- Atlas as an **Application**, so granting someone one Application role gives them
337
- everything the app needs: each member's end-user access plus the member roles
338
- and capabilities you bundle. Grants are made in Atlas, never in the manifest.
339
-
340
- ```yaml
341
- schema_version: 3
342
- # ...app, studio, primitives as in version 2...
343
- roles:
344
- definitions:
345
- member:
346
- description: Can use Loan Tools
347
- includes:
348
- - { primitive: admin-ui, role: end_user }
349
- - { primitive: score-fn, role: invoker } # end_user also works
350
- - { primitive: loans-orm, role: end_user }
351
- reviewer:
352
- inherits: [member]
353
- includes:
354
- - { primitive: admin-ui, role: approver }
355
- - { primitive: loans-orm, capability: loan-read }
356
- ```
357
-
358
- - Includes can reach `artifact`, `function`, `orm`, and `process` primitives.
359
- `role: end_user` is a member's end-user access; `invoker` is accepted on
360
- functions and processes. Any other `role` is one of the member's registered
361
- roles, and `capability` one of its capabilities. Including a member role or
362
- capability also grants that member's end-user access.
381
+ Version 3 is version 2 plus Application registration: after its primitives
382
+ deploy, the app is registered with Atlas as an **Application**. Create its
383
+ roles in Atlas — Permissions → Applications → the app → **Edit roles**, or
384
+ `POST /api/custom-roles/applications/<id>/roles` — so granting someone one
385
+ Application role gives them everything the app needs: each member's end-user
386
+ access plus the member roles and capabilities the role bundles. Grants are made
387
+ in Atlas too, never in the manifest.
388
+
389
+ - A role's includes can reach `artifact`, `function`, `orm`, and `process`
390
+ primitives: a member's end-user access (`invoker` on functions and
391
+ processes), one of its registered roles, or one of its capabilities.
392
+ A member role or capability doesn't grant end-user access by itself — as on
393
+ the primitive, a role needs an explicit end-user include on each member its
394
+ holders should be able to open.
363
395
  - A `process` primitive offers only end-user access (starting runs), and a role
364
396
  can include it only when it deploys exactly one process, `only: [<process-id>]`:
365
397
 
@@ -369,53 +401,73 @@ roles:
369
401
  - The Application registers after every primitive deploys; if one fails, it
370
402
  is skipped. Registering requires capability admin on every member (owner,
371
403
  for a process), checked on every deploy.
372
- - Each role is created the first time a deploy sees it. After that Atlas owns
373
- it: edit it in Atlas, and the deploy reports a changed definition here as
374
- drift instead of applying it.
375
404
  - Members are synced every deploy. Removing one removes every role's access
376
405
  into it.
377
406
  - A Next.js artifact is an ordinary `artifact` member. Its server calls ORM and
378
- functions as the signed-in user unless it declares `service_account`, so a
379
- role that includes it should also include `end_user` on every namespace and
380
- `invoker` on every function its `server.capabilities` reach (the same holds
381
- for any artifact's browser `capabilities`). The deploy prints an
382
- `access_gap` warning for each one a role misses; it never adds them for you.
383
-
384
- ### Collaborator roles (schema version 3)
385
-
386
- `roles` bundle use. `collaborators` bundle the tiers that let people change
387
- the members: one grant can make someone a writer on the UI, an editor on its
388
- function, and a writer on its namespace. The two never mix: a collaborator role
389
- includes only member tiers and inherits only other collaborator roles.
407
+ functions, and starts processes, as the signed-in user unless it declares
408
+ `service_account`, so a role that includes it should also include `end_user`
409
+ on every namespace and `invoker` on every function and process its
410
+ `server.capabilities` reach (the same holds for any artifact's browser
411
+ `capabilities`). The deploy prints an `access_gap` warning for each missing
412
+ namespace or function grant; process starts aren't checked yet, so grant the
413
+ process `invoker` explicitly. It never adds grants for you.
414
+
415
+ #### Deprecated: role definitions in YAML
416
+
417
+ **Capabilities are code, roles are data.** Capabilities live in YAML because your code checks them; roles
418
+ are bundles of capabilities that admins create and change in Atlas.
419
+
420
+ `roles:` and `collaborators:` blocks in `sequence.app.yml` — like
421
+ `capabilities.roles.definitions` in `artifact.bundle.yml`,
422
+ `managed-function.yml`, and `namespace.yaml` — are **deprecated**. They are
423
+ still accepted as a one-time seed: a deploy creates any role Atlas doesn't have
424
+ yet and **never updates it after**; a changed definition is reported as drift,
425
+ not applied. `seq-studio` prints a notice when a manifest it deploys defines
426
+ roles. Don't add new ones — create roles in Atlas. Capabilities stay in YAML:
427
+ they're the contract your code checks.
428
+
429
+ The legacy seed format, for reading existing manifests:
390
430
 
391
431
  ```yaml
392
- collaborators:
432
+ roles:
393
433
  definitions:
394
- reviewer:
395
- description: Reads the code and data model
434
+ member:
396
435
  includes:
397
- - { primitive: admin-ui, tier: reader }
398
- - { primitive: loans-orm, tier: reader }
436
+ - { primitive: admin-ui, role: end_user }
437
+ - { primitive: loans-orm, capability: loan-read }
438
+ collaborators:
439
+ definitions:
399
440
  maintainer:
400
- description: Ships changes to the desk, its API and its data model
401
- inherits: [reviewer]
402
441
  includes:
403
442
  - { primitive: admin-ui, tier: writer }
404
- - { primitive: score-fn, tier: editor }
405
- - { primitive: loans-orm, tier: writer }
406
- - { primitive: approval-flow, tier: editor }
407
443
  ```
408
444
 
445
+ ### Collaborator roles (schema version 3)
446
+
447
+ Runtime roles bundle use. **Collaborator roles** bundle the tiers that let
448
+ people change the members: one grant can make someone a writer on the UI, an
449
+ editor on its function, and a writer on its namespace. Create them in Atlas
450
+ (the Application's **Collaborator access** tab, or `?kind=collaborator` on the
451
+ roles API) — a `collaborators:` block here is the deprecated seed described
452
+ above. The two kinds never mix: a collaborator role includes only member tiers
453
+ and inherits only other collaborator roles.
454
+
409
455
  | Kind | Tiers a collaborator role can bundle |
410
456
  |---|---|
411
457
  | `artifact` | `reader`, `writer` |
412
458
  | `function` | `reader`, `editor` |
413
459
  | `orm` | `reader`, `writer` |
414
460
  | `process` (exactly one, `only: [<process-id>]`) | `editor` |
461
+ | `pipeline` (needs `repo`) | `viewer`, `operator`, `editor` |
415
462
 
416
463
  - Never `admin` or `owner`: admin can share a member and bundle it into other
417
464
  Applications, so it stays a direct grant. Workspaces are never bundled.
418
- - Every tier includes use, so a maintainer can always use what they maintain.
465
+ - Every tier includes the ones below it, and use where the member has any, so a
466
+ maintainer can always use what they maintain. A pipeline runs as a service
467
+ principal, so it has nothing to use and appears only in collaborator roles:
468
+ `viewer` sees its runs, `operator` runs its stages, `editor` deploys it.
469
+ - A pipeline member is its release unit, the same id deploy registers:
470
+ `pipelines/<name>`, or `apps/<name>@<path>` for one of an app's pipelines.
419
471
  - Consent is stricter than for runtime roles: bundling a member's tiers needs
420
472
  **admin** on it (owner, for a process), checked on every deploy.
421
473
  - Only the Application's admins create, edit and grant collaborator roles in
@@ -475,6 +527,122 @@ pnpm exec seq-studio agents apply -e <env>
475
527
  Use `--repo agents/<name> [--ref <ref>]` or `--git-url <url>` instead of
476
528
  `--dir` to materialize reviewed source from the platform git service.
477
529
 
530
+ ### Voice authoring (internal staging demo)
531
+
532
+ `agents voice` is restricted to the internal synthetic demo in the configured
533
+ Sequence staging environment. It is not a customer-facing Voice release. Use a
534
+ human `seq-studio login` session with current demo participant and Agent editor
535
+ access; publication additionally requires a demo operator. Machine/M2M credentials
536
+ are rejected. All network commands require an explicit environment. The server
537
+ uses the same authorization, supported catalogs, source resolution, dependency
538
+ reviews and publication service as the Atlas Voice builder.
539
+
540
+ Voice uses the same `defineAgent(...)`/`agent.ts` format and offline compiler as
541
+ text Agents. An Agent ID has one immutable mode. Generic `agents apply` does not
542
+ activate Voice; use `agents voice save` for revision-checked draft authoring and
543
+ the separate publication command when ready. No command creates a Skill or a
544
+ Managed Function. Create those with their existing authoring tools, then attach
545
+ their references. The built-in banking examples are documented in the contributor
546
+ guide; they contain fictional data and unresolved catalog/Skill placeholders.
547
+
548
+ | Command (append `-e <env>`) | Result |
549
+ |---|---|
550
+ | `agents voice inspect <id> [--out inspection.json]` | Captured draft, current source drift/access, supported catalogs and publication permission |
551
+ | `agents voice export <id> [--out agent.ts]` | Exact captured authored definition using the builder's source serializer |
552
+ | `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 |
553
+ | `agents voice capture <id> --request-file capture.json [--yes]` | Explicitly attach or refresh the current native Skill text |
554
+ | `agents voice validate <id> --expected-revision N [--out review.json]` | Current authored/projection hashes, source status and concrete tool bindings requiring review |
555
+ | `agents voice publish <id> --request-file publication.json [--yes]` | One explicit, revision-checked publication attempt |
556
+ | `agents voice status <id> --key <uuid>` or `--operation <uuid>` | Read-only recovery; never dispatches publication |
557
+ | `agents voice retry <id> --operation <uuid> [--yes]` | Resume the recorded publication under current operator/dependency checks |
558
+
559
+ `save` also accepts the usual `--repo agents/<name>` or `--git-url <url>` source,
560
+ `--ref`, and `--target <APP_ENV>`. It selects exactly the positional Agent ID after
561
+ environment selection. Output files are created with restricted permissions and
562
+ never overwrite an existing file. Export includes only the strict authored
563
+ definition, including captured SOP text, native source references and declared
564
+ Agent permissions. It excludes provider resource IDs, runtime grants, credentials,
565
+ call state and draft audit metadata. Treat source text as untrusted and review it
566
+ before executing anything from a repository.
567
+
568
+ Start in your existing standalone typed-Agent repository:
569
+
570
+ ```sh
571
+ seq-studio agents voice help
572
+ seq-studio login
573
+ seq-studio agents voice inspect <id> -e staging --out inspection.json
574
+ seq-studio agents voice export <id> -e staging --out agent.ts
575
+ # Edit agent.ts, retaining its Voice mode and the same ID.
576
+ seq-studio agents validate --dir .
577
+ seq-studio agents voice save <id> -e staging --dir . --expected-revision 3
578
+ seq-studio agents voice inspect <id> -e staging
579
+ # Use the actual returned draft revision, not the illustrative number here.
580
+ seq-studio agents voice validate <id> -e staging --expected-revision 4 --out review.json
581
+ ```
582
+
583
+ `inspect` never replaces captured text when a source Skill changes. `save` checks
584
+ current Skill access but also preserves that text. For an explicit refresh, write
585
+ `capture.json` using the actual ID/revision and the procedure's declared references:
586
+
587
+ ```json
588
+ {
589
+ "agentId": "680000000000000000000001",
590
+ "expectedDraftRevision": 4,
591
+ "action": "REFRESH",
592
+ "skillId": "native-skill-id",
593
+ "procedureKey": "replacement_card",
594
+ "activationDescription": "When asked to request a replacement for an eligible fictional card.",
595
+ "toolAliases": ["prepare_demo_service_request", "confirm_demo_service_request"],
596
+ "subprocedures": []
597
+ }
598
+ ```
599
+
600
+ Run `agents voice capture <id> -e staging --request-file capture.json`, inspect the
601
+ new draft and validate its returned revision. Use `ATTACH` for a new local key;
602
+ `REFRESH` must identify the Skill already attached to that key. Cross-environment
603
+ Skill or function references are not silently mapped. Resolve `SOURCE_MISSING`,
604
+ `SOURCE_FORBIDDEN` or `INVALID_BINDING` in the target environment before publication.
605
+ Editing captured text recalculates its content hash; restoring older source from
606
+ Git retains its text but still requires current access and dependency review.
607
+
608
+ Read `review.json`, including each binding's function version and authority policy.
609
+ Create `publication.json` with its actual draft/deployment revisions, a fresh UUID
610
+ for this intentional publication, and only the exact tool aliases/binding hashes
611
+ you reviewed. `toolReviewConfirmations` may be empty only when no confirmation is
612
+ required. `--yes` confirms the displayed action; it never manufactures reviews.
613
+
614
+ ```json
615
+ {
616
+ "agentId": "680000000000000000000001",
617
+ "expectedDraftRevision": 5,
618
+ "expectedDeploymentRevision": 2,
619
+ "idempotencyKey": "ea9d0f81-75c3-4a15-bbef-dbac20c4353c",
620
+ "toolReviewConfirmations": []
621
+ }
622
+ ```
623
+
624
+ Each confirmation has shape `{"toolAlias":"alias","bindingHash":"<64-hex hash from review>"}`.
625
+ Generate your own UUID (for example `node -e 'console.log(crypto.randomUUID())'`);
626
+ the example key is illustrative. Keep the exact request file before dispatch:
627
+
628
+ ```sh
629
+ seq-studio agents voice publish <id> -e staging --request-file publication.json
630
+ seq-studio agents voice status <id> -e staging --key <uuid-from-file>
631
+ # Only when the recorded operation requires an explicit retry:
632
+ seq-studio agents voice retry <id> -e staging --operation <returned-operation-uuid>
633
+ ```
634
+
635
+ Calls time out after 30 seconds and responses are bounded to 8 MiB. Voice requests
636
+ never automatically retry a 503, timeout or lost response. A status response may
637
+ be preparing/waiting; a successful CLI exit means the request/status was read,
638
+ not that publication is active. Status exits `2` when no operation is recorded;
639
+ an in-flight request may still arrive. Keep checking the same key. If retrying the
640
+ initial dispatch is necessary, explicitly resend the **unchanged** publication
641
+ file; do not allocate a new key to escape uncertainty. After a stale-revision
642
+ rejection, inspect and validate current state before preparing a different request.
643
+ Saving, capturing or publishing never enrolls callers, provisions phone numbers,
644
+ opens call admission, places calls, or changes the demo limits.
645
+
478
646
  ## ORM commands
479
647
 
480
648
  `seq-studio orm` authors and deploys governed ORM v2 namespaces: TypeScript
@@ -486,7 +654,7 @@ compiled to canonical SQL before registration.
486
654
  | Command | What it does |
487
655
  |---------|--------------|
488
656
  | `seq-studio orm init <dir>` | Scaffold one v2 namespace package (`sequence.config.ts`, `schema/*.ts`, `graphql/**`, and codegen config). |
489
- | `seq-studio orm generate [dir]` | Generate `schema.graphql`, `operations.manifest.json`, `typePolicies.gen.ts`, and consumer codegen when `codegen.ts` is present. |
657
+ | `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. |
490
658
  | `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. |
491
659
  | `seq-studio orm validate [dir]` | Parse and compile the namespace, then verify its committed migration chain is current. |
492
660
  | `seq-studio orm plan [dir] -e <env>` | Compare the compiled namespace with registry state without applying database changes. |
@@ -494,6 +662,7 @@ compiled to canonical SQL before registration.
494
662
  | `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. |
495
663
  | `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. |
496
664
  | `seq-studio orm migrate-from-yaml <dir>` | Convert a legacy YAML namespace to TypeScript authoring while preserving its committed migrations. |
665
+ | `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. |
497
666
 
498
667
  Install the CLI and ORM package together:
499
668
 
@@ -520,10 +689,48 @@ the target environment's data. `apply --no-create` is the CI guard that refuses
520
689
  to provision a missing namespace. Destructive DDL requires explicit
521
690
  `--allow-destructive` consent.
522
691
 
692
+ Queued rehearsals wait at most 35 minutes for a recorded verdict. If that wait
693
+ expires, the CLI reports an unknown status; it does not apply the schema or
694
+ retry the job. Inspect the printed run ID and disposable-branch cleanup before
695
+ starting another rehearsal.
696
+
523
697
  > **Preview:** ORM v2 is a Preview workflow. The generated namespace package
524
698
  > depends on `@sequenceholdings/orm@^2.0.0`; use the matching published major
525
699
  > version and keep generated manifests and migrations committed with source.
526
700
 
701
+ ### Registered SQL operations in development builds
702
+
703
+ Development builds containing SQL operation support also discover exported
704
+ `defineOperation({ language: 'sql', kind: 'query', ... })` definitions under
705
+ `operations/**/*.ts`, or equivalent `*.operation.json` files. Import the
706
+ authoring helper from `@sequenceholdings/orm/authoring`. This addition is not yet
707
+ available in the published package versions listed above.
708
+
709
+ For runtime SQL, declare `mode: 'runtime'`, namespace, operation capability,
710
+ `ontology.read` object references, and `maxRows`. Register this contract once;
711
+ execute it with `{ sql, parameters: { name: { type: 'text', value: '...' } } }`
712
+ as the operation variables. Different projections, joins, and unions use the same
713
+ operation hash. Each query is compiled against the declared objects and checked
714
+ against current caller permissions. A cached plan never caches authorization or
715
+ parameter values. Runtime contracts require matching IR v5 compiler/runtime builds.
716
+
717
+ Fixed SQL remains supported: omit `mode`, declare `parameters` and `sql` in the
718
+ definition, and supply only parameter values at runtime. Bind values with
719
+ `:parameterName`; quote camelCase properties. `orm generate` emits
720
+ `sql-operations.gen.ts` with typed operation handles and
721
+ `namespace.contract.json` for cross-namespace composition, in addition to the
722
+ shared manifest. `orm apply` and `orm execute` use the same lifecycle as GraphQL.
723
+
724
+ SQL reads currently support inner/left/right/full joins with `ON`, cross joins,
725
+ `UNION`/`UNION ALL`, correlated EXISTS, non-recursive CTEs,
726
+ grouping, supported aggregates, ordering, and limits. Unsupported SQL and
727
+ unsupported policies fail compilation. Results use column metadata plus row
728
+ arrays, with bigint and numeric values represented as strings. SQL writes,
729
+ DDL, `INTERSECT`/`EXCEPT`, window functions, `NATURAL`/`USING`/lateral joins,
730
+ implicit source refresh, and cross-database joins are not
731
+ supported. Materialized policy scans prioritize isolation; benchmark large
732
+ datasets before adopting this path for latency-sensitive reads.
733
+
527
734
  ## Process commands
528
735
 
529
736
  | Command | What it does |
@@ -896,10 +1103,42 @@ the deployed `tables` declaration before requesting broader user grants.
896
1103
 
897
1104
  | Command | What it does |
898
1105
  |---------|--------------|
899
- | `seq-studio secrets create <NAME> -e <env> [--org <slug>]` | Register an org-owned secret (no value) |
900
- | `seq-studio secrets set <NAME> -e <env> [--org <slug>] [--from-file <path>]` | Set the shared default (write-only; file is not echoed) |
1106
+ | `seq-studio secrets create <NAME> -e <env> [--type key-value\|single] [--org <slug>]` | Register an org-owned secret with an immutable type (CLI defaults to `single` for existing scripts) |
1107
+ | `seq-studio secrets set <NAME> -e <env> [--org <slug>] [--from-file <path>\|--from-json <path>]` | Set one value or a complete key/value set (write-only; file is not echoed) |
901
1108
  | `seq-studio secrets list -e <env>` | Secrets you can see (never values) |
902
1109
 
1110
+ For a grouped credential, create a key/value set and write its complete value from a JSON file:
1111
+
1112
+ ```bash
1113
+ seq-studio secrets create CANDESCENT -e staging --type key-value
1114
+ seq-studio secrets set CANDESCENT -e staging --from-json ../private/candescent-secrets.json
1115
+ seq-studio functions deploy -e staging
1116
+ ```
1117
+
1118
+ The function's `managed-function.yml` names the set and maps its entries into the environment variables the code reads:
1119
+
1120
+ ```yaml
1121
+ secrets:
1122
+ - secret: CANDESCENT
1123
+ entries:
1124
+ BASE_URL: CANDESCENT_BASE_URL
1125
+ INSTITUTION_ID: CANDESCENT_INSTITUTION_ID
1126
+ PRIVATE_KEY: CANDESCENT_PRIVATE_KEY
1127
+ PUBLIC_KEY: CANDESCENT_PUBLIC_KEY
1128
+ ```
1129
+
1130
+ For a single-value secret, `secrets: [API_KEY]` still supplies the secret named `API_KEY` as `process.env.API_KEY`. Deployment resolves manifest bindings automatically; no separate function attachment command is required.
1131
+
1132
+ If using `seq-studio secrets attach <NAME> --fn <slug>`, the function's active manifest must already declare that same secret source and exact environment variable mapping. An attachment cannot override a different manifest secret; update `managed-function.yml` and redeploy to change the source or mapping.
1133
+
1134
+ The JSON file contains an object of uppercase entry names and string values. Keep it outside git **and outside the function directory**, since function files are uploaded during deployment. A set is one version and one permission grant; changing any entry writes a new complete version. Redeploy functions tracking the default to apply it. Function code reads the mapped `process.env` names as before. Missing entries and undeclared environment variables fail deployment.
1135
+
1136
+ To change only selected entries without reading or re-entering the others, put the changes in a JSON file and run `seq-studio secrets set CANDESCENT -e staging --from-json ./changes.json --merge`. Use `null` for an entry to remove it. The CLI checks the active version before writing and asks you to retry if another edit won the race.
1137
+
1138
+ Pipeline stages can select one entry from a set for each symbolic credential: `seq-studio secrets attach CANDESCENT --stage my-stage -e staging --credential api_key --entry PRIVATE_KEY`. The selected entry is copied at plan/deploy into that stage's credential scope. Artifact Studio applications currently require a single-value secret.
1139
+
1140
+ Existing single-value secrets keep their type. To consolidate them, create a new set, provide or rotate the entry values, update each consumer's manifest mapping, redeploy, verify the consumer, then retire the old secrets. The CLI and UI cannot read back existing secret values, so an agent needs the values from an authorized source or must rotate them during consolidation.
1141
+
903
1142
  `--org` targets a managed-scope org other than the login tenant and selects
904
1143
  the intended same-named secret for `set`, `attach`, `detach`, `versions`,
905
1144
  `set-default`, and `pin`; it is required when the name exists in multiple
@@ -927,25 +1166,33 @@ successfully. Help does not initialize files, authenticate, or deploy.
927
1166
  | `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) |
928
1167
  | `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. |
929
1168
  | `seq-studio artifact pull <project-id> -e <env> [--out <dir>]` | `pull <project-id> --env <env> [--out <dir>]` |
930
- | `seq-studio artifact list -e <env>` | `list --env <env>` — projects visible on the environment (slug, id, active version, visibility) |
931
- | `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 |
1169
+ | `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 |
1170
+ | `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 |
1171
+
932
1172
  | `seq-studio artifact promote <deployment-id> -e <env>` | `promote <deployment-id> --env <env>` |
933
1173
  | `seq-studio artifact rollback <deployment-id> -e <env>` | `rollback <deployment-id> --env <env>` |
934
1174
 
1175
+ Artifact commands reject unknown options before authentication or network
1176
+ access, so a misspelled flag cannot be silently ignored. `seq-studio artifact
1177
+ deploy` also refuses source that still points at another environment's API
1178
+ origin or workspace UUID. Declare each environment's API origin under
1179
+ `targets.<environment>.url`. A workspace UUID in source must exist in the
1180
+ environment selected by `-e`.
1181
+
935
1182
  `pull` writes the **active deployment's** source files (default out dir:
936
1183
  `./<project-id>`) and errors when the project has no active deployment.
937
1184
  `promote` and `rollback` resolve the target project from the current
938
1185
  directory's `.artifact-studio/config.json` — run them from the linked artifact
939
1186
  folder (or run `seq-studio artifact link` first).
940
1187
 
941
- **React/HTML active (official) deploys to deployed environments require `main` with a
942
- resolved git commit and a clean artifact source directory** for both Git
943
- Service (`--repo`) and local sources. When a local source is nested in a larger
944
- checkout, dirty files outside that source directory are ignored with a warning.
945
- Deployments targeting `local` may use any branch, including dirty working
946
- trees. Feature branches, dirty artifact source trees, non-git sources, and
947
- detached checkouts that cannot be attributed to `main` are preview-only for
948
- deployed environments
1188
+ **React/HTML active (official) deploys to deployed environments require `main`,
1189
+ or `staging` when the target is a staging environment, with a resolved git
1190
+ commit and a clean artifact source directory** for both Git Service (`--repo`)
1191
+ and local sources. When a local source is nested in a larger checkout, dirty
1192
+ files outside that source directory are ignored with a warning. Deployments
1193
+ targeting `local` may use any branch, including dirty working trees. Feature
1194
+ branches, dirty artifact source trees, non-git sources, and detached checkouts
1195
+ that cannot be attributed to an allowed branch are preview-only for deployed environments
949
1196
  (`seq-studio artifact dev` / preview channel); promotion applies the same
950
1197
  provenance check.
951
1198
 
@@ -1073,10 +1320,17 @@ Git Service verification required for an official release:
1073
1320
  | `--repo <ns>/<name>` | a repo in the platform Git Service, e.g. `--repo artifacts/accounts` |
1074
1321
  | `--git-url <url>` | a public, credential-free HTTPS git URL (cloned to a temp dir) |
1075
1322
 
1323
+ `--path <dir>` selects the application directory inside a `--repo` / `--git-url`
1324
+ repository (default: its root), for example `--repo apps/loan-tools --path artifacts/admin`.
1325
+ A Next.js release from a Git Service repository records that directory with the
1326
+ commit. A local `[dir]` nested in a Git Service checkout is sent the same way,
1327
+ relative to the checkout root.
1328
+
1076
1329
  For React/HTML, `--ref <branch\|tag\|commit>` selects the revision for `build` and `plan`
1077
1330
  (default: the repo's default branch). Active deploys to deployed environments
1078
- require `main`; local active deploys scope dirty-file checks to the source
1079
- directory and warn about unrelated changes elsewhere in the checkout.
1331
+ require `main`, or `staging` when the target is a staging environment; local
1332
+ active deploys scope dirty-file checks to the source directory and warn about
1333
+ unrelated changes elsewhere in the checkout.
1080
1334
  `--env local` accepts any local source ref. Other refs are preview-only for
1081
1335
  deployed environments. A remote source is materialized to a
1082
1336
  temp dir, built, and torn down;
@@ -1148,6 +1402,19 @@ The raw token is printed **once** on create.
1148
1402
 
1149
1403
  ## Repos commands
1150
1404
 
1405
+ `repos create` creates the hosted repository; it does not configure Git in your
1406
+ current folder. For a new local checkout, use `repos clone` with `ATLAS_GIT_PAT`
1407
+ and `--full` to get `origin`, branch tracking, and complete history for your
1408
+ editor's Git graph. For an existing folder, discover the clone URL with
1409
+ `repos show`, inspect `git remote -v`, and add a missing `origin` with
1410
+ `git remote add origin <clone-url>`, then `git fetch origin`. Fetching does not
1411
+ set an upstream: inspect the local and remote histories before using
1412
+ `git branch --set-upstream-to=origin/<remote-branch> <local-branch>`.
1413
+ See [Connect an existing folder](https://docs.seqholdings.com/seq-studio/repositories#connect-an-existing-folder)
1414
+ for handling folders with no commits or separate local history. Verify with
1415
+ `git branch -vv` and `git status --short --branch`. Plain Git needs its own
1416
+ credential-manager or PAT prompt setup; it does not read `ATLAS_GIT_PAT`.
1417
+
1151
1418
  `seq-studio repos <sub>` manages repos in the platform Git Service over the
1152
1419
  JSON API — the same repos `--repo <ns>/<name>` sources build from.
1153
1420
 
@@ -1157,7 +1424,7 @@ JSON API — the same repos `--repo <ns>/<name>` sources build from.
1157
1424
  | `seq-studio repos namespaces [create <slug>] -e <env>` | list namespaces, or create one (creator becomes owner) |
1158
1425
  | `seq-studio repos show <ns>/<name> -e <env>` | detail: id, branches, clone URL; artifact project id when slug matches |
1159
1426
  | `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. |
1160
- | `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`. |
1427
+ | `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`. |
1161
1428
  | `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` |
1162
1429
  | `seq-studio repos delete <ns>/<name> -e <env> [--yes]` | delete a repo — interactive confirm unless `--yes` |
1163
1430
  | `seq-studio repos ci show <ns>/<name> -e <env> [--ref <r>]` | preview CI checks discovered from the ref |
@@ -1202,6 +1469,18 @@ Validation logic lives in
1202
1469
  install it alongside the CLI for local spec authoring and validation. The
1203
1470
  discovery and data-reading commands below do not require the optional SDK.
1204
1471
 
1472
+ Pipeline packages discover `*.stage.yml` and `*.stage.yaml` files from their
1473
+ root by default. To place stage specs in specific subdirectories, add a
1474
+ `pipeline.config.yml` at the package root with `schema_version: 1` and an
1475
+ explicit `stage_directories` list, for example `config/stages`. Paths are
1476
+ relative to the package root; absolute paths, traversal, duplicates, and
1477
+ symlinks escaping the package are rejected. `documentation/` and `migrations/`
1478
+ are reserved metadata roots and cannot contain stage directories. Only listed
1479
+ directories are scanned. Stage `entrypoint` paths and `src/` resources remain
1480
+ relative to the package root. Validation, planning, deployment, migrations,
1481
+ and ORM repinning share the same loader. `pipeline init` scaffolds into the
1482
+ first listed stage directory; without config it keeps using the package root.
1483
+
1205
1484
  | Command | What it does |
1206
1485
  |---------|--------------|
1207
1486
  | `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 |
@@ -1211,24 +1490,168 @@ discovery and data-reading commands below do not require the optional SDK.
1211
1490
  | `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 |
1212
1491
  | `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 |
1213
1492
  | `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 |
1214
- | `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 |
1493
+ | `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 |
1494
+ | `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 |
1215
1495
  | `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 |
1216
1496
  | `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 |
1217
1497
  | `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 |
1218
- | `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. |
1498
+ | `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. |
1219
1499
 
1220
1500
  `--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.
1501
+
1502
+ `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.
1221
1503
  | `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 |
1222
1504
  | `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. |
1223
1505
  | `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) |
1224
1506
  | `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 |
1225
- | `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 |
1226
- | `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`. |
1507
+ | `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 |
1508
+ | `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`. |
1227
1509
 
1228
1510
  `-e/--env` selects the Atlas connection. `--target` selects the logical
1229
1511
  pipeline target advertised by that endpoint. It is optional when the alias
1230
1512
  matches a target id or when the endpoint has exactly one target.
1231
1513
 
1514
+ If Git authentication fails for a named repository, inspect its source with
1515
+ `seq-studio repos clone pipelines/<name> -e <env> --transport json --output ./source`.
1516
+ This explicitly uses your Atlas session and creates no `.git` directory. It is
1517
+ suitable for source inspection; obtain a Git checkout with a PAT valid for that
1518
+ environment when you need to push commits. URL/id-only clones require Git
1519
+ transport and a PAT. Avoid issuing more PATs without diagnosing the rejection.
1520
+
1521
+ ### Run a repository through the managed pipeline workflow
1522
+
1523
+ Start with `seq-studio doctor --offline --json` and `seq-studio capabilities --json`
1524
+ to check the executable version, resolved SDK paths, cached environment, and
1525
+ available commands. If installed commands differ from the guide, update the CLI
1526
+ and SDK packages before retrying. `doctor -e <env>` checks the selected connection
1527
+ and authentication without opening a browser. A cache permission error needs a
1528
+ filesystem fix; an expired session needs login. Complete one login before retrying.
1529
+
1530
+ Edit and commit locally, then push to the selected environment's git service.
1531
+ For targets that allow local-checkout publishing, the CLI can publish and deploy:
1532
+
1533
+ ```bash
1534
+ seq-studio pipeline deploy --dir . --repo pipelines/<name> -e <env> --run-now --json > deployment.json
1535
+ ```
1536
+
1537
+ Otherwise deploy the pushed commit with `--repo pipelines/<name> --ref <commit>`.
1538
+ `--run-now` uses the managed worker to run in-unit producers in dependency order.
1539
+ Closing the local client stops polling; the remote work continues. Retain the
1540
+ returned deployment id and inspect it with `pipeline status --deployment-id <id>`.
1541
+ Deployment, serving provisioning, registry activation, and ORM readiness are
1542
+ separate phases; a failure after bundle deployment can leave native resources
1543
+ updated. Follow the returned remediation and check the serving/ORM read path.
1544
+
1545
+ For `plan`, `deploy`, `promote`, and `rollback`, `--json` writes one result to
1546
+ stdout and progress to stderr. A waited deployment returns its terminal detail,
1547
+ including failure detail with exit code 1. `--no-wait --json` returns the enqueue
1548
+ receipt. Keep stderr visible when redirecting or piping stdout.
1549
+
1550
+ ```bash
1551
+ seq-studio pipeline plan --repo pipelines/<name> --ref <commit> -e <env> --json > plan.json
1552
+ seq-studio pipeline plan --plan-request-id <id> -e <env> --json > plan.json
1553
+ ```
1554
+
1555
+ The second command reads the original durable plan; it does not enqueue another
1556
+ plan or attach credentials. Use it after a local poll/output failure, with the
1557
+ request id printed on stderr. Do not combine it with source, target, migration,
1558
+ or provisioning options. Completing a read of the plan does not deploy it.
1559
+
1560
+ ### Declared external source schema checks
1561
+
1562
+ Transformation stages can opt into `source_contracts` in their stage spec (see
1563
+ `@sequenceholdings/pipeline-spec`). `pipeline validate` validates these declarations
1564
+ offline. `pipeline plan` checks the selected native column names/types against
1565
+ Unity Catalog metadata in the destination environment and includes all discovered
1566
+ mismatches in its provisioning findings. Missing tables, required columns,
1567
+ incompatible types, or unavailable metadata block the enrolled deployment; added
1568
+ unused columns are compatible.
1569
+
1570
+ Managed deployment pins the reviewed declarations and repeats the schema check
1571
+ before provisioning, before bundle deployment, and before producers requested by
1572
+ `deploy --run-now`. A plan created without the declaration fingerprint must be
1573
+ recreated before deploying stages with source contracts. Stages without source
1574
+ contracts keep their existing behavior and have no new source verification claim.
1575
+
1576
+ Execution rechecks persist source-preflight receipts with target, revision,
1577
+ contract fingerprint, phase, time, and structured findings. This includes early
1578
+ manual-run refusals without creating an invocation. `pipeline status
1579
+ --deployment-id <id> -e <env> --json` returns the latest 50 observations for that
1580
+ deployment in `sourcePreflightChecks`; the reviewed plan keeps plan-time findings.
1581
+ Receipt storage failure blocks the affected deployment or native submission.
1582
+
1583
+ These checks prove metadata compatibility only. They do not prove SELECT access
1584
+ as the job identity, row/key validity, or that arbitrary Python reads only declared
1585
+ sources. Standalone `pipeline run-now` rechecks the active stage before invocation
1586
+ creation and immediately before native submission. These manual checks cover
1587
+ that stage only; downstream trigger tails, native scheduled runs, and unmanaged
1588
+ Databricks execution still need runtime enforcement. Checks do not freeze source data or
1589
+ prevent schemas changing after observation.
1590
+
1591
+ ### Generic serving installation lifecycle (draft)
1592
+
1593
+ This lifecycle has unit/PGlite coverage; it has not been exercised against a
1594
+ live installation as part of this change. Backing/dependent-view access checks
1595
+ cover captured dependencies, ORM ownership, explicit grants, and runtime role
1596
+ membership. A physical column/type/key audit is separate future hardening.
1597
+ Generic producer outputs and ORM source references accept safe lowercase
1598
+ `schema.table` identifiers, with each component limited to 63 characters.
1599
+ Syntax does not prove existence or authorize a relation: enrollment is limited
1600
+ to an active same-repo transformation producer and pins the exact declared
1601
+ output plus resolved physical relation. External/cross-repo sources are not
1602
+ supported. Legacy serving declarations and existing installations are
1603
+ unchanged.
1604
+
1605
+ Generic `serving` stages require an explicitly registered destination and an
1606
+ enrollment that pins both the serving version and its active producer. This is
1607
+ an operator-mediated handoff, not destination provisioning: registration
1608
+ inspects an existing UC catalog/schema and Lakebase schema, and fails closed if
1609
+ their identity or owner-only access checks do not match. It does not create a
1610
+ schema, change ACLs, accept connection details, or grant public access. Only a
1611
+ Sequence platform operator can register/revoke installations or enroll serving
1612
+ versions; ordinary Pipeline editor access and ORM namespace-admin access are
1613
+ also checked where applicable. The `reviewRef` is audit metadata, not proof of
1614
+ permission.
1615
+
1616
+ The intended bootstrap sequence is:
1617
+
1618
+ 1. As a Sequence platform operator, register the already-existing private
1619
+ destination with `POST /api/data-pipelines/serving-installations`, supplying
1620
+ only `environment`, `catalog`, `schema`, and `reviewRef`. Save the returned
1621
+ server-minted `key`; do not choose the key yourself.
1622
+ 2. With that installation key, register the serving stage shell and immutable
1623
+ serving version using the stage and stage-version APIs. Its transformation
1624
+ producer must already have an active deployment in the same repo and
1625
+ environment. Register the immutable ORM candidate without activating it;
1626
+ candidate registration does not require the serving backing to exist.
1627
+ 3. Enroll the immutable serving stage version with
1628
+ `POST /api/data-pipelines/serving-installations/<key>/enrollments`, supplying
1629
+ `servingRepo`, `servingStage`, `sourceCommit`, and `reviewRef`. For
1630
+ `orm_only` or `both` exposure, also supply the explicit immutable
1631
+ `ormVersionId`; dataset-only enrollment must omit it. The server resolves
1632
+ and verifies source deployments, candidate table contracts, and serving
1633
+ pins. An unchanged retry is idempotent.
1634
+ 4. Use the normal `pipeline plan` and reviewed deploy flow.
1635
+ Initial private creation retains acknowledgement
1636
+ and pending checks. Materialized resources must pass adoption verification
1637
+ before an active binding is advertised. Do not bypass the acknowledgement
1638
+ gate by switching exposure or directly writing registry rows.
1639
+
1640
+ To intentionally enroll a new serving version, use `PUT` on the same
1641
+ `/<key>/enrollments` path. Include the POST fields plus the
1642
+ `expectedPreviousSpecHash`, `expectedPreviousContractHash`,
1643
+ `expectedPreviousSourceSpecHash`, `expectedPreviousSourceContractHash`, and
1644
+ `expectedPreviousOrmVersionId` (UUID or `null`) returned by the prior
1645
+ enrollment. These compare-and-swap pins prevent a stale update from replacing
1646
+ a concurrent source or ORM-candidate repin. A revoked/expired enrollment cannot
1647
+ be reactivated by PUT; revoke an installation with
1648
+ `DELETE /api/data-pipelines/serving-installations?key=<key>` when retiring it.
1649
+ After changing the serving declaration or enrollment, re-plan before deploying.
1650
+
1651
+ Manual refresh uses the existing `pipeline run-now --stage <slug> -e <env>`
1652
+ flow. Refresh execution rechecks the active installation/enrollment and source
1653
+ pins. A revoked, expired, changed, or unmaterialized binding fails closed.
1654
+
1232
1655
  ### Discover inputs before authoring
1233
1656
 
1234
1657
  For both people and agents, search deployed documentation to find likely inputs,
@@ -1456,6 +1879,30 @@ For local Atlas development, `-e local` uses the server's isolated `dev`
1456
1879
  deployment target. Plan, deploy, and `run-now` therefore operate on the same
1457
1880
  personal dev Databricks catalog and Lakebase branch configured for local Atlas.
1458
1881
 
1882
+ ## Ontology consumer contracts
1883
+
1884
+ Artifact Studio manifests, `managed-function.yml`, and Pipeline `*.stage.yml`
1885
+ specs may opt into an explicit ontology dependency declaration:
1886
+
1887
+ ```yaml
1888
+ ontology:
1889
+ version: 1
1890
+ read: [lending/loans]
1891
+ write: [lending/loan_summary]
1892
+ invoke: [refresh-loan-index]
1893
+ ```
1894
+
1895
+ Object references are exact `namespace/object` names, without wildcards;
1896
+ function references are slugs. `produce` uses the same object-reference form
1897
+ but is valid only in Pipeline stage specs. The block is optional, so omitting
1898
+ it preserves legacy behavior. When present, deployment checks declared
1899
+ objects against active ORM definitions and functions against the registered
1900
+ functions; unresolved declarations fail deployment, including previews.
1901
+
1902
+ This records explicit consumer intent. It does not replace capabilities or
1903
+ permissions, and this release does not enforce declarations on runtime ORM
1904
+ requests.
1905
+
1459
1906
  ## Authorization
1460
1907
 
1461
1908
  The CLI carries no permissions of its own: every request is authorized
@@ -1480,6 +1927,9 @@ Opt in with `cache: { enabled: true }` in `managed-function.yml` for a dedicated
1480
1927
  `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.
1481
1928
  ## Blob storage / Workspaces V2
1482
1929
 
1930
+ Workspaces V2 is file storage, separate from Chat Workspaces. It has no content
1931
+ search yet, and agent `file_search` cannot read it.
1932
+
1483
1933
  The initial storage package and CLI additions are pending publication and public
1484
1934
  contract review. With a CLI build containing this feature, use the normal Atlas
1485
1935
  environment and credentials:
@@ -1489,6 +1939,7 @@ seq-studio storage init application-documents
1489
1939
  seq-studio storage validate workspace.yml
1490
1940
  seq-studio storage apply workspace.yml -e local
1491
1941
  seq-studio storage upload ./report.pdf --workspace <id> --path reports/report.pdf -e local
1942
+ seq-studio storage import ./exports --workspace <id> --path imported --yes -e local
1492
1943
  seq-studio storage list --workspace <id> -e local
1493
1944
  seq-studio storage download --workspace <id> --node <file-id> --out ./copy.pdf -e local
1494
1945
  ```
@@ -1508,6 +1959,18 @@ replaces content with optimistic concurrency; it preserves prior immutable versi
1508
1959
  Ctrl-C stops transfer without throwing away the resumable session. `storage abort`
1509
1960
  explicitly cancels it. Do not log session URLs or signed downloads.
1510
1961
 
1962
+ `storage import <directory|gs://bucket/prefix>` copies many objects into one
1963
+ workspace. It always prints where it will write (Atlas URL, environment, gcloud
1964
+ identity, source, workspace, and the pending-upload caps) and does nothing else
1965
+ until `--yes`. A GCS source uses your gcloud credentials to read objects; the CLI
1966
+ uploads those bytes with the sessions Atlas reserves in batches of 20. Applying a
1967
+ workspace does not cut an application over from its old bucket. Point the
1968
+ application at the workspace id after the import, and keep or delete the old
1969
+ bucket separately. `storage uploads` lists your unfinished sessions, and
1970
+ `storage reconcile --abort-incomplete` releases ones whose bytes never arrived.
1971
+ Re-run the same import to resume; progress defaults to
1972
+ `storage-import-progress.json`.
1973
+
1511
1974
  `storage trash` and `restore` are reversible. `purge --yes` and workspace
1512
1975
  `delete --yes` return durable Temporal receipts; inspect `storage operations` and
1513
1976
  use `--retry <operation-id>` after correcting a failed cleanup. Each destructive
@@ -1517,3 +1980,78 @@ For local full-stack integration, use `artifact dev`, `functions deploy`, `orm a
1517
1980
  and `storage apply` against the same `-e local` (or `local:<worktree>`). Storage uses
1518
1981
  the normal local Atlas authorization and lifecycle, with a dedicated development
1519
1982
  GCS bucket. The standalone `functions dev` harness does not mint storage delegation.
1983
+
1984
+
1985
+ ## Composed applications (0.3.0)
1986
+
1987
+ The public builder path combines standalone Artifacts, ORM namespaces, and Managed
1988
+ Functions in a platform repository. Use the environment's `/docs/getting-started/builder-handoff`
1989
+ and `/docs/examples/persisted-application` for the full source example and grant order.
1990
+ The matching package set is Artifact Studio 0.4.0, ORM 2.1.1, and Managed Functions
1991
+ 0.2.0. Confirm registry publication before a clean installation; local builds of
1992
+ unreleased packages do not prove a public-registry workflow.
1993
+
1994
+ - `createArtifactOrmExecutor({namespace, manifest})` from the Artifact SDK root
1995
+ uses the host-authenticated bridge. Declare only the exact namespace API write
1996
+ scope, even for persisted queries. No browser token extraction is required.
1997
+ - `createFunctionOrmExecutor({request, baseUrl, namespace, manifest})` from
1998
+ `@sequenceholdings/managed-functions/orm` uses invocation-scoped human caller
1999
+ authority. Construct it inside the handler, supply the trusted configured
2000
+ environment origin, and declare a service-account binding and data scopes.
2001
+ It does not choose service mode or authenticate arbitrary public HTTP ingress.
2002
+ - `createFunctionServiceOrmExecutor({request, baseUrl, namespace, manifest})`
2003
+ from the same module acts as the function's attached service account. Use it
2004
+ for a Lattice step or another invocation with no human caller; declare data
2005
+ scopes and enforce any per-user rule in the handler.
2006
+ - The shared execution dependency contains no ORM authoring/compiler dependencies.
2007
+ Keep namespace generation in the development package, outside the Function runtime.
2008
+
2009
+ ### Verify identity and provision bindings
2010
+
2011
+ ```bash
2012
+ seq-studio auth whoami -e <env> --json
2013
+ seq-studio service-accounts list -e <env>
2014
+ seq-studio service-accounts create task-runtime --display-name "Task runtime" -e <env>
2015
+ seq-studio service-accounts show <account-id> -e <env>
2016
+ ```
2017
+
2018
+ `whoami` reports the server-verified subject/email and environment, never credentials.
2019
+ Account creation requires existing administrator authority and issues no credentials.
2020
+ Provide the account ID/slug and act-as permission to the deployer. All new commands
2021
+ require an explicit environment; help is offline, including `doctor --help`.
2022
+
2023
+ ### Runtime access
2024
+
2025
+ ```bash
2026
+ seq-studio access definitions orm <namespace> -e <env>
2027
+ seq-studio access resolve orm <namespace> -e <env>
2028
+ seq-studio access list orm <namespace> --floor -e <env>
2029
+ seq-studio access grant orm <namespace> --floor --principal-type user --principal-id <subject> -e <env>
2030
+ seq-studio access grant orm <namespace> --key <role> --principal-type user --principal-id <subject> -e <env>
2031
+ seq-studio access revoke orm <namespace> --key <role> --principal-type user --principal-id <subject> -e <env>
2032
+ ```
2033
+
2034
+ Resource types are `artifact`, `function`, and `orm`; their IDs are project UUID,
2035
+ Function UUID, and namespace name respectively. The runtime floor means `end_user`
2036
+ for Artifact/ORM and `invoker` for Function. `list` defaults to direct role/capability
2037
+ grants; `resolve` evaluates only the signed-in caller. Grant/revoke require existing
2038
+ grant-management authority. Roles and pins do not assign users; `capabilities.uses`
2039
+ must declare every capability consumed. Fresh previews do not register new role keys;
2040
+ activate a release before granting them. Authoring/collaborator permissions remain separate.
2041
+
2042
+ ### Repository Pulls
2043
+
2044
+ ```bash
2045
+ seq-studio repos pulls create <namespace/name> --head <branch> --base main --title "Build task app" --body-file review.md -e <env>
2046
+ seq-studio repos pulls list <namespace/name> --state open -e <env>
2047
+ seq-studio repos pulls show <namespace/name> <number> -e <env>
2048
+ seq-studio repos pulls diff <namespace/name> <number> -e <env>
2049
+ seq-studio repos pulls merge <namespace/name> <number> --method squash -e <env>
2050
+ ```
2051
+
2052
+ All results are JSON (`--json` is accepted). Listing returns one page and `nextCursor`;
2053
+ use `--cursor` to continue. Diff accepts `--max-files` (maximum 500) and reports truncation.
2054
+ Merge requires merge/admin authority, confirmation (or approved automation's `--yes`),
2055
+ and the existing server review/check policy. It merges the current branch head; a
2056
+ displayed SHA is not a head-lock or policy bypass. Complete reviews before merging.
2057
+ `repos pull` remains the singular source-snapshot command.