feat(callcenter): LanceMembrane::commit_event — action-commit sole-writer sibling (gate 1)#467
Conversation
…e-writer sibling (gate 1) The runtime-side gate-1 piece referenced by OGAR-AST-CONTRACT §3 (OGAR PR #11) and CROSS_SESSION_COORDINATION.md grill #10. `commit_event(row) -> u64` is the seam the Rubicon CommitHook lowers onto: on entering the Committed lifecycle state, the binding builds a CognitiveEventRow from the OGAR ActionInvocation and calls this; it returns the new monotonic Lance version (the crossing's audit version). Where project() projects a cognitive cycle (ShaderBus + MetaWord), commit_event takes a caller-built CognitiveEventRow directly. Unlike project(), the action commit is the authoritative audit event (the Rubicon crossing / rubberstamp), so it ALWAYS ticks the version and fans out via the watcher — the server filter / gate throttle cognitive-cycle fan-out, not an explicit committed action. Kept on the concrete LanceMembrane, NOT on the zero-dep ExternalMembrane trait, so the contract crate stays zero-dep and action commits never get forced through the cognitive-cycle ShaderBus shape (the boundary agreed with the OGAR session). Verified: cargo check -p lance-graph-callcenter (realtime + default) green; test commit_event_ticks_version_and_returns_new passes. https://claude.ai/code/session_01VysoWJ6vsyg3wEGc5v7T5v
📝 WalkthroughWalkthroughAdded a new public ChangesEvent commit path
Sequence DiagramsequenceDiagram
participant Client
participant LanceMembrane
participant VersionCounter
participant LanceVersionWatcher
Client->>LanceMembrane: commit_event(CognitiveEventRow)
LanceMembrane->>VersionCounter: increment and fetch
VersionCounter-->>LanceMembrane: new version value
alt realtime feature enabled
LanceMembrane->>LanceVersionWatcher: bump(row)
LanceVersionWatcher-->>LanceMembrane: acknowledged
else non-realtime build
LanceMembrane->>LanceMembrane: discard row
end
LanceMembrane-->>Client: return version (u64)
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
crates/lance-graph-callcenter/src/lance_membrane.rs (1)
289-293:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winClarify when the version counter increments.
The doc comment states "ticks on each CollapseGate Persist", but the implementation only increments the version counter in
commit_event(line 316), not inproject(). Sincecommit_eventis the "action-commit sole-writer" (line 295), the documentation should clarify that the version ticks on action commits, not on all CollapseGate events.📝 Suggested doc comment revision
- /// Current Lance version counter (monotonic; ticks on each CollapseGate - /// Persist). Phase D wires this to the Lance dataset version. + /// Current Lance version counter (monotonic; incremented by action commits + /// via `commit_event`). Phase D wires this to the Lance dataset version. pub fn version(&self) -> u64 {🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@crates/lance-graph-callcenter/src/lance_membrane.rs` around lines 289 - 293, The doc comment for the version() method is misleading: it says the counter "ticks on each CollapseGate Persist" but the code only increments the counter in commit_event (the action-commit sole-writer) and not in project(); update the documentation to state that the version counter increments on action commits handled by commit_event (or when the action-commit path persists), not on every CollapseGate persistence, and mention that project() does not advance the version to avoid implying incorrect semantics.
🧹 Nitpick comments (1)
crates/lance-graph-callcenter/src/lance_membrane.rs (1)
551-564: 💤 Low valueConsider adding test coverage for the realtime feature path.
The current test verifies the version increment behavior, which is excellent. For additional confidence, consider adding a test that verifies
watcher.bump()is called when therealtimefeature is enabled, perhaps by subscribing and checking that the row is received.💡 Example test structure
#[cfg(feature = "realtime")] #[test] fn commit_event_bumps_watcher_under_realtime() { let m = LanceMembrane::new(); let rx = m.subscribe(CommitFilter::default()); let row = CognitiveEventRow { thinking: 42, ..Default::default() }; m.commit_event(row); let snapshot = rx.current(); assert_eq!(snapshot.thinking, 42, "watcher should receive the committed row"); }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@crates/lance-graph-callcenter/src/lance_membrane.rs` around lines 551 - 564, Add a feature-gated test that exercises the realtime path: under #[cfg(feature = "realtime")] add a test (e.g., commit_event_bumps_watcher_under_realtime) that creates a LanceMembrane via LanceMembrane::new(), calls m.subscribe(CommitFilter::default()) to obtain an rx, commits a known CognitiveEventRow with m.commit_event(...), and then asserts the watcher received the committed row (e.g., via rx.current() or the watcher API used in the code); this verifies watcher.bump()/realtime propagation when the realtime feature is enabled.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@crates/lance-graph-callcenter/src/lance_membrane.rs`:
- Around line 289-293: The doc comment for the version() method is misleading:
it says the counter "ticks on each CollapseGate Persist" but the code only
increments the counter in commit_event (the action-commit sole-writer) and not
in project(); update the documentation to state that the version counter
increments on action commits handled by commit_event (or when the action-commit
path persists), not on every CollapseGate persistence, and mention that
project() does not advance the version to avoid implying incorrect semantics.
---
Nitpick comments:
In `@crates/lance-graph-callcenter/src/lance_membrane.rs`:
- Around line 551-564: Add a feature-gated test that exercises the realtime
path: under #[cfg(feature = "realtime")] add a test (e.g.,
commit_event_bumps_watcher_under_realtime) that creates a LanceMembrane via
LanceMembrane::new(), calls m.subscribe(CommitFilter::default()) to obtain an
rx, commits a known CognitiveEventRow with m.commit_event(...), and then asserts
the watcher received the committed row (e.g., via rx.current() or the watcher
API used in the code); this verifies watcher.bump()/realtime propagation when
the realtime feature is enabled.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 23eae038-eabc-4308-b122-a113eb13b461
📒 Files selected for processing (1)
crates/lance-graph-callcenter/src/lance_membrane.rs
Tailored cross-repo view onto the substrate-b endgame architecture
from lance-graph's runtime-side perspective. Master doc lives in
AdaWorldAPI/OGAR/docs/SUBSTRATE-ENDGAME.md (five-rooms forward-looking
architecture, 1345 lines). This view focuses on:
- Room 1: lance-graph-contract, lance-graph-ontology, callcenter
(commit_event sibling — PR #467, merged), planner::temporal
(PR #468), supervisor, cognitive-shader-driver
- Room 2: Kanban polyglot work-item trait, HTTP-sidecar bridge,
§14 oracle harness, optional BEAM bridge
- Room 3: callcenter actors per OGAR Class, version_watcher push
stream, RubiconWriter Phase 2 dynamic regeneration for OP's
Workflow table
- Room 4: OpenTelemetry exposition, cognitive-event-row stream
for sexy-tier viz, actor-tree topology API
- Room 5: stable public API + SemVer, runtime getting-started,
reference deployment
Plus cross-references to OGAR's ADR doc (ADR-008 commit_event,
ADR-009 temporal two-axis, ADR-018 Kanban polyglot are lance-graph-
touching decisions) + companion runtime references + open items
lance-graph owns + compact priority map.
Pure docs; navigation aid for runtime sessions picking up the
endgame architecture without re-reading the full OGAR master.
https://claude.ai/code/session_01PBTGaPCSnnt6u3pjXpbLwY
LanceMembrane::commit_event— gate 1, runtime sideAdds the action-commit sole-writer sibling the cross-session contract needs.
OGAR-AST-CONTRACT §3 (OGAR PR #11) wires
LanceCommitHook::on_commit→LanceMembrane::commit_event(row) -> u64; this is that fn.Why a sibling, not a trait method. It stays on the concrete
LanceMembrane,not on the zero-dep
ExternalMembranetrait — so the contract crate keeps zerodeps and action commits never get forced through the cognitive-cycle
ShaderBusshape that
project()requires.project()is for cognitive cycles; this is forexplicit action commits (the Rubicon
Pending → Committedcrossing).Semantics. Unlike
project()(whose fan-out is gated by the server filter /MembraneGate), the action commit is the authoritative audit event — therubberstamp — so it always ticks the version and fans out. Returns the new
monotonic Lance version.
Verified:
cargo check -p lance-graph-callcentergreen in bothrealtimeand default; test
commit_event_ticks_version_and_returns_newpasses.Closes the runtime side of gate 1 (tracked in
CROSS_SESSION_COORDINATION.mdgrill #10). Companion to OGAR #11 (§3) +
ractor_actorsfeat/state-machine-actor.https://claude.ai/code/session_01VysoWJ6vsyg3wEGc5v7T5v
Summary by CodeRabbit