Skip to content

Add repairable streak gap dates - #518

Merged
thomasluizon merged 5 commits into
redesign/mainfrom
feature/ticket-505-repair-gap
Sep 14, 2026
Merged

thomasluizon merged 5 commits into
redesign/mainfrom
feature/ticket-505-repair-gap

Conversation

@thomasluizon

@thomasluizon thomasluizon commented Sep 11, 2026

Copy link
Copy Markdown
Owner

Closes thomasluizon/orbit-tickets#505

A bare #505 in 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 RepairableGapDates list to StreakInfoResponse. Resolve the list in UserStreakService from the same scheduled occurrence set and the same continuity, predecessor, monthly cap, and streak improvement checks used by gap repair. Keep IsRepairAvailable and RepairDate unchanged for existing clients. Update the generated OpenAPI contract and cover the response through the real streak query and repair command composition.

Merge origin/main into the branch. Regenerate architecture.json and architecture.html with node tools/arch-map.mjs because the generator is authoritative for both artifacts.

Test evidence

  • Before implementation at 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.
  • With the strengthened WeeklyTwoOccurrenceGap_IsReturnedAndAcceptedWhenEchoed response-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 with CS1061 because StreakInfoResponse did not define RepairableGapDates.
  • After implementation, dotnet test tests/Orbit.Infrastructure.Tests/Orbit.Infrastructure.Tests.csproj --filter "FullyQualifiedName~StreakGapRepairTests" passed 34 of 34, including the weekly two-occurrence echo through RepairStreakGapCommand.
  • dotnet test tests/Orbit.Application.Tests/Orbit.Application.Tests.csproj --filter "FullyQualifiedName~GetStreakInfoQueryHandlerTests" passed 10 of 10.
  • After merging origin/main at 9765492f, dotnet build Orbit.slnx completed with 0 errors and 20 warnings.
  • After merging origin/main at 9765492f, dotnet test passed 32 analyzer, 585 domain, 3,392 application, and 2,240 infrastructure tests. Total: 6,249 passed and 0 failed.

@thomasluizon

Copy link
Copy Markdown
Owner Author

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.

pullfrog[bot]
pullfrog Bot previously approved these changes Sep 11, 2026

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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.

Pullfrog  | View workflow run | Using GPT Sol𝕏

pullfrog[bot]
pullfrog Bot previously approved these changes Sep 11, 2026

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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 RepairableGapDates to StreakInfoResponse and 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-mobile PR #894 is waiting for this field before adding the client contract and multi-day action.

Pullfrog  | View workflow run | Using GPT Sol𝕏

@thomasluizon

Copy link
Copy Markdown
Owner Author

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.

@thomasluizon
thomasluizon changed the base branch from main to redesign/main September 14, 2026 22:20
@thomasluizon

Copy link
Copy Markdown
Owner Author

@pullfrog review

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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 repairableGapDates while preserving every existing StreakInfoResponse field 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-mobile PR #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.

Pullfrog  | View workflow run | Using GPT Sol𝕏

@sonarqubecloud

Copy link
Copy Markdown

@thomasluizon
thomasluizon merged commit 827b99b into redesign/main Sep 14, 2026
22 checks passed
@thomasluizon
thomasluizon deleted the feature/ticket-505-repair-gap branch September 14, 2026 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant