Skip to content

test(viewer): corpus_paths round-trip proptest surface (WBS-6.2 #446) - #451

Closed
KooshaPari wants to merge 1 commit into
mainfrom
fix/viewer-corpus-paths-properties-20260808
Closed

test(viewer): corpus_paths round-trip proptest surface (WBS-6.2 #446)#451
KooshaPari wants to merge 1 commit into
mainfrom
fix/viewer-corpus-paths-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_corpus_paths.rs with 10 proptest properties pinning the corpus_paths configuration round-trip contract (WBS-6.2 #446).

CorpusPathConfig (3 properties)

  • empty() produces a config with zero custom paths.
  • Default::default() equals empty().
  • is_empty() agrees with custom_paths.is_empty().

JSON round-trip (3 properties)

  • serde_json::to_stringserde_json::from_str preserves custom_paths exactly (order-sensitive).
  • Round-trip is idempotent.
  • Length is preserved.

save_config_to / load_config_from (4 properties)

  • save_config_to then load_config_from round-trips equal configs.
  • Missing file → Ok(empty()).
  • Junk JSON → Err.
  • save_config_to creates missing parent directories.

Validation

  • cargo test -p sl-viewer --test properties_viewer_corpus_paths --features "desktop parquet" --locked — 10 passed
  • cargo fmt --all --check — clean

WBS / TRACEABILITY

WBS-6.2 evidence list and TRACEABILITY.json gain crates/sl-viewer/tests/properties_viewer_corpus_paths.rs. CHANGELOG Unreleased documents the new surface.


CodeAnt-AI Description

Add property coverage for viewer corpus path configuration persistence

What Changed

  • Adds randomized tests verifying custom corpus paths survive JSON serialization and save/load round-trips without reordering, deduplication, or loss.
  • Verifies first launch treats a missing configuration file as an empty selection, while malformed files return an error.
  • Verifies saving to a new location creates the required parent directories.
  • Records the new coverage in the viewer documentation, traceability records, and changelog.

Impact

✅ Reliable corpus path restoration
✅ Safe first launch without a configuration file
✅ Clear errors for corrupted path settings

💡 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_corpus_paths.rs` with
10 proptest properties pinning the `corpus_paths` reductions:

* `CorpusPathConfig`:
  * `empty()` returns a config with zero custom paths.
  * `Default::default()` equals `empty()`.
  * `is_empty()` is true iff `custom_paths` is empty.
  * JSON round-trip preserves `custom_paths` exactly (order-sensitive).
  * JSON round-trip is idempotent.
  * JSON round-trip preserves `custom_paths.len()`.
* `save_config_to` / `load_config_from`:
  * `save_config_to(c, p); load_config_from(p)` round-trips an equal
    config (the contract the viewer's pick-then-read flow depends on).
  * Missing file yields `Ok(empty())` — first-launch must not fail.
  * Junk JSON surfaces `Err` — never silently drops the user's picks.
  * `save_config_to` creates missing parent directories.

Updates WBS-6.2 evidence list, TRACEABILITY.json, and CHANGELOG.
Copilot AI lite review requested due to automatic review settings August 9, 2026 21:00
@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 49a07b8 Aug 09, 2026 · 21:00 21:02

@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

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.

@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: 55 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: 4a25fddb-9508-42a9-9ed3-c78c6b6b402d

📥 Commits

Reviewing files that changed from the base of the PR and between dc2110c and 49a07b8.

📒 Files selected for processing (4)
  • CHANGELOG.md
  • crates/sl-viewer/tests/properties_viewer_corpus_paths.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
@KooshaPari

Copy link
Copy Markdown
Owner Author

Closing due to merge conflicts.

@kilo-code-bot

kilo-code-bot Bot commented Aug 9, 2026

Copy link
Copy Markdown

Code Review Summary

Status: 1 Issue Found | Recommendation: Approve with notes (non-blocking)

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 1
Issue Details (click to expand)

CRITICAL

(none — by inspection the suite compiles: proptest/tempfile are declared dev-deps, corpus_paths is pub mod in lib.rs, and all imports are used. clippy/fmt are clean; all 10 properties were traced against corpus_paths.rs and are logically correct.)

SUGGESTION

File Line Issue
crates/sl-viewer/tests/properties_viewer_corpus_paths.rs 113 json_round_trip_preserves_len is logically subsumed by json_round_trip_preserves_paths at line 93, which already asserts full structural equality (restored == config) — that equality implies equal custom_paths lengths. The length guard is harmless (the suite's stated purpose is defense-in-depth), but it is redundant against the existing full-equality property. Consider dropping it to avoid the false impression of additional coverage.
Files Reviewed (4 files)
  • crates/sl-viewer/tests/properties_viewer_corpus_paths.rs - 1 suggestion (new file, 208 lines)
  • CHANGELOG.md - reviewed (docs)
  • docs/ops/TRACEABILITY.json - reviewed (docs)
  • docs/ops/WBS.md - reviewed (docs)

Notes

  • headRefOid verified stable at 49a07b8 before posting.
  • No existing inline comments or prior Kilo summary to reconcile.
  • Conventions match the sibling suite properties_viewer_web_exports.rs (proptest _i in 0u8..N shape; std::env::temp_dir() + manual cleanup); not flagged as deviations.

Fix these issues in Kilo Cloud


Reviewed by laguna-s-2.1:free · Input: 159.1K · Output: 25.9K · Cached: 210.7K

KooshaPari added a commit that referenced this pull request Aug 9, 2026
…S-6.2 #451 #452 #453) (#461)

* test(viewer): mock_data fixture proptest surface (WBS-6.2 #451)

Adds crates/sl-viewer/tests/properties_viewer_mock_data.rs with 18
proptest properties pinning the deterministic demo fixtures:

* sample_bundles():
  * Non-empty, returns the documented 3-entry sample.
  * Every source_id is non-empty and unique.
  * Every ContinuationBundle has at least one Bundle slice, at
    least one Intent slice, and an Intent with a non-empty goal.
  * Every Acceptance slice carries ready: true.
  * Deterministic across calls.
* sample_sessions():
  * Non-empty, returns the documented 3-entry sample.
  * Every session id is non-empty and unique.
  * Every session has at least one non-empty-content message.
  * Every session has non-empty cwd and title.
  * Every session contains at least one User and one Assistant
    message so the timeline UI can render both sides.
  * Deterministic across calls.

Updates WBS-6.2 evidence list, TRACEABILITY.json, and CHANGELOG.

* test(viewer): cli_help + command_palette proptest surface (WBS-6.2 #452)

Adds crates/sl-viewer/tests/properties_viewer_cli_help.rs with 17
proptest properties pinning the CLI help and palette SSOT:

* cli_help::version_text:
  * Non-empty.
  * Contains the package version.
  * Contains the daemon: label and the help doc link.
  * Deterministic across calls.
* cli_help::help_text:
  * Non-empty.
  * Documents SL_DAEMON_URL, FORGE_DB, and SL_VIEWER_DEMO.
  * Links the documented SSOT and quick-start docs.
  * Mentions the keyboard shortcuts.
  * Deterministic across calls.
* command_palette::COMMANDS:
  * Non-empty.
  * Every command has a non-empty id, label, and hint.
  * Every id is unique across the palette.
  * Every id is kebab-case ASCII (used as a DOM id).
  * Every documented PaletteAction variant is covered.
  * Every label and hint is single-line (no tabs / newlines).
  * Each action appears 1-7 times.

Updates WBS-6.2 evidence list, TRACEABILITY.json, and CHANGELOG.

* test(viewer): corpus_cta constants proptest surface (WBS-6.2 #453)

Adds crates/sl-viewer/tests/properties_viewer_corpus_cta.rs with 9
proptest properties pinning the first-run CTA SSOT:

* QUICKSTART_URL:
  * Non-empty, uses HTTPS, ends in QUICKSTART.md.
  * Points at the canonical KooshaPari/SessionLedger repo.
  * Basename matches QUICKSTART_CORPUS_DOC's basename.
* QUICKSTART_CORPUS_DOC:
  * Equals docs/guides/quick-start/QUICKSTART.md.
* CORPUS_PICKER_INPUT_ID, FORGE_DB_HINT_STORAGE_KEY:
  * Non-empty, kebab-case ASCII (used as DOM id / localStorage key).
  * Distinct so the picker never confuses the two.

Updates WBS-6.2 evidence list, TRACEABILITY.json, and CHANGELOG.

---------

Co-authored-by: SessionLedger Bot <team@sessionledger.local>
KooshaPari added a commit that referenced this pull request Aug 9, 2026
* test(viewer): mock_data fixture proptest surface (WBS-6.2 #451)

Adds crates/sl-viewer/tests/properties_viewer_mock_data.rs with 18
proptest properties pinning the deterministic demo fixtures:

* sample_bundles():
  * Non-empty, returns the documented 3-entry sample.
  * Every source_id is non-empty and unique.
  * Every ContinuationBundle has at least one Bundle slice, at
    least one Intent slice, and an Intent with a non-empty goal.
  * Every Acceptance slice carries ready: true.
  * Deterministic across calls.
* sample_sessions():
  * Non-empty, returns the documented 3-entry sample.
  * Every session id is non-empty and unique.
  * Every session has at least one non-empty-content message.
  * Every session has non-empty cwd and title.
  * Every session contains at least one User and one Assistant
    message so the timeline UI can render both sides.
  * Deterministic across calls.

Updates WBS-6.2 evidence list, TRACEABILITY.json, and CHANGELOG.

* test(viewer): theme + settings property surfaces (WBS-6.2 #454)

Adds two complementary property surfaces for sl-viewer's pure
data-reducers:

* crates/sl-viewer/tests/properties_viewer_theme.rs (28 props):
  - Theme::default() is System; JSON round-trips for every variant.
  - ThemeColors::dark and ThemeColors::light each expose 9 fields
    that all match the documented lab_coat::* constants; every
    field is non-empty; focus == accent for both palettes.
  - for_theme(Dark|Light|System) is the documented palette.

* crates/sl-viewer/tests/properties_viewer_settings.rs (21 props):
  - DefaultTab::default() is Bundles; ALL covers every variant,
    length 9, every tab_id/value_attr unique kebab-case ASCII.
  - Settings::default() matches documented; JSON round-trips;
    serialised theme is lowercase, default_tab is kebab-case.
  - save_to_path / load_from_path round-trip; missing/corrupt
    files fall back to default(); parent dirs created.
  - resolve_settings_dir honours overrides; falls through on
    empty; picks documented macOS / Windows / Linux paths.

Updates WBS-6.2 evidence list, TRACEABILITY.json, and CHANGELOG.

---------

Co-authored-by: SessionLedger Bot <team@sessionledger.local>
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