feat(logging)!: make C5 session logging opt-in #89
Reference in New Issue
Block a user
Delete Branch "feat/c5-logging-opt-in"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Session logging (C5) is the one opinionated category that writes a persistent record of terminal output to disk, and those logs can contain secrets. Silent-by-default is the wrong posture for it.
__fish_config_op_loggingnow defaults to off. Capture requires an explicit truthy value; the master switch (__fish_config_opinionated) cannot enable it on its own — it remains a master off switch only.Design spec:
docs/superpowers/specs/2026-07-27-c5-logging-default-off-design.mdImplementation
The behavioral change is one branch in
functions/__fish_config_op_enabled.fish, placed after the explicit-truthy / explicit-falsy early returns and before the master-switch fallthrough:All five capture components, the
.logging_disabledsentinel, theparu/yaywrappers, the Kitty watcher, and theconfig-settingsTUI already route through this guard, so nothing else needed code changes.Two consequences fall out for free:
conf.d/logging-events.fishalready runs__fish_config_sync_loggingat every shell start, so the first shell after upgrading creates the sentinel and removes the generated~/.local/bin/paru/~/.local/bin/yaywrappers. No migration code.conf.d/kitty-watcher-reminder.fishexits early when C5 is off, so fresh installs no longer nag about installing a watcher for a disabled feature. The reminder appears the first time someone opts in — when it's actually useful.Decisions
conf.d. Setting the variable at startup would make it look explicitly disabled inset -U/config-settings, would leave the TUI's three-state OFF/DEFAULT/ON model with no reachable DEFAULT, and would need ordering care againstlocal.fish.config-settingsUI change. DEFAULT still means "no variable set; built-in default applies" — that default is justofffor this row.Docs
docs/manual/index.md— CAUTION callout kept and retitled SESSION LOGGING IS OPT-IN; body now reads "this configuration can silently record…"; enable/disable bullets swapped. Verified it still renders as a Starlight<Aside>with all four bullets intact (Task #5 wrapped-list hazard avoided).docs/manual/07-customization.md— Minimal Mode preamble, category table, and the whole C5 section reframed to opt-in; sentinel section notes it is present on a fresh install.docs/manual/11-troubleshooting.md— §11.3 retitled Enable or Disable Session Logging, leads with enabling.README.md— overview bullet,> [!CAUTION]block, Session Logging section, and Minimal Mode table/preamble.docs/fish-config.index— retargeteddisable-logging, addedenable-logging.AGENTS.md— added a "C5 is opt-in (do not 'fix' this)" rule under Opinionated Component Guards so a future agent doesn't refactor the special case back out.docs/fish-config.mdregenerated.python3 docs/verify-manual.py→ 43/43 passed (the 8 missing-CATEGORYwarnings are pre-existing).⚠️ Breaking Change
Anyone relying on the previous default loses logging on their next shell start. Re-enable with:
Existing logs in
~/.terminal_historyare not touched — only capture stops, and the generated AUR wrappers are removed.Manual Verification
set -Ue __fish_config_op_logging; __fish_config_op_enabled __fish_config_op_logging; echo $status→1set -U __fish_config_opinionated 1→ still1set -U __fish_config_op_logging on→0, and~/.config/fish/.logging_disableddisappears immediatelyset -U __fish_config_op_logging off→1, sentinel presentset -U __fish_config_op_logging banana→10~/.local/bin/paruand~/.local/bin/yayare gone, sentinel exists,~/.terminal_historyuntouched~/.local/binandparu --versionstill workskitty-logging statusreportsC5 logging: disabledon defaults,enabledafter opting inconfig-settingsLogging row showsDEFAULTon a clean state and steps DEFAULT → ON → OFF correctly, with the sentinel tracking each stepset -U __fish_config_op_logging ontmux_*.logappears; toggling off stops the pipe-pane in every open shell<Aside>with all four bullets