Skip to content

fix(crash-reporting): preserve coalesced repeat accounting - #14666

Merged
brennanb2025 merged 4 commits into
mainfrom
brennanb2025/crash-coalesced-repeat-accounting
Aug 16, 2026
Merged

brennanb2025 merged 4 commits into
mainfrom
brennanb2025/crash-coalesced-repeat-accounting

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Aug 15, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​402 $\color{#cf222e}{\Huge{\mathbf{−}}}$​3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​399
Prod 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​79 $\color{#cf222e}{\Huge{\mathbf{−}}}$​18 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​61

ELI5

When the same crash-related event fires rapidly, Orca doesn't write every occurrence —
it writes one entry plus a "repeated N times" count. Those counts are evidence: crash
investigations lean on them to tell one burst from two.

The bookkeeping had two bugs. If a crash report happened to be filed in the middle of a
burst, the report took a snapshot that included the pending repeats — and then the
normal path counted the same repeats AGAIN into the next entry, so one burst read as
two. Separately, when repeats were folded onto an entry that had itself been re-emitted
with a count, the fold overwrote the count the entry was born carrying — deleting a
window's worth of repeats from the record.

The first fix introduced a third bug worse than either: during a crash storm busy enough
to push the target entry out of the ring, the fold landed on a dead object and marked the
repeats resolved, so the burst vanished from every artifact. The reachability guard
stopped that zero-count regression, but review found one more escape hatch: TTL or LRU
cleanup could delete the deliberately unresolved state before the key emitted again.
The cleanup repair materializes only that unclaimed debt into the bounded ring before
cleanup drops the state.
Loop 2 closed the same cleanup hole for data-less breadcrumbs, where "no payload"
had been mistaken for "no pending repeat."

A cross-lane review then found that the 30-second suppression window used the wall clock.
A backward correction could stretch suppression indefinitely, while a forward correction
could collapse it early. The window now measures monotonic elapsed time; forensic ISO
timestamps remain wall-clock metadata.

What Changed

Four commits, four files (+481/−21), all in the durable breadcrumb store and its focused
tests — the path every coalesced breadcrumb producer routes through:

  • Double-claim closed: repeats resolved into a report snapshot are marked claimed,
    so the emit path no longer re-counts them into the next crumb.
  • Mirror erasure closed: a fold resolving onto a re-emitted crumb adds to the count
    that crumb was born carrying instead of overwriting it.
  • Zero-evidence orphan closed: folds check ring membership plus the retained-slot
    snapshot budget before resolving. Unreachable repeats remain unclaimed for the next
    emit; if unrelated TTL or LRU cleanup arrives first, it materializes only the unclaimed
    repeats into a fresh bounded-ring crumb before deleting the state.
  • Data-less orphan closed: omitted optional payloads now resolve from the suppression
    count, so cleanup cannot mistake missing data for missing debt.
  • Clock-robust window: suppression and TTL cleanup use monotonic elapsed time, so
    forward or backward system-clock corrections cannot shorten or extend the 30-second window.

Why

The durable breadcrumb store's repeat counts are forensic evidence — the crash sweep's
analyses read them as ground truth for how often something fired. The original defects
either inflated a burst into two or erased a window's repeats. The initial orphan guard
still allowed the same erasure when unrelated cleanup deleted the unresolved state; the
new cleanup handoff closes that final path without retaining unbounded tombstones.

Trade-offs

All three stated plainly:

  1. Semantic change — trace spans report only repeat debt not already folded into an
    earlier snapshot, and orphan-cleanup materialization emits no span.
    Report snapshots
    are cumulative immutable views, while emitted breadcrumbs are mirrored into spans;
    spans plus snapshots, or multiple snapshots, overlap by design and must not be summed
    as disjoint counts. Span-only rate analytics can miss snapshot-owned counts.
  2. Unfixed residual at ipc/crash-reporting.ts:185: if the renderer-error
    store.record rejects, the already-folded snapshot dies with it and those counts can
    no longer resurface via emit re-claim. This is disk-failure-only; a transactional
    unwind would couple the store to report-persistence outcomes across modules, judged
    disproportionate to the failure mode.
  3. Blast radius — five producers route through this store (agent_state_changed in
    index.ts, pr-refresh-validation-backoff, pr-refresh-coordinator, IPC renderer
    breadcrumbs, durable-crash-breadcrumb). Three ignore the return value. Two mirror
    real emits into trace spans; rare orphan-cleanup materialization remains breadcrumb
    evidence and does not add a forced trace flush.

Linked Issue

No tracked GitHub issue exists for this work — it originates from the #orca-crashes
field sweep of 2026-08-13/14. The defects were found while reviewing the sibling
external-kill-correlation branch (whose durable audit breadcrumbs depend on these counts
being exact) and split out on that reviewer's recommendation.

PR #14667 intentionally remains store-free and depends on this PR landing first. It is
blocked on this monotonic-window guarantee because its durable defer-time breadcrumbs route
through this store.

Visual Proof

No rendered interaction change. Grok's Electron/CDP launch smoke is attached in
#14666 (comment); unit-level accounting
evidence is the acceptance signal for this main-process-only change.

Testing

  • Post-rebase branch HEAD, one single-file Vitest invocation at a time: 102/102 across
    13 focused files: store 21, orphan cleanup 6, bounded-map leak 3, six upstream-split PR
    refresh coordinator shards 35, PR validation backoff 3, IPC renderer breadcrumbs 18,
    durable breadcrumbs 3, and process-gone recorder 13.

  • Clock mutation: replacing only the monotonic source with Date.now() yields
    2 failed | 19 passed: backward correction suppresses the required emit and forward
    correction emits early. Restoring performance.now() yields 21 passed.

  • The cleanup blocker is pinned as a four-case matrix: TTL expiry and LRU eviction
    after both full ring eviction and retained-slot snapshot-budget orphaning.

  • Partial claims are pinned: cleanup materializes only repeats not
    already folded into an earlier snapshot, and a later key emit starts with zero debt.

  • tsc --noEmit -p config/tsconfig.node.json, targeted oxlint, targeted oxfmt --check,
    and git diff --check pass after rebasing onto current origin/main.

  • The earlier 38-mutant battery predates the cleanup fix and is not claimed as validation
    for the new path; the focused regressions above replace the previously documented LRU
    survivor assumption that this review disproved.

  • I manually tested these changes locally — not applicable to a main-process-only
    accounting fix; no live crash storm was induced.

  • Automated tests added/updated, or explained why not below

AI Disclosure

Adversarial Review

Earlier review loops on the sibling work found the original double-claim and the first
fix's zero-evidence orphan, which led to splitting this store change into its own PR.
Adversarial review loop 1 on this PR then reproduced the remaining TTL/LRU state-deletion
blocker, added the four cleanup/orphan regressions plus a partial-claim debt-transfer case,
and drove the bounded materialization fix that now ships.
Adversarial review loop 2 then caught the optional-data contract hole in that cleanup
path, added data-less fold/orphan regressions, and clarified that immutable report
snapshots and their mirrored trace spans overlap by design.
Adversarial review loop 3 was reopened by a cross-lane clock finding, drove the monotonic
window plus backward/forward regressions and producer test-seam correction, and returned
CLEAN on the final diff.

Review

Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH,
Mobile, general backwards compatibility, performance

  • Security: no new inputs or surface; pending producer data still passes through the
    existing sanitizer before entering evidence.
  • Cross-platform (Linux/Windows/Mac): performance.now() provides per-process
    monotonic elapsed time on every target; no platform-conditional path is added.
  • Remote SSH and folder workspaces: producers can originate from either context, but
    accounting remains local main-process state with no path, Git, or wire-format change.
  • Mobile: not affected.
  • Backwards compatibility: crumb shapes and fields are unchanged; only repeat
    attribution changes. Span-only rate analytics retain trade-off (1).
  • Performance: the state map remains capped at 128, the ring at 30, and the retained
    map at 4. Each call replaces one wall-clock read with one monotonic-clock read; steady
    suppression still allocates nothing new, and only rare orphan cleanup performs one
    sanitized ring write before deleting the state.

Checklist

  • This PR is small and focused
  • I explained what changed and why (including ELI5)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover;
    local preferred) — focused lint/format, node typecheck, and tests pass locally;
    full commands were not run and are left to CI.

Author

  • X / Twitter: @BrennanKB5

@coderabbitai

coderabbitai Bot commented Aug 15, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The breadcrumb store now uses monotonic time and tracks carried, resolved, and unresolved suppression counts. Emissions claim only unresolved repeats. Snapshot resolution checks whether the breadcrumb remains visible. Cleanup materializes unresolved repeats when the breadcrumb becomes unavailable. Tests cover time jumps, data-less folding, re-emissions, snapshot folds, ring eviction, snapshot-budget limits, unrelated cleanup, LRU eviction, and timer isolation.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is detailed and covers the main sections, but it does not provide the required linked GitHub issue. Add a valid GitHub issue reference in the Linked Issue section, using the required Fixes #123`` format.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly identifies the crash-reporting change to preserve coalesced repeat accounting.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/main/crash-reporting/crash-breadcrumb-store.ts (1)

119-128: 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

Preserve orphaned repeats before deleting the coalesced state.

Lines 184-187 leave repeats unresolved when the crumb is no longer in snapshot evidence. Lines 119-128 and 142-148 then delete that state during expiry or LRU cleanup.

A later event with the same coalesceKey has no previous state. It emits with suppressedSinceLast: 0, so the unresolved repeats are lost.

Keep orphaned repeat state until the next same-key emission, or emit a new visible fallback breadcrumb before cleanup deletes the state. Add coverage for both expiry cleanup and MAX_COALESCE_KEYS eviction after ring or snapshot-budget eviction.

Also applies to: 142-148, 184-187


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: bbf0b5e7-b3a7-4acf-a203-3073cfcbe550

📥 Commits

Reviewing files that changed from the base of the PR and between 73bbe20 and dcbfbab.

📒 Files selected for processing (2)
  • src/main/crash-reporting/crash-breadcrumb-store.test.ts
  • src/main/crash-reporting/crash-breadcrumb-store.ts

@brennanb2025
brennanb2025 force-pushed the brennanb2025/crash-coalesced-repeat-accounting branch 2 times, most recently from 2370cd2 to 4f6f0f5 Compare August 15, 2026 05:53
@brennanb2025 brennanb2025 changed the title fix(crash-reporting): attribute coalesced repeats exactly once fix(crash-reporting): preserve coalesced repeat accounting Aug 15, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/main/crash-reporting/crash-breadcrumb-store.test.ts (1)

336-338: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Reduce repeated test narration.

The test names and assertions already define these scenarios. Replace necessary rationale with one concise line. Remove comments that only restate the test flow.

  • src/main/crash-reporting/crash-breadcrumb-store.test.ts#L336-L338: reduce to one line about avoiding double-counting snapshot-resolved repeats.
  • src/main/crash-reporting/crash-breadcrumb-store.test.ts#L364-L365: remove or reduce to one line about counting only new repeats.
  • src/main/crash-reporting/crash-breadcrumb-store.test.ts#L374-L375: reduce to one line about preserving carried counts.
  • src/main/crash-reporting/crash-breadcrumb-store.test.ts#L402-L405: reduce to one line about ring-evicted breadcrumbs.
  • src/main/crash-reporting/crash-breadcrumb-store.test.ts#L435-L437: reduce to one line about snapshot-budget exclusion.
  • src/main/crash-reporting/crash-breadcrumb-store.test.ts#L459-L460: reduce to one line about the retained-slot budget.
  • src/main/crash-reporting/crash-breadcrumb-store.test.ts#L471-L472: reduce to one line about immutable snapshots.
  • src/main/crash-reporting/crash-breadcrumb-store.test.ts#L501-L502: reduce to one line about fresh-window repeat counts.

As per coding guidelines, “Comments must be concise, non-obvious, and brief—prefer one line.”

Source: Coding guidelines


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d958f645-daba-4f63-9fad-f8402c4a26b3

📥 Commits

Reviewing files that changed from the base of the PR and between dcbfbab and 4f6f0f5d31cc5c7843124f0dbe91912deceb7cc4.

📒 Files selected for processing (3)
  • src/main/crash-reporting/crash-breadcrumb-store-orphan-cleanup.test.ts
  • src/main/crash-reporting/crash-breadcrumb-store.test.ts
  • src/main/crash-reporting/crash-breadcrumb-store.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/main/crash-reporting/crash-breadcrumb-store.ts

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Electron launch-smoke (exact head 4f6f0f5d31cc5c7843124f0dbe91912deceb7cc4)

This PR is a main-process coalesced-breadcrumb accounting change with no user-visible UI. Functional confidence is from the focused unit tests in src/main/crash-reporting/crash-breadcrumb-store.ts and the two colocated test files. This comment is launch-smoke proof only — not a functional re-validation of repeat accounting.

Launch: pnpm dev with REMOTE_DEBUGGING_PORT=9588 and isolated ORCA_DEV_USER_DATA_PATH=/tmp/orca-pr14666-qa/profile. Connected via agent-browser CDP only. Renderer document.readyState=complete, empty-workspace shell visible, Help menu opened/closed (responsive). No product files edited.

pr-14666-4f6f0f5d-launch-smoke.png

Local path: /tmp/orca-pr14666-qa/screenshots/pr-14666-4f6f0f5d-launch-smoke.png

@brennanb2025
brennanb2025 force-pushed the brennanb2025/crash-coalesced-repeat-accounting branch from 4f6f0f5 to 03a3c73 Compare August 15, 2026 06:01
@brennanb2025

Copy link
Copy Markdown
Contributor Author

Electron launch-smoke (exact head 03a3c73ac6b8e1d737a3aac96781847879920d31)

This PR is a main-process coalesced-breadcrumb accounting change with no user-visible UI. Functional confidence remains the focused unit tests in src/main/crash-reporting/crash-breadcrumb-store.ts and its colocated tests. This comment is launch-smoke proof only — not a functional re-validation of repeat accounting.

Launch: exact worktree HEAD 03a3c73ac6b8e1d737a3aac96781847879920d31 via config/scripts/run-electron-vite-dev.mjs with REMOTE_DEBUGGING_PORT=9333, isolated ORCA_DEV_USER_DATA_PATH=/tmp/orca-pr14666-qa-03a3c73/profile, and renderer 127.0.0.1:5175. Connected via a unique agent-browser --session pr14666qa-03a3c73 --cdp 9333 session only. Identity: pr-14666-repeat-accounting @ brennanb2025/crash-coalesced-repeat-accounting. Renderer document.readyState=complete, empty isolated workspace (repos=0, "No workspaces found"), Help menu opened then closed (responsive). No product files edited; screenshot not committed.

pr-14666-03a3c73-launch-smoke.png

@brennanb2025
brennanb2025 force-pushed the brennanb2025/crash-coalesced-repeat-accounting branch 3 times, most recently from b93da7e to d760fec Compare August 15, 2026 23:40
@coderabbitai

coderabbitai Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Electron launch-smoke (exact head 5f14e7b477fe44b32930c507d10cd326e9bc28d3)

Revalidation of the current pushed PR head after the monotonic-clock commit and later rebases. This supersedes the earlier launch-smoke evidence at #14666 (comment) (head 03a3c73ac6b8e1d737a3aac96781847879920d31).

This PR is a main-process coalesced-breadcrumb accounting change with no user-visible UI. Functional confidence remains the focused unit tests in src/main/crash-reporting/crash-breadcrumb-store.ts and its colocated tests. This comment is launch-smoke proof only — not a functional re-validation of repeat accounting.

Launch (isolated, exact head): config/scripts/run-electron-vite-dev.mjs with REMOTE_DEBUGGING_PORT=9361, isolated ORCA_DEV_USER_DATA_PATH=/tmp/orca-pr14666-qa-5f14e7b/profile, renderer dev server on 127.0.0.1:5175, distinct dock title Orca: pr-14666 5f14e7b. Launcher identity: pr-14666 @ 5f14e7b. Connected via agent-browser --session pr14666-5f14e7b --cdp 9361 only — no computer-use, no desktop automation.

Validated:

  • CDP reachable on 127.0.0.1:9361 (Chrome/150, Electron/43.1.0); single renderer target: title Orca, url http://localhost:5175/.
  • Renderer document.readyState=complete, #root mounted, no fatal/crash overlay selector present.
  • Main UI rendered: sidebar with projects/workspaces, empty isolated workspace (repos=0, "No workspaces found", "Add a project to get started"), onboarding checklist, right sidebar, usage strip.
  • Responsiveness: Help menu opened (aria-expanded=true) and closed; no hang.
  • Launcher log: no uncaught exception, crash, or fatal error. Benign notes only: terminal_liveness_unavailable orchestration recovery (fresh empty profile, no workspace/terminal exists) and an Electron MaxListenersExceededWarning (dev-mode noise).

Screenshots (hosted as clickable links — GitHub's token-accessible upload endpoints cannot serve inline images to comments; local copies kept at /tmp/orca-pr14666-qa-5f14e7b/):

Screenshots not committed; worktree clean before and after.

@brennanb2025
brennanb2025 force-pushed the brennanb2025/crash-coalesced-repeat-accounting branch from 5f14e7b to 0a21167 Compare August 16, 2026 18:34
@coderabbitai

coderabbitai Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 91b59451-4f9c-4bb0-99b7-80138c44b2bf

📥 Commits

Reviewing files that changed from the base of the PR and between 516a269 and 0a21167592c79ec63f92ef90d97a88f03763659b.

📒 Files selected for processing (4)
  • src/main/crash-reporting/crash-breadcrumb-store-orphan-cleanup.test.ts
  • src/main/crash-reporting/crash-breadcrumb-store.test.ts
  • src/main/crash-reporting/crash-breadcrumb-store.ts
  • src/main/crash-reporting/process-gone-recorder.test.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • src/main/crash-reporting/process-gone-recorder.test.ts
  • src/main/crash-reporting/crash-breadcrumb-store.ts
  • src/main/crash-reporting/crash-breadcrumb-store.test.ts

Included review availability: Your plan includes up to 10 reviews per rolling hour; 1 remains after this review.

for (let index = 0; index < 30; index += 1) {
recordCrashBreadcrumb(`renderer_error_${index}`, { index })
}
getCrashBreadcrumbSnapshot()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Do not resolve the orphan before cleanup.

getCrashBreadcrumbSnapshot() resolves pending coalesced breadcrumbs before it builds the snapshot. These calls can materialize the repeats before the expiry or LRU trigger runs. The tests can then pass if cleanup does not preserve orphaned repeats.

Remove these snapshot calls. Take the snapshot only in the expectation helper.

Proposed fix
 function orphanFromRing(): void {
   for (let index = 0; index < 30; index += 1) {
     recordCrashBreadcrumb(`renderer_error_${index}`, { index })
   }
-  getCrashBreadcrumbSnapshot()
 }

 function orphanFromSnapshotBudget(): void {
   // ...
-  getCrashBreadcrumbSnapshot()
 }

Also applies to: 54-54

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Electron launch-smoke (exact head 0a21167592c79ec63f92ef90d97a88f03763659b)

Revalidation of the current pushed PR head. This supersedes the earlier launch-smoke evidence at #14666 (comment) (head 03a3c73ac6b8e1d737a3aac96781847879920d31) and at #14666 (comment) (head 5f14e7b477fe44b32930c507d10cd326e9bc28d3).

This PR is a main-process coalesced-breadcrumb accounting change with no user-visible UI. Functional confidence remains the focused unit tests in src/main/crash-reporting/crash-breadcrumb-store.ts and its colocated tests. This comment is launch-smoke proof only — not a functional re-validation of repeat accounting.

Launch (isolated, exact head): config/scripts/run-electron-vite-dev.mjs with REMOTE_DEBUGGING_PORT=9383, isolated ORCA_DEV_USER_DATA_PATH=/tmp/orca-pr14666-qa-0a21167/profile, renderer dev server on 127.0.0.1:5175, distinct dock title Orca: pr-14666 0a21167. Launcher identity: pr-14666 @ 0a21167. Connected via agent-browser --session pr14666-0a21167 --cdp 9383 only — no computer-use, no desktop automation.

Validated:

  • CDP reachable on 127.0.0.1:9383 (Chrome/150); single renderer target: title Orca, url http://localhost:5175/.
  • Renderer document.readyState=complete, #root mounted, no fatal/crash overlay selector present.
  • Main UI rendered: sidebar with projects/workspaces, empty isolated workspace (repos=0, "No workspaces found", "Add a project to get started"), onboarding checklist, right sidebar, usage strip.
  • Responsiveness: Help menu opened (aria-expanded=true) and closed; no hang.
  • Launcher log: no uncaught exception, crash, or fatal error. Benign notes only: terminal_liveness_unavailable orchestration recovery (fresh empty profile, no workspace/terminal exists), an Electron MaxListenersExceededWarning (dev-mode noise), and a transient claude-rate-limits 429 usage-refresh backoff.

Screenshots (hosted as clickable links — GitHub's token-accessible upload endpoints cannot serve inline images to comments; local copies kept at /tmp/orca-pr14666-qa-0a21167/):

Screenshots not committed; worktree clean before and after.

Two ways one burst's suppressed repeats were misattributed in forensics,
found across two adversarial review loops on the sibling-correlation work
but pre-dating it (the coalesce machinery shipped in #8800/#5818/#10729):

- Double-claim: a crash report filed mid-window snapshots the ring, folding
  the suppressed repeats into the emitted crumb — but the next emit still
  re-claimed those repeats in its suppressedSinceLast, reporting one burst
  twice across two crumbs.
- Mirror erasure: a fold resolving onto a re-emitted crumb overwrote the
  count that crumb was born carrying, deleting the previous window's repeats.

Track what each crumb has claimed (carried at emit, resolved by folds) so
every repeat is attributed exactly once. And never resolve into an evicted
crumb: when a storm pushes the burst crumb out of the 30-entry ring — or
past the retained-slot snapshot budget — mid-window, folding there would
mark the repeats claimed by evidence no snapshot can see and the burst
would vanish from the record entirely; drop the handle so the next emit
claims them instead.

Semantic note for trace-mirroring consumers: the returned
suppressedSinceLast is now net of already-folded repeats, so exactly-once
holds over the union of trace spans and report snapshots rather than
within the trace stream alone.
@brennanb2025
brennanb2025 force-pushed the brennanb2025/crash-coalesced-repeat-accounting branch from 0a21167 to 2693c19 Compare August 16, 2026 19:02
@brennanb2025

Copy link
Copy Markdown
Contributor Author

Electron launch-smoke (exact head 2693c19d17caa3ffceef0619b019e3d2105a7f1c)

Revalidation of the current pushed PR head after the latest rebase onto origin/main (bf6dc6fcbac2c425acc27ba1c2901711f6be446b). This supersedes all earlier launch-smoke evidence: #14666 (comment) (head 03a3c73ac6b8e1d737a3aac96781847879920d31), #14666 (comment) (head 5f14e7b477fe44b32930c507d10cd326e9bc28d3), and #14666 (comment) (head 0a21167592c79ec63f92ef90d97a88f03763659b).

This PR is a main-process coalesced-breadcrumb accounting change with no user-visible UI. Functional confidence remains the focused unit tests in src/main/crash-reporting/crash-breadcrumb-store.ts and its colocated tests. This comment is launch-smoke proof only — not a functional re-validation of repeat accounting.

Launch (isolated, exact head): config/scripts/run-electron-vite-dev.mjs with REMOTE_DEBUGGING_PORT=9401, isolated ORCA_DEV_USER_DATA_PATH=/tmp/orca-pr14666-qa-2693c19/profile, renderer dev server on 127.0.0.1:5175, distinct dock title Orca: pr-14666 2693c19. Launcher identity: pr-14666 @ 2693c19. Connected via agent-browser --session pr14666-2693c19 --cdp 9401 only — no computer-use, no desktop automation.

Validated:

  • CDP reachable on 127.0.0.1:9401; single renderer target: title Orca, url http://localhost:5175/.
  • Renderer document.readyState=complete, #root mounted, no fatal/crash overlay selector present.
  • Main UI rendered: sidebar with projects/workspaces, empty isolated workspace (repos=0, "No workspaces found", "Add a project to get started"), onboarding checklist, right sidebar, usage strip.
  • Responsiveness: Help menu opened (aria-expanded=true, 11 menuitems visible) and closed (aria-expanded=false); no hang.
  • Launcher log: no uncaught exception, crash, or fatal error. Benign notes only: terminal_liveness_unavailable orchestration recovery (fresh empty profile, no workspace/terminal exists), an Electron MaxListenersExceededWarning (dev-mode noise), and a transient claude-rate-limits 429 usage-refresh backoff.

Screenshots (hosted as clickable links — GitHub's token-accessible upload endpoints cannot serve inline images to comments; local copies kept at /tmp/orca-pr14666-qa-2693c19/):

Screenshots not committed; worktree clean before and after.

@brennanb2025
brennanb2025 merged commit f4319ba into main Aug 16, 2026
45 checks passed
AmethystLiang pushed a commit that referenced this pull request Aug 17, 2026
* fix(crash-reporting): attribute coalesced repeats exactly once

Two ways one burst's suppressed repeats were misattributed in forensics,
found across two adversarial review loops on the sibling-correlation work
but pre-dating it (the coalesce machinery shipped in #8800/#5818/#10729):

- Double-claim: a crash report filed mid-window snapshots the ring, folding
  the suppressed repeats into the emitted crumb — but the next emit still
  re-claimed those repeats in its suppressedSinceLast, reporting one burst
  twice across two crumbs.
- Mirror erasure: a fold resolving onto a re-emitted crumb overwrote the
  count that crumb was born carrying, deleting the previous window's repeats.

Track what each crumb has claimed (carried at emit, resolved by folds) so
every repeat is attributed exactly once. And never resolve into an evicted
crumb: when a storm pushes the burst crumb out of the 30-entry ring — or
past the retained-slot snapshot budget — mid-window, folding there would
mark the repeats claimed by evidence no snapshot can see and the burst
would vanish from the record entirely; drop the handle so the next emit
claims them instead.

Semantic note for trace-mirroring consumers: the returned
suppressedSinceLast is now net of already-folded repeats, so exactly-once
holds over the union of trace spans and report snapshots rather than
within the trace stream alone.

* fix(crash-reporting): preserve orphaned repeat debt on cleanup

* fix(crash-reporting): preserve data-less repeat debt

* fix(crash-reporting): make coalescing window monotonic
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…14666)

* fix(crash-reporting): attribute coalesced repeats exactly once

Two ways one burst's suppressed repeats were misattributed in forensics,
found across two adversarial review loops on the sibling-correlation work
but pre-dating it (the coalesce machinery shipped in stablyai#8800/stablyai#5818/stablyai#10729):

- Double-claim: a crash report filed mid-window snapshots the ring, folding
  the suppressed repeats into the emitted crumb — but the next emit still
  re-claimed those repeats in its suppressedSinceLast, reporting one burst
  twice across two crumbs.
- Mirror erasure: a fold resolving onto a re-emitted crumb overwrote the
  count that crumb was born carrying, deleting the previous window's repeats.

Track what each crumb has claimed (carried at emit, resolved by folds) so
every repeat is attributed exactly once. And never resolve into an evicted
crumb: when a storm pushes the burst crumb out of the 30-entry ring — or
past the retained-slot snapshot budget — mid-window, folding there would
mark the repeats claimed by evidence no snapshot can see and the burst
would vanish from the record entirely; drop the handle so the next emit
claims them instead.

Semantic note for trace-mirroring consumers: the returned
suppressedSinceLast is now net of already-folded repeats, so exactly-once
holds over the union of trace spans and report snapshots rather than
within the trace stream alone.

* fix(crash-reporting): preserve orphaned repeat debt on cleanup

* fix(crash-reporting): preserve data-less repeat debt

* fix(crash-reporting): make coalescing window monotonic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant