Skip to content

release: v0.2.0 — S0–S4, Grok host, race/expand, DSL, adversarial closure#69

Open
heggria wants to merge 46 commits into
mainfrom
release/0.2.0
Open

release: v0.2.0 — S0–S4, Grok host, race/expand, DSL, adversarial closure#69
heggria wants to merge 46 commits into
mainfrom
release/0.2.0

Conversation

@heggria

@heggria heggria commented Jul 9, 2026

Copy link
Copy Markdown
Owner

Summary

Cuts the 0.2.0 monorepo release line and closes the multi-agent adversarial re-review gaps.

Product (S0–S4 + Horizon B)

  • S0–S3: FlowIR content hash (ir:<64-hex>), event log + fold, offline replayRun / taskflow_replay, event kernel (default OFF, 10 kinds)
  • S4: taskflow-dsl (TypeScript AST erase → JSON, CLI new/check/build/decompile)
  • Horizon B: race (first-success) + expand (nested/graft) → 12 phase types
  • Grok Build host: grok-taskflow + taskflow-hosts runner; MCP e2e in CI
  • Nine lockstep packages at 0.2.0 (core, mcp-core, hosts, dsl, pi, codex, claude, opencode, grok)

Adversarial closure (this commit)

  • Race: parent-abort wakes gate + grace (no hang); all-fail test; cancelLosers grace
  • Kernel: nested flow re-admits via canUseEventKernel (fail-closed for race/expand/…)
  • DSL: bare unknown runes error; P0 regression tests; decompile keeps expand dependsOn / race cancelLosers
  • Docs honesty: monorepo-vs-npm banners (EN/zh); zh 12 phases / 9 packages; website + example first success
  • Publish/CI: nine packages + grok pins; test:e2e-grok-mcp already in CI

Explicitly not in 0.2.0

  • S5 kernel default ON / flagship $6→$0.40 seal
  • Live host executor e2e as hard gate (MCP e2e is CI)

Publish plan (post-merge)

  1. Merge this PR
  2. Immediately: git tag v0.2.0 && git push origin v0.2.0
  3. Confirm .github/workflows/publish.yml publishes all nine packages + GitHub Release

Plugin pins are already @0.2.0do not leave main without the tag/publish job.

Test plan

  • pnpm run typecheck
  • Focused: race-expand, exec-kernel-hardening/parity, replay-import-lint, taskflow-dsl tests, grok unit (77 pass)
  • CI unit + e2e (codex/claude/opencode/grok MCP) on this PR
  • After merge: tag v0.2.0 and verify npm package versions

Claim ledger

See docs/internal/claim-vs-impl-0.2.0.md (Pass 5).

heggria added 30 commits July 8, 2026 18:00
The publish.yml version-consistency gate failed the v0.1.7 tag: the codex
.codex-plugin/plugin.json and claude .claude-plugin/plugin.json manifests were
still pinned at 0.1.6 (the release-prep commit bumped the .mcp.json npx pins
but missed these sibling manifests). The cross-adversarial review caught the
.mcp.json pins but not the plugin.json manifests. All versions now 0.1.7;
re-tagging.
Lands the 0.2.0 design groundwork developed across this session:

Research:
- market-positioning-2026-07: full competitor recon (Claude Code Workflows,
  Microsoft Conductor, LangGraph, Temporal, the 100+ orchestrator list).
  Verdict: "声明式 DAG" is a red ocean (Conductor mirrors us), but
  "compiled + resumable + incremental" has zero industrial competitors.
- 0.2.0-research-frontend-paradigms: 2026 frontend frontier (signals won
  the war except React; TC39 standardizing signals = overstory's algorithm;
  Svelte/Solid/Vue Vapor/Qwik/Mitosis mapped to taskflow).
- rfc-taskflow-vs-claude-code-workflows: head-to-head vs the direct rival.

RFCs (drafts, to be revised per multi-agent review):
- rfc-0.2.0-dsl-syntax: the TypeScript functional DSL spec w/ full
  JSON↔DSL coverage table (§A). REVIEW found an identity crisis
  (Solid-real-fn vs Svelte-compile-directive) — v2 will commit to
  compile directives (runes erased at runtime).
- rfc-0.2.0-three-compile-routes: Solid / Svelte / Vue Vapor comparison.
- rfc-0.2.0-typescript-dsl: earlier Solid-route sketch.

