docs(agents): describe the flow authoring form the repo actually uses - #1572
Conversation
Item 3 of AGENTS.md §Schema Validation Requirements prescribed `FlowSchema.parse()` / `defineFlow()`. Both exist in @objectstack/spec 17.2.0 (verified against the installed tarball), but neither appears anywhere in src/: all 22 src/flows/*.flow.ts files take a type-only import and annotate a plain object literal as `Automation.Flow`. Replace the prescription with the house form, and say where validation actually happens — `pnpm validate` (confirmed by ablation: a bogus flow `type` fails it with `flows.N.type: Invalid value ...`) and the platform's own parse at `AutomationEngine.registerFlow` on boot. Item 3 only; the sibling items' related defect is filed separately. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YDbLQQiy7ew8sdwiCQEZwC
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
Reviewed and ACCEPTed — the review record is on the card: #1436 (comment
Why you are assignees instead of requested reviewersThe protocol says push a governed PR at both authorised approvers rather than wait to be found. The ⇒ The review request is recorded as OWED and will be re-attempted when the budget recovers; it is listed in the round report and on the seat post (#1353). What to look at, honestlyThe substance is measured and I would merge it if I were permitted to. Two things a human might legitimately want changed, neither of which I treated as rework:
#1443 is the next link on the Generated by Claude Code |
Fixes #1436
AGENTS.mditem 3 of §🔒 Schema Validation Requirements told authors to build flows withFlowSchema.parse()from@objectstack/spec/automation, adding thatdefineFlow()is that call. Neither appears anywhere insrc/. This replaces the prescription with the form the repo actually uses, and says where validation really happens.:147is stale — the line is:171, shifted by PR #1527. Confirmed independently on my base.What I measured
Base:
origin/main@18444c8. Gate chain re-run at head4525acc.The card's three possibilities, distinguished against the installed tarball rather than the docs — which the card asked for specifically, since this lane keeps inheriting claims about the platform from in-repo prose.
@objectstack/spec17.2.0 exports both, as functions:and the implementation in
dist/automation/index.js:⇒ The API is real and the parenthetical was accurate. "Invented prose, delete it" was the wrong fix. This is the card's possibility 1: aspirational.
What the repo does instead. All 22
src/flows/*.flow.tsfiles take a type-only import and annotate a plain object literal — checked against a real file, not the type signature, per the card:Why this is the honest direction, and not "the repo is behind". The card's alternative branch was: if the wrapper is the preferred authoring form, correct the repo instead of the instruction. I found no preference signal, and two signals against it:
Flowas the schema's input type (z.inputofFlowSchema) — exported precisely so a literal can be annotated with it. There is no deprecation on the literal form.defineFlow()returnsFlowParsed(z.infer, the output type), so the two are not interchangeable drop-ins —const X: Flow = defineFlow({…})mixes the two sides of the schema.Also decisive:
AGENTS.mdalready described the literal form correctly one section earlier, in the File Suffix Protocol (:153, "typed asAutomation.Flow"). The two sections disagreed with each other;:153matched the code.That nothing goes unvalidated is confirmed by ablation, not assumed. The card's own defect is asserting a validation path that does not exist, so the replacement wording had to be checked. With one flow's
typemutated to a bogus value on disk:and on the restored tree
pnpm validateexits 0. Restore proven byte-identical (git diff HEADempty; blobdaa4237both sides).grep -ccounts lines, and the first occurrence oftype: 'schedule'in that file is inside the JSDoc comment at:11, soperlmutated prose andvalidatepassed. Re-anchored on the code line (:19, trailing comma). The green from attempt 1 was void, not evidence.⇒ Validation is real; it happens at
objectstack validateand again when the platform parses atAutomationEngine.registerFlowon boot — not in the metadata file.Gates
pnpm verifyat4525acc— exit 0, all eight in the chain:Scope
AGENTS.mditem 3 only, plus the changeset this PR adds. Nosrc/change.⛔ I did not sweep the other six items of that list, and ⛔ I added no guard, gate, lint rule or test — per
AGENTS.mdScope rule 3, a validation-class gap is a platform problem that goes upstream, not a local guard.The section-wide problem is real and measured, and is filed as its own card, back-linked. One correction to the dispatch brief's sweep, reported because it was load-bearing:
Schema.parse(is not confined toAGENTS.md—scripts/analytics-reconcile/run.ts:91callsDatasetSchema.parse(ds). The section's own seven symbols are still called nowhere, so the finding holds; the stated measurement was just wider than the truth.Landing path
AGENTS.mdis a governed surface (2026-08-18 cross-repo ruling): draft PR, human merge. Opened draft and it stays draft — not marked ready, not enqueued, no auto-merge, no reviewers requested (the seat does that). Predecessor #1229 landed via PR #1527, so this card was free to run. #1443 remains fenced behind this one and is not addressed here.Refs #1429
🤖 Generated with Claude Code
Generated by Claude Code
Generated by Claude Code