File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11MODEL: GPT-5.3-codex
22REASONING: high
33COMMAND:
4- Execute docs/pr/BUILD_PR_SHARED_EXTRACTION_20_GUARD_SCRIPT_WIRING_PACKAGE_JSON.md exactly.
5- Edit only:
6- - package.json (only if it exists and has scripts)
7- Fail fast if conditions are not met.
8- Package delta to <project folder >/tmp/BUILD_PR_SHARED_EXTRACTION_20_GUARD_SCRIPT_WIRING_PACKAGE_JSON_delta.zip
4+ Execute docs/pr/BUILD_PR_SHARED_EXTRACTION_21_OPTIONAL_NPM_PREHOOK_GUARD.md exactly.
5+ Edit only package.json under defined rules.
6+ Fail fast if conditions not met.
7+ Package delta to <project folder >/tmp/BUILD_PR_SHARED_EXTRACTION_21_OPTIONAL_NPM_PREHOOK_GUARD_delta.zip
Original file line number Diff line number Diff line change 1- BUILD PR: wire shared extraction guard into package.json script .
1+ BUILD PR: optional npm prehook for shared extraction guard .
Original file line number Diff line number Diff line change 1- Next: continue executable BUILD chain.
1+ Next: continue BUILD chain.
Original file line number Diff line number Diff line change 1- Add npm script for guard execution .
1+ Optional guard auto-run via npm prehooks .
Original file line number Diff line number Diff line change 1- package.json script added correctly
1+ prehook added correctly
Original file line number Diff line number Diff line change 1+ # BUILD_PR_SHARED_EXTRACTION_21_OPTIONAL_NPM_PREHOOK_GUARD
2+
3+ ## Purpose
4+ Optionally enforce the shared-extraction guard automatically before existing npm workflows (test or start), without introducing CI or new tooling.
5+
6+ ## Single PR Purpose
7+ Add guard execution as a pre-hook ONLY IF matching scripts already exist.
8+
9+ ## Exact Files Allowed
10+ 1 . package.json (only if it exists AND already has scripts)
11+
12+ ## Fail-Fast Gate
13+ Before editing:
14+ 1 . package.json exists
15+ 2 . has scripts section
16+ 3 . already contains at least one of:
17+ - "test"
18+ - "start"
19+
20+ If not:
21+ - stop
22+ - no changes
23+ - no ZIP
24+
25+ ## Exact Change
26+
27+ If "test" exists and "pretest" does NOT exist:
28+ add:
29+ "pretest": "node tools/dev/checkSharedExtractionGuard.mjs"
30+
31+ If "start" exists and "prestart" does NOT exist:
32+ add:
33+ "prestart": "node tools/dev/checkSharedExtractionGuard.mjs"
34+
35+ Rules:
36+ - do not override existing pretest/prestart
37+ - do not modify existing scripts
38+ - minimal insertion only
39+
40+ ## Hard Constraints
41+ - only package.json
42+ - no new files
43+ - no logic changes
44+ - no CI
45+ - no lint
46+
47+ ## Validation Checklist
48+ 1 . Only package.json changed
49+ 2 . pretest/prestart added only if valid
50+ 3 . guard script path correct
51+ 4 . existing scripts unchanged
52+
53+ ## Non-Goals
54+ - no CI integration
55+ - no repo-wide changes
Original file line number Diff line number Diff line change 11{
22 "type" : " module" ,
33 "scripts" : {
4+ "pretest" : " node tools/dev/checkSharedExtractionGuard.mjs" ,
45 "test" : " node ./scripts/run-node-tests.mjs" ,
56 "build:manifest" : " node ./scripts/generate-sample-manifest.mjs" ,
67 "check:shared-extraction-guard" : " node tools/dev/checkSharedExtractionGuard.mjs"
You can’t perform that action at this time.
0 commit comments