[0.41.0] - 2026-04-28
Added
- Content-sidecar enrichments for the four waste-pattern detectors (#57). When
DetectPatternsOptions.contentBySessionis supplied,detectPatternsnow populates four optional fields that make detector reports significantly more actionable:RetryLoop.errorSignature?(leading error line shared across retriedtool_results, or the first attempt's signature with" (signatures diverged)"appended when they don't all match),FailureRun.errorSignatures?(one{ tool, firstLine }entry per distinct tool, in first-seen order),CompactionLoss.lostWork?({ files, bashCount, editCount, readCount }aggregated across the window between the previouscompact_boundaryand this one), andEditRevertCycle.samplePreview?(truncatedold_string/new_stringpreviews for both anchor edits, capped at ~200 chars per field). Detectors fire identically when content is not supplied — only the enrichment fields are absent, honoring the spec's graceful-degradation contract forcontent.store=hash-onlysessions. Thefindings.tsadapters fold these fields intoWasteFinding.title/WasteFinding.detailso they surface inburn wasteandburn diagnose --json. WasteFinding/WasteActionstructured envelope (#56). Introduces a common shape —{ kind, severity, sessionId, title, detail, estimatedSavings, actions }— that wraps every detector result inPatternsResult(RetryLoop,FailureRun,CompactionLoss,EditRevertCycle,EditHeavySession,SkillRecallDup,SkillPruningProtection,SystemPromptTax). New exports:findingsFromPatterns(result)to roll the wholePatternsResultinto a single severity-ranked list, plus per-detector adapters (retryLoopToFinding,failureRunToFinding,compactionLossToFinding,editRevertToFinding,editHeavyToFinding,skillRecallDupToFinding,skillPruningProtectionToFinding,systemPromptTaxToFinding) andsortFindings. Severity is tiered offusdPerSession(≥ $0.50 high, ≥ $0.05 warn, else info); edit-heavy is capped at warn since its cost overlaps retry/revert findings.WasteActionis a closed union (paste/command/file-content) so a futureburn waste --applycan drive a confirmation-gated apply pipeline against typed actions instead of scraping strings. The narrow per-detector result types remain exported for downstream consumers that want them.