Skip to content

Commit 09a379f

Browse files
author
DavidQ
committed
Remove obsolete workspace-manifest documentKind usage - PR_26140_055-remove-workspace-manifest-documentkind
1 parent 6bef2b9 commit 09a379f

15 files changed

Lines changed: 76 additions & 26 deletions
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Workspace Manifest DocumentKind Removal Report
2+
3+
PR: `PR_26140_055-remove-workspace-manifest-documentkind`
4+
5+
## Summary
6+
- Replaced active `documentKind: "workspace-manifest"` usage with `documentKind: "project-manifest"`.
7+
- Kept the existing `schema: "html-js-gaming.project"` contract and Workspace Manager V2 manifest/toolState behavior.
8+
- Removed active code and test expectations that accepted `workspace-manifest` as the valid document kind.
9+
10+
## Updated Active Paths
11+
- `tools/workspace-manager-v2/js/services/WorkspaceManagerV2ContextService.js`
12+
- Generates Workspace Manager contexts with `project-manifest`.
13+
- Validates generated contexts against `project-manifest`.
14+
- `tools/shared/projectManifestContract.js`
15+
- Uses `PROJECT_DOCUMENT_KIND = "project-manifest"`.
16+
- `tools/asset-manager-v2/js/services/WorkspaceBridge.js`
17+
- Validates workspace-launched contexts as project manifest contexts.
18+
- `tools/preview-generator-v2/PreviewGeneratorV2App.js`
19+
- Resolves workspace launch contexts using the project manifest document kind.
20+
- `tools/shared/documentModeGuards.js` and `tools/shared/platformShell.js`
21+
- Detect project manifests using `project-manifest` or `schema: "html-js-gaming.project"`.
22+
- `scripts/validate-json-contracts.mjs`
23+
- Skips project-manifest sample-style documents using the new document kind.
24+
- Template manifests:
25+
- `games/_template/workspace-manager-v2-template.manifest.json`
26+
- `games/_template/workspace-manager-v2-UAT.manifest.json`
27+
- Tests and fixtures:
28+
- Workspace Manager V2 Playwright fixtures and assertions.
29+
- Asset Manager V2 workspace launch fixtures and assertions.
30+
- Collision Inspector V2 workspace launch fixture.
31+
- V2 Asset Manager workspace persistence runtime fixture.
32+
33+
## Active Reference Audit
34+
- PASS: no active `"documentKind": "workspace-manifest"` JSON values remain outside excluded historical or out-of-scope paths.
35+
- PASS: no active code/test expectations remain for `documentKind === "workspace-manifest"`, `PROJECT_DOCUMENT_KIND = "workspace-manifest"`, or `toBe("workspace-manifest")`.
36+
- A non-documentKind schema id remains in the root `workspace.manifest.json`: `html-js-gaming.workspace-manifest.palette-links/1`. It was left unchanged because this PR is scoped to documentKind terminology.
37+
38+
## Validation
39+
- PASS: targeted JSON parse validation for changed manifests.
40+
- PASS: targeted syntax/import validation for changed files.
41+
- PASS: `npm run test:workspace-v2` with 58 passed.
42+
- PASS: active documentKind search checks.
43+
- PASS: `git diff --check`.
44+
45+
## Out Of Scope
46+
- Sample JSON was not modified.
47+
- Roadmap text was not modified.
48+
- Full samples smoke test was skipped as requested.
49+
- Historical reports/docs snapshots were not modified.

games/_template/workspace-manager-v2-UAT.manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"documentKind": "workspace-manifest",
2+
"documentKind": "project-manifest",
33
"schema": "html-js-gaming.project",
44
"version": 1,
55
"id": "workspace-manager-v2-UAT-template",

games/_template/workspace-manager-v2-template.manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"documentKind": "workspace-manifest",
2+
"documentKind": "project-manifest",
33
"schema": "html-js-gaming.project",
44
"version": 1,
55
"id": "workspace-manager-v2-template",

scripts/validate-json-contracts.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ function validateSamples(schemaIndex, validate) {
564564
}
565565

