Skip to content

Commit c27970b

Browse files
author
DavidQ
committed
Remove redundant manifest documentKind field - PR_26140_056-remove-manifest-documentkind-field
1 parent 09a379f commit c27970b

16 files changed

Lines changed: 74 additions & 47 deletions
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Manifest DocumentKind Removal Report
2+
3+
PR: `PR_26140_056-remove-manifest-documentkind-field`
4+
5+
## Summary
6+
- Removed `documentKind` from active project/workspace manifest contexts where it duplicated `schema`.
7+
- Kept `schema` as the contract identifier for Workspace Manager V2 project contexts.
8+
- Preserved Workspace Manager V2 launch/save behavior.
9+
10+
## Manifest Updates
11+
- `games/_template/workspace-manager-v2-template.manifest.json`
12+
- Removed root `documentKind`.
13+
- Preserves `schema: "html-js-gaming.project"`.
14+
- `games/_template/workspace-manager-v2-UAT.manifest.json`
15+
- Removed root `documentKind`.
16+
- Preserves `schema: "html-js-gaming.project"`.
17+
- `workspace.manifest.json`
18+
- Removed root `documentKind`.
19+
20+
## Runtime And Tool Updates
21+
- Workspace Manager V2 no longer emits or validates `documentKind` in generated project contexts.
22+
- Workspace Manager V2 validates project contexts by `schema: "html-js-gaming.project"`.
23+
- Workspace tool sessions no longer include `workspaceDocumentKind`.
24+
- Asset Manager V2 workspace launch guard validates project context by schema only.
25+
- Preview Generator V2 workspace launch context detection validates project context by schema only.
26+
- Shared document/preset detection uses project schema only.
27+
- Project manifest creation/validation no longer emits, migrates, or requires `documentKind`.
28+
- Project tool integration no longer emits nested tool-entry `documentKind`.
29+
30+
## Test Updates
31+
- Workspace Manager V2 fixtures no longer include `documentKind`.
32+
- Asset Manager V2 fixtures no longer include `documentKind`.
33+
- Collision Inspector V2 fixture no longer includes `documentKind`.
34+
- Runtime workspace persistence fixture no longer includes `documentKind`.
35+
- Tests assert stored active contexts do not include `documentKind`.
36+
37+
## Active Dependency Audit
38+
- PASS: no `documentKind` references remain in active runtime/tool/script code or active template/root manifests:
39+
- `tools`
40+
- `scripts`
41+
- `games/_template`
42+
- `workspace.manifest.json`
43+
- Remaining `documentKind` mentions outside that active runtime surface are tests that assert absence and a standalone sample wrapper-field guard.
44+
- Sample JSON was not modified.
45+
46+
## Validation
47+
- PASS: targeted JSON parse validation for changed manifests.
48+
- PASS: targeted syntax/import validation for changed files.
49+
- PASS: `ProjectToolDataContracts` targeted validation.
50+
- PASS: Workspace Manager V2 schema-only validation for both template manifests without `documentKind`.
51+
- PASS: `npm run test:workspace-v2` with 58 passed.
52+
- PASS: `git diff --check`.
53+
54+
## Out Of Scope
55+
- Full samples smoke test was skipped as requested.
56+
- Sample JSON was not touched.
57+
- Roadmap text was not touched.
58+
- Historical reports/docs snapshots were not modified.

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
"documentKind": "project-manifest",
32
"schema": "html-js-gaming.project",
43
"version": 1,
54
"id": "workspace-manager-v2-UAT-template",

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
"documentKind": "project-manifest",
32
"schema": "html-js-gaming.project",
43
"version": 1,
54
"id": "workspace-manager-v2-template",

scripts/validate-json-contracts.mjs

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

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

