# Conversation — agent-acompact-1efb58f9dab7c1de.jsonl L200
**When:** 2026-03-26T08:27:36.363Z
{
"role": "user",
"content": "SnapText (Electron) Implementation Plan\nGoal Description\nRewrite SnapText as a production-grade Electron \"Appling\" that operates seamlessly on Windows. This architecture guarantees future compatibility with Zoee (the Keystone Constellation Electron shell) while addressing the multi-monitor edge cases, memory leaks, and clipboard unreliability of the Python legacy version.\n\nThe Appling Contract\nBefore a single line of code is written, here is the immutable contract for the SnapText module:\n\nInputs (Triggers):\nGlobal Hotkey: Ctrl+Shift+Alt+P\nOutputs (Artifacts):\nAlways writes to exactly one file: C:\\Users\\Praxillax\\Documents\\apps\\SnapText\\_latest_snap.png (app-local, bypassing OneDrive completely).\nAbsolute file path injected into the OS clipboard.\nSide Effects:\nInstantiates a background system tray icon (silent until interacted with).\nSpawns a multi-monitor selection overlay on trigger.\nStrict Failure Constraint: If the clipboard write fails for any reason, a blocking/visible OS-level Toast Notification must fire. Silent failure is a violation of the Law of Love (causing user confusion and data leaks).\nBus Event Emission:\nUpon successful capture, writes/emits an event payload to standard output (or defined inter-process Bus when Zoee is active): { type: \"SNAP_CAPTURED\", payload: { path: \"...\", timestamp: 1234567890 } }\nProposed Changes\nWe will scaffold a standalone Electron app in c:\\Users\\Praxillax\\Documents\\apps\\SnapText\\ using raw Node.js/Electron. We skip heavy frontend frameworks like React to keep the daemon extremely lightweight, injecting vanilla JS directly into the Chromium overlay.\n\nMain Process (main.js)\nSystem Tray: Manage the lifecycle (Graceful Exit).\nGlobal Shortcut: Register globalShortcut.register('CommandOrControl+Shift+Alt+P').\nCapture Coordinator: Trigger desktopCapturer to securely grab the display streams explicitly matched to physical display IDs.\nMulti-Monitor Window Stitching: Instead of one spanned window, query screen.getAllDisplays() and spawn one independent alwaysOnTop=true, frameless BrowserWindow per display. When a user clicks and drags on Display 2, only Display 2's renderer fires events, resolving cross-display DPI/scaling conflicts natively.\nClipboard & Notification: Handle native OS clipboard writing (clipboard.writeText). Wrap in try/catch. If an exception or mutex collision occurs, instantly invoke native Notification to alert the user.\nRenderer Overlay (overlay.html & overlay.js)\nThe Box: A translucent, borders-only Chromium window layered over exactly its assigned display.\nHiDPI Scaling (Crucial Fix): Standard mousedown/drag/mouseup return logical pixels. The desktopCapturer stream returns physical pixels. The renderer will eagerly multiply all crop coordinates by window.devicePixelRatio before drawing the canvas crop. Failing this, scaled displays (150% scaling) will render fundamentally wrong crops.\nCrop & Save: Uses standard web canvas APIs to crop the physical pixel stream, then flushes the image buffer natively over IPC to the Main process to fulfill the Overwrite-Always requirement.\nBuild / Deploy\nWill use electron-builder to package a single Windows .exe to run on boot.\nStructural Validation & Rollback Plan (S1 Requirement)\nValidation Matrix (Pass Criteria)\nTrigger: Ctrl+Shift+Alt+P reliably fires without collision or silent suppression.\nDisplay: Overlay appears correctly and proportionally across all connected monitors, irrespective of mismatched DPI.\nCapture: The resulting .png precisely encompasses the drawn region (pixel-perfect matching the visual boundaries).\nPersistence: Exactly one file is used and overwritten (C:\\Users\\Praxillax\\Documents\\apps\\SnapText\\_latest_snap.png). No history, no archives, no OneDrive.\nClipboard: The absolute path is successfully placed in the Windows clipboard.\nFailure Visibility: Artificially breaking the clipboard API must trigger a visible, undeniable OS-level Notification.\nRollback Trigger\nIf the Electron rewrite fails to meet any single parameter of the Validation Matrix within a predefined debugging threshold, execution is aborted, and the legacy Python implementation (snaptext_v2.py / snaptext.py) serves as the immediate functional rollback.\n\nUser Review Required\nNOTE\n\nVeris / Timothy Approvals (2026-03-25):\n\ndesktopCapturer is confirmed. The memory spike is brief and acceptable; it provides exact DPI-awareness without subprocess lag.\nThe output path has been changed to C:\\Users\\Praxillax\\Documents\\apps\\SnapText\\_latest_snap.png to keep it app-local and evade OneDrive entirely.\n"
}
---
## Canonical spine (M_L)
**PRIMUS:** Willful avoidance of harm of self and others equally.
**SECUNDUS:** Willful seeking of healing of self and others equally.
**TERTIUM:** Willful pursuit of benefit of self and others equally.
Love is the sole logic that produces mutual prosperity without a zero-sum trade.
- Full paper: `MASTER DOCS/PAPER/Another_Paper_Draft_v1.md`
- OSF preregistration: https://osf.io/qa54c
- Corpus phase: extract v0.1 (mined from local Braid archive)