Skip to content

refactor(memory-wiki): inline gateway source sync - #134992

Merged
vincentkoc merged 1 commit into
mainfrom
refactor/memory-wiki-gateway-sync
Sep 1, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
refactor/memory-wiki-gateway-sync

Conversation

@vincentkoc

Copy link
Copy Markdown
Member

What Problem This Solves

The Memory Wiki gateway carried a local positional wrapper around the canonical source-sync object API. That wrapper owned no policy, lifecycle, ordering, or error behavior, and duplicated an already-direct call pattern in the same module.

Why This Change Was Made

Delete syncImportedSourcesIfNeeded and have its seven gateway call sites invoke syncMemoryWikiImportedSources directly. Each call preserves the same config, appConfig, conditional signal property, await ordering, and surrounding try/catch boundary.

The architectural owner remains extensions/memory-wiki/src/source-sync.ts; tool-side wrappers and all config, storage, SDK, docs, and test surfaces remain unchanged.

User Impact

No user-visible behavior change. The gateway now has one fewer adapter and one canonical source-sync call shape.

Evidence

  • Focused gateway/source-sync/lifecycle tests: 3 files, 67 tests passed.
  • pnpm test:extension memory-wiki: 42 files, 489 tests passed.
  • node scripts/check-changed.mjs -- extensions/memory-wiki/src/gateway.ts: all selected checks passed except the dead-export scan initially lacked tracked ui/config files omitted by the shared worktree sparse profile.
  • After materializing those tracked sparse files, node --import tsx scripts/check-deadcode-exports.mts: production, full-tree, and script scans passed with 0 entries.
  • pnpm check:import-cycles: 0 runtime value cycles.
  • pnpm build: passed.
  • git diff --check: passed.
  • Exact Codex Sol/high autoreview: scoped clean, no accepted/actionable findings.
  • No bespoke Crabbox/live proof: this is a byte-equivalent private refactor. Native PR Testbox remains required before merge.

Production LOC: +7/-19, net -12.
Test LOC: 0.

Overlap checked on September 1, 2026:

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

@vincentkoc vincentkoc self-assigned this Sep 1, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review September 1, 2026 08:04
@openclaw-barnacle openclaw-barnacle Bot added size: XS maintainer Maintainer-authored PR labels Sep 1, 2026
@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, 4:54 AM ET / 08:54 UTC.

ClawSweeper review

What this changes

The PR deletes a private Memory Wiki gateway wrapper and calls the canonical imported-source sync directly from its seven synchronous gateway operations.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

No blocking correctness or security finding: the seven gateway handlers preserve the same awaited source-sync call, inputs, signal behavior, and error boundary. This member-authored, maintainer-labeled PR should remain open for normal maintainer handling.

Priority: P3
Reviewed head: a08cc1bacaff8d1ce70d51f8a5b3418f0ea8ba67

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, net-negative refactor with direct source equivalence and relevant existing contract coverage.
Proof confidence 🌊 off-meta tidepool Not applicable: This member-authored private refactor is outside the external-contributor real-behavior-proof gate; direct source comparison establishes the retained behavior.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This member-authored private refactor is outside the external-contributor real-behavior-proof gate; direct source comparison establishes the retained behavior.
Evidence reviewed 6 items Verified introduced change: The head has one raw recorded parent, and its complete introduced diff removes only the private wrapper and substitutes the identical awaited object call at seven gateway sites.
Source-sync owner and invariant: The canonical owner selects the source mode, refreshes indexes, and coalesces equivalent per-vault flights; the PR does not modify this owner.
Lifecycle caller: Plugin activation registers the gateway methods with the lifecycle-owned source-sync abort signal, which remains unchanged by the refactor.
Findings None None.
Security None None.

How this fits together

Gateway requests enter the Memory Wiki plugin, resolve the active configuration and lifecycle signal, synchronize imported sources, then read or update the wiki vault. The source-sync owner serializes vault writes and refreshes derived indexes before the gateway returns its result.

flowchart LR
  A[Gateway request] --> B[Memory Wiki gateway]
  B --> C[Resolve config and signal]
  C --> D[Imported source sync]
  D --> E[Wiki read or mutation]
  E --> F[Gateway response]
Loading

Before merge

  • Complete next step (P2) - No actionable repair is needed; the remaining action is ordinary maintainer review of a correct cleanup PR.
Agent review details

Security

None.

PR surface

Source -12. Total -12 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 1 7 19 -12
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 1 7 19 -12

Review metrics

Metric Value Why it matters
Production versus test delta production −12, tests 0 The change removes a one-use private adapter without adding production behavior or test-support surface.

Stored data model

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

Technical review

Best possible solution:

Merge the deletion-only refactor if normal maintainer review accepts it, leaving source synchronization owned solely by the canonical source-sync module.

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

Not applicable: this PR intentionally preserves existing behavior, and source comparison establishes the same sync arguments, await ordering, and exception propagation.

Is this the best way to solve the issue?

Yes. Removing the private adapter is the cleanest path because the same canonical object call is already used by the gateway’s explicit import operations and Memory Wiki CLI paths.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This is a small, behavior-preserving internal cleanup with no user-visible change.
  • 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 member-authored private refactor is outside the external-contributor real-behavior-proof gate; direct source comparison establishes the retained behavior.

Label justifications:

  • P3: This is a small, behavior-preserving internal cleanup with no user-visible change.
  • 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 member-authored private refactor is outside the external-contributor real-behavior-proof gate; direct source comparison establishes the retained behavior.

Evidence

What I checked:

  • Verified introduced change: The head has one raw recorded parent, and its complete introduced diff removes only the private wrapper and substitutes the identical awaited object call at seven gateway sites. (extensions/memory-wiki/src/gateway.ts:180, a08cc1bacaff)
  • Source-sync owner and invariant: The canonical owner selects the source mode, refreshes indexes, and coalesces equivalent per-vault flights; the PR does not modify this owner. (extensions/memory-wiki/src/source-sync.ts:85, a08cc1bacaff)
  • Lifecycle caller: Plugin activation registers the gateway methods with the lifecycle-owned source-sync abort signal, which remains unchanged by the refactor. (extensions/memory-wiki/index.ts:182, a08cc1bacaff)
  • Existing contract coverage: Gateway tests cover status forwarding, optional signal forwarding, agent-config resolution, and validate-before-sync ordering; source-sync tests cover mode routing, coalescing, serialization, and retry cleanup. (extensions/memory-wiki/src/gateway.test.ts:315, a08cc1bacaff)
  • Current-main context: The readable fetched-main gateway blob still contains the removed helper, so the cleanup is not already represented on current main. A complete endpoint diff could not be generated because this partial clone required unavailable promisor blobs and DNS was unavailable. (extensions/memory-wiki/src/gateway.ts:102, 2f91bbe52916)
  • History routing: Recent merged Memory Wiki work modified both the gateway and source-sync owner; older raw parent blobs are unavailable locally, so this supports routing but not line-introduction attribution. (extensions/memory-wiki/src/gateway.ts:180, 0e2e6c3f5622)

Likely related people:

  • Ayaan Zaidi: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • wanyongstar: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: 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.

@vincentkoc
vincentkoc merged commit 64e2753 into main Sep 1, 2026
170 checks passed
@vincentkoc
vincentkoc deleted the refactor/memory-wiki-gateway-sync branch September 1, 2026 09:27
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 2, 2026
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: XS 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