@sequenceholdings/studio-cli 0.1.30 → 0.1.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +225 -16
- package/dist/atlas-client.d.ts +16 -0
- package/dist/atlas-client.js +26 -0
- package/dist/functions/bundle.js +4 -2
- package/dist/functions/commands.d.ts +12 -2
- package/dist/functions/commands.js +176 -14
- package/dist/functions/dev.d.ts +3 -0
- package/dist/functions/dev.js +97 -0
- package/dist/functions/egress-preview.d.ts +2 -1
- package/dist/functions/egress-preview.js +3 -2
- package/dist/functions/manifest.d.ts +18 -1
- package/dist/functions/manifest.js +19 -29
- package/dist/main.js +6 -1
- package/dist/pipeline/commands.js +16 -10
- package/dist/pipeline/lifecycle.d.ts +1 -0
- package/dist/pipeline/lifecycle.js +105 -28
- package/dist/pipeline/migrations.js +6 -1
- package/dist/pipeline/stage-secrets.d.ts +95 -0
- package/dist/pipeline/stage-secrets.js +166 -0
- package/dist/pipeline/templates.d.ts +1 -1
- package/dist/pipeline/templates.js +37 -3
- package/dist/process/build.js +1 -0
- package/dist/process/codegen.js +1 -0
- package/dist/process/lint.js +12 -7
- package/dist/process/plan-diff.js +1 -0
- package/dist/process/safety-baseline.d.ts +3 -3
- package/dist/process/safety-baseline.js +4 -5
- package/dist/process/simulate.js +7 -2
- package/dist/repos/commands.d.ts +1 -1
- package/dist/repos/commands.js +15 -7
- package/dist/secrets/commands.d.ts +1 -1
- package/dist/secrets/commands.js +73 -3
- package/dist/storage/commands.d.ts +2 -0
- package/dist/storage/commands.js +215 -0
- package/dist/templates/process/pnpm-workspace.yaml +2 -0
- package/package.json +9 -7
- package/templates/process/pnpm-workspace.yaml +2 -0
package/README.md
CHANGED
|
@@ -376,7 +376,7 @@ compiled to canonical SQL before registration.
|
|
|
376
376
|
Install the CLI and ORM package together:
|
|
377
377
|
|
|
378
378
|
```bash
|
|
379
|
-
pnpm add -g @sequenceholdings/studio-cli@0.1.
|
|
379
|
+
pnpm add -g @sequenceholdings/studio-cli@0.1.35 @sequenceholdings/orm@2.1.0
|
|
380
380
|
```
|
|
381
381
|
|
|
382
382
|
The everyday loop is:
|
|
@@ -441,13 +441,14 @@ and returns an ISO-8601 string.
|
|
|
441
441
|
| parallel `fan_out` | Context snapshot | — | Branch-item array |
|
|
442
442
|
| parallel `join` | Context snapshot | `$branches` | Node output |
|
|
443
443
|
| subprocess `output` | Context snapshot | `$child` | Node output |
|
|
444
|
+
| managed-function `output` | Context snapshot | `$response` | Node output |
|
|
444
445
|
| node or supervisor retry predicate | `{ name, message }` | — | `true` to retry |
|
|
445
446
|
|
|
446
447
|
`process lint` parse-checks all of these slots. `process simulate` evaluates
|
|
447
448
|
the data-flow slots used by its topology walk (`input`, `fan_out`, `join`, and
|
|
448
449
|
subprocess `output`). It intentionally keeps runners stubbed and therefore
|
|
449
|
-
does not
|
|
450
|
-
behavior.
|
|
450
|
+
does not evaluate managed-function output mappers, send email, or execute
|
|
451
|
+
due-date, ACL, artifact-reference, or retry behavior.
|
|
451
452
|
|
|
452
453
|
### Remote source for `apply`
|
|
453
454
|
|
|
@@ -502,10 +503,13 @@ seq-studio process lint --dir my-processes --offline # finds both processes
|
|
|
502
503
|
| Command | What it does |
|
|
503
504
|
|---------|--------------|
|
|
504
505
|
| `seq-studio functions init <dir>` | Scaffold one standalone TypeScript managed function |
|
|
506
|
+
| `seq-studio functions dev [--dir <dir>] [--port <port>]` | Run a local HTTP server with Managed Function cache context |
|
|
505
507
|
| `seq-studio functions build [--dir <dir>]` | Validate a local manifest, bundle, lockfile, and size |
|
|
506
508
|
| `seq-studio functions deploy --dir <dir> -e <env>` | Preview secrets and deploy a local function |
|
|
507
509
|
| `seq-studio functions build --repo managed-functions/<name> [--path <dir>] -e <env>` | Materialize and validate a function from the platform Git Service |
|
|
508
510
|
| `seq-studio functions deploy --repo managed-functions/<name> [--path <dir>] -e <env>` | Materialize and deploy a function from the platform Git Service |
|
|
511
|
+
| `seq-studio functions limits [-e <env>] [--json] [--fn <slug>]` | Inspect fleet, runtime, cache, and bundle defaults/caps; optionally inspect one function's effective runtime limits |
|
|
512
|
+
| `seq-studio functions invoke --fn <slug> -e <env> [--data <json> \| --data @<file> \| --stdin]` | Invoke a deployed function and print its response body |
|
|
509
513
|
|
|
510
514
|
A normal function repo keeps `managed-function.yml` at its root and omits
|
|
511
515
|
`--path`. A repo may also contain related, independently deployed functions:
|
|
@@ -538,20 +542,135 @@ same repo share Git review and commit provenance, but keep separate manifests,
|
|
|
538
542
|
versions, runtime resources, secrets, and permissions. `--path` accepts only a
|
|
539
543
|
canonical relative directory inside a remote repo; use `--dir` for local source.
|
|
540
544
|
|
|
545
|
+
### Deploying to local Atlas
|
|
546
|
+
|
|
547
|
+
Start local Atlas, then use the same deployment workflow:
|
|
548
|
+
|
|
549
|
+
```bash
|
|
550
|
+
seq-studio functions deploy --dir ./my-function -e local
|
|
551
|
+
seq-studio functions invoke --dir ./my-function -e local --data '{"name":"Atlas"}'
|
|
552
|
+
seq-studio functions logs --dir ./my-function -e local
|
|
553
|
+
seq-studio functions delete --dir ./my-function -e local --yes
|
|
554
|
+
```
|
|
555
|
+
|
|
556
|
+
For a worktree, replace `local` with its environment from `seq-studio envs list`
|
|
557
|
+
(for example `local:my-worktree`). Local Atlas builds the uploaded source and
|
|
558
|
+
runs Google's Functions Framework in a supervised local Node process. It needs
|
|
559
|
+
neither GCP provisioning credentials nor a Trigger/Temporal worker for these
|
|
560
|
+
functions. Registry access is still required to install dependencies.
|
|
561
|
+
|
|
562
|
+
Create, deploy, promote, rollback, invoke, and delete use the normal Atlas
|
|
563
|
+
permissions. Redeploy starts a new process before switching the active runtime;
|
|
564
|
+
a failed replacement keeps the previous runtime. Deletion stops the process,
|
|
565
|
+
releases its port, and removes the function's local source/build/runtime files.
|
|
566
|
+
Version and invocation history remain in the development database. Shared
|
|
567
|
+
managed secrets remain until you delete the secret itself.
|
|
568
|
+
|
|
569
|
+
Set development secret values through the usual secrets workflow. Values are
|
|
570
|
+
stored in private local files, never fetched from staging. The function receives
|
|
571
|
+
only its declared secret mounts and runtime configuration. Enabled caching uses
|
|
572
|
+
bounded process-local memory; it resets on redeploy or restart. Local function
|
|
573
|
+
logs are bounded and reset with Atlas. Cloud infrastructure metrics are unavailable.
|
|
574
|
+
|
|
575
|
+
Local functions belong to the checkout and development database that created
|
|
576
|
+
them. Atlas will reject deployment/invocation/deletion of a copied cloud function
|
|
577
|
+
or a function owned by another worktree. After Atlas restarts, pending operations
|
|
578
|
+
resume and active function processes restart on first invocation. Children exit
|
|
579
|
+
when their Atlas parent exits, including a parent crash.
|
|
580
|
+
|
|
581
|
+
The local process uses Atlas's Node installation. It does not emulate cloud IAM,
|
|
582
|
+
VPC egress enforcement, autoscaling, CPU limits, or memory provisioning. Functions
|
|
583
|
+
are trusted development code running as your OS user. Hosted Atlas continues to
|
|
584
|
+
use GCP. `MANAGED_FUNCTIONS_EXECUTION_BACKEND=gcp` explicitly retains the cloud
|
|
585
|
+
backend for a local development process.
|
|
586
|
+
|
|
587
|
+
`seq-studio functions dev` remains a standalone HTTP harness; use `deploy -e local`
|
|
588
|
+
to exercise the function through Atlas.
|
|
589
|
+
|
|
590
|
+
Invoke payloads can be inline JSON, a JSON file prefixed with `@`, or stdin:
|
|
591
|
+
|
|
592
|
+
```bash
|
|
593
|
+
seq-studio functions invoke --fn my-function -e local --data '{"name":"Atlas"}'
|
|
594
|
+
seq-studio functions invoke --fn my-function -e local --data @request.json
|
|
595
|
+
cat request.json | seq-studio functions invoke --fn my-function -e local --stdin
|
|
596
|
+
```
|
|
597
|
+
|
|
598
|
+
The function response body is written to stdout so it can be piped to another
|
|
599
|
+
command. HTTP status is written to stderr, along with an invocation ID when one
|
|
600
|
+
is available. JSON responses are pretty-printed; other response bodies are
|
|
601
|
+
preserved as text. A non-2xx function response exits nonzero after printing the
|
|
602
|
+
body.
|
|
603
|
+
|
|
541
604
|
### Scaling
|
|
542
605
|
|
|
606
|
+
```bash
|
|
607
|
+
seq-studio functions limits # installed CLI's bundled policy; offline
|
|
608
|
+
seq-studio functions limits -e staging # policy enforced by the deployed server
|
|
609
|
+
seq-studio functions limits -e staging --fn get-loan --json
|
|
610
|
+
```
|
|
611
|
+
|
|
612
|
+
The catalog shares its definitions with manifest validation and server enforcement;
|
|
613
|
+
it is not a separately maintained help table. Use `-e` for authoritative environment
|
|
614
|
+
policy when CLI/server versions differ. A failed server lookup is an error, never a
|
|
615
|
+
silent fallback to local defaults. `--fn` additionally reports stored runtime limits
|
|
616
|
+
for that function, not measured live GCP configuration. Cache entries describe
|
|
617
|
+
platform policy and defaults, not that function's selected cache configuration.
|
|
618
|
+
Changing defaults or deployment caps does not rewrite existing functions' stored
|
|
619
|
+
runtime settings; inspect those with `--fn` and redeploy to apply manifest changes.
|
|
620
|
+
|
|
621
|
+
Each environment supports at most **100 non-archived managed functions** across
|
|
622
|
+
all organizations. Registered functions count even before their first deploy;
|
|
623
|
+
versions do not consume additional slots. At capacity, creating a new function
|
|
624
|
+
fails. Delete an unused function to free a slot. Existing functions can still
|
|
625
|
+
be invoked, redeployed, promoted, and rolled back.
|
|
626
|
+
|
|
543
627
|
Managed functions keep one warm instance by default. Set `min_instances: 0`
|
|
544
628
|
in `managed-function.yml` to scale to zero, or raise the floor when first-request
|
|
545
629
|
latency matters:
|
|
546
630
|
|
|
547
631
|
```yaml
|
|
548
632
|
limits:
|
|
633
|
+
cpu: 1
|
|
634
|
+
concurrency: 16
|
|
549
635
|
min_instances: 1
|
|
550
636
|
max_instances: 3
|
|
551
637
|
```
|
|
552
638
|
|
|
553
639
|
`min_instances` defaults to `1`, cannot exceed `max_instances`, and incurs
|
|
554
|
-
Cloud Run idle-instance charges while warm.
|
|
640
|
+
Cloud Run idle-instance charges while warm. `max_instances` defaults to `3`
|
|
641
|
+
and must be between `2` and `10` so every function can autoscale horizontally.
|
|
642
|
+
|
|
643
|
+
CPU and concurrency are configurable per function in `managed-function.yml`:
|
|
644
|
+
|
|
645
|
+
- `cpu`: `auto` (default), `1`, or `2` vCPUs. `auto` leaves allocation to the
|
|
646
|
+
provider based on memory; it is not a measurement of a deployed function's CPU.
|
|
647
|
+
Explicit fractional CPUs are not supported. Our platform requires at least
|
|
648
|
+
512 MiB (`memory_mb: 512`) when selecting two CPUs.
|
|
649
|
+
- `concurrency`: 1–80 simultaneous requests **per instance**, default 1. Values
|
|
650
|
+
above 1 require an explicit CPU setting because provider-selected fractional
|
|
651
|
+
CPUs cannot support concurrent requests.
|
|
652
|
+
|
|
653
|
+
The example permits up to 16 requests per instance, sharing that instance's CPU
|
|
654
|
+
and memory. Three instances therefore provide capacity for up to 48 simultaneous
|
|
655
|
+
requests, not 48 instances. CPU-bound JavaScript may not benefit from more CPUs
|
|
656
|
+
without worker threads; I/O-heavy functions are better candidates for concurrency.
|
|
657
|
+
Opting into concurrency requires handlers to keep request-specific state out of
|
|
658
|
+
mutable globals. Redeploy with `seq-studio functions deploy -e <env>` to apply
|
|
659
|
+
these settings; promote and rollback carry the selected version's settings.
|
|
660
|
+
|
|
661
|
+
`invoke_rate_per_minute` applies per function **across all Atlas replicas in the
|
|
662
|
+
environment**, using Atlas's shared Redis. All callers and invocation sources
|
|
663
|
+
share one fixed 60-second window, starting with the first attempt. Exceeding it
|
|
664
|
+
returns `429` with `Retry-After` (seconds until the window expires). Rejected
|
|
665
|
+
attempts do not extend the window. Redis unavailability returns `503` without
|
|
666
|
+
executing the function; there is no per-process fallback, including when invoking
|
|
667
|
+
through a local Atlas instance. The standalone `functions dev` handler server
|
|
668
|
+
does not pass through Atlas and does not enforce this gateway quota.
|
|
669
|
+
This is not a rolling-minute or durable spending quota: adjacent windows permit
|
|
670
|
+
boundary bursts, and Redis key loss (restart or eviction) resets the window.
|
|
671
|
+
It controls how many requests are admitted over time; concurrency controls how many
|
|
672
|
+
execute simultaneously within an instance. Increasing concurrency does not raise
|
|
673
|
+
the configured invocation rate limit.
|
|
555
674
|
|
|
556
675
|
### Invocation IP allowlist
|
|
557
676
|
|
|
@@ -686,7 +805,7 @@ to the CLI's copy — not the artifact's declared semver. Deployments record
|
|
|
686
805
|
`cliVersion` + `atlasUiVersion`. Contract:
|
|
687
806
|
`@sequenceholdings/artifact-studio` → `VERSION-PIN.md`.
|
|
688
807
|
|
|
689
|
-
Studio CLI 0.1.
|
|
808
|
+
Studio CLI 0.1.31 carries Artifact Studio 0.2.5 with Atlas UI 3.1.2 pinned
|
|
690
809
|
exactly. Ordinary builds use canonical, mode-aware `tokens.css`; new projects
|
|
691
810
|
use matching editor dependencies. Before rebuilding an older artifact, migrate
|
|
692
811
|
numbered black/white opacity utilities to semantic roles and check a preview in
|
|
@@ -789,7 +908,7 @@ JSON API — the same repos `--repo <ns>/<name>` sources build from.
|
|
|
789
908
|
| `seq-studio repos namespaces [create <slug>] -e <env>` | list namespaces, or create one (creator becomes owner) |
|
|
790
909
|
| `seq-studio repos show <ns>/<name> -e <env>` | detail: id, branches, clone URL; artifact project id when slug matches |
|
|
791
910
|
| `seq-studio repos create <ns>/<name> -e <env> [--default-branch <b>] [--git-backend gcs_isomorphic\|walgit]` | create a repo (GCS default + seed README; `walgit` starts empty on `main`; needs namespace write) |
|
|
792
|
-
| `seq-studio repos clone <ns>/<name> \| --url <clone-url> \| --id <uuid> -e <env> [--ref <r>] [--
|
|
911
|
+
| `seq-studio repos clone <ns>/<name> \| --url <clone-url> \| --id <uuid> -e <env> [--ref <r>] [--output <dir>] [--force]` | smart-HTTP `git clone` when `ATLAS_GIT_PAT` is set (`--url`/`--id` need no seqapi); otherwise JSON materialize + PAT hint. `--out` remains an alias for `--output`. |
|
|
793
912
|
| `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` |
|
|
794
913
|
| `seq-studio repos delete <ns>/<name> -e <env> [--yes]` | delete a repo — interactive confirm unless `--yes` |
|
|
795
914
|
| `seq-studio repos ci show <ns>/<name> -e <env> [--ref <r>]` | preview CI checks discovered from the ref |
|
|
@@ -823,8 +942,9 @@ check names in Settings or with `repos ci require`/`repos ci import`.
|
|
|
823
942
|
## Pipeline commands
|
|
824
943
|
|
|
825
944
|
`seq-studio pipeline <sub>` authors and validates Data Pipelines **stage
|
|
826
|
-
specs** — the typed contracts (`<name>.stage.yml`) a
|
|
827
|
-
(`pipelines/<domain>`)
|
|
945
|
+
specs** — the typed contracts (`<name>.stage.yml`) in either a dedicated
|
|
946
|
+
Pipeline repo (`pipelines/<domain>`) or an app monorepo (`apps/<app>`).
|
|
947
|
+
Validation logic lives in
|
|
828
948
|
`@sequenceholdings/pipeline-spec` (an optional peer, like `@sequenceholdings/orm`);
|
|
829
949
|
install it alongside the CLI to use this family.
|
|
830
950
|
|
|
@@ -833,14 +953,14 @@ install it alongside the CLI to use this family.
|
|
|
833
953
|
| `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 |
|
|
834
954
|
| `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 |
|
|
835
955
|
| `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 |
|
|
836
|
-
| `seq-studio pipeline plan --repo
|
|
837
|
-
| `seq-studio pipeline deploy --repo
|
|
956
|
+
| `seq-studio pipeline plan --repo <namespace>/<slug> --ref <sha\|branch> -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 |
|
|
957
|
+
| `seq-studio pipeline deploy --repo <namespace>/<slug> --ref <sha\|branch> -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. |
|
|
838
958
|
| `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 |
|
|
839
|
-
| `seq-studio pipeline adopt --stage <slug> --ref <sha\|branch> -e <env> [--target <id>] --native-id <id> --approved-by <you> [--resource-key <key>] [--kind job\|dlt_pipeline] [--old-source-removal-pr <url>] [--repo
|
|
840
|
-
| `seq-studio pipeline unbind --stage <slug> --ref <sha\|branch> -e <env> [--target <id>] --approved-by <you> [--resource-key <key>] [--repo
|
|
841
|
-
| `seq-studio pipeline run-now --stage <slug> -e <env> [--target <id>] [--repo
|
|
842
|
-
| `seq-studio pipeline promote --stage <slug> --version <v> -e <env> [--target <id>] [--repo
|
|
843
|
-
| `seq-studio pipeline rollback --stage <slug> -e <env> [--target <id>] [--repo
|
|
959
|
+
| `seq-studio pipeline adopt --stage <slug> --ref <sha\|branch> -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. |
|
|
960
|
+
| `seq-studio pipeline unbind --stage <slug> --ref <sha\|branch> -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) |
|
|
961
|
+
| `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 |
|
|
962
|
+
| `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 |
|
|
963
|
+
| `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`. |
|
|
844
964
|
|
|
845
965
|
`-e/--env` selects the Atlas connection. `--target` selects the logical
|
|
846
966
|
pipeline target advertised by that endpoint. It is optional when the alias
|
|
@@ -891,11 +1011,30 @@ checks:
|
|
|
891
1011
|
- { kind: orm_operation, namespace: finance, operation: VerifyAccounts }
|
|
892
1012
|
```
|
|
893
1013
|
|
|
894
|
-
The
|
|
1014
|
+
The proposed output declarations define the desired types. Planning also checks
|
|
1015
|
+
the actual stored types against the deployed declarations.
|
|
895
1016
|
Business calculations stay in Spark; the migration specifies coordination and
|
|
896
1017
|
acceptance criteria. `VerifyAccounts` must be a persisted read operation in the
|
|
897
1018
|
pinned ORM export. Each changed shared writer must participate.
|
|
898
1019
|
|
|
1020
|
+
If an earlier output declaration was inaccurate, explicitly record the observed
|
|
1021
|
+
Delta type under `baseline`, for example:
|
|
1022
|
+
|
|
1023
|
+
```yaml
|
|
1024
|
+
baseline:
|
|
1025
|
+
- stage: gold
|
|
1026
|
+
output: gold.accounts
|
|
1027
|
+
columns:
|
|
1028
|
+
balance: decimal(18,2)
|
|
1029
|
+
```
|
|
1030
|
+
|
|
1031
|
+
This allows that specific existing-column discrepancy only; the observation must
|
|
1032
|
+
match the native table, and unlisted drift still fails. The desired type still
|
|
1033
|
+
comes from the proposed output schema. A type already matching the desired type
|
|
1034
|
+
needs no schema conversion. Declared rebuilds and acceptance checks still run.
|
|
1035
|
+
This does not waive a mismatch in a Lakebase serving table or authorize dropping
|
|
1036
|
+
an undeclared column. Include each affected shared writer's baseline correction.
|
|
1037
|
+
|
|
899
1038
|
For an ORM participant, update the namespace source, run `orm diff`, then
|
|
900
1039
|
`orm generate --migration-export`, and commit the generated files with the
|
|
901
1040
|
source. Run `orm generate --migration-export --check` in CI to catch stale
|
|
@@ -947,6 +1086,17 @@ already access. These commands remain Sequence-staff-only; their supporting
|
|
|
947
1086
|
HTTP endpoints are internal. Untrusted authors require a separately verified
|
|
948
1087
|
execution-identity boundary before this restriction can be lifted.
|
|
949
1088
|
|
|
1089
|
+
Candidate rebuilds currently require `write_pattern: overwrite`,
|
|
1090
|
+
`on_type_violation: fail`, and no quarantine destination. Planning checks these
|
|
1091
|
+
settings before compiling and persisting deployment bundles. Passing these
|
|
1092
|
+
checks does not prove that the authored Spark code uses the supplied
|
|
1093
|
+
`input_*` and `output_*` table parameters: producers that construct table names
|
|
1094
|
+
themselves must be adapted and tested before migration. Declare every history
|
|
1095
|
+
dependency explicitly; migration planning does not infer reads from Python code.
|
|
1096
|
+
Column declarations must preserve physical precision, for example
|
|
1097
|
+
`decimal(18,2)` rather than the generic `numeric` alias. ORM-bound serving
|
|
1098
|
+
projections can retain that declaration while the ORM consumes it as numeric.
|
|
1099
|
+
|
|
950
1100
|
### Managed Pipelines asset identity
|
|
951
1101
|
|
|
952
1102
|
For native Polars transformations, use `engine: polars` and a regular Python
|
|
@@ -958,6 +1108,19 @@ requirements with the JSON-string `config.python_dependencies`; the default
|
|
|
958
1108
|
installs `polars==1.34.0` and `deltalake==1.2.1`. `config.driver_memory_gb` is rejected because
|
|
959
1109
|
this serverless Python task contract cannot honor it. See the
|
|
960
1110
|
[pipeline spec Python argument contract](../pipeline-spec/README.md#native-polars-jobs).
|
|
1111
|
+
Set Polars-only `config.python_environment_version: '4'` to select environment 4;
|
|
1112
|
+
`'3'` is also accepted and remains the default when omitted. Changing the
|
|
1113
|
+
environment is an explicit deployment choice, independent of pip requirements.
|
|
1114
|
+
|
|
1115
|
+
Polars producers can declare source-scoped `write_scope` outputs and
|
|
1116
|
+
`trigger.refresh_serving` for an existing canonical serving stage, subject to the
|
|
1117
|
+
same disjoint ownership and target validation as Spark jobs. The entrypoint must
|
|
1118
|
+
enforce atomic source-scoped writes and finish publication verification before
|
|
1119
|
+
returning successfully. Serving refreshes run only after producer success.
|
|
1120
|
+
Manual triggers cannot include serving refreshes. See
|
|
1121
|
+
[shared gold writers](../pipeline-spec/README.md#shared-gold-writers) for the
|
|
1122
|
+
ownership and serving bootstrap requirements. Contract migration candidate and
|
|
1123
|
+
in-place execution remain limited to Spark-job producers.
|
|
961
1124
|
|
|
962
1125
|
Compiled Databricks assets use stable, environment-qualified identities: display names are `{env}-MP-{type}-{stage}` (with `-trigger` for a scheduled DLT runner), DAB resource keys are `mp_{type}_{stage_snake_case}` (with `_trigger` for that runner), task keys are `{type}_{task}`, and bundles are `{env}-MP-pipelines-{domain}`. Compiled jobs and pipelines also carry `mp: "true"` and `mp_type: <type>` tags.
|
|
963
1126
|
|
|
@@ -1005,3 +1168,49 @@ contact your platform administrator.
|
|
|
1005
1168
|
`config.toml`. The server does the work — register the bundle, promote the
|
|
1006
1169
|
version, write the audit log — so the CLI runs from any checkout without
|
|
1007
1170
|
server-side wiring on the developer's machine.
|
|
1171
|
+
|
|
1172
|
+
|
|
1173
|
+
### Managed Function caching
|
|
1174
|
+
|
|
1175
|
+
Opt in with `cache: { enabled: true }` in `managed-function.yml` for a dedicated Valkey instance and a third handler argument, `context.cache`. Defaults: `custom-pico`, zero replicas, 30-second TTL. Explicit CRUD supports `get`, `set`, `setIfAbsent`, and `delete`; `getOrCompute` bypasses unavailable caching. Always authorize before cache access, scope keys to the result's audience, and handle invalidation after writes. Only Sequence members may change capacity above the baseline; previously approved capacity can be retained.
|
|
1176
|
+
|
|
1177
|
+
`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.
|
|
1178
|
+
## Blob storage / Workspaces V2
|
|
1179
|
+
|
|
1180
|
+
The initial storage package and CLI additions are pending publication and public
|
|
1181
|
+
contract review. With a CLI build containing this feature, use the normal Atlas
|
|
1182
|
+
environment and credentials:
|
|
1183
|
+
|
|
1184
|
+
```bash
|
|
1185
|
+
seq-studio storage init application-documents
|
|
1186
|
+
seq-studio storage validate workspace.yml
|
|
1187
|
+
seq-studio storage apply workspace.yml -e local
|
|
1188
|
+
seq-studio storage upload ./report.pdf --workspace <id> --path reports/report.pdf -e local
|
|
1189
|
+
seq-studio storage list --workspace <id> -e local
|
|
1190
|
+
seq-studio storage download --workspace <id> --node <file-id> --out ./copy.pdf -e local
|
|
1191
|
+
```
|
|
1192
|
+
|
|
1193
|
+
Workspace YAML declares `workspace.name` and optional `workspace.description`.
|
|
1194
|
+
Folders are real resources, created by upload paths or `storage mkdir`. Resource
|
|
1195
|
+
permissions remain separate from provisioning. `storage access` reads sharing or
|
|
1196
|
+
applies an access JSON file with `expectedRevision`, `restricted` and `grants`.
|
|
1197
|
+
All Sequence organization members have Admin access to every workspace and its
|
|
1198
|
+
folders and files, including restricted folders. Tenant administrators may
|
|
1199
|
+
provision workspaces but need a workspace or folder grant to access existing
|
|
1200
|
+
resources they do not own.
|
|
1201
|
+
|
|
1202
|
+
Uploads stream directly to GCS and print the upload ID for recovery. Repeat with
|
|
1203
|
+
`--resume <upload-id>` and the same source file. `--replace <file-id> --revision <n>`
|
|
1204
|
+
replaces content with optimistic concurrency; it preserves prior immutable versions.
|
|
1205
|
+
Ctrl-C stops transfer without throwing away the resumable session. `storage abort`
|
|
1206
|
+
explicitly cancels it. Do not log session URLs or signed downloads.
|
|
1207
|
+
|
|
1208
|
+
`storage trash` and `restore` are reversible. `purge --yes` and workspace
|
|
1209
|
+
`delete --yes` return durable Temporal receipts; inspect `storage operations` and
|
|
1210
|
+
use `--retry <operation-id>` after correcting a failed cleanup. Each destructive
|
|
1211
|
+
command requires the expected resource revision. Run `storage help` for arguments.
|
|
1212
|
+
|
|
1213
|
+
For local full-stack integration, use `artifact dev`, `functions deploy`, `orm apply`
|
|
1214
|
+
and `storage apply` against the same `-e local` (or `local:<worktree>`). Storage uses
|
|
1215
|
+
the normal local Atlas authorization and lifecycle, with a dedicated development
|
|
1216
|
+
GCS bucket. The standalone `functions dev` harness does not mint storage delegation.
|
package/dist/atlas-client.d.ts
CHANGED
|
@@ -8,6 +8,12 @@ export interface ClientOptions {
|
|
|
8
8
|
baseUrl: string;
|
|
9
9
|
token: string;
|
|
10
10
|
}
|
|
11
|
+
export interface AtlasResponse {
|
|
12
|
+
status: number;
|
|
13
|
+
contentType: string;
|
|
14
|
+
invocationId: string | null;
|
|
15
|
+
body: string;
|
|
16
|
+
}
|
|
11
17
|
export declare class AtlasApiError extends Error {
|
|
12
18
|
readonly status: number;
|
|
13
19
|
readonly path: string;
|
|
@@ -26,6 +32,16 @@ export declare function postJson<T>({ baseUrl, token, path, body, }: ClientOptio
|
|
|
26
32
|
path: string;
|
|
27
33
|
body?: unknown;
|
|
28
34
|
}): Promise<T>;
|
|
35
|
+
/**
|
|
36
|
+
* JSON POST for passthrough endpoints whose successful response is not
|
|
37
|
+
* necessarily JSON and whose non-2xx status may belong to the downstream
|
|
38
|
+
* application. The caller decides how to render and interpret the status.
|
|
39
|
+
*/
|
|
40
|
+
export declare function postJsonResponse({ baseUrl, token, path, body, headers, }: ClientOptions & {
|
|
41
|
+
path: string;
|
|
42
|
+
body?: unknown;
|
|
43
|
+
headers?: Record<string, string>;
|
|
44
|
+
}): Promise<AtlasResponse>;
|
|
29
45
|
export declare function putJson<T>({ baseUrl, token, path, body, }: ClientOptions & {
|
|
30
46
|
path: string;
|
|
31
47
|
body?: unknown;
|
package/dist/atlas-client.js
CHANGED
|
@@ -120,6 +120,9 @@ function messageFromBody(body, status, statusText) {
|
|
|
120
120
|
if (typeof record.error === 'string' && record.error.length > 0) {
|
|
121
121
|
return withViolations(record.error);
|
|
122
122
|
}
|
|
123
|
+
if (record.error && typeof record.error === 'object' && 'message' in record.error && typeof record.error.message === 'string') {
|
|
124
|
+
return withViolations(record.error.message);
|
|
125
|
+
}
|
|
123
126
|
if (typeof record.message === 'string' && record.message.length > 0) {
|
|
124
127
|
return withViolations(record.message);
|
|
125
128
|
}
|
|
@@ -181,6 +184,29 @@ export async function postJson({ baseUrl, token, path, body, }) {
|
|
|
181
184
|
throw await responseError(response, path);
|
|
182
185
|
return response.json();
|
|
183
186
|
}
|
|
187
|
+
/**
|
|
188
|
+
* JSON POST for passthrough endpoints whose successful response is not
|
|
189
|
+
* necessarily JSON and whose non-2xx status may belong to the downstream
|
|
190
|
+
* application. The caller decides how to render and interpret the status.
|
|
191
|
+
*/
|
|
192
|
+
export async function postJsonResponse({ baseUrl, token, path, body, headers = {}, }) {
|
|
193
|
+
const response = await authenticatedFetch({
|
|
194
|
+
baseUrl,
|
|
195
|
+
token,
|
|
196
|
+
path,
|
|
197
|
+
init: {
|
|
198
|
+
method: 'POST',
|
|
199
|
+
headers: { 'Content-Type': 'application/json', ...headers },
|
|
200
|
+
body: body === undefined ? undefined : JSON.stringify(body),
|
|
201
|
+
},
|
|
202
|
+
});
|
|
203
|
+
return {
|
|
204
|
+
status: response.status,
|
|
205
|
+
contentType: response.headers.get('content-type') ?? '',
|
|
206
|
+
invocationId: response.headers.get('x-invocation-id'),
|
|
207
|
+
body: await response.text(),
|
|
208
|
+
};
|
|
209
|
+
}
|
|
184
210
|
export async function putJson({ baseUrl, token, path, body, }) {
|
|
185
211
|
const response = await authenticatedFetch({
|
|
186
212
|
baseUrl,
|
package/dist/functions/bundle.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { readdir, readFile, stat } from 'node:fs/promises';
|
|
2
|
+
import { MANAGED_FUNCTION_LIMITS } from '@sequenceholdings/managed-functions/config';
|
|
2
3
|
import { existsSync } from 'node:fs';
|
|
3
4
|
import { join, relative } from 'node:path';
|
|
4
5
|
import { classifyLockfileOrigin } from './lockfile-origin.js';
|
|
@@ -119,10 +120,11 @@ export async function validateLocalBundle({ rootDir, files, }) {
|
|
|
119
120
|
});
|
|
120
121
|
}
|
|
121
122
|
const totalBytes = files.reduce((sum, f) => sum + Buffer.byteLength(f.content, f.encoding === 'base64' ? 'base64' : 'utf8'), 0);
|
|
122
|
-
|
|
123
|
+
const maxSourceBytes = MANAGED_FUNCTION_LIMITS.bundle.source_bytes.max;
|
|
124
|
+
if (totalBytes > maxSourceBytes) {
|
|
123
125
|
issues.push({
|
|
124
126
|
level: 'error',
|
|
125
|
-
message: `Bundle is ${(totalBytes / 1024 / 1024).toFixed(1)} MiB unpacked — the limit is
|
|
127
|
+
message: `Bundle is ${(totalBytes / 1024 / 1024).toFixed(1)} MiB unpacked — the limit is ${maxSourceBytes / 1024 / 1024} MiB.`,
|
|
126
128
|
});
|
|
127
129
|
}
|
|
128
130
|
return issues;
|
|
@@ -2,7 +2,7 @@ import { type AuthMode } from '../auth.js';
|
|
|
2
2
|
import { type ResolvedEnv } from '../config.js';
|
|
3
3
|
import type { ParsedArgs } from '../process/commands.js';
|
|
4
4
|
import { type ManagedFunctionManifest } from './manifest.js';
|
|
5
|
-
export { parseFunctionsSourceSelection, parseFunctionsSourceSpec, resolveFunctionSourceDir } from './source-selection.js';
|
|
5
|
+
export { parseFunctionsSourceSelection, parseFunctionsSourceSpec, resolveFunctionSourceDir, } from './source-selection.js';
|
|
6
6
|
export declare const LOG = "[seq-studio]";
|
|
7
7
|
export interface FunctionSummary {
|
|
8
8
|
id: string;
|
|
@@ -17,8 +17,10 @@ export interface FunctionSummary {
|
|
|
17
17
|
canInvoke: boolean;
|
|
18
18
|
updatedAt?: string;
|
|
19
19
|
egressHosts?: string[];
|
|
20
|
+
platformEgressHosts?: string[];
|
|
20
21
|
egressIpRanges?: string[];
|
|
21
22
|
egressEnforced?: boolean;
|
|
23
|
+
limits?: Record<string, number | string>;
|
|
22
24
|
}
|
|
23
25
|
export interface VersionSummary {
|
|
24
26
|
id: string;
|
|
@@ -75,6 +77,14 @@ export declare function pollVersion({ ctx, functionId, versionId, egressNote, }:
|
|
|
75
77
|
}): Promise<number>;
|
|
76
78
|
export declare function functionsListCommand(args: ParsedArgs): Promise<number>;
|
|
77
79
|
export declare function functionsShowCommand(args: ParsedArgs): Promise<number>;
|
|
80
|
+
export declare function functionsLimitsCommand(args: ParsedArgs): Promise<number>;
|
|
81
|
+
export declare function parseInvokePayload({ data, useStdin, cwd, readStdin: readStdinInput, }: {
|
|
82
|
+
data?: string;
|
|
83
|
+
useStdin?: boolean;
|
|
84
|
+
cwd?: string;
|
|
85
|
+
readStdin?: () => Promise<string>;
|
|
86
|
+
}): Promise<unknown>;
|
|
87
|
+
export declare function functionsInvokeCommand(args: ParsedArgs): Promise<number>;
|
|
78
88
|
export declare function functionsLogsCommand(args: ParsedArgs): Promise<number>;
|
|
79
89
|
export declare function resolveLiveActiveVersionId(ctx: CommandContext, functionId: string): Promise<string | null>;
|
|
80
90
|
export declare function functionsPromoteCommand(args: ParsedArgs): Promise<number>;
|
|
@@ -82,5 +92,5 @@ export declare function functionsRollbackCommand(args: ParsedArgs): Promise<numb
|
|
|
82
92
|
/** Minimal dotenv parser — KEY=VALUE lines, quotes stripped, comments skipped. */
|
|
83
93
|
export declare function parseDotenv(content: string): Record<string, string>;
|
|
84
94
|
export declare function functionsDeleteCommand(args: ParsedArgs): Promise<number>;
|
|
85
|
-
export declare const FUNCTIONS_USAGE = "usage:\n seq-studio functions init <dir> scaffold manifest + TypeScript hello-world handler\n seq-studio functions build [--dir d] local pre-flight (manifest, lockfile, size)\n seq-studio functions deploy -e <env> [-m msg] preview + confirm secrets + upload and deploy\n seq-studio functions list -e <env> [--match-local] functions visible on the environment\n seq-studio functions show -e <env> [--fn slug] detail for one function (versions, secrets)\n seq-studio functions logs -e <env> [--limit N] [--since t]
|
|
95
|
+
export declare const FUNCTIONS_USAGE = "usage:\n seq-studio functions init <dir> scaffold manifest + TypeScript hello-world handler\n seq-studio functions build [--dir d] local pre-flight (manifest, lockfile, size)\n seq-studio functions deploy -e <env> [-m msg] preview + confirm secrets + upload and deploy\n seq-studio functions list -e <env> [--match-local] functions visible on the environment\n seq-studio functions show -e <env> [--fn slug] detail for one function (versions, secrets)\n seq-studio functions limits [-e <env>] [--json] bundled defaults/caps, or deployed policy\n [--fn slug] also show effective runtime limits (requires -e)\n seq-studio functions dev [--dir path] [--port 8080] local HTTP server with cache context\n seq-studio functions invoke -e <env> [--data JSON | --data @file | --stdin]\n invoke a function and print its response\n seq-studio functions logs -e <env> [--limit N] [--since t] function logs (reader-gated)\n seq-studio functions promote <version> -e <env> make a version live\n seq-studio functions rollback [<version>] -e <env> redeploy a prior version\n seq-studio functions delete -e <env> [--yes] archive function + tear down its runtime\n (version history is retained)\n\n Flags: -e/--env <env|preview:<slug>> (required for network commands; see: seq-studio envs list) \u00B7 --fn <slug> \u00B7 --dir <path>\n --path <repo-subdirectory> (remote build/deploy only) select one function in a multi-function repo\n --from-env-file <path> (default: .env) source file for secret values\n --no-wait \u00B7 --yes\n --no-provision (deploy) update-only: error instead of registering a new\n shell, writing secret values, or attaching secrets (CI sweep)\n\n Local Atlas builds and runs deployed functions on this computer, including teardown.\n \"functions dev\" runs a standalone handler without Atlas registration.\n\n Configure per-function CPU and concurrency in managed-function.yml under limits.\n Run \"functions limits\" for valid settings; redeploy to apply manifest changes.\n Invocation rates are shared across Atlas replicas; 429 includes Retry-After.\n If the shared rate limiter is unavailable, invocation fails closed with 503.\n\n Source for build/deploy: a local --dir (default .), a platform git-service\n repo (--repo <ns>/<name>), or a public HTTPS git URL (--git-url <url>). --path selects\n a function directory within a remote repo; omit it for the existing root-manifest\n layout. --ref selects a branch/tag/commit (default: the repo's default branch).\n Remote sources record the pinned commit as provenance (never dirty) and NEVER\n read a repo-committed .env for secret values \u2014 provision secrets server-side\n or pass a local --from-env-file (resolved against your cwd).\n\n Interactive --repo builds clone over smart-HTTP and require a repo:read git\n PAT in ATLAS_GIT_PAT (`seq-studio auth pat create --scopes repo:read`, or\n Atlas \u2192 Settings \u2192 Tokens). Headless M2M builds use JSON materialize and\n accept only platform-managed --repo sources. Interactive builds also need\n --env + seq-studio login to resolve the repo and deploy.\n";
|
|
86
96
|
export declare function runFunctionsCommand(sub: string | undefined, args: ParsedArgs): Promise<number>;
|