Skip to content

contract(class_view): execute_compute_dag — the ORDER half of the ActionDef value executor#688

Merged
AdaWorldAPI merged 1 commit into
mainfrom
claude/review-medcare-rust-dt7MS
Jul 13, 2026
Merged

contract(class_view): execute_compute_dag — the ORDER half of the ActionDef value executor#688
AdaWorldAPI merged 1 commit into
mainfrom
claude/review-medcare-rust-dt7MS

Conversation

@AdaWorldAPI

@AdaWorldAPI AdaWorldAPI commented Jul 13, 2026

Copy link
Copy Markdown
Owner

What

Adds execute_compute_dag to lance-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) and Compute { 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) — refuses Cyclic before running any target (store untouched), else runs targets in compute_dag_topo_order so 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_target closure owns value semantics — it recomputes field position t on the consumer-owned store (e.g. a hand-ported score formula). Leaves are never passed to compute_target; they are the already-present inputs.

Why now

The medcare consumer's sono_compute_parity witness (MedCare-rs, follow-up PR) dispatches the medcare-core::sono Recal_* hand-port through this primitive and proves bit-parity over the two-layer f_2_7 DAG (6 joints → recal_ges). That is the gate the ActionDef-executor plan requires BEFORE draining any hand-ported module — and it needs this primitive on main so the consumer's vendored lance-graph-contract path 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)
  • Zero new dependencies (std only)
  • Board hygiene: LATEST_STATE.md contract-inventory row updated in the same commit (per the Mandatory Board-Hygiene Rule)

🤖 Generated with Claude Code


Generated by Claude Code

Summary by CodeRabbit

  • New Features
    • Added dependency-aware recomputation for class values.
    • Recomputations now run in dependency order, with results available to subsequent calculations.
    • Cyclic dependencies are rejected without changing existing values.
    • Processing stops at the first failed calculation while preserving earlier results.
    • Empty recomputation plans complete without changes.

…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.
@cursor

cursor Bot commented Jul 13, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot 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)

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f68ef4d8-7796-4be3-9e2e-a22b49aab616

📥 Commits

Reviewing files that changed from the base of the PR and between d641a7d and c7903d5.

📒 Files selected for processing (2)
  • .claude/board/LATEST_STATE.md
  • crates/lance-graph-contract/src/class_view.rs

📝 Walkthrough

Walkthrough

Adds a public recompute-DAG executor for class fields, including topological execution, cycle detection, target-specific errors, abort-on-failure behavior, and comprehensive unit tests.

Changes

Class recompute DAG execution

Layer / File(s) Summary
Executor API and failure semantics
crates/lance-graph-contract/src/class_view.rs, .claude/board/LATEST_STATE.md
Adds ExecuteComputeError and execute_compute_dag, documenting topological execution, cycle refusal, and immediate failure handling.
Executor behavior tests
crates/lance-graph-contract/src/class_view.rs
Tests dependency ordering, value visibility, cycle safety, partial recomputation, and empty-DAG no-op behavior.

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
Loading

Poem

I’m a bunny with a DAG to run,
Topological hops beneath the sun.
Cycles stop before writes begin,
Failed fields halt the race within.
Empty paths nap; tests cheer—
Clean recomputes bloom this year!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly names the new execute_compute_dag change in class_view and matches the PR’s main objective.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@AdaWorldAPI AdaWorldAPI merged commit 757c3e8 into main Jul 13, 2026
7 checks passed
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.

2 participants