Skip to content

rc: 0.3.0 Trusted Effects candidate (do not publish) - #122

Merged
heggria merged 40 commits into
mainfrom
rc/0.3.0-trusted-effects
Aug 12, 2026
Merged

rc: 0.3.0 Trusted Effects candidate (do not publish)#122
heggria merged 40 commits into
mainfrom
rc/0.3.0-trusted-effects

Conversation

@heggria

@heggria heggria commented Aug 11, 2026

Copy link
Copy Markdown
Owner

rc: 0.3.0 Trusted Effects candidate (do not publish)

Draft PR body. Not for npm publish — published packages stay at 0.2.9 until a human cuts v0.3.0.
This file is the source for the GitHub PR description.

Base / Head

Base main @ f605813 — release: taskflow 0.2.9 + Hermes host (#125)
Head rc/0.3.0-trusted-effects @ 1bc54d6 (30 commits ahead of main)
Status CANDIDATE — do not merge, do not publish
Post-ADV harden b5beb8e lifecycle/filesystem CI hardening; 004c3ec syncs main@0.2.9; 1bc54d6 preserves resume agent scope/global thinking and Hermes Trusted Effects skill parity

This PR supersedes the historical Draft PR #117 (head: codex/0.3.0-trusted-effects-candidate). The rc/0.3.0-trusted-effects branch is the canonical candidate branch; current head is 1bc54d6 (PR #122).

Summary

  • Trusted Effects MVP (packages/taskflow-core/src/effects/):
    • EffectIR (EFFECT_KINDS), PathRef reuse, SecretRef/ServiceRef (type-only fail-closed)
    • closed TypeBox EffectIR + confidentiality/integrity source-to-sink validation
    • resource-controlled FS transaction: durable snapshot → persistent lease → journal intent/permit → stage → Commit or Restore+Reject
    • declaration-only bridge in effects/runtime-apply.ts; no second changeset/gateway authority
    • ledger-backed whyAuthorized / whyContext / whyEffect
  • Optional phase effects[]; FlowIR translate/compile/hash include effects
  • Built-in detectEffectsIssues (category effects) + effectsLintVerifier
  • Every imperative phase fast path finalizes declared fs.write through the resource transaction; event-kernel-enabled runs use the same safe imperative path
  • Honest host baseline: conformance/workspace/host-support-baseline.json
  • Docs: docs/internal/0.3.0-trusted-effects-mvp.md, 0.3.0-agent-goal.md, 0.3.0-ga-scoreboard.md
  • Example: examples/trusted-effects-write.json
  • Tests: test/effects*.test.ts, test/verify-effects.test.ts
  • Store hardening: project .pi discovery hardened against tmp and home roots (96a32e8)
  • Windows CI fix: child-process store import specifiers portable via pathToFileURL/fileURLToPath (e7c5e31; test-harness only, no product change) — windows-latest store/process-supervisor jobs genuinely exercise saveRun/lock semantics

Fixed

  • Resource-bearing inline/saved/expanded/ctx_spawn children can no longer be skipped by parent cache or resume reuse.
  • Information-flow labels compose across nested flow boundaries; unresolved dynamic definitions remain tainted, malformed non-array effects fail admission/compile, and why-effect follows DAG dependencies.
  • Durable commit/abort results survive staging/lease cleanup faults, activation double faults release leases, and clean-terminal/aged-orphan before-images are garbage-collected.

Scope boundary

This candidate guarantees admitted declared filesystem write targets. It does not claim a full FileBroker/native OS sandbox and cannot prevent or roll back writes to undeclared paths under resolve-only execution. SecretRef/ServiceRef have no vault/network backends in this cut (fail-closed, unsupported). Historical Control Plane (feat/0.3.0) is not this release definition.

Evidence (honest)

Current-head CI: PASS at 1bc54d6run 31504434346. Node 22/24, Windows/macOS/Ubuntu process supervisor, build, packed consumer, website, all host MCP e2e, workflow CodeQL, and Advanced Security CodeQL are green.

Gate Status Notes
L1 local PASS e7c5e31: monorepo typecheck PASS (local + CI node 22/24); pnpm audit --prod clean (RC pipeline at 6071fb2 — CI does not run audit)
L2 contract PASS (local current head) full unit suite 2258 pass / 0 fail / 4 skipped; typecheck, full build, packed-consumer smoke (10 packages), generated-skill drift check, and git diff --check pass at 1bc54d6
L3 browser/electron N/A
L4 real-environment PASS (built-MCP fixture) built Codex MCP comprehensive e2e 16/16 incl. TE fixture — fs.write committed through resources + ledger-backed why-effect — against the built dist bin (codex-mcp-full.log; evidence SHA 6071fb2 per build-info stamp; CI e2e job re-runs test:e2e-codex-mcp-full at exact SHA e7c5e31). NOT a live Codex CLI run: test:e2e-codex NOT rerun on the current tip (prior-candidate A→B→C historical only)
L5 released FAIL no tag/publish — human gate
L6 ga FAIL L5 missing — NOT GA

Exact-SHA remote CI is GREEN: GitHub Actions run 31460133496 on this PR's head e7c5e31 passed the full matrix (test node 22/24, e2e codex MCP network-free incl. built-dist comprehensive, build dist, packed consumer 9 pkgs + CharterArc, website export, process supervisor ubuntu/macos/windows, CodeQL JS/TS). A prior red run 31456747148 on 0f9cf16 (windows store tests) was fixed by the test-harness portability change in e7c5e31. Historical Draft PR #117 run 31167592775 passed all jobs on 1478510f (earlier candidate SHA).

Commits (rc/0.3.0-trusted-effects vs main, newest first)

e7c5e31 fix(test): make child-process store imports portable on Windows
0f9cf16 docs: sync 0.3 draft PR body to rc tip d532f69
d532f69 docs: raise scoreboard to L4 built-MCP fixture for rc/96a32e8
59fd9c3 docs(skills): teach 0.3 Trusted Effects authoring surface
7add160 docs: add draft PR body for 0.3 trusted-effects RC
0834c59 docs: refresh 0.3 scoreboard for rc/96a32e8
96a32e8 fix(store): harden project .pi discovery against tmp and home roots
6071fb2 docs: refresh trusted effects candidate evidence
467bc28 fix(effects): close composition and transaction gaps
5529ae1 docs: record remote candidate CI evidence
f2cee92 docs: record clean 0.3 candidate evidence
e6efcd4 feat(effects): add resource-controlled trusted writes

Release state

  • CHANGELOG: ## [0.3.0] — Unreleased (Trusted Effects candidate) — still Unreleased.
  • Not released; not GA. No tag, no npm publish — blocked on explicit human authorization to cut v0.3.0.

heggria and others added 11 commits August 10, 2026 18:19
Compile closed EffectIR with transitive label checks, route declared writes through the existing resource authority, recover failed and crashed transactions, and expose ledger-backed why-effect evidence.
Do not inherit shared OS temp or home .pi dirs while walking ancestors
for project flow discovery (hostile CI/tmp). Canonicalize paths via
realpath; compare case-insensitively on win32.

Wire store boundary tests into CI; keep marketplace/README/website
skill counts aligned with the 20-tool MCP roster.
Source for GitHub PR description; not a publish request. Head
rc/0.3.0-trusted-effects, base main. Explicit no npm until human v0.3.0.
Add the effects[] DSL surface (fs.write PathRef shape, labels, payload
mapping, example pointer), the model-proposes/resources-commit authority
one-liner, the MCP-only taskflow_why_effect audit, and explicit honesty
non-claims (no FileBroker sandbox, undeclared paths, SecretRef/ServiceRef
type-only fail-closed). Regenerated the five host SKILL.md files via
scripts/build-skills.mjs; skills-build test stays green.
Align the 0.3 GA scoreboard with the built Codex MCP 16/16 TE fixture
(codex-mcp-full.log: fs.write committed through resources + ledger-backed
why-effect). Set L4 honestly as PASS (built-MCP fixture) at evidence SHA
6071fb2 per the build-info stamp, keep the live-Codex-CLI leg and exact-SHA
remote CI open, and keep L5/L6 FAIL (no tag/publish). Note that the branch
is now pushed to origin via worker-mac SSH relay while CI has no run for
96a32e8 (workflow triggers only on PR->main / push main). Update the
release-plan L4 row + human checklist and the agent-goal branch name to
rc/0.3.0-trusted-effects.
Update Base/Head to the real tip d532f69 (10 commits ahead of main),
refresh the evidence table to match the scoreboard (L4 PASS built-MCP
fixture), and note this PR itself is the exact-SHA remote CI gate.
Clawdy added 17 commits August 11, 2026 12:57
The process-boundary tests (M1 concurrent saveRun, L1 stale-steal, L1
live-owner, detached-runner e2e) embed an ESM import of store.ts built
with path.resolve(), which yields a backslash path (D:\a\...) on
Windows. ESM treats that as a bare package specifier and the child dies
at startup, so saveRun/lock code was never exercised on windows-latest.
Use pathToFileURL(...).href (already the repo convention in
resource-leases.test.ts) so the specifier is a portable file:// URL.

fix-5 also read ../src/store.ts via new URL(import.meta.url).pathname,
which win32 path.join re-prefixes as D:\D:\a\... (ENOENT). Switch to
fileURLToPath(import.meta.url).

Local: store 69/69, detached 8/8, store-extended 23/23, full pnpm test
2198 pass / 0 fail, typecheck clean.
Claim-vs-evidence audit of scoreboard/PR body/CHANGELOG/skills/host
baseline vs exact-SHA CI + local test run at tip d3b2878. 0 Blocker /
0 High / 5 Low (docs-currency only): stale tip/head citations
(31460495091 @ d3b2878 not cited), live PR #122 description lagging
head, AGENTS.md MCP roster 19->20, audit-evidence phrasing. Ready=HOLD.
Hold Ready: High verifier walk RCE surface + static flow{use} over-taint;
resources MVP holds; honesty ledger clean. No merge/tag/npm.
Elevate concurrent commit race, stage effectId path, and commit-path
symlink TOCTOU after source spot-check. HOLD Ready strengthened.
… path

Address ADV High findings before Ready:
- Shared discovery-boundary for project .pi walks (home/temp stop,
  canonicalize, reject .pi symlink escape) used by store, verifiers, agents
- file-transaction: busy lock against concurrent commit/reject
- sanitize effectId for stage blob paths
- re-check containment + refuse intermediate symlinks at commit
- mkdir parents without following symlinks
- swallow onDeferredLeaseRelease throws after terminal so ok:true sticks

Tests: adv-high-fix (7) + resource-file-transaction + store + verifier-discover
…-H2)