Demos (illustrative .tf.ts — NOT runnable yet; some use post-0.2.0 features
like $store/$derived/flow.component marked in RFC §D):
- 0.2.0-demo-smart-migration.tf.ts
- 0.2.0-app-delivery-platform/ (10-file multi-flow app)

North star:
- 0.2.0-north-star: the synthesis — "compiled + resumable + incremental",
  three core decisions, absorbed frontiers, honest boundaries, next steps.

These docs are the anchor for 0.2.0 implementation. RFCs are explicitly
drafts pending v2 (see commit notes on the identity-crisis resolution).
…gent review

Rewrites the DSL syntax RFC in direct response to review-020-design.
Headline change: a new §0 Execution Model pins down what v1 left
ambiguous.

Root decision (resolves review FEASIBILITY #1/#2/#4/#5): runes are
COMPILE DIRECTIVES, not runtime functions. `taskflow build` is an AST
transform that reads .tf.ts source without executing it (Svelte route,
not Solid). The critic proved "read .output → auto-dependency" is
physically impossible at authoring time (phase hasn't run; Proxy
.toString() collapses on method chains / numeric coercion). Compile-time
AST extraction makes auto-dependency, type inference, and
template→placeholder conversion all hold cleanly.

Honest costs acknowledged + mitigated (§0.4): no "degraded run", no rune
debugging — compensated by verify/compile/peek + new `taskflow check`
(fast feedback) and `taskflow new` (5-line skeleton). JSON remains the
"degraded" escape hatch.

Every review finding has a v2 response (§B decision log): identity
crisis resolved; map's `item` is a compile-time typed symbol;
json<T>() via compiler transform (complex types error, no silent
degradation); loop multi-phase body moved to post-0.2.0; parallel
destructuring is compile-time; decompiler designed (§6.2); approval.input
& args.type (fabricated) removed; {loop.*} added, {env.X} marked new;
demo post-0.2.0 features to be annotated; unified rune signatures;
single interpolation form; hello-world skeleton.
The two 0.2.0 demos deliberately show the full vision ceiling, but they
use features the DSL RFC §7 marks as post-0.2.0 ($derived/$state/$store/
read/write/flow.component — they need a global reactive runtime /
Shared Context Tree, not in the first release). Review USABILITY #1
flagged this as a trap: an agent using these demos as reference would
produce non-compiling code.

Rather than gut the demos (they're valuable as vision communication),
annotate so the boundary is unmistakable:

- New examples/0.2.0-app-delivery-platform/README.md: top-level warning,
  a table of which features are post-0.2.0 and why, what IS runnable in
  0.2.0, and where to find a real first-version sample.
- File-header banner (⚠️) on every file that uses a post-0.2.0 feature.
- Inline `// [post-0.2.0]` on import lines and key call sites in the
  heaviest files (smart-migration, app.ts, dashboard.ts) — imports are
  what agents copy first.
- Fixed stale "Solid 路线" wording in smart-migration (the route is now
  compile-directive per RFC v2 §0).

An agent opening any demo file now sees the warning before any code.
Add flowir/cond.ts — the condition-IR seam for the FlowIR compiler
(RFC §5.4). normalizeCond() lifts when/until/eval expressions into a
stable NormalizedCond { source, canonical, refs } descriptor shared by
two future consumers: hashing (structurally-equivalent conditions must
canonicalize identically) and deterministic replay's when-guard
re-evaluation (refs tell replay which steps.*/args.*/env.* inputs to
rebind, zero-token).

Reuses the shared condition parser in interpolate.ts via
tryEvaluateCondition for parse-validation + fail-open semantics — does
NOT duplicate the tokenizer/parser (single source of truth, no semantic
drift). Refs are extracted via a {steps|args|env}.… scan mirroring
collectRefs. The canonical form is a surface normalization (whitespace
removal + redundant enclosing-paren stripping with string-literal
contents preserved). Fail-open on parse error (canonical = source.trim(),
refs = []) — matches the fail-open-for-guards invariant. Never throws.

flowir-cond.test.ts: 29 tests covering equivalent-expression
canonicalization (whitespace/operator/paren/ref-spacing), different-
expression divergence, ref extraction (steps/args/env, dedup, order),
and fail-open for malformed/empty/nullish input.

Does not wire barrels.
Formalize the implicit FlowIR shape translate.ts already produces as a
standalone, canonical type contract (Q2=B, Q5=own). The new
flowir/schema.ts is a strict superset of meta.ts's projection: it adds
the closed FlowIRNodeKind literal union (the 10 phase kinds), an
explicit FlowIREdge model, FlowIRBudget/FlowIRMeta, and optional
TypeBox schemas + lightweight structural guards (isFlowIRNode /
assertFlowIR). Pure additive — translate.ts/meta.ts/hash.ts/index.ts
and all barrels are untouched, so the stub's output remains valid.

flowir/compile.ts (batch 2) will emit this canonical shape; the
event-sourced kernel executes it. Zero runtime deps beyond typebox.

Tests (flowir-schema.test.ts, 33 cases) cover kind membership, node
narrowing, full-IR assertion (incl. stub-shape superset compat, dup
ids, dangling edges, malformed budget), and TypeBox schema decode/Check.
Add canonicalizeFlowIR/hashFlowIR/hashNode — a synchronous node:crypto
SHA-256 content-addressed hash over the canonical FlowIR (Q5=own), distinct
from the vendored async flowDefHash (DSL-level, overstory contract).

canonicalizeFlowIR is deterministic and order/whitespace-independent:
stable-sorted object keys, nodes re-sorted by id, when guards normalized
via normalizeCond, undefined optionals dropped. Two logically-equivalent
IRs (key reorder, node reorder, condition whitespace/parens) canonicalize
identically. inject/emits/deps/edges arrays keep order (semantic).

34 property tests: DETERMINISM, ORDER/WHITESPACE INDEPENDENCE, SENSITIVITY.
Not wired into runtime/cache or any barrel — batch 2 wiring.
…nd exec events

Integration step (serial): wire the five parallel-built modules into the
taskflow-core barrels so the new public surface is reachable via the bare
`taskflow-core` specifier.

Barrel wiring:
- src/index.ts: add `export * from "./rates.ts"` (after usage.ts) and
  `export * from "./exec/index.ts"` (after replay.ts), matching the existing
  `export *` style.
- src/flowir/index.ts: re-export schema.ts, cond.ts, canonical-hash.ts.
  schema.ts's `FlowIR`/`FlowIRNode` (canonical, closed `kind` union) clash
  with meta.ts's stub-projection `FlowIR`/`FlowIRNode` (`kind: string`) —
  the canonical pair is re-exported under `CanonicalFlowIR`/
  `CanonicalFlowIRNode` aliases so the batch stays additive (existing public
  surface unchanged) and both contracts are barrel-reachable.
- src/exec/index.ts (new): `export * from "./events.ts"` barrel for the
  event-sourced log schema + back-compat reader.

Reconciliation:
- exec/events.ts: fix the one real tsc error — `parsed as Event` failed
  (Record<string,unknown> doesn't overlap Event); use `as unknown as Event`
  for the already-versioned-line fast path (the legacy path uses the typed
  `upgradeTraceEvent` shim). No `any`.
- The five new modules are internally consistent (canonical-hash imports
  FlowIR/FlowIRNode from schema.ts and normalizeCond from cond.ts; both
  match). No edits needed to schema.ts/cond.ts/canonical-hash.ts/rates.ts.

Additive only: runtime.ts, translate.ts, and the existing hash.ts are
untouched (runtime stays on Taskflow execution; the canonical hash is not
yet wired into cache — that lands in batch 2).

Includes the rates.ts and exec/events.ts source + test files (their builders
left them uncommitted); schema.ts/cond.ts/canonical-hash.ts were already
committed by their builders.
The exec-events round-trip test built a ScorerResult with an invalid
'weight' field (weights live on ScoreConfig.weights[], not per-result),
which failed repo-root 'tsc --noEmit' (test/ is excluded from the
package tsconfig, so the builder's package-scoped check missed it).
Provide the required name/type/passed/score fields instead.

Batch-1 foundation now green: typecheck exit 0, 1044/1044 core tests.
Anchor Batch 1–2 work: master architecture for event-sourced FlowIR
kernel, plus brainstorm of phase types unlocked by the new kernel.
- Event is TraceEvent & { v } (no dual schema); upgrade ts defaults to 0
- FlowIRNodeKind derives from exported PHASE_TYPES
- normalizeCond: refs ignore string literals; preserve escape sequences
- hashFlowIR/hashNode domain prefixes (ir:/node:)
- estimateCost peels cache⊆input (Codex) without double-billing
Add grokSubagentRunner (grok -p streaming-json) in taskflow-hosts and a
new grok-taskflow delivery package with MCP bin, .grok-plugin manifest,
skills, and marketplace index. Wire monorepo scripts, skill build host
target, and AGENTS.md.
Document grok-taskflow install (plugin + local dogfood bin), permissions,
MCP tools, and website en/zh guides. Update monorepo package table and
CHANGELOG Unreleased entry.
Backfill README.zh-CN, RELEASE, AGENTS package counts, package
descriptions, website nav/meta, getting-started host tabs, and host
lists in reference/community/templates/comparisons (en + zh).
Update living architecture decisions for eight packages and grok-runner;
expand i18n README install blocks; align north-star/research/library RFCs
and website template host tabs with MCP hosts including Grok.
Add cross-host footers on Codex/Claude blogs, expand case-study and
showcase host lists, fix zh README package count, and align test comments.
Implement genuine Taskflow→FlowIR compilation with content-addressed
hashFlowIR (usedFallbackHash false), pure foldEvents for event logs, and
replayRun for offline threshold/budget what-if re-fold. Runtime still uses
the imperative path; driver/step migration is next.
Wire full decision emission (gate/when/cache/tournament/budget) and fold
differential tests; add agent+script event kernel (default OFF) with usage
and when-guard parity; surface replay via taskflow_replay, action=replay,
and /tf replay plus golden fixtures. Sync skills, zh-CN docs, and FlowIR e2e
for the genuine ir: hash compiler.
Add map/parallel to the event kernel (still default OFF) with parity tests
vs the imperative path. Add fold kill-9 rebuild oracle and replay import-lint
so offline replay stays off the runtime/driver graph. Rewrite the north-star
slogan to compiled · resumable · incremental · replayable-for-what-if.
Update incremental-recompute (en/zh) for genuine ir: hashes; complete the
12-tool MCP tables in host guides and Grok website; expand README Commands
for replay/ir/peek/why-stale/recompute; document exec/trace/replay and the
event-kernel flag in AGENTS.md; fix stale agent+script kernel comments.
Mark architecture RFC S0–S5 implementation status; supersede the historical
FlowIR shadow RFC with the S0 genuine compiler note. Add skills advanced
trace/replay vs recompute; ship en/zh Deterministic Replay concept pages,
resume disambiguation, and full 12-tool command reference tables.
Expand exec/step + step-kinds so reduce, gate, approval, loop, tournament,
and flow run on the event kernel (still default OFF). Nested flows recurse
through the driver; gates and auto-rejected approvals set run status
blocked. parseTournamentWinner moves to deterministic.ts for shared pure
use. Tests cover every kind and mixed DAGs.
Address multi-agent review Blockers: dynamic flow{def} validation, recursion
stack, nesting caps, budget enforcement, dep/join/optional parity, gate eval
fail-safe, steps.*.json, agent timeouts, script stdout caps, and feature
fall-back for score/retry/expect/reflexion. Add hardening tests. Local
installed Grok plugin MCP now runs workspace dist (12 tools incl. replay).
Freeze package exports/bin, CLI (build|check|decompile|new), library API,
*.tf.ts convention, diagnostics, core import allowlist, and CLI-first host
integration for the Svelte erase + JSON escape route.
Add packages/taskflow-dsl: compile-time .tf.ts erase via TypeScript AST,
CLI build/check/decompile/new, FlowIR parity tests, and import-lint.

Document brainstorm phase horizon + S4 decision record; wire workspace.
Fix FileTraceSink to mkdir parent on first flush so MCP first-run traces land.

Adversarial re-review: 8 prior BLOCK must-fixes verified FIXED
(PASS_WITH_ISSUES — residual S4.1 only).
Add erase/tests for approval, loop, tournament, subflow, expand.nested,
gate.automated/scored; negative-path and path-containment tests.
CLI gains --cwd, -V, and -o confinement under cwd. 19 unit tests green.
- Desugar const [a,b]=parallel([...]) into real agent phase ids
- Add race + expand phase types (nested/graft-promote); kernel stays on classic 10
- taskflow-dsl: race/expand erase, check --typecheck, gate decompile binds upstream
- skills-src configuration.md: taskflow-dsl CLI workflow for all hosts
Split taskflow-dsl build/erase into ast/templates/opts/pipeline modules.
Move race execution to runtime/phases/race.ts; document the no-monolith
policy in AGENTS.md and docs/internal/modularization-0.2.0.md.
Peel all phase kind emitters out of pipeline into erase/kinds/* with a
central KIND_HANDLERS registry; pipeline is now flow discovery + body walk
only. Extract expand pure helpers (prefix/promote/mode) under runtime/phases
and fix missing MAX_DYNAMIC_PHASES import that failed expand runs.
Update skills-src (core/configuration/patterns) and regenerate host
skills for race/expand, gate sugar, and kinds↔runes mapping. Sync S4
RFCs/decision record acceptance, AGENTS, and README phase counts.
heggria added 9 commits July 9, 2026 17:13
…roval

Update rfc-0.2.0-architecture S0–S5 tracker (S4 ✅, S5 next) and continue
runtime strangler: script spawn, parallel fan-out, and approval decision
mapping live under runtime/phases/* for S5 preheat.
Honest cancelLosers (reserved/ignored + race warning), fix S4 toolchain
docs to TypeScript AST (not ts-morph), refresh 12-kind/kernel-10 comments,
package and test counts, north-star flagship as S5 gate, and add
docs/internal/claim-vs-impl-0.2.0.md verification ledger. Regenerate skills.
Website: 12 phase types and 5 hosts on the homepage; race/expand in
phase-types and concepts (en/zh); TypeScript DSL reference page + nav.
CHANGELOG Unreleased covers S4, race/expand, and claim alignment.
Examples race-first-win + expand-nested-fragment; skills caveats for
kernel/decompile/cancelLosers; advanced flow{def} vs expand; update
claim-vs-impl ledger.
Wire per-branch AbortSignal through runOne so race cancelLosers aborts
losers after first settle (best-effort). Fix FlowIRNodeKind test for 12
PHASE_TYPES. Add race cancel tests, S5 kernel-default-on plan, update
skills/website/CHANGELOG. pnpm test: 1402/1402 pass.
Race: first-success semantics, aggregate branch usage, cancel after
success, try/finally parent abort listener, delay honors extraSignal.
Expand graft: rewrite {steps.*} after id prefix; zero expand usage after
promote to avoid double-count. DSL: register unions dependsOn; unknown
runes and non-agent branches error; gate sugar allowKeys; decompile
imports race/expand and fail-closes non-string def. Kernel policy rejects
incremental and workspace cwd keywords. Docs/skills/README/website synced.
Tests: 1404/1404 green.
Fix residual claim ledger, CHANGELOG, schema, and skills text that still
said first-settle / cancelLosers reserved.
Bump all nine packages and plugin pins to 0.2.0; wire publish/CI for
taskflow-dsl and grok. Fix race parent-abort hang, nested kernel
re-admission, DSL bare unknown runes, decompile dependsOn, docs honesty
(EN/zh, website first-success), and add regression tests.
Harden runtime replay, budgets, caching, graft ownership, cancellation, and event-kernel fallback semantics. Close the TypeScript DSL compiler and CLI surface, secure Grok and MCP delivery, and fail closed on release provenance and workflow trust boundaries.
Comment thread packages/taskflow-core/src/exec/driver.ts Fixed
Comment thread packages/taskflow-core/src/exec/kernel-policy.ts Fixed
heggria added 2 commits July 10, 2026 13:40
Replace polynomial regular expressions on untrusted flow strings with a linear scanner that distinguishes Taskflow placeholders from static JSON.
Comment thread packages/taskflow-core/test/runner-process.test.ts Fixed
Comment thread packages/taskflow-dsl/src/decompile.ts Fixed
heggria added 5 commits July 11, 2026 09:33
Harden race settlement, cancellation and process-tree cleanup, preserve trace integrity, close DSL round-trip gaps, and make publishing and production website validation fail closed.
Inject the Pi runner explicitly and disable ambient extension discovery so local E2E coverage cannot collide with globally installed taskflow extensions.
Add the compiler-first homepage, executable sample parity checks, base-path-safe export validation, and refreshed documentation links while preserving valid document shells.
Always send EOF to script phases without input, and map Taskflow thinking precedence onto Codex model_reasoning_effort with argv and live-run coverage.
Harden Claude permissions and child environment handling, reject invalid thinking values, add packed-package consumer gates, and align release/public documentation with the shipped contracts.
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.

2 participants