Skip to content
This repository was archived by the owner on Nov 16, 2026. It is now read-only.
This repository was archived by the owner on Nov 16, 2026. It is now read-only.

Decentralize Play level registration to eliminate parallel PR merge conflicts in src/play/levels/index.ts #58

Open

Description

@fullsend-ai-retro

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:

  1. 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 in src/play/levels/index.ts that had to be resolved during Fix Iteration 2 (Run 43533363311, commit fefb8f4).
  2. At 2026-11-14 00:31:17 UTC, PR feat(#24): add Play Level 4 batching static vs continuous #44 (Level 4) merged into main while 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 as CONFLICTING on src/play/levels/index.ts, src/pages/play-page.test.tsx, src/play/progress.ts, and src/App.test.tsx.
  3. Maintainer @pixelsoccupied had to intervene with a manual /fs-fix comment: "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:

  1. Self-contained level exports: Each level file (e.g. src/play/levels/level-2.tsx, tokens.tsx) exports its own LevelDefinition object 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,
    }
  2. Dynamic or decoupled registry in src/play/levels/index.ts: Use Vite's import.meta.glob<{ levelDefinition: LevelDefinition }>('./*.tsx', { eager: true }) or an automated aggregator that discovers all level definitions, sorts them by number, and exports LEVELS.
  3. Zero edits to index.ts when adding levels: Adding a new level will only involve adding files in src/play/levels/ without modifying a shared central registry array, completely eliminating merge conflicts across parallel feature PRs.

Validation criteria

  1. 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.
  2. 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 main in any arbitrary order without triggering merge conflicts in src/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

  1. added
    ready-for-triage
    on Nov 14, 2026
  2. fullsend-ai-triage commented on Nov 14, 2026

    @fullsend-ai-triage

    🤖 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

  3. fullsend-ai-triage commented on Nov 14, 2026

    @fullsend-ai-triage

    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

    • Target Files Confirmed: src/play/levels/index.ts currently imports and registers levels statically, while tokens.tsx, level-2.tsx, level-4.tsx, and level-5.tsx export component definitions without individual level metadata.
    • Dynamic Discovery Pattern: When implementing 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 aggregated LEVELS array.
    • Backward Compatibility: Existing level tests (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.
    • Workflow & Dependencies: No CI/workflow changes are needed (requires_workflow_changes: false). Resolving this decoupling unblocks in-flight and future Play level branches to rebase cleanly without touching index.ts.

    Proposed Verification Test Case

    import { describe, it, expect } from "vitest"
    import { LEVELS } from "./index"
    
    describe("Dynamic Play level registration", () => {
      it("automatically aggregates and exports all registered level definitions in ascending order", () => {
        expect(LEVELS.length).toBeGreaterThanOrEqual(4)
    
        for (const level of LEVELS) {
          expect(level).toHaveProperty("id")
          expect(level).toHaveProperty("number")
          expect(level).toHaveProperty("title")
          expect(level).toHaveProperty("concept")
          expect(level).toHaveProperty("Component")
          expect(typeof level.Component).toBe("function")
        }
    
        // Verify ascending order by level number
        for (let i = 1; i < LEVELS.length; i++) {
          expect(LEVELS[i].number).toBeGreaterThan(LEVELS[i - 1].number)
        }
      })
    
      it("does not include test files in the discovered level definitions", () => {
        const testLevel = LEVELS.find((l) => l.id.includes("test"))
        expect(testLevel).toBeUndefined()
      })
    })

    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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementfeatureready-for-triagetriaged

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions