Repository navigation
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
FuJacob
force-pushed
the
security/debug-artifacts
branch
from
November 23, 2026 04:10
0e6bc6f to
e313c47
Compare
…ng history -cotabby-debug keeps working in release builds, but everything it writes now lands owner-only under ~/Library/Logs/<app>/ instead of partly on the Desktop. The AX dump no longer prints secure-field values, the calibration-strip switch only works in developer builds and is capped, a release build says when debug logging is on, and typing history's Delete All removes the debug copies too.
FuJacob
force-pushed
the
security/debug-artifacts
branch
from
November 23, 2026 04:11
e313c47 to
415eee1
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
-cotabby-debugstays available in release builds, since it is how users collect diagnostics for bug reports. But what it wrote was too exposed. The AX dump and the screenshot/OCR captures went to the Desktop, which iCloud often syncs. Every file got the default 0644/0755 modes. The AX dump copied secure-field values before any secure check ran. Adefaultskey, with no indicator and no cap, could make the shipped app save caret-line captures. And Delete All in typing history left all of these copies of the user's typing on disk. This PR keeps the feature and narrows what it exposes.CotabbyDebugArtifacts(Support/Logging) owns the whole layout: one directory,~/Library/Logs/<CFBundleName>/(CotabbyorCotabby Dev), created 0700, with every file 0600. Directories and logs that earlier builds left behind are tightened when they are next opened.JSONLFileWriter(both.eventsand.llmIO), the AX dump (ax-dump.txt), the visual-context captures (screenshots/<app>/) and the calibration strips (strips/, now written only byHostPixelCapture.dump) take their paths from that type. Nothing is written to the Desktop any more.AXTreeDumpWriterchecks each node withSecureFieldDetector. For a secure node, and every node inside one, it never reads the value, and it leaves out the selection and caret, because those reveal the length. The formatting is in a pureAXDumpValuePreviewhelper with its own tests.COTABBY_DEVbuilds honorcotabbyDumpCalibrationStrips;HostPixelCapture.dumpsCapturesnow forwards to that gate. The folder keeps the newest 200 captures, evicting by name stem so each PNG/JSON pair is kept or removed together. The screenshot folder's existing 20-per-app cap uses the same helper.-cotabby-debugshows a "Debug logging is on" line under the menu bar panel's header, with a tooltip that explains how to turn it off.cotabby.jsonl,llm-io.jsonl, their.1rotations, the AX dump, the screenshots and the strips, then reopens the liveJSONLFileWriters.cotabby.jsonlis included because the suggestion debug logger writes full prompt blocks into it, and its typed-mismatch lines record the typed characters. The confirmation text mentions this.AGENTS.md, which.claude/CLAUDE.mdimports, plusARCHITECTURE.md,CONTRIBUTING.mdandSOURCE_LAYOUT.md) describe the new layout.Validation
swiftlint lint --quieton every touched file: no new warnings. The only warnings are four existing line-length warnings inTypingHistoryStoreTests.swift, which are onmaintoo.mainatc14b1700(after Remove dead and test-only production code and fix the comments that described it #928–Revise maintainer details in README.md #955).xcodegen generaterun after adding the four new files. The committedproject.pbxprojdiff is only those additions. On cleanmain, the same command produced no drift.CotabbyDebugArtifactsTests: layout, 0700/0600 modes including tightening an existing 0755 root or 0644 file, capture eviction, and a Delete All sweep that leaves unrelated files alone.AXDumpValuePreviewTests.reopen()cases forJSONLFileWriterinFileLogHandlerTests. Both sinks share this writer since Merge duplicated log writers and tap plumbing, and drop dead members in services #931.showsDebugModeNoticeinCotabbyDebugOptionsTests.TypingHistoryStoreTests.Linked issues
None filed. Addresses M3 and the Delete All part of L10 from a static security review of
8cdbea2.Risk / rollout notes
~/Desktop/cotabby-ax-dump.txtis now~/Library/Logs/<app>/ax-dump.txt, and~/Desktop/cotabby-debug-screenshots/is now~/Library/Logs/<app>/screenshots/. Anyone with scripts or wiki pages that point at the Desktop paths needs to update them.~/Desktopwould trigger a macOS privacy prompt for every user who presses Delete All, including users who never turned on debug mode. Users who ran an earlier build with-cotabby-debugshould delete the old Desktop files by hand. This could go in the release notes.COTABBY_DEV, not only DEBUG. The dev identity's Release configuration is the documented way to check placement against real pixels, and that build never ships. If you want DEBUG only, it is a one-line change inCotabbyDebugArtifacts.dumpsCalibrationStrips..debugprompt lines while the flag is on, and Delete All cannot remove those.🤖 Generated with Claude Code