|
| 1 | +# BUILD_PR — LEVEL 09_24 — SCRIPT STRUCTURE VALIDATION LAYER |
| 2 | + |
| 3 | +## Objective |
| 4 | +Add a dedicated PowerShell validation layer for repo script governance so script placement, naming, and folder-role rules can be enforced outside the runtime/tool test suite. |
| 5 | + |
| 6 | +## Why This PR Exists |
| 7 | +The recent script lane established and refined: |
| 8 | +- `scripts/PS/` |
| 9 | +- `scripts/PS/codex/` |
| 10 | +- `scripts/PS/deploy/` |
| 11 | + |
| 12 | +A follow-up question exposed the missing enforcement layer: |
| 13 | +`Validate-ScriptStructure.ps1` should exist, but it should not live inside the JavaScript runtime/tool test suite. |
| 14 | + |
| 15 | +This PR turns that insight into a clean repo-governance validation slice. |
| 16 | + |
| 17 | +## Required Direction |
| 18 | +Create a validation layer under: |
| 19 | + |
| 20 | +- `scripts/PS/validate/` |
| 21 | + |
| 22 | +Primary script: |
| 23 | +- `scripts/PS/validate/Validate-ScriptStructure.ps1` |
| 24 | + |
| 25 | +Optional companion if helpful: |
| 26 | +- `scripts/PS/validate/Validate-All.ps1` |
| 27 | + |
| 28 | +## Scope |
| 29 | +- add a PowerShell validation layer for script-tree governance |
| 30 | +- validate script placement against intended folder roles |
| 31 | +- validate naming matches actual purpose where practical |
| 32 | +- validate required high-value scripts exist in their expected locations |
| 33 | +- keep this validation outside the Node/MJS runtime test suite |
| 34 | +- document how operators should run the validation |
| 35 | +- add focused smoke checks for the validation scripts themselves if practical |
| 36 | + |
| 37 | +## Out of Scope |
| 38 | +- no engine changes |
| 39 | +- no gameplay/runtime feature changes |
| 40 | +- no tool UI work |
| 41 | +- no migration into the JS runtime test runner |
| 42 | +- no auto-fix / auto-move behavior in the validator |
| 43 | +- no broad deployment feature expansion |
| 44 | + |
| 45 | +## Folder Ownership Rules To Enforce |
| 46 | +- `scripts/PS/` |
| 47 | + - general operator scripts |
| 48 | + - template/game creation scripts |
| 49 | + - non-Codex, non-deploy shared operator scripts |
| 50 | + |
| 51 | +- `scripts/PS/codex/` |
| 52 | + - Codex-only scripts |
| 53 | + - plan-switch / API-key / Codex workflow scripts |
| 54 | + - no general game/template creation scripts |
| 55 | + |
| 56 | +- `scripts/PS/deploy/` |
| 57 | + - deployment scripts |
| 58 | + - Docker web-server deployment prep/update/cleanup scripts only |
| 59 | + |
| 60 | +- `scripts/PS/validate/` |
| 61 | + - validation/governance scripts only |
| 62 | + |
| 63 | +## Validation Behavior |
| 64 | +The validation layer should: |
| 65 | +1. inspect the script tree |
| 66 | +2. fail loudly on misplaced scripts |
| 67 | +3. report actionable messages |
| 68 | +4. remain non-destructive |
| 69 | +5. be easy to run manually |
| 70 | +6. be suitable for future CI/pre-commit use |
| 71 | + |
| 72 | +## Explicit Rule |
| 73 | +Do not place this validation in the JavaScript test suite. |
| 74 | +Treat it as repo governance validation, not runtime/tool contract testing. |
| 75 | + |
| 76 | +## Commit Comment Format |
| 77 | +- description starts on first line |
| 78 | +- no leading blank line / no leading CR |
| 79 | +- PR identifier goes on the last line |
| 80 | + |
| 81 | +## Roadmap Instruction |
| 82 | +Update roadmap status only where this PR clearly advances tracked work. |
| 83 | +Do not change roadmap prose except for previously approved roadmap additions already in flight. |
| 84 | + |
| 85 | +## Acceptance Criteria |
| 86 | +- `scripts/PS/validate/Validate-ScriptStructure.ps1` exists |
| 87 | +- validator enforces the intended script folder roles |
| 88 | +- validator is non-destructive |
| 89 | +- validator is documented and manually runnable |
| 90 | +- no JS test-suite coupling is introduced |
| 91 | +- focused checks pass |
| 92 | +- roadmap receives status-only updates where applicable |
| 93 | + |
| 94 | +## Deliverables |
| 95 | +Return a repo-structured ZIP at: |
| 96 | +`<project folder>/tmp/BUILD_PR_LEVEL_09_24_SCRIPT_STRUCTURE_VALIDATION_LAYER.zip` |
| 97 | + |
| 98 | +Include: |
| 99 | +- docs/pr/BUILD_PR_LEVEL_09_24_SCRIPT_STRUCTURE_VALIDATION_LAYER.md |
| 100 | +- docs/dev/codex_commands.md |
| 101 | +- docs/dev/commit_comment.txt |
| 102 | +- docs/dev/next_command.txt |
| 103 | +- docs/dev/reports/change_summary.txt |
| 104 | +- docs/dev/reports/validation_checklist.txt |
0 commit comments