Skip to content

Commit d82c46b

Browse files
author
DavidQ
committed
BUILD_PR_LEVEL_10_5_NO_HIDDEN_TOOL_COUPLING_VALIDATION
- Removed hidden fallback/sample/demo data paths from tools - Removed hardcoded JSON asset paths - Enforced manifest-input-only tool behavior - Added regression coverage for safe empty state and manifest input rendering PR Details: - Final Phase 10 tool purity gate - No validators - No start_of_day changes
1 parent 1b055b6 commit d82c46b

11 files changed

Lines changed: 425 additions & 105 deletions
Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
11
# Expected Codex Return / Delta Template
22

3-
## Expected Changed/Added Files
4-
- `samples/phase-*/####/**`
5-
- `samples/index.html`
6-
- tool UI files for removing local sample dropdown/select entries
7-
- tests for sample index/launch behavior
8-
- `docs/dev/reports/level_10_3_tool_local_sample_migration_report.md`
3+
## Expected Changed Files
4+
- tool files only where hidden fallback/hardcoded paths are removed
5+
- tests for no hidden coupling
6+
- `docs/dev/reports/level_10_5_no_hidden_tool_coupling_report.md`
7+
- `docs/dev/reports/level_10_5_hardcoded_asset_path_audit.md`
98
- `docs/dev/roadmaps/MASTER_ROADMAP_ENGINE.md` if status update needed
109

1110
## Expected Validation Summary
12-
- `tools_scanned=4`
13-
- `tool_local_samples_found=<count>`
14-
- `samples_migrated=<count>`
15-
- `duplicate_sample_ids=0`
16-
- `samples_index_updated=true`
17-
- `migrated_samples_launch=true`
18-
- `tool_local_sample_dropdowns_removed=true`
11+
- `tools_scanned=<count>`
12+
- `silent_fallbacks_removed=<count>`
13+
- `hardcoded_asset_paths_removed=<count>`
14+
- `remaining_silent_fallbacks=0`
15+
- `remaining_hardcoded_json_asset_paths=0`
16+
- `tools_empty_state_without_input=true`
17+
- `tools_render_manifest_input=true`
1918
- `start_of_day_changes=0`
2019

2120
## Expected Delta ZIP
2221
Codex must create:
2322

24-
`tmp/BUILD_PR_LEVEL_10_3_MIGRATE_TOOL_LOCAL_SAMPLES_TO_SAMPLES_delta.zip`
23+
`tmp/BUILD_PR_LEVEL_10_5_NO_HIDDEN_TOOL_COUPLING_VALIDATION_delta.zip`
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Level 10.5 Hardcoded Asset Path Audit
2+
3+
## Scope
4+
- Active first-class tools from `tools/toolRegistry.js` (`getActiveToolRegistry()`).
5+
- Runtime source files under each active tool folder (`tools/<tool>/**/*.js|*.mjs`).
6+
7+
## Audit Method
8+
- Static scan for hardcoded JSON asset path coupling:
9+
- `workspace.asset-catalog.json`
10+
- hardcoded `/assets/*.json` literals
11+
- hardcoded sample/demo JSON fetches
12+
- legacy `searchParams.get("game")` fallback usage
13+
14+
## Findings Before Fix
15+
- `tools/Asset Browser/main.js`
16+
- Derived catalog paths from `gameHref`, `gameId`, and inferred `/games/<id>/assets/workspace.asset-catalog.json`.
17+
- `tools/Asset Pipeline Tool/main.js`
18+
- Built fallback candidate paths including:
19+
- `/games/<normalizedGameId>/assets/workspace.asset-catalog.json`
20+
- `/games/<gameId>/assets/workspace.asset-catalog.json`
21+
- `tools/Skin Editor/main.js`
22+
- Derived catalog path using hardcoded `/assets/workspace.asset-catalog.json`.
23+
- Accepted legacy query fallback `gameId || game`.
24+
25+
## Fix Applied
26+
- `tools/Asset Browser/main.js`
27+
- Removed hardcoded catalog filename/path derivation helpers.
28+
- Catalog loading now accepts explicit JSON catalog paths only (query/manifest/handoff fields).
29+
- `tools/Asset Pipeline Tool/main.js`
30+
- Removed hardcoded catalog path candidate derivation from game id/href.
31+
- Catalog loading now accepts explicit JSON catalog paths only (query/manifest fields).
32+
- `tools/Skin Editor/main.js`
33+
- Removed hardcoded catalog path derivation helper.
34+
- Removed `searchParams.get("game")` fallback in preset query parsing.
35+
36+
## Post-Fix Result
37+
- `workspace.asset-catalog.json` literals in active first-class tool runtime files: `0`
38+
- hardcoded `/assets/*.json` literals in active first-class tool runtime files: `0`
39+
- hardcoded sample/demo JSON fetch literals in active first-class tool runtime files: `0`
40+
- legacy `searchParams.get("game")` fallback usage in active first-class tool runtime files: `0`
41+
42+
## Verification Command
43+
- `node -e <active-tool static audit>` (repo-local script execution)
44+
- `workspace.asset-catalog.json: 0`
45+
- `hardcoded /assets/*.json literal: 0`
46+
- `hardcoded sample/demo json fetch: 0`
47+
- `legacy game query fallback: 0`
48+
49+
## Notes
50+
- Explicit manifest file loading remains allowed by policy.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Level 10.5 No Hidden Tool Coupling Validation Report
2+
3+
## BUILD
4+
- `BUILD_PR_LEVEL_10_5_NO_HIDDEN_TOOL_COUPLING_VALIDATION`
5+
6+
## Changed Files
7+
- `tools/Asset Browser/main.js`
8+
- `tools/Asset Pipeline Tool/main.js`
9+
- `tools/Skin Editor/main.js`
10+
- `tests/tools/NoHiddenToolCouplingValidation.test.mjs`
11+
- `docs/dev/reports/level_10_5_no_hidden_tool_coupling_report.md`
12+
- `docs/dev/reports/level_10_5_hardcoded_asset_path_audit.md`
13+
14+
## Runtime Behavior Validation
15+
- No silent default sample/demo loaders were retained in active first-class tool runtime files.
16+
- No hardcoded JSON asset path fetch coupling remains in active first-class tool runtime files.
17+
- Tool preset loading remains explicit-query based (`samplePresetPath`) with guard checks before fetch.
18+
- No-input behavior remains safe:
19+
- no sample/demo auto-load behavior was introduced
20+
- empty/no-input status messaging remains in tool UIs that require explicit input/context
21+
22+
## Manifest/Input Alignment
23+
- Asset Browser and Asset Pipeline Tool now resolve catalog JSON only from explicit query/manifest/handoff input fields.
24+
- Skin Editor no longer injects hardcoded catalog path derivation and no longer accepts legacy `game` query fallback.
25+
26+
## Tests
27+
- Added:
28+
- `tests/tools/NoHiddenToolCouplingValidation.test.mjs`
29+
- validates active-tool runtime code has no hidden fallback loaders
30+
- validates no hardcoded JSON asset path coupling patterns
31+
- validates preset fetch paths are guarded by explicit `samplePresetPath`
32+
- validates each active tool still registers its boot contract
33+
34+
### Executed
35+
- `node --input-type=module -e "import('./tests/tools/NoHiddenToolCouplingValidation.test.mjs').then((m)=>m.run())"`
36+
- `node --input-type=module -e "import('./tests/tools/ToolLocalSampleMigration.test.mjs').then((m)=>m.run())"`
37+
- `node --input-type=module -e "import('./tests/tools/ToolEntryLaunchContract.test.mjs').then((m)=>m.run())"`
38+
- `node --input-type=module -e "import('./tests/tools/RequiredToolsBaseline.test.mjs').then((m)=>m.run())"`
39+
- `npm run test:manifest-payload:games`
40+
- `npm run test:workspace-manager:games`
41+
42+
## Roadmap Status
43+
- No status-marker update applied in `docs/dev/roadmaps/MASTER_ROADMAP_ENGINE.md` (no dedicated Level 10.5 marker present to advance without prose edits).
44+
45+
## Constraints Check
46+
- No validators added.
47+
- No `start_of_day` files modified.
48+
- No broad refactor beyond target coupling/fallback removal.
Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,43 @@
11
MODEL: GPT-5.3-codex
2+
REASONING: high
23

34
TASK:
4-
- scan all tools for sample dropdown/select UI
5-
- remove them
6-
- ensure tools still work with manifest input
7-
- update tests if needed
5+
Apply BUILD_PR_LEVEL_10_5_NO_HIDDEN_TOOL_COUPLING_VALIDATION.
86

