|
| 1 | +# PR_11_278 Workspace V2 workspace.schema Export Enforcement + Same-Tool Diff Guard Report |
| 2 | + |
| 3 | +## Scope |
| 4 | +Workspace V2 export/import validation and Session Diff Viewer same-tool guard only. |
| 5 | + |
| 6 | +## Files Changed |
| 7 | +- tools/workspace-v2/index.html |
| 8 | +- tools/workspace-v2/index.js |
| 9 | +- tools/schemas/workspace.schema.json |
| 10 | +- tests/runtime/V2CurrentSessionExport.test.mjs |
| 11 | +- docs/pr/PLAN_PR_11_278_WORKSPACE_V2_WORKSPACE_SCHEMA_EXPORT_ENFORCEMENT_AND_SAME_TOOL_DIFF_GUARD.md |
| 12 | +- docs/pr/BUILD_PR_11_278_WORKSPACE_V2_WORKSPACE_SCHEMA_EXPORT_ENFORCEMENT_AND_SAME_TOOL_DIFF_GUARD.md |
| 13 | +- docs/dev/reports/PR_11_278_workspace_schema_export_enforcement_and_same_tool_diff_guard_report.md |
| 14 | + |
| 15 | +## Implementation Summary |
| 16 | +- Workspace V2 export now emits workspace schema root shape (`documentKind`, `schema`, `version`, `games`) and no custom wrapper. |
| 17 | +- Workspace V2 import/export validator now enforces workspace schema contract and rejects wrapper payloads. |
| 18 | +- Export/import contract explicitly blocks: |
| 19 | + - `workspaceV2Session` |
| 20 | + - `toolSessions` |
| 21 | + - `savedSessions` |
| 22 | + - `exportedAt` |
| 23 | +- Added the smallest workspace schema support needed for Workspace V2 session persistence by adding `games[].session`. |
| 24 | +- Diff Viewer now enforces same-tool comparisons only. |
| 25 | + - Cross-tool selections disable diff and show exact message: |
| 26 | + `Diff requires sessions from the same tool.` |
| 27 | + |
| 28 | +## Validation Commands Run |
| 29 | +1. `node --check tools/workspace-v2/index.js` |
| 30 | + - PASS |
| 31 | +2. `node --check tests/runtime/V2CurrentSessionExport.test.mjs` |
| 32 | + - PASS |
| 33 | +3. `node tests/runtime/V2CurrentSessionExport.test.mjs` |
| 34 | + - PASS |
| 35 | + - Results: `tmp/v2-current-session-export-results.json` |
| 36 | +4. `node tests/runtime/V2SessionMerge.test.mjs` |
| 37 | + - PASS |
| 38 | + - Results: `tmp/v2-session-merge-results.json` |
| 39 | + |
| 40 | +## Behavior Evidence |
| 41 | +- Export root shape now follows `tools/schemas/workspace.schema.json` and no longer includes `workspaceV2Session/toolSessions/savedSessions` wrappers. |
| 42 | +- Import rejects non-workspace.schema payloads with actionable error text referencing schema contract. |
| 43 | +- Cross-tool diff is blocked before compute and uses required message text. |
| 44 | +- Same-tool diff flow remains enabled. |
| 45 | + |
| 46 | +## Full Samples Smoke Decision |
| 47 | +- Skipped full samples smoke test. |
| 48 | +- Reason: changes are limited to Workspace V2 export/import contract enforcement and diff guard logic; targeted runtime checks cover changed behavior. |
0 commit comments