|
| 1 | +# PR_26146_043 Final Testing Architecture Report |
| 2 | + |
| 3 | +Generated: 2026-05-26 |
| 4 | +Status: PASS |
| 5 | + |
| 6 | +## Final Lane Ownership Model |
| 7 | + |
| 8 | +| Lane | Ownership | Authoritative scope | |
| 9 | +| --- | --- | --- | |
| 10 | +| `workspace-contract` | Workspace contract | Workspace Manager V2 launch, manifest handoff, toolState open/save, invalid payload handling, and lifecycle contracts. It is isolated from `tool-runtime` scheduling. | |
| 11 | +| `tool-runtime` | Tools | First-class tool runtime behavior for Asset Manager, Preview Generator, Collision Inspector, Palette Manager, and Tool Template. | |
| 12 | +| `game-runtime` | Games | Explicit game-owned Playwright behavior, currently Asteroids runtime and asset/visual checks. | |
| 13 | +| `engine-src` | Engine | Node tests for reusable engine, input, render, asset, and audio runtime modules. | |
| 14 | +| `integration` | Integration | Cross-surface handoffs such as game index manifest preview resolution and tools index registration. | |
| 15 | +| `samples` | Samples | Explicit samples lane only; not full samples smoke. | |
| 16 | + |
| 17 | +Workspace contract assertions stay isolated from tool runtime assertions by lane routing: `tool-runtime` no longer reaches `WorkspaceManagerV2.spec.mjs`, and `workspace-contract` remains selected only by `--lane workspace-contract`, `test:lane:workspace-contract`, or the compatibility `test:workspace-v2` wrapper. |
| 18 | + |
| 19 | +## Operational Architecture |
| 20 | + |
| 21 | +| Principle | Final state | |
| 22 | +| --- | --- | |
| 23 | +| Targeted lanes are authoritative default | `npm run test:lanes` has safe no-lane mode; runtime starts only for explicit lanes or `--all`. | |
| 24 | +| Broad Workspace/full samples are explicit/on-request only | Workspace compatibility routes to `workspace-contract`; samples require the samples lane wrapper and `--include-samples`; full samples smoke was not run. | |
| 25 | +| Deterministic failures stop before runtime | Lane registration, runner preflight, scoped discovery, manifest input validation, warm-start validation, snapshot validation, lane compilation, and dependency gating precede runtime scheduling. | |
| 26 | +| Manifest/snapshot reuse remains authoritative | Selected affected lanes regenerate/reuse persistent manifests, warm starts, and lane snapshots before runtime. | |
| 27 | +| Zero-browser preflight remains authoritative | Zero-browser preflight ran first and passed before targeted lanes were launched. | |
| 28 | +| Broad discovery fallback is prohibited | Lane manifests now use only explicit `discoveryTargets`; command targets missing from those targets fail preflight. | |
| 29 | + |
| 30 | +## Accepted Routing Layers |
| 31 | + |
| 32 | +| Layer | Status | Notes | |
| 33 | +| --- | --- | --- | |
| 34 | +| `package.json` lane scripts | Accepted | `test:lane:*` scripts route through `scripts/run-targeted-test-lanes.mjs`. | |
| 35 | +| `test:workspace-v2` | Accepted compatibility wrapper | Preserved because existing workflows use it; it routes to `workspace-contract`. | |
| 36 | +| Static structure/audit scripts | Accepted explicit broad zero-browser layer | Preserved because they inspect broad Playwright structure without browser startup. | |
| 37 | +| Direct Playwright package scripts | Removed | The obsolete Asset Manager and Preview Generator shortcuts were removed. | |
| 38 | +| Runner lane manifest validation | Accepted authoritative layer | Explicit targets, manifests, warm starts, and snapshots define lane inputs. | |
| 39 | + |
| 40 | +## Remaining Intentionally Expensive Tests |
| 41 | + |
| 42 | +| Test or command | Owner | Execution policy | |
| 43 | +| --- | --- | --- | |
| 44 | +| `tests/playwright/tools/WorkspaceManagerV2.spec.mjs` | Workspace contract | Run only through `workspace-contract` selection. | |
| 45 | +| `tests/playwright/integration/GameIndexPreviewManifestBroadScan.spec.mjs` | Integration broad scan | Explicit/on-request only; outside targeted integration defaults. | |
| 46 | +| `npm run test:launch-smoke` | Runtime smoke | Explicit/on-request only. | |
| 47 | +| `npm run test:launch-smoke:games` | Game runtime smoke | Explicit/on-request only. | |
| 48 | +| `npm run test:workspace-manager:games` | Workspace/game runtime | Explicit/on-request only. | |
| 49 | +| `npm run test:manifest-payload:games` | Game manifest payload | Explicit/on-request only. | |
| 50 | +| `npm run test:sample-standalone:data-flow` | Samples/runtime | Explicit/on-request only. | |
| 51 | +| `npm run test:lane:samples` | Samples | Explicit samples lane only; not full samples smoke. | |
| 52 | + |
| 53 | +## Remaining Accepted Technical Debt |
| 54 | + |
| 55 | +| Item | Accepted debt | |
| 56 | +| --- | --- | |
| 57 | +| `tests/playwright/tools/WorkspaceManagerV2.spec.mjs` | Physical file remains large and under `tests/playwright/tools`; lane routing keeps it isolated from tool-runtime until a dedicated Workspace spec relocation/split is approved. | |
| 58 | +| `scripts/run-targeted-test-lanes.mjs` | Runner still owns many responsibilities physically; this PR only removed obsolete routing and fallback behavior. | |
| 59 | +| `scripts/audit-playwright-test-locations.mjs` | Static audit remains broad by design and zero-browser. | |
| 60 | +| `tests/helpers/playwrightV8CoverageReporter.mjs` | Coverage collection/reporting remains shared until more consumers justify splitting it. | |
| 61 | +| `tests/helpers/runtimeSceneLoaderHotReload.helpers.mjs` | Helper ownership remains future cleanup scope. | |
| 62 | +| `tests/playwright/tools/CollisionInspectorV2.spec.mjs` | Retained as current tool-runtime coverage with explicit game fixtures. | |
| 63 | + |
| 64 | +## Before And After Cleanup Observations |
| 65 | + |
| 66 | +| Area | Before | After | |
| 67 | +| --- | --- | --- | |
| 68 | +| Package runtime entry points | Direct tool Playwright shortcuts existed outside lane preflight. | Browser-backed tool validation enters through `tool-runtime`. | |
| 69 | +| Lane manifests | Engine/samples targets could be inferred from command args. | Engine/samples targets are explicit manifest inputs. | |
| 70 | +| Discovery fallback | Missing `discoveryTargets` could be hidden by command-target fallback. | Missing target declarations fail before runtime. | |
| 71 | +| Tool/Workspace isolation | Tool lane already skipped Workspace spec, but direct tool scripts still bypassed runner safeguards. | Tool runtime uses the lane runner only; Workspace remains a separate compatibility-routed lane. | |
0 commit comments