Skip to content

✨ feat(flow): declared Activity atoms with toLayer and plan-time call - #182

Merged
roninjin10 merged 2 commits into
mainfrom
flow-activity-declared
Aug 13, 2026
Merged

✨ feat(flow): declared Activity atoms with toLayer and plan-time call#182
roninjin10 merged 2 commits into
mainfrom
flow-activity-declared

Conversation

@roninjin10

Copy link
Copy Markdown
Contributor

Summary

The declared (named) Activity form of docs/specs/Concepts/Unified Flow Authoring.md — the atom half of the two-noun model:

  • Activity.make(tag, { payload, success?, error?, tier?, idempotencyKey? }) returns Activity.Declared: schema-typed, annotatable, catalogable.
  • .toLayer(execute) attaches the implementation as a Layer through the existing flow-registration + inline-activity execution machinery (tier, idempotency, executeEncoded semantics preserved).
  • .call(payload) records an ActivityCall node (PR1's AST) — plan-time only, executes nothing; payload fields accept Planned refs.
  • The existing inline Activity.make(options) form is byte-for-byte unchanged (overload discriminates on first-arg type).
  • Adds @smthrs/plan as a dependency of @smthrs/flow (lockfile regenerated with --package-lock-only --ignore-scripts).

Depends-on: #181

Verification

  • npm run check --workspace @smthrs/flow — clean
  • npm run lint --workspace @smthrs/flow — clean
  • New test/ActivityDeclared.test.ts (5 tests: overload discrimination, declared fields, toLayer execution with decoded payload, call-node shape, annotations); full package suite 13 files green with the enforced 100% coverage gate

…Error

The authoring half of the plan: seven closure-free node variants (Succeed,
All, Map, AndThen, FlowCall, ActivityCall, Branch) with digested deferred
functions in out-of-band tables, the Planned<T> branded placeholder whose
proxy throws GraphBuildError on any computation (toPrimitive, valueOf,
toString, toJSON, application), and the GraphBuildError vocabulary.

Docs: docs/specs/Concepts/Unified Flow Authoring.md
(cherry picked from commit 64624ac)
Activity.make gains a string-first overload: a named, schema-typed atom
(payload/success/error/tier/idempotencyKey) whose implementation attaches
separately via .toLayer(execute) through the existing registration and
activity machinery, and whose .call(payload) records an ActivityCall node
for plans. The inline options form is unchanged.

Docs: docs/specs/Concepts/Unified Flow Authoring.md
(cherry picked from commit b883814)
@roninjin10

Copy link
Copy Markdown
Contributor Author

Review round 1 complete (sol + fable, independent). Findings for this PR were fixed and folded into its commit; the full ledger (15 fixes, 6 resolved-as-designed) lives in the stack's review notes. All 14 branches rebased and re-verified: whole-repo check green, all package suites at 100% coverage, rebuilt tip byte-identical to the verified fix tree.

@roninjin10
roninjin10 changed the base branch from plan-node-ast to main August 13, 2026 01:13
@roninjin10
roninjin10 merged commit 6598a99 into main Aug 13, 2026
0 of 2 checks passed
@roninjin10
roninjin10 deleted the flow-activity-declared branch August 13, 2026 01:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant