Skip to content

Commit 69c3fba

Browse files
committed
ALFA 009 harden bootstrap role parsing
1 parent 7104e83 commit 69c3fba

9 files changed

Lines changed: 342 additions & 143 deletions

dev/reports/PR_26171_ALFA_009-team-aware-bootstrap_manual-validation-notes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Expected diagnostics:
2626
- `Role: codex`
2727
- `Web URL: http://127.0.0.1:5512`
2828
- `API URL: http://127.0.0.1:5513/api`
29-
- `Browser launch: suppressed for codex role`
29+
- `Browser launch: skipped for codex role`
3030

3131
## Legacy Command
3232

dev/reports/PR_26171_ALFA_009-team-aware-bootstrap_report.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Per OWNER instruction, those uncommitted changes were discarded with `git reset
2929
- Added `dev/scripts/start-dev.mjs` as the bootstrap orchestrator.
3030
- Added focused node tests for team resolution, role offsets, invalid team/role validation, script wiring, `.env` loading behavior, and bootstrap diagnostics.
3131
- Added automatic browser launch for owner-role `dev:bootstrap` after the API and web servers are both ready.
32-
- Suppressed automatic browser launch for the `codex` role.
32+
- Skipped automatic browser launch for the `codex` role.
3333
- Fixed npm argument forwarding/parsing so both `--team charlie` and positional `charlie` select the same team after the package script's `--mode bootstrap` argument.
3434
- Treats `.env` `GAMEFOUNDRY_SITE_URL` and `GAMEFOUNDRY_API_URL` as legacy/default local values for bootstrap mode, then overwrites runtime URLs from the resolved team/role ports.
3535

@@ -94,10 +94,10 @@ npm run dev:bootstrap -- --team alfa --role codex
9494
## Browser Launch Behavior
9595

9696
- `owner` role launches the browser automatically to the selected team's `index.html`.
97-
- `codex` role suppresses browser launch.
97+
- `codex` role skips browser launch.
9898
- Browser launch happens only after both API and web servers are ready.
9999
- The Alfa owner launch target is `http://127.0.0.1:5510/index.html`.
100-
- The Alfa codex launch target is suppressed while using web `5512` and API `5513`.
100+
- The Alfa codex browser launch is skipped while using web `5512` and API `5513`.
101101
- The Charlie launch target is `http://127.0.0.1:5530/index.html` for both `npm run dev:bootstrap -- --team charlie` and `npm run dev:bootstrap -- charlie`.
102102
- Computed team/role ports override any `.env` or inherited process `GAMEFOUNDRY_SITE_URL` / `GAMEFOUNDRY_API_URL` values loaded before bootstrap startup.
103103
- Bootstrap runtime sets `GAMEFOUNDRY_SITE_URL=http://127.0.0.1:<webPort>` and `GAMEFOUNDRY_API_URL=http://127.0.0.1:<apiPort>/api` after team/role resolution.

dev/reports/PR_26171_ALFA_009-team-aware-bootstrap_requirement-checklist.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,15 @@
1818
| Validate unknown role names | PASS | `reviewer` fails clearly with supported role list. |
1919
| Support `--team` argument forwarding | PASS | `npm run dev:bootstrap -- --team charlie` resolves Charlie ports. |
2020
| Support positional team forwarding | PASS | `npm run dev:bootstrap -- charlie` resolves Charlie ports. |
21+
| Support positional team/role forwarding | PASS | `npm run dev:bootstrap -- alfa codex` resolves Alfa codex ports and skips browser launch. |
2122
| Prevent `.env` and process URL port override | PASS | Unit and live startup tests confirm computed team/role ports overwrite loaded or inherited API/site URL port values. |
2223
| Load environment | PASS | Orchestrator loads `.env` values without overriding existing environment values. |
2324
| Resolve team ports | PASS | Unit tests cover all teams and both roles. |
2425
| Start Local API | PASS | `dev:bootstrap` starts the existing Local API server on resolved API port. |
2526
| Start web server when requested | PASS | `dev:bootstrap` starts web plus API; `dev:web` mode is wired. |
2627
| Print startup diagnostics | PASS | Diagnostics include mode, team, role, web URL, API URL, environment source, supported teams, and supported roles. |
2728
| Owner role launches browser automatically | PASS | Live startup validation opened `http://127.0.0.1:5510/index.html` after API and web were ready. |
28-
| Codex role suppresses browser launch | PASS | Live startup validation reported `Browser launch: suppressed for codex role`. |
29+
| Codex role skips browser launch | PASS | Live startup validation reported `Browser launch: skipped for codex role`. |
2930
| Wait for both servers before browser launch | PASS | Targeted unit test asserts API ready, web ready, then browser launch order. |
3031
| Preserve legacy behavior | PASS | `dev:local-api` command unchanged and startup validation passed. |
3132
| No unrelated cleanup | PASS | Scope limited to package scripts, new dev scripts, targeted tests, and reports. |

