@sanoma-ai/workflows 0.11.17 → 0.11.18

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 (94) hide show
  1. package/README.md +13 -9
  2. package/dist/call.d.ts +35 -4
  3. package/dist/call.js +128 -40
  4. package/dist/call.js.map +1 -1
  5. package/dist/client.d.ts +17 -8
  6. package/dist/client.js +90 -51
  7. package/dist/client.js.map +1 -1
  8. package/dist/collection.d.ts +25 -7
  9. package/dist/collection.js +236 -91
  10. package/dist/collection.js.map +1 -1
  11. package/dist/config.d.ts +8 -5
  12. package/dist/config.js +10 -10
  13. package/dist/config.js.map +1 -1
  14. package/dist/db/company.d.ts +20 -0
  15. package/dist/db/company.js +9 -1
  16. package/dist/db/company.js.map +1 -1
  17. package/dist/describe.js +1 -1
  18. package/dist/describe.js.map +1 -1
  19. package/dist/description.js +1 -1
  20. package/dist/description.js.map +1 -1
  21. package/dist/errors.d.ts +2 -1
  22. package/dist/errors.js +3 -2
  23. package/dist/errors.js.map +1 -1
  24. package/dist/grid.js +3 -2
  25. package/dist/grid.js.map +1 -1
  26. package/dist/host-derive.d.ts +13 -8
  27. package/dist/host-derive.js +26 -13
  28. package/dist/host-derive.js.map +1 -1
  29. package/dist/index.d.ts +2 -0
  30. package/dist/index.js +2 -0
  31. package/dist/index.js.map +1 -1
  32. package/dist/ledger.d.ts +7 -0
  33. package/dist/ledger.js +32 -2
  34. package/dist/ledger.js.map +1 -1
  35. package/dist/local-sandbox.d.ts +8 -1
  36. package/dist/local-sandbox.js +3 -2
  37. package/dist/local-sandbox.js.map +1 -1
  38. package/dist/op.d.ts +3 -2
  39. package/dist/op.js.map +1 -1
  40. package/dist/resources.d.ts +1 -1
  41. package/dist/resources.js +9 -6
  42. package/dist/resources.js.map +1 -1
  43. package/dist/runner-box.d.ts +23 -0
  44. package/dist/runner-box.js +181 -0
  45. package/dist/runner-box.js.map +1 -0
  46. package/dist/runner-protocol.d.ts +73 -0
  47. package/dist/runner-protocol.js +34 -0
  48. package/dist/runner-protocol.js.map +1 -0
  49. package/dist/sandbox-contract.d.ts +14 -5
  50. package/dist/sandbox-contract.js.map +1 -1
  51. package/dist/sandbox-runner.cjs +7 -0
  52. package/dist/scenario.js +16 -7
  53. package/dist/scenario.js.map +1 -1
  54. package/dist/schema.js +6 -3
  55. package/dist/schema.js.map +1 -1
  56. package/dist/secret.d.ts +2 -1
  57. package/dist/secret.js +3 -2
  58. package/dist/secret.js.map +1 -1
  59. package/dist/shared.d.ts +39 -5
  60. package/dist/shared.js +13 -1
  61. package/dist/shared.js.map +1 -1
  62. package/dist/sites.js +10 -8
  63. package/dist/sites.js.map +1 -1
  64. package/dist/source.d.ts +21 -0
  65. package/dist/source.js.map +1 -1
  66. package/drizzle/company/0003_ledger_target.sql +2 -0
  67. package/drizzle/company/meta/0003_snapshot.json +845 -0
  68. package/drizzle/company/meta/_journal.json +7 -0
  69. package/package.json +5 -2
  70. package/src/call.ts +181 -60
  71. package/src/client.ts +118 -67
  72. package/src/collection.ts +265 -97
  73. package/src/config.ts +20 -20
  74. package/src/db/company.ts +9 -1
  75. package/src/describe.ts +1 -1
  76. package/src/description.ts +1 -1
  77. package/src/errors.ts +3 -2
  78. package/src/grid.ts +3 -1
  79. package/src/host-derive.ts +38 -18
  80. package/src/index.ts +2 -0
  81. package/src/ledger.ts +42 -2
  82. package/src/local-sandbox.ts +3 -2
  83. package/src/op.ts +3 -2
  84. package/src/resources.ts +8 -6
  85. package/src/runner-box.ts +218 -0
  86. package/src/runner-protocol.ts +61 -0
  87. package/src/sandbox-contract.ts +11 -4
  88. package/src/sandbox-runner.ts +187 -0
  89. package/src/scenario.ts +16 -6
  90. package/src/schema.ts +14 -3
  91. package/src/secret.ts +6 -2
  92. package/src/shared.ts +40 -4
  93. package/src/sites.ts +11 -7
  94. package/src/source.ts +14 -0
package/README.md CHANGED
@@ -190,7 +190,7 @@ Later, not yet: the person's numeric GitHub id is stored but unused, so a login
190
190
 
191
191
  ### Ledger
192
192
 
193
- The ledger is the audit record of a run: who started it, every operation call with the policy's decision, every approval, and how it ended, as `LedgerRecord`s in `seq` order. `client.ledger(runId)` reads it, and the app's run page shows it. Three stores keep it, each a `LedgerStore` (`append`, `read`, and `close` for one that holds a connection), and a config picks one with `ledger`:
193
+ The ledger is the audit record of a run: who started it, every operation call with the policy's decision, every approval, and how it ended, as `LedgerRecord`s in `seq` order. `client.ledger(runId)` reads it, and the app's run page shows it. Each `op.called` record names its `target` when the operation declares one (`data:outbound/Acme`: the instance the call acted on, as the policy saw it), and `client.history(target, limit?)` reads the calls that acted on one across every run, direct writes among them, newest first: a run's reads of the record too (each record's `effect` tells them from the writes), never a direct read, which is not recorded. Three stores keep it, each a `LedgerStore` (`append`, `read`, `readByTarget`, and `close` for one that holds a connection), and a config picks one with `ledger`:
194
194
 
