Skip to content

Commit 6cf27f9

Browse files
author
DavidQ
committed
Level 09.01 — split flow behavior rules from player-facing flow content across games
1 parent b463f48 commit 6cf27f9

123 files changed

Lines changed: 1097 additions & 1092 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.

docs/dev/CODEX_COMMANDS.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1-
MODEL: GPT-5.4
2-
REASONING: low
1+
MODEL: GPT-5.4
2+
REASONING: high
33

4-
TASK:
5-
Update roadmap Section 8 to fully complete [x]
4+
COMMAND GOAL:
5+
Create BUILD_PR_LEVEL_09_01_FLOW_RULES_VS_FLOW_CONTENT_SPLIT as a repo-wide docs-first implementation
6+
bundle that separates behavioral flow rules from player-facing flow content across all games.
67

7-
No code changes.
8-
Return ZIP to <project folder>/tmp/
8+
CONSTRAINTS:
9+
- one PR purpose only
10+
- preserve behavior exactly
11+
- no engine changes
12+
- no launcher changes
13+
- no config migration in this PR
14+
- only split existing flow-related rules/content

docs/dev/COMMIT_COMMENT.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Phase 08 complete — repo-wide normalization achieved
1+
build(games): split flow behavior rules vs flow content across game rules surfaces
Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,37 @@
1-
Finalizes Phase 08 completion
1+
BUILD_PR_LEVEL_09_01_FLOW_RULES_VS_FLOW_CONTENT_SPLIT
2+
3+
What changed
4+
- Added rules split modules per game: rules/flowRules.js and rules/flowContent.js.
5+
- Converted rules/gameFlowRules.js into a compatibility shim re-exporting flowRules + flowContent.
6+
- Updated flow/ and game/ import consumers to read behavior constants from flowRules and player-facing text from flowContent.
7+
8+
Classification applied
9+
- behavior/timing/mode/contract/booleans/selectors => flowRules.js
10+
- visible flow text/prompts/headings/labels => flowContent.js
11+
12+
Behavior preservation
13+
- No engine files changed.
14+
- No launcher/bootstrap changes.
15+
- No config migration included.
16+
- Split is extraction-only; constants remain same values.
17+
18+
Games affected: 19
19+
- AITargetDummy
20+
- Asteroids
21+
- Bouncing-ball
22+
- Breakout
23+
- Gravity
24+
- GravityWell
25+
- MultiBallChaos
26+
- Orbit
27+
- PacmanFullAI
28+
- PacmanLite
29+
- PaddleIntercept
30+
- Pong
31+
- ProjectileLab
32+
- Puckman
33+
- SolarSystem
34+
- SpaceDuel
35+
- SpaceInvaders
36+
- Thruster
37+
- vector-arcade-sample

docs/dev/reports/file_tree.txt

