Skip to content

Commit c2a7b0f

Browse files
author
Delta Team
committed
Merge PR_26177_DELTA_005-hitboxes-testable-mvp
2 parents 250884d + 199eaf3 commit c2a7b0f

19 files changed

Lines changed: 1751 additions & 251 deletions

assets/toolbox/hitboxes/js/index.js

Lines changed: 809 additions & 190 deletions
Large diffs are not rendered by default.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# PR_26177_DELTA_001 Hitboxes Team Ownership Manual Validation Notes
2+
3+
## Manual Review
4+
- Confirmed Hitboxes appears under Team Delta ownership in Project Instructions.
5+
- Confirmed the backlog Hitboxes entry no longer assigns Hitboxes to Team Alfa.
6+
- Confirmed no other team ownership changes were part of this PR scope.
7+
- Confirmed no implementation code or `start_of_day` folders were modified.
8+
9+
## Result
10+
PASS
11+
12+
## EOD Note
13+
This manual-validation report was added during Team Delta EOD artifact closeout to standardize the PR artifact set.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# PR_26177_DELTA_001 Hitboxes Team Ownership Requirement Checklist
2+
3+
| Requirement | Status | Notes |
4+
|---|---|---|
5+
| Hard stop unless current branch is main | PASS | Start branch was verified as `main` before creating the PR branch. |
6+
| Create and switch to PR branch | PASS | Created and switched to `PR_26177_DELTA_001-hitboxes-team-ownership`. |
7+
| Team Delta sole owner of Hitboxes | PASS | Project Instructions ownership map lists Hitboxes under Team Delta. |
8+
| Remove Hitboxes from Team Alfa ownership | PASS | Backlog item changed from `Alfa - Hitboxes` to `Delta - Hitboxes`; no `Alfa - Hitboxes` matches remain in Project Instructions target files. |
9+
| Do not modify implementation code | PASS | Only Project Instructions ownership/backlog and report artifacts changed. |
10+
| Do not change any other team ownership | PASS | Diff changes only Hitboxes ownership/routing. |
11+
| Regenerate `codex_review.diff` | PASS | `docs_build/dev/reports/codex_review.diff` was generated. |
12+
| Regenerate `codex_changed_files.txt` | PASS | `docs_build/dev/reports/codex_changed_files.txt` was generated. |
13+
| PR-specific report | PASS | `docs_build/dev/reports/PR_26177_DELTA_001-hitboxes-team-ownership.md` exists. |
14+
| Branch validation | PASS | `docs_build/dev/reports/PR_26177_DELTA_001-hitboxes-team-ownership_branch-validation.md` exists. |
15+
| Validation checklist | PASS | Original checklist exists and this standard requirement-checklist alias was added during EOD artifact closeout. |
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# PR_26177_DELTA_001 Hitboxes Team Ownership Validation Lane
2+
3+
## Scope
4+
Project Instructions ownership/backlog documentation only.
5+
6+
## Commands/Checks
7+
- PASS: Verified start branch was `main` before PR branch creation.
8+
- PASS: Verified PR branch was `PR_26177_DELTA_001-hitboxes-team-ownership`.
9+
- PASS: Searched Project Instructions for `Alfa - Hitboxes`; no matches remained in target ownership/backlog files.
10+
- PASS: Searched target Project Instructions ownership/backlog files for Hitboxes; entries route Hitboxes to Team Delta.
11+
- PASS: Reviewed changed files before report generation; no implementation code was modified.
12+
13+
## Result
14+
PASS
15+
16+
## EOD Note
17+
This validation-lane report was added during Team Delta EOD artifact closeout to standardize the PR artifact set.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# PR_26177_DELTA_005-hitboxes-testable-mvp
2+
3+
## Purpose
4+
Make Hitboxes a creator-testable MVP in one focused stacked Delta PR.
5+
6+
## Changed Files
7+
- `toolbox/hitboxes/index.html`
8+
- `assets/toolbox/hitboxes/js/index.js`
9+
- `src/dev-runtime/persistence/tool-repositories/hitboxes-mock-repository.js`
10+
- `src/dev-runtime/persistence/mock-db-store.js`
11+
- `src/dev-runtime/server/local-api-router.mjs`
12+
- `src/engine/collision/hitboxCollision.js`
13+
- `tests/engine/HitboxCollisionContract.test.mjs`
14+
- `tests/playwright/tools/HitboxesTool.spec.mjs`
15+
16+
## Implementation Summary
17+
- Replaced the read-only Hitboxes page with a Theme V2 creator tool shell.
18+
- Added Object A/Object B selection backed by the Local API `hitboxes` repository.
19+
- Added DEV review/test object sources through the server/service contract when no eligible real Objects exist.
20+
- Added canvas-based Object A/Object B visual placeholders tied to object records, bounding boxes, origins, hitbox overlays, and motion path rendering.
21+
- Added rectangle hitbox creation, selection, drag move, resize, field editing, delete, enable/disable, visible/hidden, unsaved status, and save status.
22+
- Added server-owned Hitbox persistence with ULID keys in `hitbox_definition_records`.
23+
- Added guest save redirect to `/account/sign-in.html`.
24+
- Added shared engine static AABB contact classification and used shared engine swept AABB for motion preview.
25+
26+
## Validation Summary
27+
- PASS: `node tests\engine\HitboxCollisionContract.test.mjs`
28+
- PASS: `node --check assets\toolbox\hitboxes\js\index.js`
29+
- PASS: `node --check src\dev-runtime\persistence\tool-repositories\hitboxes-mock-repository.js`
30+
- PASS: `node --check src\engine\collision\hitboxCollision.js`
31+
- PASS: `node --check tests\playwright\tools\HitboxesTool.spec.mjs`
32+
- PASS: `node -e "import('./src/dev-runtime/server/local-api-router.mjs').then(() => console.log('local api router import ok'))"`
33+
- PASS: Hitboxes repository contract smoke check for DEV samples and server-generated ULIDs.
34+
- PASS: `git diff --check`
35+
- PASS: HTML inline rule scan found no inline styles, style blocks, script blocks, or inline handlers.
36+
- BLOCKED: `npx playwright test tools/HitboxesTool.spec.mjs --project=playwright` discovered tests but could not launch because Playwright Chromium is missing.
37+
- BLOCKED: `npx playwright install chromium` timed out after 304 seconds.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Branch Validation
2+
3+
## Result
4+
PASS
5+
6+
## Checks
7+
- PASS: Current branch is `PR_26177_DELTA_005-hitboxes-testable-mvp`.
8+
- PASS: Branch is part of the Delta Hitboxes PR chain.
9+
- PASS: Work proceeded without returning to `main`.
10+
- PASS: Initial hard-stop gate was clean before edits.
11+
- PASS: No `start_of_day` folders were modified.
12+
- PASS: Changes are scoped to Hitboxes tool, Hitboxes Local API persistence, shared collision helpers, and targeted tests/reports.
13+
14+
## Notes
15+
- Final working tree includes the intended staged implementation and generated report files before commit.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Manual Validation Notes
2+
3+
## Creator MVP Flow
4+
1. Open `/toolbox/index.html` and choose Hitboxes.
5+
2. Confirm `/toolbox/hitboxes/index.html` loads the Hitboxes tool.
6+
3. If no real Objects have assigned visual metadata, confirm the Object A/Object B selectors show `DEV Review Ball` and `DEV Review Paddle` labeled as DEV review/test data.
7+
4. Confirm the center canvas shows Object A and Object B placeholders, bounding boxes, and origin markers.
8+
5. Click `Add Rectangle`.
9+
6. Select the new hitbox in the left list.
10+
7. Drag the rectangle on the canvas and confirm x/y fields update.
11+
8. Drag the bottom-right handle and confirm width/height fields update.
12+
9. Edit x/y/width/height fields and confirm the overlay updates.
13+
10. Toggle enabled and visible and confirm the list/status updates.
14+
11. Sign in as a creator, click `Save Hitboxes`, and confirm save status becomes `saved`.
15+
12. As a guest or with `?guest=1`, click `Save Hitboxes` and confirm redirect to `/account/sign-in.html`.
16+
17+
## Static Collision Preview
18+
1. Select Object A and Object B.
19+
2. Set Object A x/y to `0,0`.
20+
3. Set Object B x/y to `0,10` with a 10x10 Object A hitbox.
21+
4. Click `Test Static` and confirm `touching`.
22+
5. Set Object B y to `5`.
23+
6. Click `Test Static` and confirm `overlapping`.
24+
7. Set Object B y to `50`.
25+
8. Click `Test Static` and confirm `separated`.
26+
27+
## Swept Speed Regression
28+
1. Use the DEV Review Ball as Object A and DEV Review Paddle as Object B.
29+
2. Ensure Object A hitbox size is 10x10.
30+
3. Click `Reset` in Motion Preview.
31+
4. Confirm Object A start is `0,0`, velocity is `0,1`, speed is `100`, Object B is `0,50`, and step count is `1`.
32+
5. Click `Run Preview`.
33+
6. Confirm the result says `Collision detected before the next frame`.
34+
7. Confirm impact time, impact point, impact normal, before position, and after position are shown.
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Requirement Checklist
2+
3+
## Object Source
4+
- PASS: Hitboxes loads source Objects through the Local API/service contract.
5+
- PASS: Objects with assigned sprite/vector/asset metadata are preferred.
6+
- PASS: DEV review/test sample Objects are served through the server/API contract when no eligible Objects exist.
7+
- PASS: DEV sample Objects are clearly labeled as DEV review/test data.
8+
- PASS: No browser-local product data is used as source of truth.
9+
- PASS: Authoritative object data is not stored in browser storage.
10+
11+
## Visual Preview
12+
- PASS: Selected Objects show assigned visual metadata when available.
13+
- PASS: DEV-safe placeholders are tied to object records when asset rendering is unavailable.
14+
- PASS: Object bounding boxes are drawn.
15+
- PASS: Object origin markers are drawn.
16+
17+
## Layout
18+
- PASS: Left panel includes Object A selector, Object B selector, hitbox list, Add Rectangle, Delete, and filters.
19+
- PASS: Center panel includes a large visual editor canvas with Object A/Object B visuals, bounding boxes, origins, overlays, and motion path.
20+
- PASS: Right panel includes selected object metadata, hitbox properties, collision controls, and motion/speed controls.
21+
- PASS: Bottom status includes Object A, Object B, selected hitbox, collision result, and save status.
22+
23+
## Hitbox Editing
24+
- PASS: Add Rectangle creates a visible Object A hitbox.
25+
- PASS: Creator can select a hitbox.
26+
- PASS: Creator can drag/move a hitbox.
27+
- PASS: Creator can resize a hitbox.
28+
- PASS: Property fields update from drag/resize.
29+
- PASS: Property field edits update the overlay.
30+
- PASS: Delete hitbox is supported.
31+
- PASS: Enable/disable and visible/hidden toggles are supported.
32+
33+
## Persistence
34+
- PASS: Hitboxes save through the Local API/service contract.
35+
- PASS: Server/API owns persisted hitbox keys.
36+
- PASS: Created hitbox records receive ULID keys.
37+
- PASS: Guest save redirects to `account/sign-in.html`.
38+
- PASS: No silent fallback saves are implemented.
39+
- PASS: Browser storage is not used as product-data source of truth.
40+
41+
## Collision Preview
42+
- PASS: Object A and Object B are visible in the editor.
43+
- PASS: Static states include separated, touching, and overlapping.
44+
- PASS: Static collision classification is implemented in the shared engine collision module.
45+
- PASS: Page JS does not duplicate the shared collision classification.
46+
47+
## Motion/Speed Preview
48+
- PASS: Motion controls include Object A start x/y, velocity x/y, speed, Object B x/y, frame rate, step count, Run Preview, Step Frame, and Reset.
49+
- PASS: Preview shows path, frame positions, impact frame/time, before/after position, and result message.
50+
- PASS: Fast ball/paddle swept collision regression is covered by the shared engine unit test.
51+
- PASS: Page JS calls shared swept AABB logic instead of duplicating collision math.
52+
53+
## Theme/HTML Rules
54+
- PASS: Theme V2 is used.
55+
- PASS: JavaScript is external.
56+
- PASS: CSS is external/existing Theme V2 only.
57+
- PASS: No inline styles, style blocks, script blocks, or inline event handlers were found.
58+
59+
## Scope Guard
60+
- PASS: No unrelated tools were modified.
61+
- PASS: No `start_of_day` folders were modified.
62+
- PASS: No repo-wide refactors were added.
63+
64+
## Validation
65+
- PASS: Targeted Playwright tests were added/updated for toolbox navigation, object source loading, DEV samples, visual preview, rectangle creation, move, resize, save, static collision, swept speed regression, and guest redirect.
66+
- PASS: Unit tests were updated for shared collision logic.
67+
- BLOCKED: Playwright execution is environment-blocked because Chromium is not installed and `npx playwright install chromium` timed out.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Validation Lane
2+
3+
## Commands Run
4+
- `node tests\engine\HitboxCollisionContract.test.mjs`
5+
- `node --check assets\toolbox\hitboxes\js\index.js`
6+
- `node --check src\dev-runtime\persistence\tool-repositories\hitboxes-mock-repository.js`
7+
- `node --check src\engine\collision\hitboxCollision.js`
8+
- `node --check tests\playwright\tools\HitboxesTool.spec.mjs`
9+
- `node -e "import('./src/dev-runtime/server/local-api-router.mjs').then(() => console.log('local api router import ok'))"`
10+
- Hitboxes repository contract smoke check through `node --input-type=module`
11+
- `git diff --check`
12+
- `Select-String -LiteralPath toolbox\hitboxes\index.html -Pattern '<style|style=|<script(?![^>]+src=)| on[a-z]+='`
13+
- `npx playwright test tools/HitboxesTool.spec.mjs --project=playwright`
14+
- `npx playwright install chromium`
15+
16+
## Results
17+
- PASS: Engine collision unit test.
18+
- PASS: Hitboxes page JS syntax check.
19+
- PASS: Hitboxes repository syntax check.
20+
- PASS: Shared collision module syntax check.
21+
- PASS: Targeted Playwright spec syntax check.
22+
- PASS: Local API router import check.
23+
- PASS: Repository smoke check confirmed DEV source fallback and ULID hitbox persistence.
24+
- PASS: `git diff --check`.
25+
- PASS: HTML inline-rule scan produced no matches.
26+
- BLOCKED: Playwright test execution could not launch because `C:\Users\davidq\AppData\Local\ms-playwright\chromium-1217\chrome-win64\chrome.exe` does not exist.
27+
- BLOCKED: Chromium install timed out after 304 seconds.
28+
29+
## Validation Status
30+
PASS with one environment-blocked browser lane. All non-browser validation completed.
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Team Delta Hitboxes Chain EOD - 2026-06-26
2+
3+
## Current Branch
4+
`PR_26177_DELTA_005-hitboxes-testable-mvp`
5+
6+
## PRs Included
7+
- `PR_26177_DELTA_001-hitboxes-team-ownership`
8+
- `PR_26177_DELTA_002-hitboxes-foundation`
9+
- `PR_26177_DELTA_003-hitboxes-engine-collision-contract`
10+
- `PR_26177_DELTA_004-hitboxes-real-object-source`
11+
- `PR_26177_DELTA_005-hitboxes-testable-mvp`
12+
13+
## Changed Files Summary
14+
- Project Instructions ownership/backlog documentation for Hitboxes ownership handoff to Team Delta.
15+
- Hitboxes toolbox page and external JavaScript.
16+
- Toolbox metadata/admin notes for the Hitboxes tool entry.
17+
- Shared engine collision contract and targeted unit tests.
18+
- Local API mock DB schema, router registration, and Hitboxes repository.
19+
- Targeted Playwright coverage for the Hitboxes creator MVP.
20+
- Required Codex PR reports and closeout reports.
21+
22+
## Artifact Verification
23+
- PASS: `docs_build/dev/reports/codex_review.diff` exists.
24+
- PASS: `docs_build/dev/reports/codex_changed_files.txt` exists.
25+
- PASS: PR-specific reports exist for PRs 001-005.
26+
- PASS: Branch validation reports exist for PRs 001-005.
27+
- PASS: Requirement-by-requirement PASS/FAIL checklists exist for PRs 001-005.
28+
- PASS: Validation lane reports exist for PRs 001-005.
29+
- PASS: Manual validation notes exist for PRs 001-005.
30+
- PASS: Repo-structured delta ZIPs exist under `tmp/` for PRs 001-005.
31+
32+
## ZIP Locations
33+
- `tmp/PR_26177_DELTA_001-hitboxes-team-ownership_delta.zip`
34+
- `tmp/PR_26177_DELTA_002-hitboxes-foundation_delta.zip`
35+
- `tmp/PR_26177_DELTA_003-hitboxes-engine-collision-contract_delta.zip`
36+
- `tmp/PR_26177_DELTA_004-hitboxes-real-object-source_delta.zip`
37+
- `tmp/PR_26177_DELTA_005-hitboxes-testable-mvp_delta.zip`
38+
39+
## Validation Commands And Results
40+
- PASS: `node tests\engine\HitboxCollisionContract.test.mjs`
41+
- BLOCKED: `npx playwright test tools/HitboxesTool.spec.mjs --project=playwright`
42+
- Tests were discovered.
43+
- Browser launch failed because `C:\Users\davidq\AppData\Local\ms-playwright\chromium-1217\chrome-win64\chrome.exe` is missing.
44+
- BLOCKED: `npm run test:workspace-v2`
45+
- Fallback lane reached Playwright execution.
46+
- Browser launch failed for the same missing Chromium executable.
47+
48+
## Playwright Impacted
49+
Yes. Hitboxes Playwright coverage was added for toolbox navigation, object source loading, DEV sample fallback, visual preview, rectangle creation, move, resize, save, static collision, swept speed regression, and guest save redirect. Execution is blocked by the local missing Playwright Chromium binary, not by an observed product behavior failure.
50+
51+
## Manual Validation Notes
52+
- Confirmed artifact matrix for PRs 001-005.
53+
- Confirmed current branch was the active Delta Hitboxes chain tip before closeout.
54+
- Confirmed worktree was clean before artifact closeout.
55+
- Confirmed regenerated ZIPs are repo-structured and under `tmp/`.
56+
- Confirmed no `start_of_day` folders were modified during closeout.
57+
58+
## Known Gaps
59+
- Browser validation cannot complete until Playwright Chromium is installed locally.
60+
- Hitboxes MVP is creator-testable for object-backed rectangle editing, static collision, and swept collision; animation/frame timeline controls remain a recommended follow-up.
61+
- Visual asset rendering currently uses assigned asset metadata when available and service-backed DEV placeholders when renderer support is unavailable.
62+
63+
## Creator Completion Estimate
64+
Approximately 70% complete from a Creator perspective. The core testable workflow exists: select Object A/Object B, see visual placeholders/bounds/origins, create/edit/save rectangle hitboxes, run static collision states, and verify swept fast-motion collision. Remaining Creator polish is mainly animation/frame timing, richer visual asset rendering integration, and broader usability refinement.
65+
66+
## Next Recommended PR
67+
`PR_26177_DELTA_006-hitboxes-animation-frame-preview`
68+
69+
Recommended focus: add animation/frame timing controls and frame-aware hitbox activation without expanding collision math or unrelated tool scope.

0 commit comments

Comments
 (0)