Skip to content

Commit 2e006c3

Browse files
committed
test(lint),docs(cli): the lint tier fixture declares the pair; os init / os g text says either missing token stops the config loading
The lint tier fixture's schedule flow owed only `triggers` before `defineStack` refused `triggers` without `automation`; it now declares the pair. The config comment `os init` writes, the flow header `os g flow` writes, and their docblocks no longer say a stack without `automation` loads the flow and never runs it: without either token the config is refused. Text only; no emitted code changes. Claude-Session: https://claude.ai/code/session_01Rjy9MeetSfq34PKn81CRiN Co-authored-by: Claude <noreply@anthropic.com>
1 parent 94e3202 commit 2e006c3

3 files changed

Lines changed: 19 additions & 17 deletions

File tree

‎packages/cli/src/commands/generate.ts‎

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -348,12 +348,13 @@ export default ${toCamelCase(name)}Action;
348348
*
349349
* It declares what it needs to run (#20215): {@link FLOW_SCAFFOLD_REQUIRES}.
350350
* `defineStack` refuses a record-change flow in a stack whose `requires`
351-
* lacks `triggers`, and a stack that has `triggers` but not `automation`
352-
* loads it and never runs it — measured on `os serve`: "1 flow(s) declared
353-
* but the automation engine is not enabled — they will never run", each
354-
* trigger plugin "NOT installed". So both tokens are declared here, `os
355-
* init` declares the union, `os g flow` names any the stack is missing, and
356-
* the emitted file says so in its own header.
351+
* lacks `triggers` or `automation` (#20332): the trigger installs into the
352+
* automation service, so a stack with `triggers` alone used to load the flow
353+
* and never run it — measured on `os serve`: "1 flow(s) declared but the
354+
* automation engine is not enabled — they will never run", each trigger
355+
* plugin "NOT installed" — and is now refused instead. So both tokens are
356+
* declared here, `os init` declares the union, `os g flow` names any the
357+
* stack is missing, and the emitted file says so in its own header.
357358
*/
358359
namesObject: true,
359360
itemName: (name: string) => `${toSnakeCase(name)}_flow`,
@@ -365,8 +366,8 @@ export default ${toCamelCase(name)}Action;
365366
*
366367
* Starts when a record changes, so the stack that carries it must declare
367368
* requires: [${FLOW_SCAFFOLD_REQUIRES.map((t) => `'${t}'`).join(', ')}]. The 'triggers' capability
368-
* fires the flow and 'automation' runs it: without 'triggers' the config does
369-
* not load, and without 'automation' the server loads the flow and never runs it.
369+
* fires the flow and 'automation' runs it: without either one the config does
370+
* not load.
370371
*/
371372
const ${toCamelCase(name)}Flow: Automation.Flow = {
372373
name: '${toSnakeCase(name)}_flow',

‎packages/cli/src/commands/init.ts‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -605,9 +605,10 @@ export const SCAFFOLD_WIRED_BARRELS: readonly { type: string; dir: string; stack
605605
/**
606606
* The union of the capability tokens the scaffolds need to run — today the
607607
* `flow` scaffold's pair. Declared by every template that wires the `flows`
608-
* barrel: without `triggers` a record-change flow makes `defineStack` refuse
609-
* the config, so the first `os g flow` would break the project, and without
610-
* `automation` the server loads the flow and never runs it.
608+
* barrel: without `triggers` or without `automation` a record-change flow
609+
* makes `defineStack` refuse the config (#20332: the trigger installs into the
610+
* automation service, so neither token alone installs it), and the first
611+
* `os g flow` would break the project.
611612
*/
612613
export const SCAFFOLD_WIRED_REQUIRES: readonly string[] = [
613614
...new Set(GENERATOR_SCAFFOLD_TARGETS.flatMap((t) => t.requires)),
@@ -647,9 +648,8 @@ function renderWiredStackKeys(): string {
647648
return [
648649
` // What the files \`objectstack generate\` writes need in order to run. A`,
649650
` // flow that starts on a record change is fired by 'triggers' and run by`,
650-
` // 'automation': without 'triggers' this config stops loading once it holds`,
651-
` // such a flow, and without 'automation' the server loads the flow and never`,
652-
` // runs it. Both can go if this project will never hold a flow.`,
651+
` // 'automation': without either one this config stops loading once it`,
652+
` // holds such a flow. Both can go if this project will never hold a flow.`,
653653
` requires: [${requires}],`,
654654
'',
655655
` // Every directory \`objectstack generate\` writes into is wired here: its`,

‎packages/lint/src/authoring-rule-input-tier.test.ts‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,10 @@ describe('the mechanism: for a defineStack config the `normalized` tier is POST-
8888
const flowStack = {
8989
manifest,
9090
// A `schedule` flow auto-launches, and `defineStack` refuses one whose stack
91-
// does not declare the trigger capability (#14153) — the flow here is only
92-
// the vehicle for a parse-time default, so declare the token it owes.
93-
requires: ['triggers'],
91+
// does not declare the pair that installs its trigger (#14153, #20332) —
92+
// the flow here is only the vehicle for a parse-time default, so declare
93+
// the tokens it owes.
94+
requires: ['automation', 'triggers'],
9495
flows: [
9596
{
9697
name: 'tier_flow',

0 commit comments

Comments
 (0)