Review: Fix contract page — proration, local schedules, remove local conduct rules

review-wc-17-2026-03-24 Review

review ready

Verdict: READY

Template Completeness

  • [x] Lineage — present, traces to plan-wkq Phase 14
  • [x] Repo — correctly identifies forgejo_admin/westside-contracts
  • [x] User Story — implicit (bug fix format uses "What Broke" instead, acceptable for bug type)
  • [x] Context — thorough: references approved playground prototype branch, identifies all three discrepancies with line-level precision
  • [x] File Targets — single file identified with specific line ranges and exact code changes
  • [x] Acceptance Criteria — 5 criteria, all testable
  • [x] Test Expectations — 3 Playwright tests described with specific assertions, run command provided
  • [x] Constraints — proration formula and conditional logic specified
  • [x] Checklist — present
  • [x] Related — project and playground prototype referenced
  • [ ] "Files NOT to touch" — present and well-scoped (travel content, signing section, success overlay, server-side)

File Targets

  • [x] src/routes/contract/[token]/+page.svelte — verified exists (482 lines on main, commit 8675712)
  • [x] Line 304 on main: First monthly fee (${monthlyFee}) — confirmed, NO proration label. Ticket claim accurate.
  • [x] Line 357 on main: Practice days and locations vary by team. — confirmed generic text. Ticket claim accurate.
  • [x] Lines 384-389 on main: Rules of Conduct section present on local contract — confirmed. Ticket claim accurate.
  • [x] proratedFee variable NOT defined on main — confirmed. Ticket correctly identifies it was removed during date cleanup.
  • [x] player.team_name available in types.ts (line 15) and populated by +page.server.ts (line 11, 32) — confirmed: conditional logic is feasible.
  • [x] isLocal derived from player.team_name.includes('Local') in +page.server.ts (line 41) — confirmed: local/travel branching already works.
  • [x] Playground branch 5-sync-westside-contract-html-with-deploye exists in pal-e-playground repo — confirmed.

Repo Placement

Correct. Issue filed on forgejo_admin/westside-contracts, and all changes are to that repo's single contract page file. No cross-repo work needed.

Dependencies

  • Downstream: westside-app #74 ("Send local team contracts") is in next_up with priority:high. This fix must land before sending contracts to local teams.
  • Downstream: westside-contracts #7 ("E2E: Lucas + Marcus walk through contract flow") is in next_up. Has depends:wc-6 and depends:bball-160 — both resolved (in done). This E2E walkthrough will validate the fix.
  • Parent phase: Phase 14 (board item 131) is in_progress. This bug fix is part of that phase.
  • No blockers: No upstream dependencies. The fix is purely frontend template changes within a single file.

Acceptance Criteria

All 5 criteria are agent-verifiable:
  • [x] Proration label — agent can grep for "prorated" in rendered output for both travel and local sections
  • [x] Team-specific schedules — agent can grep for "BWill" and conditional logic in local section
  • [x] No rules of conduct on local — agent can verify absence of "Rules of Conduct" heading in the {:else} block
  • [x] Travel unchanged except proration — agent can diff travel section before/after
  • [x] Build + tests — npm run build && npm test is a real command
Test expectations reference Playwright tests that would need to be written. The existing test file (tests/validation.test.ts) covers only server-side validation, not UI. The ticket's test expectations are aspirational — no existing Playwright infrastructure exists in this repo yet. However, the ticket says "npm run build && npm test" which would run the existing vitest suite. This is acceptable since the changes are purely template/HTML and the build check catches Svelte compilation errors.

Blast Radius

  • Low risk. Changes are confined to a single Svelte template file — no server-side, no API, no database changes.
  • No sibling services affected. The contract page is self-contained in westside-contracts. No other repo renders contract content.
  • Sign endpoint unchanged. The /contract/[token]/sign/+server.ts is explicitly out of scope and the changes don't affect form submission or data model.
  • Note: Branch 17-fix-contract-prorated-fee-schedules already exists with work in progress. The working directory shows the fixes are partially or fully applied. Agent should verify against the branch state, not assume a clean start from main.

Recommendation

No action needed — scope is solid. All file targets verified against main branch (commit 8675712). All three discrepancies confirmed. Proration formula, team-specific conditionals, and Rules of Conduct removal are all well-specified. The ticket is ready for agent execution.
Minor note: The ticket's Test Expectations mention Playwright tests, but westside-contracts has no Playwright setup. The agent should focus on vitest + build verification rather than attempting to create Playwright tests. This is not a blocker — it's a refinement the agent can handle during implementation.