Skip to content

chore: integrate reviewed maintenance PR queue - #22

Merged
undivisible merged 23 commits into
mainfrom
reviewed-pr-queue
Aug 12, 2026
Merged

chore: integrate reviewed maintenance PR queue#22
undivisible merged 23 commits into
mainfrom
reviewed-pr-queue

Conversation

@undivisible

@undivisible undivisible commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Integrates the reviewed open PR queue after resolving overlapping test modules and composing the apply/repair refactors with cached statement performance optimizations.

Validated locally:

  • cargo fmt --check
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo test --all-features
  • plugins/openclaw: format, lint, test, build

Note

Medium Risk
Touches critical memory store paths (apply, export, deletion, repair) via structural refactors and statement caching, so regressions could affect data integrity even though behavior is intended to stay the same.

Overview
Integrates a reviewed maintenance queue: refactors large store and personality paths into smaller helpers, caches prepared SQLite statements in apply/export/repair, and expands test coverage.

Store refactors split apply, export, and delete_source into focused helpers (validate_apply_input/apply_commit, pack_export_page/validate_export_*, deletion target/soft-delete/retract helpers) while preserving existing behavior. Apply, export append, and repair now reuse prepare_cached statements.

Personality extracts hard-rule and learned-policy evaluation from route_event into evaluate_hard_rules / evaluate_learned_policy with no routing logic change.

Tests add coverage for claim-evidence validation, memory-state legality, repair outbox handling, correction lifecycle, lexical query edge cases, OpenClaw exact-read/path rejection, and CLI help/error paths.

Reviewed by Cursor Bugbot for commit 619ec84. Configure here.

google-labs-jules Bot and others added 23 commits August 12, 2026 04:32
Co-authored-by: undivisible <136312656+undivisible@users.noreply.github.com>
Co-authored-by: undivisible <136312656+undivisible@users.noreply.github.com>
Co-authored-by: undivisible <136312656+undivisible@users.noreply.github.com>
Co-authored-by: undivisible <136312656+undivisible@users.noreply.github.com>
Co-authored-by: undivisible <136312656+undivisible@users.noreply.github.com>
…ore loop

Co-authored-by: undivisible <136312656+undivisible@users.noreply.github.com>
Tested edge cases and happy path, significantly improving coverage.

Co-authored-by: undivisible <136312656+undivisible@users.noreply.github.com>
- Extracted `validate_export_request` to handle preliminary cursor and parameter bounds checking.
- Extracted `resolve_high_water_mark` to determine and validate the query high water mark constraint.
- Extracted `validate_export_cursor` to check cursor validity against queried sequence counts.
- Extracted `pack_export_page` to handle serialization size bounding and commit packing.
- Reduced the size and complexity of the primary `export` method by delegating these distinct steps.

Co-authored-by: undivisible <136312656+undivisible@users.noreply.github.com>
- Extracts input validation logic into `validate_apply_input`.
- Extracts inner loop commit processing into `apply_commit`.
- Greatly simplifies the `MemoryDb::apply` method.

Co-authored-by: undivisible <136312656+undivisible@users.noreply.github.com>
- Fixes the formatting issues detected by `cargo fmt --check` in the previous run.

Co-authored-by: undivisible <136312656+undivisible@users.noreply.github.com>
Make lexical_queries pub(super) and add missing test coverage for
empty query, single word, multiple words, deduplication, escaping,
punctuation, and token limits.

Co-authored-by: undivisible <136312656+undivisible@users.noreply.github.com>
Make lexical_queries pub(super) and add missing test coverage for
empty query, single word, multiple words, deduplication, escaping,
punctuation, and token limits.

Co-authored-by: undivisible <136312656+undivisible@users.noreply.github.com>
This adds three new tests for the `readFile` functionality:
- A test that invalid zkr paths correctly throw "invalid zkr memory path".
- A test that reads are correctly mapped to the underlying CLI "get" command with extracted params.
- A test validating the pagination logic (extracting line subsets) and truncation values using the `from` and `lines` parameter.

Co-authored-by: undivisible <136312656+undivisible@users.noreply.github.com>
This fixes formatting errors and adds three new tests for the `readFile` functionality:
- A test that invalid zkr paths correctly throw "invalid zkr memory path".
- A test that reads are correctly mapped to the underlying CLI "get" command with extracted params.
- A test validating the pagination logic (extracting line subsets) and truncation values using the `from` and `lines` parameter.

Co-authored-by: undivisible <136312656+undivisible@users.noreply.github.com>
- Decomposed `delete_source` in `src/store/lifecycle.rs` into multiple well-named private helper functions.
- Preserved existing logic, order of operations, and tests passing state.

Co-authored-by: undivisible <136312656+undivisible@users.noreply.github.com>
- Decomposed `delete_source` in `src/store/lifecycle.rs` into multiple well-named private helper functions.
- Preserved existing logic, order of operations, and tests passing state.
- Formatted file per `cargo fmt`.

Co-authored-by: undivisible <136312656+undivisible@users.noreply.github.com>
- Decomposed `delete_source` in `src/store/lifecycle.rs` into multiple well-named private helper functions.
- Preserved existing logic, order of operations, and tests passing state.
- Formatted file per `cargo fmt`.
- Addressed clippy complaints for type_complexity and too_many_arguments.

Co-authored-by: undivisible <136312656+undivisible@users.noreply.github.com>
Replaced a verbose 15-line test that dynamically generated a mock `zkr` script with two concise tests using standard shell commands (`echo` and `false`). These simple tests successfully trigger the JSON parsing error path and the non-zero exit code error path in `cli.ts`, improving test maintainability and driving coverage to 100%.

Co-authored-by: undivisible <136312656+undivisible@users.noreply.github.com>
Co-authored-by: undivisible <136312656+undivisible@users.noreply.github.com>
Co-authored-by: undivisible <136312656+undivisible@users.noreply.github.com>
Fix test string format to match expected output and run cargo fmt.

Co-authored-by: undivisible <136312656+undivisible@users.noreply.github.com>
Extracted the checking and insertion queries from the inner apply loops into cached prepared statements to prevent query parsing/compilation overhead on each of the thousands of records. Benchmarked using 25,000 records resulting in an approx. 4.1x performance increase (331ms baseline down to ~79ms). Included explicit drop of the cached statements to comply with Rust borrow checking before the transaction commit.

Co-authored-by: undivisible <136312656+undivisible@users.noreply.github.com>
@undivisible
undivisible merged commit a51dc48 into main Aug 12, 2026
6 checks passed
@cursor

cursor Bot commented Aug 12, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_e8d13b7c-1f33-4b40-8308-80717a9bea4f)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant