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

View File

@@ -15,6 +15,7 @@ must_haves:
- "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)"
- "Games remain fixed at their schedule-determined positions"
- "Custom items can be placed at any sortOrder value (negative, zero, positive)"
artifacts:
- path: "SportsTimeTests/SortOrderProviderTests.swift"
provides: "Unit tests for SortOrderProvider"
@@ -115,7 +116,7 @@ xcodebuild -project SportsTime.xcodeproj -scheme SportsTime -destination 'platfo
<action>
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:
@@ -137,7 +138,10 @@ Test cases to include:
**Game immutability (DATA-03):**
- `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
let config = ModelConfiguration(isStoredInMemoryOnly: true)
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)"
```
</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 type="auto">
@@ -178,17 +182,18 @@ Look for "** TEST SUCCEEDED **" at the end.
<verification>
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
4. Tests verify the success criteria from ROADMAP.md Phase 1:
- Position survives reload (tested via encode/decode and SwiftData)
- Travel day update works (tested via day property mutation)
- Midpoint insertion works (tested via 50-iteration precision test)
- Games use time-based sortOrder (tested via initialSortOrder)
- Custom items can be placed anywhere (tested via negative/between/after positions)
</verification>
<success_criteria>
- 24+ new test cases across 2 test files
- 25+ new test cases across 2 test files
- All tests pass
- Tests directly verify Phase 1 requirements DATA-01 through DATA-05 and PERS-01 through PERS-03
- No regression in existing tests