Skip to content

feat(nvim): view blocked tool calls via :LucidBlocks#319

Merged
mlcyclops merged 1 commit into
feat/nvim-knowledge-graphfrom
feat/nvim-security-blocks
Jul 19, 2026
Merged

feat(nvim): view blocked tool calls via :LucidBlocks#319
mlcyclops merged 1 commit into
feat/nvim-knowledge-graphfrom
feat/nvim-security-blocks

Conversation

@alexander-blackwell

@alexander-blackwell alexander-blackwell commented Jul 19, 2026

Copy link
Copy Markdown
Collaborator

Closes #320.

What

The GUI Security panel's blocked-tool-call list, now in the terminal and Neovim (increment P-NVIM.7). A read-only lucid blocks CLI plus :LucidBlocks / <leader>lb show the tool calls the security gate quarantined.

Why

lucid tui, bare lucid, and lucid acp run the same fail-closed gate + scanner as the desktop GUI, but a terminal/Neovim user had no way to SEE what the gate blocked. The GUI reads quarantines from agent_obs.duckdb, which a live bare-lucid session holds read-write, so a cross-process READ_ONLY open fails: a pure terminal session's blocks were invisible.

How

  • tools/blocks_cli.ts: read-only lucid blocks [--all] [--json], merging the lock-free JSONL block log with the DuckDB quarantines (securitySnapshot, opened READ_ONLY, skipped when the DB is held). Pure read: no agent, no gate spawn, no mutation.
  • harness/omp/block_log.ts: a scanner-free block 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. Env-gated and fail-safe, invoked AFTER the block decision: it can never perturb the fail-closed gate. The GUI never sets the env, so it never double-writes.
  • harness/launcher/lucid_acp.ts: route lucid blocks; point the gated spawn env at the block log (bare-lucid only, since the GUI spawns omp directly).
  • extensions/neovim/lua/lucid/init.lua + plugin/lucid.lua: M.blocks() read-only float + :LucidBlocks + <leader>lb.
  • docs/NEOVIM.md: documented.

Invariants

  • The fail-closed gate is untouched: the mirror is best-effort, env-gated, and runs after the block decision. make test-failclosed 15/15.
  • Metadata only: the mirror records tool, a severity summary, and the reason, never raw scanned content.

Testing

  • harness/omp/block_log.test.ts (9): buildBlockRecord severity/findings/fail-closed cases; mirrorBlock env-gate, JSONL append with recursive mkdir, swallowed write failure.
  • tools/blocks_cli.test.ts (8): readBlockLog parsing + approve/dismiss marker replay + defaults; blockList/runBlocks (filtered to source === "log" so the repo's real DuckDB rows never flake them).
  • lucid_acp.test.ts: main blocks --json routing (never falls through to the TUI/ACP).
  • _blocks_lines headless assertions in helpers_spec.lua (luac -p clean; run by CI where nvim exists).
  • make demo-P-NVIM.7 green; make test 2331 pass / 0 fail + sidecar green; root tsc + license headers clean.

Note

Stacked on feat/nvim-knowledge-graph (#316). The base auto-retargets to master when #316 merges; review this diff after #316.

A terminal-native mirror of the GUI Security panel: the tool calls the
security gate quarantined, in the terminal and Neovim.

- tools/blocks_cli.ts: read-only `lucid blocks [--all] [--json]`, merging
  the lock-free JSONL block log with the DuckDB quarantines. Pure read:
  no agent, no gate spawn, no mutation.
- harness/omp/block_log.ts: a scanner-free block 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 (when the gate holds agent_obs.duckdb read-write and a
  cross-process READ_ONLY open fails). Env-gated and fail-safe, called
  after the block decision, so it can never perturb the fail-closed gate.
  The desktop GUI never sets the env, so it never double-writes.
- harness/launcher/lucid_acp.ts: route `lucid blocks`; point the gated
  spawn env at the block log (bare-lucid only).
- extensions/neovim: M.blocks() read-only float + :LucidBlocks + <leader>lb.

Tests: block_log.test.ts (9), blocks_cli.test.ts (8), lucid_acp blocks
routing, and the _blocks_lines headless assertions; make demo-P-NVIM.7.
make test 2331 pass / 0 fail; make test-failclosed 15/15.
@mlcyclops
mlcyclops merged commit 3a77744 into feat/nvim-knowledge-graph Jul 19, 2026
3 checks passed
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.

2 participants