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.

Enforce Play level challenge initial-state contract with a parameterized test suite #61

Open

Description

@fullsend-ai-retro

What happened

In PR #42 (Play Level 2), the coding agent initialized slider controls such that Challenge Goal 2 pre-satisfied on mount (decode time dominated at 74%), and the component test asserted only final badge text (Dominates ✓) without establishing an unfulfilled baseline. Review agent iterations caught this defect, incurring $2.18 and 24 minutes of rework. The retro agent filed issue #57 proposing to document initial-state and transition-test rules in AGENTS.md. Code agent run 43540775501 implemented Issue #57 by adding 13 lines to AGENTS.md under ## Rules in PR #60, which merged into main at commit 901f794. However, inspection of existing levels shows that advisory prose does not guarantee contract compliance: in Level 4 (src/play/levels/level-4.tsx), Challenge Goal 1 (reach ≥ 2,000 tokens/s with p95 ≤ 2.0s) mounts in Passed ✓ state on initial render under default continuous mode at batch size 24 (acknowledged at src/play/levels/level-4.test.tsx:140). Furthermore, upcoming levels (Level 1 in #21 and Level 3 in #23) lack mechanical checks in npm test to block pre-satisfied defaults before review.

What could go better

Under Agent Scaffolding Principle #1 (Verification > documentation) and Principle #2 (Deterministic enforcement > advisory instructions), advisory instructions in context files are prone to omission or inconsistent implementation unless verified mechanically. Appending prose rules to AGENTS.md provides zero feedback to coding agents during local test runs (npm test); defects are only surfaced during subsequent review cycles. Furthermore, AGENTS.md has expanded to 156 lines, exceeding the 150-line target for minimal root context. Nearly 40% of the repository's closed issues since inception (#32, #38, #43, #49, #50, #53, #54, #57) have appended prose rules into AGENTS.md. We have high confidence that replacing advisory prose with an automated contract test will deterministically prevent pre-satisfied challenge goals across all current and future levels.

Proposed change

  1. Create a suite-level contract test src/play/levels/challenge-contract.test.tsx that imports LEVELS from src/play/levels/index.ts and iterates over all registered levels. For each level, render the Challenge section on mount and assert: (a) no goal badge renders in fulfilled status (e.g. Passed ✓ or Goal Met ✓), and (b) the challenge complete button is disabled or not present on initial render.
  2. Update src/play/levels/level-4.tsx initial control defaults (e.g., set default batchSize to 8 or default mode to static) so that Goal 1 mounts in an unfulfilled state, and update level-4.test.tsx to assert the unfulfilled baseline before simulating interaction.
  3. Condense the challenge prose rules in AGENTS.md into a concise reference pointing to src/play/levels/challenge-contract.test.tsx, returning AGENTS.md below the 150-line context cap.

Validation criteria

  1. src/play/levels/challenge-contract.test.tsx runs under npm test and passes across all registered Play levels in under 500 ms.
  2. If any level's initial state defaults are modified to satisfy a challenge goal on mount, npm test fails immediately with a descriptive assertion failure.
  3. The next two Play level implementations (Level 1 in Play Level 1: Sampling (temperature, top-k, top-p) #21 and Level 3 in Play Level 3: KV cache memory #23) achieve first-pass review compliance regarding challenge initial states with zero review findings regarding auto-satisfied goals.

Related issues checked

Searched: challenge contract test repo:ADLC-Day-Of-Learning/pixelsoccupied-inference-lab is:issue; challenge initial state repo:ADLC-Day-Of-Learning/pixelsoccupied-inference-lab is:issue; challenge goal initial state repo:fullsend-ai/fullsend repo:fullsend-ai/agents repo:ADLC-Day-Of-Learning/pixelsoccupied-inference-lab is:issue; challenge unfulfilled repo:fullsend-ai/fullsend repo:fullsend-ai/agents repo:ADLC-Day-Of-Learning/pixelsoccupied-inference-lab is:issue; tautological test repo:fullsend-ai/fullsend repo:fullsend-ai/agents repo:ADLC-Day-Of-Learning/pixelsoccupied-inference-lab is:issue
Considered: #57, fullsend-ai/agents#341, #21, #23, #24
#57: Documented challenge initial-state and transition rules in AGENTS.md as advisory prose; this proposal refines #57 by implementing deterministic mechanical enforcement via a centralized test in npm test and fixing Level 4's pre-satisfied default.
fullsend-ai/agents#341: Addresses code agent regex testing with production logic; does not cover React challenge state contracts or repo test suites.
#21: Open feature specification for Play Level 1 (Sampling); does not provide suite-wide contract tests.
#23: Open feature specification for Play Level 3 (KV cache memory); does not provide suite-wide contract tests.
#24: Closed feature issue that implemented Play Level 4 (Batching), where Goal 1 was inadvertently left pre-satisfied on initial mount.


Generated by retro agent from #60

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:53 AM UTC · Completed 1:57 AM UTC

    Commit: 901f794 · View workflow run →

    Runtime: pi · Model: google-vertex/gemini-3.8-flash → gemini-3.8-flash · Effort: high · Cost: $0.31

  3. added
    bug
    ready-to-code
    on Nov 14, 2026
  4. fullsend-ai-triage commented on Nov 14, 2026

    @fullsend-ai-triage

    Triage Assessment

    The reported issue is verified and actionable. Independent inspection of the repository confirms:

    • In src/play/levels/level-4.tsx, batchSize initializes to 24 in default continuous mode, which causes goal1Passed to evaluate to true on initial render and display the Passed ✓ badge prior to user interaction.
    • src/play/levels/level-4.test.tsx (line 140) acknowledges that Goal 1 is already satisfied on mount.
    • Other registered levels in src/play/levels/index.ts (level0, level2, and level5) initialize their challenge goals in unfulfilled states (Incomplete or In Progress), making Level 4 the only existing level requiring an initial-state fix.

    In-Flight Context & Scope

    Proposed Test Implementation

    You can implement src/play/levels/challenge-contract.test.tsx by iterating over LEVELS from src/play/levels/index.ts:

    import { render, screen, fireEvent } from "@testing-library/react"
    import { describe, it, expect } from "vitest"
    import { LEVELS } from "./index"
    
    describe("Play level challenge initial state contract", () => {
      it.each(LEVELS)(
        "Level $number ($id) initializes with all challenge goals unfulfilled on mount",
        (level) => {
          const Component = level.Component
          render(<Component onComplete={() => {}} isCompleted={false} />)
    
          // Switch to the Challenge tab if section tabs are present
          const challengeTab = screen.queryByRole("tab", { name: /challenge/i })
          if (challengeTab) {
            fireEvent.click(challengeTab)
          }
    
          // Assert that no challenge goal renders in a fulfilled status badge
          expect(screen.queryByText(/^passed\s*✓$/i)).not.toBeInTheDocument()
          expect(screen.queryByText(/goal(s)?\s*(met|passed)\s*✓/i)).not.toBeInTheDocument()
          expect(screen.queryByText(/^completed\s*✓$/i)).not.toBeInTheDocument()
    
          // Assert challenge completion button is disabled or absent on initial mount
          const completeButton = screen.queryByRole("button", {
            name: /complete.*challenge/i,
          })
          if (completeButton) {
            expect(completeButton).toBeDisabled()
          }
        }
      )
    })

    Next steps:

    • /fs-code — agent creates a PR to implement this issue
    • /fs-code <your instruction> — agent implements with your specific guidance
  5. fullsend-ai-coder commented on Nov 14, 2026

    @fullsend-ai-coder
    Contributor

    🤖 Finished Code · ❌ Failure (validation failed after 2 iteration(s)) · Started 1:58 AM UTC · Completed 2:00 AM UTC

    Commit: 901f794 · View workflow run →

    Runtime: pi · Model: google-vertex/gemini-3.8-flash → gemini-3.8-flash · Effort: high

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

    bugready-for-triageready-to-code

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions