Found while building an ObjectStack application in objectstack-ai/duly against published @objectstack/* 17.2.0. Filed here rather than there because the fix lands in packages/cli.
The defect
The flow scaffold emitted by objectstack generate cannot pass objectstack validate. Two independent reasons:
- It emits a top-level
trigger key holding { type, object, events: ['after_insert', …] }. FlowSchema is .strict() and has no trigger key at all — nor a top-level object. The trigger binds on the START node'sconfig, as { objectName, triggerType, condition }, which is where the engine's resolveTriggerBinding reads it from. - Its nodes carry
name/next where the schema requires label.
The events: ['after_insert'] vocabulary does not exist on the current surface either; the trigger type is spelled record-after-write.
Why it is worth fixing rather than documenting
This is the first flow most people will ever author, and the generator is the path the docs point at. The output does not fail with "this key moved" — it fails against a .strict() schema listing what is allowed, so a newcomer's first experience is a scaffold their own toolchain refuses, with no signpost to the shape that works.
The good news is that the schema's error message does name the START-node location, which is how it was diagnosed. But nobody should have to diagnose a generated file.
Reproduce
npx create-objectstack@latest scratch &&cd scratch
npx objectstack generate flow my_flow # or whatever the current invocation is
npx objectstack validate # refuses
Suggested fix
Bring the scaffold to the shape FlowSchema accepts on protocol 17 — START-node config: { objectName, triggerType: 'record-after-write', condition }, label on every node — and add a scaffold-validates test so the generator and the schema cannot drift again. packages/create-objectstack already has an e2e boot probe; this is the same idea one command further in.
Provenance
Reported by a developer agent implementing objectstack-ai/duly#6 (an assignment fan-out flow), which is how the correct shape was established: the card's own dispatch brief described the top-level shape, and the schema corrected it. The agent declined to file into this repo unprompted, which was the right restraint — routing it is the PM's job.
Unassigned and untriaged, per the single-producer rule for domain:*.
Found while building an ObjectStack application in
objectstack-ai/dulyagainst published@objectstack/*17.2.0. Filed here rather than there because the fix lands inpackages/cli.The defect
The flow scaffold emitted by
objectstack generatecannot passobjectstack validate. Two independent reasons:triggerkey holding{ type, object, events: ['after_insert', …] }.FlowSchemais.strict()and has notriggerkey at all — nor a top-levelobject. The trigger binds on the START node'sconfig, as{ objectName, triggerType, condition }, which is where the engine'sresolveTriggerBindingreads it from.name/nextwhere the schema requireslabel.The
events: ['after_insert']vocabulary does not exist on the current surface either; the trigger type is spelledrecord-after-write.Why it is worth fixing rather than documenting
This is the first flow most people will ever author, and the generator is the path the docs point at. The output does not fail with "this key moved" — it fails against a
.strict()schema listing what is allowed, so a newcomer's first experience is a scaffold their own toolchain refuses, with no signpost to the shape that works.The good news is that the schema's error message does name the START-node location, which is how it was diagnosed. But nobody should have to diagnose a generated file.
Reproduce
Suggested fix
Bring the scaffold to the shape
FlowSchemaaccepts on protocol 17 — START-nodeconfig: { objectName, triggerType: 'record-after-write', condition },labelon every node — and add a scaffold-validates test so the generator and the schema cannot drift again.packages/create-objectstackalready has an e2e boot probe; this is the same idea one command further in.Provenance
Reported by a developer agent implementing
objectstack-ai/duly#6(an assignment fan-out flow), which is how the correct shape was established: the card's own dispatch brief described the top-level shape, and the schema corrected it. The agent declined to file into this repo unprompted, which was the right restraint — routing it is the PM's job.Unassigned and untriaged, per the single-producer rule for
domain:*.