Skip to content

feat(core): 0.2.4 — kernel concurrent layers, verifier ecosystem, parity harness#85

Merged
heggria merged 6 commits into
mainfrom
release/0.2.4
Jul 20, 2026
Merged

feat(core): 0.2.4 — kernel concurrent layers, verifier ecosystem, parity harness#85
heggria merged 6 commits into
mainfrom
release/0.2.4

Conversation

@heggria

@heggria heggria commented Jul 20, 2026

Copy link
Copy Markdown
Owner

What changed

🔴 Kernel: concurrent DAG layers (S5 unlock)

The event kernel now executes phases within a topo layer concurrently via Promise.all with atomic layer-boundary commit. Gate/budget decisions are checked between layers. This removes the single biggest blocker to kernel default-ON.

Also unlocked on the kernel path:

  • Retryphase.retry = { max, backoffMs, factor } now honored for ALL failures (not just transient), matching the imperative contract
  • Context pre-readphase.context files read and prepended as <context> blocks
  • Per-phase literal cwd — absolute/relative literal cwd resolved and passed to runTask (interpolation placeholders and workspace keywords remain imperative-only)

🟡 Pluggable verifier ecosystem (#82 dogfood)

  • Built-in script-lint verifier — catches grep dash-pattern without --, unbalanced regex, pipelines without pipefail. Auto-included by compileTaskflow (lint !== false to opt out)
  • Verifier discovery — convention-dir loading from .pi/taskflows/verifiers/ (project shadows user). Async, fail-open
  • MCP taskflow_lint tool — exposes built-in + discovered verifiers to all MCP hosts

🟢 Compile subgraph visualization

Inline flow defs (phase.def) now render as Mermaid subgraphs showing child phases and edges.

S5.0 parity harness

kernel-parity.test.ts: 10 golden fixtures run on BOTH engines with deterministic mock runner, asserting status/output/error/gate parity. Covers linear, concurrent, gate, reduce, when-guard, join-any, script, loop, wide DAG, retry.

Tests

1795 total, all green (1578 core + 217 hosts/dsl/mcp).

New: verifier-script-lint (25), verifier-discover (8), kernel-parity (10), compile subgraph (2).
Updated: exec-kernel-hardening, runtime-closure-0.2.0, verify-pluggable.

Remaining for 0.2.4 (not in this PR)

  • runtime.ts decomposition (agent/gate/loop/tournament → runtime/phases/)
  • Kernel: score gates, reflexion, cross-run cache, shareContext
  • 4 MCP background test flakes (timing-dependent, CI-only)
  • Docs: verifier writing guide, cookbook tutorials

…ystem, parity harness

Kernel (S5 unlock):
- Concurrent DAG layer execution: driver.ts now runs phases within a
  topo layer concurrently via Promise.all with atomic layer-boundary
  commit. Gate/budget decisions are checked between layers. Removes the
  'concurrent DAG layers require the imperative runtime' restriction.
- Retry support: both runOneAgent (step.ts) and runAgentCall
  (step-kinds.ts) now honor phase.retry = { max, backoffMs, factor }
  for ALL failures (not just transient), matching the imperative
  contract. Removes the 'retry requires the imperative runtime' gate.
- Context pre-read: kernel reads phase.context files and prepends them
  to the prompt as <context> blocks, matching the imperative runtime.
  Removes the 'context pre-read requires the imperative runtime' gate.
- Per-phase literal cwd: kernel resolves literal string cwd values
  (absolute or relative to flow cwd) and passes them to runTask.
  Interpolation placeholder cwds and workspace keywords remain
  imperative-only. Per-branch cwd also remains imperative-only.

Pluggable verifier ecosystem (#82 dogfood):
- Built-in script-lint verifier (verifiers/script-lint.ts): catches
  grep dash-pattern without '--', unbalanced regex in grep/sed, and
  pipelines ending with a filter without pipefail/PIPESTATUS. Ships as
  an optional built-in; compileTaskflow auto-includes it (lint !== false).
- Verifier discovery (verifiers/discover.ts): convention-based loading
  from .pi/taskflows/verifiers/ (project) and ~/.pi/taskflows/verifiers/
  (user). Async dynamic import, fail-open, project shadows user by name.
- builtinVerifiers barrel export from taskflow-core.
- MCP taskflow_lint tool: runs built-in + discovered verifiers via MCP,
  exposing the pluggable verifier surface to all MCP hosts.

Compile visualization:
- Inline flow defs (phase.def) now render as Mermaid subgraphs showing
  child phases and their edges. Saved-use flows remain plain nodes.

S5.0 parity harness:
- kernel-parity.test.ts: 10 golden fixtures run on BOTH engines
  (imperative + event kernel) with deterministic mock runner, asserting
  status/output/error/gate parity. Covers: linear chain, concurrent
  layer, gate, reduce, when-guard, join-any, script, loop, wide DAG,
  and retry.

Tests: 1578 core + 217 hosts/dsl/mcp = 1795 total, all green.
New test files: verifier-script-lint (25), verifier-discover (8),
kernel-parity (10), compile subgraph (2). Updated: exec-kernel-hardening,
runtime-closure-0.2.0, verify-pluggable.
Comment thread packages/taskflow-core/src/verifiers/script-lint.ts Fixed
Comment thread packages/taskflow-core/src/verifiers/script-lint.ts Fixed
Comment thread packages/taskflow-core/src/verifiers/script-lint.ts Fixed
Comment thread packages/taskflow-core/src/verifiers/script-lint.ts Fixed
muyun added 4 commits July 20, 2026 17:44
… for taskflow_lint

- Add taskflow_lint to all 4 host MCP tool roster tests (claude/codex/
  opencode/grok)
- Update marketplace.json descriptions: 16 → 17 tools, add lint to list
- Update skills-build test: 16 → 17 MCP tools assertion
- Fix compile.ts type narrowing (p.type union excludes 'flow')
- Fix server.ts unused variable in lint handler early-return path

All 2021 tests green, typecheck clean, build passes.
- CHANGELOG.md: 0.2.4 section (kernel concurrent layers, retry/context/cwd,
  script-lint verifier, verifier discovery, taskflow_lint MCP tool, compile
  subgraph, S5.0 parity harness)
- Version bump: 0.2.3 → 0.2.4 across all 10 package.json files
- Skills: taskflow_lint in core.md example, pluggable verifier ecosystem
  section in advanced.md, rebuilt all host skill files
- Host test version assertions: 0.2.3 → 0.2.4
- test:pack passed: 9 packages, 24 imports, 68 exports, 5 bins
- Full suite: 2021/2021 green, typecheck clean
…parity test

- Restore 'expect contracts require the imperative runtime' in
  kernel-policy.ts: the contract-violation retry loop was NOT ported to
  the kernel step handlers; admitting expect flows would silently skip
  validation. Deferred to a future release.
- Replace dynamic import('node:fs')/import('node:path') with static
  module-level imports in step.ts and step-kinds.ts context pre-read.
  The dynamic imports ran once per context file per attempt — wasteful.
- Add gate-in-concurrent-layer parity test: a gate sharing a layer with
  an independent agent must correctly propagate its decision to the
  next layer on both engines.

2022 tests, 2021 pass (1 pre-existing MCP background flake).
@heggria
heggria enabled auto-merge (squash) July 20, 2026 10:53
- Replace 4 polynomial regexes in script-lint.ts with linear-time
  alternatives (stripPathPrefix via lastIndexOf, includes() instead of
  /bash\s+.*-o\s+pipefail/). Fixes 4 high-severity CodeQL alerts.
- Add taskflow_lint to e2e-mcp-comprehensive.mts tool roster assertion.

2022/2022 tests green, typecheck clean.
@heggria
heggria merged commit 6154048 into main Jul 20, 2026
11 checks passed
@heggria
heggria deleted the release/0.2.4 branch July 20, 2026 11:00
heggria added a commit that referenced this pull request Jul 20, 2026
…ity harness (#85)

* feat(core): 0.2.4 — kernel concurrent layers, pluggable verifier ecosystem, parity harness

Kernel (S5 unlock):
- Concurrent DAG layer execution: driver.ts now runs phases within a
  topo layer concurrently via Promise.all with atomic layer-boundary
  commit. Gate/budget decisions are checked between layers. Removes the
  'concurrent DAG layers require the imperative runtime' restriction.
- Retry support: both runOneAgent (step.ts) and runAgentCall
  (step-kinds.ts) now honor phase.retry = { max, backoffMs, factor }
  for ALL failures (not just transient), matching the imperative
  contract. Removes the 'retry requires the imperative runtime' gate.
- Context pre-read: kernel reads phase.context files and prepends them
  to the prompt as <context> blocks, matching the imperative runtime.
  Removes the 'context pre-read requires the imperative runtime' gate.
- Per-phase literal cwd: kernel resolves literal string cwd values
  (absolute or relative to flow cwd) and passes them to runTask.
  Interpolation placeholder cwds and workspace keywords remain
  imperative-only. Per-branch cwd also remains imperative-only.

Pluggable verifier ecosystem (#82 dogfood):
- Built-in script-lint verifier (verifiers/script-lint.ts): catches
  grep dash-pattern without '--', unbalanced regex in grep/sed, and
  pipelines ending with a filter without pipefail/PIPESTATUS. Ships as
  an optional built-in; compileTaskflow auto-includes it (lint !== false).
- Verifier discovery (verifiers/discover.ts): convention-based loading
  from .pi/taskflows/verifiers/ (project) and ~/.pi/taskflows/verifiers/
  (user). Async dynamic import, fail-open, project shadows user by name.
- builtinVerifiers barrel export from taskflow-core.
- MCP taskflow_lint tool: runs built-in + discovered verifiers via MCP,
  exposing the pluggable verifier surface to all MCP hosts.

Compile visualization:
- Inline flow defs (phase.def) now render as Mermaid subgraphs showing
  child phases and their edges. Saved-use flows remain plain nodes.

S5.0 parity harness:
- kernel-parity.test.ts: 10 golden fixtures run on BOTH engines
  (imperative + event kernel) with deterministic mock runner, asserting
  status/output/error/gate parity. Covers: linear chain, concurrent
  layer, gate, reduce, when-guard, join-any, script, loop, wide DAG,
  and retry.

Tests: 1578 core + 217 hosts/dsl/mcp = 1795 total, all green.
New test files: verifier-script-lint (25), verifier-discover (8),
kernel-parity (10), compile subgraph (2). Updated: exec-kernel-hardening,
runtime-closure-0.2.0, verify-pluggable.

* fix: sync tool roster (17 tools), typecheck, and marketplace metadata for taskflow_lint

- Add taskflow_lint to all 4 host MCP tool roster tests (claude/codex/
  opencode/grok)
- Update marketplace.json descriptions: 16 → 17 tools, add lint to list
- Update skills-build test: 16 → 17 MCP tools assertion
- Fix compile.ts type narrowing (p.type union excludes 'flow')
- Fix server.ts unused variable in lint handler early-return path

All 2021 tests green, typecheck clean, build passes.

* release: Taskflow 0.2.4

- CHANGELOG.md: 0.2.4 section (kernel concurrent layers, retry/context/cwd,
  script-lint verifier, verifier discovery, taskflow_lint MCP tool, compile
  subgraph, S5.0 parity harness)
- Version bump: 0.2.3 → 0.2.4 across all 10 package.json files
- Skills: taskflow_lint in core.md example, pluggable verifier ecosystem
  section in advanced.md, rebuilt all host skill files
- Host test version assertions: 0.2.3 → 0.2.4
- test:pack passed: 9 packages, 24 imports, 68 exports, 5 bins
- Full suite: 2021/2021 green, typecheck clean

* fix: review round — restore expect restriction, static imports, gate parity test

- Restore 'expect contracts require the imperative runtime' in
  kernel-policy.ts: the contract-violation retry loop was NOT ported to
  the kernel step handlers; admitting expect flows would silently skip
  validation. Deferred to a future release.
- Replace dynamic import('node:fs')/import('node:path') with static
  module-level imports in step.ts and step-kinds.ts context pre-read.
  The dynamic imports ran once per context file per attempt — wasteful.
- Add gate-in-concurrent-layer parity test: a gate sharing a layer with
  an independent agent must correctly propagate its decision to the
  next layer on both engines.

2022 tests, 2021 pass (1 pre-existing MCP background flake).

* docs: fix CHANGELOG — add expect to imperative-only list, 11 parity fixtures

---------
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