Static gates (validateTaskflow / verifyTaskflow / FlowIR translate+compile)
run without a flow store, so every flow{use: <saved>} child degraded to the
unknown-boundary summary and rejected legal saved-subflow + downstream write
compositions that the runtime (with loadFlow) executes successfully.

- validateComposedEffectFlow gains downgradeUnresolvedUse: unresolved
  flow{use} boundaries now report advisory warnings (unresolved-flow-use /
  unresolved-flow-use-taint) instead of hard confidentiality taint; dynamic
  inline flow{def} boundaries stay hard-tainted.
- Static gates accept an optional resolveFlow: pi run + MCP taskflow_run
  inject the store-backed loader so saved children are checked with real
  effects (real violations still hard-fail); runtime admission remains the
  authoritative fail-closed gate.
- New test effects-static-use-downgrade (4): benign use + write accepted
  statically and at runtime; real violation advisory without loader but
  hard-fails with resolver and at runtime; dynamic def stays tainted;
  loader-miss is advisory statically and fails closed at runtime.
Clawdy handoff after orch residual crash. Focused 110/110, CI
31465576937 green. Sync scoreboard/PR body tip. No merge/tag/npm.
worker-mac dogfood closes live-host L4 leg. Evidence under
docs/internal/evidence/. No merge/tag/npm.
Bound Windows atomic rename contention, keep background waits honest until authenticated workers quiesce, and relax a test-only startup deadline under CI load.
@heggria

