fix: attach reindex-fts and repair-summaries to the memory-pro command group#944
fix: attach reindex-fts and repair-summaries to the memory-pro command group#944gorkem2020 wants to merge 3 commits into
Conversation
5806d1f to
d1c03dc
Compare
…roup Both were registered on the root commander program (program.command(...)) instead of the memory-pro group every other command in this file uses. Core's dispatcher only routes the declared root command 'memory-pro', so neither command was ever reachable — dead code shipped and unreachable since whichever commit introduced them. Reattached to the memory group; they're now invoked as 'memory-pro reindex-fts' / 'memory-pro repair-summaries', consistent with every other command.
d1c03dc to
3bb1522
Compare
app3apps
left a comment
There was a problem hiding this comment.
Reviewed head 3bb1522. The command-tree attachment itself is correct, the three focused tests pass, the build is clean, and GitHub CI is green. The generated dist/index.js catch-up is reproducible from the already-merged source change and is not a blocker.
However, this PR's stated effect is to make these maintenance actions usable through the supported CLI path for the first time, and both action bodies have unsafe observable behavior:
-
cli.ts:2162-2198treats a mismatch between the first 60 characters oftextandl0_abstractas staleness. L0 is designed to be a concise generated abstract, so valid enriched memories are classified as stale; because--dry-rundefaults to false, their L0/L1/L2 metadata is overwritten with raw text. Conversely, a real text change after character 60 is missed. Please use reliable source-text provenance/versioning (with a conservative legacy policy), make mutation explicitly opt-in, and add action-level regressions for both cases. -
src/store.ts:2630-2642suppressesdropIndexfailures. The surviving index then makes recreation a no-op, but the method still marks FTS available and returns success. Please propagate/verify failed drops and verify that a replacement index exists before reporting success, with a failed-drop regression test.
These need to be safe before the PR exposes the commands as supported maintenance operations.
Every user-facing command in this file is meant to live under the
memory-progroup (program.command("memory-pro"), built at the top ofregisterMemoryCLI) so it can be invoked asmemory-pro <command>.reindex-ftsandrepair-summarieswere instead registered directly on the root commanderprogram. Since the host's dispatcher only routes the one declared root command (memory-pro), both commands were unreachable through any actual invocation path, no matter how they were called. This looks like it has been the case since whichever commit introduced them; there was no test exercising the actual command tree that would have caught it.reindex-ftsandrepair-summariesare now attached to thememorygroup variable instead ofprogram, so they're invoked asmemory-pro reindex-ftsandmemory-pro repair-summaries, matching every other command in this file.createMemoryCLIagainst a minimal stub context on a fresh commanderCommandand inspects the actual registered command tree: the root program must expose exactly one command (memory-pro), and bothreindex-ftsandrepair-summariesmust be reachable underneath it.Test plan
test/cli-subcommand-attachment.test.mjs, three tests, all failed before the fix (root program had four commands instead of one; neitherreindex-ftsnorrepair-summariesappeared in the group's subcommand list) and passed after.npm run build(tsc) clean.npm testchain green (one test skipped: a known host-side port 11434 conflict unrelated to this change).test/cli-subcommand-attachment.test.mjsregistered in bothpackage.json'stestscript andscripts/ci-test-manifest.mjs; manifest verification passes.Notes for reviewers
No user-facing invocation path changes for anyone currently on
master, since neither command was reachable before this fix either way. This just makes two already-shipped features usable for the first time.