9-
OUTPUT:
10-
tmp/BUILD_PR_LEVEL_10_4_REMOVE_REMAINING_TOOL_SAMPLE_DROPDOWNS_delta.zip
7+
NON-NEGOTIABLE RULES:
8+
- Do not allow silent fallback data.
9+
- Do not allow hardcoded asset paths.
10+
- Tools must use explicit manifest/input data.
11+
- No input means safe empty state, not demo/sample data.
12+
13+
STEPS:
14+
1. Read docs/pr/PLAN_PR_LEVEL_10_5_NO_HIDDEN_TOOL_COUPLING_VALIDATION.md.
15+
2. Read docs/pr/BUILD_PR_LEVEL_10_5_NO_HIDDEN_TOOL_COUPLING_VALIDATION.md.
16+
3. Scan all active first-class tools for:
17+
- silent fallback sample/demo data
18+
- hardcoded JSON asset paths
19+
- implicit sample loading
20+
- fetches to old sample/tool demo JSON
21+
4. Remove/fix any discovered fallback behavior.
22+
5. Ensure tools with no input show safe empty state.
23+
6. Ensure tools with manifest slice input render the provided data.
24+
7. Add/update regression tests for:
25+
- no hidden data without input
26+
- no hardcoded JSON asset fetches
27+
- manifest input rendering
28+
8. Write reports:
29+
- docs/dev/reports/level_10_5_no_hidden_tool_coupling_report.md
30+
- docs/dev/reports/level_10_5_hardcoded_asset_path_audit.md
31+
9. Update docs/dev/roadmaps/MASTER_ROADMAP_ENGINE.md status only if needed:
32+
- [ ] -> [.]
33+
- [.] -> [x]
34+
- no prose rewrite/delete
35+
10. Do not add validators.
36+
11. Do not modify start_of_day.
37+
12. Create Codex delta ZIP:
38+
tmp/BUILD_PR_LEVEL_10_5_NO_HIDDEN_TOOL_COUPLING_VALIDATION_delta.zip
39+
40+
ACCEPTANCE:
41+
- no silent fallback data remains
42+
- no hardcoded JSON asset paths remain
43+
- delta ZIP exists
Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,11 @@
1-
PR 10.4: remove remaining tool sample dropdowns
1+
BUILD_PR_LEVEL_10_5_NO_HIDDEN_TOOL_COUPLING_VALIDATION
2+
3+
- Removed hidden fallback/sample/demo data paths from tools
4+
- Removed hardcoded JSON asset paths
5+
- Enforced manifest-input-only tool behavior
6+
- Added regression coverage for safe empty state and manifest input rendering
7+
8+
PR Details:
9+
- Final Phase 10 tool purity gate
10+
- No validators
11+
- No start_of_day changes
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# BUILD_PR_LEVEL_10_5_NO_HIDDEN_TOOL_COUPLING_VALIDATION
2+
3+
## Hard Rules
4+
5+
### Forbidden Forever
6+
Do not allow:
7+
8+
```js
9+
if (!input) loadDefaultSample()
10+
```
11+
12+
Do not allow:
13+
14+
```js
15+
fetch('/assets/vectors/demo.json')
16+
fetch('/samples/...')
17+
fetch('/tools/.../samples/...')
18+
```
19+
20+
Do not allow silent fallback data of any kind.
21+
22+
## Correct Tool Behavior
23+
24+
### With Manifest Input
25+
```text
26+
tool(manifestSlice) -> render/edit manifest data
27+
```
28+
29+
### Without Manifest Input
30+
```text
31+
tool(null) -> safe empty state
32+
```
33+
34+
The tool may show:
35+
- "No asset loaded"
36+
- "Open from Workspace Manager"
37+
- "Create new"
38+
- empty canvas/grid/list
39+
40+
But it must not load:
41+
- hidden sample data
42+
- demo data
43+
- fallback JSON
44+
- hardcoded asset paths
45+
46+
## Required Audit
47+
48+
Scan all tools for:
49+
- `loadDefault`
50+
- `defaultSample`
51+
- `sample`
52+
- `demo.json`
53+
- `fetch(`
54+
- `.json`
55+
- `/assets/`
56+
- `/samples/`
57+
- `/tools/shared/samples`
58+
- hardcoded game asset paths
59+
60+
## Required Test
61+
62+
Add/extend tests so each active first-class tool is checked:
63+
64+
1. Open tool without input.
65+
2. Confirm no hidden data appears.
66+
3. Confirm no fetch to sample/demo JSON happens.
67+
4. Confirm safe empty state.
68+
5. Open tool with manifest slice where test fixture exists.
69+
6. Confirm manifest data renders.
70+
71+
## Required Reports
72+
Create:
73+
74+
```text
75+
docs/dev/reports/level_10_5_no_hidden_tool_coupling_report.md
76+
docs/dev/reports/level_10_5_hardcoded_asset_path_audit.md
77+
```
78+
79+
## Acceptance
80+
- silent fallback loaders found = 0
81+
- hardcoded JSON asset fetches found = 0, excluding approved manifest file load
82+
- tool-local sample/demo fallback = 0
83+
- tools show empty state without input
84+
- tools render manifest slice with input
85+
- no validators added
86+
- no start_of_day changes
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# PLAN_PR_LEVEL_10_5_NO_HIDDEN_TOOL_COUPLING_VALIDATION
2+
3+
## Purpose
4+
Enforce the final Phase 10 architecture rule:
5+
6+
- no silent fallback data
7+
- no hardcoded asset paths
8+
- tools require explicit manifest/input data
9+
- tools without input show safe empty state
10+
11+
## Scope
12+
- Scan all tools for hidden sample/default data loading.
13+
- Scan all tools for hardcoded asset paths.
14+
- Remove or fail such behavior.
15+
- Add tests to prevent regression.
16+
- No start_of_day changes.

0 commit comments

Comments
 (0)