Skip to content

Commit 82ccd32

Browse files
committed
Finalize Model B contracts with platform-only top level and tool-owned outputs - PR_26152_077-model-b-contract-final-cleanup
1 parent 84df713 commit 82ccd32

27 files changed

Lines changed: 295 additions & 2679 deletions
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# Model B Contract Final Cleanup Validation
2+
3+
PR: PR_26152_077-model-b-contract-final-cleanup
4+
Date: 2026-06-02
5+
6+
## Scope
7+
8+
- Updated `src/shared/contracts/`, `tests/shared/`, and required reports only.
9+
- No runtime, UI, CSS, HTML, database, or authentication implementation changes were made.
10+
- Repo-wide tests and samples tests were not run.
11+
12+
## Model B Cleanup
13+
14+
- Removed standalone top-level output behavior models for:
15+
- asset records
16+
- palette records
17+
- vector asset records
18+
- Moved generic tool output vocabulary into `src/shared/contracts/tools/toolContract.js`:
19+
- supported output families
20+
- output family list
21+
- output-family-to-format compatibility vocabulary
22+
- shared output type validation helpers
23+
- Updated per-tool declarations to import output family constants from `src/shared/contracts/tools/toolContract.js`.
24+
- Kept tool-specific output declarations in each tool contract file through:
25+
- `producedOutputs`
26+
- `supportedAssetTypes`
27+
- `importFormats`
28+
- `exportFormats`
29+
- Added `tests/shared/tools/ToolOutputDeclarationContract.test.mjs` to validate output vocabulary and representative per-tool output declarations.
30+
31+
## Top-Level Contract Boundary
32+
33+
Model B platform contracts are present at the top level:
34+
35+
- `identityPermissionsContract.js`
36+
- `projectContract.js`
37+
- `toolStateContract.js`
38+
39+
Output behavior contracts removed from the top level:
40+
41+
- asset output behavior model
42+
- palette output behavior model
43+
- vector asset output behavior model
44+
45+
Existing shared replay/state constants remain in `src/shared/contracts/` because they are imported by runtime/shared-state code outside this PR scope. They are not tool-produced output behavior models and were not modified in this cleanup.
46+
47+
## Validation Commands
48+
49+
Targeted contract tests:
50+
51+
```powershell
52+
$rootContractTests = Get-ChildItem -Path tests/shared -Filter '*Contract.test.mjs' | Sort-Object Name | ForEach-Object { $_.FullName }
53+
$toolContractTests = Get-ChildItem -Path tests/shared/tools -Filter '*.test.mjs' | Sort-Object Name | ForEach-Object { $_.FullName }
54+
node ./scripts/run-node-test-files.mjs $rootContractTests $toolContractTests
55+
```
56+
57+
Result: PASS, `39/39 targeted node test file(s) passed`.
58+
59+
Static checks:
60+
61+
```powershell
62+
rg "assetContract\\.js|paletteContract\\.js|vectorAssetContract\\.js" -n src/shared/contracts tests/shared
63+
git diff --name-only -- '*.css' '*.html'
64+
Get-ChildItem -Path src/shared/contracts -File | Select-Object -ExpandProperty Name | Sort-Object
65+
git diff --check -- src/shared/contracts tests/shared docs/dev/reports/tool_contract_coverage.md docs/dev/reports/model_b_contract_final_cleanup_validation.md docs/dev/commit_comment.txt
66+
```
67+
68+
Results:
69+
70+
- PASS: no top-level asset, palette, or vector asset output contract modules remain.
71+
- PASS: no imports of removed output contract modules remain in `src/shared/contracts` or `tests/shared`.
72+
- PASS: every registered visible first-class tool still has matching coverage in `docs/dev/reports/tool_contract_coverage.md`.
73+
- PASS: tool outputs are represented through per-tool declarations and validated by `ToolOutputDeclarationContract.test.mjs`.
74+
- PASS: no CSS or HTML files changed.
75+
- PASS: no whitespace errors from `git diff --check`.
76+
77+
## Skipped
78+
79+
- Runtime validation skipped because no runtime behavior changed.
80+
- UI validation skipped because no UI changed.
81+
- Repo-wide tests skipped per PR instructions.
82+
- Samples tests skipped per PR instructions.

docs/dev/reports/tool_contract_coverage.md

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,26 @@
11
# Tool Contract Coverage
22

3-
PR: PR_26152_076-tool-contract-location-correction
3+
PR: PR_26152_077-model-b-contract-final-cleanup
44
Date: 2026-06-02
55

66
## Discovery Sources
77

88
- Root Tools Index page: `tools/index.html`
99
- Root Tools Index card data: `tools/tools-page-accordions.js`
1010
- Active first-class tool registry: `tools/toolRegistry.js`
11-
- Shared tool behavior: `src/shared/contracts/tools/toolContract.js`
11+
- Shared tool behavior and output vocabulary: `src/shared/contracts/tools/toolContract.js`
1212
- Per-tool declarations: `src/shared/contracts/tools/*Contract.js`
1313
- Contract index: `src/shared/contracts/tools/toolContractsIndex.js`
1414

15-
## Location Status
15+
## Model B Status
1616

17-
- Top-level `src/shared/contracts/` contains platform/object contracts only.
18-
- Shared tool behavior now lives under `src/shared/contracts/tools/toolContract.js`.
17+
- Platform contract tests remain at the top-level contract surface for identity/permissions, projects, and tool state.
18+
- Shared tool behavior now owns tool status, visibility, versioning, import/export formats, supported output types, and output format compatibility vocabulary.
1919
- Per-tool modules remain split: 34/34 retained.
20-
- Matching per-tool tests remain split: 34/34 retained.
21-
- Per-tool declarations include tool-specific id, type, grouping, inputs, outputs, supported assets, import formats, export formats, and tool metadata.
22-
- Shared tool behavior owns owner/project/visibility/status/version, import/export, produced output, supported asset, source tool state, archive, permission, and portable export rules.
23-
- No `src/shared/contracts/tools/paletteContract.js` exists; the platform Palette object remains `src/shared/contracts/paletteContract.js`.
24-
- No standalone `vectorStudioContract.js` was created because the registered vector tools are `object-vector-studio-v2` and `world-vector-studio-v2`.
20+
- Matching per-tool declaration tests remain split: 34/34 retained.
21+
- Tool output declarations live in per-tool modules through `producedOutputs`, `supportedAssetTypes`, `importFormats`, and `exportFormats`.
22+
- Standalone top-level output object behavior models for asset, palette, and vector asset records were removed.
23+
- No separate behavior models were created for asset, palette, or vector outputs.
2524

2625
## Active Registered First-Class Tools
2726

@@ -53,6 +52,19 @@ All active visible registered first-class tools discovered through `getVisibleAc
5352
| `3d-asset-viewer` | `src/shared/contracts/tools/threeDAssetViewerContract.js` | `tests/shared/tools/ThreeDAssetViewerToolContract.test.mjs` |
5453
| `3d-camera-path-editor` | `src/shared/contracts/tools/threeDCameraPathEditorContract.js` | `tests/shared/tools/ThreeDCameraPathEditorToolContract.test.mjs` |
5554

55+
## Tool Output Declaration Coverage
56+
57+
| Output Family | Shared Vocabulary | Representative Tool Declaration |
58+
|---|---|---|
59+
| Vector | `vector`, `vector-json`, `svg` | `object-vector-studio-v2` produces `vector-json` and `svg`. |
60+
| Palette | `palette`, `palette-json` | `palette-manager-v2` produces `palette-json`. |
61+
| Image | `image`, `image-file` | `asset-studio` produces `image-file`. |
62+
| Audio | `audio`, `audio-file` | `audio-sfx-playground-v2` produces `audio-file`. |
63+
| Tilemap | `tilemap`, `tilemap-json` | `tile-map-editor` produces `tilemap-json`. |
64+
| Localization | `localization`, `localization-json` | `localization-studio` produces `localization-json`. |
65+
66+
The shared output vocabulary is validated by `tests/shared/tools/ToolOutputDeclarationContract.test.mjs`.
67+
5668
## All Tool Declarations
5769

5870
| Tool Contract | Grouping | Contract Module | Matching Test |
@@ -123,9 +135,10 @@ The root Tools Index card data includes public/root cards that are not all activ
123135
- Tool contracts defined: 34
124136
- Tool contracts with grouping metadata: 34
125137
- Per-tool contract modules: 34
126-
- Matching per-tool tests: 34
138+
- Matching per-tool declaration tests: 34
139+
- Shared tool behavior tests: 2
127140
- Registered first-class tools without contract: 0
128141
- Root Tools Index cards reviewed: 18
129142
- Root Tools Index cards skipped as non-tool surfaces: 2
130-
- Top-level tool behavior contracts remaining: 0
131-
- Duplicate object-vs-tool declaration files remaining: 0
143+
- Top-level asset/palette/vector output behavior contracts remaining: 0
144+
- Duplicate output behavior models remaining: 0

0 commit comments

Comments
 (0)