Lines changed: 121 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,121 @@
1-
docs/pr/BUILD_PR_LEVEL_08_11_PHASE_08_COMPLETION.md
1+
Flow Rules vs Content Split Tree
2+
3+
games/AITargetDummy/rules/flowRules.js
4+
games/AITargetDummy/rules/flowContent.js
5+
games/AITargetDummy/rules/gameFlowRules.js
6+
games/Asteroids/rules/flowRules.js
7+
games/Asteroids/rules/flowContent.js
8+
games/Asteroids/rules/gameFlowRules.js
9+
games/Bouncing-ball/rules/flowRules.js
10+
games/Bouncing-ball/rules/flowContent.js
11+
games/Bouncing-ball/rules/gameFlowRules.js
12+
games/Breakout/rules/flowRules.js
13+
games/Breakout/rules/flowContent.js
14+
games/Breakout/rules/gameFlowRules.js
15+
games/Gravity/rules/flowRules.js
16+
games/Gravity/rules/flowContent.js
17+
games/Gravity/rules/gameFlowRules.js
18+
games/GravityWell/rules/flowRules.js
19+
games/GravityWell/rules/flowContent.js
20+
games/GravityWell/rules/gameFlowRules.js
21+
games/MultiBallChaos/rules/flowRules.js
22+
games/MultiBallChaos/rules/flowContent.js
23+
games/MultiBallChaos/rules/gameFlowRules.js
24+
games/Orbit/rules/flowRules.js
25+
games/Orbit/rules/flowContent.js
26+
games/Orbit/rules/gameFlowRules.js
27+
games/PacmanFullAI/rules/flowRules.js
28+
games/PacmanFullAI/rules/flowContent.js
29+
games/PacmanFullAI/rules/gameFlowRules.js
30+
games/PacmanLite/rules/flowRules.js
31+
games/PacmanLite/rules/flowContent.js
32+
games/PacmanLite/rules/gameFlowRules.js
33+
games/PaddleIntercept/rules/flowRules.js
34+
games/PaddleIntercept/rules/flowContent.js
35+
games/PaddleIntercept/rules/gameFlowRules.js
36+
games/Pong/rules/flowRules.js
37+
games/Pong/rules/flowContent.js
38+
games/Pong/rules/gameFlowRules.js
39+
games/ProjectileLab/rules/flowRules.js
40+
games/ProjectileLab/rules/flowContent.js
41+
games/ProjectileLab/rules/gameFlowRules.js
42+
games/Puckman/rules/flowRules.js
43+
games/Puckman/rules/flowContent.js
44+
games/Puckman/rules/gameFlowRules.js
45+
games/SolarSystem/rules/flowRules.js
46+
games/SolarSystem/rules/flowContent.js
47+
games/SolarSystem/rules/gameFlowRules.js
48+
games/SpaceDuel/rules/flowRules.js
49+
games/SpaceDuel/rules/flowContent.js
50+
games/SpaceDuel/rules/gameFlowRules.js
51+
games/SpaceInvaders/rules/flowRules.js
52+
games/SpaceInvaders/rules/flowContent.js
53+
games/SpaceInvaders/rules/gameFlowRules.js
54+
games/Thruster/rules/flowRules.js
55+
games/Thruster/rules/flowContent.js
56+
games/Thruster/rules/gameFlowRules.js
57+
games/vector-arcade-sample/rules/flowRules.js
58+
games/vector-arcade-sample/rules/flowContent.js
59+
games/vector-arcade-sample/rules/gameFlowRules.js
60+
61+
Updated import consumers:
62+
games\AITargetDummy\flow\attract.js
63+
games\AITargetDummy\flow\highscore.js
64+
games\AITargetDummy\flow\intro.js
65+
games\Asteroids\flow\attract.js
66+
games\Asteroids\flow\highscore.js
67+
games\Asteroids\flow\intro.js
68+
games\Asteroids\game\AsteroidsGameScene.js
69+
games\Bouncing-ball\flow\attract.js
70+
games\Bouncing-ball\flow\highscore.js
71+
games\Bouncing-ball\flow\intro.js
72+
games\Breakout\flow\attract.js
73+
games\Breakout\flow\highscore.js
74+
games\Breakout\flow\intro.js
75+
games\Gravity\flow\attract.js
76+
games\Gravity\flow\highscore.js
77+
games\Gravity\flow\intro.js
78+
games\GravityWell\flow\attract.js
79+
games\GravityWell\flow\highscore.js
80+
games\GravityWell\flow\intro.js
81+
games\MultiBallChaos\flow\attract.js
82+
games\MultiBallChaos\flow\highscore.js
83+
games\MultiBallChaos\flow\intro.js
84+
games\Orbit\flow\attract.js
85+
games\Orbit\flow\highscore.js
86+
games\Orbit\flow\intro.js
87+
games\PacmanFullAI\flow\attract.js
88+
games\PacmanFullAI\flow\highscore.js
89+
games\PacmanFullAI\flow\intro.js
90+
games\PacmanLite\flow\attract.js
91+
games\PacmanLite\flow\highscore.js
92+
games\PacmanLite\flow\intro.js
93+
games\PaddleIntercept\flow\attract.js
94+
games\PaddleIntercept\flow\highscore.js
95+
games\PaddleIntercept\flow\intro.js
96+
games\Pong\flow\attract.js
97+
games\Pong\flow\highscore.js
98+
games\Pong\flow\intro.js
99+
games\ProjectileLab\flow\attract.js
100+
games\ProjectileLab\flow\highscore.js
101+
games\ProjectileLab\flow\intro.js
102+
games\Puckman\flow\attract.js
103+
games\Puckman\flow\highscore.js
104+
games\Puckman\flow\intro.js
105+
games\Puckman\game\PuckmanGameScene.js
106+
games\Puckman\game\PuckmanRuntime.js
107+
games\SolarSystem\flow\attract.js
108+
games\SolarSystem\flow\highscore.js
109+
games\SolarSystem\flow\intro.js
110+
games\SpaceDuel\flow\attract.js
111+
games\SpaceDuel\flow\highscore.js
112+
games\SpaceDuel\flow\intro.js
113+
games\SpaceInvaders\flow\attract.js
114+
games\SpaceInvaders\flow\highscore.js
115+
games\SpaceInvaders\flow\intro.js
116+
games\Thruster\flow\attract.js
117+
games\Thruster\flow\highscore.js
118+
games\Thruster\flow\intro.js
119+
games\vector-arcade-sample\flow\attract.js
120+
games\vector-arcade-sample\flow\highscore.js
121+
games\vector-arcade-sample\flow\intro.js
Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,20 @@
1-
All games pass boundary validation
1+
BUILD_PR_LEVEL_09_01_FLOW_RULES_VS_FLOW_CONTENT_SPLIT - Validation Checklist
2+
3+
Scope and constraints
4+
- [x] one PR purpose only
5+
- [x] no engine changes
6+
- [x] no launcher changes
7+
- [x] no config migration
8+
- [x] preserve behavior via constant extraction only
9+
10+
Required pattern
11+
- [x] games/<GameName>/rules/flowRules.js present for all affected games
12+
- [x] games/<GameName>/rules/flowContent.js present for all affected games
13+
- [x] flow/ and game/ import consumers updated to split modules
14+
15+
Command evidence
16+
- node --check on all rules split files + all import consumers: PASS (117 files)
17+
- node tests/runtime/LaunchSmokeAllEntries.test.mjs: PASS
18+
19+
Result
20+
- PASS
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# BUILD_PR — LEVEL 09.01 FLOW RULES VS FLOW CONTENT SPLIT
2+
3+
## Purpose
4+
Introduce a consistent repo-wide split between:
5+
- behavioral flow rules
6+
- player-facing flow content
7+
8+
This keeps timing, return modes, and transition behavior separate from UI/status copy.
9+
10+
## Why this PR exists
11+
Current game flow rule files mix:
12+
- behavioral constants, for example auto-exit timing and return mode
13+
- player-facing text, for example status prompts and headings
14+
15+
That makes the rules layer carry both behavior and content. This PR separates them cleanly.
16+
17+
## Target pattern
18+
For every game with flow/rules support:
19+
20+
games/<GameName>/rules/
21+
flowRules.js
22+
flowContent.js
23+
24+
## Classification standard
25+
26+
### Keep in `flowRules.js`
27+
Behavior-defining values:
28+
- auto-exit timing
29+
- return mode
30+
- return status codes / machine-facing values
31+
- contract version
32+
- booleans that alter flow behavior
33+
- enum-like transition selectors
34+
35+
### Move to `flowContent.js`
36+
Player-facing content:
37+
- visible status strings
38+
- headings
39+
- prompts
40+
- instructions shown to the player
41+
- labels displayed during attract / intro / highscore / game-over flow
42+
43+
## Important distinction
44+
A string is **not automatically config**.
45+
46+
Use this rule:
47+
- if it defines system/runtime environment → `config/`
48+
- if it defines game behavior → `rules/flowRules.js`
49+
- if it is player-facing text used by flow behavior → `rules/flowContent.js`
50+
51+
## In scope
52+
Repo-wide split for games that currently store flow text in rules files.
53+
54+
## Out of scope
55+
- no engine changes
56+
- no launcher/bootstrap changes
57+
- no gameplay redesign
58+
- no i18n framework
59+
- do not move environment/system settings into this PR
60+
61+
## Acceptance criteria
62+
For each affected game:
63+
1. `rules/flowRules.js` contains behavior-only constants
64+
2. `rules/flowContent.js` contains player-facing flow text only
65+
3. flow and game files import from the correct file
66+
4. no duplicate literals remain between rules/content/flow/game for the migrated constants
67+
5. no behavior meaning changes
68+
69+
## Validation examples
70+
Examples of behavior constants:
71+
- `*_AUTO_EXIT_SECONDS`
72+
- `*_RETURN_MODE`
73+
- `*_RETURN_RESET_IDLE`
74+
- `*_CONTRACT_VERSION`
75+
76+
Examples of content constants:
77+
- `*_RETURN_STATUS`
78+
- `*_HIGHSCORE_STATUS`
79+
- headings, prompts, visible labels
80+
81+
## Notes
82+
This PR is a structural split only. Preserve exact behavior.
Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
1-
import {
2-
AI_TARGET_DUMMY_FLOW_IDS,
3-
AI_TARGET_DUMMY_FLOW_LABELS,
4-
AI_TARGET_DUMMY_GAME_OVER_RETURN_MODE,
5-
AI_TARGET_DUMMY_GAME_OVER_RETURN_RESET_IDLE,
6-
AI_TARGET_DUMMY_GAME_OVER_RETURN_STATUS,
7-
createAITARGETDUMMYFlowDescriptor
8-
} from "../rules/gameFlowRules.js";
1+
import { AI_TARGET_DUMMY_FLOW_IDS, AI_TARGET_DUMMY_GAME_OVER_RETURN_MODE, AI_TARGET_DUMMY_GAME_OVER_RETURN_RESET_IDLE, createAITARGETDUMMYFlowDescriptor } from "../rules/flowRules.js";
2+
import { AI_TARGET_DUMMY_FLOW_LABELS, AI_TARGET_DUMMY_GAME_OVER_RETURN_STATUS } from "../rules/flowContent.js";
93

104
export const AI_TARGET_DUMMY_ATTRACT_FLOW_NEXT_ID = AI_TARGET_DUMMY_FLOW_IDS.intro;
115

@@ -17,3 +11,4 @@ export const attractFlow = createAITARGETDUMMYFlowDescriptor(AI_TARGET_DUMMY_FLO
1711
returnMode: AI_TARGET_DUMMY_GAME_OVER_RETURN_MODE,
1812
resetIdleOnReturn: AI_TARGET_DUMMY_GAME_OVER_RETURN_RESET_IDLE
1913
});
14+
Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
1-
import {
2-
AI_TARGET_DUMMY_FLOW_IDS,
3-
AI_TARGET_DUMMY_FLOW_LABELS,
4-
AI_TARGET_DUMMY_HIGHSCORE_AUTO_EXIT_SECONDS,
5-
AI_TARGET_DUMMY_HIGHSCORE_STATUS,
6-
createAITARGETDUMMYFlowDescriptor
7-
} from "../rules/gameFlowRules.js";
1+
import { AI_TARGET_DUMMY_FLOW_IDS, AI_TARGET_DUMMY_HIGHSCORE_AUTO_EXIT_SECONDS, createAITARGETDUMMYFlowDescriptor } from "../rules/flowRules.js";
2+
import { AI_TARGET_DUMMY_FLOW_LABELS, AI_TARGET_DUMMY_HIGHSCORE_STATUS } from "../rules/flowContent.js";
83

