Skip to content

fix(reports): tolerate malformed action_log entries + populate 30-day window from daily-check#319

Merged
hyoshi merged 1 commit into
mainfrom
fix/reports-reliability
Jun 23, 2026
Merged

fix(reports): tolerate malformed action_log entries + populate 30-day window from daily-check#319
hyoshi merged 1 commit into
mainfrom
fix/reports-reliability

Conversation

@hyoshi

@hyoshi hyoshi commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

Two reporting-reliability fixes surfaced on a customer's Agency machine.

1. Tolerant action_log parsing (read-only Reports)

An old / hand-authored action_log entry missing timestamp / platform made parse_state raise a KeyError → whole Reports document blanked. Same class as #315 (campaign tolerance), which didn't cover action_log. New _parse_action_log(raw, *, strict): writers stay strict; the read-only view (strict=False) skips nonconforming entries. Structural problems still raise.

2. daily-check populates the 30-day window

The period toggle needs two windows. YESTERDAY came from daily-check, LAST_30_DAYS only from sync-state — so a daily-check-only routine never showed the toggle. Step 13 now writes every window whose numbers it already gathered (no extra API call), so daily-check alone yields both. Bundled + source skill copies in parity.

Regression tests at parse + dashboard level. python-reviewer: APPROVE. Targets 0.10.12.

https://claude.ai/code/session_01NxBrN8Qn53Tpivt9SumdGn

… window from daily-check

Two reporting-reliability fixes surfaced on a customer's Agency machine:

1. Tolerant action_log parsing (read-only Reports view). An old / hand-authored
   action_log entry missing a required field (`timestamp` / `platform`) made
   `parse_state` raise a KeyError, blanking the whole Reports document — the
   same class as #315 (campaign tolerance), which did not cover action_log. Add
   `_parse_action_log(raw, *, strict)`: writers stay strict (default), the
   read-only view (`strict=False`, via the #315 `_read_state_tolerant` path)
   skips nonconforming entries with a warning. Structural problems still raise.

2. daily-check now populates `periods["LAST_30_DAYS"]` too. The period toggle
   only appears once two windows have data; `YESTERDAY` was written by
   daily-check but `LAST_30_DAYS` only by sync-state, so a daily-check-only
   routine never showed the toggle. Step 13 now writes every window whose
   numbers it already gathered (reusing the step-4 / step-8 figures — no extra
   API call), so daily-check alone yields both windows. Bundled + source skill
   copies kept in parity.

Regression tests at parse level (strict=False skips a field-less entry; strict
default still raises) and dashboard level (platform totals + the conforming
recent action survive a malformed action_log entry). python-reviewer: APPROVE.

Claude-Session: https://claude.ai/code/session_01NxBrN8Qn53Tpivt9SumdGn
@hyoshi
hyoshi merged commit f2810ce into main Jun 23, 2026
9 checks passed
@hyoshi
hyoshi deleted the fix/reports-reliability branch June 23, 2026 05:30
@hyoshi hyoshi mentioned this pull request Jun 23, 2026
hyoshi added a commit that referenced this pull request Jun 23, 2026
Bump version across pyproject / __init__ / .claude-plugin and add the
CHANGELOG entry for 0.10.12: the Reports action_log tolerance + daily-check
30-day window fixes (#319), the `mureo upgrade` post-upgrade refresh (#320),
and the docs refresh (#321).

Claude-Session: https://claude.ai/code/session_01NxBrN8Qn53Tpivt9SumdGn
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