Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ jobs:
- run: uv run --project python --python ${{ matrix.python }} pytest
- run: uv run --project python --python ${{ matrix.python }} python examples/quickstart/run.py
- run: uv run --project python --python ${{ matrix.python }} ruff check python/src python/tests
- run: uv run --project python --python ${{ matrix.python }} mypy python/src
- run: uv run --project python --python ${{ matrix.python }} mypy --config-file python/pyproject.toml python/src
- if: matrix.python == '3.13'
run: uv build --project python
- if: matrix.python == '3.13'
Expand Down
18 changes: 17 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,25 @@ migration note.

## [Unreleased]

### Added

- Event-sourced durable start and resume APIs in TypeScript and Python. Runs bind
graph, original input, and caller-supplied implementation identity; node
outcomes commit before releasing dependants; committed successes are reused
after process loss.
- Cross-language tagged Durable JSON for exact finite binary64 payload hashing,
stable activity/idempotency keys, terminal-result snapshots, and recovery
conformance fixtures.
- Fail-closed interrupted-attempt handling: nodes declared with no or idempotent
side effects may retry within their original budgets, while omitted or
non-idempotent declarations surface `IN_DOUBT_SIDE_EFFECT`. Resuming a valid
terminal run returns its recorded result with no new event or executor call.

### In progress

- Scheduler-integrated event emission, checkpoint recovery, replay, and fork.
- Scheduler checkpoint acceleration, replay/fork, and distributed lease/fencing
providers. Recovery correctness currently comes from the complete event
stream; checkpoint files are not wired into the scheduler.
- Streaming pipelines, conditional edge lowering, verifier panels, and bounded
runtime loops.

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Python uses uv:
uv sync --project python --extra dev
uv run --project python pytest python/tests
uv run --project python ruff check python/src python/tests
uv run --project python mypy python/src
uv run --project python mypy --config-file python/pyproject.toml python/src
```

Changes affecting the Graph IR, compiler diagnostics, event protocol, or
Expand Down
17 changes: 11 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ The project is an early alpha. The DAG compiler, ready-queue schedulers, safe pr
initializer, machine-readable CLI, structured failure handling, retries,
timeouts, budgets, settled barrier/router decisions, safe Mermaid/DOT rendering,
pattern constructors, local event/checkpoint stores, read-only MCP server, and
development progress scanner are executable today. Scheduler-integrated durable
recovery and the broader v1 surface remain under active development; the
repository does not silently mock unfinished capabilities.
development progress scanner are executable today. Both native runtimes also
provide event-sourced durable start/resume: committed successes are reused after
process loss and unsafe ambiguous effects fail closed. Checkpoint acceleration,
replay/fork, distributed leases, and the broader v1 surface remain under active
development; the repository does not silently mock unfinished capabilities.

> **Source-only alpha:** npm and PyPI packages are not published yet. Clone this
> repository to try the current release candidate; registry publication remains
Expand Down Expand Up @@ -95,15 +97,17 @@ uv run --project python pytest python/tests
| Diamond/verifier pattern constructors | Yes | Consumes the portable Graph IR |
| Safe Mermaid/DOT visualization | Yes, through the CLI | Same portable Graph IR |
| Local event/checkpoint stores | Yes | Yes |
| Scheduler checkpoint/resume | In development | In development |
| Event-sourced scheduler start/resume | Yes | Yes |
| Scheduler checkpoint acceleration | Not yet | Not yet |
| Read-only validation/planning MCP | Yes | Uses the same portable IR |
| Streaming and scheduler-applied routers/verifier panels/loops | Target v1 | Target v1 |

## Design commitments

- Explicit node and edge data contracts.
- Parallel, pipeline, barrier, router, verifier, and bounded-loop topologies.
- Durable checkpoints, resume, replay, and fork.
- Durable event-sourced start/resume today; rebuildable checkpoint acceleration,
replay, and fork as explicit follow-up protocols.
- Deterministic plumbing; models are reserved for judgment.
- Provider-neutral adapters and deny-by-default capabilities.
- Observable runs with portable events and traces.
Expand All @@ -123,7 +127,7 @@ corepack pnpm check:packages
corepack pnpm check:packed-install
corepack pnpm audit:prod
uv run --project python ruff check python/src python/tests
uv run --project python mypy python/src
uv run --project python mypy --config-file python/pyproject.toml python/src
uv build --project python
python3 scripts/check-python-artifacts.py
```
Expand All @@ -139,6 +143,7 @@ python3 scripts/check-python-artifacts.py
- [Support](SUPPORT.md)
- [Runtime semantics](spec/runtime-semantics.md)
- [Persistence semantics](spec/persistence-semantics.md)
- [Durable recovery semantics](spec/durable-recovery-semantics.md)
- [Primitive semantics](spec/primitives-semantics.md)
- [21-day delivery plan](codex_plans/Graph-Engineering-21-Day-Master-Plan.md)

