Fix bootstrap to respect BASE_WORKER_CAP when spawning initial workers - #319
Conversation
The bootstrap_state() loop iterated over Constants.WORKER_NAMES.size() (10), spawning all workers regardless of the configured BASE_WORKER_CAP (2). Changed the loop bound to Constants.BASE_WORKER_CAP so only 2 workers are spawned at game start, matching the worker cap and the e2e test expectations. Fixes #0 Signed-off-by: Saffron <263493777+itsmiso-ai@users.noreply.github.com>
There was a problem hiding this comment.
AI Automated Review
Full PR review.
Analysis engine: MiniMax-M2.7@https://litellm.jory.dev/v1 (anthropic) — escalated (fast_low_confidence)
Recommendation: Approve
This is a clean, minimal fix that corrects a bug where bootstrap_state() was spawning 10 workers instead of the intended 2 (BASE_WORKER_CAP) on new game start.
Change Analysis
File: scripts/main.gd
Before: for i in Constants.WORKER_NAMES.size(): — loops 0–9, spawning all 10 workers
After: for i in Constants.BASE_WORKER_CAP: — loops 0–1, spawning only the 2 free workers
This fix ensures bootstrap respects the documented game constant. The SPEC.md explicitly states "The first 2 workers are free (BASE_WORKER_CAP = 2)" and the BASE_WORKER_CAP = 2 constant in constants.gd confirms the intended value.
The worker names remain correct — workers 0 and 1 are "Jun" and "Mara" in both cases, so no name-access issues arise from this fix.
Standards Compliance
No repository conventions are relevant to this mechanical constant correction. The change:
- Uses existing constants correctly
- Leaves no test coverage gaps (CI passed all suites)
- Does not touch save/version migration paths
- Aligns with documented game design (2 free workers)
CI Verification
All six CI checks passed on the PR commit:
- ✅ Export validation (Windows)
- ✅ Script test suite
- ✅ Export validation (Linux)
- ✅ Headless smoke test
- ✅ Export validation (macOS)
- ✅ macOS validation
Conclusion
This is a straightforward, correct bug fix that aligns bootstrap behavior with the game's documented constants and design. No blockers.
Summary
Refs #310
Provenance
The coder finished this successfully (verdict GO) on
foreman/wl-misospace-windowstead-0/issue-0, commit83d912a92. The review never ran: foreman's litellm key was not scoped to therevieweralias, so every review request was rejected and the task ended INCOMPLETE, and no PR was opened.That branch name is derived from issue number
0, which is a bug — it is shared by every third-attempt retry in this repo, so the commit was one retry away from being force-pushed over. Cherry-picked onto a non-foreman/*branch to preserve it.Not using a closing keyword: foreman may still redo this issue, and it owns the issue lifecycle.
Verification
main; no conflicts.