Skip to content

L12: serialize TTY prompts process-wide and share friction accounting#84

Merged
jkyberneees merged 1 commit into
mainfrom
fix/l12-tty-prompt-serialization
Jul 19, 2026
Merged

L12: serialize TTY prompts process-wide and share friction accounting#84
jkyberneees merged 1 commit into
mainfrom
fix/l12-tty-prompt-serialization

Conversation

@jkyberneees

Copy link
Copy Markdown
Contributor

Closes L12 (and M-13).

  • Adds a process-wide mutex in TTYApprover so concurrent CLI tool calls cannot interleave prompts on /dev/tty.
  • Moves the friction approval log to a process-wide map, so repeated approvals of the same class engage high-friction mode regardless of which tool instance recorded them.
  • Resets the global log in test mode on each NewTTYApprover to keep tests isolated.

/cc @BackendStack21/odek

- internal/danger/approver.go: add a process-wide mutex (ttyPromptMu) that
  serializes all TTY approval prompts; move the approval log that drives
  friction mode to a process-wide map so repeated approvals across tool
  instances correctly engage high-friction mode. Reset the global log in
  test mode on each NewTTYApprover so tests stay isolated.
- internal/danger/whitebox_coverage_test.go: update record-approval test
  for the global log.
- cmd/odek/parallel_shell_danger_test.go: reset friction state before the
  trust-cache test.
- docs/SECURITY.md + AGENTS.md: document L12 mitigation.
@jkyberneees
jkyberneees merged commit 696e556 into main Jul 19, 2026
5 of 7 checks passed
@jkyberneees
jkyberneees deleted the fix/l12-tty-prompt-serialization branch July 19, 2026 08:53
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.

1 participant