Skip to content

Commit 99c34cf

Browse files
author
DavidQ
committed
BUILD_PR_LEVEL_09_06_TOOL_LAUNCH_CONTRACT_ALIGNMENT
Enforces consistent tool launch contract across active tools. No engine/runtime changes.
1 parent f961918 commit 99c34cf

14 files changed

Lines changed: 116 additions & 48 deletions

File tree

docs/dev/CODEX_COMMANDS.md

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
1-
MODEL: GPT-5.4
2-
REASONING: high
3-
COMMAND: Create BUILD_PR_LEVEL_09_05_SHARED_ASSET_HANDOFF_ENFORCEMENT as a docs-first, repo-structured delta. Use docs/pr/BUILD_PR_LEVEL_09_05_SHARED_ASSET_HANDOFF_ENFORCEMENT.md as the source of truth. Implement the smallest safe enforcement slice that makes first-class tools launch and consume shared asset/palette handoffs through the normalized contract established by 09_04. Keep scope limited to first-class tools, shared launch/handoff helpers, and focused tests only. Do not modify engine core APIs, game runtime behavior, legacy tool surfacing, or perform broad UI cleanup.
4-
5-
FINAL STEP:
6-
- Package all created and modified files into a repo-structured ZIP
7-
- Write the result ZIP to: <project folder>/tmp/BUILD_PR_LEVEL_09_05_SHARED_ASSET_HANDOFF_ENFORCEMENT.zip
8-
- Preserve exact repo-relative structure inside the ZIP
9-
- Include only files relevant to this PR
10-
- Do not include unrelated files, full-repo copies, dependencies, or build artifacts
11-
1+
MODEL: GPT-5.3-codex
2+
REASONING: medium
3+
COMMAND:
4+
- Align tool entry files to standard launch contract
5+
- Ensure config loading is consistent across tools
6+
- Validate asset/palette integration hooks

docs/dev/COMMIT_COMMENT.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
build(assets): enforce shared tool asset and palette handoff contract
1+
BUILD_PR_LEVEL_09_06_TOOL_LAUNCH_CONTRACT_ALIGNMENT
2+
3+
Enforces consistent tool launch contract across active tools.
4+
No engine/runtime changes.

docs/dev/NEXT_COMMAND.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
APPLY_PR_LEVEL_09_05_SHARED_ASSET_HANDOFF_ENFORCEMENT
1+
Proceed to BUILD_PR_LEVEL_09_07_TOOL_BOUNDARY_NORMALIZATION
Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
BUILD bundle created for the post-09_04 enforcement slice.
2-
3-
Summary:
4-
- continues directly from 09_04 asset structure simplification
5-
- preserves the 09_04 asset usage contract as the source baseline
6-
- narrows the next PR to first-class tool shared handoff enforcement only
7-
- avoids engine changes, gameplay changes, and broad tool cleanup
8-
- requires focused validation for canonical query parameters, storage keys, payload shapes, and safe fallback behavior
1+
- Added tool launch contract documentation
2+
- Standardized entry expectations
3+
- Prepared tools for normalization phase
Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,4 @@
1-
[ ] PR scope remains limited to shared handoff enforcement.
2-
[ ] Asset Browser launch flows use normalized `view` and `sourceToolId` parameters.
3-
[ ] Shared action labels remain exact and normalized.
4-
[ ] `toolboxaid.shared.assetHandoff` is the only asset handoff key used.
5-
[ ] `toolboxaid.shared.paletteHandoff` is the only palette handoff key used.
6-
[ ] Asset payload preserves canonical top-level fields.
7-
[ ] Palette payload preserves canonical top-level fields.
8-
[ ] Consuming tools prefer valid shared handoffs over hidden private defaults.
9-
[ ] Invalid/missing handoff payloads degrade safely.
10-
[ ] Starter template remains compatible.
11-
[ ] Legacy tools remain excluded.
12-
[ ] No engine core API files are changed.
1+
[ ] Tool entry points aligned
2+
[ ] Config loading consistent
3+
[ ] No engine changes introduced
4+
[ ] Docs match implementation intent
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# BUILD PR — LEVEL 09_06 — TOOL LAUNCH CONTRACT ALIGNMENT
2+
3+
## Purpose
4+
Enforce consistent tool launch entry and configuration contract across all active tools.
5+
6+
## Scope
7+
- Define standard tool entry pattern
8+
- Normalize config loading expectations
9+
- Align asset + palette + IO integration points
10+
11+
## Non-Goals
12+
- No engine changes
13+
- No runtime logic changes

