Skip to content

Commit 7104e83

Browse files
committed
ALFA 009 fix bootstrap env port overrides
1 parent 80f732e commit 7104e83

8 files changed

Lines changed: 136 additions & 166 deletions

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Expected diagnostics:
1212
- `Role: owner`
1313
- `Web URL: http://127.0.0.1:5510`
1414
- `API URL: http://127.0.0.1:5511/api`
15-
- `Browser launch: opened http://127.0.0.1:5510/index.html`
15+
- `Browser launch: http://127.0.0.1:5510/index.html`
1616

1717
## Primary Alfa Codex Command
1818

@@ -60,6 +60,8 @@ For Charlie, both forms should show:
6060
- `API URL: http://127.0.0.1:5531/api`
6161
- `Browser launch: http://127.0.0.1:5530/index.html`
6262

63+
If `.env` or the current shell already has `GAMEFOUNDRY_SITE_URL` or `GAMEFOUNDRY_API_URL`, bootstrap should still show the resolved team/role ports in diagnostics and launch the browser from the computed `GAMEFOUNDRY_SITE_URL`.
64+
6365
## Failure Checks
6466

6567
```powershell

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Per OWNER instruction, those uncommitted changes were discarded with `git reset
3131
- Added automatic browser launch for owner-role `dev:bootstrap` after the API and web servers are both ready.
3232
- Suppressed 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.
34+
- 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.
3435

3536
## Supported Teams
3637

@@ -98,7 +99,8 @@ npm run dev:bootstrap -- --team alfa --role codex
9899
- The Alfa owner launch target is `http://127.0.0.1:5510/index.html`.
99100
- The Alfa codex launch target is suppressed while using web `5512` and API `5513`.
100101
- 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`.
101-
- Computed team/role ports override any `.env` port values loaded before bootstrap startup.
102+
- Computed team/role ports override any `.env` or inherited process `GAMEFOUNDRY_SITE_URL` / `GAMEFOUNDRY_API_URL` values loaded before bootstrap startup.
103+
- 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.
102104

103105
## Files Changed
104106

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
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-
| Prevent `.env` port override | PASS | Unit test confirms computed team/role ports overwrite loaded API/site port values. |
21+
| 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. |
2222
| Load environment | PASS | Orchestrator loads `.env` values without overriding existing environment values. |
2323
| Resolve team ports | PASS | Unit tests cover all teams and both roles. |
2424
| Start Local API | PASS | `dev:bootstrap` starts the existing Local API server on resolved API port. |

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
| `node --check dev/scripts/start-local-api-server.mjs` | PASS | Legacy startup entrypoint remains valid. |
1010
| `node --check dev/tests/dev-runtime/TeamAwareBootstrap.test.mjs` | PASS | Test syntax valid. |
1111
| `node ./dev/scripts/run-node-test-files.mjs dev/tests/dev-runtime/TeamAwareBootstrap.test.mjs dev/tests/dev-runtime/LocalApiStartupLogging.test.mjs` | PASS | 2 targeted files passed; 14 subtests passed. |
12-
| Unsupported team token scan in new bootstrap files | PASS | No unsupported old team names or single-letter public team commands found. |
12+
| 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. |
1515
| `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. |
16-
| `npm run dev:bootstrap -- --team charlie` | PASS | Started with team `charlie`, role `owner`, web `5530`, API `5531`, launched browser to `http://127.0.0.1:5530/index.html`, then process tree was stopped. |
16+
| `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. |
1717
| `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`. |
1818
| `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`. |
1919
| `npm run dev:bootstrap -- --team omega` | PASS | Failed clearly with supported team list. |
@@ -22,4 +22,4 @@
2222

2323
## Notes
2424

25-
The startup-command validations used short-lived process launches and `taskkill /T /F` cleanup after expected diagnostics appeared, so no dev servers were left running. Owner-role validations opened the configured browser target after both server diagnostics were available. Unit coverage verifies loaded `.env` port values are overwritten by computed team/role ports.
25+
The startup-command validations used short-lived process launches and `taskkill /T /F` cleanup after expected diagnostics appeared, so no dev servers were left running. Owner-role validations opened the configured browser target after both server diagnostics were available. Unit coverage verifies loaded `.env` and inherited process URL values are overwritten by computed team/role ports.

dev/reports/codex_changed_files.txt

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,16 @@ 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
87
M dev/tests/dev-runtime/TeamAwareBootstrap.test.mjs
98

109
# git ls-files --others --exclude-standard
1110
(no output)
1211

1312
# git diff --stat
14-
...team-aware-bootstrap_manual-validation-notes.md | 8 ++++++
15-
...R_26171_ALFA_009-team-aware-bootstrap_report.md | 3 ++
16-
...9-team-aware-bootstrap_requirement-checklist.md | 3 ++
17-
...A_009-team-aware-bootstrap_validation-report.md | 5 +++-
18-
dev/scripts/start-dev.mjs | 2 +-
19-
dev/scripts/team-port-config.mjs | 29 +++++++++++++++++++-
20-
dev/tests/dev-runtime/TeamAwareBootstrap.test.mjs | 32 +++++++++++++++++++++-
21-
7 files changed, 78 insertions(+), 4 deletions(-)
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(-)

0 commit comments

Comments
 (0)