Skip to content

feat(factory): persist guarded workflows and reconcile recovery - #273

Draft
wangtsiao wants to merge 6 commits into
7df-lab:mainfrom
wangtsiao:feat/factory-durable-guards-20261108
Draft

wangtsiao wants to merge 6 commits into
7df-lab:mainfrom
wangtsiao:feat/factory-durable-guards-20261108

Conversation

@wangtsiao

Copy link
Copy Markdown
Contributor

Stack and review scope

Depends on #270 (Factory DAG scheduler) and #272 (RLM child lifecycle/collection). Neither prerequisite is merged by this PR. The stack base combines their published commits d2a2ca8 and 05495fc; the main-targeted diff therefore includes prerequisite changes until they land.

Review only this slice: wangtsiao/devo@stack/factory-base-270-272-20261108...feat/factory-durable-guards-20261108 . The incremental comparison is 18 files, two commits. Retarget/rebase after the prerequisites merge.

Added behavior

  • Opt-in durable runs: host-owned, session-scoped save/load/list with 1 MiB snapshots, 128-run cap, CAS revisions, ownership checks, atomic replacement, private files and Unix directory fsync.
  • Persist admission intent before spawn; checkpoint child binding after acknowledgement. Lost acknowledgements, missing/ambiguous child identities and failed cleanup remain explicit, never silently respawned or reported successful.
  • Explicit restore first claims the revision, then reconciles exact direct children. Plan Mode denies writes before child materialization; read-only saved-list/load never creates files or hydrates children.
  • Version 2 scalar guards and all/any joins, with deterministic all-predecessor settlement and distinct skipped branches. Guard numbers use a lossless range; no eval or authorization from output text.
  • Stop/restore concurrency and malformed-checkpoint checks, including stop while saving intent, interrupted recovery, duplicate child bindings, inconsistent terminal flags and missing outputs.

This remains a foreground-driven DAG workflow. It does not implement automatic background scheduling, loops, foreach, residents, retry budgets, UI, or a machine library. See docs/factory-durable-workflows.md for the API and recovery limits.

Verification

  • Factory Python tests: 42 passed, including an independent review pass.
  • Entire Python runtime suite: 125 run, 122 passed, 3 platform-specific skips.
  • Rust Factory store/dispatch tests: 11 passed, including real CPython kernel replacement, Plan gating, concurrent CAS, corruption, owner isolation and path-swap boundaries.
  • Real CPython → production host → child-session integration: 2 passed. One executes a durable guarded diamond; the other rebuilds the runtime, reconciles a retained completed child, and dispatches only the pending successor. Providers are scripted/offline, not paid models.
  • cargo clippy -p devo-server --lib --tests -- -D warnings: passed.
  • cargo fmt --all -- --check and git diff --check: passed.
  • Full cross-platform CI for this exact head: pending.

No PR merge, auto-merge or deployment is performed.

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