94
export const AI_TARGET_DUMMY_HIGHSCORE_FLOW_NEXT_ID = AI_TARGET_DUMMY_FLOW_IDS.attract;
105

@@ -14,3 +9,4 @@ export const highscoreFlow = createAITARGETDUMMYFlowDescriptor(AI_TARGET_DUMMY_F
149
autoAdvanceSeconds: AI_TARGET_DUMMY_HIGHSCORE_AUTO_EXIT_SECONDS,
1510
statusText: AI_TARGET_DUMMY_HIGHSCORE_STATUS
1611
});
12+

games/AITargetDummy/flow/intro.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
1-
import {
2-
AI_TARGET_DUMMY_FLOW_IDS,
3-
AI_TARGET_DUMMY_FLOW_LABELS,
4-
AI_TARGET_DUMMY_GAME_OVER_AUTO_EXIT_SECONDS,
5-
AI_TARGET_DUMMY_GAME_OVER_RETURN_MODE,
6-
AI_TARGET_DUMMY_GAME_OVER_RETURN_RESET_IDLE,
7-
AI_TARGET_DUMMY_GAME_OVER_RETURN_STATUS,
8-
createAITARGETDUMMYFlowDescriptor
9-
} from "../rules/gameFlowRules.js";
1+
import { AI_TARGET_DUMMY_FLOW_IDS, AI_TARGET_DUMMY_GAME_OVER_AUTO_EXIT_SECONDS, AI_TARGET_DUMMY_GAME_OVER_RETURN_MODE, AI_TARGET_DUMMY_GAME_OVER_RETURN_RESET_IDLE, createAITARGETDUMMYFlowDescriptor } from "../rules/flowRules.js";
2+
import { AI_TARGET_DUMMY_FLOW_LABELS, AI_TARGET_DUMMY_GAME_OVER_RETURN_STATUS } from "../rules/flowContent.js";
103

114
export const AI_TARGET_DUMMY_INTRO_FLOW_NEXT_ID = AI_TARGET_DUMMY_FLOW_IDS.highscore;
125

@@ -18,3 +11,4 @@ export const introFlow = createAITARGETDUMMYFlowDescriptor(AI_TARGET_DUMMY_FLOW_
1811
returnMode: AI_TARGET_DUMMY_GAME_OVER_RETURN_MODE,
1912
resetIdleOnReturn: AI_TARGET_DUMMY_GAME_OVER_RETURN_RESET_IDLE
2013
});
14+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
export const AI_TARGET_DUMMY_FLOW_LABELS = Object.freeze({
2+
attract: "Attract",
3+
intro: "Intro",
4+
highscore: "Highscore"
5+
});
6+
export const AI_TARGET_DUMMY_GAME_OVER_RETURN_STATUS = "Press 1 for one player or 2 for two players.";
7+
export const AI_TARGET_DUMMY_HIGHSCORE_STATUS = "AI Target Dummy high scores";
8+

0 commit comments

Comments
 (0)