Skip to content

refactor(memory-wiki): share tool registration and result adapters - #135066

Merged
steipete merged 1 commit into
mainfrom
codex/qa50-memory-wiki-results
Sep 1, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/qa50-memory-wiki-results

Conversation

@steipete

@steipete steipete commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Memory Wiki's tool adapter repeated two pairs of factory registrations and seven plain-text result envelopes. The registration pairs now share their existing context projection, and the tools use the lightweight SDK textResult helper. The five named tools still register synchronously in the same order; status retains its distinct callback.

The factories resolve the current app configuration and service signal on every invocation. Agent/session/sandbox/recall context, context-free multi-agent omission, unknown-agent errors, stop/restart fencing, and independent tool objects remain unchanged. Result text, detail references, own-property order, undefined values, spread precedence, lint report projection, and error rejection behavior are preserved. Invalid wiki_get input still returns before filesystem work, while a successful empty read remains found: true.

This removes 39 production lines (+49/−88), all nonblank/noncomment adapter code across the two owners. It adds no helper, type, public API, configuration, dependency, schema, or storage behavior. Tests and generated files are unchanged. The newly imported SDK helper and registration contracts exist at the plugin's stable peer floor, v2026.8.1, as verified from the immutable local tag.

Validation covers 83 maintained tests across seven files and all 24 selected changed-file checks, including production/test types, lint, all three unused-export scans, doctor contracts, plugin boundaries, and zero runtime import cycles. Fresh managed P2 review is clean. A temporary integration harness invokes the actual plugin registration, all five factories, and real isolated vault operations before and after the patch: 64 tool invocations and 88 capture records match across 2,220,243 normalized bytes, including 1,074 own-undefined nodes and four shared-reference nodes. Only three temporary vault path prefixes are normalized; error stacks are retained separately, while names/messages/descriptors remain compared.

The integration proof uses a synthetic host API/KV/blob store and external memory/session seams with real filesystem, query, lint, mutation, compile, and lifecycle code. It does not claim a live Gateway, model/provider, operator store, or remote memory-engine run. One initial baseline attempt hit the unchanged silence watchdog before tests; another exposed an incorrect fixture assumption about search-only recall context. Both are preserved, and the corrected baseline/candidate captures pass without changing production policy or increasing timeouts. Whether recall should also restrict ordinary explicit reads is a separate product-contract question, not a fixed bug in this refactor. No release changelog entry is required for this internal simplification.

The latest 09:51 UTC ClawSweeper review is code-clean with no before-merge finding or rank-up list. The automatic storage/vector classification is false: only registration and result envelopes change; no database, schema, embedding, migration or persisted data code changes. Exact-head CI 33493810666 is green; maintainer review accepts the refactor.

@clawsweeper

clawsweeper Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@steipete
steipete marked this pull request as ready for review September 1, 2026 09:44
@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 1, 2026
@clawsweeper

clawsweeper Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 1, 2026, 5:51 AM ET / 09:51 UTC.

ClawSweeper review

What this changes

The PR deduplicates Memory Wiki tool registration callbacks and replaces repeated plain-text result envelopes with the existing Plugin SDK helper.

Merge readiness

✅ Ready for maintainer review

Keep this fresh, maintainer-authored PR open. Current main still has the duplicated registrations and result envelopes, while the introduced refactor preserves their context and output contracts; no actionable defect was found.

Priority: P3
Reviewed head: 9263c595cc741ad375e76fef5513f572dd7d31b2

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A bounded, source-equivalent cleanup using an established SDK contract, with no blocking correctness or security concern identified.
Proof confidence 🌊 off-meta tidepool Not applicable: This is a maintainer-authored, behavior-neutral adapter refactor; the supplied synthetic-host equivalence harness is useful supplemental evidence but is not an external-contributor proof gate.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This is a maintainer-authored, behavior-neutral adapter refactor; the supplied synthetic-host equivalence harness is useful supplemental evidence but is not an external-contributor proof gate.
Evidence reviewed 6 items Introduced registration refactor: The two typed registration loops retain the previous lint→apply→search→get order and preserve the distinct context projection for each factory.
Result-helper contract: The SDK helper returns the exact prior object shape and property order: a single text content entry followed by the supplied details reference.
Stable SDK availability: The plugin SDK facade and helper are present in the v2026.8.1 source, so this imports an established public SDK subpath rather than adding a dependency or API.
Findings None None.
Security None None.

How this fits together

Memory Wiki is a bundled plugin that registers tools for agents to query and maintain a local knowledge vault. The plugin maps agent context into tool factories, which perform vault operations and return model text plus structured details.

flowchart LR
  A[Agent tool request] --> B[Memory Wiki plugin]
  B --> C[Resolve agent context]
  C --> D[Wiki tool factory]
  D --> E[Vault query or mutation]
  E --> F[Text and structured result]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source -39. Total -39 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 2 49 88 -39
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 2 49 88 -39

Review metrics

Metric Value Why it matters
Production versus test delta production −39, tests 0 The two changed files are production adapters; the cleanup removes duplicated code without changing test surfaces.

Stored data model

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

Technical review

Best possible solution:

Merge the compact refactor once the exact-head required checks complete, retaining the existing SDK result helper and current context-projection tests.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this PR refactors existing adapter code rather than fixing a reported failing behavior.

Is this the best way to solve the issue?

Yes. Reusing the established SDK helper removes duplicated envelopes while the typed loops preserve the two pre-existing tool-context shapes.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against a0866b51da27.

Labels

Label changes:

  • add P3: This is a small behavior-preserving plugin cleanup with no reported user-facing regression.
  • 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 is a maintainer-authored, behavior-neutral adapter refactor; the supplied synthetic-host equivalence harness is useful supplemental evidence but is not an external-contributor proof gate.

Label justifications:

  • P3: This is a small behavior-preserving plugin cleanup with no reported user-facing regression.
  • 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 is a maintainer-authored, behavior-neutral adapter refactor; the supplied synthetic-host equivalence harness is useful supplemental evidence but is not an external-contributor proof gate.

Evidence

What I checked:

Likely related people:

  • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Dallin Romney: Raw commit bfffa95 adds src/agents/tools/tool-results.ts:3 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: bfffa950d71c; files: src/agents/tools/tool-results.ts)

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 a2ff017 into main Sep 1, 2026
177 checks passed
@steipete
steipete deleted the codex/qa50-memory-wiki-results branch September 1, 2026 10:22
@steipete

steipete commented Sep 1, 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