|
| 1 | +# Vector Asset Contract Tests Validation |
| 2 | + |
| 3 | +PR: PR_26152_069-vector-asset-contract-tests |
| 4 | +Date: 2026-06-02 |
| 5 | + |
| 6 | +## Scope |
| 7 | + |
| 8 | +- Added reusable Vector Asset contract data under `src/shared/contracts/vectorAssetContract.js`. |
| 9 | +- Added Vector Asset fixtures under `tests/fixtures/vector-assets/vector-asset-scenarios.json`. |
| 10 | +- Added targeted contract tests under `tests/shared/VectorAssetContract.test.mjs`. |
| 11 | +- No database implementation was added. |
| 12 | +- No authentication implementation was added. |
| 13 | +- No UI/page/runtime behavior was changed. |
| 14 | +- No CSS or HTML files were changed. |
| 15 | +- No dependencies were added. |
| 16 | + |
| 17 | +## Contract Coverage |
| 18 | + |
| 19 | +Targeted tests prove: |
| 20 | + |
| 21 | +- vector asset records require owner |
| 22 | +- vector asset records require project |
| 23 | +- vector asset records may link to source tool state |
| 24 | +- visibility rules are enforced |
| 25 | +- exported vector assets remain portable |
| 26 | +- archived vector assets are immutable unless policy allows edits |
| 27 | +- version must be valid |
| 28 | + |
| 29 | +The Vector Asset contract defines: |
| 30 | + |
| 31 | +- `assetId` |
| 32 | +- `assetType = vector` |
| 33 | +- `ownerId` |
| 34 | +- `projectId` |
| 35 | +- `sourceToolState` |
| 36 | +- `visibility` |
| 37 | +- `version` |
| 38 | +- `status` |
| 39 | +- `exportFormats` |
| 40 | + |
| 41 | +## Validation Lanes |
| 42 | + |
| 43 | +- lanes executed: contract - Vector Asset contract tests plus existing Tool State, Project, and Identity/Permissions contract tests were required by the PR. |
| 44 | +- lanes skipped: runtime, integration, engine, recovery/UAT - no runtime, handoff, engine, or recovery behavior changed. |
| 45 | +- samples decision: SKIP because samples were explicitly out of scope and no sample contracts or runtime paths changed. |
| 46 | +- Playwright impacted: No. This PR changes contract data and targeted Node tests only. |
| 47 | +- blocker scope: targeted contract lane only. |
| 48 | + |
| 49 | +## Commands |
| 50 | + |
| 51 | +```powershell |
| 52 | +node ./scripts/run-node-test-files.mjs tests/shared/VectorAssetContract.test.mjs tests/shared/ToolStateContract.test.mjs tests/shared/ProjectContract.test.mjs tests/shared/IdentityPermissionsContract.test.mjs |
| 53 | +``` |
| 54 | + |
| 55 | +Result: PASS |
| 56 | + |
| 57 | +```text |
| 58 | +PASS tests/shared/VectorAssetContract.test.mjs |
| 59 | +PASS tests/shared/ToolStateContract.test.mjs |
| 60 | +PASS tests/shared/ProjectContract.test.mjs |
| 61 | +PASS tests/shared/IdentityPermissionsContract.test.mjs |
| 62 | +
|
| 63 | +4/4 targeted node test file(s) passed. |
| 64 | +``` |
| 65 | + |
| 66 | +```powershell |
| 67 | +git diff --check -- src/shared/contracts/vectorAssetContract.js tests/shared/VectorAssetContract.test.mjs tests/fixtures/vector-assets/vector-asset-scenarios.json |
| 68 | +``` |
| 69 | + |
| 70 | +Result: PASS with no output. |
| 71 | + |
| 72 | +## Expected PASS Behavior |
| 73 | + |
| 74 | +- Valid vector asset fixtures pass without errors. |
| 75 | +- Invalid vector asset fixtures return the exact expected contract error codes. |
| 76 | +- Owner/project/visibility/version/export format requirements are enforced. |
| 77 | +- Source tool state links are allowed when they identify tool state, tool type, and matching project. |
| 78 | +- Private vector assets deny ungranted viewers and allow granted project viewers. |
| 79 | +- Collaborators can edit granted active project vector assets. |
| 80 | +- Viewers cannot edit vector assets. |
| 81 | +- Marketplace vector assets are visible. |
| 82 | +- Archived vector assets reject edits unless policy explicitly allows archived edits. |
| 83 | +- Portable vector asset exports preserve portable fields and remove owner/project/database identifiers. |
| 84 | + |
| 85 | +## Expected WARN Behavior |
| 86 | + |
| 87 | +- No WARN findings for the targeted contract lane. |
| 88 | +- Repo-wide, samples, UI, CSS, HTML, database, and authentication validation were intentionally not run because they are outside this PR scope. |
0 commit comments