Skip to content

feat(vitals): persist comparable error-cluster reports - #28

Open
TimeToBuildBob wants to merge 2 commits into
ActivityWatch:masterfrom
TimeToBuildBob:feat/crash-cluster-reports
Open

feat(vitals): persist comparable error-cluster reports#28
TimeToBuildBob wants to merge 2 commits into
ActivityWatch:masterfrom
TimeToBuildBob:feat/crash-cluster-reports

Conversation

@TimeToBuildBob

@TimeToBuildBob TimeToBuildBob commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

vitals.py errors currently prints transient prose, so release owners cannot compare Play error clusters across collections or retain triage decisions. This adds versioned JSON and ranked Markdown output plus a daily consumer that preserves every snapshot and compares counts by the authoritative Play issue ID.

The collector uses explicit UTC query windows, requests count ordering, follows pagination, and records selection truncation. Missing clusters mean “not observed”; overlapping-window count changes and sample versions do not prove a release fixed an issue. Severity stays unclassified. Only reports without a Play issue ID use the versioned structural fingerprint.

--update-dir saves current JSON/Markdown and immutable, atomically published history. Optional identity-keyed dispositions survive refreshes in a separate file. Sample output retains structural frames and timestamp/version provenance; raw report text, device data, and credentials are excluded. The existing scheduled Play workflow collects a seven-day top-100 report and removes its temporary credential on failure.

Validation:

  • uv run ruff check ., uv run mypy *.py, and all 56 tests pass.
  • Fixtures cover managed NPE, nested Android inflation, JNI/native abort, and an explicitly synthetic Rust backtrace; tests cover noise invariance, identity preservation, persistence, pagination, missing IDs, corrupt archives, and failed API collection.
  • Two live read-only Play collections: 49 issues and 49 samples each, all IDs stable, no truncation, zero count deltas across the two seven-day windows (ending 04:00Z and 05:00Z), and both immutable histories retained. No live reports or credentials are committed.
  • Workflow YAML and shell blocks checked; injected collector failure propagated and cleaned up the dummy credential.

The quality gate flagged shared-file overlap with #25; that PR adds rate-by-version metrics and freshness warnings, while this change covers the separate errorIssues/errorReports path.

Related to #17 and ActivityWatch/aw-android#176. This does not close the broader data-collection tracker.

@greptile-apps

greptile-apps Bot commented Sep 8, 2026

Copy link
Copy Markdown

Greptile Summary

This PR adds persistent, comparable Android Play error-cluster reporting.

  • Collects paginated, count-ranked issues using explicit UTC windows.
  • Produces sanitized, versioned JSON and operator-facing Markdown reports.
  • Retains immutable history and identity-keyed triage dispositions.
  • Adds structural fallback signatures for reports lacking Play issue IDs.
  • Extends the scheduled workflow to collect reports and clean up credentials.
  • The revision since the previous review stages both current reports and restores the prior pair if publication is interrupted.

Confidence Score: 5/5

The PR appears safe to merge; the previously reported inconsistent current-report publication has been fully fixed and no actionable new failure remains.

The revised publisher stages each artifact, preserves existing versions as backups, and restores the previous pair or removes a first-time partial when the second replacement fails. The accompanying tests cover both refresh rollback and first publication failure. No repository-rule violations or accepted new correctness or security findings remain.

Important Files Changed

Filename Overview
crash_reports.py Builds, compares, renders, archives, and transactionally publishes sanitized error-cluster snapshots; the previous current-report consistency finding is fully addressed.
vitals.py Adds bounded UTC error collection, pagination, sample retrieval, structured output, comparison, and persistence options.
crash_signatures.py Adds versioned structural normalization and fallback fingerprints while excluding unparsed report prose.
.github/workflows/collect-play.yml Adds daily error-report collection, stages generated artifacts, and removes the temporary credential through an exit trap.
test_crash_reports.py Covers API pagination, snapshot contracts, history, dispositions, failures, and rollback of partial current-report publication.
test_crash_signatures.py Verifies stable signatures, structural discrimination, and exclusion of incidental or private report content.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Scheduled or manual errors command] --> B[Query Play error issues]
  B --> C[Fetch optional samples]
  C --> D[Normalize structural traces]
  D --> E[Build versioned snapshot]
  E --> F[Compare with current baseline]
  F --> G[Publish immutable history]
  G --> H[Stage current JSON and Markdown]
  H --> I{Both replacements succeed?}
  I -- Yes --> J[Remove temporary backups]
  I -- No --> K[Restore previous pair or remove first partial]
  J --> L[Commit generated reports]
  K --> M[Fail collection]
Loading

Reviews (2): Last reviewed commit: "fix(vitals): publish current error repor..." | Re-trigger Greptile

Comment thread crash_reports.py Outdated
If current.md failed after current.json was replaced, the two live reports
could describe different snapshots. Stage both files, replace them in order,
and restore the previous pair (or delete a first-time partial) on failure.
@TimeToBuildBob

Copy link
Copy Markdown
Contributor Author

@greptileai review

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