molecule-core/workspace-server
rabbitblood 641b1391e2 refactor(discovery): apply simplify findings on #1038 PR
Code-quality + efficiency review of PR #2081:

- Drop comma-ok on map type-asserts in filterPeersByQuery —
  queryPeerMaps writes name/role unconditionally as string, so the
  silent-empty-string fallback was cargo-culted defense that would
  HIDE a real upstream shape change in tests rather than surface it.
  Plain p["name"].(string) panics on violation, caught by tests.
- Trim filterPeersByQuery doc from 5 lines to 1 — function is 15
  lines and self-evident.
- Refactor 6 separate Test functions into one table-driven
  TestPeers_QFilter with 6 sub-tests. Net ~80 lines saved + naming
  becomes readable subtest names instead of TestPeers_Q_Foo_Bar.
- Set-based peer-id comparison (peerIDSet) replaces fragile
  peers[0]["id"] == "ws-alpha" asserts that would silently mask a
  future sort/order regression on the production code.
- Fix the broken TestPeers_Q_NoMatches assertion: re-encoding an
  unmarshalled []map collapses both null and [] to [], so the
  previous json.Marshal(peers) == "[]" check was tautological. Move
  the [] vs null distinction to a dedicated test
  (TestPeers_Q_NoMatches_RawBodyIsArrayNotNull) that inspects the
  recorder body BEFORE unmarshal.

runPeersWithQuery now returns both parsed peers and raw body so the
nil-guard test can use the bytes directly.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-26 01:02:19 -07:00
..
cmd/server feat(#1957): wire gh-identity plugin into workspace-server 2026-04-24 15:01:41 +00:00
internal refactor(discovery): apply simplify findings on #1038 PR 2026-04-26 01:02:19 -07:00
migrations feat(a2a): queue-on-busy — Phase 1 of priority queue (#1870) 2026-04-23 14:09:29 -07:00
pkg/provisionhook feat(#1957): wire gh-identity plugin into workspace-server 2026-04-24 15:01:41 +00:00
.ci-force chore: force Platform(Go) CI run on main — validate go vet clean 2026-04-21 15:43:19 +00:00
.gitignore feat(ws-server): pull env from CP on startup 2026-04-19 02:41:15 -07:00
.golangci.yaml chore(workspace-server): add golangci.yaml disabling errcheck 2026-04-24 07:16:54 +00:00
Dockerfile chore: extract ContextMenu Zustand fix + a2a_proxy local-docker SSRF bypass + workspace-server Dockerfile GID entrypoint 2026-04-22 20:00:16 -07:00
Dockerfile.tenant feat(terminal): remote path via aws ec2-instance-connect + pty 2026-04-21 18:13:29 -07:00
entrypoint-tenant.sh fix(security): add USER directive before ENTRYPOINT in all tenant images (#1155) 2026-04-20 23:51:33 +00:00
go.mod feat(#1957): wire gh-identity plugin into workspace-server 2026-04-24 15:01:41 +00:00
go.sum feat(#1957): wire gh-identity plugin into workspace-server 2026-04-24 18:28:18 +00:00