Repository navigation
fix(memory): name a missing or ambiguous match instead of review_changed - #131
Merged
Merged
Conversation
Release LORE 0.62.25. `memory replace --scope project "<old>" "<new>"` answered `review_changed` and changed nothing: the CLI joins positionals into the text, so the match stayed empty, matched every entry and the substring path refused it with the code for a changed reviewed snapshot. That code sends a caller looking for a concurrent writer or a stale review, while the cause was their own match. A substring that hits no entry is now `match_not_found` and one that hits several is `match_ambiguous` (memory replace/remove/move, filemap replace/remove, and project-name resolution for `memory move --to`, `project move` and `backfill --project`). A missing or empty `--match`, and a positional these commands cannot read, are `invalid_request`; the old parser dropped them, which let `filemap remove <path>` delete the only row of a one-row map. `review_changed` stays where something really changed: the exact review path, exact sync replay, pending listings and the other snapshot checks. Verified: cargo check --locked --workspace, cargo test --locked (all suites), the native launcher smoke test, all 41 Python test files and tests/test_native_interop.py.
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.
lore memory replacewithout--matchansweredreview_changedand changed nothing. That code means "the reviewed snapshot changed since you looked", so a caller goes looking for a concurrent writer when the real cause is their own match: an empty--matchmatches every entry, and the substring path refuses anything but exactly one hit.The direct path now names the match. A missing or empty
--matchonmemory replace|remove|moveandfilemap replace|removeisinvalid_request, as is a positional argument the subcommand does not take, which the parser used to drop silently. A match that hits no entry is the newmatch_not_found, one that hits several ismatch_ambiguous, andmemory move --toandproject movereport an unknown project name the same way.review_changedstays wherever it means a stale snapshot or a concurrent change: the exact replay path used by sync andproject move, reviewed--expectedwrites, pending, the gate and the belief stores.The stray positionals were worse than a misleading code on the old binary:
filemap remove src/a.rsdeleted the only row,filemap replace src/b.rs secondrewrote it, andmemory remove --match old strayapplied. All of them are refused now.Text stays variadic for
memory add|replaceandfilemap add|replace, matching the Python CLI'stext nargs="+", soreplace --match X old newstill writes "old new".Releases 0.62.25: version in the plugin manifests and Cargo files, and a CHANGELOG entry.
Validation:
cargo check --locked --workspace,cargo test --locked(all native suites), the native launcher checks, the 41 Python test files andtests/test_native_interop.pypass locally. New unit tests cover a zero and a two-entry match for memory, move and filemap with the file left unchanged, plus an exact-path miss that still reportsreview_changed. A CLI test drives the binary through eleven refused forms, including the reported one, and through both new codes. With the fix reverted, the new tests fail withreview_changedwhere they expect the new codes. The built binary, run against a scratchLORE_ROOT, returnsinvalid_requestfor the reported call,match_not_foundandmatch_ambiguousfor the two misses, and applies a correct--match.