Expand Down
18 changes: 11 additions & 7 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,19 @@ earned by executable cross-language tests.

## Alpha 2 — durable graph patterns

- Scheduler event emission and checkpoint-safe node commit.
- Crash recovery that reuses completed node results.
- Replay and fork with immutable lineage.
- Pipeline buffers/backpressure and explicit barrier policies.
- Deterministic routers, verifier verdicts, quorum/unknown outcomes, reflection,
- [x] Scheduler event emission with commit-before-release node outcomes and
tagged Durable JSON payloads.
- [x] Event-sourced crash continuation that reuses committed successes, preserves
attempt budgets, and fails closed for ambiguous unsafe effects.
- [ ] Scheduler checkpoint acceleration; correctness already rebuilds from the
authoritative event history.
- [ ] Replay and fork with immutable lineage.
- [ ] Pipeline buffers/backpressure and explicit barrier policies.
- [ ] Deterministic routers, verifier verdicts, quorum/unknown outcomes, reflection,
and bounded loop-until-dry primitives.
- Deterministic mock, OpenAI, Anthropic, Gemini, OpenAI-compatible, HTTP, shell,
- [ ] Deterministic mock, OpenAI, Anthropic, Gemini, OpenAI-compatible, HTTP, shell,
and MCP adapters behind explicit capability declarations.
- Ten executable TypeScript/Python patterns with failure and recovery fixtures.
- [ ] Ten executable TypeScript/Python patterns with failure and recovery fixtures.

## Beta — operations and external validation

Expand Down
104 changes: 104 additions & 0 deletions codex_logs/daily/2026-07-26.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,107 @@ Canonical IR -> language models/builders -> compiler -> deterministic scheduler
code-review/security graphs, ready-queue benchmarking, and honest adopter stories.
- Verified anonymously that the repository, release, discussions, issue chooser,
private vulnerability report form, and raw README each return HTTP 200.

## 12:42 UTC durable-recovery design checkpoint

- Confirmed that both CI and CodeQL passed again for the public-release log
commit `d242b65`; the protected public alpha is green before feature work.
- Created branch `feat/durable-recovery` and ran three parallel read-only audits
over the TypeScript scheduler, Python scheduler, persistence stores, recovery
state machine, crash windows, and shared conformance requirements.
- Froze the first scheduler-integrated recovery contract around an authoritative
CAS event history, commit-before-dependent-release, immutable graph/input/
implementation bindings, stable activity keys, terminal idempotence, and
conservative handling of unknown external effects. Checkpoints remain
rebuildable acceleration rather than a second source of truth.
- Added a shared diamond recovery case in which one committed branch is reused,
one interrupted safe branch advances to attempt two, the merge receives both
outputs, total attempt budgets survive restart, and a second terminal resume
produces zero events and zero executor calls.
- Started parallel native implementation lanes and a separate exact Tagged
Durable JSON vector/schema lane. Tagged values preserve finite binary64 data
across TypeScript/Python while staying inside checkpoint safe-integer rules.
- Registry publication remains deferred. This feature will be committed as
`reacher-z <mtrxcop@gmail.com>` without co-author trailers only after focused,
cross-language, full-suite, packaging, and security validation passes.

## 13:41 UTC durable-recovery adversarial checkpoint

