Skip to content

fix(daemon): persist accepted HTTP ingests - #484

Merged
KooshaPari merged 2 commits into
mainfrom
fix/sessionledger-http-ingest-persistence-20260810
Aug 12, 2026
Merged

fix(daemon): persist accepted HTTP ingests#484
KooshaPari merged 2 commits into
mainfrom
fix/sessionledger-http-ingest-persistence-20260810

Conversation

@KooshaPari

Copy link
Copy Markdown
Owner

Summary

  • route accepted OKF payloads through the durable ETL/session pipeline
  • publish SSE only after persistence and retain audit events
  • reject unsafe bundle identifiers and deduplicate repeated SQLite facts

Evidence

  • focused SQLite ingest regression: PASS 1/1
  • unsafe bundle-id regression: PASS 1/1
  • rustfmt check on owned files: PASS
  • git diff --check: PASS

Scope

Three daemon files only. Full workspace validation remains pending; this draft makes no release-readiness claim.

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: c732cff3-f3f6-4619-829b-81e34610d338

📥 Commits

Reviewing files that changed from the base of the PR and between 5d2c60c and 29b3e01.

📒 Files selected for processing (3)
  • crates/sl-daemon/src/etl.rs
  • crates/sl-daemon/src/http.rs
  • crates/sl-daemon/src/validation.rs

📝 Walkthrough

Summary

The PR persists validated HTTP ingests through the ETL pipeline before publishing SSE events. It also records audit events, rejects unsafe bundle identifiers, and deduplicates repeated SQLite facts.

The focused regression tests pass. Full workspace validation remains pending.

Must Fix

  • Run cargo test --all-features --locked.
  • Run cargo clippy --all-targets --all-features.
  • Split crates/sl-daemon/src/http.rs. The file is 2,302 lines and exceeds the repository’s 500-line limit.

Should Fix

  • Add a test for persistence failure. Verify the handler returns 500, records the audit event, and does not publish an SSE event.
  • Add an explicit test for each accepted role during HTTP-to-session conversion.

Consider

  • Confirm that created_at and token_count from PostBundle are preserved or intentionally discarded when creating session_ledger::Session.
  • Keep the SSE event contract documented as the path of the successfully written OKF file.

Approve / Request Changes

Request changes because the file-size limit is violated and the required full test and Clippy checks are not complete.

Walkthrough

Changes

Durable ingest persistence

Layer / File(s) Summary
Session export helper
crates/sl-daemon/src/etl.rs
transform_session centralizes session processing, optional memory persistence, OKF serialization, and sanitized file output.
Ingest conversion and persistence
crates/sl-daemon/src/validation.rs, crates/sl-daemon/src/http.rs
Validated bundles convert supported roles into sessions and persist through the ETL pipeline. Unsafe paths and persistence failures return structured errors. Successful writes broadcast the output path.
Durable ingest validation
crates/sl-daemon/src/http.rs
Integration tests cover durable OKF output, fact deduplication, and traversal-style bundle rejection.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested labels: size:L

✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/sessionledger-http-ingest-persistence-20260810
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch fix/sessionledger-http-ingest-persistence-20260810

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.

@KooshaPari
KooshaPari marked this pull request as ready for review August 12, 2026 07:33
Copilot AI lite review requested due to automatic review settings August 12, 2026 07:33

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.

@KooshaPari
KooshaPari merged commit 384db42 into main Aug 12, 2026
103 of 113 checks passed
@KooshaPari
KooshaPari deleted the fix/sessionledger-http-ingest-persistence-20260810 branch August 12, 2026 07:33
@coderabbitai coderabbitai Bot added the size:L This PR changes 100-499 lines, ignoring generated files label Aug 12, 2026
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