Skip to content

Commit b2c04a1

Browse files
committed
Consolidate storage prefix, document GFSP packages, validate R2, and wire Assets storage - PR_26168_222-through-225-r2-assets-stack
1 parent d51c34a commit b2c04a1

50 files changed

Lines changed: 3612 additions & 430 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.example

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,3 @@ GAMEFOUNDRY_STORAGE_ACCESS_KEY_ID=
2626
GAMEFOUNDRY_STORAGE_SECRET_ACCESS_KEY=
2727
GAMEFOUNDRY_STORAGE_BUCKET=
2828
GAMEFOUNDRY_STORAGE_PROJECTS_PREFIX=
29-
GAMEFOUNDRY_ASSET_STORAGE_PATH=

admin/infrastructure.html

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ <h2>Admin</h2>
4444
<p>/dev/projects/</p>
4545
<p>/ist/projects/</p>
4646
<p>/uat/projects/</p>
47-
<p>/prod/projects/</p>
47+
<p>/prd/projects/</p>
4848
</div>
4949
</details>
5050
</div>
@@ -72,7 +72,7 @@ <h3 id="admin-infrastructure-image-zoom-title">Game Foundry Infrastructure</h3>
7272
</dialog>
7373
<div class="table-wrapper">
7474
<table class="data-table" aria-label="Project storage path reference">
75-
<caption>Project Asset Storage Paths use <code>GAMEFOUNDRY_ASSET_STORAGE_PATH</code></caption>
75+
<caption>Project Asset Storage Paths use <code>GAMEFOUNDRY_STORAGE_PROJECTS_PREFIX</code></caption>
7676
<thead>
7777
<tr>
7878
<th scope="col">Lane</th>
@@ -84,7 +84,23 @@ <h3 id="admin-infrastructure-image-zoom-title">Game Foundry Infrastructure</h3>
8484
<tr><td>DEV</td><td>/dev/projects/</td><td>Loading</td></tr>
8585
<tr><td>IST</td><td>/ist/projects/</td><td>Loading</td></tr>
8686
<tr><td>UAT</td><td>/uat/projects/</td><td>Loading</td></tr>
87-
<tr><td>PROD</td><td>/prod/projects/</td><td>Loading</td></tr>
87+
<tr><td>PRD</td><td>/prd/projects/</td><td>Loading</td></tr>
88+
</tbody>
89+
</table>
90+
</div>
91+
<div class="table-wrapper">
92+
<table class="data-table" aria-label="Admin storage connectivity results">
93+
<caption>Storage Connectivity Results</caption>
94+
<thead>
95+
<tr>
96+
<th scope="col">Action</th>
97+
<th scope="col">Status</th>
98+
<th scope="col">Executed</th>
99+
<th scope="col">Message</th>
100+
</tr>
101+
</thead>
102+
<tbody data-admin-storage-connectivity-result-rows>
103+
<tr><td>startup</td><td>SKIP</td><td>no</td><td>No storage connectivity action has been run.</td></tr>
88104
</tbody>
89105
</table>
90106
</div>
@@ -107,7 +123,17 @@ <h2>Inspector</h2>
107123
<summary>Guardrails</summary>
108124
<div class="accordion-body content-stack">
109125
<p>Infrastructure status remains a read-only Admin reference.</p>
110-
<p>Operational actions and connection validation stay on Owner Operations.</p>
126+
<p>Storage connectivity tests run through the Local API and never expose secrets.</p>
127+
</div>
128+
</details>
129+
<details class="vertical-accordion" open>
130+
<summary>Storage Connectivity</summary>
131+
<div class="accordion-body content-stack">
132+
<button class="btn btn--compact" type="button" data-admin-storage-connectivity-action="storage-list">List</button>
133+
<button class="btn btn--compact" type="button" data-admin-storage-connectivity-action="storage-write-test-object">Write Test Object</button>
134+
<button class="btn btn--compact" type="button" data-admin-storage-connectivity-action="storage-read-test-object">Read Test Object</button>
135+
<button class="btn btn--compact" type="button" data-admin-storage-connectivity-action="storage-delete-test-object">Delete Test Object</button>
136+
<p class="status" role="status" data-admin-storage-connectivity-status>Storage connectivity not run.</p>
111137
</div>
112138
</details>
113139
</div>

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

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,58 @@
11
import {
2-
readAdminInfrastructureStoragePathStatus
2+
readAdminInfrastructureStoragePathStatus,
3+
runAdminInfrastructureStorageConnectivityAction
34
} from "../../../src/engine/api/admin-infrastructure-api-client.js";
45

56
const STORAGE_PATH_LANES = Object.freeze([
67
Object.freeze({ lane: "DEV", path: "/dev/projects/" }),
78
Object.freeze({ lane: "IST", path: "/ist/projects/" }),
89
Object.freeze({ lane: "UAT", path: "/uat/projects/" }),
9-
Object.freeze({ lane: "PROD", path: "/prod/projects/" }),
10+
Object.freeze({ lane: "PRD", path: "/prd/projects/" }),
1011
]);
1112

1213
class AdminInfrastructureStoragePathStatus {
1314
constructor(root) {
1415
this.root = root;
16+
this.connectivityActionButtons = Array.from(root.querySelectorAll("[data-admin-storage-connectivity-action]"));
17+
this.connectivityRows = root.querySelector("[data-admin-storage-connectivity-result-rows]");
18+
this.connectivityStatus = root.querySelector("[data-admin-storage-connectivity-status]");
1519
this.rows = root.querySelector("[data-admin-storage-path-status-rows]");
1620
}
1721

1822
init() {
1923
if (!this.rows) {
2024
return;
2125
}
26+
this.connectivityActionButtons.forEach((button) => {
27+
button.addEventListener("click", () => this.runStorageConnectivityAction(button.dataset.adminStorageConnectivityAction));
28+
});
2229
this.load();
2330
}
2431

32+
setConnectivityStatus(status, message) {
33+
if (this.connectivityStatus) {
34+
this.connectivityStatus.textContent = `${status}: ${message}`;
35+
}
36+
}
37+
38+
appendConnectivityResult(result = {}) {
39+
if (!this.connectivityRows) {
40+
return;
41+
}
42+
const row = document.createElement("tr");
43+
[
44+
result.actionId || "storage-connectivity",
45+
result.status || "WARN",
46+
result.executed === true ? "yes" : "no",
47+
result.message || "No storage connectivity message returned.",
48+
].forEach((value) => {
49+
const cell = document.createElement("td");
50+
cell.textContent = value;
51+
row.append(cell);
52+
});
53+
this.connectivityRows.prepend(row);
54+
}
55+
2556
renderRows(rows) {
2657
this.rows.replaceChildren();
2758
rows.forEach((row) => {
@@ -58,6 +89,16 @@ class AdminInfrastructureStoragePathStatus {
5889
this.renderFailure(error instanceof Error ? error.message : "Storage path status unavailable.");
5990
}
6091
}
92+
93+
runStorageConnectivityAction(actionId) {
94+
try {
95+
const result = runAdminInfrastructureStorageConnectivityAction(actionId);
96+
this.appendConnectivityResult(result);
97+
this.setConnectivityStatus(result.status || "WARN", result.message || "Storage connectivity action returned no message.");
98+
} catch (error) {
99+
this.setConnectivityStatus("FAIL", error instanceof Error ? error.message : "Storage connectivity action failed.");
100+
}
101+
}
61102
}
62103

63104
document.addEventListener("DOMContentLoaded", () => {
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Project Packages
2+
3+
## Decision
4+
5+
`.gfsp` is the Game Foundry Studio Project package extension.
6+
7+
Game Foundry Studio project packages use an internal ZIP-based package format. The `.gfsp` extension identifies the package as a Game Foundry Studio Project while preserving the operational advantages of a ZIP container for export, import, validation, and inspection.
8+
9+
## Filename Format
10+
11+
Project package filenames use:
12+
13+
`<ProjectNameWithoutSpaces>-<YYJJJ>-<sequence>.gfsp`
14+
15+
Example:
16+
17+
`KingOfTheIceberg-26168-001.gfsp`
18+
19+
Rules:
20+
21+
- `ProjectNameWithoutSpaces` removes spaces from the project display name.
22+
- `YYJJJ` uses the two-digit year plus Julian day.
23+
- `sequence` is a three-digit package sequence for that project/day.
24+
- The filename is metadata for operators and review; package contents remain authoritative for project identity.
25+
26+
## Promotion Terms
27+
28+
Project promotion language uses package operations:
29+
30+
- Export Project Package
31+
- Import Project Package
32+
- Validate Project Package
33+
34+
Promotion planning should describe which project package is exported, imported, or validated and which environment lane is involved. Browser surfaces must not perform destructive promotion behavior without an explicit reviewed runtime contract.
35+
36+
## Notes
37+
38+
These notes are Codex decision notes only. They are intentionally kept under `docs_build/codex/decisions/` and must not be promoted into root, `src/`, `assets/`, `toolbox/`, `games/`, or runtime paths.

docs_build/dev/codex_commands.md

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2180,3 +2180,125 @@ Required reports:
21802180

21812181
Packaging:
21822182
- `tmp/PR_26168_221-storage-path-error-rule-and-r2-env-ready_delta.zip`
2183+
2184+
2185+
## PR_26168_222-storage-env-prefix-consolidation
2186+
2187+
Changes:
2188+
- Read `docs_build/dev/PROJECT_INSTRUCTIONS.md`.
2189+
- Verified the current branch is `main`.
2190+
- Consolidated Admin Infrastructure storage path status on `GAMEFOUNDRY_STORAGE_PROJECTS_PREFIX`.
2191+
- Removed active Admin/runtime/page dependence on `GAMEFOUNDRY_ASSET_STORAGE_PATH`.
2192+
- Updated Admin Infrastructure lane copy from `/prod/projects/` to `/prd/projects/`.
2193+
- Updated tracked `.env.example` to remove the old asset storage path placeholder.
2194+
- Updated ignored local `.env.<target>` copy-source files with non-secret storage prefix placeholders only.
2195+
2196+
Validation:
2197+
- `node --check src/dev-runtime/server/local-api-router.mjs`
2198+
- `node --check assets/theme-v2/js/admin-infrastructure.js`
2199+
- `node --check tests/playwright/tools/AdminPlatformToolsWireframes.spec.mjs`
2200+
- Admin Infrastructure static contract check for storage prefix consolidation and no inline HTML script/style/event handlers.
2201+
- `npx playwright test tests/playwright/tools/AdminPlatformToolsWireframes.spec.mjs -g "Infrastructure Admin wireframe preserves template structure|Infrastructure storage path status reports missing env path as ERROR|Infrastructure storage path status reports invalid env path as ERROR|Infrastructure storage path status reports DEV match only|Infrastructure storage path status reports IST match only"`
2202+
- Full samples smoke skipped because sample JSON and sample runtime behavior were not touched.
2203+
2204+
Required reports:
2205+
- `docs_build/dev/reports/PR_26168_222-storage-env-prefix-consolidation.md`
2206+
- `docs_build/dev/reports/codex_changed_files.txt`
2207+
- `docs_build/dev/reports/codex_review.diff`
2208+
- `docs_build/dev/reports/playwright_v8_coverage_report.txt`
2209+
- `docs_build/dev/reports/coverage_changed_js_guardrail.txt`
2210+
2211+
Packaging:
2212+
- `tmp/PR_26168_222-storage-env-prefix-consolidation_delta.zip`
2213+
2214+
2215+
## PR_26168_223-codex-decisions-notes
2216+
2217+
Changes:
2218+
- Read `docs_build/dev/PROJECT_INSTRUCTIONS.md`.
2219+
- Verified the current branch is `main`.
2220+
- Added `docs_build/codex/decisions/project-packages.md`.
2221+
- Documented `.gfsp` as Game Foundry Studio Project.
2222+
- Documented the internal ZIP-based package format, package filename format, example filename, and package-based promotion terms.
2223+
- Kept Codex decision notes under `docs_build/codex/decisions/` only.
2224+
2225+
Validation:
2226+
- `Get-Content -Path docs_build/codex/decisions/project-packages.md`
2227+
- Static Node validation for `.gfsp`, ZIP package format, filename format, example, promotion terminology, and allowed notes path.
2228+
- `git diff --check`
2229+
- Full samples smoke skipped because sample JSON and sample runtime behavior were not touched.
2230+
2231+
Required reports:
2232+
- `docs_build/dev/reports/PR_26168_223-codex-decisions-notes.md`
2233+
- `docs_build/dev/reports/codex_changed_files.txt`
2234+
- `docs_build/dev/reports/codex_review.diff`
2235+
2236+
Packaging:
2237+
- `tmp/PR_26168_223-codex-decisions-notes_delta.zip`
2238+
2239+
2240+
## PR_26168_224-r2-storage-connectivity-test
2241+
2242+
Changes:
2243+
- Read `docs_build/dev/PROJECT_INSTRUCTIONS.md`.
2244+
- Verified the current branch is `main`.
2245+
- Added Owner Operations storage connectivity actions for List, Write test object, Read test object, and Delete test object.
2246+
- Added Admin Infrastructure storage connectivity actions for List, Write test object, Read test object, and Delete test object.
2247+
- Routed connectivity actions through Local API and the configured project asset storage provider.
2248+
- Added storage provider delete support for the test object cleanup path.
2249+
- Preserved hidden credential handling and visible failure diagnostics.
2250+
2251+
Validation:
2252+
- `node --check src/dev-runtime/server/local-api-router.mjs`
2253+
- `node --check src/dev-runtime/storage/r2-project-asset-storage.mjs`
2254+
- `node --check src/engine/api/admin-infrastructure-api-client.js`
2255+
- `node --check assets/theme-v2/js/admin-infrastructure.js`
2256+
- `node --check tests/playwright/tools/AdminPlatformToolsWireframes.spec.mjs`
2257+
- Static Node storage connectivity contract validation for no inline HTML script/style/event handlers, server-owned storage actions, prefix diagnostics, and DELETE support.
2258+
- `npx playwright test tests/playwright/tools/AdminPlatformToolsWireframes.spec.mjs -g "Infrastructure Admin wireframe preserves template structure|Infrastructure storage connectivity actions call Local API and hide secrets|Owner Operations exposes owner-only connection validation and manual operation actions"`
2259+
- `git diff --check`
2260+
- Full samples smoke skipped because sample JSON and sample runtime behavior were not touched.
2261+
2262+
Required reports:
2263+
- `docs_build/dev/reports/PR_26168_224-r2-storage-connectivity-test.md`
2264+
- `docs_build/dev/reports/codex_changed_files.txt`
2265+
- `docs_build/dev/reports/codex_review.diff`
2266+
- `docs_build/dev/reports/playwright_v8_coverage_report.txt`
2267+
- `docs_build/dev/reports/coverage_changed_js_guardrail.txt`
2268+
2269+
Packaging:
2270+
- `tmp/PR_26168_224-r2-storage-connectivity-test_delta.zip`
2271+
2272+
2273+
## PR_26168_225-assets-r2-storage-integration
2274+
2275+
Changes:
2276+
- Read `docs_build/dev/PROJECT_INSTRUCTIONS.md`.
2277+
- Verified the current branch is `main`.
2278+
- Updated Assets storage-backed delete so the Local API repository deletes the configured storage object before removing DB metadata.
2279+
- Preserved upload/list/read through the Local API and configured project asset storage provider.
2280+
- Preserved browser API repository ownership and guest upload blocking.
2281+
- Added fake R2 DELETE validation to the targeted Assets storage Playwright test.
2282+
2283+
Validation:
2284+
- `node --check src/dev-runtime/persistence/tool-repositories/assets-mock-repository.js`
2285+
- `node --check tests/playwright/tools/AssetToolMockRepository.spec.mjs`
2286+
- `node --check toolbox/assets/assets.js`
2287+
- `node --check toolbox/assets/assets-api-client.js`
2288+
- Static Node Assets storage/API contract validation for API repository ownership, no browser storage SSoT, storage-provider write/read/delete, DB metadata keys, no sample JSON changes, and no `start_of_day` changes.
2289+
- `npx playwright test tests/playwright/tools/AssetToolMockRepository.spec.mjs -g "Assets DEV storage upload list read and delete use configured projects prefix"`
2290+
- `npx playwright test tests/playwright/tools/AssetToolMockRepository.spec.mjs -g "Assets guest upload action shows account prompt and creates no record"`
2291+
- `npm run test:workspace-v2`
2292+
- `git diff --check`
2293+
- Full samples smoke skipped because sample JSON and sample runtime behavior were not touched.
2294+
- `npm run test:workspace-v2` is a legacy command name; user-facing language is Project Workspace.
2295+
2296+
Required reports:
2297+
- `docs_build/dev/reports/PR_26168_225-assets-r2-storage-integration.md`
2298+
- `docs_build/dev/reports/codex_changed_files.txt`
2299+
- `docs_build/dev/reports/codex_review.diff`
2300+
- `docs_build/dev/reports/playwright_v8_coverage_report.txt`
2301+
- `docs_build/dev/reports/coverage_changed_js_guardrail.txt`
2302+
2303+
Packaging:
2304+
- `tmp/PR_26168_225-assets-r2-storage-integration_delta.zip`

docs_build/dev/commit_comment.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Storage path error rule and R2 env readiness - PR_26168_221-storage-path-error-rule-and-r2-env-ready
1+
Assets R2 storage integration - PR_26168_225-assets-r2-storage-integration

0 commit comments

Comments
 (0)