← Back to Pull requests

Drop the empty sessions an older version archived #120

Closed
unknown closed this pull request without merging on Oct 28, 2026 08:05 UTC
View on GitHub
unknown unknown commented on Oct 28, 2026 07:49 UTC
Author

Before 0.34.2, every Claude Code subagents/workflows/wf_/journal.jsonl was indexed as an empty subagent session, with the wf_ folder as its project, and archived once deleted. #58 stopped both, but only going forward. archive_or_prune runs when a file disappears, so rows that were already archived were never looked at again. On this machine 81 such rows remained, each listed as its own wf_ project, each with a [] copy in the archive table that a rebuild would restore.

A fix-up on open, drop_empty_archives, now does what archive_or_prune has done since #58:

  • It drops an archived session that has no messages, from files, archive, touched and edits.

  • It keeps any such session the user tagged, noted or summarized.

  • It follows the existing fix-up pattern: a rowid mark in FIXUP_MARKS and apply_without_waiting.
  • Three reparse tests (codex_mcp_reparse, large_provenance_reparse, reader_fix_reparse) seeded an archived row with no messages to check that archived rows are not re-parsed. Those rows now carry one message, as a real archived session does.

    Verification:

  • New test an_empty_session_an_older_version_archived_is_dropped_on_open. It fails before the change (the journal row stays) and passes after.

  • Mutants, each caught: drop any one of the messages, tags, notes or summaries guards; keep the archive copy; don't run the fix-up.

  • The three rewritten tests still fail when their own archived_at IS NULL guard is removed, so the oracle is no weaker.

  • Real index, opened by this branch on a copy (21 GB; the copy is deleted):

  • - wf_
    projects: 81 → 0;
    - empty archive copies: 81 → 0;
    - files and archive each went down by exactly 81.
  • cargo test --no-fail-fast: 347 passed. cargo fmt --check and clippy -D warnings are clean.

  • workflow_journal.rs now serializes its two tests, which both set SESSIONWIKI_DATA.
  • AI disclosure: written with Claude Code; I reviewed and ran the checks above.

    Diff: 246 lines (+184 / -62) across 3 files Reviewer: youdie006 Review duration: 15m
    All Vouch review confidence checks passed
    Residual risk 0.17 = Change Risk (0.44) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.44 · 246 lines diff across 3 files
    0.44
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.330
    Shallow Review Depth shallow_review_depth
    0.289
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #120"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 43.9% (MEDIUM) · Higher = larger blast radius
    43.9%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 17.3% · Safe to merge
    17.3%