Repository navigation
Conversation
…ort (#909) The reported loss does not reproduce on 5da095e: contains_entry edges of every non-fixture about are byte-identical after replay, and the full, paged wake catalogue of project:made matches its source. This regression test writes labelled memories in two abouts, relabels one, exports through the binary, imports into a fresh store on a hermetic HOME/XDG and requires every page of the catalogue to come back unchanged.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #909.
Summary
The reported loss does not reproduce on
5da095ee(v0.25.0), and it does not reproduce with the released 0.24.0 binary either. Replay builds the samecontains_entryedges as the live write path, soVisualLabel::cataloguereturns the same catalogue. This PR adds no product change. It adds the regression test the issue asks for, so the "Expected" clause is now pinned.Evidence (scratch copy of the real user store, 474 events, 20 abouts)
cp -a ~/.local/share/kmp/default $SCR/src-store, thenexporttofull.jsonlandimportinto a fresh dir ({"events_imported":474,"mutations_applied":16085}). HOME and XDG pointed at scratch dirs the whole time.contains_entryedges (relations_by_source,k3='contains_entry', value JSON withdimension/scope_id): source 2473, replay 2477. Thediffshows exactly 4 extra lines, all forfixture:storea/fixture:storeb. Every other edge is byte-identical,project:madeincluded.project:made, read page by page throughprojection.next_action(51 pages on the source, 116 on the replay): 108 labels in each. The sorteddiffis empty.sections.labels = {remaining: 102, returned_on_page: 6}.import --from <store> --about project:madeandimport --from <bundle> --about project:made, both read in full, give the same 108 labels with an emptydiff.~/.claude/plugins/cache/underpass/kmp/0.24.0/bin/kmp-mcp), same procedure: source and replay both return 108 labels, and both match the 0.25.0 catalogue with an emptydiff.The labels are a paged expansion that fills the byte budget after the core (see
kmp_wake'slabelsdescription). So a page can showlabels: []whileprojection.sections.labels.remaining > 0. That is my best explanation for the original3 → []reading, but I could not reproduce it with the default budget, nor with anintent.What the table-count deltas in the issue actually are
aggregates18→20,memory_anchors18→20,nodes+6,relations_by_*+14: all of it isfixture:storea/fixture:storeb. Events 405/406 of the source log, with idempotency keyscanary-storeA-v1/canary-storeB-v1, are inevent_logandidempotencybut have no aggregate head, anchor, nodes or edges.append_in_transaction(crates/kmp-adapter-embedded/src/adapter/context_events.rs) writes the aggregate head, the log row and the idempotency row in one transaction, and no product path removesaggregatesrows.rebuild_projections(replay.rs) leavesaggregatesalone and projects every log event again. Projections deleted after the commit are the most likely cause, for example a manual canary cleanup like the one that leftdefault-backups/kernel.sqlite3.pre-canary-cleanup.bakon 23 Sept; that is not proven. The events were already in the log by the 26 Sept bench export. Replay simply projects them again. This partial "source lags its log" state is limited to those two fixture abouts and does not touchproject:made.detail_headers1953→2331: every extra key isproject:kmp. Headers came after many of those details had been written (detail_header.rs: "a detail whose header is absent is a projection that predates this record"). Replay writes a header for each detail, so this gap is expected and harmless.Test
crates/kmp-mcp/tests/label_catalogue_round_trip.rs:kmp_relabelto move one entry fromtask=corte-3totask=corte-5;kmp-mcp exportand thenkmp-mcp importthrough the real binary into a fresh store, with temporary HOME and XDG;Checks run locally
All of these ran with HOME and XDG set to scratch dirs:
cargo fmt --all -- --checkcargo clippy -p kmp-mcp --all-targets --locked -- -D warningscargo test -p kmp-mcp --locked: 1256 passed, 0 failedscripts/ci/kmp-mcp-architecture-gate.shOnly
kmp-mcpwas touched (a test file), which is insideDEV_PACKAGES.