Skip to content

fix(go): close all medium-divergence parity findings (M1-M19) - #236

Merged
rado0x54 merged 8 commits into
go-backendfrom
go-parity-mediums
Jul 6, 2026
Merged

fix(go): close all medium-divergence parity findings (M1-M19)#236
rado0x54 merged 8 commits into
go-backendfrom
go-parity-mediums

Conversation

@rado0x54

@rado0x54 rado0x54 commented Jul 5, 2026

Copy link
Copy Markdown
Owner

Closes every remaining medium item from the parity audit (data/go-parity-findings-2026-07-04.md). M2/M4/M11/M12/M17 were already closed on go-parity-highs; this branch lands the other 14, one commit per logical group.

Session & transport semantics

  • M6 — post-mortem sessions: transport-driven closes now retain the session (registry + buffer) so tail/re-attach show the final output; lists hide closed but show error (exact Node listSessions filter, including the close-on-closed no-op). Only an explicit Close clears the buffer and removes the entry. The MCP cap prune treats retained dead sessions as dead.
  • M7 — transport errors: the SSH pump distinguishes a broken transport (reset, protocol error) from a normal end (clean exit, nonzero exit, hangup without exit-status) — errors now surface as status=error / transport-error in WS + audit.
  • M8/M9 — Denying one WebAuthn key aborts SSH connection instead of trying next identity #91 regression: the terminal path now cancels a dead connection's stranded sign prompts (OnConnectionEnded hook on the passkey factory, fired on connect failure and transport end) and Broker.CancelForConnection broadcasts sign:resolved so stale toasts clear on every tab (agent-proxy path switched to it too).
  • M10 — approval store pruning: terminal-state actions are deleted 120s after expiry (Node's poll-grace window); the store no longer grows forever.

MCP surface

  • M3 — server instructions: live endpoint list + workflow/session-lifecycle/sudo guidance, byte-matching Node's text; serverInfo.version now comes from build info.
  • M5 — per-account cap: the MCP path resolves accounts.max_sessions instead of always defaulting to 5.
  • M1 — notifications: closed as SDK-blocked. The official go-sdk (v1.6.1; unchanged in v1.7.0-pre.1) has no public API to send custom notification methods — notifications/shellwatch/* is rejected by its typed method registry and the underlying jsonrpc2 connection is unexported. Until the sdk grows an escape hatch, agents must poll; the instructions deliberately omit Node's notifications section so they poll instead of waiting for notifications that cannot arrive. Recorded as a known divergence.

Wire & config

  • M13: first-party/skip consent auto-accept sends remember: true, remember_for: 30d — the SPA client shows up in "Authorized clients" and remembered skips renew.
  • M14: endpoint delete is a soft delete (enabled=0) and lists filter enabled — Node parity including the get-by-id quirk (post-delete PUT/session-create by id still work); Node-era deletions can no longer resurrect on a shared data dir.
  • M15: action view createdAt/expiresAt are epoch-ms integers per the contract.
  • M16: audit pages serialize "rows": [] when empty, page cap is 500, and the sessions cursor payload uses sessionId — pre-migration cursors keep working.
  • M18: an absolute keyDirectory is kept as-is (path.resolve semantics).
  • M19: seeding failure aborts boot — a fresh deployment can't come up silently un-loginable.

Tests

New coverage: manager retention semantics (post-mortem read, list filters, no-op close), server-hangup test updated to pin retention, MCP instructions assertion, config/store behavior via the existing suites. go build && go vet && go test -count=1 ./... and pnpm spdx:check clean.

rado0x54 added 8 commits July 5, 2026 22:24
…t pages serialize rows:[] when empty, page cap 500, sessions cursor key sessionId (M16) (#210)
…er_for 30d (M13); MCP path resolves per-account maxSessions from the store (M5) (#210)
…10); terminal-path connection death cancels stranded prompts via OnConnectionEnded + broker CancelForConnection broadcasts sign:resolved (M8/M9); SSH transport distinguishes transport errors from normal closes (M7) (#210)
…r enabled — Node parity incl. the get-by-id quirk; prevents resurrection of Node-era deletions on shared data dirs (M14) (#210)
…en closes keep registry+buffer (tail/re-attach work), lists hide closed but show errored, explicit Close clears+removes, close-on-closed is a no-op; MCP cap prune treats retained dead sessions as dead (M6) (#210)
…ecycle/sudo guidance (M3); serverInfo.version from build info; Node's notifications section deliberately omitted (M1 blocked: go-sdk has no public API for custom notification methods) (#210)
…o Background-context forwarding awaiters can't leak (deliberate Node divergence); MCP cap counts live sessions only but keeps dead ids owned for post-mortem reads; explicit max_sessions=0 blocks MCP creation (negative = default 5); atomic Close guard + locked reasonOr (race-clean); account deletion purges retained post-mortem sessions (#210)
@rado0x54
rado0x54 merged commit 191405e into go-backend Jul 6, 2026
20 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.

1 participant