Skip to content

App logging: bounded files and ctl logs - #93

Draft
1bye wants to merge 10 commits into
mainfrom
codex/app-logging-84
Draft

1bye wants to merge 10 commits into
mainfrom
codex/app-logging-84

Conversation

@1bye

@1bye 1bye commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

Closes #84

App logging uses the existing tracing subscriber, private platform log directories, bounded output worker and ctl transport. Release files rotate at 1 MiB with three archives and a 4 MiB total budget; development stderr keeps its existing format, and Web keeps console output. Disk failures discard output without stopping the app.

File records now include an RFC 3339 UTC timestamp, level, target, application message and event/span fields. Secret-looking field names are matched by case-insensitive substring and their values become [redacted]: password, passwd, secret, token, authorization, cookie, api_key/apikey, credential, private_key and session. Values escape newlines. Each record is bounded to 4 KiB including its newline, with UTF-8-safe …[truncated] marking.

rake ctl logs retains the same formatted line with its sequence cursor and loss counters. A separate bounded tail keeps up to 128 entries within a 256 KiB encoded budget, leaving room in the transport frame. File and ctl retention can lose different subsets under contention, overflow or disk failure, but retained lines have identical content. Crash records keep their structural-only diagnostic tail and optional log path.

Runtime privacy audit changes:

  • Application activation/startup, updater/quit, menu/tray, control transport, window-state and surface diagnostics now log fixed operation categories and static error_type metadata instead of formatting error payloads that could include paths, URLs or application text.
  • Tray diagnostics omit platform message bodies and tray IDs. Event delivery and error handling keep their existing behavior.
  • Paragraph shaping/painting and vendored text rendering omit document/HTML/AST dumps and raw parsing or clipboard error text.
  • Vendored browser runtime logs omit opened URLs, invalid response-header names/values, clipboard MIME/exception details, pasted-image exception text, and raw graphics/window/IME/dispatcher exceptions. Structural indices, categories and error types remain.
  • Reviewed runtime HTTP instrumentation: its tracing span carries a request ID, with no URL, query string, headers or body. No notification-body tracing sites were found. The default subscriber does not install a log-facade bridge; host-owned bridges need their own privacy review.

Applications retain responsibility for secrets or personal data inside messages, targets, unrecognized fields and free-form debug/error values. Key redaction is a heuristic. docs/logging.md describes that boundary, Rake's own privacy rules, timestamps, truncation, paths, configuration, bounds and ctl behavior.

Web crash delivery retains its fixed, privacy-safe error category for the unchanged browser regression test; sink error payloads remain omitted.

CI note: Windows desktop hit the known cold-cache 60-minute timeout on f0bd797 and 3de2938, also present on main. On 3de2938, the real desktop dev/CDP, GUI inspection, reload, shutdown and editor-process survival smoke checks passed before cancellation during later tests. Workflow timeouts are unchanged in this PR. Ubuntu had one existing source-opener fixture launch failure; all 14 broker tests pass locally. Its rerun is blocked until the still-active native job completes.

Local validation: 70 headless rake-app unit tests plus the native local_control transport test; 11 diagnostics unit tests, two snapshot tests and one doctest; strict diagnostics Clippy; native App Clippy; default Web App Clippy; rake format and rake lint. Coverage includes secret-key matching/case, newline escaping, timestamp format, 4 KiB UTF-8 truncation, file message/target content, file/ctl equality, concurrent writes, loss counters, rotation/bounds, failed setup/writes and unchanged development stderr formatting. CI is pending for the new head. Workflow timeouts are unchanged.

🤖 Generated with Claude Code

1bye and others added 10 commits November 15, 2026 21:01
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add UTC timestamps, target, messages and fields to bounded 4 KiB log records. Share the formatted line with ctl, redact secret-named fields, escape values and mark UTF-8-safe truncation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replace raw framework error payloads with static error types. Omit tray diagnostic bodies, document AST/text dumps, URL strings, response-header values and browser clipboard exception details from runtime logging.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Web delivery returns fixed categories rather than sink payloads. Preserve the warning error field consumed by the unchanged browser regression test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

App logging: log files, rotation and rake ctl logs

1 participant