Skip to content

Commit a03bc4e

Browse files
docs(skills): flow teaching text spells only shapes the publish checks accept (#36932)
Fixes #36718 Clause-②: no Metadata-protocol: none ## 维护者速读 - 搭建者和 AI 照着自动化技能、定时触发器说明和报错提示写流程时,照抄的写法不再被发布检查提醒或拦下;已有流程和检查规则本身不变。 - 属于「各种搭建方式共用的底座:发布前检查」专题,上一批收紧了十条流程发布检查,教流程写法的文字当时没有跟上。 - 只改文字,出错时最多是某一句说得不准,可直接撤回;技能包的长度上限没有抬高。 - 请审阅并批准这次对外发布技能包的文字改动。 ## What changes Wording only. No schema, lint rule or reader changes. The ten checks, read off `packages/lint/src` on `main`: `flow-trigger-object-missing`, `flow-condition-option-label`, `flow-time-relative-shadowed`, `flow-time-relative-key-misplaced`, `flow-time-relative-date-field-invalid`, `flow-node-write-unknown-option`, `flow-node-write-date-helper-text` (errors); `flow-schedule-timezone-missing`, `flow-subflow-unknown`, `flow-create-update-pair` (warnings). Every place changed, before → after: | # | Place | Before | After | Check | |---|---|---|---|---| | 1 | `skills/objectstack-automation/SKILL.md`, `subflow` row | Else `os validate` passes and the node fails at run time | Else the node fails at run time (…). `os validate` warns `flow-subflow-unknown` on any name this stack lacks, a correct cross-package call included | `flow-subflow-unknown` | | 2 | `SKILL.md`, *Valid-but-silently-wrong* item 4 | `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`). | 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`). A label in a `filter` or an edge `condition` is never checked: it silently matches nothing. | `flow-condition-option-label`, `flow-node-write-unknown-option`; no check reads a `filter` or an edge condition | | 3 | `references/examples-flows.md`, the schedule example's comment | A bare cron string also works; a cron tag does not. A bare expression runs in UTC. | A cron tag fails. A cron with no `timezone` (a bare string) runs in UTC and warns. | `flow-schedule-timezone-missing` | | 4 | `references/integration-recipes.md`, recipe 1 start node | `schedule: { type: 'cron', expression: '0 3 * * *' }` | `schedule: { type: 'cron', expression: '0 3 * * *', timezone: 'UTC' }` | `flow-schedule-timezone-missing` | | 5 | recipe 1, two node labels (pays for row 4's bytes) | `label: 'Nightly 03:00'`, `label: 'Write balance'` | `label: 'Nightly'`, `label: 'Write'` | token ratchet | | 6 | `evals/flows-triggers-approvals.json`, eval 1 `expected_output` | `config.schedule: { type: 'cron', expression: '0 2 * * *' }` (no top-level `schedule`) | `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`) | `flow-schedule-timezone-missing` | | 7 | `packages/triggers/trigger-schedule/README.md`, time-relative example | `schedule: { type: 'cron', expression: '0 8 * * *' }` | `schedule: { type: 'cron', expression: '0 8 * * *', timezone: 'UTC' }` | `flow-schedule-timezone-missing` | | 8 | the same README, under the *Schedule shapes* table | (nothing) | 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. | `flow-schedule-timezone-missing` | | 9 | `examples/app-showcase/src/automation/flows/index.ts`, comment at 445 | e.g. `{ type: 'cron', expression: '0 8 * * *' }` | e.g. `{ type: 'cron', expression: '0 8 * * *', timezone: 'UTC' }` | `flow-schedule-timezone-missing` | | 10 | the same file, comment at 2047 | `schedule: { type: 'cron', expression: '0 8 * * *' }` | `schedule: { type: 'cron', expression: '0 8 * * *', timezone: 'UTC' }` | `flow-schedule-timezone-missing` | | 11 | `packages/spec/src/automation/flow-start-config-refusals.ts`, empty-string refusal | Write a cron expression (e.g. '0 8 * * *') or remove the key. | Write `{ type: 'cron', expression: '0 8 * * *', timezone: 'UTC' }` or remove the key. | `flow-schedule-timezone-missing` | | 12 | the same file, typed-schedule refusal | Write `{ type: 'cron', … timezone: 'UTC' }`, the interval form or the once form, or a bare cron string. | The same sentence without ", or a bare cron string". | `flow-schedule-timezone-missing` | | 13 | the same file, reads-nothing refusal (the one the card names) | Write a cron string such as '0 8 * * *', or `{ type: 'cron', expression: '0 8 * * *' }`, the interval form or the once form. | Write `{ type: 'cron', expression: '0 8 * * *', timezone: 'UTC' }`, the interval form or the once form. | `flow-schedule-timezone-missing` | | 14 | the same file, typed-alias hint | write `{ type: 'cron', expression: '…' }` | write `{ type: 'cron', expression: '…', timezone: 'UTC' }` | `flow-schedule-timezone-missing` | | 15 | `evals/flows-triggers-approvals.json`, eval 20 `expected_output` | without the dependency the flow still passes `os validate`, and the node fails at run time (`outside-closure`, naming `acme.crm`). | 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. | `flow-subflow-unknown` | | 16 | `SKILL.md`, wording that pays for rows 1 and 2 (no fact removed) | six table separator rows in the long form; `autolaunched`: Runs without user interaction — triggered by events, APIs, or other flows; `screen`: Presents UI screens; `schedule`: … — or a per-record date sweep; `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; `wait`: Pause until a timer elapses or a named signal arrives; `get_record`: Fetch records with filters; The node as JSON; The request speaks the label ("Lost"); the row stores the `value` (`lost`). | the short separator form the file already uses; No user interaction: started by events, APIs or other flows; Shows UI screens; …, or a per-record date sweep; Entry point: exactly one per flow; Exit point: one or more; Branch by edge `condition` predicates, not node config; Pause for a timer or a named signal; Fetch records by filter; As JSON; The request says "Lost"; the row stores `lost`. | token ratchet | Skills size, lines and tokens (the ratchet's count, `ceil(bytes / 4)`): | File | Lines before → after | Tokens before → after | |---|---|---| | `skills/objectstack-automation/SKILL.md` | 479 → 480 | 7045 → 7045 (28199 → 28198 bytes; ceiling 7045) | | `references/examples-flows.md` | 145 → 145 | 1543 → 1543 | | `references/integration-recipes.md` | 186 → 186 | 2594 → 2595 (ceiling 2595) | | `evals/flows-triggers-approvals.json` (eval fixture, not ratcheted) | 450 → 450 | 7078 → 7147 | | all 14 `SKILL.md` files together | 4947 → 4948 | 65225 → 65225 | Net lines across `skills/**`: +1 (budget: at most +40). No ceiling is raised. ## Tests - The real rule table on every extracted example. A scratch harness (not committed) extracts every fenced flow, start-node and node block, every cron the text spells (in prose, comments and the refusal strings) and every start condition and `fields` write the prose spells, from the six listed places; completes each fragment into a flow over objects shaped as the prose describes them (each select with a label that differs from its value); and runs `runAuthoringRules('validate', …)` from the built `@objectstack/lint`, the 78-rule table `os validate` runs. Before (text of `f46ce5b4`): 13 findings from the ten rules on shapes the text offers. After (`ec3822d6`): 0. Four findings remain on shapes the text itself names as refused or warned: the label condition and label write in `SKILL.md` item 4, and the bare string and its normalized form in the README's reader table. - `@objectstack/spec`: `flow-start-config-refusals.test.ts` and `flow.test.ts`, 157 of 157 passed; `typecheck` exit 0. - `check:skill-examples`: 349 marked examples type-check, exit 0. `check:generated`: all 14 generated artifacts up to date, nothing regenerated. - Patch round (commits `9e163110` and `ed201b70`), a run-time trace of the label trap outside the two rules, on a scratch dogfood probe (not committed) booted with `bootStack(…, { automation: true })`: a `select` with inline options `Open`/`open` and `Lost`/`lost`, two rows stored `lost`. `get_record` with `filter: { status: 'Lost' }`: HTTP 200, run `success: true`, `selected: 0` (control `'lost'`: `selected: 2`). `update_record` with the same filter and `multi: true`: `success: true`, `acted: 0`, both rows untouched (control: `acted: 2`). A decision edge `condition: "deal.status == 'Lost'"`: `success: true`, the branch `skipped: 1`, row untouched (control `'lost'`: `acted: 1`). No `invalid_option` on any of the three. The same shapes through `runAuthoringRules('validate', …)` from the built `@objectstack/lint`: no label finding on the `filter` or the edge; the control (label in the start `condition` and in `fields`) answers `flow-condition-option-label` and `flow-node-write-unknown-option`; an unknown `subflow` name answers `flow-subflow-unknown` (warning). - No behaviour a test pins changed, so no ablation. The refusal tests pin each message's head (`is not a schedule at …`, `names no schedule the readers can use`), not the sentence that offers a shape. ## Acceptance notes - Read against each check and left as written, because the validator is silent on them: the `SKILL.md` trigger example (`objectName` present; its condition compares `status` with the value `'escalated'`); the scheduled escalation flow (`timezone: 'Asia/Shanghai'`, writes the value `'escalated'`); the time-relative example and its JSON form (`filter` inside the descriptor, a `date` field, no `triggerType`); recipe 4; the `notify` and `script` node examples. No listed place carries a `subflow` node, a date helper inside a string, or an after-create and after-update pair. - `SKILL.md` item 4 still shows the label forms, as the thing not to write; the sentence now says publish refuses them. It says "inline options" because the two rules judge only a field whose options are inline (a field on a shared `picklist` is skipped). The `filter` trap that `main` named is back, restated as measured: `main` said a label `filter` fails the run (`invalid_option`); it does not, the run succeeds and matches nothing, and the same holds for a label in an edge condition. Neither is read by any check. - The README's *Schedule shapes* table still lists the bare string, because it is the reader's own table (`normalizeSchedule`) and the reader does accept it. The sentence under it now names the warning. - `flow-subflow-unknown` also warns on a correct call to a flow another installed package ships (eval 20's shape): the stack does not hold that flow. That is the rule's stated hedge. The `subflow` row no longer ties the warning to the name that fails at run time: it says the node fails at run time for the non-resolving cases, and separately that `os validate` warns `flow-subflow-unknown` on any name this stack lacks, a correct cross-package call included. Eval 20's answer key says the same (row 15). - Token ratchet: the three skill files sat at zero headroom, and the first wording went over by 74, 19 and 5 tokens. Each new sentence now replaces the stale words it corrects, and recipe 1 gives up two label words for the `timezone` key (row 5). The patch round's two sentences in `SKILL.md` are paid for inside the file by row 16: shorter spellings of eight table cells and two sentences, and the short separator-row form on six tables. No fact, trap or example was removed to pay. - Eval 1's expected answer is edited (row 6). It is the answer key for the nightly-cron case, and it spelled the shape the warning fires on. Its assertions are unchanged. - The harness's findings from other rules are artefacts of completing a fragment (a `notify` node read with no trigger, so `record` is unbound) or the README's placeholder condition `'...'`. None is from the ten rules. - PR #36158 moves most of `SKILL.md` into the references. Every edit here is in place, on the lines listed above; `SKILL.md` gains one line (item 4), no other skill file gains or loses one. - Not run: the `os validate` binary. The harness calls the rule table it runs, on a parsed stack. ## Verification Two-minute check: `node scripts/check-skills-token-ratchet.mjs` exits 0 and prints `(+0)` for the three automation files; `git diff f46ce5b --numstat -- skills` shows equal additions and deletions per file, except `SKILL.md` at 21 added and 20 removed. Read first, by risk: `packages/spec/src/automation/flow-start-config-refusals.ts` (three refusal strings an author is shown), `skills/objectstack-automation/SKILL.md` (item 4 and the `subflow` row), `skills/objectstack-automation/evals/flows-triggers-approvals.json` (eval 1's answer key). <details><summary>Patch-round gate readings (run on 9e16311; head ed201b7 changes one changeset sentence)</summary> - On the final head `ed201b70` (changeset only since `9e163110`), each exit 0: `node scripts/check-skills-token-ratchet.mjs`, `node scripts/check-empty-changeset.mjs --base origin/main`, `node scripts/check-changeset-no-major.mjs --base origin/main`, `node scripts/check-adr-0087-registration.mjs --base origin/main`, `pnpm check:nul-bytes`, `pnpm check:doc-authoring`, `pnpm check:issue-citations`, `pnpm check:published-files`. The readings below are on `9e163110`. - `node scripts/pm/dispatch-gates.mjs --ran`, exit 0: `96 derived famil(ies) accounted for — 95 run, 1 NOT-MEASURED (1 DERIVED from a recorded exit 3)`. The 95 exited 0. NOT MEASURED, exit 3 (a prerequisite refusal, not a finding): `pnpm check:dual-build-cjs-loads` (reads every package's `dist/`). CI runs it. - `node scripts/check-skills-token-ratchet.mjs`, exit 0: `60 authored bundle file(s) within their ceilings`; `SKILL.md` `7045 / 7045 (+0)`, `examples-flows.md` `1543 / 1543 (+0)`, `integration-recipes.md` `2595 / 2595 (+0)`; the eval fixture reads 7147 tokens, not ratcheted. - `pnpm --filter @objectstack/spec run check:skill-examples`, under the verify lock, `VERDICT command-exit 0`: `349 prose examples type-check across 3 surface(s)`. `check:skill-docs`, `check:skill-refs`, `check:skill-served-sections`, `check:skill-links`, `check:skill-identifier-liveness`: exit 0, inside the 95. - The run-time probe, under the verify lock: `VERDICT command-exit 0`, `Tests 1 passed (1)`; the readings are in Tests above. - CI check-runs on `9e163110`: 58 `success`, 11 `skipped`, none failed or pending; `Lint & Repo Gates`, `TypeScript Type Check`, `Test Core`, `Build Core`, `Check Changeset`, `Governed Surface Queue Guard`, `Dogfood Regression Gate`: `success`. </details> <details><summary>Gate and harness readings (first round, head ec3822d)</summary> - Harness, before (`f46ce5b4` text): `TOTAL examples judged: 25 · skipped (no flow shape): 10 · findings from the ten rules on shapes the text offers: 13 · on shapes the text itself names as warned or refused: 0 · registry size: 78`. - Harness, after (`ec3822d6`): `TOTAL examples judged: 24 · skipped (no flow shape): 10 · findings from the ten rules on shapes the text offers: 0 · on shapes the text itself names as warned or refused: 4 · registry size: 78`. One fewer judged: the reads-nothing refusal spelled a cron twice (a bare string and an object) and now spells it once. - Before, by place: `SKILL.md` item 4 (2 errors: `flow-condition-option-label`, `flow-node-write-unknown-option`); `integration-recipes.md` recipe 1 (2, the block and its cron); the README (4: the example block, its cron, the table's bare string and its normalized form); the two showcase comments (2); the refusal file (3). The other 11 are `flow-schedule-timezone-missing` warnings. - `node scripts/pm/dispatch-gates.mjs --ran`: `96 derived famil(ies) accounted for — 93 run, 3 NOT-MEASURED (3 DERIVED from a recorded exit 3)`. The 93 exited 0. - NOT MEASURED locally, exit 3 (a prerequisite refusal, not a finding): `node scripts/check-plugin-teardown-shape.mjs --self-test` (needs an unshallowed clone), `pnpm check:dual-build-cjs-loads` (reads every package's `dist/`), `pnpm check:i18n-coverage` (needs the workspace CLI built). CI runs all three. - `node scripts/check-skills-token-ratchet.mjs`, exit 0: `60 authored bundle file(s) within their ceilings`; the three automation files print `7045 / 7045 (+0)`, `1543 / 1543 (+0)`, `2595 / 2595 (+0)`. - `pnpm --filter @objectstack/spec run check:skill-examples`, exit 0: `349 prose examples type-check across 3 surface(s)`. Its first run refused with exit 3 (the client packages were not built); it passed after `pnpm --filter '@objectstack/client-react...' build`. - `pnpm --filter @objectstack/spec check:generated`, exit 0: `All 14 generated artifacts are up to date`. - Under the verify lock, `VERDICT command-exit 0`: `pnpm --filter @objectstack/spec build`, then `vitest run src/automation/flow-start-config-refusals.test.ts src/automation/flow.test.ts` (`Test Files 2 passed (2)`, `Tests 157 passed (157)`), then `pnpm --filter @objectstack/spec typecheck`. - Not run locally, left to CI: `test:repo`, the example app's own tests (two comments changed there), the full dogfood battery (no `!` title, no narrowing arm). </details> **Seat-written open.** Seat `repo:objectstack#4` (os-justin, `session_01QSeKYpEsWWE9Y5YtSsDgqZ`) opened this draft on the maintainer's ruling in the seat session, verbatim 「一选1+」 (2026-11-24): option 1+ — the seat performs only the writes the dev session's permission classifier refused, each checked against the branch; pull requests stay draft; no standing allow rule is added. Refused in dev session `session_01QSeKYkHoFSRK5JsuPYqbtc`, twice, reason `[Undermining Oversight]`: `node scripts/pm/fleet-write/dispatch.mjs --repo objectstack-ai/objectstack --actions-file FILE` carrying this one `pr_create`. Title and body above are the dev's text, unchanged; branch head checked at `ec3822d6` (2 commits on `f46ce5b4`, 8 files). **Patch round 1** (head `ed201b70`): built by a seat `os-dev` subagent in seat session `session_01QSeKYpEsWWE9Y5YtSsDgqZ` on the L1 REWORK and contract review of `ec3822d6`; this body was rewritten by that round and sent by the seat (os-dev.md: PR body edits after `pr_create` are the seat's). Report: comment 7129961596 on #36718. --- _Generated by [Claude Code](https://claude.ai/code/session_01QSeKYkHoFSRK5JsuPYqbtc)_ <!-- signed: repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ --> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 144d368 commit a03bc4e

8 files changed

Lines changed: 58 additions & 37 deletions

File tree

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
'@objectstack/skills': patch
3+
'@objectstack/spec': patch
4+
'@objectstack/trigger-schedule': patch
5+
---
6+
7+
docs(skills): the automation skill, the schedule trigger README and the start-node schedule refusals spell only flow shapes the publish checks accept
8+
9+
Clause-②: no
10+
Metadata-protocol: none
11+
12+
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.
13+
14+
- `@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.
15+
- `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.
16+
- `@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.

‎examples/app-showcase/src/automation/flows/index.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -442,8 +442,8 @@ export const ScheduledDigestFlow = defineFlow({
442442
// this filled dev.db to 260MB+ over a multi-day `pnpm dev`. 60s keeps
443443
// the schedule trigger observable within a minute while cutting the
444444
// write rate 3x. Production digests use a cron expression instead,
445-
// e.g. { type: 'cron', expression: '0 8 * * *' }. Real bounding comes
446-
// from the lifecycle/retention work (ADR-0057), not this number.
445+
// e.g. { type: 'cron', expression: '0 8 * * *', timezone: 'UTC' }. Real
446+
// bounding comes from the lifecycle/retention work (ADR-0057), not this number.
447447
schedule: { type: 'interval', intervalMs: 60000 },
448448
},
449449
},
@@ -2044,7 +2044,7 @@ export const TaskDueReminderFlow = defineFlow({
20442044
filter: { status: { $ne: 'done' } }, // optional, ANDed with the date window
20452045
},
20462046
// schedule defaults to daily 08:00 UTC; override with
2047-
// schedule: { type: 'cron', expression: '0 8 * * *' }
2047+
// schedule: { type: 'cron', expression: '0 8 * * *', timezone: 'UTC' }
20482048
},
20492049
},
20502050
// "Your task is due" has nobody to address on a task with no assignee, so

‎packages/spec/src/automation/flow-start-config-refusals.ts‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export function flowStartScheduleReadsNothing(raw: unknown): boolean {
9090
function typedAliasHint(raw: Record<string, unknown>): string {
9191
const has = (k: string) => Object.prototype.hasOwnProperty.call(raw, k);
9292
if (raw.type === 'cron' && has('cron') && !has('expression')) {
93-
return " A typed cron schedule names its cron in `expression`, not `cron`: write `{ type: 'cron', expression: '…' }`.";
93+
return " A typed cron schedule names its cron in `expression`, not `cron`: write `{ type: 'cron', expression: '…', timezone: 'UTC' }`.";
9494
}
9595
if (raw.type === 'interval' && has('every') && !has('intervalMs')) {
9696
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 {
102102
if (raw == null || typeof raw === 'string') {
103103
return typeof raw === 'string' && flowStartScheduleReadsNothing(raw)
104104
? 'The start node\'s `config.schedule` is an empty string, so no schedule is read from it: a schedule ' +
105-
'flow stays unbound and a time-relative sweep falls back to daily 08:00 UTC. Write a cron expression ' +
106-
"(e.g. '0 8 * * *') or remove the key."
105+
'flow stays unbound and a time-relative sweep falls back to daily 08:00 UTC. Write ' +
106+
"`{ type: 'cron', expression: '0 8 * * *', timezone: 'UTC' }` or remove the key."
107107
: undefined;
108108
}
109109
if (isRecord(raw) && Object.prototype.hasOwnProperty.call(raw, 'type')) {
@@ -117,16 +117,16 @@ function scheduleRefusal(raw: unknown): string | undefined {
117117
' The schedule ' +
118118
'readers cannot use it, so a schedule flow stays unbound and a time-relative sweep falls back to daily ' +
119119
"08:00 UTC. Write `{ type: 'cron', expression: '0 8 * * *', timezone: 'UTC' }`, " +
120-
"`{ type: 'interval', intervalMs: 60000 }` or `{ type: 'once', at: '<ISO datetime>' }`, or a bare cron string."
120+
"`{ type: 'interval', intervalMs: 60000 }` or `{ type: 'once', at: '<ISO datetime>' }`."
121121
);
122122
}
123123
}
124124
if (!flowStartScheduleReadsNothing(raw)) return undefined;
125125
return (
126126
'The start node\'s `config.schedule` names no schedule the readers can use (a cron `expression` as a ' +
127127
'string, a positive `intervalMs`, or an `at` datetime), so a schedule flow stays unbound and a ' +
128-
'time-relative sweep falls back to daily 08:00 UTC. Write a cron string such as \'0 8 * * *\', or ' +
129-
"`{ type: 'cron', expression: '0 8 * * *' }`, `{ type: 'interval', intervalMs: 60000 }` or " +
128+
'time-relative sweep falls back to daily 08:00 UTC. Write ' +
129+
"`{ type: 'cron', expression: '0 8 * * *', timezone: 'UTC' }`, `{ type: 'interval', intervalMs: 60000 }` or " +
130130
"`{ type: 'once', at: '<ISO datetime>' }`."
131131
);
132132
}

‎packages/triggers/trigger-schedule/README.md‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ refusal names the spelling you wrote.
6666
| `{ type: 'interval', intervalMs }` / `{ every }` | interval |
6767
| `{ type: 'once', at }` / `{ at }` | once |
6868

69+
A cron with no `timezone` runs in UTC, and `os validate` warns on it
70+
(`flow-schedule-timezone-missing`). Author the first row with its `timezone`
71+
(`'UTC'` when UTC is meant); the bare string cannot carry one.
72+
6973
## Usage
7074

7175
```ts
@@ -127,7 +131,7 @@ schedule and launched **once per matching record**:
127131
maxRecords: 1000, // optional per-sweep cap (default 1000)
128132
},
129133
organization: '<sys_organization.id>', // REQUIRED — same refusal as above
130-
schedule: { type: 'cron', expression: '0 8 * * *' }, // optional; defaults to daily 08:00 UTC
134+
schedule: { type: 'cron', expression: '0 8 * * *', timezone: 'UTC' }, // optional; defaults to daily 08:00 UTC
131135
condition: '...', // optional per-record start-condition gate
132136
},
133137
}

‎skills/objectstack-automation/SKILL.md‎

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ Also vendor-integration callbacks and **assignment rules**.
3434
### Flow Types
3535

3636
| Type | When to Use |
37-
|:-----|:------------|
38-
| `autolaunched` | Runs without user interaction — triggered by events, APIs, or other flows |
39-
| `screen` | Presents UI screens |
40-
| `schedule` | Runs on a cron/interval cadence declared on the **start node's `config.schedule`** — or a **per-record date sweep** via `config.timeRelative` |
37+
|:--|:--|
38+
| `autolaunched` | No user interaction: started by events, APIs or other flows |
39+
| `screen` | Shows UI screens |
40+
| `schedule` | Runs on a cron/interval cadence declared on the **start node's `config.schedule`**, or a **per-record date sweep** via `config.timeRelative` |
4141
| `record_change` | Fires on record create/update/delete. `autolaunched` + the same `record-*` binding behaves identically; `record_change` also opts into the trigger-readiness lint |
4242
| `api` | Inbound **webhook** (*Inbound webhook triggers*); a flow only ever started explicitly is `autolaunched` |
4343

@@ -69,33 +69,33 @@ Built-in (plugins register more; a `type` none runs is refused at a server's pub
6969
#### Control Flow
7070

7171
| Node | Purpose |
72-
|:-----|:--------|
73-
| `start` | Entry point — every flow has exactly one |
74-
| `end` | Exit point — can have multiple |
75-
| `decision` | Conditional branching — routed by **edge `condition` predicates**, not node config |
72+
|:--|:--|
73+
| `start` | Entry point: exactly one per flow |
74+
| `end` | Exit point: one or more |
75+
| `decision` | Branch by **edge `condition` predicates**, not node config |
7676
| `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 |
7777
| `parallel` | Fan out into `config.branches[]` (≥ 2 regions) run concurrently, **joined implicitly** at block end |
7878
| `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 |
7979
| `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 |
80-
| `wait` | Pause until a timer elapses or a named signal arrives |
81-
| `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) |
80+
| `wait` | Pause for a timer or a named signal |
81+
| `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 |
8282
| `parallel_gateway` / `join_gateway` / `boundary_event` | BPMN-interop forms a `parallel` / `try_catch` container lowers into; author the container |
8383

8484
#### Data Operations
8585

8686
| Node | Purpose |
87-
|:-----|:--------|
87+
|:--|:--|
8888
| `assignment` | Set variable values |
8989
| `create_record` | Insert a record |
9090
| `update_record` | Modify records |
9191
| `delete_record` | Remove records |
92-
| `get_record` | Fetch records with filters (**no `query_record`**) |
92+
| `get_record` | Fetch records by filter (**no `query_record`**) |
9393
| `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 |
9494