heggria commented Aug 11, 2026

Copy link
Copy Markdown
Owner Author

Reopening immediately to retrigger the missing pull_request CI event for head b5beb8e; the synchronize push produced no check suite.

@heggria heggria closed this Aug 11, 2026
@heggria heggria reopened this Aug 11, 2026
@heggria

heggria commented Aug 11, 2026

Copy link
Copy Markdown
Owner Author

CI lifecycle/filesystem hardening delivered

Current head: 004c3ec (b5beb8e fixes + merge of main@f605813 / taskflow 0.2.9).

Root causes fixed independently:

  • Windows/process-supervisor fixture used an 80 ms child startup/idle boundary; it now keeps terminal semantics intact while using a realistic 1000 ms startup watchdog.
  • MCP background wait previously treated terminal state as worker quiescence; it now waits for the matching authenticated detached-worker lease, handles timeout/abort honestly, and reconciles dead/stale owners.
  • Windows atomic rename can transiently return EPERM, EACCES, or EBUSY; atomic writes now use a deterministic hard-bounded retry helper (max 51 attempts) with strict parameter validation.

Verification:

  • independent final review: no blocking logic or security defects
  • local full suite: 2257 passed / 0 failed / 4 skipped
  • resume integration stress: 20/20
  • typecheck, full build, git diff --check: PASS
  • packed consumer: 10 packages, 27 explicit imports, 83 wildcard exports, 6 bins
  • GitHub Actions run 31500969543, attempt 2: all checks green, including Node 22/24 and Windows process supervisor