- Independently reran the Python lane after its first implementation: 419 tests,
Ruff, strict mypy, and diff hygiene passed. Core and persistence remain green
at 36 and 27 tests, and all 14 Tagged Durable JSON vectors still validate.
- Two independent read-only audits then found actionable protocol defects before
commit: zero-attempt node outcomes existed only in a terminal snapshot;
Python could trust a shallowly frozen compiled graph; normal retry admission
ignored the global attempt budget; and malformed retry timestamps could append
`RunResumed` before failing validation.
- Froze `NodeSettledWithoutAttempt` as an explicit event-derived outcome for
missing-executor, binding, upstream, budget, and pre-dispatch cancellation
paths. Both schedulers must commit it before releasing dependants, and terminal
folding must derive every node result and both orders from history.
- Hardened the TypeScript scheduler so a journal failure is not held hostage by
an executor that ignores cancellation, and public `runGraph` now runtime-
whitelists options so JavaScript callers cannot inject internal journals or
recovery seeds. A dedicated scheduler lane is adding atomic global retry
reservations and settlement hooks with concurrency tests.
- Added safe-integer limits to the shared Graph IR schema and TypeScript shape
validation, expanded the portable event vocabulary, and started a
cross-language durable report. Its Python side already proves committed-left
reuse, interrupted-right attempt advancement, stable activity keys, merge
input parity, four total attempts, and terminal zero-event/zero-executor
idempotence.
- The thirty-minute timer remains active. A manual scan after registering the
conformance lane reports 30 tasks: 29 healthy and one waiting only on the two
active native implementations; no stale, blocked, warning, or integration-risk
item was reported.

## 14:49 UTC durable-recovery completion checkpoint

- Completed native event-sourced `start` and `resume` APIs in TypeScript and
Python. The append-only CAS event stream is authoritative; graph, input, and
implementation identities are bound at creation; attempt claims commit before
executor work; outcomes commit before dependants are released; and a valid
terminal resume performs zero writes and zero executor calls.
- Added exact Tagged Durable JSON for finite binary64 values, stable activity
keys, strict real-calendar RFC 3339 timestamps, unique per-run event IDs,
explicit zero-attempt settlements, portable failure identities, 32-bit host
timer bounds, and fail-closed recovery for ambiguous unsafe side effects.
- Closed adversarial state-machine cases covering duplicate or stale starts,
pending retry reservations, global attempt races, premature downstream
settlements, prototype-named JSON keys, mutable executor registries and graph
views, event factory/clock failures, completion commit order, and non-cooperative
Python handlers that swallow cancellation after a durability failure.
- Expanded conformance from Python-produced interrupted history resumed by
TypeScript to bidirectional terminal-history consumption for missing executors
and output-binding failures. Each cross-language terminal replay reconstructs
the recorded result with zero new events and zero executor calls.
- Final local release gates are green: Core 37 tests, Runtime 81 tests, Python
486 tests, all workspace tests, build/typecheck/lint, strict mypy, both Ruff
configurations, eight compiler fixtures, runtime/primitives/persistence and
durable cross-language conformance, seven npm tarballs and clean installs,
Python wheel/sdist audits, source and isolated quickstarts, documentation links,
fixture validation, production dependency audit, and diff hygiene.
- Synchronized the canonical Graph Schema into CLI and MCP packaged assets and
corrected CI/documented mypy commands so they explicitly load the Python
strict configuration. The 07:40 automatic progress scan reported every
completed lane healthy and the remaining conformance lane recently active;
the post-gate manual scan then reported 30 of 30 tasks healthy with zero
waiting, stale, blocked, warning, or integration-risk items.
- Distributed leases/fencing, checkpoint acceleration, replay/fork, approval
callbacks, and universal exactly-once effects remain deliberately unclaimed
follow-up work. Registry publication remains deferred.

## 14:55 UTC durable-recovery delivery checkpoint