9595
#### External Integration
9696

9797
| Node | Purpose |
98-
|:-----|:--------|
98+
|:--|:--|
9999
| `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) |
100100
| `notify` | Send a notification (below) |
101101
| `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
105105
#### Human Decision
106106

107107
| Node | Purpose |
108-
|:-----|:--------|
108+
|:--|:--|
109109
| `approval` | Route a record for human sign-off |
110110

111111
### `notify`
112112

113113
An undeclared key is a named parse error. **RAW** keys are read as written:
114-
a `{token}` in one is refused. The node as JSON (TypeScript: the same
114+
a `{token}` in one is refused. As JSON (TypeScript: the same
115115
literal, a `FlowNode`):
116116

117117
```json
@@ -321,10 +321,11 @@ Most are caught by `objectstack build`:
321321
```
322322

323323
4. **A `select` is compared and written by its option `value`, never its label.**
324-
The request speaks the label ("Lost"); the row stores the `value` (`lost`).
325-
`condition: "record.status == 'Lost'"` parses, matches no row: the flow
326-
stages clean and never fires; `fields: { status: 'Lost' }` / a `filter`
327-
fails the run (`invalid_option`). Read the field's `options`.
324+
The request says "Lost"; the row stores `lost`.
325+
A start `condition: "record.status == 'Lost'"` or `fields: { status: 'Lost' }`
326+
is refused at publish (inline options), else matches no row or fails the
327+
run (`invalid_option`). A label in a `filter` or an edge `condition` is never
328+
checked: it silently matches nothing. Read the field's `options`.
328329

329330
---
330331

@@ -417,7 +418,7 @@ token implies the other:
417418
### Trigger Types (start-node `config.triggerType`)
418419

419420
| `triggerType` | ObjectQL hook |
420-
|:------|:------|
421+
|:--|:--|
421422
| `record-before-create` (can modify/reject) | `beforeInsert` |
422423
| `record-after-create` | `afterInsert` |
423424
| `record-before-update` | `beforeUpdate` |

‎skills/objectstack-automation/evals/flows-triggers-approvals.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
{
55
"id": 1,
66
"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.",
7-
"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.",
7+
"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.",
88
"files": [],
99
"assertions": {
1010
"must_contain": [
@@ -354,7 +354,7 @@
354354
{
355355
"id": 20,
356356
"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.",
357-
"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.",
357+
"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.",
358358
"files": [],
359359
"assertions": {
360360
"must_contain": [

‎skills/objectstack-automation/references/examples-flows.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ export const EscalateOverdueCasesFlow = defineFlow({
2727
type: 'start',
2828
label: 'Daily at 09:00 Shanghai time',
2929
// The cadence lives HERE — FlowSchema has NO top-level `schedule` key (a
30-
// named parse error). A bare cron string also works; a cron`…` tag does not.
31-
// A bare expression runs in UTC. A wall-clock hour the request names is
30+
// named parse error). A cron`…` tag fails. A cron with no `timezone`
31+
// (a bare string) runs in UTC and warns. A wall-clock hour the request names is
3232
// written AS SAID with its IANA `timezone` — never converted to UTC by hand:
3333
// the arithmetic may be right, but nothing then records which zone was meant.
3434
config: { schedule: { type: 'cron', expression: '0 9 * * *', timezone: 'Asia/Shanghai' } },

‎skills/objectstack-automation/references/integration-recipes.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ export const StripeBalanceSweep = defineFlow({
4343
name: 'crm_stripe_balance_sweep', label: 'Stripe balance → house account',
4444
type: 'schedule', runAs: 'system',
4545
nodes: [
46-
{ id: 'start', type: 'start', label: 'Nightly 03:00',
47-
config: { schedule: { type: 'cron', expression: '0 3 * * *' } } },
46+
{ id: 'start', type: 'start', label: 'Nightly',
47+
config: { schedule: { type: 'cron', expression: '0 3 * * *', timezone: 'UTC' } } },
4848
{ id: 'bal', type: 'connector_action', label: 'GET /v1/balance',
4949
connectorConfig: { connectorId: 'stripe', actionId: 'GetBalance', input: {} } },
50-
{ id: 'write', type: 'update_record', label: 'Write balance', config: {
50+
{ id: 'write', type: 'update_record', label: 'Write', config: {
5151
objectName: 'crm_account', filter: { is_house_account: true },
5252
fields: { stripe_available: { dialect: 'cel', source: 'bal.body.available[0].amount / 100.0' },
5353
stripe_synced_at: { dialect: 'cel', source: 'isoDatetime(now())' } } } },

0 commit comments

Comments
 (0)