Add repairable streak gap dates - #518
Conversation
|
Approach: append an optional repairable gap date list to StreakInfoResponse, derive it inside UserStreakService from the same scheduled occurrence sequence and boundary rules used by repair validation, and add focused unit coverage for daily and weekly gaps, invalid predecessor and lookback boundaries, completion today, plus echoing the weekly list through repair-gap. This keeps the existing single-day contract unchanged and avoids duplicating schedule logic in clients. |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes This revision contains the initialization commit only.
- Empty setup commit — No files differ from
main, so the repairable streak gap response, service logic, contract changes, and tests described in the PR body are not present to review yet.
GPT Sol | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes Reviewed the repairable gap date implementation added since the prior Pullfrog review.
- Extended the streak contract: Appended nullable, non-required
RepairableGapDatestoStreakInfoResponseand regenerated OpenAPI without breaking installed clients. - Derived server-authoritative candidates: Built the complete missed scheduled run from the user's local date and reused the write path's continuity, predecessor, monthly quota, and streak improvement evaluation.
- Covered read and write composition: Added daily and sparse weekly cases, rejection boundaries, completion-today behavior, exact response projection, and an echo through
RepairStreakGapCommand. - Preserved API-first rollout: Confirmed paired
orbit-ui-mobilePR #894 is waiting for this field before adding the client contract and multi-day action.
GPT Sol | 𝕏
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UFozk1UXf4Pm5spEHYxzT1
|
Merge origin/main into this branch, resolve architecture.html temporarily with our side, then regenerate architecture.json and architecture.html using node tools/arch-map.mjs. I will commit only merge output and generated artifacts. Regeneration is authoritative because both artifacts are generator output; I will not hand-edit either file. |
|
@pullfrog review |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes Reviewed the complete repairable streak gap implementation through the latest merge from main.
- Append-only response contract: Adds nullable, non-required
repairableGapDateswhile preserving every existingStreakInfoResponsefield for installed clients. - Server-authoritative gap detection: Derives the full scheduled gap using the user's local date and the same continuity, predecessor, monthly allowance, and streak improvement predicate used by the write path.
- Read and write composition: Covers exact daily and sparse weekly date sets, lookback and predecessor rejection, completion-today behavior, query projection, and successful command echo.
- Cross-repository rollout: Confirmed open
orbit-ui-mobilePR #894 is waiting on this API-first field and existing Zod consumers safely ignore the added optional key. - Generated artifacts: Updates OpenAPI and the architecture map consistently with the response and dependency changes.
GPT Sol | 𝕏
…et-505-repair-gap
|




Closes thomasluizon/orbit-tickets#505
A bare
#505in this repository resolves to orbit-api pull request 505, which is a different and already merged change. The backing ticket lives in the private ticket repository.Approach
Append an optional
RepairableGapDateslist toStreakInfoResponse. Resolve the list inUserStreakServicefrom the same scheduled occurrence set and the same continuity, predecessor, monthly cap, and streak improvement checks used by gap repair. KeepIsRepairAvailableandRepairDateunchanged for existing clients. Update the generated OpenAPI contract and cover the response through the real streak query and repair command composition.Merge
origin/maininto the branch. Regeneratearchitecture.jsonandarchitecture.htmlwithnode tools/arch-map.mjsbecause the generator is authoritative for both artifacts.Test evidence
5d11beaa,dotnet test tests/Orbit.Infrastructure.Tests/Orbit.Infrastructure.Tests.csproj --filter "FullyQualifiedName~WeeklyGapWhosePriorOccurrenceIsAWeekBack_IsRepairable"passed 1 of 1. The existing test proved that weekly repair validation accepted a scheduled gap, but did not cover the missing read contract.WeeklyTwoOccurrenceGap_IsReturnedAndAcceptedWhenEchoedresponse-path test placed against the same pre-fix production code,dotnet test tests/Orbit.Infrastructure.Tests/Orbit.Infrastructure.Tests.csproj --filter "FullyQualifiedName~WeeklyTwoOccurrenceGap_IsReturnedAndAcceptedWhenEchoed"failed at compile time withCS1061becauseStreakInfoResponsedid not defineRepairableGapDates.dotnet test tests/Orbit.Infrastructure.Tests/Orbit.Infrastructure.Tests.csproj --filter "FullyQualifiedName~StreakGapRepairTests"passed 34 of 34, including the weekly two-occurrence echo throughRepairStreakGapCommand.dotnet test tests/Orbit.Application.Tests/Orbit.Application.Tests.csproj --filter "FullyQualifiedName~GetStreakInfoQueryHandlerTests"passed 10 of 10.origin/mainat9765492f,dotnet build Orbit.slnxcompleted with 0 errors and 20 warnings.origin/mainat9765492f,dotnet testpassed 32 analyzer, 585 domain, 3,392 application, and 2,240 infrastructure tests. Total: 6,249 passed and 0 failed.