Skip to content

refactor(knowledge): remove redundant validation and array copies - #188556

Merged
steipete merged 2 commits into
mainfrom
dbasync/dslrecent
Oct 30, 2026
Merged

steipete merged 2 commits into
mainfrom
dbasync/dslrecent

Conversation

@steipete

@steipete steipete commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Knowledge currently walks valid store keys twice and makes an extra array copy before three explorer projections. Let the existing schema validator own key validation, and let filter/toSorted/toReversed provide the arrays they already allocate.

User Impact

No user-visible behavior change. The malformed-membership path still makes affected agents unavailable. Store-key syntax, membership/authority checks, sorting, rendering, pagination, and source-array ownership stay unchanged. No SQL, schema, SDK, or provider-request change.

Why This Change Was Made

The validated schema owns key syntax; the native array methods own the required copies. Keep those owners and delete the redundant work.

Evidence

Acceptance and counts

This is a four-site cleanup, using the final-small-batch exception; production +4/-5 lines (net -1), net test lines unchanged. Count acceptance: one redundant key scan and its regex allocation removed; three explicit array copies removed. No wall-clock, CPU, SQL, or Gateway latency claim; no timing experiment. Existing nonmutating methods remain, with no new lint suppression.

  • Focused existing stores-config suite: 4/4 passed, including malformed-key invalidation, revision stability, policy rejection, and conversation grants.
  • Changed-file oxfmt, oxlint, and git diff --check passed.
  • Two isolated Codex P0–P2 reviews of the full four-file diff against 8f1ef6c: both scoped-clean; no findings. Initial temporary-directory preflight refusals were corrected before either reviewer executed.
  • Initial exact-head CI run 41097808042 exposed a storage-schema replacement-fixture failure (expected three indexes, got two). The unchanged file passes 10/10 on both base and candidate; inode reuse was not reproduced locally. Earlier fixture cleanup can leave freed inode IDs in the module admission set. The replacement test now uses a freshly imported owner, preserves both warm-file/replacement index assertions, and passes 10/10 locally. Net test lines remain zero.
  • One additional isolated Codex P0–P2 delta review found no actionable issue in the fixture repair; the final import alias also passes no-shadow lint.
  • Final exact-head CI 41099978168 at 31f0f63: all applicable test, type, lint, source-contract, architecture, extension-boundary and baseline-ratchet gates passed, including the previously failing extensions-config shard. Security/dependency review passed. GitHub status requests intermittently returned 502/504; no test rerun or bypass was used.

Open-PR overlap comparison used base and candidate merge-tree output against #186270 (2a8f1cc) and #184755 (e1a7985). Conflict blocks are identical: 51→51 and 1→1 respectively; no new conflict. Final shared-index refresh also checked the test file and found no further peers. #186270 is now merged; the remaining open #184755 still has the identical single unrelated generated-baseline conflict. Broader scan candidates needing mutable-sort lint exceptions, uncertain input contracts, or another owner were retained rather than included here.

Release-note context: reduce redundant Knowledge config validation and explorer array copying without changing user-visible behavior.

Keep schema validation as the owner of store-key syntax and preserve nonmutating explorer projections. Remove one duplicate key scan and three intermediate arrays; no user-visible behavior change.
@clawsweeper

clawsweeper Bot commented Oct 30, 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 October 30, 2026 17:19
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-30T17:36:10.886221Z 31f0f63 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@steipete
steipete merged commit cd8290c into main Oct 30, 2026
105 of 107 checks passed
@steipete
steipete deleted the dbasync/dslrecent branch October 30, 2026 18:04
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 31, 2026
…enclaw#188556)

## What Problem This Solves

Knowledge currently walks valid store keys twice and makes an extra array copy before three explorer projections. Let the existing schema validator own key validation, and let filter/toSorted/toReversed provide the arrays they already allocate.

## User Impact

No user-visible behavior change. The malformed-membership path still makes affected agents unavailable. Store-key syntax, membership/authority checks, sorting, rendering, pagination, and source-array ownership stay unchanged. No SQL, schema, SDK, or provider-request change.

## Why This Change Was Made

The validated schema owns key syntax; the native array methods own the required copies. Keep those owners and delete the redundant work.

## Evidence

### Acceptance and counts

This is a four-site cleanup, using the final-small-batch exception; production +4/-5 lines (net -1), net test lines unchanged. Count acceptance: one redundant key scan and its regex allocation removed; three explicit array copies removed. No wall-clock, CPU, SQL, or Gateway latency claim; no timing experiment. Existing nonmutating methods remain, with no new lint suppression.

- Focused existing stores-config suite: 4/4 passed, including malformed-key invalidation, revision stability, policy rejection, and conversation grants.
- Changed-file oxfmt, oxlint, and git diff --check passed.
- Two isolated Codex P0–P2 reviews of the full four-file diff against 5fe865c: both scoped-clean; no findings. Initial temporary-directory preflight refusals were corrected before either reviewer executed.
- Initial exact-head CI run 41097808042 exposed a storage-schema replacement-fixture failure (expected three indexes, got two). The unchanged file passes 10/10 on both base and candidate; inode reuse was not reproduced locally. Earlier fixture cleanup can leave freed inode IDs in the module admission set. The replacement test now uses a freshly imported owner, preserves both warm-file/replacement index assertions, and passes 10/10 locally. Net test lines remain zero.
- One additional isolated Codex P0–P2 delta review found no actionable issue in the fixture repair; the final import alias also passes no-shadow lint.
- Final exact-head CI 41099978168 at 31f0f63: all applicable test, type, lint, source-contract, architecture, extension-boundary and baseline-ratchet gates passed, including the previously failing extensions-config shard. Security/dependency review passed. GitHub status requests intermittently returned 502/504; no test rerun or bypass was used.

Open-PR overlap comparison used base and candidate merge-tree output against openclaw#186270 (2a8f1cc) and openclaw#184755 (e1a7985). Conflict blocks are identical: 51→51 and 1→1 respectively; no new conflict. Final shared-index refresh also checked the test file and found no further peers. openclaw#186270 is now merged; the remaining open openclaw#184755 still has the identical single unrelated generated-baseline conflict. Broader scan candidates needing mutable-sort lint exceptions, uncertain input contracts, or another owner were retained rather than included here.

Release-note context: reduce redundant Knowledge config validation and explorer array copying without changing user-visible behavior.
RomneyDa added a commit that referenced this pull request Oct 31, 2026
…88556)

## What Problem This Solves

Knowledge currently walks valid store keys twice and makes an extra array copy before three explorer projections. Let the existing schema validator own key validation, and let filter/toSorted/toReversed provide the arrays they already allocate.

## User Impact

No user-visible behavior change. The malformed-membership path still makes affected agents unavailable. Store-key syntax, membership/authority checks, sorting, rendering, pagination, and source-array ownership stay unchanged. No SQL, schema, SDK, or provider-request change.

## Why This Change Was Made

The validated schema owns key syntax; the native array methods own the required copies. Keep those owners and delete the redundant work.

## Evidence

### Acceptance and counts

This is a four-site cleanup, using the final-small-batch exception; production +4/-5 lines (net -1), net test lines unchanged. Count acceptance: one redundant key scan and its regex allocation removed; three explicit array copies removed. No wall-clock, CPU, SQL, or Gateway latency claim; no timing experiment. Existing nonmutating methods remain, with no new lint suppression.

- Focused existing stores-config suite: 4/4 passed, including malformed-key invalidation, revision stability, policy rejection, and conversation grants.
- Changed-file oxfmt, oxlint, and git diff --check passed.
- Two isolated Codex P0–P2 reviews of the full four-file diff against 8f1ef6c: both scoped-clean; no findings. Initial temporary-directory preflight refusals were corrected before either reviewer executed.
- Initial exact-head CI run 41097808042 exposed a storage-schema replacement-fixture failure (expected three indexes, got two). The unchanged file passes 10/10 on both base and candidate; inode reuse was not reproduced locally. Earlier fixture cleanup can leave freed inode IDs in the module admission set. The replacement test now uses a freshly imported owner, preserves both warm-file/replacement index assertions, and passes 10/10 locally. Net test lines remain zero.
- One additional isolated Codex P0–P2 delta review found no actionable issue in the fixture repair; the final import alias also passes no-shadow lint.
- Final exact-head CI 41099978168 at 31f0f63: all applicable test, type, lint, source-contract, architecture, extension-boundary and baseline-ratchet gates passed, including the previously failing extensions-config shard. Security/dependency review passed. GitHub status requests intermittently returned 502/504; no test rerun or bypass was used.

Open-PR overlap comparison used base and candidate merge-tree output against #186270 (2a8f1cc) and #184755 (e1a7985). Conflict blocks are identical: 51→51 and 1→1 respectively; no new conflict. Final shared-index refresh also checked the test file and found no further peers. #186270 is now merged; the remaining open #184755 still has the identical single unrelated generated-baseline conflict. Broader scan candidates needing mutable-sort lint exceptions, uncertain input contracts, or another owner were retained rather than included here.

Release-note context: reduce redundant Knowledge config validation and explorer array copying without changing user-visible behavior.

(cherry picked from commit cd8290c)
Co-authored-by: RomneyDa <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant