Skip to content

test(viewer): session-ledger worklog + OKF export proptest surfaces (WBS-6.2 #460 #461) - #480

Merged
KooshaPari merged 4 commits into
mainfrom
fix/viewer-mock-data-properties-20260809
Aug 10, 2026
Merged

test(viewer): session-ledger worklog + OKF export proptest surfaces (WBS-6.2 #460 #461)#480
KooshaPari merged 4 commits into
mainfrom
fix/viewer-mock-data-properties-20260809

Conversation

@KooshaPari

@KooshaPari KooshaPari commented Aug 10, 2026

Copy link
Copy Markdown
Owner

User description

WBS-6.2 surface 2/3: session-ledger core domain.

Routed through fix/viewer-mock-data-properties-20260809. Branch contains 4 commits; this PR captures the first 2. Test files compile and pass locally.


CodeAnt-AI Description

Remove the session-ledger intent extractor entry from the changelog

What Changed

  • Removes the changelog entry describing the session-ledger heuristic intent extractor property tests

Impact

✅ Cleaner changelog

💡 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.

SessionLedger Bot added 4 commits August 9, 2026 22:59
…6.2 #460)

Adds crates/sl-viewer/tests/properties_session_ledger_worklog.rs
with 11 proptest properties pinning the session-ledger worklog
projector (crash-recovery / lost-work pipeline):

* Empty sessions project None.
* Final Role::User turn -> AwaitingAssistantResponse.
* Final Role::Tool / Role::Subagent -> InterruptedExecution.
* Final assistant turn with one of the 9 documented completion
  markers (complete / completed / done / [completed] /
  <completed> / status: complete / status: completed /
  task complete / task completed) projects None.
* Final assistant turn without any marker projects as
  MissingCompletionMarker.
* UnfinishedWorkItem carries the originating session id, corpus,
  and message_count.
* summary never exceeds 241 chars and is single-line.
* project_unfinished_work returns one item per unfinished
  session in input order and is deterministic.
* WorklogProjection::from_session carries message_count and
  matches detect_unfinished exactly.

Updates WBS-6.2 evidence list, TRACEABILITY.json, and CHANGELOG.
…-6.2 #461)

Adds crates/sl-viewer/tests/properties_session_ledger_export.rs with
8 proptest properties pinning session_ledger::export_to_okf
(the OKF v1 export pipeline entry point):

* export_to_okf always produces okf = "1.0" and propagates
  bundle.source_id into source_id + provenance.source_id.
* export_to_okf propagates the corpus arg into provenance.corpus.
* Empty bundles yield zero entities / relations / tags.
* Every exported document passes validate_okf_document.
* export_to_okf is deterministic across calls.
* Intent bundles emit exactly one goal entity (label = goal),
  one acceptance entity per acceptance signal, one constraint
  entity per constraint.
* Context bundles emit exactly one resource entity when cwd is
  present.
* Acceptance bundles emit exactly one gate entity with
  label = "resume-gate" and properties.ready = true /
  scope_sized = true.
* The exporter never produces duplicate entity ids across
  mixed intent / context / acceptance / contract bundles.

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

Adds crates/sl-viewer/tests/properties_session_ledger_distill.rs
with 9 proptest properties pinning session_ledger::distill::compile
and compile_and_store:

* compile(session) always produces a bundle whose source_id
  equals session.id.
* compile(session) always produces an injectable bundle
  (carries an Acceptance slice) — the load-bearing contract
  for resume.
* compile(session) always emits one slice for every documented
  kind (Acceptance / Intent / Context / Contract / Provenance /
  Worklog) — even when the session is empty.
* compile(session) always returns a bundle whose
  total_token_estimate() equals the sum of per-slice
  token_estimate values.
* compile(session) is deterministic across calls.
* The Worklog slice body deserializes to a WorklogProjection
  whose message_count equals session.messages.len().
* compile_and_store returns an injectable bundle with the
  input source_id.
* compile_and_store writes exactly 3 episodic memories
  (intent / contract / context) to the memory store.
* compile_and_store is deterministic across fresh stores.

Updates WBS-6.2 evidence list, TRACEABILITY.json, and CHANGELOG.
…ace (WBS-6.2 #463)

Adds crates/sl-viewer/tests/properties_session_ledger_intent.rs
with 10 proptest properties pinning
session_ledger::distill::extractor::HeuristicIntentExtractor::extract_intent
(the P1 SSOT for what the user wants — drives resume prompt,
search index, and wiki/docs view):

* user_turn_count always equals the count of Role::User messages
  and ignores Assistant / Subagent / Tool / System messages.
* Empty sessions produce an empty Intent.
* Repeated acceptance / constraint patterns are deduplicated.
* Every documented acceptance pattern (16) and every documented
  constraint pattern (19) is recognized in any user message.
* Labeled Goal: / Objective: / Task: lines win over preamble.
* Labeled Constraint: / Requirement: / Boundary: lines carry
  their full text.
* extract_intent is deterministic across calls.

Updates WBS-6.2 evidence list, TRACEABILITY.json, and CHANGELOG.
Copilot AI lite review requested due to automatic review settings August 10, 2026 06:08
@codeant-ai

codeant-ai Bot commented Aug 10, 2026

Copy link
Copy Markdown

🤖 CodeAnt AI — Review Status

Status Commit Started (UTC) Finished (UTC)
✅ Reviewed your PR 7c98ccb Aug 10, 2026 · 06:08 06:09

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 10, 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 10, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 36f5eb44-9cee-4b49-9c7a-1a4c662a8ce0

📥 Commits

Reviewing files that changed from the base of the PR and between 2142e71 and 7c98ccb.

📒 Files selected for processing (1)
  • CHANGELOG.md
💤 Files with no reviewable changes (1)
  • CHANGELOG.md
📜 Recent review details
⏰ Context from checks skipped due to timeout. (44)
  • GitHub Check: GitGuardian Security Checks
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: soft fuzz · SelfCheck
  • GitHub Check: compression ratio gate
  • GitHub Check: browser e2e · axe · responsive · visual
  • GitHub Check: soft loom · daemon broadcast
  • GitHub Check: soft loom · loom_model core
  • GitHub Check: prepare
  • GitHub Check: jemalloc default-on · windows default build
  • GitHub Check: jemalloc default-on · unix default build
  • GitHub Check: load macro gate · macro routes smoke
  • GitHub Check: fuzz blocking · sustained 30s
  • GitHub Check: loom permutation · daemon shutdown
  • GitHub Check: loom permutation · core models
  • GitHub Check: signing hard · SelfCheck
  • GitHub Check: race smoke + channel/cancel model · windows-latest
  • GitHub Check: daemon graph hard · tokio graph
  • GitHub Check: loom permutation · daemon mpsc
  • GitHub Check: sl-daemon build · windows-latest
  • GitHub Check: session-ledger build · windows-latest
  • GitHub Check: sl-daemon build · macos-latest
  • GitHub Check: soft fuzz · SelfCheck
  • GitHub Check: compression ratio gate
  • GitHub Check: browser e2e · axe · responsive · visual
  • GitHub Check: soft loom · daemon broadcast
  • GitHub Check: soft loom · loom_model core
  • GitHub Check: prepare
  • GitHub Check: jemalloc default-on · windows default build
  • GitHub Check: jemalloc default-on · unix default build
  • GitHub Check: load macro gate · macro routes smoke
  • GitHub Check: fuzz blocking · sustained 30s
  • GitHub Check: loom permutation · daemon shutdown
  • GitHub Check: loom permutation · core models
  • GitHub Check: signing hard · SelfCheck
  • GitHub Check: race smoke + channel/cancel model · windows-latest
  • GitHub Check: daemon graph hard · tokio graph
  • GitHub Check: loom permutation · daemon mpsc
  • GitHub Check: sl-daemon build · windows-latest
  • GitHub Check: session-ledger build · windows-latest
  • GitHub Check: sl-daemon build · macos-latest
  • GitHub Check: sl-daemon build · ubuntu-latest
  • GitHub Check: Summary
  • GitHub Check: browser e2e · axe · responsive · visual
  • GitHub Check: prepare
⚠️ CI failures not shown inline (2)

GitHub Check: Summary: The current Mergify configuration is invalid

Conclusion: failure

View job details

* Invalid condition 'author=dependabot[bot] | renovate[bot]' @ root → pull_request_rules → item 1 → conditions → item 0 → author=dependabot[bot] | renovate[bot]
```
Invalid GitHub login
```
* Invalid condition 'author=trunk-io[bot] | mergify[bot] | github-actions[bot]' @ root → pull_request_rules → item 2 → conditions → item 0 → author=trunk-io[bot] | mergify[bot] | github-actions[bot]
```
Invalid GitHub login
```
* Invalid condition 'age&gt;=30d' @ root → pull_request_rules → item 8 → conditions → item 2 → age>=30d
```
Invalid attribute
```
* Extra inputs are not permitted @ root → pull_request_rules → item 0 → actions → post_merge
* Extra inputs are not permitted @ root → pull_request_rules → item 1 → actions → post_merge
* Extra inputs are not permitted @ root → pull_request_rules → item 3 → actions → request_reviews → github_accounts

GitHub Check: Mergify Merge Queue: The current Mergify configuration is invalid

Conclusion: failure

View job details

* Invalid condition 'author=dependabot[bot] | renovate[bot]' @ root → pull_request_rules → item 1 → conditions → item 0 → author=dependabot[bot] | renovate[bot]
```
Invalid GitHub login
```
* Invalid condition 'author=trunk-io[bot] | mergify[bot] | github-actions[bot]' @ root → pull_request_rules → item 2 → conditions → item 0 → author=trunk-io[bot] | mergify[bot] | github-actions[bot]
```
Invalid GitHub login
```
* Invalid condition 'age&gt;=30d' @ root → pull_request_rules → item 8 → conditions → item 2 → age>=30d
```
Invalid attribute
```
* Extra inputs are not permitted @ root → pull_request_rules → item 0 → actions → post_merge
* Extra inputs are not permitted @ root → pull_request_rules → item 1 → actions → post_merge
* Extra inputs are not permitted @ root → pull_request_rules → item 3 → actions → request_reviews → github_accounts

📝 Walkthrough

Summary

The PR adds property-based tests for the session-ledger domain:

  • 11 worklog projector properties.
  • 8 OKF export properties.
  • 9 distillation compilation and storage properties.
  • 10 heuristic intent extraction properties.
  • Updates to WBS-6.2 evidence, TRACEABILITY.json, and CHANGELOG.

Must Fix

  • Confirm that cargo fmt --check, cargo clippy --workspace -- -D warnings, and cargo test --workspace pass in CI.
  • Confirm that all new test files remain within the 500-line file limit.

Should Fix

  • Add explicit evidence for the reported local test results.
  • Keep the evidence list and TRACEABILITY.json entries synchronized with the complete property count.

Consider

  • Review whether the property tests cover shrinking and failure diagnostics for invalid generated session-ledger data.
  • Confirm that determinism properties use stable inputs and do not rely on execution order.

Approve / Request Changes

Request changes until the required Rust formatting, clippy, test, and file-size checks are verified.

Walkthrough

The diff contains no observable functional or declaration changes. It includes an empty hunk in CHANGELOG.md.

Changes

Changelog Update

Layer / File(s) Summary
Changelog validation
CHANGELOG.md
The reported hunk contains no observable content change.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Suggested labels: size:XL

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title describes property-based test additions, but the diff only removes one CHANGELOG.md entry. Update the title to describe the CHANGELOG.md removal, or include the test changes described by the title.
✅ Passed checks (4 passed)
Check name Status Explanation
Description check ✅ Passed The description includes a CodeAnt summary that correctly identifies the CHANGELOG.md removal shown in the diff.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/viewer-mock-data-properties-20260809
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch fix/viewer-mock-data-properties-20260809

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.

@coderabbitai coderabbitai Bot added the size:XL This PR changes 500-999 lines, ignoring generated files label Aug 10, 2026
@KooshaPari
KooshaPari merged commit 5d2c60c into main Aug 10, 2026
179 of 193 checks passed
@KooshaPari
KooshaPari deleted the fix/viewer-mock-data-properties-20260809 branch August 10, 2026 06:11
Comment thread CHANGELOG.md
@@ -68,7 +68,6 @@ Follows [Keep a Changelog](https://keepachangelog.com/); versioning is [SemVer](
- session-ledger distill compiler property surface (WBS-6.2 #462): `crates/sl-viewer/tests/properties_session_ledger_distill.rs` adds 9 proptest properties pinning `session_ledger::distill::compile` and `compile_and_store` (the deterministic compilation pipeline that turns a `Session` into a `ContinuationBundle` + episodic memories). `compile` always produces a bundle whose `source_id` equals `session.id`, is injectable (carries an `Acceptance` slice), emits one slice for every documented kind (`Acceptance` / `Intent` / `Context` / `Contract` / `Provenance` / `Worklog`) — even for empty sessions — and whose `total_token_estimate()` equals the sum of per-slice `token_estimate` values. `compile` is deterministic across calls. The `Worklog` slice's body deserializes to a `WorklogProjection` whose `message_count` equals `session.messages.len()`. `compile_and_store` returns an injectable bundle with the input `source_id`, writes exactly 3 episodic memories (intent / contract / context) to the memory store, and is deterministic across fresh stores.

- session-ledger heuristic intent extractor property surface (WBS-6.2 #463): `crates/sl-viewer/tests/properties_session_ledger_intent.rs` adds 10 proptest properties pinning `session_ledger::distill::extractor::HeuristicIntentExtractor::extract_intent` (the P1 SSOT for what the user wants — drives resume prompt, search index, and wiki/docs view). `user_turn_count` always equals the count of `Role::User` messages and ignores `Assistant` / `Subagent` / `Tool` / `System` messages. Empty sessions produce an empty `Intent`. Repeated acceptance / constraint patterns are deduplicated. Every documented acceptance pattern (16 of them: `looks good`, `works`, `that's correct`, `correct`, `done`, `fixed`, `passes`, `approved`, `looks right`, `looks great`, `all good`, `that works`, `nice`, `perfect`, `exactly`, `confirmed`) and every documented constraint pattern (19 of them: `don't change`, `do not change`, `must not`, `should not`, `keep`, `maintain`, `preserve`, `never`, `don't touch`, `do not touch`, `don't modify`, `do not modify`, `only`, `but don't`, `but do not`, `without changing`, `without modifying`, `leave alone`, `leave as is`) is recognized in any user message. Labeled `Goal:` / `Objective:` / `Task:` lines win over surrounding preamble. Labeled `Constraint:` / `Requirement:` / `Boundary:` lines contribute their full text. The extractor is deterministic across calls.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

WARNING: PR title references WBS-6.2 #460 and #461 (worklog projector and OKF export adapter surfaces), but this diff removes the changelog entry for #463 (heuristic intent extractor surface). The title and actual content change are mismatched — this could mislead changelog readers about which feature's entry was removed.

If the intent was to remove #463's entry (e.g. because #481 re-adds it), the title should reference #463. If the intent was to document #460/#461, the wrong changelog entry was removed.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

@kilo-code-bot

kilo-code-bot Bot commented Aug 10, 2026

Copy link
Copy Markdown

Code Review Summary

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
WARNING 1
Issue Details (click to expand)

WARNING

File Line Issue
CHANGELOG.md 70 PR title references WBS-6.2 #460/#461 (worklog + OKF export surfaces), but the diff removes the changelog entry for #463 (heuristic intent extractor). Title/content mismatch could mislead changelog readers.
Files Reviewed (1 file)
  • CHANGELOG.md - 1 issue

Fix these issues in Kilo Cloud


Reviewed by step-3.7-flash · Input: 79.1K · Output: 5.6K · Cached: 288.1K

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

Labels

size:XL This PR changes 500-999 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants