Skip to content

fix(sessions): preserve every distinct history blocker - #4715

Closed
ScriptedAlchemy wants to merge 1 commit into
masterfrom
fix/history-blocker-diagnostics
Closed

ScriptedAlchemy wants to merge 1 commit into
masterfrom
fix/history-blocker-diagnostics

Conversation

@ScriptedAlchemy

@ScriptedAlchemy ScriptedAlchemy commented Nov 3, 2026 •

Copy link
Copy Markdown
Owner

Root cause

pass_reason_code retained only the first matching failure for each provider with BTreeMap::entry(...).or_insert(...). A provider reporting an invalid observation followed by projection_store_corrupt therefore lost the corruption reason before the worker logged the outcome or published its typed serving status. Source order could change the operator-visible diagnosis while the actual failures were identical.

Change

Collect distinct (provider, reason) pairs in canonical order rather than one reason per provider. Preserve raw codes for single-provider passes and existing provider-qualified codes for multi-provider passes. Duplicate failures do not repeat the same reason. Nonretryable failures still take precedence over retryable siblings, and healthy-provider progress remains intact.

This is the existing history-outcome/status path; no new event store, timer, retry policy, wire field, authorization rule, or recovery mechanism is introduced.

Regression coverage

Added three behavioral tests through the real outcome classifier:

  • Multiple terminal failures from one provider retain corruption in either source order, deduplicate repeated failures, reach the actual SessionTemporalRefreshWakeState serving-status handle, and clear on a subsequent Complete outcome.
  • Multiple retryable failures from one provider retain every distinct reason in stable order without changing retry classification.
  • Mixed providers preserve qualified terminal reasons and committed progress while excluding retryable siblings from the blocked diagnosis.

Existing single-reason, mixed-provider, progress, and retry tests remain unchanged.

Verification

Reviewed the project/profile ingestors, outcome classifier, worker consumer, and typed status mapping. The complete GitHub-generated commit diff changes only reason aggregation, its documentation, test imports, and the three added regressions.

No local compilation, rustfmt, Clippy, or test execution is claimed. This environment has no supplied checkout, Bazel, rustc, or rustfmt, and direct source downloads fail DNS. No Cargo commands were run. Hosted Bazel CI must validate //crates/tracedecay-session-runtime:unit_test and the affected session/status journeys before merge.

Refs #4569 (corrupt-store visibility). This fixes information loss in the existing status path; it does not implement relational-store rebuild, prove a production corruption recovery, or complete Doctor's remaining recovery guidance. Keep the issue open.


Devin Review

@changeset-bot

changeset-bot Bot commented Nov 3, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: e8b0972

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@devin-ai-integration devin-ai-integration 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.

🔍 Devin Review: 1 flag

Not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)

Devin Review

@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

Consolidated into #4742 (integrate/open-pull-requests) at the captured head shown in its description, as requested. Continue review and further fixes on #4742. This closure does not assert CI readiness; the replacement remains draft. Source branch retained.

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