Repo-wide arch/robustness/completeness pass: 26 verified fixes (2 HIGH mcp bugs)#93
Merged
Conversation
Full grounded review (17 reviewers × adversarial verify) of main post #91/#92: 7 invariants intact; 29 issues surfaced; 26 distinct fixes, each with a test. HIGH (both in the merged #91 mcp code): - stdio transport could deadlock every caller under an uninterruptible blocking Decode holding the per-server mutex — now ctx-cancellable + evict-on-cancel, plus a bounded Discover boot timeout. - untrusted MCP tool name written to a host path unsanitized (traversal) — now slug()-sanitized like resources/prompts. Also: live token streaming restored (Resilient forwards live on attempt 0) + partial-on-cancel; experience Fold moved off the eventlog append mutex (single ordered drainer); kill-switch WithRoot wired; browser Enter-submit gated; desktop stale-ref versioned; secret reflow scrubbed for all field types; flywheel RotatedLogPaths wired; project SWITCH threads *State; code.test_passes runs ./...; LSP Content-Length capped; keychain fail-closed; +more. make verify (119 pkgs) + tui-verify + golangci-lint + -race all green. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
What this is
A full repo-wide architecture / robustness / completeness pass over
main(post #91 mcp-upgrade + #92 audit-remediation), then remediation of every confirmed finding. The review ran 17 reviewers (13 subsystem areas + 4 cross-cutting lenses) with every finding adversarially re-verified against the cited code. The 7 invariants lens found zero structural breaks — I1–I7 still hold. 29 issues surfaced → 26 distinct fixes, each with a focused test.HIGH — both in the freshly-merged #91 mcp code
Decode— a boot hang and, in serve, a cross-session lock-hold. Fixed: eachDecoderuns in a goroutine selected againstctx, closing the connection on cancel so the Manager evicts + reconnects; plus a boundedsetupMCPDiscover timeout so a stalled server can't hang boot. (My B8 batch originally had this fix; I dropped it during the Deep subsystem audit: remediate all 89 shipped-gaps (14 areas) + selfeval wiring #92 rebase judging feat(mcp): close the container gap + HTTP/SSE transport + opt-in resources/prompts #91's transport handled it — it didn't. Re-applied.)t.Name + ".json"(untrustedtools/listoutput) written viafilepath.Joincould escape the worktree. Nowslug()-sanitized like resources/prompts; the descriptor keeps the original name so the model still invokes the right tool.MEDIUM/LOW highlights
Resilient.Streambuffered all chunks (streaming was dead in every production run); now forwards live on attempt 0 (buffers only on retry) and preserves the partial Response on ctx-cancel (steer interrupt-but-preserve).Foldoff the eventlog append mutex — a single ordered background drainer (non-blocking send, drop-and-warn under overload, drained on Close) so a slow SQLite projection can't stall the authoritative log.WithRootthreaded throughwrapAutoApproveso.nilcore/AUTOAPPROVE_OFFresolves against the run root, not process CWD.RotatedLogPathswired.listdiscovery action,Manager.getctx-select,internal/mcpleafdeps_test.go; per-day rate-cap TOCTOU; project SWITCH*State;code.test_passes→./...; LSPContent-Lengthcap; semantic-index prune; keychain fail-closed; native web-search on non-container backends; session-compaction splice; Telegram poller restartable; meter charge on cancel; channel depskernelparity; host-/tmpshred.How it was built
9 fixes by me (the security-critical mcp cluster + core eventlog + shared cmd wiring); the rest by 8 parallel worktree-isolated agents over disjoint packages, each verified in isolation, then integrated. Full grounded finding list + verified file:line in the commit.
Verification
make verify— 119 packages, exit 0make tui-verify— greengolangci-lint— cleango test -race— clean on every touched concurrency package (eventlog drainer, mcp, graapprove, session, telegram, model, experience)🤖 Generated with Claude Code