Skip to content

Commit 78cd647

Browse files
author
DavidQ
committed
Add Codex review diff artifact for ChatGPT code review without pre-commit hooks - PR_26124_014-include-review-diff
1 parent 0be6776 commit 78cd647

8 files changed

Lines changed: 139 additions & 0 deletions

docs/dev/codex_commands.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,3 +327,10 @@ PR_26124_009-empty-fail-batch-capture
327327
```bash
328328
npx @openai/codex run --model gpt-5.3-codex --reasoning medium "Implement PR_26124_009: extract next FAIL tools from tool_completion_audit.md, record explicit batch fail list, and if no FAIL tools remain capture the empty batch with validation evidence and no runtime changes."
329329
```
330+
331+
---
332+
PR_26124_014-include-review-diff
333+
334+
```bash
335+
npm run codex:review-artifacts
336+
```
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# PR_26124_014-include-review-diff
2+
3+
## Summary
4+
- Added end-of-run artifact generator script for Codex PR review outputs.
5+
- Added npm command: `npm run codex:review-artifacts`.
6+
- Added command entry to `docs/dev/codex_commands.md`.
7+
8+
## Files Changed
9+
- `scripts/write-codex-review-artifacts.mjs`
10+
- `package.json`
11+
- `docs/dev/codex_commands.md`
12+
13+
## Validation
14+
- `node --check scripts/write-codex-review-artifacts.mjs` -> pass
15+
- `npm run codex:review-artifacts` -> pass
16+
17+
## Artifact Confirmation
18+
- `docs/dev/reports/codex_review.diff` exists
19+
- `docs/dev/reports/codex_changed_files.txt` exists
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# git status --short
2+
M docs/dev/codex_commands.md
3+
M package.json
4+
D tests/playwright.zip
5+
D tools/workspace-v2.zip
6+
?? docs/dev/reports/PR_26124_014_include_review_diff_report.md
7+
?? docs/dev/reports/codex_changed_files.txt
8+
?? docs/dev/reports/codex_review.diff
9+
?? scripts/write-codex-review-artifacts.mjs
10+
11+
# git diff --stat
12+
docs/dev/codex_commands.md | 7 +++++++
13+
package.json | 1 +
14+
tests/playwright.zip | Bin 4491 -> 0 bytes
15+
tools/workspace-v2.zip | Bin 31477 -> 0 bytes
16+
4 files changed, 8 insertions(+)

docs/dev/reports/codex_review.diff

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
diff --git a/docs/dev/codex_commands.md b/docs/dev/codex_commands.md
2+
index c99e0d6c..1ca60ee5 100644
3+
--- a/docs/dev/codex_commands.md
4+
+++ b/docs/dev/codex_commands.md
5+
@@ -327,3 +327,10 @@ PR_26124_009-empty-fail-batch-capture
6+
```bash
7+
npx @openai/codex run --model gpt-5.3-codex --reasoning medium "Implement PR_26124_009: extract next FAIL tools from tool_completion_audit.md, record explicit batch fail list, and if no FAIL tools remain capture the empty batch with validation evidence and no runtime changes."
8+
```
9+
+
10+
+---
11+
+PR_26124_014-include-review-diff
12+
+
13+
+```bash
14+
+npm run codex:review-artifacts
15+
+```
16+
diff --git a/package.json b/package.json
17+
index 1e5462bd..533204d3 100644
18+
--- a/package.json
19+
+++ b/package.json
20+
@@ -13,6 +13,7 @@
21+
"check:games-template-contract": "node ./scripts/validate-games-template-contract.mjs",
22+
"test:workspace-v2:playwright": "playwright test --workers=1 tests/ui/workspace-v2.asset-manager.spec.js tests/playwright/workspace-v2.validation.spec.js tests/playwright/tool-validation",
23+
"test:workspace-v2": "node ./scripts/run-workspace-v2-playwright-gate.mjs",
24+
+ "codex:review-artifacts": "node ./scripts/write-codex-review-artifacts.mjs",
25+
"test:launch-smoke": "node ./tests/runtime/LaunchSmokeAllEntries.test.mjs",
26+
"test:launch-smoke:games": "node ./tests/runtime/LaunchSmokeAllEntries.test.mjs --games",
27+
"test:workspace-manager:games": "node ./tests/runtime/GamesIndexWorkspaceManagerOpen.test.mjs",
28+
diff --git a/tests/playwright.zip b/tests/playwright.zip
29+
deleted file mode 100644
30+
index 84f08898..00000000
31+
Binary files a/tests/playwright.zip and /dev/null differ
32+
diff --git a/tools/workspace-v2.zip b/tools/workspace-v2.zip
33+
deleted file mode 100644
34+
index 5047d4aa..00000000
35+
Binary files a/tools/workspace-v2.zip and /dev/null differ

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"check:games-template-contract": "node ./scripts/validate-games-template-contract.mjs",
1414
"test:workspace-v2:playwright": "playwright test --workers=1 tests/ui/workspace-v2.asset-manager.spec.js tests/playwright/workspace-v2.validation.spec.js tests/playwright/tool-validation",
1515
"test:workspace-v2": "node ./scripts/run-workspace-v2-playwright-gate.mjs",
16+
"codex:review-artifacts": "node ./scripts/write-codex-review-artifacts.mjs",
1617
"test:launch-smoke": "node ./tests/runtime/LaunchSmokeAllEntries.test.mjs",
1718
"test:launch-smoke:games": "node ./tests/runtime/LaunchSmokeAllEntries.test.mjs --games",
1819
"test:workspace-manager:games": "node ./tests/runtime/GamesIndexWorkspaceManagerOpen.test.mjs",
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
import { spawnSync } from "node:child_process";
2+
import { fileURLToPath } from "node:url";
3+
import { dirname, resolve } from "node:path";
4+
import { mkdirSync, writeFileSync } from "node:fs";
5+
6+
const repoRoot = resolve(dirname(fileURLToPath(import.meta.url)), "..");
7+
const reportsDirectory = resolve(repoRoot, "docs", "dev", "reports");
8+
const reviewDiffPath = resolve(reportsDirectory, "codex_review.diff");
9+
const changedFilesPath = resolve(reportsDirectory, "codex_changed_files.txt");
10+
11+
function runGit(args) {
12+
const result = spawnSync("git", args, {
13+
cwd: repoRoot,
14+
encoding: "utf8"
15+
});
16+
if (result.error) {
17+
throw result.error;
18+
}
19+
return result;
20+
}
21+
22+
function assertGitCommand(result, args) {
23+
if (result.status !== 0) {
24+
const commandText = `git ${args.join(" ")}`;
25+
const stderr = result.stderr && result.stderr.trim() ? result.stderr.trim() : "Unknown git error";
26+
throw new Error(`${commandText} failed: ${stderr}`);
27+
}
28+
}
29+
30+
const stagedCheck = runGit(["diff", "--cached", "--quiet"]);
31+
if (stagedCheck.status !== 0 && stagedCheck.status !== 1) {
32+
const stderr = stagedCheck.stderr && stagedCheck.stderr.trim() ? stagedCheck.stderr.trim() : "Unknown git error";
33+
throw new Error(`git diff --cached --quiet failed: ${stderr}`);
34+
}
35+
36+
const useCachedDiff = stagedCheck.status === 1;
37+
const reviewDiffArguments = useCachedDiff ? ["diff", "--cached"] : ["diff"];
38+
const reviewDiffResult = runGit(reviewDiffArguments);
39+
assertGitCommand(reviewDiffResult, reviewDiffArguments);
40+
41+
const statusShortResult = runGit(["status", "--short"]);
42+
assertGitCommand(statusShortResult, ["status", "--short"]);
43+
44+
const diffStatResult = runGit(["diff", "--stat"]);
45+
assertGitCommand(diffStatResult, ["diff", "--stat"]);
46+
47+
mkdirSync(reportsDirectory, { recursive: true });
48+
writeFileSync(reviewDiffPath, reviewDiffResult.stdout, "utf8");
49+
50+
const changedFilesReport = [
51+
`# git status --short`,
52+
statusShortResult.stdout.trim() ? statusShortResult.stdout.trim() : "(no output)",
53+
"",
54+
`# git diff --stat`,
55+
diffStatResult.stdout.trim() ? diffStatResult.stdout.trim() : "(no output)"
56+
].join("\n");
57+
58+
writeFileSync(changedFilesPath, changedFilesReport, "utf8");
59+
60+
console.log(`Wrote ${reviewDiffPath} using git ${reviewDiffArguments.join(" ")}`);
61+
console.log(`Wrote ${changedFilesPath}`);

tests/playwright.zip

-4.39 KB
Binary file not shown.

tools/workspace-v2.zip

-30.7 KB
Binary file not shown.

0 commit comments

Comments
 (0)