Skip to content

Commit 23991fa

Browse files
jmanhypeclaude
andcommitted
chore: mark final 5 items as done after recovery merge
All 20 items now complete. Recovered: wf_term, wf_core, wf_compile, wf_cancel, wf_effect, wf_receipt, wf_case_runner, wf_case_sup. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 4bea7d8 commit 23991fa

5 files changed

Lines changed: 14 additions & 14 deletions

File tree

.wreckit/items/002-pattern-term-algebra/item.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
"schema_version": 1,
33
"id": "002-pattern-term-algebra",
44
"title": "Implement pattern term algebra and derived patterns",
5-
"state": "critique",
5+
"state": "done",
66
"overview": "Implement wf_term.erl: the closed pattern algebra AST with constructors: task/2 (named task with metadata), seq/2 (sequential composition), par/1 (parallel split, list of branches), xor/1 (exclusive choice, list of branches), join/2 (synchronization with policy), loop/2 (structured loop with condition and body), defer/1 (deferred/lazy evaluation), cancel/2 (cancel scope with region and body), mi/2 (multiple instances with config). Include full -type and -spec declarations for every constructor and the wf_term() union type. Provide smart constructors that validate structural invariants (e.g., par requires at least 2 branches, join policy is valid). Implement structural validation: well_formed/1 that checks nesting rules, no orphan joins, cancel scopes are properly nested.\n\nAlso implement wf_core.erl with derived/composite patterns built from the kernel primitives: simple_merge (xor converging to single continuation), synchronizing_merge (par branches converging with full sync), discriminator (par with first-complete join that cancels remaining), n_out_of_m (par with wait-n join policy). Each derived pattern is a function that returns a wf_term().",
77
"branch": null,
88
"pr_url": null,
99
"pr_number": null,
10-
"last_error": "Merge conflict detected: wreckit/002-pattern-term-algebra cannot be cleanly merged into main. Please resolve conflicts manually or rebase the feature branch.",
10+
"last_error": null,
1111
"created_at": "2026-02-10T00:00:00.000Z",
1212
"updated_at": "2026-02-11T18:12:15.040Z"
13-
}
13+
}

.wreckit/items/004-bytecode-compiler/item.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
"schema_version": 1,
33
"id": "004-bytecode-compiler",
44
"title": "Implement bytecode compiler",
5-
"state": "critique",
6-
"overview": "Implement wf_compile.erl: compile wf_term() AST into wf_bc() bytecode (flat instruction list). Opcodes: SEQ_ENTER (begin sequence scope), SEQ_NEXT (advance to next step in sequence), PAR_FORK (fork N parallel branches with label targets), JOIN_WAIT (block until join condition met — policy: all/n/first), XOR_CHOOSE (exclusive choice point with branch labels), LOOP_BACK (jump back to loop head), LOOP_CHECK (evaluate loop condition, exit or continue), CANCEL_SCOPE (enter/exit cancel region with scope ID), MI_SPAWN (spawn multiple instances per config), EFFECT_YIELD (yield control for external effect), TASK_EXEC (execute a task — the leaf operation), DONE (terminate execution path).\n\nOutput is a flat list of {opcode, operands} tuples with integer label targets for jumps/forks. The compiler performs a single recursive pass over the AST, emitting instructions and resolving labels. Include -spec for compile/1 :: wf_term() -> wf_bc(). Validate that compiled output has no unresolved labels. No per-step AST dispatch at runtime — all structural decisions are resolved at compile time.",
5+
"state": "done",
6+
"overview": "Implement wf_compile.erl: compile wf_term() AST into wf_bc() bytecode (flat instruction list). Opcodes: SEQ_ENTER (begin sequence scope), SEQ_NEXT (advance to next step in sequence), PAR_FORK (fork N parallel branches with label targets), JOIN_WAIT (block until join condition met \u2014 policy: all/n/first), XOR_CHOOSE (exclusive choice point with branch labels), LOOP_BACK (jump back to loop head), LOOP_CHECK (evaluate loop condition, exit or continue), CANCEL_SCOPE (enter/exit cancel region with scope ID), MI_SPAWN (spawn multiple instances per config), EFFECT_YIELD (yield control for external effect), TASK_EXEC (execute a task \u2014 the leaf operation), DONE (terminate execution path).\n\nOutput is a flat list of {opcode, operands} tuples with integer label targets for jumps/forks. The compiler performs a single recursive pass over the AST, emitting instructions and resolving labels. Include -spec for compile/1 :: wf_term() -> wf_bc(). Validate that compiled output has no unresolved labels. No per-step AST dispatch at runtime \u2014 all structural decisions are resolved at compile time.",
77
"branch": null,
88
"pr_url": null,
99
"pr_number": null,
1010
"last_error": null,
1111
"created_at": "2026-02-10T00:00:00.000Z",
1212
"updated_at": "2026-02-11T18:27:22.163Z"
13-
}
13+
}

.wreckit/items/008-cancellation-semantics/item.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
"schema_version": 1,
33
"id": "008-cancellation-semantics",
44
"title": "Implement structured cancellation semantics",
5-
"state": "critique",
6-
"overview": "Implement wf_cancel.erl: structured cancellation for three scopes:\n1. Activity cancellation: cancel a single task. If the task is running (has yielded an effect), the effect is marked cancelled. If not yet started, the task is skipped. Produces a cancel_activity event.\n2. Case cancellation: cancel an entire workflow instance. All active branches, pending effects, and running tasks are cancelled. The case transitions to a terminal cancelled state. Produces a cancel_case event.\n3. Region cancellation: cancel a scoped subtree identified by cancel scope ID. Only tokens and tasks within the named scope are cancelled. Tokens outside the scope are unaffected. Produces cancel_region events for each affected item.\n\nCancellation propagation is O(scope size) — it walks only the tokens/tasks in the affected scope, not the entire workflow. Cancelled scopes produce structured cancel events with: scope_id, cancelled_tokens, cancelled_effects, timestamp. Cancellation does not corrupt unrelated scopes — verified by invariant checks.\n\nIntegrates with wf_exec (scope stack), wf_state (scope metadata), and wf_effect (effect cancellation). Export: cancel_activity/3, cancel_case/1, cancel_region/3, is_cancelled/2.",
5+
"state": "done",
6+
"overview": "Implement wf_cancel.erl: structured cancellation for three scopes:\n1. Activity cancellation: cancel a single task. If the task is running (has yielded an effect), the effect is marked cancelled. If not yet started, the task is skipped. Produces a cancel_activity event.\n2. Case cancellation: cancel an entire workflow instance. All active branches, pending effects, and running tasks are cancelled. The case transitions to a terminal cancelled state. Produces a cancel_case event.\n3. Region cancellation: cancel a scoped subtree identified by cancel scope ID. Only tokens and tasks within the named scope are cancelled. Tokens outside the scope are unaffected. Produces cancel_region events for each affected item.\n\nCancellation propagation is O(scope size) \u2014 it walks only the tokens/tasks in the affected scope, not the entire workflow. Cancelled scopes produce structured cancel events with: scope_id, cancelled_tokens, cancelled_effects, timestamp. Cancellation does not corrupt unrelated scopes \u2014 verified by invariant checks.\n\nIntegrates with wf_exec (scope stack), wf_state (scope metadata), and wf_effect (effect cancellation). Export: cancel_activity/3, cancel_case/1, cancel_region/3, is_cancelled/2.",
77
"branch": null,
88
"pr_url": null,
99
"pr_number": null,
1010
"last_error": null,
1111
"created_at": "2026-02-10T00:00:00.000Z",
1212
"updated_at": "2026-02-11T18:35:44.750Z"
13-
}
13+
}

.wreckit/items/010-effect-boundary-and-receipts/item.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
"schema_version": 1,
33
"id": "010-effect-boundary-and-receipts",
44
"title": "Implement effect boundary and receipt system",
5-
"state": "critique",
5+
"state": "done",
66
"overview": "Implement wf_effect.erl: the effect system boundary for external IO/tool calls. Tasks do not perform side effects directly. Instead, when a task needs external interaction, the executor yields {effect, EffectSpec, Continuation} where EffectSpec describes what to do and Continuation is the resumption point.\n\nEffectSpec includes: effect_id (unique causal ID derived from case_id + step_seq + scope), effect_type (atom), payload (term), idempotency_key (optional, for at-most-once semantics), timeout (optional).\n\nEffects are:\n- Cancelable: if the cancel scope containing the effect is cancelled, the effect is marked cancelled and its result (if any) is discarded.\n- Idempotent or at-most-once: if an idempotency_key is provided, duplicate effect submissions with the same key return the cached result from the receipt store.\n\nImplement wf_receipt.erl: receipt records for completed effects. Each receipt contains: receipt_id, effect_id, effect_spec_hash (for verification), timestamp, result (ok/error tuple), duration_us. Receipts form an append-only log per case. Receipts can be queried by effect_id or idempotency_key.\n\nExport from wf_effect: new_spec/4, yield/3, cancel_effect/2, is_cancelled/1.\nExport from wf_receipt: new/3, store/2, lookup/2, lookup_by_key/2, all/1, verify/2 (check hash matches spec).",
77
"branch": null,
88
"pr_url": null,
99
"pr_number": null,
1010
"last_error": null,
1111
"created_at": "2026-02-10T00:00:00.000Z",
1212
"updated_at": "2026-02-11T18:49:04.478Z"
13-
}
13+
}

.wreckit/items/012-otp-supervision-tree/item.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
"schema_version": 1,
33
"id": "012-otp-supervision-tree",
44
"title": "Implement OTP supervision tree and public API",
5-
"state": "implementing",
6-
"overview": "Implement the OTP supervision tree and public API for wf_substrate.\n\nSupervision hierarchy:\n- wf_substrate_sup: top-level supervisor (one_for_one), starts wf_case_sup and optional singletons.\n- wf_case_sup: dynamic supervisor (simple_one_for_one) for per-case runner processes.\n- wf_effect_sup (optional): dynamic supervisor for effect handler processes if effects are executed in-process.\n- wf_trace_sink: optional gen_server that collects trace events from all cases (for centralized logging/monitoring).\n\nPer-case runner as gen_statem with states: {initializing, running, waiting_effect, waiting_signal, cancelled, done}. The runner holds the exec_state, steps in configurable bursts (N reductions then yield to scheduler), handles incoming signals (external events that feed into XOR choices or task completions), effect responses, and cancel requests. Uses state_timeout for overall case timeout.\n\nPublic API module wf_substrate.erl exports:\n- new_case/3 :: (CaseId, wf_term(), Ctx) -> {ok, Pid} — compile term, create runner.\n- signal/2 :: (CaseId, Signal) -> ok — send external signal to running case.\n- cancel/1 :: (CaseId) -> ok — cancel entire case.\n- cancel_region/2 :: (CaseId, ScopeId) -> ok — cancel a region within a case.\n- await/2 :: (CaseId, Timeout) -> {ok, Result} | {error, Reason} — block until case completes.\n- status/1 :: (CaseId) -> Status — get current case status.\n- trace/3 :: (CaseId, Level, Sink) -> ok — configure tracing for a case.\n- validate/2 :: (wf_term(), Options) -> ok | {error, Issues} — static validation without execution.\n\nInclude wf_substrate_app.erl (application behaviour) that starts wf_substrate_sup.",
5+
"state": "done",
6+
"overview": "Implement the OTP supervision tree and public API for wf_substrate.\n\nSupervision hierarchy:\n- wf_substrate_sup: top-level supervisor (one_for_one), starts wf_case_sup and optional singletons.\n- wf_case_sup: dynamic supervisor (simple_one_for_one) for per-case runner processes.\n- wf_effect_sup (optional): dynamic supervisor for effect handler processes if effects are executed in-process.\n- wf_trace_sink: optional gen_server that collects trace events from all cases (for centralized logging/monitoring).\n\nPer-case runner as gen_statem with states: {initializing, running, waiting_effect, waiting_signal, cancelled, done}. The runner holds the exec_state, steps in configurable bursts (N reductions then yield to scheduler), handles incoming signals (external events that feed into XOR choices or task completions), effect responses, and cancel requests. Uses state_timeout for overall case timeout.\n\nPublic API module wf_substrate.erl exports:\n- new_case/3 :: (CaseId, wf_term(), Ctx) -> {ok, Pid} \u2014 compile term, create runner.\n- signal/2 :: (CaseId, Signal) -> ok \u2014 send external signal to running case.\n- cancel/1 :: (CaseId) -> ok \u2014 cancel entire case.\n- cancel_region/2 :: (CaseId, ScopeId) -> ok \u2014 cancel a region within a case.\n- await/2 :: (CaseId, Timeout) -> {ok, Result} | {error, Reason} \u2014 block until case completes.\n- status/1 :: (CaseId) -> Status \u2014 get current case status.\n- trace/3 :: (CaseId, Level, Sink) -> ok \u2014 configure tracing for a case.\n- validate/2 :: (wf_term(), Options) -> ok | {error, Issues} \u2014 static validation without execution.\n\nInclude wf_substrate_app.erl (application behaviour) that starts wf_substrate_sup.",
77
"branch": null,
88
"pr_url": null,
99
"pr_number": null,
1010
"last_error": null,
1111
"created_at": "2026-02-10T00:00:00.000Z",
1212
"updated_at": "2026-02-11T18:49:05.771Z"
13-
}
13+
}

0 commit comments

Comments
 (0)