Skip to content

refactor(memory-wiki): share CLI and tool result presentation - #139913

Merged
steipete merged 1 commit into
mainfrom
codex/refactor-wiki-result-presentation
Sep 6, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/refactor-wiki-result-presentation

Conversation

@steipete

@steipete steipete commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

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

  • Add data-model compatibility proof: No persisted data model, schema, migration, embedding metadata or write-path changes are introduced. The full diff is limited to cli.ts, tool.ts and the new pure presentation.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 formatJsonOrText and writeOutput implementations 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.

@clawsweeper

clawsweeper Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@steipete
steipete marked this pull request as ready for review September 6, 2026 07:55
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 6, 2026
@clawsweeper

clawsweeper Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 6, 2026, 4:02 AM ET / 08:02 UTC.

ClawSweeper review

What this changes

The 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
Reviewed head: efa4299ea3b803f759a6c247920e1b98f251f977

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, behavior-preserving extraction with useful reported validation and no identified blocking defect.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored presentation extraction is exempt from the external-contributor proof gate; reported tests and pure comparisons support output equivalence but do not establish a live wiki run.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored presentation extraction is exempt from the external-contributor proof gate; reported tests and pure comparisons support output equivalence but do not establish a live wiki run.
Evidence reviewed 7 items Verified introduced change: The merge-base-to-head diff extracts the existing formatting expressions and updates both callers; query inputs, mutation execution, result ordering, and tool envelopes remain unchanged.
CLI output contract: The existing JSON selector still uses two-space JSON serialization, and the unchanged output writer adds a final newline only when needed.
Current-main necessity: The CLI and tool files on fetched main are unchanged from the pinned merge base, so the duplicated renderers remain there. The shared presentation file is absent on fetched main and the supplied latest-release commit.
Findings None None.
Security None None.

How this fits together

Memory 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
Loading

Before merge

  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Source -16. Total -16 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 3 27 43 -16
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 27 43 -16

Review metrics

None.

Stored data model

Persistent data-model change detected: serialized state: extensions/memory-wiki/src/cli.ts, unknown-data-model-change: extensions/memory-wiki/src/cli.ts, unknown-data-model-change: extensions/memory-wiki/src/tool.ts, vector/embedding metadata: extensions/memory-wiki/src/cli.ts. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best 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.

Labels

Label changes:

  • add P3: This is a behavior-preserving presentation cleanup with no reported user-facing failure.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored presentation extraction is exempt from the external-contributor proof gate; reported tests and pure comparisons support output equivalence but do not establish a live wiki run.

Label justifications:

  • P3: This is a behavior-preserving presentation cleanup with no reported user-facing failure.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored presentation extraction is exempt from the external-contributor proof gate; reported tests and pure comparisons support output equivalence but do not establish a live wiki run.

Evidence

What I checked:

  • Verified introduced change: The merge-base-to-head diff extracts the existing formatting expressions and updates both callers; query inputs, mutation execution, result ordering, and tool envelopes remain unchanged. (extensions/memory-wiki/src/presentation.ts:1, efa4299ea3b8)
  • CLI output contract: The existing JSON selector still uses two-space JSON serialization, and the unchanged output writer adds a final newline only when needed. (extensions/memory-wiki/src/cli.ts:388, efa4299ea3b8)
  • Current-main necessity: The CLI and tool files on fetched main are unchanged from the pinned merge base, so the duplicated renderers remain there. The shared presentation file is absent on fetched main and the supplied latest-release commit. (extensions/memory-wiki/src/cli.ts, 379f0533efb9)
  • Latest-release inspection: The supplied v2026.9.2 release commit contains no presentation.ts entry; no shipped replacement for this extraction was established. (extensions/memory-wiki/src/presentation.ts, 3928bad9badf)
  • Documented presentation boundary: The CLI reference documents optional Claim and Evidence text plus richer JSON metadata. The extracted renderer retains those fields. Its producer imports are type-only and plugin-local; no dependency-specific Codex contract is involved. Public docs: docs/cli/wiki.md. (docs/cli/wiki.md, efa4299ea3b8)
  • Reported validation: The captured PR body reports 90 existing tests passing before and after, 400 pure presentation comparisons, and 24 changed-check phases. It explicitly disclaims a live operator-vault run and full product build. These claims were reviewed as supplemental evidence; no tests or repository scripts were executed during this review. (efa4299ea3b8)

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete merged commit 4a42c4e into main Sep 6, 2026
165 checks passed
@steipete
steipete deleted the codex/refactor-wiki-result-presentation branch September 6, 2026 08:13
@steipete

steipete commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: memory-wiki maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant