Repository navigation
Decentralize Play level registration to eliminate parallel PR merge conflicts in src/play/levels/index.ts #58
Description
What happened
In PR #42, parallel development of Play levels caused repeated merge conflicts in src/play/levels/index.ts and associated integration test files:
- At 2026-11-14 00:19:25 UTC, PR feat(#37): add Play Level 0 Tokens and toy tokenizer #40 (Level 0) merged into
main. This created a merge conflict insrc/play/levels/index.tsthat had to be resolved during Fix Iteration 2 (Run 43533363311, commitfefb8f4). - At 2026-11-14 00:31:17 UTC, PR feat(#24): add Play Level 4 batching static vs continuous #44 (Level 4) merged into
mainwhile Review Round 3 (Run 43534248194) was in progress. Review Round 3 approved PR feat(#22): add Play Level 2 prefill vs decode simulation #42 at 00:45 UTC, but GitHub marked the PR asCONFLICTINGonsrc/play/levels/index.ts,src/pages/play-page.test.tsx,src/play/progress.ts, andsrc/App.test.tsx. - Maintainer
@pixelsoccupiedhad to intervene with a manual/fs-fixcomment: "Approved, but it conflicts with main in src/play/levels/index.ts. Merge origin/main, keep every level already registered on main, and add this one in number order...". Fix Iteration 3 (Run 43536415658) took 13m 57s and $0.73 strictly to reconcile these conflicts.
Currently, all remaining open Play level PRs (#41 for Level 5, #46 for Level 1, #47 for Level 3) are in CONFLICTING status due to this exact file bottleneck.
What could go better
This mirrors the exact architectural bottleneck previously diagnosed for the Calculator page in issue #34 ("Decompose CalculatorPage into modular card components to eliminate merge conflicts"), where multiple PRs editing monolithic calculator-page.tsx conflicted.
In Play mode, src/play/levels/index.ts acts as a centralized bottleneck file where every single level PR must import its component, re-export it, define a levelN: LevelDefinition constant, and append it to the centralized LEVELS array. Because level PRs run concurrently, whichever level merges first forces all other in-flight PRs into merge conflicts.
Decentralizing level definitions into self-contained level files and dynamically aggregating them in index.ts (or using an isolated level registry mapping) will allow parallel level development without git conflicts or human coordination.
Proposed change
Refactor Play level registration to decouple individual level definitions from src/play/levels/index.ts:
- Self-contained level exports: Each level file (e.g.
src/play/levels/level-2.tsx,tokens.tsx) exports its ownLevelDefinitionobject directly:export const levelDefinition: LevelDefinition = { id: 'prefill-decode', number: 2, title: 'Prefill vs. Decode', concept: 'Prefill sets TTFT (compute-bound); decode sets inter-token latency (bandwidth-bound).', Component: Level2Component, }
- Dynamic or decoupled registry in
src/play/levels/index.ts: Use Vite'simport.meta.glob<{ levelDefinition: LevelDefinition }>('./*.tsx', { eager: true })or an automated aggregator that discovers all level definitions, sorts them bynumber, and exportsLEVELS. - Zero edits to
index.tswhen adding levels: Adding a new level will only involve adding files insrc/play/levels/without modifying a shared central registry array, completely eliminating merge conflicts across parallel feature PRs.
Validation criteria
- Adding or merging a new Play level requires touching only files within its own component file/directory, with zero modifications to
src/play/levels/index.ts. - The remaining open Play level PRs (Level 1 feat(#21): add Play Level 1 sampling with temperature, top-k, and top-p #46, Level 3 feat(#23): add Play Level 3 KV cache memory level #47, Level 5 feat(#25): implement Play Level 5 quantization and model choice #41) can be rebased and merged into
mainin any arbitrary order without triggering merge conflicts insrc/play/levels/index.ts.
Related issues checked
Searched: level registration merge conflict repo:ADLC-Day-Of-Learning/pixelsoccupied-inference-lab is:issue is:open; play levels index repo:ADLC-Day-Of-Learning/pixelsoccupied-inference-lab is:issue is:open; merge conflict index.ts repo:ADLC-Day-Of-Learning/pixelsoccupied-inference-lab is:issue is:closed; modular components merge conflict repo:fullsend-ai/fullsend repo:fullsend-ai/agents repo:ADLC-Day-Of-Learning/pixelsoccupied-inference-lab is:issue; levels index.ts repo:fullsend-ai/fullsend repo:fullsend-ai/agents repo:ADLC-Day-Of-Learning/pixelsoccupied-inference-lab is:issue
Considered: #34, #23, #25, #21, fullsend-ai/fullsend#2033
#34 addressed merge conflicts in CalculatorPage by decomposing it into modular cards; it assumed Play mode was already modular but did not identify the index.ts centralized registration bottleneck.
#21, #23, #25 are feature issues for Play Levels 1, 3, and 5; they instruct implementers to register in index.ts and are currently conflicting because of this bottleneck.
fullsend-ai/fullsend#2033 is an internal refactoring of the fullsend CLI install command, unrelated to frontend level registration.
Generated by retro agent from #42
Activity
fullsend-ai-triage commentedon Nov 14, 2026
🤖 Finished Triage · ✅ Success · Started 1:23 AM UTC · Completed 1:30 AM UTC
Commit:
4d97536· View workflow run →Runtime: pi · Model: google-vertex/gemini-3.8-flash → gemini-3.8-flash · Effort: high · Cost: $0.48
fullsend-ai-triage commentedon Nov 14, 2026
Triage Assessment
The proposed architectural refactoring is well-specified and ready for implementation. Decentralizing Play level registration directly resolves the file contention bottleneck that caused merge conflicts across concurrent Play level pull requests.
Repository Context & Implementation Notes
src/play/levels/index.tscurrently imports and registers levels statically, whiletokens.tsx,level-2.tsx,level-4.tsx, andlevel-5.tsxexport component definitions without individual level metadata.import.meta.glob<{ levelDefinition?: LevelDefinition }>, ensure the glob pattern excludes test files (e.g.,['./*.tsx', '!./*.test.tsx']) to prevent test suites from being included in the aggregatedLEVELSarray.tokens.test.tsx,level-2.test.tsx,level-4.test.tsx,level-5.test.tsx) import specific level constants from./index. Ensure those named exports remain available or update test imports to reference the respective level files directly.requires_workflow_changes: false). Resolving this decoupling unblocks in-flight and future Play level branches to rebase cleanly without touchingindex.ts.Proposed Verification Test Case
Labels: Decoupling Play level registration into dynamic discovery is an architectural enhancement that prevents merge conflicts.
Next steps:
/fs-code— agent creates a PR to implement this issue/fs-code <your instruction>— agent implements with your specific guidance