Skip to content

Commit a7e05a1

Browse files
committed
BUILD_PR PR_26175_CHARLIE_003 r2 storage standardization
1 parent a2c0dd1 commit a7e05a1

13 files changed

Lines changed: 725 additions & 251 deletions

.env.example

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ GAMEFOUNDRY_DB_BACKUP_DIR=
5050

5151
# Server-only project asset storage configuration.
5252
# Browser uploads must go through the server API and must not receive these secrets.
53+
# Approved GAMEFOUNDRY_STORAGE_PROJECTS_PREFIX values:
54+
# DEV /dev/projects/
55+
# IST /ist/projects/
56+
# UAT /uat/projects/
57+
# PRD /prod/projects/
5358
GAMEFOUNDRY_STORAGE_ENDPOINT=
5459
GAMEFOUNDRY_STORAGE_ACCESS_KEY_ID=
5560

admin/infrastructure.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ <h2>Admin</h2>
4141
<p>/dev/projects/</p>
4242
<p>/ist/projects/</p>
4343
<p>/uat/projects/</p>
44-
<p>/prd/projects/</p>
44+
<p>/prod/projects/</p>
4545
</div>
4646
</details>
4747
</div>
@@ -81,7 +81,7 @@ <h3 id="admin-infrastructure-image-zoom-title">Game Foundry Infrastructure</h3>
8181
<tr><td>DEV</td><td>/dev/projects/</td><td>Loading</td></tr>
8282
<tr><td>IST</td><td>/ist/projects/</td><td>Loading</td></tr>
8383
<tr><td>UAT</td><td>/uat/projects/</td><td>Loading</td></tr>
84-
<tr><td>PRD</td><td>/prd/projects/</td><td>Loading</td></tr>
84+
<tr><td>PRD</td><td>/prod/projects/</td><td>Loading</td></tr>
8585
</tbody>
8686
</table>
8787
</div>

assets/theme-v2/js/admin-infrastructure.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const STORAGE_PATH_LANES = Object.freeze([
66
Object.freeze({ lane: "DEV", path: "/dev/projects/" }),
77
Object.freeze({ lane: "IST", path: "/ist/projects/" }),
88
Object.freeze({ lane: "UAT", path: "/uat/projects/" }),
9-
Object.freeze({ lane: "PRD", path: "/prd/projects/" }),
9+
Object.freeze({ lane: "PRD", path: "/prod/projects/" }),
1010
]);
1111

