Skip to content

Commit a2c0dd1

Browse files
committed
PLAN_PR PR_26175_CHARLIE_003 r2 storage standardization
1 parent 5de48d1 commit a2c0dd1

5 files changed

Lines changed: 402 additions & 519 deletions
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# PR_26175_CHARLIE_003 Instruction Compliance Checklist
2+
3+
| Requirement | Status | Evidence |
4+
|---|---:|---|
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`. |
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# PR_26175_CHARLIE_003 Manual Validation Notes
2+
3+
## Manual Checks Completed During PLAN
4+
5+
- 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.
Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
# PLAN_PR: PR_26175_CHARLIE_003-r2-storage-standardization
2+
3+
Team: Charlie
4+
5+
Purpose: Plan a scoped R2 storage configuration standardization PR around `GAMEFOUNDRY_STORAGE_PROJECTS_PREFIX` and the approved project storage prefixes.
6+
7+
## Branch and Context 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 PLAN changes | clean | clean | PASS |
13+
| Local/origin sync before PLAN changes | `0 0` | `0 0` | PASS |
14+
| Active team | Team Charlie | Team Charlie | PASS |
15+
| Ownership scope | Infrastructure / Storage / System Health | R2 storage configuration standardization | PASS |
16+
17+
## Scope
18+
19+
Plan only for R2 storage configuration standardization.
20+
21+
Approved standard:
22+
23+
- Configuration variable: `GAMEFOUNDRY_STORAGE_PROJECTS_PREFIX`
24+
- Allowed project storage prefixes:
25+
- `/dev/projects/`
26+
- `/ist/projects/`
27+
- `/uat/projects/`
28+
- `/prod/projects/`
29+
30+
Allowed APPLY/build scope:
31+
32+
- Standardize project asset storage config validation around the approved prefix set.
33+
- Keep R2 as the project asset storage provider direction.
34+
- Keep object keys server-owned and under the configured prefix.
35+
- Keep prefix normalization for slash and backslash cleanup, then validate against the approved prefix set.
36+
- Keep safe status surfaces in Admin Infrastructure and Admin System Health aligned with the same allowed prefix set.
37+
- Preserve existing R2 list/read/write/delete connectivity behavior.
38+
- Preserve existing Postgres, Runtime Environment, Limits, Diagnostics Plan, and Diagnostics Log behavior.
39+
- Preserve secret masking and never return access key or secret key values.
40+
41+
Explicitly out of scope:
42+
43+
- Telemetry implementation.
44+
- Configurable runtime ports.
45+
- New storage provider abstraction.
46+
- Live R2 credential changes.
47+
- New persistence tables or database schema.
48+
- Backup prefix changes beyond checking for conflicts with project storage prefix rules.
49+
- Editing local ignored `.env` files.
50+
- Samples smoke.
51+
52+
## Current Implementation Inventory
53+
54+
Exact target files reviewed:
55+
56+
- `src/dev-runtime/storage/storage-config.mjs`
57+
- `src/dev-runtime/storage/r2-project-asset-storage.mjs`
58+
- `src/dev-runtime/server/local-api-router.mjs`
59+
- `scripts/validate-storage-config.mjs`
60+
- `admin/infrastructure.html`
61+
- `assets/theme-v2/js/admin-infrastructure.js`
62+
- `admin/system-health.html`
63+
- `assets/theme-v2/js/admin-system-health.js`
64+
- `tests/playwright/tools/AdminPlatformToolsWireframes.spec.mjs`
65+
66+
Current findings:
67+
68+
- `storage-config.mjs` normalizes `GAMEFOUNDRY_STORAGE_PROJECTS_PREFIX` but currently accepts any non-empty normalized prefix.
69+
- `local-api-router.mjs` already has `STORAGE_PROJECTS_PREFIX_LANES` with the four approved prefixes and reports invalid paths in Infrastructure/System Health status.
70+
- `admin/infrastructure.html` lists `/dev/projects/`, `/ist/projects/`, `/uat/projects/`, and `/prd/projects/`.
71+
- `assets/theme-v2/js/admin-infrastructure.js` mirrors those four paths client-side for fallback/error rows.
72+
- `AdminPlatformToolsWireframes.spec.mjs` has focused coverage for missing, invalid, DEV, and IST path status and includes the full four-prefix list.
73+
- `scripts/validate-storage-config.mjs` validates configured R2 connectivity but depends on `loadStorageConfig()` for prefix acceptance.
74+
- `.env.example` includes `GAMEFOUNDRY_STORAGE_PROJECTS_PREFIX=` but does not currently enforce a value.
75+
- Tracked `.env.dev`, `.env.ist`, `.env.uat`, and `.env.prd` files were not present in this workspace when searched. Local ignored environment files must not be edited by this PR.
76+
77+
## Proposed APPLY/Build Steps
78+
79+
1. Add an exported approved project prefix list in `src/dev-runtime/storage/storage-config.mjs`, for example `STORAGE_PROJECTS_ALLOWED_PREFIXES`.
80+
2. Update `loadStorageConfig()` so `GAMEFOUNDRY_STORAGE_PROJECTS_PREFIX` is normalized first, then accepted only when it matches one of:
81+
- `/dev/projects/`
82+
- `/ist/projects/`
83+
- `/uat/projects/`
84+
- `/prod/projects/`
85+
3. Return a safe validation error when the prefix is missing or outside the approved list.
86+
4. Update `src/dev-runtime/server/local-api-router.mjs` to reuse the storage-config approved prefix list where practical, or keep its lane metadata explicitly synchronized if importing would create an unwanted dependency.
87+
5. Update `scripts/validate-storage-config.mjs` output so invalid prefixes report the approved values without printing secrets.
88+
6. Update `.env.example` comments near `GAMEFOUNDRY_STORAGE_PROJECTS_PREFIX` to document the approved values. Leave the value blank if templates should not default to a lane.
89+
7. Add or update targeted Node tests for `normalizeStorageProjectsPrefix()` and `loadStorageConfig()`:
90+
- accepts slash variants that normalize to approved prefixes;
91+
- rejects `/qa/projects/`;
92+
- rejects generic `/projects/`;
93+
- rejects empty values;
94+
- never exposes access key or secret key values in safe config.
95+
8. Update targeted Admin/System Health validation only if the payload shape changes.
96+
9. Produce required reports and repo-structured ZIP.
97+
98+
## Status and Severity Rules
99+
100+
Use existing status model:
101+
102+
- `PASS`: configured prefix matches exactly one approved lane.
103+
- `WARN`: missing or incomplete storage configuration.
104+
- `FAIL`: malformed or unsafe storage configuration if the existing caller expects failure semantics.
105+
- `PENDING`: intentionally unwired future work only.
106+
107+
For this PR, invalid project prefixes should remain visible and actionable. The recommended server-facing status is `WARN` unless an existing route/test already treats invalid prefix as `ERROR` and preserving that behavior is safer. Browser-facing status must not expose secret values.
108+
109+
## Validation Plan
110+
111+
Required targeted validation for APPLY/build:
112+
113+
- `git diff --check`
114+
- `node --test tests/dev-runtime/StorageConfig.test.mjs` or equivalent new targeted storage-config test
115+
- `node --test tests/dev-runtime/AdminHealthOperations.test.mjs`
116+
- `npx playwright test tests/playwright/tools/AdminPlatformToolsWireframes.spec.mjs --grep "Infrastructure storage path status"`
117+
- `npx playwright test tests/playwright/tools/AdminHealthOperationsPage.spec.mjs`
118+
- `node scripts/validate-storage-config.mjs` only when `.env` is present and configured; otherwise document SKIP from script output.
119+
120+
Required static checks:
121+
122+
- Verify `GAMEFOUNDRY_STORAGE_PROJECTS_PREFIX` appears in config/docs/status surfaces.
123+
- Verify approved prefixes appear:
124+
- `/dev/projects/`
125+
- `/ist/projects/`
126+
- `/uat/projects/`
127+
- `/prod/projects/`
128+
- Verify no raw R2 credentials are printed in reports, tests, or status payloads.
129+
130+
Skipped lanes:
131+
132+
- Full samples smoke: skipped because scope is R2 storage config standardization only.
133+
- Broad Playwright: skipped unless targeted Admin/System Health validation fails.
134+
- Telemetry validation: skipped because telemetry is explicitly out of scope.
135+
- Runtime-port validation: skipped because configurable runtime ports are explicitly out of scope.
136+
137+
## Required Reports for APPLY/Build
138+
139+
- `docs_build/dev/reports/codex_review.diff`
140+
- `docs_build/dev/reports/codex_changed_files.txt`
141+
- `docs_build/dev/reports/PR_26175_CHARLIE_003-r2-storage-standardization.md`
142+
- `docs_build/dev/reports/PR_26175_CHARLIE_003-r2-storage-standardization-manual-validation-notes.md`
143+
- `docs_build/dev/reports/PR_26175_CHARLIE_003-r2-storage-standardization-instruction-compliance-checklist.md`
144+
- repo-structured delta ZIP under `tmp/`
145+
146+
## PLAN_PR Result
147+
148+
PLAN status: PASS.
149+
150+
Recommendation: Proceed to BUILD/APPLY on the active Charlie stack branch if owner approves the scoped server-side prefix validation and targeted test additions.
Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
1-
admin/system-health.html
2-
assets/theme-v2/js/admin-system-health.js
3-
docs_build/dev/reports/PR_26175_CHARLIE_002-system-health-dashboard-instruction-compliance-checklist.md
4-
docs_build/dev/reports/PR_26175_CHARLIE_002-system-health-dashboard-manual-validation-notes.md
5-
docs_build/dev/reports/PR_26175_CHARLIE_002-system-health-dashboard.md
6-
src/dev-runtime/server/local-api-router.mjs
7-
tests/dev-runtime/AdminHealthOperations.test.mjs
8-
tests/playwright/tools/AdminHealthOperationsPage.spec.mjs
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
3+
docs_build/dev/reports/PR_26175_CHARLIE_003-r2-storage-standardization-instruction-compliance-checklist.md
94
docs_build/dev/reports/codex_review.diff
105
docs_build/dev/reports/codex_changed_files.txt

0 commit comments

Comments
 (0)