Skip to content

objectstack generate scaffolds a flow that objectstack validate rejects — the trigger key and the events vocabulary do not exist on protocol 17 #14087

Description

@os-warren

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:

  1. 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's config, as { objectName, triggerType, condition }, which is where the engine's resolveTriggerBinding reads it from.
  2. 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:*.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions