Repository navigation
refactor(knowledge): remove redundant validation and array copies - #188556
Merged
Merged
Conversation
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.
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Contributor
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
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.