contract(class_view): execute_compute_dag — the ORDER half of the ActionDef value executor#688
Conversation
…ionDef value executor (lane-3a inc 1) Runs a class's recompute DAG over a consumer-owned store in topological order (compute_dag_topo_order): Cyclic is refused before any target runs (store untouched); a failing consumer closure aborts at that target (earlier targets stay written, later targets never run — the same visibility contract as cycle-aware write_row gating). Value semantics live entirely in the consumer's compute_target closure — thinking/order upstream, values with the row owner; medcare's hand-ported sono Recal_* family is the designated first parity witness. Additive on #539's ComputeEdge machinery; zero new deps; +4 tests (41/41 class_view). Board: LATEST_STATE contract-inventory row in this commit.
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_703c33fa-e8b6-45f8-9fee-6324fc897010) |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughAdds a public recompute-DAG executor for class fields, including topological execution, cycle detection, target-specific errors, abort-on-failure behavior, and comprehensive unit tests. ChangesClass recompute DAG execution
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Caller
participant execute_compute_dag
participant Store
Caller->>execute_compute_dag: Provide ComputeEdge entries and compute_target
execute_compute_dag->>execute_compute_dag: Build topological recompute order
execute_compute_dag->>Store: Recompute each target in order
Store-->>execute_compute_dag: Return success or target failure
execute_compute_dag-->>Caller: Return executed order or ExecuteComputeError
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
What
Adds
execute_compute_dagtolance-graph-contract::class_view— the ORDER half of the ActionDef value executor (the medcare transpile arc's lane-3a increment 1).ExecuteComputeError<E>—Cyclic(no topological order; the registry-build gate should have rejected the manifest) andCompute { target, source }(the consumer closure failed at a target; abort-at-target, earlier targets stay written).execute_compute_dag<S, E>(edges, store, compute_target)— refusesCyclicbefore running any target (store untouched), else runs targets incompute_dag_topo_orderso every precedent is recomputed before its dependents. Returns the executed order.Split of responsibilities (commitment: thinking lives upstream, values live with the row owner)
This function owns sequencing only. The consumer's
compute_targetclosure owns value semantics — it recomputes field positionton the consumer-owned store (e.g. a hand-ported score formula). Leaves are never passed tocompute_target; they are the already-present inputs.Why now
The medcare consumer's
sono_compute_paritywitness (MedCare-rs, follow-up PR) dispatches themedcare-core::sonoRecal_*hand-port through this primitive and proves bit-parity over the two-layerf_2_7DAG (6 joints →recal_ges). That is the gate the ActionDef-executor plan requires BEFORE draining any hand-ported module — and it needs this primitive onmainso the consumer's vendoredlance-graph-contractpath resolves it.Verification
cargo test -p lance-graph-contract class_view— 41/41 passing (4 new: in-order chain, cycle-untouched, abort-at-target, empty-noop)LATEST_STATE.mdcontract-inventory row updated in the same commit (per the Mandatory Board-Hygiene Rule)🤖 Generated with Claude Code
Generated by Claude Code
Summary by CodeRabbit