Skip to content

Commit 38a5876

Browse files
committed
Audit Sprites legacy MVP plan
1 parent 1420bc8 commit 38a5876

7 files changed

Lines changed: 625 additions & 1402 deletions
Lines changed: 187 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
1+
# PR_26177_CHARLIE_009-sprites-legacy-audit-plan
2+
3+
Status: PASS
4+
Team: Charlie
5+
Branch: PR_26177_CHARLIE_009-sprites-legacy-audit-plan
6+
Date: 2026-06-26
7+
Base branch: main
8+
Base commit: 1420bc8b2634b4976da1b35ae33dd5575279f56b
9+
10+
## Scope
11+
12+
This PR audits the legacy `archive/v1-v2/tools/old_Sprite Editor` implementation and creates the Sprites MVP plan. It does not implement runtime behavior.
13+
14+
The current OWNER command assigns this work to Team Charlie. Current Project Instructions normally route creator content tools to Bravo, so this report records the active assignment as an OWNER-scoped Team Charlie execution context for this Sprites batch.
15+
16+
## Legacy Reference Reviewed
17+
18+
Reviewed files:
19+
20+
- `archive/v1-v2/tools/old_Sprite Editor/README.md`
21+
- `archive/v1-v2/tools/old_Sprite Editor/index.html`
22+
- `archive/v1-v2/tools/old_Sprite Editor/main.js`
23+
- `archive/v1-v2/tools/old_Sprite Editor/modules/constants.js`
24+
- `archive/v1-v2/tools/old_Sprite Editor/modules/projectModel.js`
25+
- `archive/v1-v2/tools/old_Sprite Editor/modules/spriteEditorApp.js`
26+
- `archive/v1-v2/tools/old_Sprite Editor/modules/colorUtils.js`
27+
- `archive/v1-v2/tools/old_Sprite Editor/spriteEditor.css`
28+
- `archive/v1-v2/tools/old_Sprite Editor/how_to_use.html`
29+
30+
Current GFS reference files reviewed:
31+
32+
- `toolbox/sprites/index.html`
33+
- `toolbox/colors/index.html`
34+
- `toolbox/assets/index.html`
35+
- `src/shared/toolbox/tool-metadata-inventory.js`
36+
- `docs_build/database/ddl/palette.sql`
37+
- `docs_build/database/ddl/asset.sql`
38+
- `docs_build/database/seed/guest/sprites.json`
39+
- `docs_build/database/seed/guest/palette.json`
40+
- `docs_build/dev/ProjectInstructions/addendums/postgres_only.md`
41+
- `docs_build/dev/ProjectInstructions/addendums/environment_governance_model.md`
42+
- `docs_build/dev/ProjectInstructions/addendums/environment_configuration_standards.md`
43+
- `docs_build/dev/ProjectInstructions/addendums/table_first_ui.md`
44+
- `docs_build/dev/ProjectInstructions/addendums/referenced_asset_protection.md`
45+
46+
## Legacy Findings
47+
48+
The archived tool is a browser-based Sprite Editor, not a current GFS asset management tool. It includes:
49+
50+
- Canvas-first pixel drawing.
51+
- Frame add, duplicate, delete, undo, redo, onion-skin, and playback preview.
52+
- Tool-local project JSON import/export.
53+
- Tool-local asset registry export/import.
54+
- PNG and sprite sheet import/export flows.
55+
- Palette selection from a legacy engine palette list.
56+
- Tool-local palette arrays and recent color arrays.
57+
- Page-local CSS and legacy shell assets.
58+
- Direct browser document ownership of the sprite project model.
59+
60+
Useful behaviors to preserve conceptually:
61+
62+
- Explicit sprite dimensions and file metadata.
63+
- Preview and metadata surfacing.
64+
- Archive/delete safety expectations.
65+
- Asset registry thinking around sprite references.
66+
- Palette dependency awareness.
67+
- Clear unavailable-state messaging when palette data cannot be loaded.
68+
69+
Legacy behaviors rejected for MVP implementation:
70+
71+
- Rebuilding a pixel editor as the MVP.
72+
- Browser-owned sprite records.
73+
- Browser-generated authoritative sprite keys.
74+
- Page-local product data arrays.
75+
- Browser storage as product-data source of truth.
76+
- Tool-local palette color definitions.
77+
- Duplicated Palette/Colors records.
78+
- Legacy `engine/paletteList` as an authoritative color source.
79+
- File-download JSON as authoritative persistence.
80+
- Page-local CSS, inline script patterns, and legacy shell styling.
81+
- Hardcoded named reusable colors inside Sprites.
82+
- Silent fallback data when API, database, storage, or Palette/Colors is unavailable.
83+
84+
## Current Product Position
85+
86+
`toolbox/sprites/index.html` currently exists as a static Theme V2 wireframe. It says no database, persistence, save, load, or runtime behavior is implemented.
87+
88+
The Sprites MVP should therefore complete the existing route as an API-backed asset management tool. It should not become a full image editor. Creation and editing in this MVP means creating and maintaining sprite asset records and metadata, not painting pixels in browser-owned product data.
89+
90+
## Palette/Colors Ownership Rule
91+
92+
Palette/Colors is the authoritative source for reusable colors.
93+
94+
Sprites must:
95+
96+
- Reference Palette/Colors records by API/database key when color linkage is needed.
97+
- Display Palette/Colors unavailable or empty states when the integration is unavailable.
98+
- Keep color names, hex values, reusable swatches, and saved palettes owned by Palette/Colors.
99+
100+
Sprites must not:
101+
102+
- Own reusable color definitions.
103+
- Create reusable colors.
104+
- Duplicate Palette/Colors records.
105+
- Use page-local color arrays.
106+
- Hardcode selectable, reusable, named, or saved colors.
107+
- Persist Palette/Colors data through Sprites-owned records except for approved key references.
108+
109+
## MVP Data Needs
110+
111+
Sprites MVP records should support:
112+
113+
- `key`
114+
- `name`
115+
- `status`
116+
- `category`
117+
- `tags` or `tagKeys`
118+
- `source` or storage reference
119+
- `mimeType`
120+
- `width`
121+
- `height`
122+
- `size`
123+
- `paletteColorKeys` or equivalent Palette/Colors key references
124+
- `usageCount`
125+
- `createdAt`
126+
- `updatedAt`
127+
- `createdBy`
128+
- `updatedBy`
129+
130+
Server/API must own:
131+
132+
- ULID key generation.
133+
- Audit timestamps.
134+
- Audit user fields.
135+
- Duplicate detection.
136+
- Archive/delete rules.
137+
- Reference protection.
138+
139+
## MVP PR Plan
140+
141+
### PR_26177_CHARLIE_010-sprites-api-db-foundation
142+
143+
Add the Sprites API and Postgres DDL/DML/seed foundation. Include server-owned keys and audit fields. Define list, read, create, update, archive, delete-safe, and reference contracts. Do not store color definitions.
144+
145+
### PR_26177_CHARLIE_011-sprites-tool-shell
146+
147+
Replace the static Sprites wireframe with the current GFS tool shell and read/list connection. Add loading, empty, and error states. Keep Palette/Colors unavailable state visible if color references are exposed.
148+
149+
### PR_26177_CHARLIE_012-sprites-library-crud
150+
151+
Implement the API-backed Sprites library table and create/edit/archive/delete flow. Guest save redirects to `account/sign-in.html`.
152+
153+
### PR_26177_CHARLIE_013-sprites-import-preview-metadata-palette
154+
155+
Add import/preview/metadata flows only where existing API and storage contracts support them. Show explicit unavailable states when storage or Palette/Colors contracts are not available. Duplicate via API-owned new key.
156+
157+
### PR_26177_CHARLIE_014-sprites-tags-categories-search
158+
159+
Add API/database-backed search, tags, categories, and table filtering. Reuse Tags service contracts when available.
160+
161+
### PR_26177_CHARLIE_015-sprites-reference-protection
162+
163+
Add reference viewer and destructive delete protection. If real references are not yet available, expose an empty contract state and document the limitation.
164+
165+
### PR_26177_CHARLIE_016-sprites-playwright-final-polish
166+
167+
Complete Theme V2 polish, Playwright coverage, no inline CSS/JS verification, navigation verification, Palette/Colors ownership verification, and backlog completion update.
168+
169+
## Validation Summary
170+
171+
- PASS: Project Instructions reviewed.
172+
- PASS: Current branch started from clean, synchronized `main`.
173+
- PASS: Legacy Sprite Editor reference located and reviewed.
174+
- PASS: Current Sprites route located.
175+
- PASS: Palette/Colors ownership rule documented.
176+
- PASS: Rejected legacy patterns documented.
177+
- PASS: No runtime implementation added.
178+
- PASS: No `start_of_day` files changed.
179+
180+
## Follow-Up Constraints For Later PRs
181+
182+
- Later implementation PRs must use the shared API/service contract.
183+
- Later implementation PRs must not split Local API and Public API contracts.
184+
- Later implementation PRs must target Postgres DDL/DML/seed patterns.
185+
- Later implementation PRs must use Theme V2 and external JavaScript.
186+
- Later implementation PRs must preserve Palette/Colors as the color source of truth.
187+
- Later implementation PRs must stop on validation failure before proceeding.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# PR_26177_CHARLIE_009 Branch Validation
2+
3+
Status: PASS
4+
Team: Charlie
5+
Branch: PR_26177_CHARLIE_009-sprites-legacy-audit-plan
6+
Date: 2026-06-26
7+
8+
## Gate Results
9+
10+
| Gate | Result | Evidence |
11+
| --- | --- | --- |
12+
| Started from `main` | PASS | `git branch --show-current` returned `main` before branch creation. |
13+
| Worktree clean before branch | PASS | `git status --short` returned no files before branch creation. |
14+
| Local and origin synchronized | PASS | `git rev-list --left-right --count main...origin/main` returned `0 0`. |
15+
| Branch created from main | PASS | Branch `PR_26177_CHARLIE_009-sprites-legacy-audit-plan` created after the clean/sync gate. |
16+
| No `start_of_day` changes | PASS | Changed-file check found no `start_of_day` paths. |
17+
| No runtime code changes | PASS | This PR changes reports only. |
18+
| ZIP artifact created | PASS | `tmp/PR_26177_CHARLIE_009-sprites-legacy-audit-plan_delta.zip`. |
19+
20+
## Branch Disposition
21+
22+
Source branch retained for draft PR review.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# PR_26177_CHARLIE_009 Manual Validation Notes
2+
3+
Status: PASS
4+
Team: Charlie
5+
Branch: PR_26177_CHARLIE_009-sprites-legacy-audit-plan
6+
7+
## Manual Review
8+
9+
- Confirmed the archived `old_Sprite Editor` is a legacy pixel editor, not a current asset management surface.
10+
- Confirmed current `toolbox/sprites/index.html` exists as a static Theme V2 wireframe.
11+
- Confirmed current Colors tool is the proper color ownership surface.
12+
- Confirmed current database grouped DDL includes Palette and Asset group patterns that the later Sprites foundation should follow.
13+
- Confirmed Sprites planning keeps reusable color records owned by Palette/Colors.
14+
- Confirmed no source, runtime, UI, API, or database files are changed by this PR.
15+
16+
## Manual Notes
17+
18+
The MVP path should favor a table-first sprite asset library with API-backed records, metadata, storage references, Palette/Colors key references, and reference protection. Pixel editing can remain a future enhancement or separate product surface.
19+
20+
Guest users may browse seed/sample content, but saving requires account sign-in.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# PR_26177_CHARLIE_009 Requirements Checklist
2+
3+
Status: PASS
4+
Team: Charlie
5+
Branch: PR_26177_CHARLIE_009-sprites-legacy-audit-plan
6+
7+
| Requirement | Result | Notes |
8+
| --- | --- | --- |
9+
| Audit `archive/v1-v2/tools/old_Sprite Editor` | PASS | Legacy README, HTML, CSS, main script, app module, constants, color utilities, and project model reviewed. |
10+
| Use legacy reference/base only | PASS | Report documents concepts only; no legacy code copied. |
11+
| Do not copy legacy architecture blindly | PASS | Rejected legacy patterns are explicit. |
12+
| Use tool name `Sprites`, not `Sprite Editor` | PASS | MVP plan uses `Sprites`; legacy name appears only when referring to the archived tool. |
13+
| Treat Sprites as asset management, not image editor | PASS | Plan centers API-backed asset records, metadata, storage references, and references. |
14+
| Document reusable behavior | PASS | Preview, dimensions, metadata, reference awareness, and palette dependency awareness captured. |
15+
| Document UI concepts | PASS | Table-first, Theme V2, loading, empty, error, and inspector surfaces documented. |
16+
| Document data needs | PASS | Required sprite record fields and audit fields captured. |
17+
| Document rejected legacy patterns | PASS | Browser-owned data, local palettes, local JSON persistence, and page-local CSS rejected. |
18+
| Document Palette/Colors ownership rule | PASS | Palette/Colors is documented as authoritative color source of truth. |
19+
| No runtime implementation | PASS | Reports only. |
20+
| No `start_of_day` changes | PASS | Changed-file check clean. |
21+
| Create required reports | PASS | PR-specific report, branch validation, checklist, validation lane, manual notes, diff, and changed files created. |
22+
| Create repo-structured ZIP under `tmp/` | PASS | ZIP created under `tmp/` and not staged. |
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# PR_26177_CHARLIE_009 Validation Lane
2+
3+
Status: PASS
4+
Team: Charlie
5+
Branch: PR_26177_CHARLIE_009-sprites-legacy-audit-plan
6+
7+
## Commands
8+
9+
```powershell
10+
git branch --show-current
11+
git status --short
12+
git rev-list --left-right --count main...origin/main
13+
git diff --check
14+
git diff --name-only
15+
```
16+
17+
## Results
18+
19+
| Validation | Result | Notes |
20+
| --- | --- | --- |
21+
| Branch gate | PASS | Started from clean synchronized `main`, then created the PR branch. |
22+
| Docs/report-only changed-file check | PASS | Changed files are under `docs_build/dev/reports/`. |
23+
| Runtime changed-file check | PASS | No runtime, UI, API, database, or source files changed. |
24+
| `start_of_day` changed-file check | PASS | No `start_of_day` paths changed. |
25+
| Markdown artifact presence | PASS | Required PR-specific report files are present. |
26+
| `git diff --check` | PASS | No whitespace errors detected. |
27+
| Playwright impacted | PASS | Not impacted; PR is audit/report-only. |
28+
29+
## Targeted Validation Rationale
30+
31+
This PR does not change runtime behavior, UI, API, database schema, or tests. Targeted validation is limited to branch gates, changed-file scope, report presence, and diff whitespace.
Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
1-
M docs_build/dev/reports/PR_26177_OWNER_057-game-journey-metrics-regression-recovery_branch-validation.md
2-
M docs_build/dev/reports/PR_26177_OWNER_057-game-journey-metrics-regression-recovery_manual-validation-notes.md
3-
M docs_build/dev/reports/PR_26177_OWNER_057-game-journey-metrics-regression-recovery_report.md
4-
M docs_build/dev/reports/PR_26177_OWNER_057-game-journey-metrics-regression-recovery_requirement-checklist.md
5-
M docs_build/dev/reports/PR_26177_OWNER_057-game-journey-metrics-regression-recovery_validation-lane.md
6-
M docs_build/dev/reports/coverage_changed_js_guardrail.txt
7-
M docs_build/dev/reports/playwright_v8_coverage_report.txt
8-
D scripts/migrate-game-journey-completion-metrics-sqlite-to-postgres.mjs
9-
M scripts/validate-browser-env-agnostic.mjs
10-
D src/dev-runtime/persistence/game-journey-completion-metrics-migration.mjs
11-
D tests/dev-runtime/GameJourneyCompletionMetricsMigration.test.mjs
12-
M tests/dev-runtime/GameJourneyCompletionMetricsStore.test.mjs
13-
M tests/playwright/tools/AdminHealthOperationsPage.spec.mjs
14-
M tests/playwright/tools/GameJourneyTool.spec.mjs
15-
M docs_build/dev/reports/codex_changed_files.txt
16-
M docs_build/dev/reports/codex_review.diff
1+
docs_build/dev/reports/PR_26177_CHARLIE_009-sprites-legacy-audit-plan.md
2+
docs_build/dev/reports/PR_26177_CHARLIE_009-sprites-legacy-audit-plan_branch-validation.md
3+
docs_build/dev/reports/PR_26177_CHARLIE_009-sprites-legacy-audit-plan_manual-validation-notes.md
4+
docs_build/dev/reports/PR_26177_CHARLIE_009-sprites-legacy-audit-plan_requirements-checklist.md
5+
docs_build/dev/reports/PR_26177_CHARLIE_009-sprites-legacy-audit-plan_validation-lane.md
6+
docs_build/dev/reports/codex_changed_files.txt
7+
docs_build/dev/reports/codex_review.diff

0 commit comments

Comments
 (0)