Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 24 additions & 20 deletions docs_build/dev/BUILD_PR.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,44 @@
# PR_26177_001-shared-hash-foundation
# PR_26177_002-shared-noise-foundation

## Purpose

Add a small shared non-cryptographic hash foundation.
Add a small shared deterministic noise foundation.

## Source Of Truth

This `BUILD_PR.md`, `PLAN_PR.md`, and the user request are the source of truth for `PR_26177_001-shared-hash-foundation`.
This `BUILD_PR.md`, `PLAN_PR.md`, and the user request are the source of truth for `PR_26177_002-shared-noise-foundation`.

## Stack

- Base branch: `PR_26177_001-shared-hash-foundation`
- This PR builds on PR_001 hash utilities.

## Exact Scope

- Add `src/shared/hash/` foundation.
- Include deterministic non-crypto hash helpers.
- No browser-owned product data.
- No runtime UI changes.
- Add targeted tests for the shared hash area.
- Add `src/shared/noise/` foundation.
- Build on existing `Random`/`RandomSeed` and PR_001 hash utilities.
- Include deterministic Value, Perlin-style, Simplex-style, and Fractal-style helpers only where practical.
- Keep API small and documented.
- Add targeted tests for the shared noise area.
- Create required Codex reports under `docs_build/dev/reports/`.
- Create repo-structured delta ZIP under `tmp/`.

## Exact Targets

- `docs_build/dev/PLAN_PR.md`
- `docs_build/dev/BUILD_PR.md`
- `src/shared/hash/hash.js`
- `tests/shared/HashFoundation.test.mjs`
- `docs_build/dev/reports/PR_26177_001-shared-hash-foundation.md`
- `docs_build/dev/reports/PR_26177_001-shared-hash-foundation_branch-validation.md`
- `docs_build/dev/reports/PR_26177_001-shared-hash-foundation_requirement-checklist.md`
- `docs_build/dev/reports/PR_26177_001-shared-hash-foundation_validation-lane.md`
- `docs_build/dev/reports/PR_26177_001-shared-hash-foundation_manual-validation-notes.md`
- `src/shared/noise/noise.js`
- `tests/shared/NoiseFoundation.test.mjs`
- `docs_build/dev/reports/PR_26177_002-shared-noise-foundation.md`
- `docs_build/dev/reports/PR_26177_002-shared-noise-foundation_branch-validation.md`
- `docs_build/dev/reports/PR_26177_002-shared-noise-foundation_requirement-checklist.md`
- `docs_build/dev/reports/PR_26177_002-shared-noise-foundation_validation-lane.md`
- `docs_build/dev/reports/PR_26177_002-shared-noise-foundation_manual-validation-notes.md`
- `docs_build/dev/reports/codex_review.diff`
- `docs_build/dev/reports/codex_changed_files.txt`

## Out Of Scope

- No cryptographic hashing.
- No browser-owned product data.
- No runtime UI changes.
- No browser storage changes.
Expand All @@ -49,9 +53,9 @@ This `BUILD_PR.md`, `PLAN_PR.md`, and the user request are the source of truth f
Run exactly:

```powershell
node ./scripts/run-node-test-files.mjs tests/shared/HashFoundation.test.mjs
node --check src/shared/hash/hash.js
node --check tests/shared/HashFoundation.test.mjs
node ./scripts/run-node-test-files.mjs tests/shared/NoiseFoundation.test.mjs tests/shared/HashFoundation.test.mjs
node --check src/shared/noise/noise.js
node --check tests/shared/NoiseFoundation.test.mjs
git diff --check
```

Expand All @@ -60,5 +64,5 @@ git diff --check
Create repo-structured delta ZIP:

```text
tmp/PR_26177_001-shared-hash-foundation_delta.zip
tmp/PR_26177_002-shared-noise-foundation_delta.zip
```
25 changes: 10 additions & 15 deletions docs_build/dev/PLAN_PR.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,23 @@
# PLAN_PR: PR_26177_001-shared-hash-foundation
# PLAN_PR: PR_26177_002-shared-noise-foundation

## Purpose

Add a small shared non-cryptographic hash foundation.
Add a small shared deterministic noise foundation.

## Scope

- Add `src/shared/hash/` foundation.
- Include deterministic non-crypto hash helpers.
- Add targeted unit tests.
- Add `src/shared/noise/` foundation.
- Build on existing `RandomSeed` and PR_001 hash utilities.
- Include deterministic Value, Perlin-style, Simplex-style, and Fractal-style helpers where practical.
- Keep API small and documented.
- Add targeted tests.
- No browser-owned product data.
- No runtime UI changes.
- No unrelated cleanup.

## Implementation Plan

1. Add `src/shared/hash/hash.js` with deterministic stable string and FNV-1a based helpers.
2. Add `tests/shared/HashFoundation.test.mjs`.
3. Validate determinism, object key ordering, seed variation, combination, and normalized hash output.
1. Add `src/shared/noise/noise.js`.
2. Add `tests/shared/NoiseFoundation.test.mjs`.
3. Validate deterministic output, seed variation, practical ranges, and permutation determinism.
4. Produce required Codex reports and repo-structured ZIP.

