|
1 | | -# PR_26177_OWNER_051-environment-configuration-standards |
| 1 | +# PR_26177_DELTA_052-random-seed-utility |
2 | 2 |
|
3 | 3 | ## Purpose |
4 | 4 |
|
5 | | -Define the official Game Foundry Studio environment configuration standards that build on the OWNER_050 environment model. |
| 5 | +Add a reusable shared JavaScript `RandomSeed` utility for deterministic seeded random sequences. |
6 | 6 |
|
7 | 7 | ## Source Of Truth |
8 | 8 |
|
9 | | -This `BUILD_PR.md` and the user request are the source of truth for `PR_26177_OWNER_051-environment-configuration-standards`. |
| 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_052-random-seed-utility`. |
| 10 | + |
| 11 | +## OWNER Override And Team Assignment |
| 12 | + |
| 13 | +OWNER override approved: Assign Team Delta `PR_26177_DELTA_052-random-seed-utility`. |
| 14 | + |
| 15 | +Team Delta owns Shared JS, runtime utilities, technical debt remediation, and runtime test coverage. |
10 | 16 |
|
11 | 17 | ## Exact Scope |
12 | 18 |
|
13 | | -- Governance/documentation only. |
14 | | -- Build on OWNER_050 environment model. |
15 | | -- Standardize environment file names: |
16 | | - - `.env.local` |
17 | | - - `.env.dev` |
18 | | - - `.env.ist` |
19 | | - - `.env.uat` |
20 | | - - `.env.prod` |
21 | | -- Treat `.env.prd` as legacy technical debt only. |
22 | | -- Add `GAMEFOUNDRY_ENVIRONMENT` allowed values: |
23 | | - - `local` |
24 | | - - `dev` |
25 | | - - `ist` |
26 | | - - `uat` |
27 | | - - `prod` |
28 | | -- Keep `GAMEFOUNDRY_ENVIRONMENT_LABEL` display-only. |
29 | | -- Document that only `.env` values and environment-managed secrets differ. |
30 | | -- Document that the deployable artifact must remain identical. |
31 | | -- Document one shared API/service contract. |
32 | | -- Document feature flags cannot create permanent environment-specific behavior. |
33 | | -- Review `.env.example` comments/placeholders only. |
34 | | -- Clarify that only `.env.example` is committed to the repository. |
35 | | -- Clarify that real `.env` files are user/environment-owned and must live outside the repo clone or be injected by deployment. |
36 | | -- Document the external `/env/<target>/.env` layout next to the `/GFS/` repo clone. |
37 | | -- Do not change runtime behavior. |
| 19 | +- Add reusable shared JavaScript utility class named `RandomSeed`. |
| 20 | +- Constructor accepts an initial seed. |
| 21 | +- Include: |
| 22 | + - `seed(value)` |
| 23 | + - `next()` |
| 24 | + - `nextInt(min, max)` |
| 25 | + - `nextFloat(min, max)` |
| 26 | + - `pick(array)` |
| 27 | +- Same seed must reproduce the same sequence after reseeding. |
| 28 | +- Different seeds should produce different sequences. |
| 29 | +- Add JSDoc. |
| 30 | +- Add targeted unit tests. |
| 31 | +- Do not replace existing `Math.random()` usage. |
| 32 | +- No UI changes. |
| 33 | +- No browser storage. |
| 34 | +- No API/database changes. |
| 35 | +- No unrelated cleanup. |
38 | 36 | - Create required Codex reports under `docs_build/dev/reports/`. |
39 | 37 | - Create repo-structured delta ZIP under `tmp/`. |
40 | 38 |
|
41 | 39 | ## Exact Targets |
42 | 40 |
|
| 41 | +- `docs_build/dev/PLAN_PR.md` |
43 | 42 | - `docs_build/dev/BUILD_PR.md` |
44 | | -- `docs_build/dev/PROJECT_INSTRUCTIONS.md` |
45 | | -- `docs_build/dev/ProjectInstructions/PROJECT_INSTRUCTIONS.md` |
46 | | -- `docs_build/dev/ProjectInstructions/README.txt` |
47 | | -- `docs_build/dev/ProjectInstructions/addendums/environment_configuration_standards.md` |
48 | | -- `docs_build/dev/ProjectInstructions/addendums/environment_governance_model.md` |
49 | | -- `docs_build/dev/ProjectInstructions/addendums/release_gate.md` |
50 | | -- `.env.example` |
51 | | -- `docs_build/dev/reports/PR_26177_OWNER_051-environment-configuration-standards.md` |
52 | | -- `docs_build/dev/reports/PR_26177_OWNER_051-environment-configuration-standards_branch-validation.md` |
53 | | -- `docs_build/dev/reports/PR_26177_OWNER_051-environment-configuration-standards_requirement-checklist.md` |
54 | | -- `docs_build/dev/reports/PR_26177_OWNER_051-environment-configuration-standards_validation-lane.md` |
55 | | -- `docs_build/dev/reports/PR_26177_OWNER_051-environment-configuration-standards_manual-validation-notes.md` |
56 | | -- `docs_build/dev/reports/PR_26177_OWNER_051-environment-configuration-standards_instruction-compliance-checklist.md` |
| 43 | +- `docs_build/dev/ProjectInstructions/team_assignments/TEAM_ASSIGNMENTS.md` |
| 44 | +- `docs_build/dev/ProjectInstructions/team_assignments/ACTIVE_TEAM_REGISTRY.md` |
| 45 | +- `src/shared/math/RandomSeed.js` |
| 46 | +- `tests/shared/RandomSeed.test.mjs` |
| 47 | +- `docs_build/dev/reports/PR_26177_DELTA_052-random-seed-utility.md` |
| 48 | +- `docs_build/dev/reports/PR_26177_DELTA_052-random-seed-utility_branch-validation.md` |
| 49 | +- `docs_build/dev/reports/PR_26177_DELTA_052-random-seed-utility_requirement-checklist.md` |
| 50 | +- `docs_build/dev/reports/PR_26177_DELTA_052-random-seed-utility_validation-lane.md` |
| 51 | +- `docs_build/dev/reports/PR_26177_DELTA_052-random-seed-utility_manual-validation-notes.md` |
| 52 | +- `docs_build/dev/reports/PR_26177_DELTA_052-random-seed-utility_instruction-compliance-checklist.md` |
57 | 53 | - `docs_build/dev/reports/codex_review.diff` |
58 | 54 | - `docs_build/dev/reports/codex_changed_files.txt` |
59 | 55 |
|
60 | 56 | ## Out Of Scope |
61 | 57 |
|
62 | | -- No runtime code changes. |
| 58 | +- No existing `Math.random()` call-site replacements. |
63 | 59 | - No UI changes. |
64 | | -- No engine core changes. |
| 60 | +- No browser storage changes. |
| 61 | +- No API changes. |
| 62 | +- No database changes. |
| 63 | +- No engine core changes outside the new shared utility. |
65 | 64 | - No `start_of_day` folder changes. |
66 | | -- No actual `.env`, `.env.local`, `.env.dev`, `.env.ist`, `.env.uat`, `.env.prod`, or `.env.prd` secret/value file edits. |
67 | | -- No committed real `.env.*` copy-source files. |
68 | | -- No API implementation changes. |
69 | | -- No storage implementation changes. |
70 | | -- No database migration or DDL changes. |
71 | | -- No feature flag implementation changes. |
| 65 | +- No unrelated cleanup. |
72 | 66 |
|
73 | 67 | ## Validation |
74 | 68 |
|
75 | 69 | Run exactly: |
76 | 70 |
|
77 | 71 | ```powershell |
| 72 | +node ./scripts/run-node-test-files.mjs tests/shared/RandomSeed.test.mjs |
| 73 | +node --check src/shared/math/RandomSeed.js |
| 74 | +node --check tests/shared/RandomSeed.test.mjs |
78 | 75 | git diff --check |
79 | 76 | ``` |
80 | 77 |
|
81 | | -Playwright is not required unless runtime files change. |
| 78 | +Playwright is not required because this PR does not change UI or browser runtime behavior. |
82 | 79 |
|
83 | 80 | ## Artifact |
84 | 81 |
|
85 | 82 | Create repo-structured delta ZIP: |
86 | 83 |
|
87 | 84 | ```text |
88 | | -tmp/PR_26177_OWNER_051-environment-configuration-standards_delta.zip |
| 85 | +tmp/PR_26177_DELTA_052-random-seed-utility_delta.zip |
89 | 86 | ``` |
0 commit comments