From 2533505fed683888f8fb05b52eb4f7063d4c63a9 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Nov 2026 04:27:13 +0000 Subject: [PATCH 1/4] docs(skills): flow teaching text spells only shapes the publish checks accept The automation skill, the schedule trigger README, two showcase comments and the start-node schedule refusals offered cron shapes with no timezone and described label comparisons and unknown subflow names as passing validation. Wording only. Claude-Session: https://claude.ai/code/session_01QSeKYkHoFSRK5JsuPYqbtc Co-authored-by: Claude --- .../36718-flow-teaching-accepted-shapes.md | 16 ++++++++++++++++ .../app-showcase/src/automation/flows/index.ts | 6 +++--- .../src/automation/flow-start-config-refusals.ts | 12 ++++++------ packages/triggers/trigger-schedule/README.md | 6 +++++- skills/objectstack-automation/SKILL.md | 10 ++++++---- .../evals/flows-triggers-approvals.json | 2 +- .../references/examples-flows.md | 5 +++-- .../references/integration-recipes.md | 4 ++-- 8 files changed, 42 insertions(+), 19 deletions(-) create mode 100644 .changeset/36718-flow-teaching-accepted-shapes.md diff --git a/.changeset/36718-flow-teaching-accepted-shapes.md b/.changeset/36718-flow-teaching-accepted-shapes.md new file mode 100644 index 00000000000..afc45fe5ff8 --- /dev/null +++ b/.changeset/36718-flow-teaching-accepted-shapes.md @@ -0,0 +1,16 @@ +--- +'@objectstack/skills': patch +'@objectstack/spec': patch +'@objectstack/trigger-schedule': patch +--- + +docs(skills): the automation skill, the schedule trigger README and the start-node schedule refusals spell only flow shapes the publish checks accept + +Clause-②: no +Metadata-protocol: none + +The ten publish-time flow checks (`flow-schedule-timezone-missing`, `flow-condition-option-label`, `flow-node-write-unknown-option`, `flow-subflow-unknown` and the rest) landed without the text that teaches flows. Wording only; no schema, rule or reader changes. + +- `@objectstack/spec`: the three refusals of a start node's `config.schedule` (an empty string, a typed schedule the published schema refuses, a value the readers read nothing from) now offer `{ type: 'cron', expression: '0 8 * * *', timezone: 'UTC' }` as the cron to write. They no longer offer a bare cron string or a cron object with no `timezone`, which `os validate` warns on. The typed-alias hint names `{ type: 'cron', expression: '…', timezone: 'UTC' }`. What is refused is unchanged. +- `objectstack-automation` skill: recipe 1's nightly cron states `timezone: 'UTC'`; the schedule example's comment says a bare cron string, like any cron with no `timezone`, runs in UTC and warns; the `subflow` row names the `flow-subflow-unknown` warning; the select-label rule says publish and `os validate` refuse a start condition or a `fields` write that uses an option's label where the options are inline, and names what is not judged (an edge condition, a `filter`, a `picklist` field). Eval 1's expected answer states the cron's `timezone`. +- `@objectstack/trigger-schedule` README: the time-relative example's cron states `timezone: 'UTC'`, and the schedule-shapes table is followed by the UTC reading and the warning. diff --git a/examples/app-showcase/src/automation/flows/index.ts b/examples/app-showcase/src/automation/flows/index.ts index a2407f05323..6218d66d8c5 100644 --- a/examples/app-showcase/src/automation/flows/index.ts +++ b/examples/app-showcase/src/automation/flows/index.ts @@ -442,8 +442,8 @@ export const ScheduledDigestFlow = defineFlow({ // this filled dev.db to 260MB+ over a multi-day `pnpm dev`. 60s keeps // the schedule trigger observable within a minute while cutting the // write rate 3x. Production digests use a cron expression instead, - // e.g. { type: 'cron', expression: '0 8 * * *' }. Real bounding comes - // from the lifecycle/retention work (ADR-0057), not this number. + // e.g. { type: 'cron', expression: '0 8 * * *', timezone: 'UTC' }. Real + // bounding comes from the lifecycle/retention work (ADR-0057), not this number. schedule: { type: 'interval', intervalMs: 60000 }, }, }, @@ -2044,7 +2044,7 @@ export const TaskDueReminderFlow = defineFlow({ filter: { status: { $ne: 'done' } }, // optional, ANDed with the date window }, // schedule defaults to daily 08:00 UTC; override with - // schedule: { type: 'cron', expression: '0 8 * * *' } + // schedule: { type: 'cron', expression: '0 8 * * *', timezone: 'UTC' } }, }, // "Your task is due" has nobody to address on a task with no assignee, so diff --git a/packages/spec/src/automation/flow-start-config-refusals.ts b/packages/spec/src/automation/flow-start-config-refusals.ts index 837ceab7107..0122dabb9e9 100644 --- a/packages/spec/src/automation/flow-start-config-refusals.ts +++ b/packages/spec/src/automation/flow-start-config-refusals.ts @@ -90,7 +90,7 @@ export function flowStartScheduleReadsNothing(raw: unknown): boolean { function typedAliasHint(raw: Record): string { const has = (k: string) => Object.prototype.hasOwnProperty.call(raw, k); if (raw.type === 'cron' && has('cron') && !has('expression')) { - return " A typed cron schedule names its cron in `expression`, not `cron`: write `{ type: 'cron', expression: '…' }`."; + return " A typed cron schedule names its cron in `expression`, not `cron`: write `{ type: 'cron', expression: '…', timezone: 'UTC' }`."; } if (raw.type === 'interval' && has('every') && !has('intervalMs')) { return " A typed interval schedule names its period in `intervalMs`, not `every`: write `{ type: 'interval', intervalMs: … }`."; @@ -102,8 +102,8 @@ function scheduleRefusal(raw: unknown): string | undefined { if (raw == null || typeof raw === 'string') { return typeof raw === 'string' && flowStartScheduleReadsNothing(raw) ? 'The start node\'s `config.schedule` is an empty string, so no schedule is read from it: a schedule ' + - 'flow stays unbound and a time-relative sweep falls back to daily 08:00 UTC. Write a cron expression ' + - "(e.g. '0 8 * * *') or remove the key." + 'flow stays unbound and a time-relative sweep falls back to daily 08:00 UTC. Write ' + + "`{ type: 'cron', expression: '0 8 * * *', timezone: 'UTC' }` or remove the key." : undefined; } if (isRecord(raw) && Object.prototype.hasOwnProperty.call(raw, 'type')) { @@ -117,7 +117,7 @@ function scheduleRefusal(raw: unknown): string | undefined { ' The schedule ' + 'readers cannot use it, so a schedule flow stays unbound and a time-relative sweep falls back to daily ' + "08:00 UTC. Write `{ type: 'cron', expression: '0 8 * * *', timezone: 'UTC' }`, " + - "`{ type: 'interval', intervalMs: 60000 }` or `{ type: 'once', at: '' }`, or a bare cron string." + "`{ type: 'interval', intervalMs: 60000 }` or `{ type: 'once', at: '' }`." ); } } @@ -125,8 +125,8 @@ function scheduleRefusal(raw: unknown): string | undefined { return ( 'The start node\'s `config.schedule` names no schedule the readers can use (a cron `expression` as a ' + 'string, a positive `intervalMs`, or an `at` datetime), so a schedule flow stays unbound and a ' + - 'time-relative sweep falls back to daily 08:00 UTC. Write a cron string such as \'0 8 * * *\', or ' + - "`{ type: 'cron', expression: '0 8 * * *' }`, `{ type: 'interval', intervalMs: 60000 }` or " + + 'time-relative sweep falls back to daily 08:00 UTC. Write ' + + "`{ type: 'cron', expression: '0 8 * * *', timezone: 'UTC' }`, `{ type: 'interval', intervalMs: 60000 }` or " + "`{ type: 'once', at: '' }`." ); } diff --git a/packages/triggers/trigger-schedule/README.md b/packages/triggers/trigger-schedule/README.md index 2f4fd8bdf3c..105a9ad854c 100644 --- a/packages/triggers/trigger-schedule/README.md +++ b/packages/triggers/trigger-schedule/README.md @@ -66,6 +66,10 @@ refusal names the spelling you wrote. | `{ type: 'interval', intervalMs }` / `{ every }` | interval | | `{ type: 'once', at }` / `{ at }` | once | +A cron with no `timezone` runs in UTC, and `os validate` warns on it +(`flow-schedule-timezone-missing`). Author the first row with its `timezone` +(`'UTC'` when UTC is meant); the bare string cannot carry one. + ## Usage ```ts @@ -127,7 +131,7 @@ schedule and launched **once per matching record**: maxRecords: 1000, // optional per-sweep cap (default 1000) }, organization: '', // REQUIRED — same refusal as above - schedule: { type: 'cron', expression: '0 8 * * *' }, // optional; defaults to daily 08:00 UTC + schedule: { type: 'cron', expression: '0 8 * * *', timezone: 'UTC' }, // optional; defaults to daily 08:00 UTC condition: '...', // optional per-record start-condition gate }, } diff --git a/skills/objectstack-automation/SKILL.md b/skills/objectstack-automation/SKILL.md index b6777d1790a..f800fc6cc47 100644 --- a/skills/objectstack-automation/SKILL.md +++ b/skills/objectstack-automation/SKILL.md @@ -78,7 +78,7 @@ Built-in (plugins register more; a `type` none runs is refused at a server's pub | `try_catch` | Run `config.try`; on failure run `config.catch` with the error in `errorVariable` (default `$error`); `config.retry` re-runs `try` with backoff first; in a `record-after-*` flow it (or `errorHandling.strategy: 'retry'`) may not reach an inline `http` / `connector_action`: the save would wait out every attempt. Inside a `subflow` / `map` child, retried by either flow, that is **silent**: the flow saves but never arms (`GET /api/v1/automation/_status`: `bound: false`, `unboundCause: retried_callout_in_subflow`) until the child's `http` is `durable: true` or nothing retries the call. **No `finally`** — the container's ordinary out-edges are the continuation | | `map` | Sequential multi-instance — invoke the `config.flowName` flow (named as `subflow`'s) per item of `config.collection` (shaped as `loop`'s); each may pause (batch approvals); a refused name fails it at the first item | | `wait` | Pause until a timer elapses or a named signal arrives | -| `subflow` | Invoke the flow bare `config.flowName` names: a package's flow gets its own, else the one holder in its `dependencies` closure plus `sys`; a package-less flow, the environment's, else the one package holder. Else `os validate` passes and the node fails at run time (`subflow 'X' failed: …` naming every candidate; no `code`): `outside-closure` — held only by an undeclared package (declare it) or the environment; `ambiguous-in-closure` / `ambiguous-in-environment` — two packages hold it (package / package-less caller) | +| `subflow` | Invoke the flow bare `config.flowName` names: a package's flow gets its own, else the one holder in its `dependencies` closure plus `sys`; a package-less flow, the environment's, else the one package holder. Else `os validate` passes (warning `flow-subflow-unknown` when no flow in the stack has the name, as when another installed package ships it) and the node fails at run time (`subflow 'X' failed: …` naming every candidate; no `code`): `outside-closure` — held only by an undeclared package (declare it) or the environment; `ambiguous-in-closure` / `ambiguous-in-environment` — two packages hold it (package / package-less caller) | | `parallel_gateway` / `join_gateway` / `boundary_event` | BPMN-interop forms a `parallel` / `try_catch` container lowers into; author the container | #### Data Operations @@ -322,9 +322,11 @@ Most are caught by `objectstack build`: 4. **A `select` is compared and written by its option `value`, never its label.** The request speaks the label ("Lost"); the row stores the `value` (`lost`). - `condition: "record.status == 'Lost'"` parses, matches no row: the flow - stages clean and never fires; `fields: { status: 'Lost' }` / a `filter` - fails the run (`invalid_option`). Read the field's `options`. + A start `condition: "record.status == 'Lost'"` matches no row and + `fields: { status: 'Lost' }` / a `filter` fails the run (`invalid_option`): + publish and `os validate` refuse the first two where the options are inline + (`flow-condition-option-label`, `flow-node-write-unknown-option`); an edge + condition, a `filter` or a `picklist` field is not judged. Read the field's `options`. --- diff --git a/skills/objectstack-automation/evals/flows-triggers-approvals.json b/skills/objectstack-automation/evals/flows-triggers-approvals.json index 5fee84afd1d..376119f8835 100644 --- a/skills/objectstack-automation/evals/flows-triggers-approvals.json +++ b/skills/objectstack-automation/evals/flows-triggers-approvals.json @@ -4,7 +4,7 @@ { "id": 1, "prompt": "Every night at 02:00, mark `subscription` records whose `renewal_date` has passed as `lapsed`; `status` is a readonly field only automation may change.", - "expected_output": "A `defineFlow` with `type: 'schedule'`, the cadence on the START NODE's `config.schedule: { type: 'cron', expression: '0 2 * * *' }` (no top-level `schedule`), `runAs: 'system'` (a readonly field is stripped under `runAs: 'user'`); one `update_record` with a where-map `filter` (`renewal_date: { $lt: '{today}' }`) and `fields: { status: 'lapsed' }` (not `values`), `label` on every node, `edges` (never `next`), an `end` node.", + "expected_output": "A `defineFlow` with `type: 'schedule'`, the cadence on the START NODE's `config.schedule: { type: 'cron', expression: '0 2 * * *', timezone: 'UTC' }` (no top-level `schedule`; the request names no zone, and a cron with none warns `flow-schedule-timezone-missing`), `runAs: 'system'` (a readonly field is stripped under `runAs: 'user'`); one `update_record` with a where-map `filter` (`renewal_date: { $lt: '{today}' }`) and `fields: { status: 'lapsed' }` (not `values`), `label` on every node, `edges` (never `next`), an `end` node.", "files": [], "assertions": { "must_contain": [ diff --git a/skills/objectstack-automation/references/examples-flows.md b/skills/objectstack-automation/references/examples-flows.md index c2a13bcafa4..d8ed0db706d 100644 --- a/skills/objectstack-automation/references/examples-flows.md +++ b/skills/objectstack-automation/references/examples-flows.md @@ -27,8 +27,9 @@ export const EscalateOverdueCasesFlow = defineFlow({ type: 'start', label: 'Daily at 09:00 Shanghai time', // The cadence lives HERE — FlowSchema has NO top-level `schedule` key (a - // named parse error). A bare cron string also works; a cron`…` tag does not. - // A bare expression runs in UTC. A wall-clock hour the request names is + // named parse error). A cron`…` tag does not work; a bare cron string, like + // any cron with no `timezone`, runs in UTC and `os validate` warns + // (`flow-schedule-timezone-missing`). A wall-clock hour the request names is // written AS SAID with its IANA `timezone` — never converted to UTC by hand: // the arithmetic may be right, but nothing then records which zone was meant. config: { schedule: { type: 'cron', expression: '0 9 * * *', timezone: 'Asia/Shanghai' } }, diff --git a/skills/objectstack-automation/references/integration-recipes.md b/skills/objectstack-automation/references/integration-recipes.md index 4d30b8c4fb3..2d9222bc96e 100644 --- a/skills/objectstack-automation/references/integration-recipes.md +++ b/skills/objectstack-automation/references/integration-recipes.md @@ -43,8 +43,8 @@ export const StripeBalanceSweep = defineFlow({ name: 'crm_stripe_balance_sweep', label: 'Stripe balance → house account', type: 'schedule', runAs: 'system', nodes: [ - { id: 'start', type: 'start', label: 'Nightly 03:00', - config: { schedule: { type: 'cron', expression: '0 3 * * *' } } }, + { id: 'start', type: 'start', label: 'Nightly 03:00 UTC', + config: { schedule: { type: 'cron', expression: '0 3 * * *', timezone: 'UTC' } } }, { id: 'bal', type: 'connector_action', label: 'GET /v1/balance', connectorConfig: { connectorId: 'stripe', actionId: 'GetBalance', input: {} } }, { id: 'write', type: 'update_record', label: 'Write balance', config: { From ec3822d63a91126bcc49a2f9603e30bdece2fe84 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Nov 2026 04:31:57 +0000 Subject: [PATCH 2/4] docs(skills): pay the flow teaching edits inside each file's token ceiling Each rewritten sentence replaces the stale words it corrects, and recipe 1 shortens two node labels for the timezone key, so no skill file grows. Claude-Session: https://claude.ai/code/session_01QSeKYkHoFSRK5JsuPYqbtc Co-authored-by: Claude --- .changeset/36718-flow-teaching-accepted-shapes.md | 2 +- skills/objectstack-automation/SKILL.md | 10 ++++------ .../references/examples-flows.md | 5 ++--- .../references/integration-recipes.md | 4 ++-- 4 files changed, 9 insertions(+), 12 deletions(-) diff --git a/.changeset/36718-flow-teaching-accepted-shapes.md b/.changeset/36718-flow-teaching-accepted-shapes.md index afc45fe5ff8..b41b6227338 100644 --- a/.changeset/36718-flow-teaching-accepted-shapes.md +++ b/.changeset/36718-flow-teaching-accepted-shapes.md @@ -12,5 +12,5 @@ Metadata-protocol: none The ten publish-time flow checks (`flow-schedule-timezone-missing`, `flow-condition-option-label`, `flow-node-write-unknown-option`, `flow-subflow-unknown` and the rest) landed without the text that teaches flows. Wording only; no schema, rule or reader changes. - `@objectstack/spec`: the three refusals of a start node's `config.schedule` (an empty string, a typed schedule the published schema refuses, a value the readers read nothing from) now offer `{ type: 'cron', expression: '0 8 * * *', timezone: 'UTC' }` as the cron to write. They no longer offer a bare cron string or a cron object with no `timezone`, which `os validate` warns on. The typed-alias hint names `{ type: 'cron', expression: '…', timezone: 'UTC' }`. What is refused is unchanged. -- `objectstack-automation` skill: recipe 1's nightly cron states `timezone: 'UTC'`; the schedule example's comment says a bare cron string, like any cron with no `timezone`, runs in UTC and warns; the `subflow` row names the `flow-subflow-unknown` warning; the select-label rule says publish and `os validate` refuse a start condition or a `fields` write that uses an option's label where the options are inline, and names what is not judged (an edge condition, a `filter`, a `picklist` field). Eval 1's expected answer states the cron's `timezone`. +- `objectstack-automation` skill: recipe 1's nightly cron states `timezone: 'UTC'`; the schedule example's comment says a cron with no `timezone` (a bare string) runs in UTC and warns, where it said a bare cron string also works; the `subflow` row says `os validate` may warn, where it said it passes; the select-label rule says a start condition or a `fields` write that uses an option's label is refused at publish where the options are inline, where it said the flow stages clean. Eval 1's expected answer states the cron's `timezone`. No file grows: each new word replaces one, and two node labels in recipe 1 are shortened to pay for the `timezone` key. - `@objectstack/trigger-schedule` README: the time-relative example's cron states `timezone: 'UTC'`, and the schedule-shapes table is followed by the UTC reading and the warning. diff --git a/skills/objectstack-automation/SKILL.md b/skills/objectstack-automation/SKILL.md index f800fc6cc47..c0121a9ab11 100644 --- a/skills/objectstack-automation/SKILL.md +++ b/skills/objectstack-automation/SKILL.md @@ -78,7 +78,7 @@ Built-in (plugins register more; a `type` none runs is refused at a server's pub | `try_catch` | Run `config.try`; on failure run `config.catch` with the error in `errorVariable` (default `$error`); `config.retry` re-runs `try` with backoff first; in a `record-after-*` flow it (or `errorHandling.strategy: 'retry'`) may not reach an inline `http` / `connector_action`: the save would wait out every attempt. Inside a `subflow` / `map` child, retried by either flow, that is **silent**: the flow saves but never arms (`GET /api/v1/automation/_status`: `bound: false`, `unboundCause: retried_callout_in_subflow`) until the child's `http` is `durable: true` or nothing retries the call. **No `finally`** — the container's ordinary out-edges are the continuation | | `map` | Sequential multi-instance — invoke the `config.flowName` flow (named as `subflow`'s) per item of `config.collection` (shaped as `loop`'s); each may pause (batch approvals); a refused name fails it at the first item | | `wait` | Pause until a timer elapses or a named signal arrives | -| `subflow` | Invoke the flow bare `config.flowName` names: a package's flow gets its own, else the one holder in its `dependencies` closure plus `sys`; a package-less flow, the environment's, else the one package holder. Else `os validate` passes (warning `flow-subflow-unknown` when no flow in the stack has the name, as when another installed package ships it) and the node fails at run time (`subflow 'X' failed: …` naming every candidate; no `code`): `outside-closure` — held only by an undeclared package (declare it) or the environment; `ambiguous-in-closure` / `ambiguous-in-environment` — two packages hold it (package / package-less caller) | +| `subflow` | Invoke the flow bare `config.flowName` names: a package's flow gets its own, else the one holder in its `dependencies` closure plus `sys`; a package-less flow, the environment's, else the one package holder. Else `os validate` may warn and the node fails at run time (`subflow 'X' failed: …` naming every candidate; no `code`): `outside-closure` — held only by an undeclared package (declare it) or the environment; `ambiguous-in-closure` / `ambiguous-in-environment` — two packages hold it (package / package-less caller) | | `parallel_gateway` / `join_gateway` / `boundary_event` | BPMN-interop forms a `parallel` / `try_catch` container lowers into; author the container | #### Data Operations @@ -322,11 +322,9 @@ Most are caught by `objectstack build`: 4. **A `select` is compared and written by its option `value`, never its label.** The request speaks the label ("Lost"); the row stores the `value` (`lost`). - A start `condition: "record.status == 'Lost'"` matches no row and - `fields: { status: 'Lost' }` / a `filter` fails the run (`invalid_option`): - publish and `os validate` refuse the first two where the options are inline - (`flow-condition-option-label`, `flow-node-write-unknown-option`); an edge - condition, a `filter` or a `picklist` field is not judged. Read the field's `options`. + A start `condition: "record.status == 'Lost'"` or `fields: { status: 'Lost' }` + is refused at publish (inline options), else matches no row or fails the + run (`invalid_option`). Read the field's `options`. --- diff --git a/skills/objectstack-automation/references/examples-flows.md b/skills/objectstack-automation/references/examples-flows.md index d8ed0db706d..335d57b4170 100644 --- a/skills/objectstack-automation/references/examples-flows.md +++ b/skills/objectstack-automation/references/examples-flows.md @@ -27,9 +27,8 @@ export const EscalateOverdueCasesFlow = defineFlow({ type: 'start', label: 'Daily at 09:00 Shanghai time', // The cadence lives HERE — FlowSchema has NO top-level `schedule` key (a - // named parse error). A cron`…` tag does not work; a bare cron string, like - // any cron with no `timezone`, runs in UTC and `os validate` warns - // (`flow-schedule-timezone-missing`). A wall-clock hour the request names is + // named parse error). A cron`…` tag fails. A cron with no `timezone` + // (a bare string) runs in UTC and warns. A wall-clock hour the request names is // written AS SAID with its IANA `timezone` — never converted to UTC by hand: // the arithmetic may be right, but nothing then records which zone was meant. config: { schedule: { type: 'cron', expression: '0 9 * * *', timezone: 'Asia/Shanghai' } }, diff --git a/skills/objectstack-automation/references/integration-recipes.md b/skills/objectstack-automation/references/integration-recipes.md index 2d9222bc96e..03afc0ed6a4 100644 --- a/skills/objectstack-automation/references/integration-recipes.md +++ b/skills/objectstack-automation/references/integration-recipes.md @@ -43,11 +43,11 @@ export const StripeBalanceSweep = defineFlow({ name: 'crm_stripe_balance_sweep', label: 'Stripe balance → house account', type: 'schedule', runAs: 'system', nodes: [ - { id: 'start', type: 'start', label: 'Nightly 03:00 UTC', + { id: 'start', type: 'start', label: 'Nightly', config: { schedule: { type: 'cron', expression: '0 3 * * *', timezone: 'UTC' } } }, { id: 'bal', type: 'connector_action', label: 'GET /v1/balance', connectorConfig: { connectorId: 'stripe', actionId: 'GetBalance', input: {} } }, - { id: 'write', type: 'update_record', label: 'Write balance', config: { + { id: 'write', type: 'update_record', label: 'Write', config: { objectName: 'crm_account', filter: { is_house_account: true }, fields: { stripe_available: { dialect: 'cel', source: 'bal.body.available[0].amount / 100.0' }, stripe_synced_at: { dialect: 'cel', source: 'isoDatetime(now())' } } } }, From 9e163110611c593fe8bb16a6dc4bf6fb1b7f52a8 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Nov 2026 10:42:59 +0000 Subject: [PATCH 3/4] docs(skills): the subflow row and the select-label rule say what the checks read The `subflow` row no longer ties the `os validate` warning to the name that fails at run time: `flow-subflow-unknown` warns on any name the stack does not hold, a correct call to another package's flow included. Item 4 names the `filter` and edge-condition trap again, as measured: no check reads a label there and the run succeeds matching nothing. Eval 20's answer key states the warning. The changeset says what holds about file size and which checks are warnings. SKILL.md stays inside its token ceiling: the new words are paid for by shorter table rows. Claude-Session: https://claude.ai/code/session_01QSeKYpEsWWE9Y5YtSsDgqZ Co-authored-by: Claude --- .../36718-flow-teaching-accepted-shapes.md | 4 +- skills/objectstack-automation/SKILL.md | 37 ++++++++++--------- .../evals/flows-triggers-approvals.json | 2 +- 3 files changed, 22 insertions(+), 21 deletions(-) diff --git a/.changeset/36718-flow-teaching-accepted-shapes.md b/.changeset/36718-flow-teaching-accepted-shapes.md index b41b6227338..a460cf879ae 100644 --- a/.changeset/36718-flow-teaching-accepted-shapes.md +++ b/.changeset/36718-flow-teaching-accepted-shapes.md @@ -9,8 +9,8 @@ docs(skills): the automation skill, the schedule trigger README and the start-no Clause-②: no Metadata-protocol: none -The ten publish-time flow checks (`flow-schedule-timezone-missing`, `flow-condition-option-label`, `flow-node-write-unknown-option`, `flow-subflow-unknown` and the rest) landed without the text that teaches flows. Wording only; no schema, rule or reader changes. +Ten flow checks of `os validate` and publish (`flow-schedule-timezone-missing`, `flow-condition-option-label`, `flow-node-write-unknown-option`, `flow-subflow-unknown` and the rest) landed without the text that teaches flows. Three of them are warnings and refuse nothing: `flow-schedule-timezone-missing`, `flow-subflow-unknown` (run by the CLI only) and `flow-create-update-pair`. Wording only; no schema, rule or reader changes. - `@objectstack/spec`: the three refusals of a start node's `config.schedule` (an empty string, a typed schedule the published schema refuses, a value the readers read nothing from) now offer `{ type: 'cron', expression: '0 8 * * *', timezone: 'UTC' }` as the cron to write. They no longer offer a bare cron string or a cron object with no `timezone`, which `os validate` warns on. The typed-alias hint names `{ type: 'cron', expression: '…', timezone: 'UTC' }`. What is refused is unchanged. -- `objectstack-automation` skill: recipe 1's nightly cron states `timezone: 'UTC'`; the schedule example's comment says a cron with no `timezone` (a bare string) runs in UTC and warns, where it said a bare cron string also works; the `subflow` row says `os validate` may warn, where it said it passes; the select-label rule says a start condition or a `fields` write that uses an option's label is refused at publish where the options are inline, where it said the flow stages clean. Eval 1's expected answer states the cron's `timezone`. No file grows: each new word replaces one, and two node labels in recipe 1 are shortened to pay for the `timezone` key. +- `objectstack-automation` skill: recipe 1's nightly cron states `timezone: 'UTC'`; the schedule example's comment says a cron with no `timezone` (a bare string) runs in UTC and warns, where it said a bare cron string also works; the `subflow` row says `os validate` warns `flow-subflow-unknown` on any name the stack does not hold, a correct call to another package's flow included, where it said `os validate` passes; the select-label rule says a start condition or a `fields` write that uses an option's label is refused at publish where the options are inline, where it said the flow stages clean, and says a label in a `filter` or an edge condition is never checked and silently matches nothing, where it said a `filter` fails the run. Eval 1's expected answer states the cron's `timezone`, and eval 20's states that warning. No skill file passes its token ceiling: `SKILL.md` gains one line, paid for by shorter table rows and separator rows in the same file, and two node labels in recipe 1 are shortened to pay for the `timezone` key. - `@objectstack/trigger-schedule` README: the time-relative example's cron states `timezone: 'UTC'`, and the schedule-shapes table is followed by the UTC reading and the warning. diff --git a/skills/objectstack-automation/SKILL.md b/skills/objectstack-automation/SKILL.md index c0121a9ab11..868820401cb 100644 --- a/skills/objectstack-automation/SKILL.md +++ b/skills/objectstack-automation/SKILL.md @@ -34,10 +34,10 @@ Also vendor-integration callbacks and **assignment rules**. ### Flow Types | Type | When to Use | -|:-----|:------------| -| `autolaunched` | Runs without user interaction — triggered by events, APIs, or other flows | -| `screen` | Presents UI screens | -| `schedule` | Runs on a cron/interval cadence declared on the **start node's `config.schedule`** — or a **per-record date sweep** via `config.timeRelative` | +|:--|:--| +| `autolaunched` | No user interaction: started by events, APIs or other flows | +| `screen` | Shows UI screens | +| `schedule` | Runs on a cron/interval cadence declared on the **start node's `config.schedule`**, or a **per-record date sweep** via `config.timeRelative` | | `record_change` | Fires on record create/update/delete. `autolaunched` + the same `record-*` binding behaves identically; `record_change` also opts into the trigger-readiness lint | | `api` | Inbound **webhook** (*Inbound webhook triggers*); a flow only ever started explicitly is `autolaunched` | @@ -69,33 +69,33 @@ Built-in (plugins register more; a `type` none runs is refused at a server's pub #### Control Flow | Node | Purpose | -|:-----|:--------| -| `start` | Entry point — every flow has exactly one | -| `end` | Exit point — can have multiple | -| `decision` | Conditional branching — routed by **edge `condition` predicates**, not node config | +|:--|:--| +| `start` | Entry point: exactly one per flow | +| `end` | Exit point: one or more | +| `decision` | Branch by **edge `condition` predicates**, not node config | | `loop` | Iterate a **nested `config.body` region** once per item of `config.collection` — a CEL value envelope or an inline list, never a string; `iteratorVariable` (default `item`) and optional `indexVariable` bind inside it, `maxIterations` caps it | | `parallel` | Fan out into `config.branches[]` (≥ 2 regions) run concurrently, **joined implicitly** at block end | | `try_catch` | Run `config.try`; on failure run `config.catch` with the error in `errorVariable` (default `$error`); `config.retry` re-runs `try` with backoff first; in a `record-after-*` flow it (or `errorHandling.strategy: 'retry'`) may not reach an inline `http` / `connector_action`: the save would wait out every attempt. Inside a `subflow` / `map` child, retried by either flow, that is **silent**: the flow saves but never arms (`GET /api/v1/automation/_status`: `bound: false`, `unboundCause: retried_callout_in_subflow`) until the child's `http` is `durable: true` or nothing retries the call. **No `finally`** — the container's ordinary out-edges are the continuation | | `map` | Sequential multi-instance — invoke the `config.flowName` flow (named as `subflow`'s) per item of `config.collection` (shaped as `loop`'s); each may pause (batch approvals); a refused name fails it at the first item | -| `wait` | Pause until a timer elapses or a named signal arrives | -| `subflow` | Invoke the flow bare `config.flowName` names: a package's flow gets its own, else the one holder in its `dependencies` closure plus `sys`; a package-less flow, the environment's, else the one package holder. Else `os validate` may warn and the node fails at run time (`subflow 'X' failed: …` naming every candidate; no `code`): `outside-closure` — held only by an undeclared package (declare it) or the environment; `ambiguous-in-closure` / `ambiguous-in-environment` — two packages hold it (package / package-less caller) | +| `wait` | Pause for a timer or a named signal | +| `subflow` | Invoke the flow bare `config.flowName` names: a package's flow gets its own, else the one holder in its `dependencies` closure plus `sys`; a package-less flow, the environment's, else the one package holder. Else the node fails at run time (`subflow 'X' failed: …` naming every candidate; no `code`): `outside-closure` — held only by an undeclared package (declare it) or the environment; `ambiguous-in-closure` / `ambiguous-in-environment` — two packages hold it (package / package-less caller). `os validate` warns `flow-subflow-unknown` on any name this stack lacks, a correct cross-package call included | | `parallel_gateway` / `join_gateway` / `boundary_event` | BPMN-interop forms a `parallel` / `try_catch` container lowers into; author the container | #### Data Operations | Node | Purpose | -|:-----|:--------| +|:--|:--| | `assignment` | Set variable values | | `create_record` | Insert a record | | `update_record` | Modify records | | `delete_record` | Remove records | -| `get_record` | Fetch records with filters (**no `query_record`**) | +| `get_record` | Fetch records by filter (**no `query_record`**) | | `save_notice` | Tell the saver what this create/update started — record create/update trigger only, not after a pause: **objectstack-data** `rules/lifecycle.md` § Save Notice | #### External Integration | Node | Purpose | -|:-----|:--------| +|:--|:--| | `http` | Call an HTTP API — set `timeoutMs`, or it has no timeout and warns (`flow-http-timeout-missing`). `url` and `headers` are served as written with the definition to every member who can read flows — only `signingSecret` and a start node's `secret` are withheld — so never a credential there: use a declared connector via `connector_action`. Retried after a record change: `durable: true` (outbox-queued, else sent once in the background, unretried; no response) | | `notify` | Send a notification (below) | | `connector_action` | Dispatch an action of a declared connector (§ *Integrations are declared, not coded*) or a plugin's. `connectorConfig.input` is a value-slot map like `subflow` `input`. Evaluated, it is judged against the action's `inputSchema` (`required`, `type`, `items`, a key outside listed `properties`) before dispatch: a breach fails the step `VALIDATION_ERROR` (`fault`-routable); `os validate` does not judge that fit yet. Retried after a record change: drop the retry, or run the flow on demand / on a schedule | @@ -105,13 +105,13 @@ Built-in (plugins register more; a `type` none runs is refused at a server's pub #### Human Decision | Node | Purpose | -|:-----|:--------| +|:--|:--| | `approval` | Route a record for human sign-off | ### `notify` An undeclared key is a named parse error. **RAW** keys are read as written: -a `{token}` in one is refused. The node as JSON (TypeScript: the same +a `{token}` in one is refused. As JSON (TypeScript: the same literal, a `FlowNode`): ```json @@ -321,10 +321,11 @@ Most are caught by `objectstack build`: ``` 4. **A `select` is compared and written by its option `value`, never its label.** - The request speaks the label ("Lost"); the row stores the `value` (`lost`). + The request says "Lost"; the row stores `lost`. A start `condition: "record.status == 'Lost'"` or `fields: { status: 'Lost' }` is refused at publish (inline options), else matches no row or fails the - run (`invalid_option`). Read the field's `options`. + run (`invalid_option`). A label in a `filter` or an edge `condition` is never + checked: it silently matches nothing. Read the field's `options`. --- @@ -417,7 +418,7 @@ token implies the other: ### Trigger Types (start-node `config.triggerType`) | `triggerType` | ObjectQL hook | -|:------|:------| +|:--|:--| | `record-before-create` (can modify/reject) | `beforeInsert` | | `record-after-create` | `afterInsert` | | `record-before-update` | `beforeUpdate` | diff --git a/skills/objectstack-automation/evals/flows-triggers-approvals.json b/skills/objectstack-automation/evals/flows-triggers-approvals.json index 376119f8835..04e430fa2ca 100644 --- a/skills/objectstack-automation/evals/flows-triggers-approvals.json +++ b/skills/objectstack-automation/evals/flows-triggers-approvals.json @@ -354,7 +354,7 @@ { "id": 20, "prompt": "Our package `acme.billing` ships the flow `billing_invoice_paid`. When it runs it should call the `notify_owner` flow that the installed package `acme.crm` ships. Write the node and anything else the package needs.", - "expected_output": "A `type: 'subflow'` node with `config: { flowName: 'notify_owner' }` in `billing_invoice_paid`, plus `acme.billing`'s manifest declaring `dependencies: { 'acme.crm': '^1.0.0' }` (any range). A package flow's bare child name resolves to its own package's flow, else the one holder in its declared dependency closure plus `sys`; without the dependency the flow still passes `os validate`, and the node fails at run time (`outside-closure`, naming `acme.crm`). No copy of `notify_owner` into `acme.billing` or into the environment, and no package-qualified flow name.", + "expected_output": "A `type: 'subflow'` node with `config: { flowName: 'notify_owner' }` in `billing_invoice_paid`, plus `acme.billing`'s manifest declaring `dependencies: { 'acme.crm': '^1.0.0' }` (any range). A package flow's bare child name resolves to its own package's flow, else the one holder in its declared dependency closure plus `sys`; without the dependency the node fails at run time (`outside-closure`, naming `acme.crm`). `os validate` warns `flow-subflow-unknown` here with or without the dependency, because `acme.billing`'s own stack does not hold `notify_owner`: the warning is expected on this correct call and is not that failure. No copy of `notify_owner` into `acme.billing` or into the environment, and no package-qualified flow name.", "files": [], "assertions": { "must_contain": [ From ed201b70523e7a8f738154b0fca2e5bd722628cb Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Nov 2026 11:17:33 +0000 Subject: [PATCH 4/4] docs(changeset): name both things that pay for the SKILL.md line Claude-Session: https://claude.ai/code/session_01QSeKYpEsWWE9Y5YtSsDgqZ Co-authored-by: Claude --- .changeset/36718-flow-teaching-accepted-shapes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/36718-flow-teaching-accepted-shapes.md b/.changeset/36718-flow-teaching-accepted-shapes.md index a460cf879ae..babbf65c6fe 100644 --- a/.changeset/36718-flow-teaching-accepted-shapes.md +++ b/.changeset/36718-flow-teaching-accepted-shapes.md @@ -12,5 +12,5 @@ Metadata-protocol: none Ten flow checks of `os validate` and publish (`flow-schedule-timezone-missing`, `flow-condition-option-label`, `flow-node-write-unknown-option`, `flow-subflow-unknown` and the rest) landed without the text that teaches flows. Three of them are warnings and refuse nothing: `flow-schedule-timezone-missing`, `flow-subflow-unknown` (run by the CLI only) and `flow-create-update-pair`. Wording only; no schema, rule or reader changes. - `@objectstack/spec`: the three refusals of a start node's `config.schedule` (an empty string, a typed schedule the published schema refuses, a value the readers read nothing from) now offer `{ type: 'cron', expression: '0 8 * * *', timezone: 'UTC' }` as the cron to write. They no longer offer a bare cron string or a cron object with no `timezone`, which `os validate` warns on. The typed-alias hint names `{ type: 'cron', expression: '…', timezone: 'UTC' }`. What is refused is unchanged. -- `objectstack-automation` skill: recipe 1's nightly cron states `timezone: 'UTC'`; the schedule example's comment says a cron with no `timezone` (a bare string) runs in UTC and warns, where it said a bare cron string also works; the `subflow` row says `os validate` warns `flow-subflow-unknown` on any name the stack does not hold, a correct call to another package's flow included, where it said `os validate` passes; the select-label rule says a start condition or a `fields` write that uses an option's label is refused at publish where the options are inline, where it said the flow stages clean, and says a label in a `filter` or an edge condition is never checked and silently matches nothing, where it said a `filter` fails the run. Eval 1's expected answer states the cron's `timezone`, and eval 20's states that warning. No skill file passes its token ceiling: `SKILL.md` gains one line, paid for by shorter table rows and separator rows in the same file, and two node labels in recipe 1 are shortened to pay for the `timezone` key. +- `objectstack-automation` skill: recipe 1's nightly cron states `timezone: 'UTC'`; the schedule example's comment says a cron with no `timezone` (a bare string) runs in UTC and warns, where it said a bare cron string also works; the `subflow` row says `os validate` warns `flow-subflow-unknown` on any name the stack does not hold, a correct call to another package's flow included, where it said `os validate` passes; the select-label rule says a start condition or a `fields` write that uses an option's label is refused at publish where the options are inline, where it said the flow stages clean, and says a label in a `filter` or an edge condition is never checked and silently matches nothing, where it said a `filter` fails the run. Eval 1's expected answer states the cron's `timezone`, and eval 20's states that warning. No skill file passes its token ceiling: `SKILL.md` gains one line, paid for by shorter wording and shorter table separator rows in the same file, and two node labels in recipe 1 are shortened to pay for the `timezone` key. - `@objectstack/trigger-schedule` README: the time-relative example's cron states `timezone: 'UTC'`, and the schedule-shapes table is followed by the UTC reading and the warning.