@heggria

heggria commented Aug 11, 2026

Copy link
Copy Markdown
Owner Author

Final review-blocker resolution — 1bc54d6

The post-merge independent review found two resume-context defects plus a Hermes skill merge loss. All are resolved:

  • taskflow_resume now discovers agents with the child flow's persisted agentScope instead of hardcoding both.
  • Resume now propagates configured globalThinking.
  • Cache identity now hashes the effective thinking value (phase.thinking ?? globalThinking), preventing stale reuse across global-thinking changes.
  • Hermes generated/source skills now expose taskflow_why_effect and include the Trusted Effects audit contract.

TDD / local evidence

  • RED confirmed: the resume fixture reran stable under the wrong roster; the global-thinking cache test reused incorrectly (counter 1, expected 2).
  • GREEN: Codex MCP 31/31, cache 28/28, Hermes MCP 4/4.
  • Full suite: 2258 passed / 0 failed / 4 skipped.
  • Typecheck, full build, generated-skill drift check, packed consumer (10 packages / 27 explicit imports / 83 wildcard exports / 6 bins), and git diff --check: PASS.
  • Independent fail-closed review: PASS; no security concerns or logic errors.

Exact-head remote evidence

CI run 31504434346 on 1bc54d6c7e39167614abd86c96b3ab7a27bd3d6d: all checks green, including Node 22/24, Windows process supervisor, all-host MCP e2e, build, packed consumer, website, workflow CodeQL, and Advanced Security CodeQL.

Candidate status is unchanged: do not merge / do not publish without the explicit human release gate.

Clawdy added 10 commits August 12, 2026 16:50
# Conflicts:
#	packages/codex-taskflow/test/e2e-mcp-comprehensive.mts
#	packages/codex-taskflow/test/mcp-server.test.ts
#	packages/taskflow-core/src/store.ts
#	packages/taskflow-mcp-core/src/mcp/server.ts
…s + ControlHost

0.3-C S2: create the taskflow-control package from the frozen wire plan
(docs/internal/wire-freeze.md + P1-P16 ADRs; no archive implementation).

- TypeBox wire schemas with closed contracts + schemaVersion covering
  wire-freeze 3.2-3.9 (~33 new types), TE REUSE mirrors (resources/*
  shapes not exported by taskflow-core) and read-only TE imports
  (effects/schema, flowir/canonical-hash).
- ControlHost auto/coordinated/standalone mode contracts (P13 D5):
  fresh-install defaults to auto; coordinated fails closed; no silent
  auto->standalone fallback.
- User singleton lock/endpoint/fencing (D32): hard-link create, stale
  endpoint recovery, identity-bound reclaim, compare-and-delete release,
  fencing epoch enforcement (TF_AUTHORITY_REVOKED).
- hello-before-RPC negotiation gate (P4): TF_PROTOCOL_INCOMPATIBLE /
  TF_SCHEMA_UNSUPPORTED / TF_FEATURE_REQUIRED.
- TE resources as the only execution authority (P8): te-provider adapter
  with accepted|rejected|ambiguous DTOs; ControlHost refuses non-TE
  providers.
- Unit tests: modes, singleton fencing/stale recovery, te-provider
  delegation, hello gate, schema contracts, ControlHost integration.
- Workspace wiring: pnpm-workspace, root build/devDeps; wire-freeze.md
  backfilled with actual file paths. 10-package 0.2.10 surface unchanged
  (typecheck, full test suite 2353 pass, packed smoke 10 packages).
@heggria
heggria marked this pull request as ready for review August 12, 2026 17:14
@heggria
heggria merged commit 561cfd3 into main Aug 12, 2026
11 checks passed
@heggria
heggria deleted the rc/0.3.0-trusted-effects branch August 12, 2026 17:14
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