Skip to content

test(viewer): search_view + memory_tab proptest surface (WBS-6.2 #435) - #442

Merged
KooshaPari merged 1 commit into
mainfrom
fix/viewer-timeline-properties-20260808
Aug 9, 2026
Merged

test(viewer): search_view + memory_tab proptest surface (WBS-6.2 #435)#442
KooshaPari merged 1 commit into
mainfrom
fix/viewer-timeline-properties-20260808

Conversation

@KooshaPari

@KooshaPari KooshaPari commented Aug 9, 2026

Copy link
Copy Markdown
Owner

User description

Summary

Adds crates/sl-viewer/tests/properties_viewer_search_memory.rs with 12 proptest properties pinning the search_view and memory_tab pure-helper reductions (WBS-6.2 #435, redux after the operator closed the original PR due to merge conflicts with #433's timeline surface).

search_view::build_query (4 properties) — trim-invariance, present-iff-nonempty, percent-encoding of , ,, #, &, =, +, always-limit= with parse-or-"50" fallback.

search_view::advanced_filter_active_count (3 properties) — per-field count, "50" not counted, trim-invariance.

memory_tab::to_wiki_page (3 properties)session_id/title carried through, deterministic.

memory_tab::all_wiki_pages_from_sessions (2 properties) — length matches input, order matches input.

Validation

  • cargo test -p sl-viewer --test properties_viewer_search_memory --features "desktop parquet" --locked — 12 passed
  • cargo clippy -p sl-viewer --test properties_viewer_search_memory --features "desktop parquet" --locked -- -D warnings — clean
  • cargo fmt --all --check — clean

Rebase status

This branch was rebased onto origin/main after #433 (timeline) was merged. The 05ebd116 (timeline) commit was skipped by git rebase because #433 was already merged into origin/main; only e79c9d47 (search/memory) remained to apply.


CodeAnt-AI Description

Add property-based tests that verify viewer search queries and memory pages remain consistent across varied inputs

What Changed

  • Verifies search filters are trimmed, omitted when empty, safely encoded, and always include a valid limit with a 50 fallback
  • Verifies active filter counts handle empty values, the default limit, and surrounding whitespace correctly
  • Verifies memory pages preserve session IDs and titles, remain deterministic, and retain one-to-one input order
  • Records the new coverage in the changelog, work plan, and traceability evidence

Impact

✅ Fewer regressions in viewer search filters
✅ Consistent memory page ordering
✅ Clearer validation of default search limits

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

Adds `crates/sl-viewer/tests/properties_viewer_search_memory.rs` with
12 proptest properties pinning `search_view` and `memory_tab`
reductions:

* `search_view::build_query`:
  * Each field's post-trim value is what gets serialized — padding
    on either side of a field value does not change the output.
  * `since` (and by symmetry every other optional field) appears
    in the query iff its post-trim value is non-empty.
  * The documented break-character set (` `, `,`, `#`, `&`,
    `=`, `+`) is percent-encoded; safe ASCII alphanumerics pass
    through unchanged.
  * `limit=` is always present and equals the parsed input or the
    documented `"50"` fallback when parsing fails.
* `search_view::advanced_filter_active_count`:
  * `min_tokens` and `tags` count as 1 each when non-empty
    (post-trim); 0 otherwise.
  * `limit"=="50"` does not count; any other value does.
  * Trim-invariant: padded inputs produce the same count.
* `memory_tab::to_wiki_page`:
  * `session_id` and `title` are carried through unchanged.
  * Deterministic: applying it twice to the same session yields the
    same `MemoryWikiPage`.
* `memory_tab::all_wiki_pages_from_sessions`:
  * Output length equals input length.
  * Order matches input order (page `i` ↔ session `i`).

Updates WBS-6.2 evidence list, TRACEABILITY.json, and CHANGELOG.
Copilot AI lite review requested due to automatic review settings August 9, 2026 02:16

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@codeant-ai

codeant-ai Bot commented Aug 9, 2026

Copy link
Copy Markdown

🤖 CodeAnt AI — Review Status

Status Commit Started (UTC) Finished (UTC)
✅ Reviewed your PR a3fa3a1 Aug 09, 2026 · 02:16 02:18

@codeant-ai

codeant-ai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@KooshaPari, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 56 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: c898e871-0087-446e-b663-6bb5c23e5f85

📥 Commits

Reviewing files that changed from the base of the PR and between 1ba3cd3 and a3fa3a1.

📒 Files selected for processing (4)
  • CHANGELOG.md
  • crates/sl-viewer/tests/properties_viewer_search_memory.rs
  • docs/ops/TRACEABILITY.json
  • docs/ops/WBS.md

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codeant-ai codeant-ai Bot added the size:L This PR changes 100-499 lines, ignoring generated files label Aug 9, 2026
Comment on lines +79 to +81
let q = build_query(&since, &until, &model, &min_tokens, &tags, &limit);
let has_since = q.split('&').any(|kv| kv.starts_with("since="));
prop_assert_eq!(has_since, !since.trim().is_empty());

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: The test claims to verify the trimmed, encoded, exactly-once since parameter, but it only checks whether any component starts with since=. A duplicate parameter, an incorrect value, or an unencoded value would all pass. Parse the query components and assert that there is exactly one since entry whose value matches the trimmed and encoded input. [api mismatch]

Severity Level: Major ⚠️
- ⚠️ Incorrect `since` filters can reach `GET /api/search`.
- ⚠️ Duplicate parameters may produce ambiguous daemon filtering.

Fix in Cursor Fix in VSCode Claude

(Use Cmd/Ctrl + Click for best experience)

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** crates/sl-viewer/tests/properties_viewer_search_memory.rs
**Line:** 79:81
**Comment:**
	*Api Mismatch: The test claims to verify the trimmed, encoded, exactly-once `since` parameter, but it only checks whether any component starts with `since=`. A duplicate parameter, an incorrect value, or an unencoded value would all pass. Parse the query components and assert that there is exactly one `since` entry whose value matches the trimmed and encoded input.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
👍 | 👎

Comment on lines +148 to +155
for ch in input.chars() {
if [' ', ',', '#', '&', '=', '+'].contains(&ch) {
prop_assert!(
!model_part.contains(ch),
"raw character {ch:?} present in model value: {model_part:?}",
);
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: This property only checks that reserved characters are absent from the output and never verifies their required percent-encoded replacements or that the input content is preserved. An implementation that silently drops these characters or substitutes arbitrary text would pass, despite violating the documented encoding contract. Assert the exact encoded model value for every generated input. [incomplete implementation]

Severity Level: Major ⚠️
- ⚠️ Encoding regressions can silently discard model-filter content.
- ⚠️ Search query property gives false confidence.

Fix in Cursor Fix in VSCode Claude

(Use Cmd/Ctrl + Click for best experience)

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** crates/sl-viewer/tests/properties_viewer_search_memory.rs
**Line:** 148:155
**Comment:**
	*Incomplete Implementation: This property only checks that reserved characters are absent from the output and never verifies their required percent-encoded replacements or that the input content is preserved. An implementation that silently drops these characters or substitutes arbitrary text would pass, despite violating the documented encoding contract. Assert the exact encoded model value for every generated input.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
👍 | 👎

Comment on lines +220 to +222
let body_changes_default = !min_tokens.trim().is_empty() || !tags.trim().is_empty() || body.trim() != "50";
let body_changes_other = !min_tokens.trim().is_empty() || !tags.trim().is_empty() || body.trim() != "50";
prop_assert_eq!(default_count < changed_count, body_changes_default && body_changes_other);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: The expected condition is duplicated with the filter fields included in both cases. When min_tokens or tags is non-empty and body.trim() is 50, both calls produce the same count, but the right-hand side is still true, so this property fails for valid inputs. Compare only whether body differs from 50 when asserting that the count increases. [incorrect condition logic]

Severity Level: Major ⚠️
- ❌ Property test fails for valid active-filter inputs.
- ⚠️ CI validation is blocked by a false assertion.

Fix in Cursor Fix in VSCode Claude

(Use Cmd/Ctrl + Click for best experience)

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** crates/sl-viewer/tests/properties_viewer_search_memory.rs
**Line:** 220:222
**Comment:**
	*Incorrect Condition Logic: The expected condition is duplicated with the filter fields included in both cases. When `min_tokens` or `tags` is non-empty and `body.trim()` is `50`, both calls produce the same count, but the right-hand side is still true, so this property fails for valid inputs. Compare only whether `body` differs from `50` when asserting that the count increases.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
👍 | 👎

Comment on lines +233 to +234
let page = to_wiki_page(&session);
prop_assert_eq!(page.session_id, session.id);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: The memory tests assert only copied metadata, page count/order, and repeatability. Because session_strategy creates sessions without messages, the four extractor outputs are effectively exercised only for empty input; a regression that returns incorrect intent, context, contract, or acceptance data for real session content would still pass all these properties. Generate sessions containing representative messages and assert the extracted fields as part of the helper contract. [incomplete implementation]

Severity Level: Major ⚠️
- ⚠️ Memory Wiki extraction regressions remain undetected.
- ⚠️ Intent, context, contract, acceptance outputs lack coverage.

Fix in Cursor Fix in VSCode Claude

(Use Cmd/Ctrl + Click for best experience)

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** crates/sl-viewer/tests/properties_viewer_search_memory.rs
**Line:** 233:234
**Comment:**
	*Incomplete Implementation: The memory tests assert only copied metadata, page count/order, and repeatability. Because `session_strategy` creates sessions without messages, the four extractor outputs are effectively exercised only for empty input; a regression that returns incorrect intent, context, contract, or acceptance data for real session content would still pass all these properties. Generate sessions containing representative messages and assert the extracted fields as part of the helper contract.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
👍 | 👎

@KooshaPari
KooshaPari merged commit 2ca5bea into main Aug 9, 2026
104 of 113 checks passed
@KooshaPari
KooshaPari deleted the fix/viewer-timeline-properties-20260808 branch August 9, 2026 02:41
@kilo-code-bot

kilo-code-bot Bot commented Aug 9, 2026

Copy link
Copy Markdown

Code Review Summary

Status: 4 Issues Found | Recommendation: Address before merge

Overview

Severity Count
WARNING 4
Issue Details (click to expand)

WARNING

File Line Issue
crates/sl-viewer/tests/properties_viewer_search_memory.rs 81 build_query_since_present_iff_nonempty only checks that since= appears somewhere in the query string. It does not verify that since appears exactly once, that its value matches the trimmed and URL-encoded input, or that duplicates are rejected. A buggy implementation emitting since= twice or with a wrong value would still pass.
crates/sl-viewer/tests/properties_viewer_search_memory.rs 155 build_query_encodes_break_chars only verifies that raw break characters are absent from the encoded value. It never checks that the required percent-encoded replacements appear, that the encoding is correct (e.g. %20 vs + for space), or that non-break characters are preserved. An implementation that silently drops reserved characters would pass.
crates/sl-viewer/tests/properties_viewer_search_memory.rs 222 advanced_filter_count_limit_default contains duplicated boolean expressions (body_changes_default and body_changes_other are identical). When min_tokens or tags is non-empty and body.trim() is "50", both default_count and changed_count are equal, so default_count < changed_count is false while the right-hand side is true — the property fails for valid inputs.
crates/sl-viewer/tests/properties_viewer_search_memory.rs 234 The memory-tab properties only exercise Session fixtures created without messages. Because to_wiki_page and all_wiki_pages_from_sessions extract intent, context, contract, and acceptance from session content, these tests only verify empty/default extractor output. A regression in real message extraction would go undetected.
Files Reviewed (4 files)
  • crates/sl-viewer/tests/properties_viewer_search_memory.rs - 4 issues
  • CHANGELOG.md
  • docs/ops/TRACEABILITY.json
  • docs/ops/WBS.md

Fix these issues in Kilo Cloud


Reviewed by step-3.7-flash · Input: 91.4K · Output: 18.9K · Cached: 446.1K

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

Labels

size:L This PR changes 100-499 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants