Skip to content

LUCID terminal/Neovim: view the security gate's blocked tool calls (:LucidBlocks) #320

Description

@alexander-blackwell

Summary

The desktop GUI's Security panel lists the tool calls the security gate blocked (quarantined), but lucid / lucid tui / lucid acp and the Neovim plugin have no equivalent. A terminal or Neovim user cannot SEE what the gate blocked in their own session.

Add a read-only viewer: a lucid blocks CLI and a :LucidBlocks command, the terminal-native mirror of the GUI Security panel. Sibling of lucid kb / :LucidKb (P-NVIM.6, #316).

Current behavior / problem

  • The gate (harness/omp/security_extension.ts) blocks a tool call via pi.on("tool_call") and records the quarantine in agent_obs.duckdb.
  • A live bare-lucid TUI/ACP session holds agent_obs.duckdb READ-WRITE, so a cross-process READ_ONLY open (what a separate lucid blocks process would do) fails. A pure terminal session's blocks are therefore invisible from outside the running agent.
  • The GUI sidesteps this because it records blocks its own way (desktop/security_log.ts, a lock-free JSONL) in addition to the DB.

Constraints

  • Invariant feat/mac-build #1 (extend omp, never fork): a CLI + hook, no omp patch.
  • Invariant build(deps): bump github/codeql-action from 3 to 4 #3 (fail-closed is law): the viewer and any new logging MUST NOT be able to perturb the gate's block decision. Any mirror write is best-effort, env-gated, and happens AFTER the decision.
  • Metadata only: never surface raw scanned content (tool, a severity summary, the reason only).
  • Read-only: releasing or approving a quarantine stays a GUI action (the audited fail-closed override).

Recommended approach (mirrors P-NVIM.6, #316)

  1. tools/blocks_cli.ts: read-only lucid blocks [--all] [--json], merging (a) the lock-free JSONL block log and (b) the DuckDB quarantines (securitySnapshot, READ_ONLY, skipped when the DB is held). Wired into the launcher main() like lucid kb / lucid stats.
  2. harness/omp/block_log.ts: a scanner-free mirror. The in-process gate appends each block to ~/.omp/lucid-blocks.jsonl when the launcher opts in via LUCID_BLOCK_LOG, so a block is visible during a live session. The GUI never sets the env, so it never double-writes.
  3. extensions/neovim: M.blocks() read-only float + :LucidBlocks + <leader>lb.

Acceptance criteria

  • lucid blocks lists the quarantined tool calls (tool, severity, findings, reason); --all includes reviewed rows; --json for editors.
  • Blocks are visible DURING a live bare-lucid session (the lock-free log path), not only after it exits.
  • :LucidBlocks / <leader>lb shows the same list in a read-only Neovim float.
  • Fail-closed untouched: make test-failclosed green; the mirror can never affect a block decision.
  • New unit tests (block log, blocks CLI, launcher routing, the Neovim pure helper); a new make demo-<increment> green; make test green; root tsc + license headers clean.

References

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions