Skip to content

fix(daemon): classify raw failure lifecycle - #3743

Closed
Sinity wants to merge 1 commit into
masterfrom
feature/fix/raw-failure-convergence
Closed

fix(daemon): classify raw failure lifecycle#3743
Sinity wants to merge 1 commit into
masterfrom
feature/fix/raw-failure-convergence

Conversation

@Sinity

@Sinity Sinity commented Aug 4, 2026

Copy link
Copy Markdown
Owner

Summary

Classifies retained raw parse outcomes as deferred, terminal, or unexplained and exposes those counts through daemon and stopped-daemon status. Adds a committed read-only preflight for the 112 observed failures.

Problem

The stopped daemon exposed 111 raw parse failures and one maintenance failure as a single failure bucket. Empty payloads and unsupported parser results could consume cursor retries without typed terminal evidence, while an incomplete hot capture lacked a structural proof requirement for deferral.

Solution

The full-ingest writer records closed source-tier artifact evidence after retaining a raw failure. A growing source must hash-match the captured payload prefix before it receives deferred_hot_jsonl_capture; static incomplete input becomes terminal_corrupt_input; empty or unsupported input becomes terminal_unsupported_shape. Daemon and direct CLI status report deferred retryable, terminal, and unexplained counts separately. The preflight records aggregate evidence only and makes post-deploy processing contingent on a verified backup and reviewed dry-run.

Acceptance criteria

Criterion Status
Read-only census of all 112 failures Satisfied by docs/audits/2026-08-04-raw-failure-preflight.md; raw IDs and private paths are omitted.
Ingest-route lifecycle regression and red twins Satisfied by the full-ingest empty, static-incomplete, and proven-hot-prefix tests.
Stopped-daemon lifecycle status Satisfied by daemon status, health, and direct CLI fallback coverage.
Production-data safety and post-deploy control No production archive mutation occurred. The report requires backup-gated dry-run and apply receipts before a future operator run.

Verification

POLYLOGUE_ARCHIVE_ROOT=/realm/db/polylogue polylogue status --format json ran read-only against the stopped daemon and reported daemon_liveness: false, 111 unexplained raw failures, and zero typed deferred or terminal historical rows.

python -m devtools test tests/unit/sources/test_live_batch_support.py::test_full_ingest_empty_jsonl_is_not_misclassified_as_truncated tests/unit/sources/test_live_batch_support.py::test_full_ingest_defers_incomplete_jsonl_only_after_hot_prefix_proof tests/unit/sources/test_live_batch_support.py::test_full_ingest_rejects_incomplete_jsonl_without_hot_prefix_proof tests/unit/daemon/test_raw_failure_sample.py::TestRawFailureInfoProducesTypedSamples::test_raw_failure_info_separates_closed_lifecycle_evidence tests/unit/daemon/test_health_check_paths.py::test_raw_failures_marks_deferred_work_retryable_not_unexplained tests/unit/cli/test_status.py::TestNoArchiveStatus::test_direct_status_json_keeps_stopped_daemon_lifecycle_visible passed 6 tests.

python -m devtools verify --quick exited 0, including ruff, mypy, generated-surface, layering, schema, manifest, workflow, and documentation gates. The ordinary affected-test verification could not be seeded in this linked worktree because the repository testmon seed writes its attempt record before the checkout-provenance marker required by pytest; focused route tests provide the test evidence for this PR.

Adversarial review notes

No completed iteration was recorded. Two read-only local reviewer attempts were stopped after the nested runtime failed to return a verdict or final artifact; neither modified the checkout or production archive.

Problem
Stopped daemon convergence presented retained hot captures, terminal input
rejections, and unexplained parser failures as one retryable failure bucket.

What changed
Record closed source-tier evidence for deferred hot JSONL captures and terminal
corrupt or unsupported payloads. Surface the lifecycle in daemon and direct
CLI status, with a read-only preflight census and production-route tests.

Compatibility
Existing raw rows remain unexplained until a reviewed post-deploy route records
new typed evidence. No archive data, cursor, or blob was mutated.

Co-Authored-By: Codex <noreply@openai.com>
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@Sinity, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 19 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: f1be780b-57b3-478f-a100-45efd0ee3c77

📥 Commits

Reviewing files that changed from the base of the PR and between 14d5511 and 4af5aaa.

📒 Files selected for processing (18)
  • devtools/docs_surface.py
  • docs/README.md
  • docs/audits/2026-08-04-raw-failure-preflight.md
  • docs/audits/README.md
  • docs/plans/layering.yaml
  • polylogue/cli/commands/status.py
  • polylogue/core/raw_failure_evidence.py
  • polylogue/daemon/health.py
  • polylogue/daemon/status.py
  • polylogue/daemon/status_snapshot.py
  • polylogue/sources/live/batch.py
  • polylogue/storage/sqlite/archive_tiers/archive.py
  • polylogue/storage/sqlite/archive_tiers/revision_governance.py
  • polylogue/storage/sqlite/archive_tiers/source_write.py
  • tests/unit/cli/test_status.py
  • tests/unit/daemon/test_health_check_paths.py
  • tests/unit/daemon/test_raw_failure_sample.py
  • tests/unit/sources/test_live_batch_support.py

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.

@Sinity

Sinity commented Aug 4, 2026

Copy link
Copy Markdown
Owner Author

Superseded by #3746, which carries the lifecycle classification plus replay and active-pointer status corrections.

@Sinity Sinity closed this Aug 4, 2026
@Sinity
Sinity deleted the feature/fix/raw-failure-convergence branch August 10, 2026 13:11
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