Skip to content

fix(memory-wiki): make metadata list replacement explicit - #190641

Merged
vincentkoc merged 2 commits into
openclaw:mainfrom
ericcaiwx-star:codex/fix-wiki-metadata-replacements-190606
Nov 12, 2026
Merged

vincentkoc merged 2 commits into
openclaw:mainfrom
ericcaiwx-star:codex/fix-wiki-metadata-replacements-190606

Conversation

@ericcaiwx-star

@ericcaiwx-star ericcaiwx-star commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Closes #190606.

What Problem This Solves

Updating wiki metadata with a partial list silently replaces the stored list, while the tool contract and successful result do not explain the loss.

User Impact

Agents and operators can see that supplied metadata lists replace existing values and can identify reductions after an update. Existing replacement and clearing semantics are preserved.

Why This Change Was Made

The existing locked metadata mutation owner records before/after list counts from the read page and accepted replacement frontmatter. The successful result carries those facts to the shared tool/CLI summary. Existing array properties and the plugin/CLI guides explain complete replacement, omission, and explicit clearing.

Evidence

November 9 conflict refresh

Current head: 99d22dce149e369d3893c6608f885716e1bfb588, rebased onto f615e96b55becb3944b57de4e8af74a801814fab. The only manual conflict was in the CLI guide: both the complete-list replacement explanation and upstream's untouched-YAML formatting explanation are retained. Range-diff confirms the production patch is unchanged by this refresh.

Fresh validation at this candidate:

  • Wiki tool, mutation owner, YAML rendering, and CLI regressions: 4 files / 80 tests passed.
  • Provider-prefix stability: 14 tests passed.
  • Targeted plugin lint, changed TypeScript formatting, both docs' formatting/MDX, scoped wiki production and test types, and git diff --check passed.
  • Official test-line ratchet passed: 6,600,518 lines == 6,600,518 ceiling, slack 0. The original exact 77-line test allocation was preserved.

The full local extension production type check failed because this older checkout's dependency installation lacks @solidjs/web and solid-js required by unrelated browser plugins. The scoped wiki type checks passed using the official compiler options and declaration inputs; the full local failure is not called green, and its full production/test type coverage is now supplied by the successful current-head hosted CI. No dependency, lockfile, baseline, or unrelated product change was made to hide it.

The authorized current-head canonical Codex P0–P2 review completed clean, with no findings and patch correct (confidence 0.91); its exact diff passed the TruffleHog scan. Current-head CI completed success: 24 successful jobs / 30 applicable skips, including production and test type checks and the baseline ratchets. This supplies clean-install CI coverage for the locally missing unrelated dependencies. The scoped CodeQL Critical Quality workflow succeeded with no applicable analysis shard; no full CodeQL analysis is claimed. The current-head ClawSweeper review, reviewed at 22:57:02 UTC on November 9, confirms complete fix scope, proof sufficient, readiness/proof/patch quality 5/6, and Before merge: None / Findings: None / Security: None. It verified that the production patch is unchanged by the mechanical rebase and accepted the named historical shipped-entry evidence with fresh current-head consumer, prefix and CI checks. Author-side work is complete; maintainer review remains. No new built CLI/Gateway/provider-turn proof was run in this mechanical refresh; the shipped-entry proof below is historical evidence at its named old head.

Historical implementation and validation

The implementation and shipped-entry proof below were published and executed at 5ea8f5f88871d07fbdbab8fb76c507a7c12f4b93; those prior-head review and CI results do not certify the rebased head.

Historical completed checks at 5ea8f5f88871d07fbdbab8fb76c507a7c12f4b93:

  • Focused real tool/owner tests: 2 files, 10 tests passed. The new populated-page regression failed against unchanged production code before the repair.
  • Production and test extension type checks passed using the repository compiler wrappers.
  • Plugin oxlint, changed TypeScript formatting, docs formatting/MDX, test-line ratchet, and diff whitespace checks passed.
  • Independent local P0–P2 review: scoped-clean, no accepted/actionable findings. Final monitor-bound clean exact-head review also passed with no P0–P2 findings.