tests/run-tests.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ import { run as runStorageService } from './persistence/StorageService.test.mjs'
8888
import { run as runAssetValidationEngine } from './tools/AssetValidationEngine.test.mjs';
8989
import { run as runAssetUsageIntegration } from './tools/AssetUsageIntegration.test.mjs';
9090
import { run as runAssetRemediationSystem } from './tools/AssetRemediationSystem.test.mjs';
91+
import { run as runToolEntryLaunchContract } from './tools/ToolEntryLaunchContract.test.mjs';
9192
import { run as runProjectPackagingSystem } from './tools/ProjectPackagingSystem.test.mjs';
9293
import { run as runRuntimeAssetLoader } from './tools/RuntimeAssetLoader.test.mjs';
9394
import { run as runEditorExperienceLayer } from './tools/EditorExperienceLayer.test.mjs';
@@ -200,6 +201,7 @@ const tests = [
200201
['AssetValidationEngine', runAssetValidationEngine],
201202
['AssetUsageIntegration', runAssetUsageIntegration],
202203
['AssetRemediationSystem', runAssetRemediationSystem],
204+
['ToolEntryLaunchContract', runToolEntryLaunchContract],
203205
['ProjectPackagingSystem', runProjectPackagingSystem],
204206
['RuntimeAssetLoader', runRuntimeAssetLoader],
205207
['EditorExperienceLayer', runEditorExperienceLayer],
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
import assert from "node:assert/strict";
2+
import { readFileSync } from "node:fs";
3+
import {
4+
SHARED_ACTION_LABELS,
5+
getSharedShellActions
6+
} from "../../tools/shared/assetUsageIntegration.js";
7+
8+
const FIRST_CLASS_TOOL_INDEXES = Object.freeze([
9+
{ toolId: "asset-browser", indexPath: "../../tools/Asset Browser/index.html" },
10+
{ toolId: "sprite-editor", indexPath: "../../tools/Sprite Editor/index.html" },
11+
{ toolId: "vector-map-editor", indexPath: "../../tools/Vector Map Editor/index.html" },
12+
{ toolId: "vector-asset-studio", indexPath: "../../tools/Vector Asset Studio/index.html" },
13+
{ toolId: "tile-map-editor", indexPath: "../../tools/Tilemap Studio/index.html" },
14+
{ toolId: "parallax-editor", indexPath: "../../tools/Parallax Scene Studio/index.html" },
15+
{ toolId: "palette-browser", indexPath: "../../tools/Palette Browser/index.html" }
16+
]);
17+
18+
export async function run() {
19+
const previousWindow = globalThis.window;
20+
globalThis.window = {
21+
location: {
22+
search: ""
23+
}
24+
};
25+
26+
try {
27+
FIRST_CLASS_TOOL_INDEXES.forEach(({ toolId }) => {
28+
const actions = getSharedShellActions(toolId, "tool");
29+
assert.equal(actions.length, 4);
30+
assert.deepEqual(
31+
actions.map((action) => action.label),
32+
[
33+
SHARED_ACTION_LABELS.browseAssets,
34+
SHARED_ACTION_LABELS.importAssets,
35+
SHARED_ACTION_LABELS.browsePalettes,
36+
SHARED_ACTION_LABELS.managePalettes
37+
]
38+
);
39+
assert.equal(
40+
actions[0].href,
41+
`../Asset Browser/index.html?view=browse&sourceToolId=${toolId}`
42+
);
43+
assert.equal(
44+
actions[1].href,
45+
`../Asset Browser/index.html?view=import&sourceToolId=${toolId}`
46+
);
47+
assert.equal(
48+
actions[2].href,
49+
`../Palette Browser/index.html?view=browse&sourceToolId=${toolId}`
50+
);
51+
assert.equal(
52+
actions[3].href,
53+
`../Palette Browser/index.html?view=manage&sourceToolId=${toolId}`
54+
);
55+
});
56+
} finally {
57+
globalThis.window = previousWindow;
58+
}
59+
60+
FIRST_CLASS_TOOL_INDEXES.forEach(({ toolId, indexPath }) => {
61+
const fileUrl = new URL(indexPath, import.meta.url);
62+
const html = readFileSync(fileUrl, "utf8");
63+
assert.match(html, new RegExp(`data-tool-id="${toolId}"`));
64+
assert.match(html, /<script type="module" src="\.\.\/shared\/platformShell\.js"><\/script>/);
65+
});
66+
}

tools/Performance Profiler/main.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import {
22
runDeterministicWorkloadIteration,
33
summarizeDurationSamples,
44
toPrettyJson
5-
} from "../../tools/shared/debugInspectorData.js";
6-
import { readToolHostSharedContextFromLocation } from "../../tools/shared/toolHostSharedContext.js";
7-
import { registerToolBootContract } from "../../tools/shared/toolBootContract.js";
5+
} from "../shared/debugInspectorData.js";
6+
import { readToolHostSharedContextFromLocation } from "../shared/toolHostSharedContext.js";
7+
import { registerToolBootContract } from "../shared/toolBootContract.js";
88
import { isFiniteNumber } from "../../src/shared/utils/numberUtils.js";
99

1010
const refs = {

tools/Replay Visualizer/main.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import {
44
normalizeReplayEvents,
55
safeParseJson,
66
toPrettyJson
7-
} from "../../tools/shared/debugInspectorData.js";
8-
import { readToolHostSharedContextFromLocation } from "../../tools/shared/toolHostSharedContext.js";
9-
import { registerToolBootContract } from "../../tools/shared/toolBootContract.js";
7+
} from "../shared/debugInspectorData.js";
8+
import { readToolHostSharedContextFromLocation } from "../shared/toolHostSharedContext.js";
9+
import { registerToolBootContract } from "../shared/toolBootContract.js";
1010
import { isFiniteNumber } from "../../src/shared/utils/numberUtils.js";
1111

1212
const refs = {

0 commit comments

Comments
 (0)