- Committed the integrated feature as
`854b2e3a35e36c2f41a82704485934a96cce644c` with author and committer
`reacher-z <mtrxcop@gmail.com>` and no co-author trailer, then pushed
`feat/durable-recovery` to the existing GitHub remote.
- Opened draft pull request
[#14](https://github.com/reacher-z/GraphEngineering/pull/14) against protected
`main`. The GitHub App lacked collaborator authority for PR creation, so the
authenticated `gh` fallback completed the same draft-only operation.
- Every reported remote CI, package, cross-language, progress-scanner,
dependency-review, and Python/JavaScript CodeQL check passed. The pull request
remains intentionally unmerged and review-required; protected-branch policy
was not bypassed.
98 changes: 97 additions & 1 deletion codex_logs/task-registry.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"schema_version": 1,
"updated_at": "2026-07-26T12:20:00Z",
"updated_at": "2026-07-26T13:40:44Z",
"repository": ".",
"scan_policy": {
"warning_after_minutes": 60,
Expand Down Expand Up @@ -428,6 +428,102 @@
"risk": "medium",
"blocker": null,
"next_action": "Use the 9,416+ moving parity benchmark, finish GitHub launch settings, and execute the adoption/content backlog without promising stars"
},
{
"id": "D6-DURABLE-SPEC-010",
"title": "Cross-language durable scheduler recovery contract and fixtures",
"owner": "main + /root/durable_contract",
"status": "completed",
"work_package": "WP3",
"depends_on": ["D1-SPEC-001", "D2-TS-PERSIST-001", "D2-PY-PERSIST-001"],
"expected_artifacts": [
"spec/durable-recovery-semantics.md",
"spec/durable-json.schema.json",
"spec/conformance/durable-json.case.json",
"spec/conformance/durable-resume.case.json"
],
"expected_tests": [
"tagged Durable JSON hash parity",
"committed-success reuse",
"interrupted-attempt recovery",
"terminal resume idempotence"
],
"assigned_at": "2026-07-26T12:23:00Z",
"started_at": "2026-07-26T12:23:00Z",
"last_heartbeat": "2026-07-26T13:40:44Z",
"risk": "high",
"blocker": null,
"next_action": "Hold the contract stable while both native implementations and the shared recovery harness are verified"
},
{
"id": "D6-TS-DURABLE-010",
"title": "TypeScript event-sourced scheduler start and resume",
"owner": "/root/durable_contract (handoff from /root/durable_ts)",
"status": "completed",
"work_package": "WP3",
"depends_on": ["D6-DURABLE-SPEC-010", "D3-TS-RUNTIME-002", "D2-TS-PERSIST-001"],
"expected_artifacts": ["packages/runtime"],
"expected_tests": [
"commit-before-release",
"successful node never reruns",
"attempt budgets survive crash",
"identity/history/CAS rejection",
"terminal idempotence"
],
"assigned_at": "2026-07-26T12:42:00Z",
"started_at": "2026-07-26T12:42:00Z",
"last_heartbeat": "2026-07-26T14:39:43Z",
"risk": "high",
"blocker": null,
"next_action": "Maintain the 81-test durable runtime contract while shared release and package gates run"
},
{
"id": "D6-PY-DURABLE-010",
"title": "Python event-sourced scheduler start and resume",
"owner": "/root/durable_py",
"status": "completed",
"work_package": "WP3",
"depends_on": ["D6-DURABLE-SPEC-010", "D3-PY-RUNTIME-002", "D2-PY-PERSIST-001"],
"expected_artifacts": ["python/src/graph_engineering"],
"expected_tests": [
"commit-before-release",
"successful node never reruns",
"attempt budgets survive crash",
"identity/history/CAS rejection",
"terminal idempotence"
],
"assigned_at": "2026-07-26T12:42:00Z",
"started_at": "2026-07-26T12:42:00Z",
"last_heartbeat": "2026-07-26T14:39:43Z",
"risk": "high",
"blocker": null,
"next_action": "Maintain the 486-test durable runtime contract as the branch enters CI review"
},
{
"id": "D6-DURABLE-CONFORMANCE-011",
"title": "Cross-language crash/resume and adversarial history conformance",
"owner": "main",
"status": "completed",
"work_package": "WP3-WP11",
"depends_on": ["D6-TS-DURABLE-010", "D6-PY-DURABLE-010"],
"expected_artifacts": [
"tools/conformance/python_durable_report.py",
"tools/conformance/python_durable_interop.py",
"tools/conformance/run.mjs"
],
"expected_tests": [
"Python-created crash history resumes in TypeScript",
"shared result and event sequence parity",
"terminal zero-event zero-executor resume",
"resigned history rejection",
"full repository and package gates"
],
"assigned_at": "2026-07-26T13:28:00Z",
"started_at": "2026-07-26T13:28:00Z",
"last_heartbeat": "2026-07-26T14:49:21Z",
"risk": "high",
"blocker": null,
"next_action": "Monitor protected-branch CI and review feedback without weakening the recovery contract"
}
]
}
Loading