dev/reports/PR_26171_ALFA_009-team-aware-bootstrap_validation-report.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
| Unsupported team token scan in new bootstrap files | PASS | No unsupported old team names or single-letter public team commands found in package scripts, bootstrap scripts, or targeted bootstrap tests. |
1313
| `npm run validate:canonical-structure` | PASS | Canonical repository structure guardrail passed. |
1414
| `npm run dev:bootstrap -- --team alfa` | PASS | Started with team `alfa`, role `owner`, web `5510`, API `5511`, launched browser to `http://127.0.0.1:5510/index.html`, then process tree was stopped. |
15-
| `npm run dev:bootstrap -- --team alfa --role codex` | PASS | Started with team `alfa`, role `codex`, web `5512`, API `5513`, suppressed browser launch, then process tree was stopped. |
15+
| `npm run dev:bootstrap -- --team alfa --role codex` | PASS | Started with team `alfa`, role `codex`, web `5512`, API `5513`, skipped browser launch, then process tree was stopped. |
16+
| `npm run dev:bootstrap -- alfa codex` | PASS | Positional team/role forwarding selected team `alfa`, role `codex`, web `5512`, API `5513`, and skipped browser launch. |
1617
| `npm run dev:bootstrap -- --team charlie` with inherited stale URL env values | PASS | Started with team `charlie`, role `owner`, web `5530`, API `5531`, launched browser to `http://127.0.0.1:5530/index.html`, and ignored inherited `GAMEFOUNDRY_SITE_URL` / `GAMEFOUNDRY_API_URL` port values before process cleanup. |
1718
| `npm run dev:bootstrap -- charlie` | PASS | Positional team forwarding selected team `charlie`, web `5530`, API `5531`, and browser target `http://127.0.0.1:5530/index.html`. |
1819
| `npm run dev:bootstrap -- --team bravo` | PASS | Started with team `bravo`, role `owner`, web `5520`, API `5521`, and browser target `http://127.0.0.1:5520/index.html`. |

dev/reports/codex_changed_files.txt

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,18 @@ M dev/reports/PR_26171_ALFA_009-team-aware-bootstrap_manual-validation-notes.md
44
M dev/reports/PR_26171_ALFA_009-team-aware-bootstrap_requirement-checklist.md
55
M dev/reports/PR_26171_ALFA_009-team-aware-bootstrap_validation-report.md
66
M dev/scripts/start-dev.mjs
7+
M dev/scripts/team-port-config.mjs
78
M dev/tests/dev-runtime/TeamAwareBootstrap.test.mjs
89

910
# git ls-files --others --exclude-standard
1011
(no output)
1112

1213
# git diff --stat
13-
...LFA_009-team-aware-bootstrap_manual-validation-notes.md | 4 +++-
14-
.../PR_26171_ALFA_009-team-aware-bootstrap_report.md | 4 +++-
15-
..._ALFA_009-team-aware-bootstrap_requirement-checklist.md | 2 +-
16-
...6171_ALFA_009-team-aware-bootstrap_validation-report.md | 6 +++---
17-
dev/scripts/start-dev.mjs | 6 +++---
18-
dev/tests/dev-runtime/TeamAwareBootstrap.test.mjs | 14 +++++++++++---
19-
6 files changed, 24 insertions(+), 12 deletions(-)
14+
...team-aware-bootstrap_manual-validation-notes.md | 2 +-
15+
...R_26171_ALFA_009-team-aware-bootstrap_report.md | 6 +-
16+
...9-team-aware-bootstrap_requirement-checklist.md | 3 +-
17+
...A_009-team-aware-bootstrap_validation-report.md | 3 +-
18+
dev/scripts/start-dev.mjs | 2 +-
19+
dev/scripts/team-port-config.mjs | 31 ++++++++--
20+
dev/tests/dev-runtime/TeamAwareBootstrap.test.mjs | 71 ++++++++++++++++------
21+
7 files changed, 87 insertions(+), 31 deletions(-)

0 commit comments

Comments
 (0)