Skip to content

task 4 brief

Xopher edited this page Oct 28, 2026 · 1 revision

Task 4: The suggested chore list and re-runs

Files:

  • Create: src/lib/services/projects/projectChores.ts
  • Test: tests/unit/projectChores.spec.ts

Interfaces:

  • Consumes: Task 2's types; PackHero, heroBandFor (packCommon.ts); MOVING_ROOMS (labels).

  • Produces:

    • interface ProjectHouse { rooms: Partial<Record<MovingRoomId, number>>; basement?: boolean }
    • interface ProjectRoom { id: string /* "kitchen", "bedroom-2" */; kind: MovingRoomId | "house"; name: string }
    • interface ProjectChore { id: string; phaseId: string; roomId: string; name: string; difficulty: number; assignee: string[]; beastId?: string; minutes?: number; custom?: boolean }
    • houseRoomsOf(house: ProjectHouse): ProjectRoom[] (counted rooms numbered "Bedroom 1", "Bedroom 2"; a "house" room named "The Whole House")
    • suggestChores(type: ProjectType, house: ProjectHouse, heroes: readonly PackHero[]): ProjectChore[] (finale included, phaseId: "roof")
    • choresFromLastRun(last: readonly ProjectChore[], heroes: readonly PackHero[]): ProjectChore[]
  • Step 1: Write the failing tests: one chore per suggestion per matching room (a kitchen suggestion with 1 kitchen gives one chore, a bedroom suggestion with 3 bedrooms gives three); rooms not ticked get none; who: "little" goes to a little hero, round-robin across heroes of that band, falling back little → kid → grown-up when a band is empty; "team" assigns every hero; difficulty is clamped into the assignee's band range (little 1-2, kid 2-5, grown-up 5-13); ids are stable for the same input; choresFromLastRun keeps names, sizes and custom chores, drops assignees who are no longer heroes and re-assigns those chores by band, and gives fresh ids.

  • Step 2: Run chemx test tests/unit/projectChores.spec.ts. Expected: FAIL.

  • Step 3: Implement with the signatures above.

  • Step 4: Run the spec. Expected: PASS.

  • Step 5: Lead commits feat(projects): the suggested chore list by room and age, and re-runs.

Table of Contents


Home - See Pages

Developer Docs

Start Screen

User Management

My Portal

My Home

The City (Hometown)

The World Map

The Dungeon

Game Master

Settings

Support & Glossary

About XP

Clone this wiki locally