molecule-core/docs/architecture
Hongming Wang a56b765b2d
docs: testing strategy + PR hygiene + backend parity matrix + boot-event postmortem (#1824)
Bundles the documentation and lightweight tooling landed during the
2026-04-23 ops/triage session. Pure additions — no behavior changes.

## Added

### docs/architecture/backends.md
Parity matrix for Docker vs EC2 (SaaS) workspace backends. 18 features
tabulated with current status; 6 ranked drift risks; enforcement
hooks (parity-lint + contract tests). Living document — owners are
workspace-server + controlplane teams.

### docs/engineering/testing-strategy.md
Tiered test-coverage floors instead of a blanket 100% target. Seven
tiers by code class (auth/crypto → generated DTOs). Per-package
current-state snapshot + targets. Tracks the 3 biggest coverage gaps
(tokens.go 0%, workspace_provision.go 0%, wsauth ~48%) against their
tier-1/2 floors.

### docs/engineering/pr-hygiene.md
Captures the patterns that keep diffs reviewable. Motivated by the
2026-04-23 backlog audit where 8 of 23 open PRs had 70-380-file bloat
from stale branch drift. Covers: small-PR sizing, rebase-not-merge,
cherry-pick-onto-fresh-base for recovery, targeting staging first,
describing why-not-what.

### docs/engineering/postmortem-2026-04-23-boot-event-401.md
Postmortem for the /cp/tenants/boot-event 401 race. Root cause (DB
INSERT ordered AFTER readiness check), detection path (E2E + manual
log inspection), lessons (write-before-read pattern, integration
tests needed, E2E alerting gap, invariants-as-comments).

### tools/check-template-parity.sh
CI lint for template repos — diffs the `${VAR:+VAR=${VAR}}` provider-
key forwarders between install.sh (bare-host / EC2 path) and start.sh
(Docker path). Catches the #5 drift risk from backends.md before it
ships.

### workspace-server/internal/provisioner/backend_contract_test.go
Shared behavioral contract scaffold for Provisioner + CPProvisioner.
Compile-time assertions catch method-signature drift today; scenario-
level runs are t.Skip'd pending backend nil-hardening (drift risk #6,
see backends.md).

## Updated

### README.md
Links the new engineering docs + backends parity matrix into the
Documentation Map so agents and humans can actually find them.

## Related issues

- #1814 — unblock workspace_provision_test.go (broadcaster interface)
- #1813 — nil-client panic hardening (drift risk #6)
- #1815 — Canvas vitest coverage instrumentation
- #1816 — tokens.go 0% → 85%
- #1817 — 5 sqlmock column-drift failures
- #1818 — Python pytest-cov setup
- #1819 — wsauth middleware coverage gap
- #1821 — tiered coverage policy (meta)
- #1822 — backend parity drift tracker

Co-authored-by: Hongming Wang <hongmingwang.rabbit@users.noreply.github.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: molecule-ai[bot] <276602405+molecule-ai[bot]@users.noreply.github.com>
2026-04-23 19:59:38 +00: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: testing strategy + PR hygiene + backend parity matrix + boot-event postmortem (#1824) 2026-04-23 19:59:38 +00:00
canary-release.md docs(security): move sensitive runbooks to private internal repo 2026-04-22 22:39:23 +00:00
database-schema.md initial commit — Molecule AI platform 2026-04-13 11:55:37 -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: open-source restructure — rename dirs, remove internal files, scrub secrets 2026-04-18 00:24:44 -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
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