Skip to content

Milestone 4 — Run orchestration decision and compatibility spike

Outcome: Complete with NO-GO for LangGraph. Keep the current Harnessa scheduler. Stop here; milestone 5 has not started.

Baseline: main at 8ddc86e77520288e2bfc9699d3ad7b67fe2e6b03 (8ddc86e). The checkout was clean at initial preflight. While this milestone ran, a separate user commit d2b5133 added project skills and development MCP documentation; it was preserved and is outside this milestone's changes.

Decision: ADR 0004. Declared workload: spike workload and thresholds.

Milestone 3 gate verified

Before milestone 4 edits, I checked the milestone 3 report and reran its offline gates instead of relying on the report file. pnpm lint, pnpm typecheck, and pnpm test passed; the unit suite had 9 passed and 17 integration skips. podman compose ... config -q passed. The running milestone 3 API readiness endpoint returned ready and web returned HTTP 200. HARNESSA_API_URL=http://127.0.0.1:28010 pnpm contracts:generate succeeded with no generated diff. On disposable PostgreSQL 16.10 and Redis 7.4.2, all 17 integration tests passed. A fresh Alembic database reached revision b11f10974e82; an upgrade from 0001_foundation preserved the seeded task and produced the expected seeded model pools; alembic check reported no new operations. The optional paid-provider probe remains pending per the milestone 3 report. No paid call was made for milestone 4.

Work completed

  • Reviewed the active prompt and planning decisions, milestones 1–3, scheduler/recovery/effect/stream code, adapter ports, and OpenAPI-to-TypeScript generation path.
  • Added the isolated Python 3.12 candidate set at spikes/orchestration/candidate/, pinning LangGraph 1.2.16 and langgraph-checkpoint-postgres 3.2.0. The complete dependency resolution is recorded in the spike uv.lock; production dependency files were not changed.
  • Verified async PostgreSQL setup, repeated setup, typed interrupt/resume after reconstructing saver and graph objects, strict-msgpack mode, and forward-only checkpointer migration behavior on disposable PostgreSQL.
  • Added framework-neutral Pydantic run orchestration/evidence contracts and the RunOrchestrator adapter protocol. Registered the models in canonical OpenAPI and regenerated the TypeScript client through the existing command. No framework type is present in the public schemas and no runtime endpoint or production executor was added.
  • Wrote ADR 0004 with the binary decision, ownership boundary, versions/licenses/API findings, per-case evidence, reproduction commands, limitations, and conditional migration/rollback guardrails. The conditional GO plan is documentation only.

Actual verification

Command or check Result
uv lock --directory spikes/orchestration/candidate --python 3.12.12 Passed; resolved 81 packages with exact candidate pins in the isolated lock.
Candidate pytest command in ADR, using LANGGRAPH_STRICT_MSGPACK=true 3 passed on PostgreSQL 16.10. Covers repeatable setup, PostgreSQL-backed interrupt/resume after saver/graph reconstruction, typed answer validation, and fixture-only duplicate dispatch/answer/effect guards. One pytest cache warning occurred because the workspace mount was read-only.
Current integration command in ADR, on disposable PostgreSQL/Redis 17 passed. Covers current scheduler fencing/recovery/retries/cancellation, event transport/replay, effect reconciliation, model reservation ceilings, and partial stream behavior. One pytest cache warning occurred because the workspace mount was read-only.
pnpm lint:api Passed.
uv run ruff check spikes/orchestration/candidate Passed.
pnpm typecheck:api Passed; mypy checked 22 source files.
pnpm test:api Passed after excluding spike files from default discovery by naming the candidate case module langgraph_postgres_cases.py: 13 passed, 17 integration tests skipped without explicit service URLs; one existing Starlette/AnyIO deprecation warning.
pnpm contracts:generate with HARNESSA_API_URL=http://127.0.0.1:28020 Passed against the updated local API OpenAPI schema.
pnpm typecheck:web and pnpm lint:web Passed after TypeScript generation.

An additional non-gating uv run mypy --follow-imports=silent apps/api/harnessa/main.py reports 9 diagnostics on handlers/OpenAPI assignment that already exist at the baseline revision. The repository's configured pnpm typecheck:api does not include main.py and passes; the new contract registration was exercised by API tests and OpenAPI generation.

M4 database and test-runner settings were bounded at PostgreSQL 2 CPUs/1 GiB with a 512 MiB tmpfs data directory, Redis 1 CPU/256 MiB, and test runner 2 CPUs/1 GiB. PostgreSQL was 16.10 and Redis was 7.4.2. No peak RSS measurement was taken. All test data was disposable. There was no paid model use, GitHub access, production service, or live run-state migration; external spend was $0.

Matrix result and limitations

The current integration suite passes its existing scenarios, and the LangGraph smoke suite demonstrates a narrow set of database-backed APIs. The full critical matrix did not pass on both runtimes:

  • Current Harnessa has no durable question/answer authority or route, and the production execution adapter is unconfigured. Candidate answer/dispatch/effect checks use spike-only SQL fixtures; they do not count as Harnessa authority evidence.
  • Neither side ran a process-kill fault at both sides of checkpoint commit, cancellation resource/process cleanup, database outage, or the exact timeout-after-accepted-effect schedule.
  • LangGraph was not connected to Harnessa leases/fencing, domain-event replay, budget reservations, or effect-intent reconciliation. Candidate attempts cannot prove those controls.
  • Candidate setup was tested fresh and repeatable through migration version 9. The package has no downgrade API; an older-schema upgrade plus rollback preserving Harnessa audit/effect rows was not demonstrated.
  • The fixed 64-run workload was not executed. Its 16 human waits cannot be represented with current Harnessa question authority without substituting a synthetic pass. Therefore p50/p95 dispatch and recovery latency, database write/storage ratios, worker RSS ratios, and the required 20% custom-code reduction have no valid paired result. The candidate test suite's 0.65 second runtime is not a workflow benchmark.

These are explicit NO-GO findings under the prompt's conjunctive gate, not claims that the candidate is unsuitable in every future architecture. No threshold was relaxed after candidate execution. Harnessa remains authoritative and its current scheduler remains selected.

Milestone 5 prerequisites

The next milestone must first confirm this NO-GO/current-scheduler decision. Before reopening a runtime comparison, add Harnessa-owned durable questions and answer receipts with authorization, revisions, and idempotency; provide a real adapter boundary that carries run/attempt/fencing identity; and demonstrate process cleanup, checkpoint-boundary crashes, database-outage behavior, timeout-after-effect reconciliation, and rollback preserving Harnessa authority/audit/effect data. Any future comparison must execute the already declared workload on both paths and capture the stated latency, PostgreSQL, RSS, and custom-code measures. Do not add LangGraph to production or translate live checkpoints based on this spike.