Skip to content

Upgrade CLI logging, diagnostics, and failure handling - #39

Merged
szmyty merged 2 commits into
mainfrom
agent/cli-logging
Oct 18, 2026
Merged

szmyty merged 2 commits into
mainfrom
agent/cli-logging

Conversation

@szmyty

@szmyty szmyty commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Mindcap currently mixes progress with result output, prints raw exception text, repeats every failed asset warning, and can count a partial sync archive as a successful capture. This gives CLI commands consistent timestamped diagnostics, safe error handling, and usable failure summaries.

  • Add bright severity labels, literal Rich text, grouped repeated warnings, attempted-item counts and elapsed time. Keep final results on stdout and progress/warnings/errors on stderr, including export imports and interrupted sync JSON. Preserve full archive paths at narrow widths.
  • Add global --verbose, --debug, --quiet and optional --log-file (before the command name), preserving capture/sync's existing local flags. JSONL logs append with owner-only permissions; diagnostic sessions restore handlers and close files after each command. Debug failures show sanitized frame locations without source lines or locals. Root/HTTP loggers remain untouched.
  • Give operational and argument errors stable codes and next steps. Redact common credential fields, named session cookies, nested cookie/storage-state objects, JWTs, URL credentials/queries/fragments, and terminal control sequences. Do not log provider payloads or browser state.
  • Return exit 2 for incomplete single captures and explicit incomplete batch items while retaining saved archives and their integrity results. Display retries and final failures, retain safe warnings/errors in sync reports, reconcile identical warnings separately for each source, and restore signal handlers so interrupted runs remain interrupted and resumable (exit 130).

Dependency: builds on Suno fix #38. Merge #38 first, then this PR. The PR targets main so it needs no manual base change. Logging-only comparison. Bookmark #37 remains separate and unmerged.

Validation on exact tree 384c432f88de98da6049affb328697551299a74c:

  • 611 tests passed, including architecture boundaries and synthetic interruption, retry, warning grouping, JSON channels, file permissions, handler cleanup, and credential redaction.
  • Ruff lint/format passed with both the uv-lock and Poetry-lock Ruff versions; focused strict Mypy passed 10 changed source/test files. Full-repository Mypy retains exactly the same 28 existing diagnostics in nine files.
  • Wheel and sdist build. A fresh wheel-only install outside the checkout passed nested-command logging, an offline ChatGPT fixture capture, JSON errors, redacted argument errors and JSONL logging using newly resolved Typer 0.27.3; locked tests use 0.27.0.
  • Inspected a synthetic colored terminal preview, including a 36-audio-failure summary and actionable error panel.

No real credentials, Chrome profiles, source accounts or media downloads were accessed. Diagnostics can still include identifiers, titles and paths; they are not anonymous exports. Unrecognized-option usage errors may render text even when --json is present; operational JSON results and errors use their documented channels. The cause of the maintainer's live Suno 403s still needs the diagnostic result requested in #38. No runtime dependencies or lockfiles change.

GitHub Actions CI run 39132605708 passed on published head 5e818da7069c7891f29c5aa14c260acf1d36d0f2: dependency install/configuration, formatting, lint, full tests, architecture boundaries, wheel/sdist build, package-content validation and clean-tree checks. The published tree matches the locally tested tree exactly.

@szmyty
szmyty marked this pull request as ready for review October 18, 2026 13:56
@szmyty
szmyty merged commit 0aeb03f into main Oct 18, 2026
1 check passed
@devactivity-app

Copy link
Copy Markdown

Pull Request Summary by devActivity

Metrics

Cycle Time: 15m Coding Time: < 1 min

Achievements

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