tests/playwright/tools/AssetManagerV2.spec.mjs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1292,7 +1292,6 @@ 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: "project-manifest",
12961295
schema: "html-js-gaming.project",
12971296
version: 1,
12981297
id: "workspace-manager-v2-Asteroids",
@@ -1341,7 +1340,6 @@ test.describe("Asset Manager V2", () => {
13411340
toolId: "asset-manager-v2",
13421341
gameId: "Asteroids",
13431342
workspaceManifest: {
1344-
documentKind: "project-manifest",
13451343
schema: "html-js-gaming.project",
13461344
version: 1,
13471345
id: "legacy-workspace-v2-Asteroids",
@@ -1547,7 +1545,7 @@ test.describe("Asset Manager V2", () => {
15471545
await expect(page.locator("#statusLog")).toHaveValue(/OK workspace\.tools\.asset-manager-v2 now has 19 validated assets\./);
15481546

15491547
const storedContext = await page.evaluate((id) => JSON.parse(sessionStorage.getItem(id)), hostContextId);
1550-
expect(storedContext.documentKind).toBe("project-manifest");
1548+
expect(storedContext.documentKind).toBeUndefined();
15511549
expect(storedContext.toolId).toBeUndefined();
15521550
expect(storedContext.activePalette).toBeUndefined();
15531551
expect(storedContext.workspaceManifest).toBeUndefined();

tests/playwright/tools/CollisionInspectorV2.spec.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -813,7 +813,6 @@ 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: "project-manifest",
817816
schema: "html-js-gaming.project",
818817
version: 1,
819818
id: "workspace-manager-v2-Asteroids",

tests/playwright/tools/WorkspaceManagerV2.spec.mjs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,6 @@ function workspaceContextFromGameManifest(gameManifest, { repoPath = "", repoRoo
740740
const game = gameManifest.game || {};
741741
const gameRoot = `games/${game.folder}/`;
742742
const context = {
743-
documentKind: "project-manifest",
744743
schema: "html-js-gaming.project",
745744
version: 1,
746745
id: `workspace-manager-v2-${game.id}`,
@@ -9837,7 +9836,7 @@ test.describe("Workspace Manager V2 bootstrap", () => {
98379836
const invalidRuntimeWorkspaceManifest = structuredClone(manifest);
98389837
invalidRuntimeWorkspaceManifest.game.gameData = { workspace: {} };
98399838
const invalidEmbeddedWorkspaceManifest = structuredClone(manifest);
9840-
invalidEmbeddedWorkspaceManifest.game["workspace"] = { documentKind: "project-manifest" };
9839+
invalidEmbeddedWorkspaceManifest.game["workspace"] = { schema: "html-js-gaming.project" };
98419840
const invalidObjectVectorRuntimeManifest = structuredClone(manifest);
98429841
invalidObjectVectorRuntimeManifest.objectVectorRuntime = {
98439842
objectIds: {
@@ -9864,11 +9863,9 @@ test.describe("Workspace Manager V2 bootstrap", () => {
98649863
embeddedWorkspaceValidation: await service.validateGameManifest(invalidEmbeddedWorkspaceManifest),
98659864
objectVectorRuntimeValidation: await service.validateGameManifest(invalidObjectVectorRuntimeManifest),
98669865
runtimeWorkspaceValidation: await service.validateGameManifest(invalidRuntimeWorkspaceManifest),
9867-
rootDocumentKind: manifest.documentKind || "",
98689866
schema: manifest.schema,
98699867
unknownGameDataValidation: await service.validateGameManifest(invalidUnknownGameDataManifest),
98709868
unknownWorkspaceValidation: await service.validateGeneratedManifest(invalidUnknownWorkspaceManifest),
9871-
workspaceDocumentKind: manifest.game?.["workspace"]?.documentKind,
98729869
workspaceValidation: await service.validateGeneratedManifest(workspaceManifest)
98739870
};
98749871
});
@@ -9879,11 +9876,9 @@ test.describe("Workspace Manager V2 bootstrap", () => {
98799876
hasRootTools: true,
98809877
hasWorkspace: false,
98819878
objectVectorRuntimeValidation: { ok: false },
9882-
rootDocumentKind: "",
98839879
schema: "html-js-gaming.game-manifest",
98849880
unknownGameDataValidation: { ok: false },
98859881
unknownWorkspaceValidation: { ok: false },
9886-
workspaceDocumentKind: undefined,
98879882
workspaceValidation: { ok: true }
98889883
});
98899884
expect(asteroidsGameManifestShape.embeddedWorkspaceValidation.message).toContain("Embedded workspace data under root.game is not allowed");
@@ -10551,7 +10546,7 @@ test.describe("Workspace Manager V2 bootstrap", () => {
1055110546
const hostContextId = url.searchParams.get("hostContextId");
1055210547
return JSON.parse(sessionStorage.getItem(hostContextId));
1055310548
});
10554-
expect(storedContext.documentKind).toBe("project-manifest");
10549+
expect(storedContext.documentKind).toBeUndefined();
1055510550
expect(storedContext.toolId).toBeUndefined();
1055610551
expect(storedContext.activePalette).toBeUndefined();
1055710552
expect(storedContext.workspaceManifest).toBeUndefined();
@@ -10640,8 +10635,8 @@ test.describe("Workspace Manager V2 bootstrap", () => {
1064010635
]);
1064110636
const url = new URL(window.location.href);
1064210637
const manifest = JSON.parse(sessionStorage.getItem(url.searchParams.get("hostContextId")));
10643-
const allowedManifestKeys = new Set(["documentKind", "schema", "version", "id", "name", "gameId", "gameRoot", "assetsPath", "screen", "repoRoot", "repoPath", "tools"]);
10644-
const requiredManifestKeys = ["documentKind", "schema", "version", "id", "name", "gameId", "gameRoot", "assetsPath", "tools"];
10638+
const allowedManifestKeys = new Set(["schema", "version", "id", "name", "gameId", "gameRoot", "assetsPath", "screen", "repoRoot", "repoPath", "tools"]);
10639+
const requiredManifestKeys = ["schema", "version", "id", "name", "gameId", "gameRoot", "assetsPath", "tools"];
1064510640
const allowedToolKeys = new Set(["palette-manager-v2", "asset-manager-v2", "object-vector-studio-v2", "collision-inspector-v2", "text2speech-V2"]);
1064610641
const palettePayload = manifest.tools["palette-manager-v2"];
1064710642
const assetPayload = manifest.tools["asset-manager-v2"];

tests/runtime/V2AssetManagerWorkspacePersistence.test.mjs

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

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

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ function hasOnlyGamesRoot(value) {
2121

2222
function isProjectManifestContext(value) {
2323
return isPlainObject(value)
24-
&& value.documentKind === "project-manifest"
25-
&& typeof value.schema === "string"
24+
&& value.schema === "html-js-gaming.project"
2625
&& isPlainObject(value.tools);
2726
}
2827

@@ -89,7 +88,7 @@ export class WorkspaceBridge {
8988
return { ok: false, message: "Workspace Manager V2 launch no longer accepts wrapper context JSON." };
9089
}
9190
const unsupportedManifestKeys = Object.keys(workspaceManifest)
92-
.filter((key) => !["documentKind", "schema", "version", "id", "name", "gameId", "gameRoot", "assetsPath", "screen", "repoRoot", "repoPath", "tools"].includes(key));
91+
.filter((key) => !["schema", "version", "id", "name", "gameId", "gameRoot", "assetsPath", "screen", "repoRoot", "repoPath", "tools"].includes(key));
9392
if (unsupportedManifestKeys.length) {
9493
return { ok: false, message: `Workspace Manager V2 manifest includes fields not allowed by the manifest/toolState contract: ${unsupportedManifestKeys.join(", ")}.` };
9594
}

tools/preview-generator-v2/PreviewGeneratorV2App.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ function readWorkspacePreviewGeneratorWorkspace(manifest) {
180180
}
181181

182182
function isProjectManifestContext(value) {
183-
return isPlainObject(value) && value.documentKind === "project-manifest";
183+
return isPlainObject(value) && value.schema === "html-js-gaming.project";
184184
}
185185

186186
function workspaceManifestFromLaunchContext(launchContext) {

0 commit comments

Comments
 (0)