6.5 KiB
6.5 KiB
Spec-coherence change. Most implementation work is already done in the 2026-04-24 wave; tasks marked
[x]reflect that. Tasks marked[ ]are normative or cleanup work this change introduces.
0. Pre-flight (non-negotiable)
- 0.1 Confirm clean working tree (
git statusreports nothing) and no in-flight worktrees with uncommitted work (git worktree listthengit statusin each) - 0.2 If any worktrees exist under
.claude/worktrees/, account for each one: still-active agent, work-pending-merge, or stale-and-prune. Stale worktrees MUST be removed (git worktree remove) before opening a new one — code that has been lost twice on main is the failure mode this guards against. - 0.3 Confirm the package set in
MANIFEST.mdmatchesfind packages -maxdepth 3 -name package.jsoncount. Drift here means a prior change archived without regenerating the manifest.
1. Audit-driven prep
- 1.1 Read the umbrella design at
/mnt/s/web/genesis/docs/superpowers/specs/2026-04-24-enterprise-testbed-design.md. - 1.2 Read the three implementation plans at
/mnt/s/web/genesis/docs/superpowers/plans/2026-04-24-testing-integration-core.md,/mnt/s/web/genesis/docs/superpowers/plans/2026-04-24-testing-integration-plugins.md,/mnt/s/web/genesis/docs/superpowers/plans/2026-04-24-testbed-pages-and-e2e.md. - 1.3 Read the audit at
/mnt/s/web/genesis/docs/superpowers/specs/2026-04-25-test-suite-audit.md. - 1.4 Confirm the seven packages exist on disk under
packages/testing/.
2. testing-integration (core) — already implemented
- 2.1
ServiceFixture<TConfig>interface +InferConfig<F>utility. - 2.2
HealthPollerwith configurable interval / timeout / sleep injection. - 2.3
TestEnvironmentwith parallel-start / reverse-stop and thestarteddouble-start guard. - 2.4
skipIfUnavailable()helper (Vitestinject()). - 2.5
createIntegrationSetup()factory + Vitest global-setup bridge. - 2.6 OTel counters / histograms / spans for every public entrypoint.
- 2.7 100 % Istanbul coverage on the package.
3. testing-integration (core) — new normative work landed by this change
- 3.1 Add
dependsOn?: readonly string[]toServiceFixture<TConfig>and topo-sort inTestEnvironment.setupAll(). Stop reverses the same order. - 3.2 Extend
TestEnvironmentOptionswithclock?: Clock; rng?: Rng; signal?: AbortSignaland propagate to fixture configs whose options declareacceptsContext: true. - 3.3 Implement leak / handle-tracker assertion at end of
teardownAll(); emit warning +testing.integration.leak.countincrement on detection. - 3.4 Implement
markFlaky({ retries, reason })wrapper + per-packagequarantine.jsonenumeration. - 3.5 Rename inject-key
__integration_failed__→__suaveplan_integration_failed__acrosscreate-integration-setup.ts,skip-if-unavailable.ts, and tests. - 3.6 Replace every literal
95 %indocs/superpowers/plans/2026-04-24-*.mdwith100 %(sed-style sweep). - 3.7 Add property-based round-trip tests for
HealthPollerretry arithmetic andTestEnvironmenttopo-sort usingfast-check.
4. Per-plugin specs (already implemented; this change only lifts to spec)
- 4.1
testing-integration-surrealdbv3.0.4 image, HTTP/health, random password, three env vars. - 4.2
testing-integration-redisRedis 7, TCP PING,REDIS_URLparsing. - 4.3
testing-integration-postgresPostgreSQL 16,pg_isreadyexec,POSTGRES_URL. - 4.4
testing-integration-mailpitAPI health,assertMail()partial-subject + exact-address matching, two env vars. - 4.5
testing-integration-typesenseTypesense 27,{ ok: true }health, random API key. - 4.6
testing-integration-garage-s3Garage v2.0.0, dual-port 3900/3902, 7-step init, four env vars.
5. Per-plugin normative work landed by this change
- 5.1 Each plugin's package surface MUST expose
INTEGRATION.<PLUGIN>.*error codes via acodesconst re-exported from the barrel (audit alignment with the testing-error pattern). - 5.2 Each plugin's
ServiceFixtureconfig schema (Zod) lists every env-bridge variable name; spec scenarios assertenv()returns the full set. - 5.3 Each plugin marks the
acceptsContext: trueoption (where the config can deterministically take aclock/rng).
6. testing-e2e — already implemented
- 6.1
attachConsoleMonitor(page)witherrors,warnings,assertNoErrors(),assertNoWarnings(), filter options. - 6.2
attachNetworkMonitor(page)withfailures,assertNoFailures(). - 6.3 Multi-session WebRTC fixture (
createMultiSessionFixture). - 6.4 Extension fixture (
extendTestWithExtension).
7. testing-e2e — new normative work landed by this change
- 7.1 Extend
attachNetworkMonitorwithassertNoMissingAssets(),assertNoMixedContent(),assertNoCorsErrors(). - 7.2 Default-deny network sandbox in
createPlaywrightConfig:page.route('**/*')blocks external origins unlessallowedOriginsis provided. - 7.3 Multi-session fixture exposes
disableSignalingRoute()chaos hook (already partial in plan).
8. testing capability — coverage / property / determinism updates
- 8.1 In the canonical spec delta, replace
≥ 95 %with100 %on every dimension; remove the foundation carve-out language. - 8.2 Broaden the property-based requirement from "the
@suaveplan/testingpackage" to every pure-function@suaveplan/*package (citingcrypto-utils,diff,pagination,validation). - 8.3 Add a clarifying scenario tying the deterministic
Clock/Rng/AbortSignalcontract toTestEnvironmentOptionspropagation.
9. Spec validation
- 9.1
openspec validate enterprise-testing-integration --type changepasses. - 9.2 Diff each plugin spec against the implementation plan to confirm no requirement contradicts shipped code.
10. Pre-publish gate per package (run when each plugin next ships)
- 10.1
bunx turbo lint typecheck test --filter=@suaveplan/testing-integrationgreen. - 10.2
bunx turbo test:coverage --filter=@suaveplan/testing-integrationat 100 %. - 10.3 Repeat 10.1 / 10.2 for each of
testing-integration-{surrealdb,redis,postgres,mailpit,typesense,garage-s3}.
11. Archive
- 11.1 Fold each spec delta into the matching
openspec/specs/<capability>/spec.md(creating the file for new capabilities, MODIFIED-merging fortestingandtesting-e2e). - 11.2 Move
openspec/changes/enterprise-testing-integration/→openspec/archive/<yyyy-mm-dd>-enterprise-testing-integration/.