feat(v3.0): Phase 52 Simple CLI API#29
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add route_query() method to MemoryClient for orchestrated retrieval - Re-export RouteQueryResponse from memory-client lib - Create memory-cli crate with memory binary (6 subcommands) - Implement clap derive structs: Cli, GlobalArgs, Commands enum - Add 11 unit tests for CLI argument parsing - Create command stubs for search, context, add, timeline, summary, recall - Add placeholder output.rs (JsonEnvelope) and client.rs (connect_client) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add JsonEnvelope::ok, context_ok, error constructors with builder pattern - Implement TTY-aware print_output using std::io::IsTerminal - Add estimate_tokens heuristic (chars * 0.75 + 50) - Add should_force_json for global/command format detection - Finalize connect_client with actionable daemon-not-running error - Add 14 unit tests for output module (serialization, skip_none, meta, tokens) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add 52-01-SUMMARY.md with execution results - Update STATE.md: advance to plan 2 of 3, add decisions - Update ROADMAP.md and REQUIREMENTS.md progress Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Map CLI kind strings to EventType (episodic, tool_result, etc.) - Build Event with ULID-generated IDs and User role - Connect to daemon via gRPC and ingest event - Return event_id in JsonEnvelope with tokens_estimated - Exit non-zero with error envelope when daemon is down - Unit tests for kind_to_event_type and build_event helpers Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Map RouteQueryResponse results to JSON array with doc_id, score, source_layer - Build meta with retrieval_ms, tokens_estimated, confidence from response - Re-export RetrievalResult and ExplainabilityPayload from memory-client - Add 7 unit tests for map_retrieval_result, build_meta, layer_to_string Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Recall delegates to search with rerank=llm, top=10 - Context builds structured MemoryContext-shaped JSON with summary, relevant_events, key_entities - Fix timeline.rs import to use memory_client::ProtoEvent re-export (Rule 3) - Add 4 unit tests for recall args construction and context JSON shape Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Timeline: parse_range for "Nd"/"Nw" formats, get_events RPC, entity filtering - Summary: parse_summary_range for named ranges, get_toc_root + browse_toc RPCs - Map ProtoEvent fields to human-readable JSON (event_type, role strings) - TOC node overlap filtering for time-range-based summary navigation - Both commands include tokens_estimated in meta envelope - Add memory-service dependency for ProtoTocNode type access - Unit tests for parse_range, parse_summary_range, map_proto_event, node_overlaps Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add 52-02-SUMMARY.md with search/context/recall implementation details - Update STATE.md: advance to plan 3 of 3, add decisions - Update ROADMAP.md with plan progress - Mark CLI-02, CLI-03, CLI-06, CLI-08 requirements complete Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Remove #[allow(dead_code)] from output and client modules (now used) - Apply cargo fmt formatting fixes - Full pr-precheck passes (fmt + clippy + test + doc) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add 52-03-SUMMARY.md with task commits and deviation docs - Update STATE.md: phase 52 complete, decisions recorded - Update ROADMAP.md: phase 52 progress 3/3 - Mark CLI-04, CLI-07 requirements complete Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
Phase 52 of v3.0 Competitive Parity & Benchmarks — adds the
memorybinary, a dead-simple CLI that talks to the daemon over gRPC. All commands route through existing RPCs; no direct RocksDB access from the CLI.Commands
memory search <query>memory context <query>memory recall <query>search --rerank=llm(heavier, slower, higher quality)memory add <text>memory timelinememory summaryGlobal args:
--format,--endpoint, plus TTY-aware output (JSON when piped, human-friendly when interactive).Design decisions
memory-daemonRPCs; the CLI never opens RocksDB directly. Keeps the daemon as the single source of truth and works with remote stores.ok/error/context_okconstructors with TTY detection viaIsTerminal. Scripted callers get parseable JSON; humans get prose.crates/memory-cli/(binary namememory) added to the workspace alongsidememory-daemon. Each binary stays focused.recallis an explicit subcommand that maps tosearch --rerank=llm. Discoverable in--help.Files added
crates/memory-cli/— new binary crate (12 files, ~1500 LOC)cli.rs— clap derive Parser/Subcommandclient.rs— gRPC client helperoutput.rs—JsonEnvelopeand TTY detectioncommands/{add,context,recall,search,summary,timeline}.rs— one file per subcommand.planning/phases/52-simple-cli-api/— 3 plans + 3 summaries + context/research/validation/verificationTouched:
crates/memory-client/src/lib.rs(added a couple of helpers used by the CLI).Tests
task test): 54 test result blocks, 0 failurestask clippy): zero warnings on--workspace --all-targets --all-features -- -D warningstask doc): zero rustdoc warnings underRUSTDOCFLAGS=-D warningstask fmtpassesRebase notes (2026-05-12)
Rebased from
gsd/phase-52-simple-cli-api(local stack, 36 commits ahead of an old main) onto post-Phase-51origin/main. Usedgit rebase --ontoto drop the Phase 51 commits already absorbed via PR #28. The 15 commits in this PR are Phase 52's own work plus a final clean planning-doc update.Next in v3.0
Phase 53 (Benchmark Suite) is the remaining v3.0 work — stacked on this branch locally at
gsd/phase-53-benchmark-suite. PR #25 (cross-project federation, Phase 53.5) is also open.