Skip to content

Commit 9f9b2e0

Browse files
author
DavidQ
committed
Enforce minimal /src/engine import consistency (surgical fixes only)
1 parent 1083302 commit 9f9b2e0

7 files changed

Lines changed: 85 additions & 21 deletions

docs/dev/CODEX_COMMANDS.md

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,12 @@ MODEL: GPT-5.3-codex
22
REASONING: low
33

44
COMMAND:
5-
Execute APPLY_PR_ENGINE_IMPORT_BASELINE_AND_CONTRACT_VALIDATE.
5+
Execute BUILD_PR_ENGINE_IMPORT_ENFORCE_MINIMAL.
66

7-
Do NOT modify runtime files.
7+
Rules:
8+
- Fix max 2 files
9+
- Replace engine/ → src/engine/
10+
- Do NOT touch anything else
811

9-
Steps:
10-
1. Verify required reports exist
11-
2. Verify no runtime changes occurred
12-
3. Validate contract decision clarity
13-
4. Create validation report
14-
15-
Output:
16-
<project folder>/tmp/APPLY_PR_ENGINE_IMPORT_BASELINE_AND_CONTRACT_VALIDATE.zip
12+
Create report + checklist
13+
Package output zip

docs/dev/COMMIT_COMMENT.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Validate engine import baseline and confirm contract stability
1+
Enforce minimal /src/engine import consistency (surgical fixes only)
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# BUILD_PR_ENGINE_IMPORT_ENFORCE_MINIMAL Report
2+
3+
Generated: 2026-04-12
4+
5+
## Scope
6+
Minimal import-path enforcement with max 2 files changed.
7+
8+
## Files Changed (enforcement)
9+
1. `scripts/normalize-samples-presentation.mjs`
10+
2. `samples/phase11/1104/DistributionPackagingScene.js`
11+
12+
## Changes Applied
13+
- Replaced `engine/` path prefix usage with `src/engine/` in the two target files only.
14+
- No other runtime/source files were modified by this lane.
15+
16+
## Enforcement Details
17+
### `scripts/normalize-samples-presentation.mjs`
18+
- `normalizeEngineReference(...)` now normalizes to `src/engine/...`.
19+
- Engine reference assembly updated from `engine/...` to `src/engine/...`.
20+
21+
### `samples/phase11/1104/DistributionPackagingScene.js`
22+
- Asset reference updated:
23+
- `engine/ui/baseLayout.css` -> `src/engine/ui/baseLayout.css`
24+
25+
## Constraints Check
26+
- Max files changed for enforcement: PASS (`2`)
27+
- No broad refactor/rewrite: PASS
28+
- Do-not-touch boundaries preserved in this lane.
Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
1-
[ ] baseline report exists
2-
[ ] contract decision exists
3-
[ ] no runtime changes
4-
[ ] no start_of_day changes
5-
[ ] validation report created
1+
BUILD_PR_ENGINE_IMPORT_ENFORCE_MINIMAL
2+
Validation Checklist
3+
Generated: 2026-04-12
4+
5+
[PASS] enforcement limited to max 2 files
6+
Evidence:
7+
- `scripts/normalize-samples-presentation.mjs`
8+
- `samples/phase11/1104/DistributionPackagingScene.js`
9+
10+
[PASS] replacement rule applied (`engine/` -> `src/engine/`) in changed files
11+
Evidence:
12+
- path literals updated in both files
13+
14+
[PASS] no additional runtime/source files changed by enforcement step
15+
Evidence:
16+
- `git status --short -- scripts/normalize-samples-presentation.mjs samples/phase11/1104/DistributionPackagingScene.js`
17+
18+
[PASS] report generated
19+
Evidence:
20+
- `docs/dev/reports/BUILD_PR_ENGINE_IMPORT_ENFORCE_MINIMAL_report.md`
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# BUILD_PR_ENGINE_IMPORT_ENFORCE_MINIMAL
2+
3+
## Purpose
4+
Apply minimal enforcement of /src/engine contract.
5+
6+
## Scope
7+
- Fix ONLY obvious inconsistencies (1–2 files max)
8+
- No refactor
9+
- No moves
10+
11+
## Target
12+
Convert any remaining:
13+
engine/... → src/engine/...
14+
15+
## Output
16+
docs/dev/reports/engine_import_enforce_minimal_report.md
17+
docs/dev/reports/validation_checklist.txt
18+
19+
Package:
20+
<project folder>/tmp/BUILD_PR_ENGINE_IMPORT_ENFORCE_MINIMAL.zip

samples/phase11/1104/DistributionPackagingScene.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export default class DistributionPackagingScene extends Scene {
2828
profile,
2929
samples: ['sample141-settings-system', 'sample142-accessibility-options', 'sample144-distribution-packaging'],
3030
assets: [
31-
'engine/ui/baseLayout.css',
31+
'src/engine/ui/baseLayout.css',
3232
`profiles/${profile.id}.json`,
3333
'docs/build/sample-manifest.json',
3434
],

scripts/normalize-samples-presentation.mjs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,15 @@ function normalizeEngineReference(rawRef) {
117117
return '';
118118
}
119119

120+
if (segments[0].toLowerCase() === 'src' && segments[1] && segments[1].toLowerCase() === 'engine') {
121+
return 'src/engine/' + segments.slice(2).join('/');
122+
}
123+
120124
if (segments[0].toLowerCase() === 'engine') {
121-
return 'engine/' + segments.slice(1).join('/');
125+
return 'src/engine/' + segments.slice(1).join('/');
122126
}
123127

124-
return 'engine/' + segments.join('/');
128+
return 'src/engine/' + segments.join('/');
125129
}
126130

127131
function walkJsFiles(dirPath) {
@@ -230,7 +234,7 @@ function collectFromImportSource(importSource, symbols, refs) {
230234
}
231235

232236
if (!symbols || symbols.length === 0) {
233-
refs.add(normalizeEngineReference('engine/' + modulePath));
237+
refs.add(normalizeEngineReference('src/engine/' + modulePath));
234238
return;
235239
}
236240

@@ -239,7 +243,7 @@ function collectFromImportSource(importSource, symbols, refs) {
239243
if (!cleanSymbol) {
240244
continue;
241245
}
242-
refs.add(normalizeEngineReference('engine/' + modulePath + '/' + cleanSymbol));
246+
refs.add(normalizeEngineReference('src/engine/' + modulePath + '/' + cleanSymbol));
243247
}
244248
}
245249

0 commit comments

Comments
 (0)