Historical exact-head validation at 5ea8f5f88871d07fbdbab8fb76c507a7c12f4b93:

  • Full memory-wiki suite: 50 files, 392 tests passed, 1 skipped.
  • Runtime build passed; provider-prefix stability: 14 tests passed.
  • Formal ocpr prove post-fix run passed (exit 0) through built CLI initialization, authenticated Gateway /tools/invoke, and built CLI metadata JSON/text. Independently parsed stored frontmatter confirms replacement and clearing; omitted/scalar fields, invalid-confidence refusal without changing the page, human notes, synthesis, and joined Gateway shutdown passed.
Gateway: claims 17 -> 1; questions/contradictions/sourceIds 3 -> 1
text: Replaced metadata lists: sourceIds 3 -> 1, claims 17 -> 1, contradictions 3 -> 1, questions 3 -> 1.
Explicit clear: claims 2 -> 0; other supplied lists 3 -> 0
CLI JSON: sourceIds {before: 3, after: 1}; text: questions 3 -> 1
POST_FIX_ALL_BOUNDARIES_PASS; Gateway exit=0

Built embedded-agent protocol proof also passed: a local synthetic OpenAI-compatible SSE provider received the four complete-list/clear descriptions, returned an actual wiki_apply call, and received Replaced metadata lists: claims 17 -> 1. in the next request. Tools stayed unchanged across both requests, the replacement persisted, human notes survived, and agent exit was 0. This is shipped agent/tool/provider-wire acceptance with a synthetic provider, not external model quality or real-service acceptance. Its first fixture assertion omitted the normalizer's existing empty evidence array; correcting that expected storage contract produced the pass without product edits.

At historical head 5ea8f5f88871d07fbdbab8fb76c507a7c12f4b93, final canonical clean P0–P2 review passed and hosted CI completed successfully, and openclaw/ci-gate reports: “CI and applicable security review requirements passed.” Security/dependency review, OpenGrep, docs and all selected CI checks passed. The CodeQL Critical Quality workflow completed successfully after scope selection; its analysis shards were skipped. The separate CodeQL workflow was not triggered because its upstream path filter excludes all touched files. No full CodeQL analysis is claimed. The historical-head ClawSweeper review confirms proof sufficient (terminal), complete fix scope, 5/6 readiness/proof/patch quality, and no Before merge items or findings. Maintainer review remains. Initial setup refusals/invalidated runs are retained privately and do not count as passes.

Formal named-base proof executed through ocpr prove at 0e70bc443ec9a5e2921446e902a720a9e18cc52e. A private driver started the built CLI and Gateway, invoked wiki_apply through authenticated loopback HTTP, and independently read the persisted frontmatter:

populated replacement: HTTP 200; stored claims 17 -> 1; metadataListChanges absent
text: Updated entities/populated.md via update_metadata. Refreshed 5 index files.
explicit empty lists: HTTP 200; metadataListChanges absent
PRODUCT_ASSERTION_FAILURES: missing before/after counts, visible replacement text, clear counts
exit=1; owned Gateway shutdown exit=0

The same run verified omitted lists, scalar updates, human-note preservation, synthesis, and invalid confidence refusal with unchanged stored bytes. Fixtures use isolated synthetic vaults and loopback token authentication. This exercises real built CLI initialization and HTTP tool execution, not a model/provider turn.

The first fixture incorrectly expected HTTP 400 for invalid confidence. Existing Gateway behavior is HTTP 500 tool_error with the expected confidence rejection in its log; the corrected run asserts that contract and unchanged page bytes. The original evidence is retained privately; no unrelated HTTP-status change is proposed.

@clawsweeper

clawsweeper Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 1, 2026
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation extensions: memory-wiki size: S and removed size: XS labels Nov 1, 2026
@ericcaiwx-star
ericcaiwx-star marked this pull request as ready for review November 1, 2026 20:21
@ericcaiwx-star

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 1, 2026
@clawsweeper

clawsweeper Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR explains complete-list replacement and reports before/after metadata counts in wiki mutation results.

Example: Update a page containing 17 claims with one supplied claim.

  • Before: The stored list becomes one claim, with no replacement information in the result.
  • After: The schema explains replacement and the result reports “Replaced metadata lists: claims 17 -> 1.”

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A focused, useful repair with shipped-entry evidence, current-head CI, preserved storage semantics, and no actionable findings.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): Supplied historical built CLI and authenticated Gateway traces exercise replacement, clearing, omission, persisted frontmatter, and visible counts; an embedded-agent provider-wire run also verifies schema descriptions and returned counts. GitHub source inspection confirms the production patch is unchanged after the mechanical refresh, with fresh current-head consumer and prefix checks reported.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Agents and operators can unintentionally replace an entire metadata list without being told the operation's semantics or resulting reduction.
Reason: The patch satisfies the reporter's disclosure alternative, preserves established defaults, and adds no configuration or merge policy.