566566
let schemaPath = "";
567-
const isWorkspaceManifest = String(document?.documentKind || "").trim() === "workspace-manifest"
567+
const isWorkspaceManifest = String(document?.documentKind || "").trim() === "project-manifest"
568568
|| String(document?.schema || "").trim().toLowerCase() === "html-js-gaming.project";
569569
if (isWorkspaceManifest) {
570570
rows.push({ filePath: rel, schemaPath: "", status: "skipped", errorCount: 0, firstErrors: "", note: "separate workspace validation contract removed; sample workspace JSON is out of scope" });

tests/playwright/tools/AssetManagerV2.spec.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1292,7 +1292,7 @@ test.describe("Asset Manager V2", () => {
12921292

12931293
test("shows Asset Manager V2 launch guard when Workspace Manager V2 palette context is missing", async ({ page }) => {
12941294
const server = await openAssetManagerWithSessionContext(page, {
1295-
documentKind: "workspace-manifest",
1295+
documentKind: "project-manifest",
12961296
schema: "html-js-gaming.project",
12971297
version: 1,
12981298
id: "workspace-manager-v2-Asteroids",
@@ -1341,7 +1341,7 @@ test.describe("Asset Manager V2", () => {
13411341
toolId: "asset-manager-v2",
13421342
gameId: "Asteroids",
13431343
workspaceManifest: {
1344-
documentKind: "workspace-manifest",
1344+
documentKind: "project-manifest",
13451345
schema: "html-js-gaming.project",
13461346
version: 1,
13471347
id: "legacy-workspace-v2-Asteroids",
@@ -1547,7 +1547,7 @@ test.describe("Asset Manager V2", () => {
15471547
await expect(page.locator("#statusLog")).toHaveValue(/OK workspace\.tools\.asset-manager-v2 now has 19 validated assets\./);
15481548

15491549
const storedContext = await page.evaluate((id) => JSON.parse(sessionStorage.getItem(id)), hostContextId);
1550-
expect(storedContext.documentKind).toBe("workspace-manifest");
1550+
expect(storedContext.documentKind).toBe("project-manifest");
15511551
expect(storedContext.toolId).toBeUndefined();
15521552
expect(storedContext.activePalette).toBeUndefined();
15531553
expect(storedContext.workspaceManifest).toBeUndefined();

tests/playwright/tools/CollisionInspectorV2.spec.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -813,7 +813,7 @@ test.describe("Collision Inspector V2", () => {
813813
try {
814814
const gameManifest = JSON.parse(await readFile(join(server.repoRoot, "games", "Asteroids", "game.manifest.json"), "utf8"));
815815
const workspaceContext = {
816-
documentKind: "workspace-manifest",
816+
documentKind: "project-manifest",
817817
schema: "html-js-gaming.project",
818818
version: 1,
819819
id: "workspace-manager-v2-Asteroids",

tests/playwright/tools/WorkspaceManagerV2.spec.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,7 @@ function workspaceContextFromGameManifest(gameManifest, { repoPath = "", repoRoo
740740
const game = gameManifest.game || {};
741741
const gameRoot = `games/${game.folder}/`;
742742
const context = {
743-
documentKind: "workspace-manifest",
743+
documentKind: "project-manifest",
744744
schema: "html-js-gaming.project",
745745
version: 1,
746746
id: `workspace-manager-v2-${game.id}`,
@@ -9837,7 +9837,7 @@ test.describe("Workspace Manager V2 bootstrap", () => {
98379837
const invalidRuntimeWorkspaceManifest = structuredClone(manifest);
98389838
invalidRuntimeWorkspaceManifest.game.gameData = { workspace: {} };
98399839
const invalidEmbeddedWorkspaceManifest = structuredClone(manifest);
9840-
invalidEmbeddedWorkspaceManifest.game["workspace"] = { documentKind: "workspace-manifest" };
9840+
invalidEmbeddedWorkspaceManifest.game["workspace"] = { documentKind: "project-manifest" };
98419841
const invalidObjectVectorRuntimeManifest = structuredClone(manifest);
98429842
invalidObjectVectorRuntimeManifest.objectVectorRuntime = {
98439843
objectIds: {
@@ -10551,7 +10551,7 @@ test.describe("Workspace Manager V2 bootstrap", () => {
1055110551
const hostContextId = url.searchParams.get("hostContextId");
1055210552
return JSON.parse(sessionStorage.getItem(hostContextId));
1055310553
});
10554-
expect(storedContext.documentKind).toBe("workspace-manifest");
10554+
expect(storedContext.documentKind).toBe("project-manifest");
1055510555
expect(storedContext.toolId).toBeUndefined();
1055610556
expect(storedContext.activePalette).toBeUndefined();
1055710557
expect(storedContext.workspaceManifest).toBeUndefined();

tests/runtime/V2AssetManagerWorkspacePersistence.test.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function simulatePersistence(hostContextId, toolStateContext, limitBytes) {
4747

4848
function simulateWorkspaceExportDocument(activeHostContextId, activeToolStatePayload, savedToolStates) {
4949
return {
50-
documentKind: "workspace-manifest",
50+
documentKind: "project-manifest",
5151
schema: "html-js-gaming.project",
5252
version: 1,
5353
id: `workspace-v2-${activeHostContextId}`,

tools/asset-manager-v2/js/services/WorkspaceBridge.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ function hasOnlyGamesRoot(value) {
1919
return path.startsWith("games/") && !path.includes("/samples/") && !path.includes("/tools/");
2020
}
2121

22-
function isWorkspaceManifest(value) {
22+
function isProjectManifestContext(value) {
2323
return isPlainObject(value)
24-
&& value.documentKind === "workspace-manifest"
24+
&& value.documentKind === "project-manifest"
2525
&& typeof value.schema === "string"
2626
&& isPlainObject(value.tools);
2727
}
@@ -80,7 +80,7 @@ export class WorkspaceBridge {
8080
if (!isPlainObject(workspaceManifest)) {
8181
return { ok: false, message: "Workspace Manager V2 manifest context is invalid." };
8282
}
83-
if (!isWorkspaceManifest(workspaceManifest)) {
83+
if (!isProjectManifestContext(workspaceManifest)) {
8484
return { ok: false, message: "Workspace Manager V2 launch requires a valid manifest/toolState context." };
8585
}
8686
if (Object.prototype.hasOwnProperty.call(workspaceManifest, "workspaceManifest")

tools/preview-generator-v2/PreviewGeneratorV2App.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,15 +179,15 @@ function readWorkspacePreviewGeneratorWorkspace(manifest) {
179179
return { ok: true, workspace };
180180
}
181181

182-
function isWorkspaceManifest(value) {
183-
return isPlainObject(value) && value.documentKind === "workspace-manifest";
182+
function isProjectManifestContext(value) {
183+
return isPlainObject(value) && value.documentKind === "project-manifest";
184184
}
185185

186186
function workspaceManifestFromLaunchContext(launchContext) {
187-
if (isWorkspaceManifest(launchContext)) {
187+
if (isProjectManifestContext(launchContext)) {
188188
return launchContext;
189189
}
190-
if (isWorkspaceManifest(launchContext?.manifest)) {
190+
if (isProjectManifestContext(launchContext?.manifest)) {
191191
return launchContext.manifest;
192192
}
193193
return null;

0 commit comments

Comments
 (0)