Skip to content

Commit 004ad99

Browse files
author
DavidQ
committed
Recovery audit from 20.1 baseline
PR Details: - Uses 3f7e9df / BUILD_PR_LEVEL_20_1_PHASE20_TOOL_PRESET_INTEGRATION as the last known assistant-produced baseline. - Audits all later changes. - Documents anti-patterns and junk code. - Produces reset-vs-surgical-cleanup decision. - Forbids destructive reset in this PR.
1 parent 5e5e5f1 commit 004ad99

8 files changed

Lines changed: 532 additions & 100 deletions

docs/dev/codex_rules.md

Lines changed: 50 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1,94 +1,59 @@
11
# Codex Rules (MANDATORY — HARD CONSTRAINTS)
22

3-
These rules OVERRIDE all other task instructions except correctness and explicit user safety constraints.
3+
These rules OVERRIDE all other instructions.
44
If any rule is violated, the output is incorrect.
55

66
Codex must prefer the existing repo pattern over any new pattern, unless the PR explicitly says otherwise.
77

8-
## Core Principles
9-
- Follow the requested task exactly.
10-
- One PR purpose only.
11-
- Smallest scoped valid change.
12-
- No repo-wide rewrites unless explicitly required by the task.
13-
- Do not introduce behavior that was not explicitly requested.
14-
- Do not modify `start_of_day` folders.
8+
## Baseline
9+
10+
The last known assistant-produced baseline is:
11+
12+
- commit: `3f7e9df`
13+
- PR: `BUILD_PR_LEVEL_20_1_PHASE20_TOOL_PRESET_INTEGRATION`
14+
15+
All recovery analysis must compare current repo state against this baseline.
16+
17+
## Recovery Safety
18+
19+
- Do NOT run destructive git commands.
20+
- Do NOT run `git reset --hard`.
21+
- Do NOT delete files.
22+
- Do NOT modify implementation files in this PR.
23+
- Do NOT rewrite roadmap text.
24+
- Do NOT modify `start_of_day` folders.
25+
- Do NOT invent fallback/default behavior.
26+
- Do NOT preserve junk code silently.
27+
28+
## Anti-Patterns Strictly Forbidden
29+
30+
- variable aliasing: one concept renamed into another variable
31+
- pass-through variables
32+
- duplicate state
33+
- stored derived state
34+
- vague names such as data, temp, obj, item, thing, value
35+
- hidden fallback behavior
36+
- default behavior where explicit routing is required
37+
- broad truthy/falsy checks that alter behavior
38+
- magic strings or magic numbers
39+
- duplicate event listeners
40+
- globals
41+
- new managers/factories/service layers unless explicitly requested
42+
- route/URL/ID/label changes unless explicitly requested
43+
- public API changes unless explicitly requested
44+
- unrelated cleanup
45+
- unrelated refactoring
46+
- scope expansion
47+
- duplicated launch paths
48+
- sample/game launch bypasses
49+
- workspace launch memory carryover from external entry
50+
51+
## Validation
1552

16-
## Naming / Data Flow
17-
- One concept = one name.
18-
- Do not create alias variables or name remapping chains.
19-
- Do not copy variables into new variables unless data is transformed.
20-
- Do not rename the same concept across files.
21-
- Do not use vague names such as `data`, `temp`, `obj`, `item`, `thing`, `value`, or `result` unless the scope is tiny and obvious.
22-
- Do not introduce adapter names unless the PR explicitly requires adapters.
23-
- Do not create duplicate state for the same value.
24-
- Do not store derived state when it can be computed directly.
25-
26-
## Variables
27-
- No temporary pass-through variables.
28-
- No `a -> b -> c` assignment chains.
29-
- Only introduce variables when they transform data, clarify a complex expression, or are required for control flow.
30-
31-
## Scope Creep
32-
- Do not fix unrelated bugs.
33-
- Do not clean up unrelated files.
34-
- Do not modernize code unless requested.
35-
- Do not change public APIs unless the PR explicitly requires it.
36-
- Do not change folder structure unless the PR explicitly requires it.
37-
38-
## Control Flow
39-
- Do not add hidden fallback behavior.
40-
- Do not swallow errors silently.
41-
- Do not replace explicit checks with broad truthy/falsy checks when behavior could change.
42-
- Do not add global flags to control local behavior.
43-
- Do not introduce magic strings or magic numbers.
44-
- Do not add defaults/fallbacks for tool launch data; missing required SSoT data must fail validation visibly.
45-
46-
## Architecture
47-
- Do not add a new framework, library, dependency, build tool, or pattern.
48-
- Do not introduce service layers, registries, managers, factories, or abstractions unless explicitly requested.
49-
- Do not create future-proof extension points.
50-
- Do not split files only for style.
51-
52-
## UI / Navigation
53-
- Do not change existing tile behavior unless the PR is specifically about that tile.
54-
- Do not change route names, URLs, IDs, labels, or menu text unless requested.
55-
- Do not create duplicate launch paths for the same tool.
56-
- Do not bypass existing navigation conventions.
57-
- Samples must launch tools through `tools/<tool>/index.html`.
58-
- Games must launch Workspace Manager through `tools/Workspace Manager/index.html`.
59-
- External launches from samples or games must clear prior tool/workspace memory before loading the requested tool or workspace.
60-
61-
## Testing / Validation
62-
- Do not mark work complete without a concrete test path.
63-
- Do not claim browser-tested behavior unless actually tested.
64-
- Do not remove existing tests or validation hooks.
65-
- Do not weaken tests to make changes pass.
66-
67-
## Repo Safety
68-
- Do not modify `start_of_day` folders.
69-
- Do not delete legacy folders unless explicitly instructed.
70-
- Do not touch roadmap text except status markers `[ ]`, `[.]`, `[x]`.
71-
- Do not rewrite documentation outside the PR scope.
72-
73-
## JavaScript-Specific
74-
- Do not use `var`.
75-
- Do not create globals.
76-
- Do not mutate imported/shared config objects.
77-
- Do not rely on implicit type coercion.
78-
- Do not use loose equality `==` or `!=`.
79-
- Do not add async behavior unless needed.
80-
- Do not mix DOM querying and business logic if existing code separates them.
81-
- Do not duplicate event listeners.
82-
- Do not attach handlers repeatedly inside render/update loops.
83-
84-
## Validation Required Before Finish
8553
Before completing, verify:
86-
- No alias variables exist.
87-
- No unnecessary variables were introduced.
88-
- No scope expansion occurred.
89-
- Code matches existing repo patterns.
90-
- Only requested changes were made.
91-
- Launch data comes from a single source of truth.
92-
- No default/fallback launch entries remain for tools.
9354

94-
If any violation exists, fix it before returning output.
55+
- no implementation files changed
56+
- no destructive command used
57+
- all required reports exist
58+
- reset recommendation is explicit
59+
- all identified anti-patterns include file paths
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Placeholder
2+
3+
Codex must replace this file during execution.
4+
# Recovery Anti-Pattern Audit From 20.1 Baseline
5+
6+
## Audit Basis
7+
- Baseline: `3f7e9df`
8+
- HEAD: `5e5e5f12`
9+
- Rules source: `docs/dev/codex_rules.md`
10+
- Evidence sources: `git log`, `git diff --stat`, `git diff --name-status`, targeted file inspection
11+
12+
## Findings (Ordered by Severity)
13+
14+
### High - Scope Expansion Beyond Recovery Lane
15+
- Evidence:
16+
- `125` commits after baseline
17+
- `488` files changed
18+
- `35,818` insertions / `4,946` deletions
19+
- Cross-domain impact includes `docs`, `samples`, `tools`, `games`, `src`, and `tests`
20+
- Why this is an anti-pattern:
21+
- Violates smallest-scoped recovery objective.
22+
- Introduces high uncertainty for root-cause recovery and validation.
23+
24+
### High - Start-of-Day Boundary Touched
25+
- File:
26+
- `docs/dev/start_of_day/codex/PROJECT_INSTRUCTIONS.lnk` (`A` after baseline)
27+
- Why this is an anti-pattern:
28+
- Recovery rules explicitly protect `start_of_day` content from unrelated edits.
29+
30+
### High - Broad Unrelated Deletion/Rename Churn
31+
- Evidence:
32+
- `54` deletions and `8` renames in baseline diff.
33+
- Large deletion set under `samples/phase-20/*/index.html`.
34+
- Tool identity rename path:
35+
- `tools/3D Map Editor/*` to `tools/3D JSON Payload Normalizer/*`
36+
- Why this is an anti-pattern:
37+
- Recovery lane is launch-path stabilization, not broad content pruning or feature renaming.
38+
39+
### High - Duplicate Source-of-Truth Vocabulary
40+
- Evidence:
41+
- `samples/index.render.js` still consumes `toolHints`.
42+
- `games/index.render.js` consumes `toolsUsed`.
43+
- `tools/Workspace Manager/main.js` consumes `toolsUsed`.
44+
- Why this is an anti-pattern:
45+
- Introduces dual metadata semantics for tool launch eligibility.
46+
- Increases risk of mismatch between games and samples launch routing.
47+
48+
### Medium - Launch Path Complexity Drift
49+
- Evidence in UAT core files:
50+
- `games/index.render.js` expanded launch behavior and click routing logic.
51+
- `samples/index.render.js` expanded roundtrip link construction and launch/error handling.
52+
- `tools/Workspace Manager/main.js` includes extensive forwarded query handling and host-mode branching.
53+
- Why this is an anti-pattern:
54+
- Recovery lane requires clarity and deterministic launch routing.
55+
- Complexity growth increases likelihood of hidden fallback behavior and regressions.
56+
57+
### Medium - Roadmap Surface Proliferation Outside Master Engine File
58+
- Evidence:
59+
- Added `docs/dev/roadmaps/MASTER_ROADMAP_SAMPLES2TOOLS.md` after baseline.
60+
- Engine roadmap file is unchanged in this delta, but additional roadmap surface introduces governance drift.
61+
- Why this is an anti-pattern:
62+
- Recovery efforts benefit from a single authoritative roadmap surface.
63+
64+
### Low - Diff Hygiene Issues
65+
- Evidence from `git diff --check`:
66+
- New blank line at EOF in:
67+
- `docs/dev/reports/BUILD_PR_LEVEL_20_2_WORKSPACE_MANAGER_GAMES_TILE_UAT_RECOVERY_uat_report.md`
68+
- `docs/dev/reports/tool_launch_ssot_external_memory_reset_validation.md`
69+
- `samples/phase-12/1208/data/toolFormattedTileMap.js`
70+
- `tools/shared/toolLaunchSSoT.js`
71+
- Why this matters:
72+
- Not functionally critical, but indicates review hygiene inconsistency.
73+
74+
## Anti-Pattern Summary
75+
- Recovery lane contamination is substantial.
76+
- UAT launch-path changes are not isolated.
77+
- Multiple independent feature/doc/structure lanes were combined post-baseline.
78+
- Overall profile strongly favors reset-first recovery over surgical edits on current HEAD.
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
# Placeholder
2+
3+
Codex must replace this file during execution.
4+
# Recovery Change Audit From 20.1 Baseline
5+
6+
## Scope
7+
- Baseline commit: `3f7e9df`
8+
- Baseline PR: `BUILD_PR_LEVEL_20_1_PHASE20_TOOL_PRESET_INTEGRATION`
9+
- Current HEAD: `5e5e5f12575f9576745cf57827e6f40abc98812b`
10+
- Branch: `main`
11+
- Audit mode: reports only (no implementation edits, no reset, no deletions)
12+
13+
## Required Command Capture
14+
15+
### 1) `git status --short`
16+
```text
17+
M docs/dev/codex_rules.md
18+
M docs/operations/dev/codex_commands.md
19+
M docs/operations/dev/commit_comment.txt
20+
?? docs/dev/reports/recovery_antipattern_audit_from_20_1.md
21+
?? docs/dev/reports/recovery_change_audit_from_20_1.md
22+
?? docs/dev/reports/recovery_file_risk_list_from_20_1.md
23+
?? docs/dev/reports/recovery_reset_decision_from_20_1.md
24+
?? docs/pr/BUILD_PR_LEVEL_20_5_RECOVERY_AUDIT_FROM_20_1_BASELINE.md
25+
```
26+
27+
### 2) `git branch --show-current`
28+
```text
29+
main
30+
```
31+
32+
### 3) `git rev-parse HEAD`
33+
```text
34+
5e5e5f12575f9576745cf57827e6f40abc98812b
35+
```
36+
37+
### 4) `git log 3f7e9df..HEAD --oneline --decorate --name-status`
38+
```text
39+
Captured. Output is large (1000+ lines) and confirms a broad multi-lane change stream after baseline.
40+
Top commit: 5e5e5f12 (HEAD -> main) Normalize tool and workspace tile launch routing through SSoT
41+
Includes many unrelated lanes (samples2tools, skin editor, 3D rename, docs/roadmaps, tool UX, metadata rewrites).
42+
```
43+
44+
### 5) `git diff --stat 3f7e9df..HEAD`
45+
```text
46+
488 files changed, 35818 insertions(+), 4946 deletions(-)
47+
```
48+
49+
### 6) `git diff --name-status 3f7e9df..HEAD`
50+
```text
51+
Captured. Mix of large additions, modifications, renames, and deletions.
52+
Status totals:
53+
- M: 167
54+
- A: 259
55+
- R: 8
56+
- D: 54
57+
```
58+
59+
### 7) `git diff --check 3f7e9df..HEAD`
60+
```text
61+
docs/dev/reports/BUILD_PR_LEVEL_20_2_WORKSPACE_MANAGER_GAMES_TILE_UAT_RECOVERY_uat_report.md:44: new blank line at EOF.
62+
docs/dev/reports/tool_launch_ssot_external_memory_reset_validation.md:69: new blank line at EOF.
63+
samples/phase-12/1208/data/toolFormattedTileMap.js:4116: new blank line at EOF.
64+
tools/shared/toolLaunchSSoT.js:140: new blank line at EOF.
65+
```
66+
67+
### 8) `git ls-files --others --exclude-standard`
68+
```text
69+
docs/dev/reports/recovery_antipattern_audit_from_20_1.md
70+
docs/dev/reports/recovery_change_audit_from_20_1.md
71+
docs/dev/reports/recovery_file_risk_list_from_20_1.md
72+
docs/dev/reports/recovery_reset_decision_from_20_1.md
73+
docs/pr/BUILD_PR_LEVEL_20_5_RECOVERY_AUDIT_FROM_20_1_BASELINE.md
74+
```
75+
76+
## Aggregate Metrics
77+
- Commits after baseline: `125`
78+
- File churn: `488 files`
79+
- Insertions/deletions: `+35,818 / -4,946`
80+
- Top-level area impact count:
81+
- `docs`: 162
82+
- `samples`: 162
83+
- `tools`: 84
84+
- `games`: 61
85+
- `src`: 10
86+
- `tests`: 4
87+
88+
## UAT-Relevant File Inspection
89+
90+
### Direct files requested
91+
- `games/index.html`: present and modified vs baseline (`M`)
92+
- `samples/index.html`: present and modified vs baseline (`M`)
93+
- `tools/Workspace Manager/index.html`: present, no baseline diff (`unchanged`)
94+
- `docs/dev/roadmaps/MASTER_ROADMAP_ENGINE.md`: present, no baseline diff (`unchanged`)
95+
96+
### `tools/*/index.html` inspection
97+
- Enumerated 19 tool index files under `tools/`
98+
- Baseline deltas for tool index files:
99+
- `R078 tools/3D Map Editor/index.html -> tools/3D JSON Payload Normalizer/index.html`
100+
- `M tools/Asset Pipeline Tool/index.html`
101+
- `M tools/Palette Browser/index.html`
102+
- `M tools/Parallax Scene Studio/index.html`
103+
- `A tools/Skin Editor/index.html`
104+
- `M tools/Sprite Editor/index.html`
105+
- `M tools/Tilemap Studio/index.html`
106+
- `M tools/Vector Map Editor/index.html`
107+
108+
## UAT Path Delta Snapshot
109+
```text
110+
games/index.html | 32 +--
111+
games/index.render.js | 214 +++++++++++++++++--
112+
samples/index.html | 33 ++-
113+
samples/index.render.js | 224 ++++++++++++++++++-
114+
tools/Workspace Manager/main.js | 460 +++++++++++++++++++++++++++++++++++-----
115+
5 files changed, 843 insertions(+), 120 deletions(-)
116+
```
117+
118+
## Initial Audit Conclusion
119+
- Change volume and blast radius are substantially beyond a narrow recovery lane.
120+
- UAT-relevant launch paths are embedded within large parallel changes across tools, samples, docs, and metadata.
121+
- A reset-first recovery path is likely safer than surgical cleanup from current HEAD.

0 commit comments

Comments
 (0)