Merge readiness

✅ Ready for maintainer review

Keep open: this PR fixes a current disclosure gap without changing replacement semantics, and no actionable defects remain.

Priority: P1
Reviewed head: 99d22dce149e369d3893c6608f885716e1bfb588

Before merge

None.

Findings

None.

Agent review details

How this fits together

The memory-wiki plugin accepts tool, Gateway, and CLI mutations, updates Markdown through its locked vault owner, and returns structured results and shared human-readable summaries.

flowchart TD
  A[Agent tool] --> D[Locked mutation owner]
  B[Gateway method] --> D
  C[Wiki CLI] --> D
  D --> E[Markdown vault and indexes]
  D --> F[Structured mutation result]
  F --> G[Shared text summary]
Loading

Technical review

Best possible solution:

Land the focused disclosure repair through the existing mutation and presentation owners while preserving replacement and clearing semantics.

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

Current-main source establishes that one supplied claim replaces 17 stored claims without count disclosure; the supplied named-base Gateway trace demonstrates that failure, and no target code was executed during this review.

Is this the best way to solve the issue?

This is the smallest complete disclosure fix: describe the existing contract before invocation, derive replacement facts inside the locked owner, and expose them through existing results and summaries.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 3fa0f3a75c69.

Provenance checked

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Vincent Koc: Raw commit 5716d83 adds extensions/memory-wiki/src/apply.ts:209 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 5716d83336fd; files: extensions/memory-wiki/src/apply.ts)

PR surface

Source +46, Tests +77, Docs +15, Other +2. Total +140 across 7 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 3 59 13 +46
Tests 1 77 0 +77
Docs 2 15 0 +15
Config 0 0 0 0
Generated 0 0 0 0
Other 1 2 0 +2
Total 7 153 13 +140

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #190606
Summary: This PR implements the disclosure alternative explicitly requested by the canonical open issue.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Labels

Label changes:

No label changes.

Label justifications:

  • P1: The linked official-release report documents repeated unintended claim removal caused by undisclosed replacement semantics.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-11-01T20:36:49.525Z sha 5ea8f5f88871d07fbdbab8fb76c507a7c12f4b93 :: needs maintainer review before merge. :: none

Reviewed November 9, 2026, 5:57 PM ET / 22:57 UTC (Revision 2).

@ericcaiwx-star
ericcaiwx-star force-pushed the codex/fix-wiki-metadata-replacements-190606 branch from 5ea8f5f to 99d22dc Compare November 9, 2026 22:42

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Current head: 99d22dce149e369d3893c6608f885716e1bfb588, rebased onto f615e96b55becb3944b57de4e8af74a801814fab. The CLI guide conflict now retains both the complete-list replacement contract and upstream's untouched-YAML formatting contract. Range-diff confirms the production patch is unchanged.

Fresh candidate validation: 80 tool/mutation/YAML/CLI tests, 14 provider-prefix tests, scoped production/test types, lint, formatting/MDX, and the exact 77-line test allocation all pass. Authorized canonical Codex P0–P2 review is clean, no findings. Full exact-head CI and ci-gate pass; its clean-install production/test type checks also cover the unrelated dependencies missing from the old local install.

The PR body is current and distinguishes these new-head results from the previously accepted built CLI/Gateway/provider-wire proof at 5ea8f5f88871d07fbdbab8fb76c507a7c12f4b93. No new shipped-entry run is claimed for this mechanical refresh. This is the first re-review request at the new head.

@clawsweeper

clawsweeper Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Nov 9, 2026
@clawsweeper clawsweeper Bot removed clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 9, 2026
@vincentkoc
vincentkoc merged commit 94d171d into openclaw:main Nov 12, 2026
190 checks passed
@vincentkoc

Copy link
Copy Markdown
Member

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 13, 2026
…90641)

* chore: claim wiki metadata replacement repair

* fix(memory-wiki): disclose metadata list replacements

Co-authored-by: Eric Cai <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation extensions: memory-wiki P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor 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.

[Bug]: wiki_apply update_metadata replaces the whole claims/questions/contradictions/sourceIds list (silent data loss)

2 participants