|
1 | | -# PR_26177_DELTA_056-shared-validation-assertions |
| 1 | +# PR_26177_001-shared-hash-foundation |
2 | 2 |
|
3 | 3 | ## Purpose |
4 | 4 |
|
5 | | -Move generic validation/assertion helpers out of random helper code into a shared validation module. |
| 5 | +Add a small shared non-cryptographic hash foundation. |
6 | 6 |
|
7 | 7 | ## Source Of Truth |
8 | 8 |
|
9 | | -This `BUILD_PR.md`, `PLAN_PR.md`, the user request, and `docs_build/dev/ProjectInstructions.zip` are the source of truth for `PR_26177_DELTA_056-shared-validation-assertions`. |
10 | | - |
11 | | -## OWNER Override And Team Assignment |
12 | | - |
13 | | -OWNER override approved: Continue Team Delta random utility stack with `PR_26177_DELTA_056-shared-validation-assertions`. |
14 | | - |
15 | | -Team Delta owns Shared JS, runtime utilities, technical debt remediation, and runtime test coverage. |
16 | | - |
17 | | -## Stack |
18 | | - |
19 | | -- Base branch: `PR_26177_DELTA_055-random-seed-enhancements` |
20 | | -- This PR depends on the random helper module from PR_053, `Random` from PR_054, and `RandomSeed` enhancements from PR_055. |
| 9 | +This `BUILD_PR.md`, `PLAN_PR.md`, and the user request are the source of truth for `PR_26177_001-shared-hash-foundation`. |
21 | 10 |
|
22 | 11 | ## Exact Scope |
23 | 12 |
|
24 | | -- Create `src/shared/validation/assert.js`. |
25 | | -- Move generic assertion helpers from random helper code into `assert.js`. |
26 | | -- Include only generic reusable validation functions needed by current random helpers: |
27 | | - - `assertArray` |
28 | | - - `assertFiniteNumber` |
29 | | - - `assertOrderedRange` |
30 | | -- Update random helper code to import from `src/shared/validation/assert.js`. |
31 | | -- Preserve existing `Random` and `RandomSeed` behavior. |
32 | | -- Do not change public API. |
33 | | -- Do not expand into unrelated validation functions yet. |
34 | | -- Add/update targeted unit tests if needed. |
35 | | -- No UI changes. |
36 | | -- No API/database changes. |
37 | | -- No unrelated cleanup. |
| 13 | +- Add `src/shared/hash/` foundation. |
| 14 | +- Include deterministic non-crypto hash helpers. |
| 15 | +- No browser-owned product data. |
| 16 | +- No runtime UI changes. |
| 17 | +- Add targeted tests for the shared hash area. |
38 | 18 | - Create required Codex reports under `docs_build/dev/reports/`. |
39 | 19 | - Create repo-structured delta ZIP under `tmp/`. |
40 | 20 |
|
41 | 21 | ## Exact Targets |
42 | 22 |
|
43 | 23 | - `docs_build/dev/PLAN_PR.md` |
44 | 24 | - `docs_build/dev/BUILD_PR.md` |
45 | | -- `docs_build/dev/ProjectInstructions/team_assignments/TEAM_ASSIGNMENTS.md` |
46 | | -- `docs_build/dev/ProjectInstructions/team_assignments/ACTIVE_TEAM_REGISTRY.md` |
47 | | -- `src/shared/validation/assert.js` |
48 | | -- `src/shared/math/randomHelpers.js` |
49 | | -- `docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions.md` |
50 | | -- `docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions_branch-validation.md` |
51 | | -- `docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions_requirement-checklist.md` |
52 | | -- `docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions_validation-lane.md` |
53 | | -- `docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions_manual-validation-notes.md` |
54 | | -- `docs_build/dev/reports/PR_26177_DELTA_056-shared-validation-assertions_instruction-compliance-checklist.md` |
| 25 | +- `src/shared/hash/hash.js` |
| 26 | +- `tests/shared/HashFoundation.test.mjs` |
| 27 | +- `docs_build/dev/reports/PR_26177_001-shared-hash-foundation.md` |
| 28 | +- `docs_build/dev/reports/PR_26177_001-shared-hash-foundation_branch-validation.md` |
| 29 | +- `docs_build/dev/reports/PR_26177_001-shared-hash-foundation_requirement-checklist.md` |
| 30 | +- `docs_build/dev/reports/PR_26177_001-shared-hash-foundation_validation-lane.md` |
| 31 | +- `docs_build/dev/reports/PR_26177_001-shared-hash-foundation_manual-validation-notes.md` |
55 | 32 | - `docs_build/dev/reports/codex_review.diff` |
56 | 33 | - `docs_build/dev/reports/codex_changed_files.txt` |
57 | 34 |
|
58 | 35 | ## Out Of Scope |
59 | 36 |
|
60 | | -- No public API changes. |
61 | | -- No new unrelated validation helpers. |
62 | | -- No existing game logic adoption changes. |
63 | | -- No UI changes. |
| 37 | +- No cryptographic hashing. |
| 38 | +- No browser-owned product data. |
| 39 | +- No runtime UI changes. |
64 | 40 | - No browser storage changes. |
65 | | -- No API changes. |
66 | | -- No database changes. |
| 41 | +- No API/database changes. |
| 42 | +- No engine refactor. |
67 | 43 | - No `start_of_day` folder changes. |
68 | 44 | - No unrelated cleanup. |
| 45 | +- No full samples smoke by default. |
69 | 46 |
|
70 | 47 | ## Validation |
71 | 48 |
|
72 | 49 | Run exactly: |
73 | 50 |
|
74 | 51 | ```powershell |
75 | | -node ./scripts/run-node-test-files.mjs tests/shared/RandomHelpers.test.mjs tests/shared/Random.test.mjs tests/shared/RandomSeed.test.mjs |
76 | | -node --check src/shared/validation/assert.js |
77 | | -node --check src/shared/math/randomHelpers.js |
| 52 | +node ./scripts/run-node-test-files.mjs tests/shared/HashFoundation.test.mjs |
| 53 | +node --check src/shared/hash/hash.js |
| 54 | +node --check tests/shared/HashFoundation.test.mjs |
78 | 55 | git diff --check |
79 | 56 | ``` |
80 | 57 |
|
81 | | -Playwright is not required because this PR does not change UI or browser runtime flows. |
82 | | - |
83 | 58 | ## Artifact |
84 | 59 |
|
85 | 60 | Create repo-structured delta ZIP: |
86 | 61 |
|
87 | 62 | ```text |
88 | | -tmp/PR_26177_DELTA_056-shared-validation-assertions_delta.zip |
| 63 | +tmp/PR_26177_001-shared-hash-foundation_delta.zip |
89 | 64 | ``` |
0 commit comments