molecule-core/docs/architecture
Hongming Wang eec4ea2e7d chore: delete TeamHandler.Collapse + docs cleanup (closes #2864)
Multi-model retrospective review of #2856 (Phase 1 Expand removal)
flagged that TeamHandler.Collapse is unreachable from the canvas UI:
the "Collapse Team" button calls PATCH /workspaces/:id { collapsed }
(visual flag toggle on canvas_layouts), NOT POST /workspaces/:id/collapse.
The destructive POST route — which stops EC2s, marks children removed,
and deletes layouts — has zero UI callers (verified via grep across
canvas/, scripts/, and the MCP tool registry; only docs referenced it).

Two semantically different operations had been sharing the word
"Collapse":

- Visual collapse (canvas) → PATCH { collapsed: true }. Hides
  children visually. Reversible. UI-only.
- Destructive collapse (POST /collapse) → Stops + marks removed.
  Irreversible. No caller.

Deleting the destructive one + its supporting machinery:

- workspace-server/internal/handlers/team.go (entirely)
- workspace-server/internal/handlers/team_test.go (entirely)
- POST /collapse route + teamh init in router.go
- findTemplateDirByName helper (zero non-test callers after Expand
  was deleted in #2856; package-private so no out-of-package consumers)
- NewTeamHandler constructor (no callers after route removed)

Plus stale doc references (the most dangerous was the MCP wrapper
mapping in mcp-server-setup.md — anyone generating MCP tool wrappers
from that table was wiring a 404):

- docs/agent-runtime/team-expansion.md (deleted entirely — whole
  guide taught the deleted flow)
- docs/api-reference.md (dropped two team.go rows)
- docs/api-protocol/platform-api.md (dropped /expand + /collapse
  rows)
- docs/architecture/molecule-technical-doc.md (dropped /expand +
  /collapse rows)
- docs/guides/mcp-server-setup.md (dropped expand_team +
  collapse_team MCP wrapper mappings)
- docs/glossary.md (dropped "(org template expand_team)"
  parenthetical)
- docs/frontend/canvas.md (dropped broken link to deleted
  team-expansion.md)

Kept: docs/architecture/backends.md mention of "TeamHandler.Expand
(#2367) bypassed routing on Start" — correct historical context for
the AST gate's existence, no live route reference.

Visual-collapse path unaffected:
  canvas/src/components/ContextMenu.tsx:227 → api.patch — unchanged
  canvas/src/components/WorkspaceNode.tsx:128 → api.patch — unchanged

go vet ./... clean. go test ./internal/handlers/ -count 1 — all green
(4.3s, no regression).

Net: -388/+10 = ~378 lines removed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-05 11:59:43 -07:00
..
architecture.md chore: open-source restructure — rename dirs, remove internal files, scrub secrets 2026-04-18 00:24:44 -07:00
backends.md docs(backends): document Auto-dispatcher SoT pattern + source-level pins 2026-05-04 20:25:10 -07:00
canary-release.md docs(security): move sensitive runbooks to private internal repo 2026-04-22 22:39:23 +00:00
database-schema.md docs(security): document the KMS-rooted custody chain for SECRETS_ENCRYPTION_KEY 2026-04-26 11:29:16 -07:00
event-log.md initial commit — Molecule AI platform 2026-04-13 11:55:37 -07:00
memory.md initial commit — Molecule AI platform 2026-04-13 11:55:37 -07:00
molecule-technical-doc.md chore: delete TeamHandler.Collapse + docs cleanup (closes #2864) 2026-05-05 11:59:43 -07:00
org-api-keys.md docs: strip internal roadmap/followups from public org-api-keys docs 2026-04-20 14:31:46 -07:00
overview.md fix(docs): update architecture + API reference paths for workspace-server rename 2026-04-18 01:25:21 -07:00
partner-api-keys.md docs: Partner API Keys architecture + Phase 34 plan 2026-04-17 14:07:50 -07:00
provisioner.md initial commit — Molecule AI platform 2026-04-13 11:55:37 -07:00
saas-prod-migration-2026-04-19.md docs: 2026-04-19 SaaS prod migration notes 2026-04-19 02:29:31 -07:00
secrets-key-custody.md docs(security): document the KMS-rooted custody chain for SECRETS_ENCRYPTION_KEY 2026-04-26 11:29:16 -07:00
staging-environment.md docs: staging environment design + Phase 36 plan 2026-04-17 20:37:11 -07:00
technology-choices.md initial commit — Molecule AI platform 2026-04-13 11:55:37 -07:00
tenant-image-upgrades.md chore: open-source preparation — scrub secrets, add community files 2026-04-18 00:10:56 -07:00
wildcard-dns-proxy.md chore: final open-source cleanup — binary, stale paths, private refs 2026-04-18 00:38:55 -07:00
workspace-tiers.md initial commit — Molecule AI platform 2026-04-13 11:55:37 -07:00