1212
class AdminInfrastructureStoragePathStatus {

docs_build/dev/reports/PR_26175_CHARLIE_003-r2-storage-standardization-instruction-compliance-checklist.md

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,21 @@
22

33
| Requirement | Status | Evidence |
44
|---|---:|---|
5-
| Active branch remains `PR_26172_CHARLIE_repository-compliance-stack` | PASS | Branch gate passed before PLAN changes. |
6-
| Worktree clean before PLAN | PASS | `git status --short` returned no output. |
7-
| Scope only R2 storage configuration standardization | PASS | PLAN is limited to `GAMEFOUNDRY_STORAGE_PROJECTS_PREFIX` and R2 storage config/status targets. |
8-
| Standardize around `GAMEFOUNDRY_STORAGE_PROJECTS_PREFIX` | PASS | PLAN names this as the authoritative project storage prefix variable. |
9-
| Include `/dev/projects/` | PASS | Approved prefix listed. |
10-
| Include `/ist/projects/` | PASS | Approved prefix listed. |
11-
| Include `/uat/projects/` | PASS | Approved prefix listed. |
12-
| Include `/prod/projects/` | PASS | Approved prefix listed. |
13-
| Do not implement telemetry | PASS | Telemetry is explicitly out of scope. |
14-
| Do not implement configurable runtime ports | PASS | Runtime-port work is explicitly out of scope. |
15-
| No implementation files changed in PLAN | PASS | PLAN creates report artifacts only. |
16-
| Required reports under `docs_build/dev/reports/` | PASS | PLAN, manual notes, checklist, Codex diff, and changed-files reports are produced. |
17-
| Repo-structured ZIP under `tmp/` | PASS | Planned artifact: `tmp/PR_26175_CHARLIE_003-r2-storage-standardization_PLAN_delta.zip`. |
5+
| Active branch remains `PR_26172_CHARLIE_repository-compliance-stack` | PASS | Branch gate returned `PR_26172_CHARLIE_repository-compliance-stack`. |
6+
| Worktree clean before BUILD | PASS | `git status --short` returned no output before edits. |
7+
| Local/origin sync before BUILD is `0 0` | PASS | Sync check returned `0 0`. |
8+
| Scope only R2 storage configuration standardization | PASS | Changes are limited to prefix config, safe status surfaces, validation, tests, and reports. |
9+
| Standardize around `GAMEFOUNDRY_STORAGE_PROJECTS_PREFIX` | PASS | Shared approved prefix list added in `storage-config.mjs`. |
10+
| Allow `/dev/projects/` | PASS | Included in `STORAGE_PROJECTS_ALLOWED_PREFIXES`; covered by tests/status surfaces. |
11+
| Allow `/ist/projects/` | PASS | Included in `STORAGE_PROJECTS_ALLOWED_PREFIXES`; covered by tests/status surfaces. |
12+
| Allow `/uat/projects/` | PASS | Included in `STORAGE_PROJECTS_ALLOWED_PREFIXES`; covered by tests/status surfaces. |
13+
| Allow `/prod/projects/` | PASS | Included in `STORAGE_PROJECTS_ALLOWED_PREFIXES`; PRD lane references updated to `/prod/projects/`. |
14+
| Reject unapproved project prefixes | PASS | New storage-config test rejects `/production/projects/`, `/qa/projects/`, and `/projects/`. |
15+
| Preserve R2 list/read/write/delete behavior | PASS | Connectivity action code paths were not changed; storage validation list/readiness passed with `--use-system-ca`. |
16+
| Preserve System Health and Infrastructure safe status surfaces | PASS | Targeted Admin Health Operations and Infrastructure Playwright validations passed. |
17+
| Do not expose secrets | PASS | Safe config excludes access and secret keys; validation output did not print credential values. |
18+
| Do not implement telemetry | PASS | No telemetry implementation was added. |
19+
| Do not implement configurable runtime ports | PASS | Runtime port code was not changed. |
20+
| Do not edit ignored local `.env` files | PASS | Only `.env.example` was updated. |
21+
| Required reports under `docs_build/dev/reports/` | PASS | PR report, manual notes, checklist, codex diff, and changed-files reports are produced. |
22+
| Repo-structured ZIP under `tmp/` | PASS | ZIP produced as `tmp/PR_26175_CHARLIE_003-r2-storage-standardization_delta.zip`. |
Lines changed: 30 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,34 @@
11
# PR_26175_CHARLIE_003 Manual Validation Notes
22

3-
## Manual Checks Completed During PLAN
3+
## Manual Checks Completed During BUILD
44

55
- Confirmed active branch remained `PR_26172_CHARLIE_repository-compliance-stack`.
6-
- Confirmed worktree was clean before PLAN artifacts were created.
7-
- Confirmed branch local/origin sync was `0 0` before PLAN artifacts were created.
8-
- Reviewed active ProjectInstructions and Team Charlie ownership.
9-
- Reviewed R2 storage config, R2 provider, Admin Infrastructure, Admin System Health, storage validation script, and targeted Admin Playwright coverage.
10-
11-
## Current State Observations
12-
13-
- The active R2 storage config normalizes `GAMEFOUNDRY_STORAGE_PROJECTS_PREFIX`.
14-
- Server-side status already recognizes the approved storage lanes for Admin Infrastructure/System Health.
15-
- The storage config loader does not yet reject arbitrary normalized project prefixes.
16-
- `.env.example` includes `GAMEFOUNDRY_STORAGE_PROJECTS_PREFIX=` but no lane value.
17-
- Tracked `.env.dev`, `.env.ist`, `.env.uat`, and `.env.prd` files were not present in this workspace search.
18-
19-
## Manual Checks Required During APPLY/Build
20-
21-
- Verify project prefix validation accepts only `/dev/projects/`, `/ist/projects/`, `/uat/projects/`, and `/prod/projects/`.
22-
- Verify invalid prefix status is visible and actionable.
23-
- Verify R2 credential values are never printed.
24-
- Verify existing R2 connectivity behavior still uses the configured approved prefix.
25-
- Verify telemetry and configurable runtime ports were not implemented.
26-
27-
## Skipped During PLAN
28-
29-
- No implementation validation was run because this task is PLAN_PR only.
30-
- No Playwright validation was run because no runtime/UI files were changed.
31-
- No samples were run.
6+
- Confirmed worktree was clean before BUILD edits.
7+
- Confirmed branch local/origin sync was `0 0` before BUILD edits.
8+
- Reviewed ProjectInstructions and approved PLAN report.
9+
- Reviewed exact target files for R2 storage config, Local API status surface, Admin Infrastructure, storage validation, and targeted tests.
10+
11+
## Behavioral Notes
12+
13+
- `GAMEFOUNDRY_STORAGE_PROJECTS_PREFIX` now accepts only normalized project prefixes in the approved lane list.
14+
- PRD lane display now uses `/prod/projects/`.
15+
- Invalid project prefixes return a safe validation error that names approved values and does not expose credentials.
16+
- R2 list/read/write/delete code paths were not changed.
17+
- System Health and Infrastructure status surfaces continue to hide storage credentials.
18+
19+
## Validation Notes
20+
21+
- `git diff --check` passed.
22+
- `node --test tests/dev-runtime/StorageConfig.test.mjs` passed.
23+
- `node --test tests/dev-runtime/AdminHealthOperations.test.mjs` passed.
24+
- Targeted Admin Infrastructure Playwright storage path tests passed.
25+
- Targeted Admin System Health Playwright route tests passed.
26+
- `node scripts/validate-storage-config.mjs` failed on local certificate trust before a code failure was observed.
27+
- `node --use-system-ca scripts/validate-storage-config.mjs` passed and confirmed R2 list/readiness for `/dev/projects/`.
28+
29+
## Skipped Validation
30+
31+
- Full samples smoke was skipped because the approved scope was storage prefix standardization only.
32+
- Broad Playwright was skipped because targeted Admin status validations passed.
33+
- Telemetry validation was skipped because telemetry is out of scope.
34+
- Configurable runtime port validation was skipped because runtime ports are out of scope.
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# PR_26175_CHARLIE_003-r2-storage-standardization
2+
3+
Team: Charlie
4+
5+
Purpose: Standardize R2 project asset storage around `GAMEFOUNDRY_STORAGE_PROJECTS_PREFIX` and the approved project prefix set.
6+
7+
## Branch Validation
8+
9+
| Check | Expected | Actual | Status |
10+
|---|---|---|---|
11+
| Active branch | `PR_26172_CHARLIE_repository-compliance-stack` | `PR_26172_CHARLIE_repository-compliance-stack` | PASS |
12+
| Worktree before BUILD | clean | clean | PASS |
13+
| Local/origin sync before BUILD | `0 0` | `0 0` | PASS |
14+
| Team ownership | Charlie storage/infrastructure | R2 storage configuration standardization | PASS |
15+
16+
## Implementation Summary
17+
18+
- Added `STORAGE_PROJECTS_PREFIX_LANES` and `STORAGE_PROJECTS_ALLOWED_PREFIXES` as the shared approved project prefix contract.
19+
- Restricted `loadStorageConfig()` to normalized prefixes matching:
20+
- `/dev/projects/`
21+
- `/ist/projects/`
22+
- `/uat/projects/`
23+
- `/prod/projects/`
24+
- Updated Admin Infrastructure and Local API storage path status to use `/prod/projects/` for the PRD lane.
25+
- Kept R2 list/read/write/delete behavior unchanged and still routed through the configured project prefix.
26+
- Updated `.env.example` comments and `scripts/validate-storage-config.mjs` safe output to name approved prefixes.
27+
- Added focused `node:test` coverage for prefix normalization, allow-list validation, missing prefix handling, and safe config secret masking.
28+
29+
## Files Changed
30+
31+
- `.env.example`
32+
- `admin/infrastructure.html`
33+
- `assets/theme-v2/js/admin-infrastructure.js`
34+
- `scripts/validate-storage-config.mjs`
35+
- `src/dev-runtime/server/local-api-router.mjs`
36+
- `src/dev-runtime/storage/storage-config.mjs`
37+
- `tests/dev-runtime/StorageConfig.test.mjs`
38+
- `tests/playwright/tools/AdminPlatformToolsWireframes.spec.mjs`
39+
40+
## Scope Guardrails
41+
42+
| Requirement | Status | Notes |
43+
|---|---:|---|
44+
| Preserve R2 list/read/write/delete behavior | PASS | Connectivity action code paths were not changed. |
45+
| Preserve System Health safe status surface | PASS | Existing Admin Health Operations test and page spec passed. |
46+
| Preserve Infrastructure safe status surface | PASS | Storage path status rows now use the shared approved prefix list. |
47+
| Do not expose secrets | PASS | Safe config excludes access key and secret key values; validation output printed no secret values. |
48+
| Do not implement telemetry | PASS | No telemetry code was added. |
49+
| Do not implement configurable runtime ports | PASS | Runtime port logic was not changed. |
50+
| Do not edit local ignored `.env` files | PASS | Only `.env.example` was updated. |
51+
52+
## Validation Lane Report
53+
54+
| Command | Result |
55+
|---|---:|
56+
| `git diff --check` | PASS |
57+
| `node --test tests/dev-runtime/StorageConfig.test.mjs` | PASS, 5 tests |
58+
| `node --test tests/dev-runtime/AdminHealthOperations.test.mjs` | PASS, 4 tests |
59+
| `npx playwright test tests/playwright/tools/AdminPlatformToolsWireframes.spec.mjs --grep "Infrastructure storage path status"` | PASS, 4 tests |
60+
| `npx playwright test tests/playwright/tools/AdminHealthOperationsPage.spec.mjs` | PASS, 3 tests |
61+
| `node scripts/validate-storage-config.mjs` | FAIL due local Node certificate trust error before code changes were needed |
62+
| `node --use-system-ca scripts/validate-storage-config.mjs` | PASS; R2 list/readiness succeeded for `/dev/projects/` with 0 objects |
63+
64+
## Validation Notes
65+
66+
- The first `validate-storage-config` run loaded `.env`, confirmed all storage keys were present, and printed only safe endpoint, bucket, and prefix values. It failed on `UNABLE_TO_VERIFY_LEAF_SIGNATURE`.
67+
- The rerun with `--use-system-ca` passed and confirmed the R2 list/readiness behavior under the approved `/dev/projects/` prefix.
68+
- Active code, config, Admin UI, and targeted tests no longer use `/prd/projects/`.
69+
- Historical report references to `/prd/projects/` were left untouched as report history.
70+
71+
## Skipped Lanes
72+
73+
- Full samples smoke: skipped; out of scope for R2 prefix standardization.
74+
- Broad Playwright: skipped; targeted Admin Infrastructure and System Health specs passed.
75+
- Telemetry validation: skipped; telemetry is explicitly out of scope.
76+
- Configurable runtime port validation: skipped; runtime ports are explicitly out of scope.
77+
78+
## BUILD Result
79+
80+
BUILD status: PASS.
81+
82+
Recommendation: Keep this commit on the Charlie stack for owner review.
Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1-
docs_build/dev/reports/PR_26175_CHARLIE_003-r2-storage-standardization_PLAN.md
2-
docs_build/dev/reports/PR_26175_CHARLIE_003-r2-storage-standardization-manual-validation-notes.md
1+
.env.example
2+
admin/infrastructure.html
3+
assets/theme-v2/js/admin-infrastructure.js
4+
docs_build/dev/reports/PR_26175_CHARLIE_003-r2-storage-standardization.md
35
docs_build/dev/reports/PR_26175_CHARLIE_003-r2-storage-standardization-instruction-compliance-checklist.md
4-
docs_build/dev/reports/codex_review.diff
5-
docs_build/dev/reports/codex_changed_files.txt
6+
docs_build/dev/reports/PR_26175_CHARLIE_003-r2-storage-standardization-manual-validation-notes.md
7+
scripts/validate-storage-config.mjs
8+
src/dev-runtime/server/local-api-router.mjs
9+
src/dev-runtime/storage/storage-config.mjs
10+
tests/dev-runtime/StorageConfig.test.mjs
11+
tests/playwright/tools/AdminPlatformToolsWireframes.spec.mjs

0 commit comments

Comments
 (0)