feat(nvim): view blocked tool calls via :LucidBlocks#319
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 blocksCLI plus:LucidBlocks/<leader>lbshow the tool calls the security gate quarantined.Why
lucid tui, barelucid, andlucid acprun 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 fromagent_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-onlylucid 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.jsonlwhen the launcher opts in viaLUCID_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: routelucid 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
make test-failclosed15/15.Testing
harness/omp/block_log.test.ts(9):buildBlockRecordseverity/findings/fail-closed cases;mirrorBlockenv-gate, JSONL append with recursive mkdir, swallowed write failure.tools/blocks_cli.test.ts(8):readBlockLogparsing + approve/dismiss marker replay + defaults;blockList/runBlocks(filtered tosource === "log"so the repo's real DuckDB rows never flake them).lucid_acp.test.ts:main blocks --jsonrouting (never falls through to the TUI/ACP)._blocks_linesheadless assertions inhelpers_spec.lua(luac -pclean; run by CI where nvim exists).make demo-P-NVIM.7green;make test2331 pass / 0 fail + sidecar green; root tsc + license headers clean.Note
Stacked on
feat/nvim-knowledge-graph(#316). The base auto-retargets tomasterwhen #316 merges; review this diff after #316.