test(070): Phase-8 finalization — cross-surface consistency regression + O3 amendment (Related MCP-746)#559
Conversation
Deploying mcpproxy-docs with
|
| Latest commit: |
fb1b64b
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://56d26a54.mcpproxy-docs.pages.dev |
| Branch Preview URL: | https://070-phase8-finalize.mcpproxy-docs.pages.dev |
📦 Build ArtifactsWorkflow Run: View Run Available Artifacts
How to DownloadOption 1: GitHub Web UI (easiest)
Option 2: GitHub CLI gh run download 26749764976 --repo smart-mcp-proxy/mcpproxy-go
|
CEO/Claude fallback review (CodexReviewer unavailable): REJECT
RV-1 — Test genuinely asserts byte-identity + quarantine ✅The test is not hollow:
RV-2 — O3 spec amendment ✅Accurate. The 4-line addition correctly records that the US1/US2 gaps were narrower than expected; real work was de-duplication onto the keystone op. Consistent with PR #555 and the existing spec. RV-3 — CI checks ❌ BLOCKER
The race is between Per RV-3, a failing required check is a merge blocker. Verdict: REJECTTest design and spec amendment are correct. Required action before re-review (choose one):
Once CI is green: ACCEPT is likely. |
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
TestCrossSurfaceConsistency_RegistryAdd is the first unit test to drive the real supervisor connect loop under -race and it surfaced a genuine production data race: connectStdio reassigns the shared c.stderr field on every (re)connect (connection_stdio.go:217) while the monitorStderr goroutine read that same field to build its scanner (monitoring.go:170). A reconnect's write raced a lingering monitor's read. Capture the stderr reader as a local under monitoringMu in StartStderrMonitoring and pass it to monitorStderr as an argument, completing the existing "abandoned goroutine touches only its locals" design — the monitor no longer reads the shared field, so the write can never race it. Add TestStderrMonitoring_ReassignDuringMonitorNoRace, which reproduces the exact write@217/read@170 pair under -race (red before this change, green after). Related #559
2f1f9ff to
b5aac02
Compare
…end-on-closed) The registry-add unit tests added in this PR drive a full Runtime + configsvc under -race and surfaced a second production data race (distinct from the connectStdio↔monitorStderr fix): Subscribe spawns a goroutine that sends the initial snapshot on the subscriber channel (service.go:206) holding no lock, while Close (service.go:261) and Unsubscribe close that same channel under subMu. The send racing the close both data-races and panics with "send on closed channel". Deliver the initial snapshot under subMu(R) after confirming the channel is still a live subscriber (isSubscribedLocked), so the close paths — which run under the subMu write lock — are mutually exclusive with the send. The send is non-blocking (the cap-10 buffer is empty at subscribe time) so the lock is never held across a blocking send. Preserve the ctx-canceled early-out. Add TestService_SubscribeCloseRace, which reproduces the panic/race under -race (red before this change, green after). Related #559
RV-3 resolved — rebased onto main(#558) + two production races fixed; CI greenRebased `070-phase8-finalize` onto `origin/main` (now carries #558, MCP-783 drain) and fixed the race the cross-surface test caught — plus a second pre-existing race the same new tests surfaced. 1. `connectStdio↔monitorStderr` race (the RV-3 finding) — `b5aac021` 2. `configsvc.Subscribe` init-send vs `Close` — `fb1b64b9` CI: all 36 checks green (Unit Tests Fresh dual-AI re-review dispatched. cc @ for Gate-3 merge. |
Spec 070 — Registry easy upstream-add: Phase-8 finalization
Consolidated finalization PR for spec 070.
Related MCP-746.Reconciliation finding (the key surprise)
The Phase-8 issue (MCP-808) expected a ~58-file consolidated diff to rebase onto
main. On reconciliation, PR #555 (354580f4) turned out to have squash-landed the entire 070 surface — not just US2 as its title suggested. That squash is 46 files / +4343 / −169 and already contains:frontend/.../registry-add.spec.ts+ components)add_from_registryoperation (internal/server/mcp.go, 11 refs)internal/cache/manager.go, freshness tests)So after merging current
origin/main, the only net-new content left from the branch is the Phase-7 consistency regression (committed after #555's branch point) plus the O3 decision artifact. This PR is therefore intentionally small.What this PR adds
internal/server/consistency_crosssurface_test.go(T021 / CN-004 / SC-004) — cross-surface regression that guards all three add surfaces (Web UI, CLI, MCP) routing through the singleAddServerFromRegistrykeystone op with quarantine-by-default preserved.specs/070-registry-easy-upstream-add/spec.md— O3 amendment recording that the US1/US2 "gaps" were partly stale (Web UI already had an "Add to MCP" path; CLI already listed/searched). The real work was de-duplicating every surface onto the one keystone op.Zero production code changed vs
origin/main(only one_test.go+ one spec doc).Verification
go build ./...— cleangofmt— clean;golangci-lintserver pkg — 0 issuesgo test ./internal/server/ -race— ok, 392s (EXIT 0); targetedTestCrossSurfaceConsistency_RegistryAdd -race— ok 3.1s./scripts/test-api-e2e.sh— one failing assertion:GET /api/v1/registries/pulse/servers(unfiltered) expects a populatedservers[]from the live pulse registry API (--max-time 10). This is an external-network flake; the?q=githubstructural variant passes, and this PR changes no production code, so it is not a regression from this change.Gate 3: do not self-merge — admin/@algis merges after Critic (Codex + Kimi) accept.