Skip to content

pi-taskflow 0.0.28

Choose a tag to compare

@github-actions github-actions released this 27 Jun 06:36

Granular-reuse release. v0.0.27 proved the incremental-recompute cost win — v0.0.28 makes it far larger and trivial to opt into. Invalidation drops from whole-flow to per-phase and per-item, and a single flag flips an entire flow into cross-run reuse.


⚡ Smarter invalidation

  • Per-phase fingerprint (v3:phasefp) — edit one phase, only it and its dependents re-run. An independent sibling keeps its cache hit.
  • Per-item map caching — change 1 of N items, only that item re-executes. The other N−1 are served for $0.

🎛️ One-flag opt-in

  • incremental flag (flow-level and run arg) — defaults every phase to cross-run reuse, no per-phase annotation needed. Per-phase cache and blocked types (gate/approval/loop/tournament) still win; default stays the safe run-only.

🔍 See what got reused

  • Reuse reporting — the end-of-run report and /tf recompute now show reused-vs-executed counts plus a per-phase Why trace: ▲ rerun · ✂ cutoff · ✓ reused · ✗ failed, with ← causedBy.

Implementation details & soundness
  • v3:phasefp hashes the phase plus its transitive dependsOn ∪ from closure, replacing the whole-flow v2:flowdef hash. cacheKeys emits a 4-tier read ladder (v3:phasefp write → v2:flowdef → bare flowdef → legacy, all read-only) so the upgrade is additive — no miss-storm for unchanged flows. Fail-open: any per-phase error degrades that phase to the whole-flow hash. Falls back to whole-flow when per-phase invalidation can't be statically guaranteed (flow-wide contextSharing, any shareContext phase in the closure, join: "any", or sub-flow inner phases). — extensions/flowir/phasefp.ts
  • Per-item keys omit the structural fingerprint (which hashes the whole over source) so changing one item no longer moves every key; they fold [phase.id, it.agent, model, it.task] + the world-state tail. Disabled (whole-map only) under run-only/off scope, shareContext / flow-wide contextSharing, or inside a runtime-generated sub-flow.
  • phaseFingerprint now strips cache, retry, concurrency, final — none changes a phase's output, so a no-op config tweak no longer falsely invalidates.
  • Reuse reporting reports a dollar figure only for within-run reuse (where prior usage is preserved); cross-run hits are counted without an invented saving. — summarizeReuse / RecomputeDecision in extensions/runtime.ts

Tests: 804 → 846 (+42) across 46 files — new cache-phasefp, cache-peritem, incremental-flag, reuse-summary suites. Typecheck clean.
Upgrade: drop-in. The 4-tier cache ladder reads old entries; nothing to migrate.