195
195
  - `postgresLedger(databaseUrl)`, the default when `ledger` is not set: one table, `sanoma_ledger`, in the config's database beside DBOS's own, which the worker, the app and other processes then share without sharing a disk. The table is made on first use, and the database with it when it is not there (as a worker's launch makes it), so the app may read before any worker has run. The worker and the client (so the app) each make their own store and close it with themselves (`stop`, `client.close()`); `close()` ends its pool for good. A store the config gives is the config's to close: the runtime never closes it.
196
196
  - `jsonlLedger(dir)`: `<dir>/<runId>.jsonl`, one record per line, for a ledger on disk or in a repo.
@@ -321,7 +321,7 @@ export default defineConfig({ connectors: [], secrets });
321
321
 
322
322
  Without `store`, the runtime uses its encrypted Postgres adapter. Without `namespace`, it uses `default`. An unbound name resolves to the same path in that namespace, managed by Sanoma. A `{ path, management: "external" }` binding is read-only to Sanoma even when its store can write. An `{ env }` binding reads that exact variable, is read-only, and does not fall back when absent. A `{ bootstrap }` binding explicitly exposes one deployment key to trusted host-secret resolution; it reads the corresponding environment or mounted-file input and never stores the key in Postgres. Bootstrap keys and recovery are described [below](#bootstrap-keys).
323
323
 
324
- To deliver an additional environment binding to the [declared hosts](#hosts), opt in with `PROVISIONING_BOOTSTRAP: { env: "SANOMA_PROVISIONING_CREDENTIAL", host: true }`. Apply gives each deriving host the logical `secret("PROVISIONING_BOOTSTRAP")` marker under `SANOMA_PROVISIONING_CREDENTIAL`; only the trusted host driver resolves its value. `host` is allowed only on environment bindings. Omitted or `false` adds no delivery beyond the host's existing derived bindings. Two opted-in bindings cannot target the same environment variable, and a binding cannot replace a derived host binding with a different logical secret.
324
+ To deliver an additional environment binding to the [declared hosts](#hosts), opt in with `PROVISIONING_BOOTSTRAP: { env: "SANOMA_PROVISIONING_CREDENTIAL", host: true }`. Apply gives each deriving host the logical `secret("PROVISIONING_BOOTSTRAP")` marker under `SANOMA_PROVISIONING_CREDENTIAL`; only the trusted host driver resolves its value. `host` is allowed only on environment bindings. Omitted or `false` adds no delivery beyond the host's existing derived bindings. Two opted-in bindings cannot target the same environment variable, and a binding cannot replace a derived host binding with a different logical secret. An opted-in binding with no value where apply runs is a problem of the plan, before any vendor call: the host is left out, and the problem names the binding and the variable it reads (`PROVISIONING_BOOTSTRAP (\`host: true\`) has no value where apply runs, …: set SANOMA_PROVISIONING_CREDENTIAL, …`).
325
325
 
326
326
  This applies to declared deriving hosts that accept derived bootstrap, not hosts that bind their own bootstrap or company hosts created by workflows. Keep provisioning credentials in the control plane's configuration; company workflows must deliver only that company's runtime authority. Delivery uses the host's existing rollout behavior: it does not watch local environment changes or restart a host automatically. For Cloudflare secret replacement, advance the non-secret `configurationRevision` and apply the host; see [the Worker](../../connectors/cloudflare/README.md#the-worker).
327
327
 
@@ -517,7 +517,7 @@ export const outbound = collection({
517
517
 
518
518
  A field is `"text"`, `"number"`, `"boolean"`, `"date"` (ISO 8601: a date, or a date and time with its offset) or `"person"` (a person's id), `{ type, optional: true }`, or `{ enum: [...] }` (optional too). A record is typed by them (`RecordOf<typeof outbound.fields>`), and `save` refuses a field that is not declared. The config's `collections` lists them; `sanoma` adds every collection `resources/data.ts` exports when it loads the config, so a company's config lists none.
519
519
 
520
- `resources/data.ts` is the data file the runtime imports as well as loads: the launcher imports it, and so does a workflow that names a collection's operations (`import { outbound } from "../resources/data.ts"`, the one file outside `workflows/` or `policies/` the workflow lint lets them import, found by its real path). So it holds collections only, `collection` imported from `sanoma/data` (or `@sanoma-ai/workflows/data`): a resource declared there, or a collection declared in another data file, is a [problem](#data-files). Their operations are of the vendor `data` (`DATA_VENDOR`, which no connector may take): `data.outbound.get` (`{ key }`: the record, or `null`), `.list` (`{ where?, order?, limit? }`: fields equal to a value or within `{ gt, gte, lt, lte }`, sorted by a field, or `-field` for descending, with missing values last, else by key; values compare as their field's type, text byte by byte (Postgres's `COLLATE "C"`, whatever the database's collation), and one of another type counts as missing; 1 to 1000 records, 100 by default), `.save` (`{ record, ifAbsent?, ifRecord? }`: added or replaced, optionally guarded by an absent key or matching record) and `.delete` (`{ key }`: `{ deleted }`). `get` and `list` are effect `read`, `save` and `delete` `write`, all idempotent, and the policy's `target` is `data:outbound/<key>` (`data:outbound` for a list). A workflow names them in `uses` and calls them on `ctx`, as any operation:
520
+ `resources/data.ts` is the data file the runtime imports as well as loads: the launcher imports it, and so does a workflow that names a collection's operations (`import { outbound } from "../resources/data.ts"`, the one file outside `workflows/` or `policies/` the workflow lint lets them import, found by its real path). So it holds collections only, `collection` imported from `sanoma/data` (or `@sanoma-ai/workflows/data`): a resource declared there, or a collection declared in another data file, is a [problem](#data-files). Their operations are of the vendor `data` (`DATA_VENDOR`, which no connector may take): `data.outbound.get` (`{ key }`: the record, or `null`), `.list` (`{ where?, order?, limit? }`: fields equal to a value or within `{ gt, gte, lt, lte }`, sorted by a field, or `-field` for descending, with missing values last, else by key; values compare as their field's type, text byte by byte (Postgres's `COLLATE "C"`, whatever the database's collation), and one of another type counts as missing; 1 to 1000 records, 100 by default), `.count` (`{ where? }`, as `list` takes it: `{ count }`), `.save` (`{ record, ifAbsent?, ifRecord? }`: added or replaced, optionally guarded by an absent key or matching record), `.saveMany` (`{ records?: [{ record, ifAbsent?, ifRecord? }], deletes?: [{ key, ifRecord? }] }`: saves and deletes together, all or none, see [batches](#batches)) and `.delete` (`{ key, ifRecord? }`: `{ key, deleted }`, refused like a save when `ifRecord` no longer matches). `get`, `list` and `count` are effect `read`, `save`, `saveMany` and `delete` `write`, all idempotent, and the policy's `target` is `data:outbound/<key>` (`data:outbound` for a list, a count or a batch). A workflow names them in `uses` and calls them on `ctx`, as any operation:
521
521
 
522
522
  ```ts
523
523
  uses: [outbound.get, outbound.save],
@@ -530,12 +530,16 @@ async run(ctx, { company }) {
530
530
  },
531
531
  ```
532
532
 
533
- Use `save({ record, ifAbsent: true })` to claim a key atomically before creating external resources. An absent key is inserted. If the stored JSON record and `updatedBy` already match, the call returns the original `Saved` receipt, including its timestamp, so a retry after a lost response can recover. A different record or actor is refused with a non-retryable `DriverError` (`vendorCode: "record_exists"`, status `409`). Object-property order and omitted `undefined` fields do not change JSON equality; the sandbox fake follows the same rule.
533
+ Use `save({ record, ifAbsent: true })` to claim a key atomically before creating external resources. An absent key is inserted. If the stored JSON record and `updatedBy` already match, the call returns the original `Saved` receipt, including its timestamp, so a retry after a lost response can recover. A different record or actor is refused with a non-retryable `DriverError` (`vendorCode: "record_exists"`, status `409`) whose `current` is the record there. Object-property order and omitted `undefined` fields do not change JSON equality; the sandbox fake follows the same rule.
534
534
 
535
- Use `save({ record: next, ifRecord: previous.record })` to replace an existing record only while its full JSON still matches the record read earlier. A missing or changed record is refused with a non-retryable `DriverError` (`vendorCode: "record_changed"`, status `409`). An already-written `next` record from the same actor returns its original receipt, allowing recovery after a lost response. Do not combine `ifRecord` with `ifAbsent`. Omitting both keeps ordinary replacement behavior. A conflict does not automatically reload and overwrite the winner.
535
+ Use `save({ record: next, ifRecord: previous.record })` to replace an existing record only while its full JSON still matches the record read earlier. A missing or changed record is refused with a non-retryable `DriverError` (`vendorCode: "record_changed"`, status `409`) whose `current` is the record as it stands (a `Saved`), or `null` when it is gone, so the caller can settle the conflict without another read; a policy that lets someone save a record thereby lets them see it, so allow the collection's `get` wherever `save` is allowed. An already-written `next` record from the same actor returns its original receipt, allowing recovery after a lost response. Do not combine `ifRecord` with `ifAbsent`. Omitting both keeps ordinary replacement behavior. A conflict does not automatically reload and overwrite the winner.
536
536
 
537
537
  For a claim belonging to one provisioning run, declare a text field such as `claimRun` and include `claimRun: ctx.runId` in the initial record. Keep that value stable on retries and complete the claim before vendor effects. Subsequent transitions must check ownership and conditionally save the full prior record, retaining a run or generation identifier so a later transition cannot look like an earlier one. `ifRecord` compares contents; it is not a monotonic revision, expiring lease or lock held across vendor calls. Managed Cloud consumer integration and lifecycle verification remain separate work in [#532](https://github.com/Sanoma-AI/sanoma/issues/532).
538
538
 
539
+ #### Batches
540
+
541
+ `saveMany` takes up to 1000 entries (`BATCH_LIMIT`), records to save (each as `save` takes it, `ifAbsent` or `ifRecord` included) and keys to delete, each key once, and makes them in one transaction: all are kept, or none. It answers the records' receipts then the deletes' answers, in the order sent. The policy never sees a batch: it decides each entry as the collection's `save` or `delete`, with the record it replaces as `before`, and the ledger records each entry as its own `op.called` with its target and decision, so a record's history reads the same whether it was saved alone or in a batch (a `Then` step names `data.outbound.save`, never `saveMany`). One denied entry denies the batch (`policy_denied`, its `data.denied` the denied keys, the reason naming each); one held entry holds it whole, the approval covering the batch and the entries it held (an approved batch denied when the policy is asked again is recorded as the deny); a retry of a `delete` under `ifRecord` (a run's second try, or the same direct call again after its records were cut short) that finds no record answers `deleted: true`, the first try having deleted it; a `Then` step cannot name the batch (`data.outbound.saveMany is recorded as its entries`), and the Permissions grid and the run form's will-ask line ask about its entries, the `save` and the `delete`, since no rule names it; one record an entry's `ifRecord` or `ifAbsent` refuses (changed, missing, or there) refuses it with a non-retryable `DriverError` (`vendorCode: "record_changed"`, status `409`) whose `conflicts` lists every such entry as `{ key, current }`, the record as it stands or `null`. The sandbox fake does the same in memory.
542
+
539
543
  `get`, `list` and `save` answer `Saved` records, `{ key, record, updatedAt, updatedBy }`, where `updatedBy` is who the call was made as (`CallContext.by`: `run:<id>` inside a run, the person's id for a [direct call](#direct-calls)). The records are JSON rows of one table the runtime creates beside the ledger, `sanoma_data` (`collection`, `key`, `record`, `updated_at`, `updated_by`), in the config's database. A declaration changes with no migration: a record saved under an older one comes back as it is stored, with `issues` (`{ path, message }`) where the fields no longer accept it. A sandbox run keeps the records in memory, in a fake that starts empty: a scenario seeds a record as it seeds a resource, `Given data.outbound "Acme" has` with a table of fields (the key is the quoted name, and what the table leaves out is made up), and removes one with `Given data.outbound "Acme" is gone`. `describeConfig` lists them as `collections`, each `{ name, title?, key, fields, record, ops, declared? }`, `record` being the JSON Schema `save` accepts, with `$id` `sanoma:collection/<name>`, and `declared` where `resources/data.ts` declares it (`{ id, file, name, at }`, as `loadDataFiles` reads it), whose declaration the app's Hosting page opens. `@sanoma-ai/workflows/shared` exports `DATA_VENDOR` and the `Saved` and `ListQuery` types.
540
544
 
541
545
  ### Direct calls
@@ -547,7 +551,7 @@ const saved = await client.call("data.outbound.save", { record }, { actor: { id:
547
551
  const customer = await client.call("stripe.customer.get", { id }, { actor: { id: "ada" } });
548
552
  ```
549
553
 
550
- `client.call(opId, input, { actor, id? })` refuses an unknown operation, one that may not be called directly and input its schema refuses (`invalid_input`). The policy decides the call as the person, in a run `direct:<actor>:<id>` of the workflow `call` with no approvals (`id` is a new UUID unless given). A deny throws `policy_denied` and writes nothing. An allowed call runs the driver once, without DBOS and without a retry, as `CallContext` `{ idempotencyKey, runId }` both that run id and `by` the person's id; a failure is `driver_failed`. A read returns its output and records nothing, so a page polling it does not fill the ledger. A write is one `op.called` record (seq 0) of that run, and with the default ledger it is in one Postgres transaction with the record it saves: both are kept, or neither. The same id with the same input returns the output recorded, without writing again; with another operation or input it is refused (`invalid_input`, `differs`). When the policy asks for an approval, the call becomes a run of the built-in `call` workflow (`CALL_WORKFLOW`), started as the person with run id `call:<actor>:<id>` and input `{ op, input }`: its one call is held like any run's, shows in `client.approvals`, and once approved is made as the person (a save's `updatedBy` is theirs). `client.call` throws `approval_pending` (`ApprovalPendingError`) with `data` `{ runId, workflow: "call", op }`, and so does the same call again (same id) while that run waits; once it has ended, the same call returns what the run returned (or throws its error), without asking the policy again. A write whose driver failed keeps its failure under its id: call again with another id to try again. The `call` workflow `uses` every operation that may be called directly and has a driver; `resolveConfig` adds it when there is one, and a config's own workflow may not be named `call`.
554
+ `client.call(opId, input, { actor, id? })` refuses an unknown operation, one that may not be called directly and input its schema refuses (`invalid_input`). The policy decides the call as the person, in a run `direct:<actor>:<id>` of the workflow `call` with no approvals (`id` is a new UUID unless given). A deny throws `policy_denied` and writes nothing. An allowed call runs the driver once, without DBOS and without a retry, as `CallContext` `{ idempotencyKey, runId }` both that run id and `by` the person's id; a failure is `driver_failed`. A read returns its output and records nothing, so a page polling it does not fill the ledger. A write is one `op.called` record (seq 0) of that run, a [batch](#batches) one per entry (seq 0, 1, ...), and with the default ledger they are in one Postgres transaction with the records it saves: all are kept, or none. The same id with the same input returns the output recorded, without writing again; with another operation or input it is refused (`invalid_input`, `differs`). When the policy asks for an approval, the call becomes a run of the built-in `call` workflow (`CALL_WORKFLOW`), started as the person with run id `call:<actor>:<id>` and input `{ op, input }`: its one call is held like any run's, shows in `client.approvals`, and once approved is made as the person (a save's `updatedBy` is theirs). `client.call` throws `approval_pending` (`ApprovalPendingError`) with `data` `{ runId, workflow: "call", op }`, and so does the same call again (same id) while that run waits; once it has ended, the same call returns what the run returned (or throws its error), without asking the policy again. A write whose driver failed keeps its failure under its id: call again with another id to try again. The `call` workflow `uses` every operation that may be called directly and has a driver; `resolveConfig` adds it when there is one, and a config's own workflow may not be named `call`.
551
555
 
552
556
  `client.latest(workflow)` is the newest finished run of a workflow, `{ runId, output, at }` (`at` when it finished), or `null`: one query, for a page that shows a workflow's last result.
553
557
 
@@ -657,7 +661,7 @@ This package knows nothing of OpenTofu. Resource types from an OpenTofu provider
657
661
 
658
662
  A host is a resource type that runs the company (a container, a Render service, a Fly app): `defineResource({ …, writable: true, host })`, where `host` (`HostSpec`) says where the type takes the runtime's inputs, by dotted path into its fields (`inputs: { source, ref, secrets, port, domains?, hostname? }`, `secrets` a write-only field; `domains`, when the type takes it, a public site's domain by site name, which the host hands the app as `SANOMA_DOMAINS` and `describeConfig` reports a problem for, at the declaration, when it names a site that is not public or gives one domain two sites: `sanoma.example is the domain of both www and docs`; `hostname`, when the type takes it, the hostname the app itself is served at, never one of the sites' domains, nor another host's hostname or domain (`describeConfig` reports one that is), so a host with one reports its `url` as `https://<hostname>`, the vendor's URL otherwise, and its vendor's URL as `wakeUrl`, where its wakeup reaches it, so a wake never waits on a custom domain's DNS or certificate; `wakeUrlOf(outputs)` is its `wakeUrl`, else its `url`), which field apply fills with the commit (`revision`, which a data file may not declare: it names a branch, never a commit), what it can do (`capabilities: { lifetime, publicUrl, buildsFromGit, staticEgress }`, `lifetime` `long-lived` or `stops-when-quiet`, `HostLifetime`), and how its state reads (`outputs(state) → { url, wakeUrl?, revision?, healthy }`). `defineResource` refuses a `host` that names no field, or whose `secrets` is not write-only. A host whose vendor mints the instance's bootstrap (its database URL, keys and tokens) and binds it itself declares `bindsBootstrap: true` and takes no `secrets` (Sanoma Cloud's `cloud.host`); `defineResource` refuses one that gives both, or neither. A write-only field may be a map of secrets (`secrets: { SANOMA_DATABASE_URL: secret("DATABASE_URL") }`): its markers are kept as one at the field is. A host type is `stateless` (a `ResourceSpec` field, default true for a host): its objects keep no data, so replacing or recreating one is routine. `source` is a clone URL, or a reference to a declared repository with a `by` field holding one.
659
663
 
660
- A host that derives (`derives: true`, `cloudflare.host` and `cloud.host`) is declared by its decisions alone, its `name`, `hostname` and `database` (`inputs.database`, a write-only reference to the declared database it runs on), and apply fills the rest before it plans, in the data-file step, as it fills the revision (`deriveHosts`, from `hostFacts`): `name` (when its type takes `inputs.name`, as `cloudflare.host` does) the name it is bound by (so a renamed repository never replaces it), else the repository's name, made lower-case letters, digits and dashes, its identity `UNNAMED` until then; `image` (when its type takes one) the installed `sanoma`'s runtime image, `runtimeImage(version)`, `ghcr.io/sanoma-ai/runtime:<version>` (`RUNTIME_IMAGE`); `source` the declared repository that is the app's `origin` (else the one its data file declares, `sourceRepository`), else `origin`'s URL with no credentials (`originUrl`, `cloneUrl`); `ref` the repository's default branch, resolved with the revision; `domains` each public site's `defineSite({ public: true, domain })`; and, unless it binds its own bootstrap, `secrets` as markers only: `SANOMA_DATABASE_URL` (`databaseUrlSecret` of the database's export), `SANOMA_SIGNING_KEY` (the config's when it binds one, `{ env }` or `{ bootstrap }`, else the host's own, `secret("SANOMA_HOST_SIGNING_KEY", { generate: true })`, `HOST_SIGNING_KEY`, generated into the store at its create), with the built-in store `SANOMA_SECRETS_KEY` (which cannot live in the store it unlocks: always bound), `SANOMA_SOURCE_KEY` for a GitHub repository where the config has the `github.repository_deploy_key` type (without it, the host clones over HTTPS, a public repository only), the wakeup's token (and URL for `sanoma.wakeup`) when a wakeup names the host, the variables the drivers of its data file's vendors and of the login's sender read (an optional one once stored), and the GitHub App's keys that are stored (`GITHUB_APP`, the one list of them, which the staff login and the app's Connect page use too). `image`, `source` and `ref` stay as overrides; `port` is the image's (`RUNTIME_PORT`), never declared; a data file that writes `secrets` or `domains` is refused. A live apply mints what it gives the host when none is stored: the source key pair (where the deploy-key type is), its private half as `SANOMA_SOURCE_KEY`, and the wakeup's token (`swi_…`). For a GitHub repository, apply then declares the deploy key itself, `<file>#host.sourceKey` (`sourceKeyId`), a read-only `github.repository_deploy_key` of the key's public half, before the host, with its type's identity (`<owner>/<repository>:<key>`), so a key GitHub holds already is bound, never made again (GitHub takes a key once). Problems, each leaving the host out of the plan with what names it (its wakeup, and what names that) until fixed, so apply changes nothing it cannot give all it needs: no `database`, no installed `sanoma` without an `image`, no `origin` without a `source`, no name to tell, a name another host of its type has, a credential a vendor's driver reads from this machine's environment that nothing binds (`ACME_TOKEN is read from the environment here, and has no binding, …`: bind it `{ env }` in `sanoma.config.ts`, or store it on the connector page), a private repository with no deploy-key type to clone it with (`hostFacts` asks GitHub, with no token, whether the repository a host may clone, `origin`'s or a declared `source`'s, is public), and two hosts that would attach the sites' domains. At plan time, a host whose state has domains attached while no site declares one is a problem too, with no step: a change would detach them (put `domain` on each site). Apply's `bind` of an object its identity found that an orphaned binding of the same type holds takes that binding over (`from` on the step, written in the same commit, `Apply: rebind … from …`): the orphan is none, as for an export renamed, or a deploy key a data file declared before (`#deployKey`) that apply now declares as `#host.sourceKey`. A type renamed keeps its objects: `formerly` (a `ResourceSpec` field, `["cloudflare.container"]` on `cloudflare.host`) lists the ids whose lockfile bindings bind its declarations.
664
+ A host that derives (`derives: true`, `cloudflare.host` and `cloud.host`) is declared by its decisions alone, its `name`, `hostname` and `database` (`inputs.database`, a write-only reference to the declared database it runs on), and apply fills the rest before it plans, in the data-file step, as it fills the revision (`deriveHosts`, from `hostFacts`): `name` (when its type takes `inputs.name`, as `cloudflare.host` does) the name it is bound by (so a renamed repository never replaces it), else the repository's name, made lower-case letters, digits and dashes, its identity `UNNAMED` until then; `image` (when its type takes one) the installed `sanoma`'s runtime image, `runtimeImage(version)`, `ghcr.io/sanoma-ai/runtime:<version>` (`RUNTIME_IMAGE`); `source` the declared repository that is the app's `origin` (else the one its data file declares, `sourceRepository`), else `origin`'s URL with no credentials (`originUrl`, `cloneUrl`); `ref` the repository's default branch, resolved with the revision; `domains` each public site's `defineSite({ public: true, domain })`; and, unless it binds its own bootstrap, `secrets` as markers only: `SANOMA_DATABASE_URL` (`databaseUrlSecret` of the database's export), `SANOMA_SIGNING_KEY` (the config's when it binds one, `{ env }` or `{ bootstrap }`, else the host's own, `secret("SANOMA_HOST_SIGNING_KEY", { generate: true })`, `HOST_SIGNING_KEY`, generated into the store at its create), with the built-in store `SANOMA_SECRETS_KEY` (which cannot live in the store it unlocks: always bound), `SANOMA_SOURCE_KEY` for a GitHub repository where the config has the `github.repository_deploy_key` type (without it, the host clones over HTTPS, a public repository only), the wakeup's token (and URL for `sanoma.wakeup`) when a wakeup names the host, the variables the drivers of its data file's vendors and of the login's sender read (an optional one once stored), and the GitHub App's keys that are stored (`GITHUB_APP`, the one list of them, which the staff login and the app's Connect page use too). `image`, `source` and `ref` stay as overrides; `port` is the image's (`RUNTIME_PORT`), never declared; a data file that writes `secrets` or `domains` is refused. A live apply mints what it gives the host when none is stored: the source key pair (where the deploy-key type is), its private half as `SANOMA_SOURCE_KEY`, and the wakeup's token (`swi_…`). For a GitHub repository, apply then declares the deploy key itself, `<file>#host.sourceKey` (`sourceKeyId`), a read-only `github.repository_deploy_key` of the key's public half, before the host, with its type's identity (`<owner>/<repository>:<key>`), so a key GitHub holds already is bound, never made again (GitHub takes a key once). Problems, each leaving the host out of the plan with what names it (its wakeup, and what names that) until fixed, so apply changes nothing it cannot give all it needs: no `database`, no installed `sanoma` without an `image`, no `origin` without a `source`, no name to tell, a name another host of its type has, a credential a vendor's driver reads from this machine's environment that nothing binds (`ACME_TOKEN is read from the environment here, and has no binding, …`: bind it `{ env }` in `sanoma.config.ts`, or store it on the connector page), a binding the config gives the host (`host: true`, see [Secret store configuration](#secret-store-configuration)) with no value where apply runs, a private repository with no deploy-key type to clone it with (`hostFacts` asks GitHub, with no token, whether the repository a host may clone, `origin`'s or a declared `source`'s, is public), and two hosts that would attach the sites' domains. At plan time, a host whose state has domains attached while no site declares one is a problem too, with no step: a change would detach them (put `domain` on each site). Apply's `bind` of an object its identity found that an orphaned binding of the same type holds takes that binding over (`from` on the step, written in the same commit, `Apply: rebind … from …`): the orphan is none, as for an export renamed, or a deploy key a data file declared before (`#deployKey`) that apply now declares as `#host.sourceKey`. A type renamed keeps its objects: `formerly` (a `ResourceSpec` field, `["cloudflare.container"]` on `cloudflare.host`) lists the ids whose lockfile bindings bind its declarations.
661
665
 
662
666
  A config whose connectors declare a host type has the built-in operation `sanoma.source.resolve` (`SOURCE_RESOLVE`, effect `read`): `{ url, ref? } → { revision, ref }`, by `git ls-remote` on this machine (a branch, then a tag, peeled; a full commit id is itself; with no `ref`, the default branch its `HEAD` names, `defaultBranch(url)`). Apply calls it for each host it plans, and gives the host the commit as its `revision` and the clone URL as its `source` (a referenced repository's, from its `by` field); a host whose ref does not resolve, or whose repository has no clone URL yet (apply the repository first), is a problem of the plan. The drift run calls it for every host it reads. A sandbox run calls its fake instead (`fakeSourceDriver`), with no git or network: a full commit id is itself, any other ref the SHA-1 of `<url>#<ref>`, the same on every run, and the default branch `main`. A host's `secrets` map may name sanoma's own secrets (`SANOMA_…`), and no other field of any type may. `resolveRevision(url, ref)` is the same, outside a run.
663
667
 
@@ -681,13 +685,13 @@ A database is a resource type that holds the company's database (a Neon project,
681
685
 
682
686
  ### Sandboxes
683
687
 
684
- A sandbox is a resource type whose boxes a coding agent works in (an Agent37 instance): `defineResource({ …, writable: true, sandbox })`, where `sandbox` (`SandboxSpec`) says what its boxes can do (`capabilities: { snapshot, pause, port }`: their files survive a stop; a stopped box keeps its memory; a port is reachable from outside), where it takes a box's image and its size in vCPUs, by dotted path into its fields (`inputs: { image, size }`), and how its state reads (`outputs(state) → { id, healthy }`). The vendor's own facts (region, machine type) are fields of the resource, never the environment. Its connector attaches the backend (`withSetup(connector, { sandbox: ({ secrets }) => backend })`): `open({ name, image, size })` gives the box `name`, made, woken or started as it needs, and `discard({ name })` deletes it and all the vendor kept. A `Box` runs `bash -c` (`run(command, { cwd, env, stdin, signal })` → a `Process` of web streams, `wait()` and `kill()`), reads and writes files (a relative path is under its home), exposes a port (`expose(port)` → `{ url, headers? }`) and stops. `localBackend(dir, env?)` is the backend on this machine: a box is the directory `<dir>/<name>`, its commands children in process groups of their own (`LOCAL_SANDBOX`: it snapshots and exposes ports on loopback). `ResolvedConfig.sandboxes()` names the declared ones. `defineResource` refuses a `sandbox` that breaks any of that. Its conformance kit is [`@sanoma-ai/testing/sandbox`](../testing/README.md#a-sandboxs-conformance).
688
+ A sandbox is a resource type whose boxes a coding agent works in (an Agent37 instance): `defineResource({ …, writable: true, sandbox })`, where `sandbox` (`SandboxSpec`) says what its boxes can do (`capabilities: { snapshot, pause, port }`: their files survive a stop; a stopped box keeps its memory; a port is reachable from outside), where it takes a box's image and its size in vCPUs, by dotted path into its fields (`inputs: { image, size }`), and how its state reads (`outputs(state) → { id, healthy }`). The vendor's own facts (region, machine type) are fields of the resource, never the environment. Its connector attaches the backend (`withSetup(connector, { sandbox: ({ secrets, declared }) => backend })`, `declared` the declared resource's fields, where the vendor's facts are): `open({ name, image, size })` gives the box `name`, made, woken or started as it needs, and `discard({ name })` deletes it and all the vendor kept. A `Box` runs `bash -c` (`run(command, { cwd, env, stdin, signal })` → a `Process` of web streams, `wait()` and `kill()`), reads and writes files (a relative path is under its home), exposes a port (`expose(port)` → `{ url, headers? }`) and stops. `localBackend(dir, env?)` is the backend on this machine: a box is the directory `<dir>/<name>`, its commands children in process groups of their own (`LOCAL_SANDBOX`: it snapshots and exposes ports on loopback). A remote box is driven through the runner, a small server of Sanoma's that its backend starts inside it: `runnerScript()` is the runner as one file (Node 22 or later, nothing to install), which listens on `RUNNER_PORT` (7700), answers `GET /runner/health` (`RUNNER_HEALTH`) with its protocol and pid (`RunnerHealth`, `{ protocol, pid }`, `RUNNER_PROTOCOL`; `runnerHealth(url, headers?)` asks it) and asks no credential, since the vendor's edge authenticates every request to the port; `runnerBox({ url, headers, id })` is the box's `run`, `read`, `write` and `stop` over one WebSocket to it, the upgrade sent with `headers`, its commands streaming both ways, which a vendor's buffered exec cannot. `ResolvedConfig.sandboxes()` gives the declared one, read at each call (an instance opens its coding agents' boxes in one sandbox: several are each a problem of the data files, and left out), and `sandboxBackends` the makers of the backends the connectors attach, by vendor: the app (`personBox`) makes the declared one's vendor's with its fields and opens a person's box in it, falls back to `localBackend` on this computer, and refuses its coding agents on a live instance that declares none. `open`'s `image` and `size`, left out, are the backend's own. `defineResource` refuses a `sandbox` that breaks any of that. Its conformance kit is [`@sanoma-ai/testing/sandbox`](../testing/README.md#a-sandboxs-conformance).
685
689
 
686
690
  ### Secrets
687
691
 
688
692
  Never put a secret in a workflow's input or an operation's input or output. They are persisted verbatim: DBOS keeps every step's input and output in Postgres, the ledger records each call's input and output, an approval a policy asks for carries the held call's input, and the app shows all of it to anyone who can reach it. A driver reads its credentials when it is called (from the environment or a secret store), and an operation that creates a secret (an API key, a password reset link) returns a reference to where it is stored, not the secret.
689
693
 
690
- A secret a resource needs is named, never written. A data file gives `secret("NAME")` (from `sanoma/resources`; `NAME` upper case, as a variable's; sanoma's own, `SANOMA_…`, only in a host's `secrets`) at a write-only field (or an entry of a write-only map), and `secret("NAME", { generate: true })` for one apply makes when none is stored: `database_password: secret("SUPABASE_DB_PASSWORD", { generate: true })`. Declarations, checkpoints and the ledger hold its marker, `{ "$secret": "NAME", "generate": true }`; the resource type refuses one at any other field, and its schema does not judge it. The driver resolves the markers just before the vendor call, `await resolveSecrets(input, call.secrets)`: each is replaced by the stored value, a `generate` one with none stored first made (32 random bytes, base64url) and stored, and one with nothing stored fails the call for good. `call.secrets` is `{ get(name), ensure(name, make), delete?(name) }`, resolved through the configured store and explicit bindings (see [Credentials](#credentials)); a fake's and a sandbox run's are in memory (`memorySecrets()`, which a driver's tests use too).
694
+ A secret a resource needs is named, never written. A data file gives `secret("NAME")` (from `sanoma/resources`; `NAME` upper case, as a variable's; sanoma's own, `SANOMA_…`, only in a host's `secrets`) at a write-only field (or an entry of a write-only map), and `secret("NAME", { generate: true })` for one apply makes when none is stored: `database_password: secret("SUPABASE_DB_PASSWORD", { generate: true })`. Declarations, checkpoints and the ledger hold its marker, `{ "$secret": "NAME", "generate": true }`; the resource type refuses one at any other field, and its schema does not judge it. The driver resolves the markers just before the vendor call, `await resolveSecrets(input, call.secrets)`: each is replaced by the stored value, a `generate` one with none stored first made (32 random bytes, base64url) and stored, and one with nothing stored fails the call for good, before the vendor call, with the `vendorCode` `secret_not_set` (the run's ledger then says nothing changed at the vendor). `call.secrets` is `{ get(name), ensure(name, make), delete?(name) }`, resolved through the configured store and explicit bindings (see [Credentials](#credentials)); a fake's and a sandbox run's are in memory (`memorySecrets()`, which a driver's tests use too).
691
695
 
692
696
  ### Versions
693
697
 
package/dist/call.d.ts CHANGED
@@ -41,13 +41,44 @@ export interface Placed {
41
41
  * queued behind it, would never start.
42
42
  */
43
43
  export declare function buildCtx(wf: WorkflowDefinition<any, any>, run: Run): any;
44
+ /** The resource instance the call acts on, from the operation's `target`, when it declares one. */
45
+ export declare function targetOf(op: Op, input: unknown): {
46
+ target?: string;
47
+ };
48
+ /** One call as the policy decides it and the ledger records it: an operation and its parsed input. */
49
+ export interface Call {
50
+ op: Op;
51
+ input: unknown;
52
+ }
53
+ /**
54
+ * The calls a call makes: a collection's `saveMany` (`isBatch`) makes one per entry, the
55
+ * collection's `save` or `delete` with the entry as its input, and these are what the policy
56
+ * decides and the ledger records, so a record's history reads the same whether it was saved
57
+ * alone or in a batch; any other call makes itself.
58
+ */
59
+ export declare function callsOf(op: Op, input: unknown, ops: ReadonlyMap<string, Op>): Call[];
60
+ /** The outputs of the calls a call made, from its output: a batch's, one per entry, in order. */
61
+ export declare const outputsOf: (op: Op, output: unknown) => unknown[];
44
62
  /**
45
- * Asks the policy about one call, with the record a collection's `save` or
46
- * `delete` replaces as `before` (`beforeOf`). The runtime's own rule first (`runtimeHold`, over
47
- * the running instance's people): while it holds or denies, the company's policy is not asked.
48
- * Runs inside a step, so it must have no side effects of its own.
63
+ * The decision for a call from those of the calls it makes: a batch is denied when any entry is
64
+ * (the reason naming each denied key), else held when any is (by the first hold), else allowed;
65
+ * any other call's is its own.
49
66
  */
67
+ export declare function decisionOf(op: Op, calls: readonly Call[], decisions: readonly RecordedDecision[], collections: ReadonlyMap<string, Collection>): RecordedDecision;
68
+ /** The keys of a batch's denied entries, for its `policy_denied` (`denied`); nothing for any other call. */
69
+ export declare function deniedKeys(op: Op, calls: readonly Call[], decisions: readonly RecordedDecision[], collections: ReadonlyMap<string, Collection>): {
70
+ denied?: string[];
71
+ };
72
+ /** `decideEach` for one call. */
50
73
  export declare function decide(run: Run, op: Op, input: unknown, connection?: ConnectionSnapshot): Promise<RecordedDecision>;
74
+ /**
75
+ * Asks the policy about each of the calls a call makes (`callsOf`), in order, with the record a
76
+ * collection's `save` or `delete` replaces as `before` (`beforeOf`, each read keyed by its place).
77
+ * The runtime's own rule first (`runtimeHold`, over the running instance's people): while it
78
+ * holds or denies a call, the company's policy is not asked about it. Runs inside a step, so it
79
+ * must have no side effects of its own.
80
+ */
81
+ export declare function decideEach(run: Run, calls: readonly Call[], connection?: ConnectionSnapshot): Promise<RecordedDecision[]>;
51
82
  /**
52
83
  * For a collection's `save` or `delete`, the record it replaces or removes, read once with the
53
84
  * collection's `get` (`read`): `{ before }` when there is one, else nothing, and nothing read
package/dist/call.js CHANGED
@@ -11,7 +11,7 @@ import { allowAll, policyOpOf } from "./policy.js";
11
11
  import { reservedFor, runtimeHold } from "./change.js";
12
12
  import { isChangeOp } from "./resource.js";
13
13
  import { readPeople } from "./resources.js";
14
- import { APPLY_WORKFLOW, approverLabel, CALL_WORKFLOW, CHANGE_MERGE, DATA_VENDOR, errorMessage, fitsOp, LOGIN_CODE_WORKFLOW, problemLine, WORKFLOW_ACTION, } from "./shared.js";
14
+ import { APPLY_WORKFLOW, approverLabel, CALL_WORKFLOW, CHANGE_MERGE, DATA_VENDOR, entryOpsOf, errorMessage, fitsOp, isBatch, LOGIN_CODE_WORKFLOW, problemLine, WORKFLOW_ACTION, } from "./shared.js";
15
15
  /** DBOS took the run from this execution: it cancelled the run, or another process took it over. */
16
16
  const takenByDbos = (err) => causes(err).some((e) => e instanceof DBOSErrors.DBOSWorkflowCancelledError || e instanceof DBOSWorkflowConflictError);
17
17
  /**
@@ -208,7 +208,7 @@ function strict(obj, path, workflow) {
208
208
  });
209
209
  }
210
210
  /** The resource instance the call acts on, from the operation's `target`, when it declares one. */
211
- function targetOf(op, input) {
211
+ export function targetOf(op, input) {
212
212
  if (!op.target)
213
213
  return {};
214
214
  const target = op.target(input);
@@ -218,26 +218,94 @@ function targetOf(op, input) {
218
218
  return { target };
219
219
  }
220
220
  /**
221
- * Asks the policy about one call, with the record a collection's `save` or
222
- * `delete` replaces as `before` (`beforeOf`). The runtime's own rule first (`runtimeHold`, over
223
- * the running instance's people): while it holds or denies, the company's policy is not asked.
224
- * Runs inside a step, so it must have no side effects of its own.
221
+ * The calls a call makes: a collection's `saveMany` (`isBatch`) makes one per entry, the
222
+ * collection's `save` or `delete` with the entry as its input, and these are what the policy
223
+ * decides and the ledger records, so a record's history reads the same whether it was saved
224
+ * alone or in a batch; any other call makes itself.
225
225
  */
226
+ export function callsOf(op, input, ops) {
227
+ if (!isBatch(op))
228
+ return [{ op, input }];
229
+ const { records, deletes } = input;
230
+ const [save, remove] = entryOpsOf(op).map((id) => ops.get(id));
231
+ return [...records.map((e) => ({ op: save, input: e })), ...deletes.map((e) => ({ op: remove, input: e }))];
232
+ }
233
+ /** The outputs of the calls a call made, from its output: a batch's, one per entry, in order. */
234
+ export const outputsOf = (op, output) => (isBatch(op) ? output : [output]);
235
+ /** The key of the record a collection's `save` or `delete` acts on. */
236
+ const keyOf = (op, input, collection) => op.name === "save"
237
+ ? input.record[collection.key]
238
+ : input.key;
239
+ /** A batch's denied entries: each one's key, with its decision. */
240
+ function denialsOf(op, calls, decisions, collections) {
241
+ const collection = collections.get(op.resource);
242
+ return calls.flatMap((c, i) => {
243
+ const decision = decisions[i];
244
+ return decision.kind === "deny" ? [{ key: keyOf(c.op, c.input, collection), decision }] : [];
245
+ });
246
+ }
247
+ /**
248
+ * The decision for a call from those of the calls it makes: a batch is denied when any entry is
249
+ * (the reason naming each denied key), else held when any is (by the first hold), else allowed;
250
+ * any other call's is its own.
251
+ */
252
+ export function decisionOf(op, calls, decisions, collections) {
253
+ if (!isBatch(op))
254
+ return decisions[0];
255
+ const version = decisions[0]?.policyVersion === undefined ? {} : { policyVersion: decisions[0].policyVersion };
256
+ const denied = denialsOf(op, calls, decisions, collections);
257
+ if (denied.length) {
258
+ const reasons = [...new Set(denied.flatMap(({ decision }) => decision.reasons ?? []))];
259
+ const reason = denied.map(({ key, decision }) => `${key}: ${decision.reason}`).join("; ");
260
+ return { kind: "deny", reason, ...(reasons.length && { reasons }), ...version };
261
+ }
262
+ return decisions.find((d) => d.kind === "approve") ?? { kind: "allow", ...version };
263
+ }
264
+ /** The keys of a batch's denied entries, for its `policy_denied` (`denied`); nothing for any other call. */
265
+ export function deniedKeys(op, calls, decisions, collections) {
266
+ if (!isBatch(op))
267
+ return {};
268
+ return { denied: denialsOf(op, calls, decisions, collections).map(({ key }) => key) };
269
+ }
270
+ /** `decideEach` for one call. */
226
271
  export async function decide(run, op, input, connection) {
272
+ const [decision] = await decideEach(run, [{ op, input }], connection);
273
+ return decision;
274
+ }
275
+ /**
276
+ * Asks the policy about each of the calls a call makes (`callsOf`), in order, with the record a
277
+ * collection's `save` or `delete` replaces as `before` (`beforeOf`, each read keyed by its place).
278
+ * The runtime's own rule first (`runtimeHold`, over the running instance's people): while it
279
+ * holds or denies a call, the company's policy is not asked about it. Runs inside a step, so it
280
+ * must have no side effects of its own.
281
+ */
282
+ export async function decideEach(run, calls, connection) {
227
283
  const seen = {
228
284
  id: run.id,
229
285
  workflow: run.workflow,
230
286
  approvals: structuredClone(run.approvals).filter((a) => a.requestedBy !== "policy" || a.connection === connection?.revision),
231
287
  };
232
- // Only a merge is the rule's: no other call reads the people's files.
233
- const held = op.id === CHANGE_MERGE ? runtimeHold(op.id, input, seen.approvals, readPeople(run.state.root).people) : undefined;
234
- if (held)
235
- return held;
236
288
  const { policy } = run.state;
237
- // Keyed by the call (`seq` was taken for it), so a fake answers each read afresh.
238
- const before = await beforeOf(policy, op, input, run.state.collections, (get, key) => driverOf(run, get)?.({ key }, { idempotencyKey: `${run.id}:${run.seq}:before`, runId: run.id, opId: get, attempt: 1, secrets: secretsOf(run) }));
239
- const call = { ...callOf(op, input, run.actor, seen), ...before, ...(connection && { connection }) };
240
- return ask(policy, op.id, () => policy(call), run.state);
289
+ const decisions = [];
290
+ for (const [i, { op, input }] of calls.entries()) {
291
+ // Only a merge is the rule's: no other call reads the people's files.
292
+ const held = op.id === CHANGE_MERGE ? runtimeHold(op.id, input, seen.approvals, readPeople(run.state.root).people) : undefined;
293
+ if (held) {
294
+ decisions.push(held);
295
+ continue;
296
+ }
297
+ // Keyed by the call (`seq` was taken for it) and its place, so a fake answers each read afresh.
298
+ const before = await beforeOf(policy, op, input, run.state.collections, (get, key) => driverOf(run, get)?.({ key }, {
299
+ idempotencyKey: `${run.id}:${run.seq}:before${i ? `:${i}` : ""}`,
300
+ runId: run.id,
301
+ opId: get,
302
+ attempt: 1,
303
+ secrets: secretsOf(run),
304
+ }));
305
+ const call = { ...callOf(op, input, run.actor, seen), ...before, ...(connection && { connection }) };
306
+ decisions.push(ask(policy, op.id, () => policy(call), run.state));
307
+ }
308
+ return decisions;
241
309
  }
242
310
  /** The run's function for an operation: its own fake's in a sandbox run, never a vendor's; else the driver's. */
243
311
  const driverOf = (run, id) => (run.sandbox === undefined ? run.state.drivers : run.fakeDrivers)?.get(id);
@@ -262,9 +330,7 @@ export async function beforeOf(policy, op, input, collections, read) {
262
330
  const collection = op.vendor === DATA_VENDOR ? collections.get(op.resource) : undefined;
263
331
  if (policy === allowAll || !collection || (op.name !== "save" && op.name !== "delete"))
264
332
  return {};
265
- const key = op.name === "save"
266
- ? input.record[collection.key]
267
- : input.key;
333
+ const key = keyOf(op, input, collection);
268
334
  let saved;
269
335
  try {
270
336
  saved = (await read(`${DATA_VENDOR}.${op.resource}.get`, key));
@@ -371,11 +437,15 @@ async function callOp(run, id, input, place, ref) {
371
437
  });
372
438
  }
373
439
  const parsed = parseOrThrow(op.input, input, `The input to ${op.id} does not match its schema`, { op: op.id });
440
+ // The calls this one makes (a batch's entries), each decided and recorded on its own.
441
+ const calls = callsOf(op, parsed, run.state.ops);
374
442
  // The call's identity (its ledger seq and id, and the driver's idempotency key) is taken
375
443
  // before the first await, so it depends only on the order the workflow made its calls. A
376
444
  // replay skips the step bodies but counts the same way. A call held for an approval is
377
- // numbered before the approval's records, so its op.called sorts ahead of them.
378
- const seq = run.seq++;
445
+ // numbered before the approval's records, so its op.called sorts ahead of them. A batch
446
+ // takes a seq per entry.
447
+ const seq = run.seq;
448
+ run.seq += calls.length;
379
449
  // The decision is recorded as a step, so a replay reuses it instead of asking a policy
380
450
  // that may have changed since. The policy must still be deterministic: a run that fails
381
451
  // before the step is recorded asks again.
@@ -394,32 +464,45 @@ async function callOp(run, id, input, place, ref) {
394
464
  // approval, so a call made after a long wait sees the files as they are then.
395
465
  if (run.workflow !== APPLY_WORKFLOW && isChangeOp(op, run.state.types))
396
466
  await refuseDeclared(run, op, parsed);
397
- return decide(run, op, parsed, connection);
467
+ return decideEach(run, calls, connection);
398
468
  }, { name: `policy:${op.id}` });
399
- let decision = await decideStep();
469
+ let decisions = await decideStep();
470
+ let decision = decisionOf(op, calls, decisions, run.state.collections);
471
+ // The records keep the first decisions: a hold stays a hold once its approval let the call through.
472
+ const decided = decisions;
400
473
  const logged = recorded(op, parsed, run.workflow);
401
- const call = {
474
+ /** The call's records, one per call it made, numbered from `seq`, each with its decision and what `outcome` says of it. */
475
+ const records = (outcome, at) => calls.map((c, i) => entry(run, {
402
476
  type: "op.called",
403
- op: op.id,
477
+ op: c.op.id,
404
478
  ...place,
405
- effect: op.effect,
406
- input: logged,
407
- decision,
479
+ ...targetOf(c.op, c.input),
480
+ effect: c.op.effect,
481
+ input: recorded(c.op, c.input, run.workflow),
482
+ decision: decided[i],
408
483
  ...(connection && { connection }),
484
+ ...outcome(i),
485
+ }, { seq: seq + i, ...(at !== undefined && { at }) }));
486
+ const writeFailures = async (outcome, err, at) => {
487
+ for (const record of records(outcome, at))
488
+ await writeFailure(run, record, err);
409
489
  };
410
490
  // Each hold is lifted in turn: once one is approved, the policy is asked again, with it.
411
491
  for (;;) {
412
492
  if (decision.kind === "deny") {
413
- const err = new PolicyDeniedError(op.id, decision.reason);
414
- await writeFailure(run, entry(run, { ...call, decision, error: errorInfo(err), durationMs: 0 }, { seq }), err);
493
+ const err = new PolicyDeniedError(op.id, decision.reason, deniedKeys(op, calls, decisions, run.state.collections));
494
+ // A deny after an approval is recorded as the deny, with its reason, not as the hold.
495
+ await writeFailures((i) => ({ decision: decisions[i], error: errorInfo(err), durationMs: 0 }), err);
415
496
  throw err;
416
497
  }
417
498
  if (decision.kind !== "approve")
418
499
  break;
419
500
  const title = decision.title ?? `${op.id} needs ${approverLabel(decision.approver)}`;
420
501
  try {
421
- // A hold covers the call it held.
422
- await awaitApproval(run, title, { approver: decision.approver, covers: [op.id] }, place, {
502
+ // A hold covers the call it held and the calls of a batch it held, each decided again once it is approved.
503
+ const held = calls.filter((_, i) => decisions[i].kind === "approve").map((c) => c.op.id);
504
+ const covers = [...new Set([op.id, ...held])];
505
+ await awaitApproval(run, title, { approver: decision.approver, covers }, place, {
423
506
  op: op.id,
424
507
  seq,
425
508
  input: logged,
@@ -432,12 +515,12 @@ async function callOp(run, id, input, place, ref) {
432
515
  const code = errorCode(err);
433
516
  if (code === "approval_rejected" || code === "approval_withdrawn") {
434
517
  const approval = err.data.approvalId;
435
- const record = entry(run, { ...call, approval, error: errorInfo(err), durationMs: 0 }, { seq });
436
- await writeFailure(run, record, err);
518
+ await writeFailures(() => ({ approval, error: errorInfo(err), durationMs: 0 }), err);
437
519
  }
438
520
  throw err;
439
521
  }
440
- decision = await decideStep();
522
+ decisions = await decideStep();
523
+ decision = decisionOf(op, calls, decisions, run.state.collections);
441
524
  }
442
525
  const started = Date.now();
443
526
  // The try DBOS is on, as it passes it to the step. The last try's error is not retried, so
@@ -474,18 +557,23 @@ async function callOp(run, id, input, place, ref) {
474
557
  });
475
558
  }
476
559
  catch (err) {
477
- // The step failed for good; on replay DBOS rethrows the recorded error, and this record
478
- // gets the same id. A success record would too, so a call has one op.called at most.
479
- const record = entry(run, { ...call, error: errorInfo(err), durationMs: Date.now() - started, ...(attempt ? { attempt } : {}) }, { seq, at: started });
480
- if (isInfrastructureError(err, run.state))
481
- skipped(record, `the call was interrupted (${errorMessage(err)})`);
560
+ // The step failed for good; on replay DBOS rethrows the recorded error, and these records
561
+ // get the same ids. A success record would too, so a call has one op.called at most.
562
+ const failed = () => ({ error: errorInfo(err), durationMs: Date.now() - started, ...(attempt ? { attempt } : {}) });
563
+ if (isInfrastructureError(err, run.state)) {
564
+ for (const record of records(failed, started))
565
+ skipped(record, `the call was interrupted (${errorMessage(err)})`);
566
+ }
482
567
  else
483
- await writeFailure(run, record, err);
568
+ await writeFailures(failed, err, started);
484
569
  throw err;
485
570
  }
486
571
  const { output, at, durationMs } = result;
572
+ const outputs = outputsOf(op, output);
487
573
  try {
488
- await write(run, entry(run, { ...call, output: recorded(op, output, run.workflow), durationMs, attempt: result.attempt }, { seq, at }));
574
+ for (const record of records((i) => ({ output: recorded(calls[i].op, outputs[i], run.workflow), durationMs, attempt: result.attempt }), at)) {
575
+ await write(run, record);
576
+ }
489
577
  }
490
578
  catch (err) {
491
579
  // The vendor acted, and nothing records it. A workflow that caught this and called again
package/dist/call.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"call.js","sourceRoot":"","sources":["../src/call.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,yBAAyB,EAAE,KAAK,IAAI,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC1F,OAAO,EAAE,aAAa,EAAwB,MAAM,gBAAgB,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,EACL,UAAU,EAIV,qBAAqB,EACrB,QAAQ,EAER,UAAU,EAEV,UAAU,GAGX,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,MAAM,EACN,SAAS,EACT,SAAS,EACT,OAAO,EACP,QAAQ,EACR,YAAY,EACZ,iBAAiB,EACjB,WAAW,GACZ,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChF,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAoB,IAAI,EAAW,MAAM,SAAS,CAAC;AAC1D,OAAO,EAA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