fix(01): revise plans based on checker feedback

- 01-01: Reframe must_haves.truths to user-observable behaviors
- 01-01: Remove unimplemented key_link (wiring happens in later phases)
- 01-02: Add test case for DATA-04 (custom items at any position)
- 01-02: Add must_haves.truths entry for custom item flexibility
- 01-02: Document LocalItineraryItem is standalone (no sibling models needed)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Trey t
2026-01-18 13:47:12 -06:00
parent 6bce0481bd
commit a7d0e7f049
2 changed files with 14 additions and 13 deletions

View File

@@ -11,9 +11,9 @@ autonomous: true
must_haves: must_haves:
truths: truths:
- "Games get sortOrder derived from game time (minutes since midnight + offset)" - "Games sort by schedule time within each day"
- "Inserting between two items produces midpoint sortOrder" - "Items can be inserted at any position (before, between, after existing items)"
- "Day number can be calculated from any date given trip start date" - "Items can be assigned to any trip day by date calculation"
artifacts: artifacts:
- path: "SportsTime/Core/Models/Domain/SortOrderProvider.swift" - path: "SportsTime/Core/Models/Domain/SortOrderProvider.swift"
provides: "sortOrder calculation utilities" provides: "sortOrder calculation utilities"
@@ -21,11 +21,7 @@ must_haves:
- path: "SportsTime/Core/Models/Domain/Trip.swift" - path: "SportsTime/Core/Models/Domain/Trip.swift"
provides: "Day derivation methods" provides: "Day derivation methods"
contains: "func dayNumber(for date: Date) -> Int" contains: "func dayNumber(for date: Date) -> Int"
key_links: key_links: []
- from: "SortOrderProvider"
to: "ItineraryItem.sortOrder"
via: "Utilities compute values assigned to sortOrder property"
pattern: "sortOrder.*=.*SortOrderProvider"
--- ---
<objective> <objective>

View File

@@ -15,6 +15,7 @@ must_haves:
- "Moving travel segment to different day updates its day property" - "Moving travel segment to different day updates its day property"
- "Inserting between two items gets sortOrder between their values (e.g., 1.0 and 2.0 -> 1.5)" - "Inserting between two items gets sortOrder between their values (e.g., 1.0 and 2.0 -> 1.5)"
- "Games remain fixed at their schedule-determined positions" - "Games remain fixed at their schedule-determined positions"
- "Custom items can be placed at any sortOrder value (negative, zero, positive)"
artifacts: artifacts:
- path: "SportsTimeTests/SortOrderProviderTests.swift" - path: "SportsTimeTests/SortOrderProviderTests.swift"
provides: "Unit tests for SortOrderProvider" provides: "Unit tests for SortOrderProvider"
@@ -115,7 +116,7 @@ xcodebuild -project SportsTime.xcodeproj -scheme SportsTime -destination 'platfo
<action> <action>
Create a new test file `SemanticPositionPersistenceTests.swift` with integration tests for semantic position persistence. Create a new test file `SemanticPositionPersistenceTests.swift` with integration tests for semantic position persistence.
These tests verify PERS-01, PERS-02, PERS-03 requirements. These tests verify PERS-01, PERS-02, PERS-03, and DATA-04 requirements.
Test cases to include: Test cases to include:
@@ -137,7 +138,10 @@ Test cases to include:
**Game immutability (DATA-03):** **Game immutability (DATA-03):**
- `test_gameItem_sortOrderDerivedFromTime`: Create game item for 7pm game, verify sortOrder is ~1240.0 (100 + 19*60) - `test_gameItem_sortOrderDerivedFromTime`: Create game item for 7pm game, verify sortOrder is ~1240.0 (100 + 19*60)
Use in-memory SwiftData ModelContainer for tests: **Custom item flexibility (DATA-04):**
- `test_customItem_canBePlacedAtAnyPosition`: Create custom items with sortOrder values at negative (-5.0, before all games), between games (500.0), and after all games (2000.0). Verify all three persist correctly and can coexist on the same day sorted correctly.
Use in-memory SwiftData ModelContainer for tests. Note: LocalItineraryItem is standalone with no relationships - it can be registered alone:
```swift ```swift
let config = ModelConfiguration(isStoredInMemoryOnly: true) let config = ModelConfiguration(isStoredInMemoryOnly: true)
let container = try ModelContainer(for: LocalItineraryItem.self, configurations: config) let container = try ModelContainer(for: LocalItineraryItem.self, configurations: config)
@@ -151,7 +155,7 @@ Tests compile and pass:
xcodebuild -project SportsTime.xcodeproj -scheme SportsTime -destination 'platform=iOS Simulator,name=iPhone 17,OS=26.2' -only-testing:SportsTimeTests/SemanticPositionPersistenceTests test 2>&1 | grep -E "(Test Case|passed|failed)" xcodebuild -project SportsTime.xcodeproj -scheme SportsTime -destination 'platform=iOS Simulator,name=iPhone 17,OS=26.2' -only-testing:SportsTimeTests/SemanticPositionPersistenceTests test 2>&1 | grep -E "(Test Case|passed|failed)"
``` ```
</verify> </verify>
<done>SemanticPositionPersistenceTests.swift exists with 8+ test cases, all tests pass</done> <done>SemanticPositionPersistenceTests.swift exists with 9+ test cases, all tests pass</done>
</task> </task>
<task type="auto"> <task type="auto">
@@ -178,17 +182,18 @@ Look for "** TEST SUCCEEDED **" at the end.
<verification> <verification>
1. SortOrderProviderTests.swift exists with 16+ test methods covering all SortOrderProvider functions 1. SortOrderProviderTests.swift exists with 16+ test methods covering all SortOrderProvider functions
2. SemanticPositionPersistenceTests.swift exists with 8+ test methods covering persistence requirements 2. SemanticPositionPersistenceTests.swift exists with 9+ test methods covering persistence requirements
3. All tests pass when run individually and as part of full suite 3. All tests pass when run individually and as part of full suite
4. Tests verify the success criteria from ROADMAP.md Phase 1: 4. Tests verify the success criteria from ROADMAP.md Phase 1:
- Position survives reload (tested via encode/decode and SwiftData) - Position survives reload (tested via encode/decode and SwiftData)
- Travel day update works (tested via day property mutation) - Travel day update works (tested via day property mutation)
- Midpoint insertion works (tested via 50-iteration precision test) - Midpoint insertion works (tested via 50-iteration precision test)
- Games use time-based sortOrder (tested via initialSortOrder) - Games use time-based sortOrder (tested via initialSortOrder)
- Custom items can be placed anywhere (tested via negative/between/after positions)
</verification> </verification>
<success_criteria> <success_criteria>
- 24+ new test cases across 2 test files - 25+ new test cases across 2 test files
- All tests pass - All tests pass
- Tests directly verify Phase 1 requirements DATA-01 through DATA-05 and PERS-01 through PERS-03 - Tests directly verify Phase 1 requirements DATA-01 through DATA-05 and PERS-01 through PERS-03
- No regression in existing tests - No regression in existing tests