## Acceptance Criteria

- Hash helpers are deterministic for identical values.
- Object hashing is stable regardless of property insertion order.
- Helpers are documented as non-cryptographic.
- No browser storage, UI, API, database, or sample smoke changes are introduced.
24 changes: 24 additions & 0 deletions docs_build/dev/reports/PR_26177_002-shared-noise-foundation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# PR_26177_002-shared-noise-foundation

Date: 2026-06-26
Scope: Shared deterministic noise foundation
Status: PASS

## Summary

- Added `src/shared/noise/noise.js`.
- Added deterministic value, Perlin-style, Simplex-style, fractal, and seeded permutation helpers.
- Built on PR_001 hash utilities and existing `RandomSeed`.
- Added targeted tests in `tests/shared/NoiseFoundation.test.mjs`.
- No browser-owned product data, runtime UI, API, database, or unrelated cleanup changes were made.

## Validation

- PASS: `node ./scripts/run-node-test-files.mjs tests/shared/NoiseFoundation.test.mjs tests/shared/HashFoundation.test.mjs`.
- PASS: `node --check src/shared/noise/noise.js`.
- PASS: `node --check tests/shared/NoiseFoundation.test.mjs`.
- PASS: `git diff --check`.

## Artifact

- `tmp/PR_26177_002-shared-noise-foundation_delta.zip`
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# PR_26177_002-shared-noise-foundation Branch Validation

Status: PASS

- PASS: Branch `PR_26177_002-shared-noise-foundation` was created from `PR_26177_001-shared-hash-foundation`.
- PASS: Stack base was clean before branch creation.
- PASS: One PR purpose only: shared noise foundation.
- PASS: No `start_of_day` files changed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# PR_26177_002-shared-noise-foundation Manual Validation Notes

Status: PASS

Manual review confirmed the noise helpers are deterministic, small, documented, stacked on the hash foundation, and isolated from UI, browser product-data ownership, API, and database behavior.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# PR_26177_002-shared-noise-foundation Requirement Checklist

| Requirement | Status | Notes |
|---|---:|---|
| Add `src/shared/noise/` foundation | PASS | Added `src/shared/noise/noise.js`. |
| Build on Random/RandomSeed and PR_001 hash utilities | PASS | Uses `RandomSeed` and hash helpers. |
| Include deterministic Value helpers where practical | PASS | Added `valueNoise2D`. |
| Include deterministic Perlin helpers where practical | PASS | Added `perlinNoise2D`. |
| Include deterministic Simplex helpers where practical | PASS | Added `simplexNoise2D`. |
| Include deterministic Fractal helpers where practical | PASS | Added `fractalNoise2D`. |
| Keep API small and documented | PASS | Added a compact documented helper set. |
| Add targeted tests | PASS | Added `tests/shared/NoiseFoundation.test.mjs`. |
| No runtime UI changes | PASS | No UI files changed. |
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# PR_26177_002-shared-noise-foundation Validation Lane

Status: PASS

## Commands

```powershell
node ./scripts/run-node-test-files.mjs tests/shared/NoiseFoundation.test.mjs tests/shared/HashFoundation.test.mjs
node --check src/shared/noise/noise.js
node --check tests/shared/NoiseFoundation.test.mjs
git diff --check
```

## Results

- PASS: Targeted noise and hash tests.
- PASS: Changed JS syntax checks.
- PASS: `git diff --check`.

## Not Run

- Full samples smoke was not run by default.
14 changes: 7 additions & 7 deletions docs_build/dev/reports/codex_changed_files.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
docs_build/dev/BUILD_PR.md
docs_build/dev/PLAN_PR.md
docs_build/dev/reports/PR_26177_001-shared-hash-foundation.md
docs_build/dev/reports/PR_26177_001-shared-hash-foundation_branch-validation.md
docs_build/dev/reports/PR_26177_001-shared-hash-foundation_manual-validation-notes.md
docs_build/dev/reports/PR_26177_001-shared-hash-foundation_requirement-checklist.md
docs_build/dev/reports/PR_26177_001-shared-hash-foundation_validation-lane.md
docs_build/dev/reports/PR_26177_002-shared-noise-foundation.md
docs_build/dev/reports/PR_26177_002-shared-noise-foundation_branch-validation.md
docs_build/dev/reports/PR_26177_002-shared-noise-foundation_manual-validation-notes.md
docs_build/dev/reports/PR_26177_002-shared-noise-foundation_requirement-checklist.md
docs_build/dev/reports/PR_26177_002-shared-noise-foundation_validation-lane.md
docs_build/dev/reports/codex_changed_files.txt
docs_build/dev/reports/codex_review.diff
src/shared/hash/hash.js
tests/shared/HashFoundation.test.mjs
src/shared/noise/noise.js
tests/shared/NoiseFoundation.test.mjs
Loading
Loading