Skip to content

feat(sensor): report bounded parser health and suspected format drift - #131

Open
barisozbas wants to merge 1 commit into
wt/claude-parser-refreshfrom
wt/sensor-diagnostics
Open

barisozbas wants to merge 1 commit into
wt/claude-parser-refreshfrom
wt/sensor-diagnostics

Conversation

@barisozbas

@barisozbas barisozbas commented Sep 19, 2026

Copy link
Copy Markdown
Collaborator

Summary

Add fixed-code parser recovery counters and per-source health summaries across
all ten capture sources, including runs with no usable sessions. Keep operational
records separate from captured telemetry and export them only with --otel-config.

Rotate diagnostics.jsonl and error.log, record partial run failures, and add
--fail-on-error for schedulers that need strict exit status. Document incomplete
coverage, single-writer rotation, and unchanged legacy console output.

This change builds on #130 and should merge after it. The PR targets its feature
branch to keep the diagnostic diff separate; main-only CI will run after retargeting.

What type of PR is this?

  • Feature
  • Bug Fix
  • Documentation Update

Related issue: None; sensor health monitoring.

Why? Parsers often recover locally from bad input without reporting the
failure to operators. Zero-output runs can therefore look healthy. These records
distinguish absent input, empty capture, expected skips, corruption, partial failure,
and explicitly unsupported formats without copying captured content into error logs.

Test Plan

Synthetic tests cover partial/zero-output failures, malformed records, expected
live tails, missing inputs, log rotation, fixed-schema privacy, resource accounting,
and in-memory OTLP health serialization. No real sessions or collectors are used.

413 sensor tests pass locally on Python 3.9 and 3.12. Ruff, whitespace checks,
source/wheel builds, and pre-publish validation pass. Platform-specific DSH and
Gemini CI tests pass on Linux, macOS, and Windows; the full CI matrix requires
retargeting to main after #130 merges.

Potential risks: error.log gains a versioned health schema, and new
diagnostics.jsonl records are written even with --no-save. Rotation assumes one
active writer per output directory. Drift is a hint, not a completeness guarantee;
some recovery paths and unknown record kinds remain unclassified. Legacy console
output and old error-log entries are unchanged. Captured telemetry is not redacted
or otherwise modified by the diagnostic schema.

Revert Plan

Revert this commit to restore the previous error reporting and CLI exit behavior.
Existing diagnostic files remain on disk and can be archived by the operator.

Summary:
Add fixed-code parser recovery counters and per-source health summaries across
all ten capture sources, including runs with no usable sessions. Keep operational
records separate from captured telemetry and export them only with --otel-config.

Rotate diagnostics.jsonl and error.log, record partial run failures, and add
--fail-on-error for schedulers that need strict exit status. Document incomplete
coverage, single-writer rotation, and unchanged legacy console output.

This change builds on #130 and should merge after it. The PR targets its feature
branch to keep the diagnostic diff separate; main-only CI will run after retargeting.

Test Plan:
Synthetic tests cover partial/zero-output failures, malformed records, expected
live tails, missing inputs, log rotation, fixed-schema privacy, resource accounting,
and in-memory OTLP health serialization. No real sessions or collectors are used.

Revert Plan:
Revert this commit to restore the previous error reporting and CLI exit behavior.
Existing diagnostic files remain on disk and can be archived by the operator.
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