Repository navigation
refactor(memory-wiki): share CLI and tool result presentation - #139913
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed September 6, 2026, 4:02 AM ET / 08:02 UTC. ClawSweeper reviewWhat this changesThe Memory Wiki plugin shares search-result and mutation-summary formatting between its CLI and agent tools while preserving text, JSON, and tool details. Merge readiness⛔ Blocked before merge - 1 item remains This remains a useful, focused refactor: current main still duplicates the presentation logic, and the introduced changes preserve output behavior. No actionable correctness or security findings were identified. Priority: P3 Review scores
Verification
How this fits togetherMemory Wiki turns stored knowledge into searchable wiki pages. Its CLI and agent tools pass completed search and mutation results through presentation code before returning them to operators and agents. flowchart LR
A[Wiki CLI] --> C[Search and mutation owners]
B[Agent tools] --> C
C --> D[Prepared results]
D --> E[Shared text presentation]
D --> F[CLI JSON and tool details]
E --> G[Operator and agent output]
F --> G
Before merge
Agent review detailsSecurityNone. PR surfaceSource -16. Total -16 across 3 files. View PR surface stats
Review metricsNone. Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Keep one plugin-local presentation owner while preserving the established CLI serialization and tool-result contracts. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR addresses duplicated formatting rather than a reported runtime defect; source inspection confirms the duplication and equivalent replacement. Is this the best way to solve the issue? Yes. A small plugin-local module removes the duplication without expanding the public SDK or changing producer and caller contracts. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 379f0533efb9. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
What Problem This Solves
Wiki CLI and tool responses independently format the same search metadata and mutation summaries. Keeping separate copies of provenance, claim, evidence and index-update wording makes those user-facing outputs prone to drift.
Why This Change Was Made
Put both text renderers in one pure plugin-local presentation module, with types derived from their existing producers. The CLI retains its existing JSON selection and final-newline writer; tools retain their existing text/result envelopes. Remove the old duplicate formatters and two generic file-header comments. No query, mutation, synchronization, storage or visibility behavior changes.
User Impact
Search text, result ordering, optional metadata, mutation summaries, CLI JSON and tool details remain unchanged. The three-file diff removes 16 production lines without adding tests, dependencies or public SDK exports.
Evidence
The same 90 existing CLI, tool and query tests passed before and after. Separately, 400 exact presentation comparisons over ordinary prepared results checked text, JSON, newlines and envelopes using the frozen original and extracted presentation blocks; these are pure comparisons, not 400 full product runs.
All 24 selected changed-check phases passed, including type checks, formatting, lint, package boundaries, dead exports and runtime import-cycle checks. Independent managed review covered all three files and found no actionable issue. Fresh exact-head CI remains required before landing. No live operator vault or full product build was used.
Data-model compatibility proof
cli.ts,tool.tsand the new purepresentation.ts; the query, mutation, configuration, source-sync, compile and mutation-coordinator modules are byte-identical to the base.The new module imports its producer functions only as types. Its inputs are their unchanged return types, and its functions only return text. Existing CLI
formatJsonOrTextandwriteOutputimplementations are byte-identical; JSON still serializes the original result with two-space indentation, and tools retain the original details objects. The same 90 fixture CLI/tool/query tests passed before and after, with 400 additional exact presentation/JSON/newline/envelope comparisons. No data rewrite or migration is required for this presentation extraction.This addresses the review's compatibility item with source and serialized-output preservation proof. Its file-level stored-data classification does not identify an introduced stored-data change. Exact-head CI 34020430912 passed all 29 selected jobs (17 skipped). No live operator vault or simulated upgrade is claimed.