fix(logging): bound log-tail input resource consumption #18

Open
opened 2026-10-10 16:58:48 +00:00 by KofTwentyTwo · 2 comments
KofTwentyTwo commented 2026-10-10 16:58:48 +00:00 (Migrated from github.com)

Problem

LogTail retains a bounded number of lines but scans the entire file and has no line-length limit. Threat-model T6 is only partially mitigated.

Acceptance criteria

Implement an explicit, tested input/line resource bound while preserving tail order and supported encodings; cover huge files and huge single lines; update threat-model evidence and retain core coverage.

Scope

AppKit logging and log viewers.

This issue is part of the user-requested AppKit readiness remediation. Local work is not completion until the applicable published/runtime state and checks are verified. Substantial AI assistance: Codex.

## Problem LogTail retains a bounded number of lines but scans the entire file and has no line-length limit. Threat-model T6 is only partially mitigated. ## Acceptance criteria Implement an explicit, tested input/line resource bound while preserving tail order and supported encodings; cover huge files and huge single lines; update threat-model evidence and retain core coverage. ## Scope AppKit logging and log viewers. This issue is part of the user-requested AppKit readiness remediation. Local work is not completion until the applicable published/runtime state and checks are verified. Substantial AI assistance: Codex.
KofTwentyTwo commented 2026-10-10 17:59:12 +00:00 (Migrated from github.com)

Implemented and committed locally in 8768281f69 (SSH-signed and DCO-signed off).

Log refreshes seek directly to at most 1 MiB of trailing bytes plus a four-byte BOM header; queue preallocation is capped and even a single line is bounded. UTF-8 and BOM-marked UTF-16/UTF-32 tails preserve code-unit alignment. Both WinUI and WPF show a truncation notice. Existing public read/display signatures remain available. Threat-model T6 and the changelog now reflect the actual resource bound.

Verification: 130 unit tests, 12 sample UI tests, 100% core/updates line coverage, zero-warning full build, and format verification passed. Regression tests cover a 128 MiB file, a 4 MiB single line, small byte budgets, empty/BOM-only input, and both byte orders. Format still reports workspace-loading warnings.

Remaining: publish the reviewed commit and verify live gates; this ticket stays open until then. No push or release occurred. AI assistance: Codex (GPT-6).

Implemented and committed locally in 8768281f69dc6d3781b47fde2327b60641c74bf3 (SSH-signed and DCO-signed off). Log refreshes seek directly to at most 1 MiB of trailing bytes plus a four-byte BOM header; queue preallocation is capped and even a single line is bounded. UTF-8 and BOM-marked UTF-16/UTF-32 tails preserve code-unit alignment. Both WinUI and WPF show a truncation notice. Existing public read/display signatures remain available. Threat-model T6 and the changelog now reflect the actual resource bound. Verification: 130 unit tests, 12 sample UI tests, 100% core/updates line coverage, zero-warning full build, and format verification passed. Regression tests cover a 128 MiB file, a 4 MiB single line, small byte budgets, empty/BOM-only input, and both byte orders. Format still reports workspace-loading warnings. Remaining: publish the reviewed commit and verify live gates; this ticket stays open until then. No push or release occurred. AI assistance: Codex (GPT-6).
KofTwentyTwo commented 2026-10-10 18:27:36 +00:00 (Migrated from github.com)

Implemented and saved in signed, DCO-signed-off commit b2f0686ac0d9edccda15541bf115efaa2a79a203 (following bounded-reader commit 8768281): both WinUI and WPF now keep the truncation notice in their toolbars while Follow scrolls to the newest entry. WPF initial layout now scrolls correctly on first open, as well as refreshes.

Added huge-file UI regression cases that assert the last entry is in UI Automation's visible text ranges, alongside the persistent notice. Zero-warning x64 build, whole-solution formatting verification and all 14 UI tests pass. Existing core/update evidence remains 146 unit tests and 100% line coverage; this commit changes viewer and test-harness code only.

Initial UI attempts exposed DPI virtualization in the test host and WPF scrolling before first layout. Fixed the synchronous test thread's DPI context with guaranteed restoration, and fixed WPF layout/scroll timing. Fresh window-interior captures confirm both viewers show the final entry. Captures remain local review evidence.

This is local implementation evidence. The issue stays open until the reviewed changes reach main and applicable published/runtime checks pass. Substantial AI assistance: Codex (GPT-6).

Implemented and saved in signed, DCO-signed-off commit `b2f0686ac0d9edccda15541bf115efaa2a79a203` (following bounded-reader commit `8768281`): both WinUI and WPF now keep the truncation notice in their toolbars while Follow scrolls to the newest entry. WPF initial layout now scrolls correctly on first open, as well as refreshes. Added huge-file UI regression cases that assert the last entry is in UI Automation's visible text ranges, alongside the persistent notice. Zero-warning x64 build, whole-solution formatting verification and all 14 UI tests pass. Existing core/update evidence remains 146 unit tests and 100% line coverage; this commit changes viewer and test-harness code only. Initial UI attempts exposed DPI virtualization in the test host and WPF scrolling before first layout. Fixed the synchronous test thread's DPI context with guaranteed restoration, and fixed WPF layout/scroll timing. Fresh window-interior captures confirm both viewers show the final entry. Captures remain local review evidence. This is local implementation evidence. The issue stays open until the reviewed changes reach main and applicable published/runtime checks pass. Substantial AI assistance: Codex (GPT-6).
Sign in to join this conversation.