Skip to content

feat(memory-wiki): allow owner-scoped bridge reads in shared vaults - #189336

Merged
roboclaw-bot merged 1 commit into
mainfrom
loop/contributor-pr-129191
Oct 31, 2026
Merged

roboclaw-bot merged 1 commit into
mainfrom
loop/contributor-pr-129191

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Collaborator

Supersedes #129191, thanks @igs-rogenlo.

What Problem This Solves

Agents sharing a global wiki cannot restrict imported bridge notes to their owners without also separating the native wiki into per-agent vaults.

User Impact

Operators can opt into plugins.entries.memory-wiki.config.bridge.ownership: "owner" so non-sandboxed agents retrieve their own bridge notes while native wiki pages stay shared. The omitted setting and explicit "sandboxed-only" preserve today's behavior; sandboxed reads never widen.

Owner mode hides bridge pages without matching ownership, including unowned pages and calls without a resolved identity. CLI calls resolve the default agent unless --agent is supplied. This filters wiki query results, not filesystem access or compiled prompt digests; native aggregate pages remain shared. Existing configurations need no migration or action.

Why This Change Was Made

Reuse the existing plugin-owned visibility filter and validate one optional enum in its runtime and manifest schemas. Delegation and public SDK additions from the original proposal are outside this minimal replacement. Main's vault.scope: "agent" separates the entire vault and does not cover this shared-native-pages scenario.

The simplification removes the one-use bridge-page predicate in the same visibility owner. Production TypeScript is −3 lines; manifest schema/help is +8 lines, for +5 production/config lines overall. Tests are +43 lines, allocated in a dedicated test-line record for the tool-level regression and independent schema boundary. Generated config artifacts add exactly one plugin leaf (4911 → 4912); core/channel counts are unchanged.

Evidence

  • Red before repair on main 447e14d02460: owner-mode wiki_search returned another agent's bridge page; runtime schema rejected both new enum values. The original two-file run had 3 expected failures and 40 passes (50.60 seconds wall time).
  • Green after repair: pnpm test extensions/memory-wiki/src/query.test.ts extensions/memory-wiki/src/config.test.ts extensions/memory-wiki/src/query.reads.test.ts extensions/memory-wiki/src/query.path-lookup.test.ts extensions/memory-wiki/src/query.abort.test.ts extensions/memory-wiki/src/query-reader.test.ts --maxWorkers=1 — 64 passed, 6 files, 46.77 seconds wall time including cold worker preparation; test execution about 2 seconds. PR CI succeeded at the same head: run 41198930094, all 32 executed jobs passed; the changed-test job took 273 seconds including setup.
  • The regression executes the real wiki_search and wiki_get tools on a synthetic temporary vault, checking omitted/legacy/owner settings, sandboxed and non-sandboxed calls, shared native pages, unowned bridge pages, unresolved identity, and CLI-style default identity. Existing memory-provider seams remain mocked; no live Gateway/model or stable-upgrade run was performed on the production host.
  • Targeted type-aware oxlint, oxfmt, config:docs:check, plugins:inventory:check, staged test-line ratchet, and git diff --check passed. Broad compiler/test proof is delegated to PR CI.
  • Independent local autoreview of the complete candidate against 447e14d02460, including query/config/tool context: scoped-clean at P0–P2, no actionable findings. Local ClawSweeper is unavailable. The requested hosted review completed with no code findings and asks for broader trusted-runtime and fresh/stable-install evidence. Review addressed by the maintainer ruling: the one optional field preserves defaults and sandbox restrictions; focused red→green proof and exact-head green CI are sufficient. Broader runtime/upgrade runs are not required for this change and were not performed. Applicable security review and openclaw/ci-gate have passed.
  • Contributor code was read with gh pr view/gh pr diff only and was never checked out or executed. Human credit from both commit-author identities is retained; agent co-authors are excluded.

Upgrade note: existing configs without bridge.ownership validate unchanged and retain current sandbox-inferred visibility; the runtime and manifest schema test covers the omitted field, and the tool regression covers unchanged default visibility.

Keep the sandbox-inferred default. Opt-in owner mode reuses the existing
wiki page visibility policy for every caller, including non-sandboxed agents.

Co-authored-by: igs-rogenlo <[email protected]>
Co-authored-by: ACD_RD4駱俊馳 <[email protected]>
@clawsweeper

clawsweeper Bot commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@roboclaw-bot
roboclaw-bot marked this pull request as ready for review October 31, 2026 11:56
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

@clawsweeper review

Minimal credited replacement for #129191. Local autoreview is scoped-clean at P0–P2; the focused 64-test owner/reader suite and targeted checks passed. Please review unchanged defaults, opt-in owner filtering, schema validation, and sandbox visibility.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation extensions: memory-wiki size: S labels Oct 31, 2026
@clawsweeper

clawsweeper Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Oct 31, 2026
@clawsweeper

clawsweeper Bot commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

What this changes

Adds an optional bridge ownership setting that scopes imported-page retrieval while keeping native wiki pages shared.

Example: Agent main searches a global vault containing bridge notes owned by main and secondary.

  • Before: A non-sandboxed main agent can retrieve both agents' bridge notes.
  • After: With bridge.ownership set to owner, main retrieves its own bridge notes and shared native pages, while secondary and unowned bridge notes are hidden.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A focused, useful implementation with meaningful regression coverage and no discrete code finding; trusted identity propagation remains unproven.
Proof confidence 🦐 gold shrimp (3/6) Real behavior proof is necessary before merge. See Before merge.
Patch quality 🦐 gold shrimp (3/6) Security review found an item that needs attention.

Product

Kind: Feature · Worth it: Yes · Fix scope: Complete
User problem: Operators cannot keep native wiki knowledge shared while limiting ordinary agents' retrieval of imported bridge notes to their owners.
Reason: The maintainer-authored direction addresses a use case that per-agent vaults cannot provide, with a narrow implementation and explicit aggregate/digest limitations.

Merge readiness

⛔ Blocked before merge - 3 items remain

Keep open: this maintainer-authored PR addresses a distinct shared-vault use case, and source review found no introduced correctness defect.

Priority: P3
Reviewed head: 34ac5c06226d9239b9a8ddacbe3703df3bd0e176

Before merge

  • Add real behavior proof - Authority-chain proof required: the reported real-tool regression checks final results on a temporary vault, but caller identities are injected and session/default resolvers are mocked; provide a trusted-runtime invocation showing own-page access and foreign/unowned-page exclusion from final search/get responses, with sensitive values redacted. After adding proof, update the PR body, then request a new review with @clawsweeper re-review. The PR author or someone with repository write access can request it.
  • Resolve security review attention item - No concrete disclosure regression was found, and the existing sandbox predicate remains intact.
  • Resolve merge risk - The PR owner must establish that owner-mode results use the trusted calling agent throughout the production invocation, including exclusion of another agent's bridge content from the final response.

Findings

None.

Tests

  • Missing end-to-end proof: Supply trusted-runtime search/get evidence for allowed and foreign identities, plus fresh-install and latest-stable upgrade coverage with existing configuration and vault contents preserved.
Agent review details

How this fits together

Memory Wiki receives trusted caller context and operator configuration, resolves page visibility, and applies that scope to direct reads and worker searches before returning wiki results.

flowchart TD
  A[Operator configuration] --> C[Wiki query owner]
  B[CLI or agent tool context] --> C
  C --> D[Ownership visibility scope]
  D --> E[Direct reader or scan worker]
  F[Shared vault pages] --> E
  E --> G[Filtered search or get results]
Loading

Technical review

Best possible solution:

Keep the optional policy in the existing plugin visibility owner, preserving default behavior and the documented distinction between retrieval filtering and whole-vault isolation.

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

Current main visibly bypasses bridge ownership filtering for non-sandboxed callers; the supplied regression reports that behavior before the change, and no target code was executed during this review.

Is this the best way to solve the issue?

The implementation is the smallest complete owner-mode change: reuse the existing visibility policy, validate the optional enum at both configuration boundaries, and retain distinct schema and tool-result regressions.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 140e7af66277.

Merge-risk options

Maintainer options:

  1. Prove caller-bound retrieval (recommended)
    The PR owner should record a production-path invocation showing main receiving its own bridge page and shared native page while secondary-owned and unowned bridge pages are absent from the final search/get responses.

Provenance checked

  • Sandbox ownership policy keeps the original intent (cdab176: Prevent sandboxed callers from reading foreign or unowned bridge pages through shared-vault recall.)
  • Direct and worker page readers keeps the original intent (6a6ba1d: Keep short reads responsive while moving whole-vault scans to workers using the same visibility policy.)
  • Global versus per-agent vault ownership keeps the original intent (98b8c8c: Provide opt-in whole-vault separation while preserving the shared global default.)

Testing

Proof path: in-process harness.

Security

Needs attention: No concrete disclosure regression was found, and the existing sandbox predicate remains intact.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 98b8c8c adds extensions/memory-wiki/src/config.ts:314 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 98b8c8c4ae29; files: extensions/memory-wiki/src/config.ts)
  • Mitchell Etzel: Raw commit 6a6ba1d adds extensions/memory-wiki/src/query-pages.ts:140 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 6a6ba1da8dcb; files: extensions/memory-wiki/src/query-pages.ts)

PR surface

Source +5, Tests +43, Docs +19, Generated 0, Other +2. Total +69 across 10 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 4 16 11 +5
Tests 2 46 3 +43
Docs 1 19 0 +19
Config 0 0 0 0
Generated 2 3 3 0
Other 1 2 0 +2
Total 10 86 17 +69

Review metrics

Metric Value Why it matters
Configuration surface 1 optional enum with 2 values Adds an operator-facing retrieval policy while preserving the existing default.

Labels

Label changes:

  • add P3: This is an optional retrieval-policy feature with unchanged defaults and no established current regression.
  • add merge-risk: 🚨 security-boundary: The change extends identity-based content filtering to ordinary callers, so trusted identity propagation and foreign-content exclusion need production-boundary evidence.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Label justifications:

  • P3: This is an optional retrieval-policy feature with unchanged defaults and no established current regression.
  • merge-risk: 🚨 security-boundary: The change extends identity-based content filtering to ordinary callers, so trusted identity propagation and foreign-content exclusion need production-boundary evidence.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Prove the trusted main caller receives its own content while secondary-owned and unowned bridge content is excluded from final tool responses.

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.

Reviewed October 31, 2026, 8:01 AM ET / 12:01 UTC.

@roboclaw-bot
roboclaw-bot merged commit d9fbd28 into main Oct 31, 2026
199 checks passed
@roboclaw-bot
roboclaw-bot deleted the loop/contributor-pr-129191 branch October 31, 2026 12:31
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 1, 2026
…penclaw#189336)

Keep the sandbox-inferred default. Opt-in owner mode reuses the existing
wiki page visibility policy for every caller, including non-sandboxed agents.

Co-authored-by: igs-rogenlo <[email protected]>
Co-authored-by: ACD_RD4駱俊馳 <[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 merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant