fix(code): rebase concurrent map updates - #2324
Conversation
|
Reviewed at head The two race tests cannot fail on the implementation they exist to disprove
Both are That makes them change-detectors for the new code rather than regression proofs for the bug. It The fix is to put the forced interleaving on a seam that exists in both implementations — a pause The L2 sweep decides outside the rebase boundary, so "every RMW" is not true yet
let existing_module = get_entity_opt(rt, token, precomputed_module_id).await?; // :3205
let needs_reparse = l2_needs_reparse(/* ...from existing_module... */); // :3206
let Some(module_id) = upsert_module(..., !needs_reparse, ...) // :3232
...
if !needs_reparse {
let declaration_ids = existing_module.as_ref()... // :3252
Worth being precise about provenance, because it changes what the fix is. This shape is not new — main So this is an incomplete fix rather than a regression, and it reads as a defect mainly because of what Natural-key insert loss retries the same absent id
Reach bounds this: source-ingest callers derive What holds up
Coverage gaps worth namingBeyond the revert-red problem: no test covers a retry whose second attempt also conflicts, a No builds or tests were run for this pass; every claim above was checked against source at the head |
ohdearquant
left a comment
There was a problem hiding this comment.
Automated review. Posted by this repository's automated pull-request review pipeline; this is not a human read and does not gate the merge by itself.
Verdict on head 964a72b: REQUEST-CHANGES, 3 blocking findings. Finding details are delivered to the review's recipients rather than posted here. Do not merge this head while blocking findings are outstanding; a pipeline comment on a newer head supersedes this one.
One conflict, in `crates/khive-db/src/stores/graph.rs`, and it was an insertion collision rather than a disagreement: both sides added a new edge-insert helper immediately after `edge_upsert_statement`, so git could not tell they were different functions. Both are kept. - main's `edge_insert_only_guarded_by_endpoints_statement` inserts only while both endpoints still exist. - this branch's `edge_insert_if_absent_statement` leaves an existing edge untouched on either conflict so the caller can read the winner. `cargo check -p khive-db --all-targets` is clean at this tree, which is the control that matters here: the two functions returning the same `statement` binding is exactly the shape a careless resolution would have silently merged into one.
Summary
Regression proof
Before the fix, forced same-revision interleavings lost one unresolved specifier and one dependency-evidence kind. The same two-runtime tests now retain both writers, advance the winning revision, and record each entity FTS effect once.
Verification
cargo test -p khive-pack-code(159 tests passed)cargo test -p khive-storage(137 tests passed)cargo test -p khive-db --lib(839 passed; one unrelated walpin timestamp-boundary flake passed on exact isolated rerun)cargo check --workspace --all-targetscargo clippy --workspace --all-targets -- -D warningscargo fmt --all --manifest-path crates/Cargo.toml -- --checkgit diff --checkCloses #2231