Skip to content

Commit e858d42

Browse files
author
DavidQ
committed
Fix next group of failing tools from audit using bundled approach with strict Workspace V2 contract - PR_26124_007-bundle-next-tools
1 parent 26d5d13 commit e858d42

7 files changed

Lines changed: 96 additions & 1 deletion

File tree

docs/dev/codex_commands.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,3 +306,10 @@ PR_26124_006-playwright-ctrl-tap-debug
306306
```bash
307307
npx @openai/codex run --model gpt-5.3-codex --reasoning medium "Implement PR_26124_006: add shared Ctrl tap (Control down/up) before key Playwright click actions for Workspace V2 navigation/tool/workspace interaction points without changing runtime behavior."
308308
```
309+
310+
---
311+
PR_26124_007-tool-payload-guards-group
312+
313+
```bash
314+
npx @openai/codex run --model gpt-5.3-codex --reasoning medium "Implement PR_26124_007: fix next small group of failing tools (asset-manager-v2 + palette-manager-v2) by adding strict pre-render cross-tool payload guards while preserving workspace launch behavior."
315+
```

docs/dev/commit_comment.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Add shared Playwright Ctrl-tap-before-click helper for Workspace V2 navigation and tool/workspace interaction actions - PR_26124_006-playwright-ctrl-tap-debug
1+
Add strict pre-render cross-tool payload guards for Asset Manager V2 and Palette Manager V2 without schema/runtime feature changes - PR_26124_007-tool-payload-guards-group
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# PR_26124_007 Report
2+
3+
## Scope
4+
- Small related tool group fix (2 tools):
5+
- `asset-manager-v2`
6+
- `palette-manager-v2`
7+
8+
## Changes
9+
1. `tools/asset-manager-v2/index.js`
10+
- Added pre-render rejection for invalid root key `paletteJson`.
11+
- Error shown before render:
12+
- `Asset Manager V2 session data is invalid. paletteJson is not supported; use payloadJson.assetCatalog.`
13+
14+
2. `tools/palette-manager-v2/index.js`
15+
- Added pre-render rejection for invalid `payloadJson.assetCatalog`.
16+
- Error shown before render:
17+
- `Palette Manager V2 session data is invalid. payloadJson.assetCatalog is not supported; use payloadJson.paletteDocument.`
18+
19+
## Contract Outcomes
20+
- Valid JSON: unchanged, loads/renders correctly.
21+
- Invalid cross-tool JSON: rejected before render with clear visible error.
22+
- No fallback/default data introduced.
23+
- Workspace integration remains `payloadJson`-based with no schema changes.
24+
- Workspace launch remains functional for valid matching sessions.
25+
26+
## Validation
27+
- `node --check tools/asset-manager-v2/index.js` -> PASS
28+
- `node --check tools/palette-manager-v2/index.js` -> PASS
29+
- `npm run test:workspace-v2` -> PASS
30+
- `Workspace V2 Playwright Gate Summary: passed=1 failed=0`
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# BUILD_PR — PR_26124_007
2+
3+
## Scope
4+
- Exactly two related tools:
5+
- `tools/asset-manager-v2/index.js`
6+
- `tools/palette-manager-v2/index.js`
7+
- No schema changes
8+
- No sample JSON changes
9+
- No other tool changes
10+
11+
## Implemented
12+
1. Asset Manager V2 (`asset-manager-v2`)
13+
- Added invalid payload guard:
14+
- reject root `paletteJson`
15+
- clear error:
16+
- `paletteJson is not supported; use payloadJson.assetCatalog.`
17+
18+
2. Palette Manager V2 (`palette-manager-v2`)
19+
- Added invalid payload guard:
20+
- reject `payloadJson.assetCatalog`
21+
- clear error:
22+
- `payloadJson.assetCatalog is not supported; use payloadJson.paletteDocument.`
23+
24+
## Why
25+
- Prevent cross-tool payload mixing before render.
26+
- Keep strict tool-owned `payloadJson` contracts.
27+
- Preserve deterministic workspace launch behavior without fallback/default injection.
28+
29+
## Validation
30+
- `node --check tools/asset-manager-v2/index.js` -> PASS
31+
- `node --check tools/palette-manager-v2/index.js` -> PASS
32+
- `npm run test:workspace-v2` -> PASS (`1 passed`, `failed=0`)
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# PLAN_PR — PR_26124_007
2+
3+
## Goal
4+
Fix the next small group of failing tools (2 tools) from the Workspace V2 completion audit with minimal, low-risk changes.
5+
6+
## Tools in Scope
7+
- `asset-manager-v2`
8+
- `palette-manager-v2`
9+
10+
## Planned Fix Type
11+
- Tighten pre-render payload contract validation with explicit cross-tool/legacy key rejection.
12+
- No schema updates.
13+
- No runtime feature additions.
14+
15+
## Planned Validation
16+
- `node --check tools/asset-manager-v2/index.js`
17+
- `node --check tools/palette-manager-v2/index.js`
18+
- `npm run test:workspace-v2`

tools/asset-manager-v2/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,10 @@ class AssetBrowserV2 {
304304
this.renderError("Asset Manager V2 session data is invalid. Expected toolId 'asset-manager-v2'.");
305305
return;
306306
}
307+
if (Object.prototype.hasOwnProperty.call(versionCheck.payload, "paletteJson")) {
308+
this.renderError("Asset Manager V2 session data is invalid. paletteJson is not supported; use payloadJson.assetCatalog.");
309+
return;
310+
}
307311
if (!versionCheck.payload.payloadJson || typeof versionCheck.payload.payloadJson !== "object" || Array.isArray(versionCheck.payload.payloadJson)) {
308312
this.renderError("Asset Manager V2 session data is invalid. Expected payloadJson only.");
309313
return;

tools/palette-manager-v2/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,10 @@ class PaletteManagerV2 {
182182
this.renderError("Palette Manager V2 session data is invalid. Expected payloadJson.paletteDocument.");
183183
return;
184184
}
185+
if (Object.prototype.hasOwnProperty.call(versionCheck.payload.payloadJson, "assetCatalog")) {
186+
this.renderError("Palette Manager V2 session data is invalid. payloadJson.assetCatalog is not supported; use payloadJson.paletteDocument.");
187+
return;
188+
}
185189
if (Object.prototype.hasOwnProperty.call(versionCheck.payload.payloadJson.paletteDocument, "colors")) {
186190
this.renderError("Palette Manager V2 session data is invalid. payloadJson.paletteDocument.colors is not supported; use payloadJson.paletteDocument.swatches.");
187191
return;

0 commit comments

Comments
 (0)