Skip to content

feat(scheduler): support occurrence lifecycle - #290

Merged
yordis merged 6 commits into
mainfrom
yordis/create-pr-v2
Jun 17, 2026
Merged

feat(scheduler): support occurrence lifecycle#290
yordis merged 6 commits into
mainfrom
yordis/create-pr-v2

Conversation

@yordis

@yordis yordis commented Jun 16, 2026

Copy link
Copy Markdown
Member
  • Scheduler state needs durable occurrence progress so recurring schedules can recover and continue correctly across command boundaries.
  • The aggregate needs explicit events for planned, recorded, and exhausted occurrences so delivery timing remains auditable and deterministic.

@cursor

cursor Bot commented Jun 16, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Large change to schedule aggregate state, RRULE planning, and event evolution; correctness bugs could cause missed or duplicate occurrences, though behavior is heavily tested in command/state tests.

Overview
Adds durable occurrence lifecycle to the schedule aggregate so RRULE schedules can plan wakeups, record firings, and finish when recurrence is exhausted—without the execution layer doing recurrence math.

Protos: State now tracks last occurrence, gapless sequence, retained schedule, pending_occurrence_at, and completed. ScheduleEvent gains ScheduleOccurrenceScheduled, ScheduleOccurrenceRecorded, and ScheduleCompleted.

Domain/commands: New Recurrence expands RRULE (with cursors, DST, rdate/exdate). ScheduleNextOccurrence arms the next occurrence (or emits completion) for enabled schedules. RecordScheduleOccurrence accepts only the pending instant, then chains the next schedule or completion; paused schedules record in-flight wakeups without re-arming unless exhausted.

State evolution: Occurrence events update progress and pending; pause keeps pending for race-safe recording; resume clears unrecorded pending so re-arming works; create resets occurrence fields. ResumeSchedule rejects completed schedules.

Execution reconciliation treats occurrence lifecycle events as non-reconciled (no delivery-definition changes).

Reviewed by Cursor Bugbot for commit fe46982. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@yordis, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 52 minutes and 41 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: bc2289a3-ad5a-4e5f-b5a6-81a7c42dd158

📥 Commits

Reviewing files that changed from the base of the PR and between ff1662e and fe46982.

📒 Files selected for processing (1)
  • rsworkspace/crates/trogon-scheduler/src/commands/resume_schedule.rs

Walkthrough

Adds schedule occurrence lifecycle support to the scheduler: three new proto messages (ScheduleOccurrenceRecorded, ScheduleOccurrenceScheduled, ScheduleCompleted) with corresponding ScheduleEvent variants, extended durable State fields, RRULE recurrence expansion domain logic, ScheduleOccurrenceSequence domain type, RecordScheduleOccurrence and ScheduleNextOccurrence command deciders, codec wiring, and reconciliation bypass for the new event variants.

Changes

Schedule Occurrence Tracking and Recurrence Commands

Layer / File(s) Summary
Proto schemas: new occurrence events and state extension
proto/trogonai/scheduler/schedules/v1/schedule_occurrence_recorded.proto, proto/trogonai/scheduler/schedules/v1/schedule_occurrence_scheduled.proto, proto/trogonai/scheduler/schedules/v1/schedule_completed.proto, proto/trogonai/scheduler/schedules/v1/events.proto, proto/trogonai/scheduler/schedules/state/v1/state.proto
Adds ScheduleOccurrenceRecorded, ScheduleOccurrenceScheduled, and ScheduleCompleted proto messages. Extends ScheduleEvent.oneof with fields 5–7 and expands State with last_occurrence_at, last_occurrence_sequence, schedule, pending_occurrence_at, and completed.
ScheduleOccurrenceSequence domain type and module wiring
rsworkspace/crates/trogon-scheduler/src/commands/domain/schedule_occurrence_sequence.rs, rsworkspace/crates/trogon-scheduler/src/commands/domain/mod.rs, rsworkspace/crates/trogon-scheduler/src/commands/mod.rs
Introduces ScheduleOccurrenceSequence as a validated non-zero u64 wrapper with try_new, next_after (overflow-safe), as_u64, and Display. Wires recurrence and sequence modules into the domain tree and registers the two new command modules.
RRULE recurrence expansion domain logic
rsworkspace/crates/trogon-scheduler/src/commands/domain/recurrence.rs
Adds RRuleCursor (inclusive vs. exclusive boundary), RecurrenceError, RecurrenceStep, Recurrence aggregate parsing v1::Schedule via TryFrom, and plan_next using an off-by-one-nanosecond probe for inclusive boundary semantics. Returns Occurrence or Exhausted. Tests cover boundary behavior, exhaustion, rdate/exdate, DST, and error handling.
State evolution: occurrence field tracking across all event types
rsworkspace/crates/trogon-scheduler/src/commands/state.rs
Extends EvolveError with MissingOccurrenceAt and MissingOccurrenceSequence. Expands initial_state and evolve to carry and mutate occurrence fields across all seven event arms. Tests verify field advancement, pending lifecycle, and new missing-field error paths.
RecordScheduleOccurrence decider
rsworkspace/crates/trogon-scheduler/src/commands/record_schedule_occurrence.rs
Defines RecordScheduleOccurrence command and RecordScheduleOccurrenceError. Decider validates state, guards duplicates via last_occurrence_at, enforces strict pending_occurrence_at equality, advances sequence, emits ScheduleOccurrenceRecorded, then conditionally emits ScheduleOccurrenceScheduled or ScheduleCompleted for enabled schedules. Implements CommandSnapshotPolicy.
ScheduleNextOccurrence decider
rsworkspace/crates/trogon-scheduler/src/commands/schedule_next_occurrence.rs
Defines ScheduleNextOccurrence command and ScheduleNextOccurrenceError. Decider validates state lifecycle, rejects already-armed (pending_occurrence_at set) or completed states, derives RRULE cursor from last_occurrence_at with 5-minute grace window, and emits ScheduleOccurrenceScheduled or ScheduleCompleted. Implements CommandSnapshotPolicy.
Codec wiring, reconciliation filtering, and test updates
rsworkspace/crates/trogonai-proto/src/scheduler/schedules/codec.rs, rsworkspace/crates/trogon-scheduler/src/processor/execution/reconciliation/recorded_events.rs, rsworkspace/crates/trogon-scheduler/src/commands/create_schedule.rs, rsworkspace/crates/trogon-scheduler/src/commands/pause_schedule.rs, rsworkspace/crates/trogon-scheduler/src/commands/remove_schedule.rs, rsworkspace/crates/trogon-scheduler/src/commands/resume_schedule.rs
Extends ScheduleEvent codec for three new variants with round-trip tests. Adds NonReconciledEvent to ScheduleEventDecodeError and short-circuits occurrence lifecycle events to Ok(None) in schedule_change_from_stream_event. Updates existing command tests to construct state_v1::State with defaulted new occurrence fields.

Sequence Diagram(s)

sequenceDiagram
  participant Processor
  participant ScheduleNextOccurrenceDecider
  participant Recurrence
  participant StateEvolve

  rect rgba(100, 149, 237, 0.5)
    note over Processor,StateEvolve: Arm next occurrence
    Processor->>ScheduleNextOccurrenceDecider: decide(state, ScheduleNextOccurrence{id, now})
    ScheduleNextOccurrenceDecider->>ScheduleNextOccurrenceDecider: validate state value, check pending_occurrence_at, check completed
    ScheduleNextOccurrenceDecider->>Recurrence: TryFrom(stored schedule definition)
    Recurrence-->>ScheduleNextOccurrenceDecider: Recurrence or RecurrenceError
    ScheduleNextOccurrenceDecider->>Recurrence: plan_next(at_or_after last_occurrence_at - grace)
    Recurrence-->>ScheduleNextOccurrenceDecider: Occurrence{at} or Exhausted
    alt Occurrence found
      ScheduleNextOccurrenceDecider-->>Processor: emit ScheduleOccurrenceScheduled{sequence++, occurrence_at, scheduled_at=now}
    else Exhausted
      ScheduleNextOccurrenceDecider-->>Processor: emit ScheduleCompleted{last_occurrence_sequence}
    end
    Processor->>StateEvolve: evolve(state, emitted event)
    StateEvolve-->>Processor: updated State{pending_occurrence_at set or completed=true}
  end

  rect rgba(144, 238, 144, 0.5)
    note over Processor,StateEvolve: Record occurrence
    Processor->>ScheduleNextOccurrenceDecider: decide(state, RecordScheduleOccurrence{id, occurrence_at, recorded_at})
    ScheduleNextOccurrenceDecider->>ScheduleNextOccurrenceDecider: guard duplicate, enforce pending match, advance sequence
    ScheduleNextOccurrenceDecider-->>Processor: emit ScheduleOccurrenceRecorded
    ScheduleNextOccurrenceDecider->>Recurrence: plan_next(after occurrence_at)
    Recurrence-->>ScheduleNextOccurrenceDecider: Occurrence or Exhausted
    ScheduleNextOccurrenceDecider-->>Processor: emit ScheduleOccurrenceScheduled or ScheduleCompleted
    Processor->>StateEvolve: evolve(state, events)
    StateEvolve-->>Processor: updated State{last_occurrence advanced, pending cleared or set}
  end
Loading

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~120 minutes

Possibly related PRs

  • TrogonStack/trogonai#192: The main PR updates create_schedule.rs test fixtures to construct the expanded state_v1::State shape with new occurrence/recurrence fields, building directly on the CreateSchedule command and state-validation work from this PR.
  • TrogonStack/trogonai#193: The main PR updates PauseSchedule state handling and test assertions for the newly expanded occurrence fields and paused/pending behavior, which directly overlaps with the pause_schedule command and SchedulePaused event emission introduced in this PR.
  • TrogonStack/trogonai#209: The main PR extends processor/execution/reconciliation/recorded_events.rs to treat occurrence lifecycle events as non-reconciling, building directly on the persisted ScheduleEvent decoding and reconciliation layer added in this PR.

Poem

🐇 Hop, hop, the calendar ticks,
Each RRULE beat the scheduler picks!
last_occurrence_at hops ahead,
pending_occurrence waits in bed.
When recurrences are all exhausted, done—
ScheduleCompleted! The bunny won! 🎉

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 68.55% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat(scheduler): support occurrence lifecycle' accurately summarizes the main change: adding occurrence lifecycle support (planned, recorded, exhausted) to the scheduler component.
Description check ✅ Passed The description is directly related to the changeset, explaining why durable occurrence progress tracking is needed and how explicit lifecycle events enable reliable recovery across command boundaries.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch yordis/create-pr-v2

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@yordis
yordis force-pushed the yordis/create-pr-v2 branch from a81b957 to 74a107e Compare June 16, 2026 05:31
@github-actions

github-actions Bot commented Jun 16, 2026

Copy link
Copy Markdown

badge

Code Coverage Summary

Details
Filename                                                                              Stmts    Miss  Cover    Missing
----------------------------------------------------------------------------------  -------  ------  -------  ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
crates/trogon-service-config/src/lib.rs                                                  92       0  100.00%
crates/trogon-decider-nats/src/store.rs                                                 127      47  62.99%   35-160
crates/trogon-decider-nats/src/snapshot_store.rs                                        861      27  96.86%   208-210, 248-250, 361-367, 449, 585, 590, 686-688, 694-696, 730-731, 741-742, 761, 789-790
crates/trogon-decider-nats/src/stream_store.rs                                          659      18  97.27%   70-72, 245, 273-274, 277, 293-297, 464-465, 506, 519-523
crates/trogon-scheduler/src/processor/execution/execution_schedules/mod.rs              190       0  100.00%
crates/trogon-std/src/time/mock.rs                                                      125       0  100.00%
crates/trogon-std/src/time/system.rs                                                     31       0  100.00%
crates/acp-nats/src/nats/subjects/subscriptions/all_agent.rs                              9       0  100.00%
crates/acp-nats/src/nats/subjects/subscriptions/prompt_wildcard.rs                        9       0  100.00%
crates/acp-nats/src/nats/subjects/subscriptions/one_agent.rs                             15       0  100.00%
crates/acp-nats/src/nats/subjects/subscriptions/all_session.rs                            9       0  100.00%
crates/acp-nats/src/nats/subjects/subscriptions/global_all.rs                             9       0  100.00%
crates/acp-nats/src/nats/subjects/subscriptions/one_client.rs                            15       0  100.00%
crates/acp-nats/src/nats/subjects/subscriptions/all_client.rs                             9       0  100.00%
crates/acp-nats/src/nats/subjects/subscriptions/one_session.rs                           12       0  100.00%
crates/acp-nats/src/nats/subjects/subscriptions/all_agent_ext.rs                          9       0  100.00%
crates/acp-nats-stdio/src/main.rs                                                       135      25  81.48%   65, 113-120, 126-128, 145, 174-193
crates/acp-nats-stdio/src/config.rs                                                      66       0  100.00%
crates/trogonai-proto/src/convert.rs                                                    120       0  100.00%
crates/trogonai-proto/src/codec.rs                                                       16       0  100.00%
crates/trogon-decider-runtime/src/headers/header_value.rs                                34       0  100.00%
crates/trogon-decider-runtime/src/headers/header_name.rs                                 28       0  100.00%
crates/trogon-decider-runtime/src/headers/header_map.rs                                  54       3  94.44%   20-22
crates/trogon-decider-runtime/src/headers/mod.rs                                         74       0  100.00%
crates/mcp-nats/src/nats/mod.rs                                                          99       0  100.00%
crates/mcp-nats/src/nats/parsing.rs                                                     191       0  100.00%
crates/mcp-nats/src/nats/subjects/server/read_resource.rs                                12       0  100.00%
crates/mcp-nats/src/nats/subjects/server/list_prompts.rs                                 12       0  100.00%
crates/mcp-nats/src/nats/subjects/server/set_logging_level.rs                            12       0  100.00%
crates/mcp-nats/src/nats/subjects/server/subscribe_resource.rs                           12       0  100.00%
crates/mcp-nats/src/nats/subjects/server/resource_list_changed.rs                        12       0  100.00%
crates/mcp-nats/src/nats/subjects/server/cancel_task.rs                                  12       0  100.00%
crates/mcp-nats/src/nats/subjects/server/tool_list_changed.rs                            12       0  100.00%
crates/mcp-nats/src/nats/subjects/server/unsubscribe_resource.rs                         12       0  100.00%
crates/mcp-nats/src/nats/subjects/server/list_tasks.rs                                   12       0  100.00%
crates/mcp-nats/src/nats/subjects/server/get_prompt.rs                                   12       0  100.00%
crates/mcp-nats/src/nats/subjects/server/get_task.rs                                     12       0  100.00%
crates/mcp-nats/src/nats/subjects/server/initialize.rs                                   12       0  100.00%
crates/mcp-nats/src/nats/subjects/server/list_resources.rs                               12       0  100.00%
crates/mcp-nats/src/nats/subjects/server/list_tools.rs                                   12       0  100.00%
crates/mcp-nats/src/nats/subjects/server/get_task_result.rs                              12       0  100.00%
crates/mcp-nats/src/nats/subjects/server/list_resource_templates.rs                      12       0  100.00%
crates/mcp-nats/src/nats/subjects/server/ping.rs                                          9       0  100.00%
crates/mcp-nats/src/nats/subjects/server/cancelled.rs                                    12       0  100.00%
crates/mcp-nats/src/nats/subjects/server/progress.rs                                     12       0  100.00%
crates/mcp-nats/src/nats/subjects/server/elicitation_completed.rs                        12       0  100.00%
crates/mcp-nats/src/nats/subjects/server/resource_updated.rs                             12       0  100.00%
crates/mcp-nats/src/nats/subjects/server/call_tool.rs                                    12       0  100.00%
crates/mcp-nats/src/nats/subjects/server/complete.rs                                     12       0  100.00%
crates/mcp-nats/src/nats/subjects/server/logging_message.rs                              12       0  100.00%
crates/mcp-nats/src/nats/subjects/server/prompt_list_changed.rs                          12       0  100.00%
crates/trogon-gateway/src/source_status.rs                                               24       0  100.00%
crates/trogon-gateway/src/source_integration_id.rs                                       55       2  96.36%   58, 60
crates/trogon-gateway/src/source_plugin.rs                                              269       3  98.88%   82, 141-142
crates/trogon-gateway/src/main.rs                                                       111       0  100.00%
crates/trogon-gateway/src/http.rs                                                       145       0  100.00%
crates/trogon-gateway/src/streams.rs                                                    129       0  100.00%
crates/trogon-gateway/src/config.rs                                                    2591      42  98.38%   84, 668, 671, 831, 888, 971, 974, 977, 981, 1065-1072, 1149, 1152, 1155, 1160, 1218, 1221, 1224, 1303, 1306, 1309, 1313, 1377, 1380, 1383, 1446, 1449, 1452, 1457, 1532, 1535, 1538, 1543, 1601, 1604, 1607, 1820-1822
crates/trogon-scheduler/src/commands/schedule_next_occurrence.rs                        313       3  99.04%   275, 311, 335
crates/trogon-scheduler/src/commands/state.rs                                           472       0  100.00%
crates/trogon-scheduler/src/commands/snapshot.rs                                          4       0  100.00%
crates/trogon-scheduler/src/commands/remove_schedule.rs                                 194       0  100.00%
crates/trogon-scheduler/src/commands/record_schedule_occurrence.rs                      397       5  98.74%   182, 386, 403, 415, 432
crates/trogon-scheduler/src/commands/pause_schedule.rs                                  178       0  100.00%
crates/trogon-scheduler/src/commands/create_schedule.rs                                 202       0  100.00%
crates/trogon-scheduler/src/commands/resume_schedule.rs                                 211       0  100.00%
crates/trogon-gateway/src/source/sentry/signature.rs                                     42       0  100.00%
crates/trogon-gateway/src/source/sentry/sentry_client_secret.rs                          17       0  100.00%
crates/trogon-gateway/src/source/sentry/server.rs                                       308       0  100.00%
crates/mcp-nats/src/nats/subjects/client/roots_list_changed.rs                           12       0  100.00%
crates/mcp-nats/src/nats/subjects/client/list_roots.rs                                   12       0  100.00%
crates/mcp-nats/src/nats/subjects/client/ping.rs                                          9       0  100.00%
crates/mcp-nats/src/nats/subjects/client/initialized.rs                                  12       0  100.00%
crates/mcp-nats/src/nats/subjects/client/create_message.rs                               12       0  100.00%
crates/mcp-nats/src/nats/subjects/client/cancelled.rs                                    12       0  100.00%
crates/mcp-nats/src/nats/subjects/client/progress.rs                                     12       0  100.00%
crates/mcp-nats/src/nats/subjects/client/create_elicitation.rs                           12       0  100.00%
crates/trogon-gateway/src/source/notion/verification_token.rs                           220       0  100.00%
crates/trogon-gateway/src/source/notion/server.rs                                       310       4  98.71%   115-116, 135-136
crates/trogon-gateway/src/source/notion/notion_verification_token.rs                     17       0  100.00%
crates/trogon-gateway/src/source/notion/notion_event_type.rs                             46       3  93.48%   50-52
crates/trogon-gateway/src/source/notion/signature.rs                                     45       0  100.00%
crates/trogon-scheduler/src/telemetry/metrics.rs                                         52       0  100.00%
crates/trogon-scheduler/src/telemetry/trace.rs                                           41       0  100.00%
crates/mcp-nats-stdio/src/config.rs                                                     149       0  100.00%
crates/mcp-nats-stdio/src/main.rs                                                       204       0  100.00%
crates/trogon-std/src/duration.rs                                                        42       0  100.00%
crates/trogon-std/src/json.rs                                                            30       0  100.00%
crates/trogon-std/src/secret_string.rs                                                   32       0  100.00%
crates/trogon-std/src/args.rs                                                            19       9  52.63%   11-28
crates/trogon-std/src/signal.rs                                                          26      12  53.85%   6-11, 18-25, 34
crates/trogon-std/src/http.rs                                                            19       0  100.00%
crates/trogon-std/src/uuid.rs                                                             7       0  100.00%
crates/acp-nats/src/jetstream/provision.rs                                               52       0  100.00%
crates/acp-nats/src/jetstream/ext_policy.rs                                              26       0  100.00%
crates/acp-nats/src/jetstream/streams.rs                                                163       4  97.55%   206-208, 218
crates/acp-nats/src/jetstream/consumers.rs                                               91       0  100.00%
crates/trogon-scheduler/src/commands/domain/schedule_event_delivery.rs                   25       0  100.00%
crates/trogon-scheduler/src/commands/domain/schedule_event_schedule.rs                   83       0  100.00%
crates/trogon-scheduler/src/commands/domain/message.rs                                  219       0  100.00%
crates/trogon-scheduler/src/commands/domain/schedule_event_sampling_source.rs            20       0  100.00%
crates/trogon-scheduler/src/commands/domain/schedule_event_status.rs                     10       0  100.00%
crates/trogon-scheduler/src/commands/domain/schedule.rs                                 638       0  100.00%
crates/trogon-scheduler/src/commands/domain/recurrence.rs                               179       1  99.44%   99
crates/trogon-scheduler/src/commands/domain/schedule_id.rs                               81       0  100.00%
crates/trogon-scheduler/src/commands/domain/schedule_occurrence_sequence.rs              30       0  100.00%
crates/acp-nats/src/in_flight_slot_guard.rs                                              32       0  100.00%
crates/acp-nats/src/config.rs                                                           203       0  100.00%
crates/acp-nats/src/ext_method_name.rs                                                   65       0  100.00%
crates/acp-nats/src/client_proxy.rs                                                     181       0  100.00%
crates/acp-nats/src/jsonrpc.rs                                                            6       0  100.00%
crates/acp-nats/src/lib.rs                                                               69       0  100.00%
crates/acp-nats/src/pending_prompt_waiters.rs                                           131       0  100.00%
crates/acp-nats/src/acp_prefix.rs                                                        46       0  100.00%
crates/acp-nats/src/req_id.rs                                                            39       0  100.00%
crates/acp-nats/src/session_id.rs                                                        68       0  100.00%
crates/acp-nats/src/error.rs                                                             82       0  100.00%
crates/trogon-gateway/src/source/twitter/config.rs                                       17       0  100.00%
crates/trogon-gateway/src/source/twitter/signature.rs                                    58       0  100.00%
crates/trogon-gateway/src/source/twitter/server.rs                                      525       0  100.00%
crates/trogon-std/src/env/in_memory.rs                                                   73       0  100.00%
crates/trogon-std/src/env/system.rs                                                      17       0  100.00%
crates/trogon-gateway/src/source/telegram/registration.rs                               313       0  100.00%
crates/trogon-gateway/src/source/telegram/server.rs                                     339       0  100.00%
crates/trogon-gateway/src/source/telegram/signature.rs                                   27       0  100.00%
crates/trogon-gateway/src/source/telegram/config.rs                                      89       0  100.00%
crates/trogon-nats/src/telemetry/messaging.rs                                            82       0  100.00%
crates/trogon-decider/src/lib.rs                                                        138       0  100.00%
crates/trogon-decider/src/decision.rs                                                    27       0  100.00%
crates/trogon-decider/src/act.rs                                                         62       0  100.00%
crates/trogon-decider/src/events.rs                                                      49       0  100.00%
crates/trogon-decider/src/testing.rs                                                    654       0  100.00%
crates/acp-nats/src/nats/subjects/responses/prompt_response.rs                           27       0  100.00%
crates/acp-nats/src/nats/subjects/responses/update.rs                                    27       0  100.00%
crates/acp-nats/src/nats/subjects/responses/ext_ready.rs                                 12       0  100.00%
crates/acp-nats/src/nats/subjects/responses/response.rs                                  20       0  100.00%
crates/acp-nats/src/nats/subjects/responses/cancelled.rs                                 15       0  100.00%
crates/mcp-nats/src/mcp_prefix.rs                                                        34       0  100.00%
crates/mcp-nats/src/transport.rs                                                        698       0  100.00%
crates/mcp-nats/src/server.rs                                                            31       0  100.00%
crates/mcp-nats/src/jsonrpc.rs                                                           22       0  100.00%
crates/mcp-nats/src/config.rs                                                           110       0  100.00%
crates/mcp-nats/src/mcp_peer_id.rs                                                       31       0  100.00%
crates/mcp-nats/src/client.rs                                                            31       0  100.00%
crates/trogon-nats/src/jetstream/publish.rs                                              64       0  100.00%
crates/trogon-nats/src/jetstream/mocks.rs                                              1686       1  99.94%   505
crates/trogon-nats/src/jetstream/claim_check.rs                                         405      10  97.53%   45-47, 116-122
crates/trogon-nats/src/jetstream/create_conflicts.rs                                     24       0  100.00%
crates/trogon-nats/src/jetstream/stream_max_age.rs                                       18       0  100.00%
crates/trogon-nats/src/jetstream/traits.rs                                               46      40  13.04%   181-251
crates/trogon-gateway/src/source/slack/server.rs                                        854       0  100.00%
crates/trogon-gateway/src/source/slack/config.rs                                         58       0  100.00%
crates/trogon-gateway/src/source/slack/socket_mode.rs                                   716       0  100.00%
crates/trogon-gateway/src/source/slack/signature.rs                                      66       0  100.00%
crates/trogon-scheduler/src/processor/execution/worker/processor.rs                     913      10  98.90%   264, 324, 435-436, 442, 484-487, 579
crates/trogon-scheduler/src/processor/execution/worker/dispatcher.rs                    911      11  98.79%   183, 187-188, 246, 578, 917-923
crates/trogon-scheduler/src/processor/execution/worker/consumer.rs                      203       0  100.00%
crates/trogon-scheduler/src/processor/execution/worker/testkit.rs                       278       0  100.00%
crates/trogon-scheduler/src/processor/execution/checkpoints/store.rs                    407      17  95.82%   102, 120, 124, 132, 224-230, 236, 279-283
crates/trogon-scheduler/src/processor/execution/checkpoints/failure.rs                   38       0  100.00%
crates/trogon-scheduler/src/processor/execution/checkpoints/codec.rs                    641      68  89.39%   134, 140, 149, 192, 208-210, 227, 244-246, 415, 417-419, 453-464, 480-481, 486-487, 493-494, 507-508, 513-514, 519-523, 529-530, 545-546, 551-552, 558-559, 566-567, 572-573, 585-589, 595-597, 612-618, 626, 631-633, 643, 648
crates/trogon-scheduler/src/processor/execution/checkpoints/record.rs                     6       0  100.00%
crates/trogon-gateway/src/source/microsoft_graph/server.rs                              325       0  100.00%
crates/trogon-gateway/src/source/microsoft_graph/client_state.rs                         30       0  100.00%
crates/acp-nats-server/src/main.rs                                                      896      10  98.88%   100, 231-238, 437
crates/acp-nats-server/src/acp_connection_id.rs                                          37       0  100.00%
crates/acp-nats-server/src/connection.rs                                                182      36  80.22%   95-102, 107-122, 138, 140-141, 146, 155-156, 161, 165, 169, 172, 180, 184, 187, 190-194, 232
crates/acp-nats-server/src/config.rs                                                    126       3  97.62%   41-43
crates/acp-nats-server/src/transport.rs                                                1915     106  94.46%   253, 512, 530, 557, 611, 616, 635, 647, 766, 789-791, 843, 860-863, 958-961, 1035, 1038, 1041, 1050, 1054, 1057, 1060-1063, 1082, 1114-1117, 1125-1130, 1142-1146, 1150-1159, 1171-1172, 1190-1191, 1201, 1217-1221, 1249-1255, 1275-1277, 1282-1286, 1289-1294, 1311, 1313-1314, 1396-1397, 1409-1410, 1430-1431, 1483-1499, 2204, 2248, 2301, 2357, 2370
crates/trogon-decider-runtime/src/snapshot/codec/snapshot_encode_error.rs                36       0  100.00%
crates/trogon-decider-runtime/src/snapshot/codec/snapshot_envelope_decode_error.rs       28       0  100.00%
crates/trogon-decider-runtime/src/snapshot/codec/encoded_snapshot.rs                    117       0  100.00%
crates/trogon-decider-runtime/src/snapshot/codec/snapshot_payload_decode.rs               3       0  100.00%
crates/trogon-decider-runtime/src/snapshot/codec/snapshot_decode_error.rs                49       0  100.00%
crates/trogon-decider-runtime/src/snapshot/codec/snapshot_envelope_encode_error.rs       14       0  100.00%
crates/trogon-scheduler/src/processor/execution/reconciliation/schedule_key.rs           67       0  100.00%
crates/trogon-scheduler/src/processor/execution/reconciliation/recorded_events.rs       596      13  97.82%   198-203, 258, 264, 270, 303, 313, 331, 415, 500, 508, 785, 928
crates/trogon-scheduler/src/processor/execution/reconciliation/reconcile.rs             502       0  100.00%
crates/trogon-scheduler/src/processor/execution/reconciliation/request.rs               326       3  99.08%   100, 115, 121
crates/trogon-scheduler/src/processor/execution/reconciliation/schedule_subject.rs       48       0  100.00%
crates/trogon-scheduler/src/processor/execution/reconciliation/go_duration.rs            59       0  100.00%
crates/trogon-telemetry/src/service_name.rs                                              44       0  100.00%
crates/trogon-telemetry/src/lib.rs                                                      208      24  88.46%   54, 118, 123, 128, 138-139, 145-163, 199, 202, 205, 211
crates/trogon-telemetry/src/trace.rs                                                     23       1  95.65%   24
crates/trogon-telemetry/src/metric.rs                                                    26       1  96.15%   30
crates/trogon-telemetry/src/resource_attribute.rs                                        23       0  100.00%
crates/trogon-telemetry/src/log.rs                                                       70       1  98.57%   35
crates/acp-nats/src/client/ext_session_prompt_response.rs                               135       0  100.00%
crates/acp-nats/src/client/request_permission.rs                                        298       0  100.00%
crates/acp-nats/src/client/terminal_create.rs                                           264       0  100.00%
crates/acp-nats/src/client/terminal_release.rs                                          335       0  100.00%
crates/acp-nats/src/client/terminal_kill.rs                                             278       0  100.00%
crates/acp-nats/src/client/terminal_wait_for_exit.rs                                    364       0  100.00%
crates/acp-nats/src/client/terminal_output.rs                                           206       0  100.00%
crates/acp-nats/src/client/mod.rs                                                      2851       0  100.00%
crates/acp-nats/src/client/ext.rs                                                       296       8  97.30%   146-155, 172-181
crates/acp-nats/src/client/fs_write_text_file.rs                                        408       0  100.00%
crates/acp-nats/src/client/session_update.rs                                             55       0  100.00%
crates/acp-nats/src/client/fs_read_text_file.rs                                         346       0  100.00%
crates/acp-nats/src/client/rpc_reply.rs                                                  64       0  100.00%
crates/trogon-decider-runtime/src/event/event_identity.rs                                 3       0  100.00%
crates/trogon-decider-runtime/src/event/stream_event.rs                                   8       0  100.00%
crates/trogon-decider-runtime/src/event/event_id.rs                                      32       0  100.00%
crates/trogon-decider-runtime/src/event/mod.rs                                          170       0  100.00%
crates/trogon-std/src/dirs/system.rs                                                     71       0  100.00%
crates/trogon-std/src/dirs/fixed.rs                                                      80       0  100.00%
crates/acp-nats/src/nats/subjects/global/session_list.rs                                  6       0  100.00%
crates/acp-nats/src/nats/subjects/global/authenticate.rs                                  6       0  100.00%
crates/acp-nats/src/nats/subjects/global/session_new.rs                                   6       0  100.00%
crates/acp-nats/src/nats/subjects/global/ext.rs                                           9       0  100.00%
crates/acp-nats/src/nats/subjects/global/ext_notify.rs                                    9       0  100.00%
crates/acp-nats/src/nats/subjects/global/initialize.rs                                    6       0  100.00%
crates/acp-nats/src/nats/subjects/global/logout.rs                                        6       0  100.00%
crates/trogon-gateway/src/source/standard_webhooks.rs                                   138       0  100.00%
crates/trogon-std/src/telemetry/http.rs                                                 217       0  100.00%
crates/trogonai-proto/src/scheduler/schedules/codec.rs                                  377       0  100.00%
crates/trogon-decider-runtime/src/execution.rs                                         1432       0  100.00%
crates/acp-nats/src/telemetry/metrics.rs                                                 53       0  100.00%
crates/mcp-nats/src/telemetry/transport.rs                                                6       0  100.00%
crates/mcp-nats/src/nats/subjects/mod.rs                                                 89       0  100.00%
crates/acp-nats/src/nats/subjects/mod.rs                                                362       0  100.00%
crates/acp-nats/src/nats/subjects/stream.rs                                              56       0  100.00%
crates/trogon-std/src/fs/mem.rs                                                         216      10  95.37%   61-63, 77-79, 132-134, 157
crates/trogon-std/src/fs/system.rs                                                       92       0  100.00%
crates/trogon-nats/src/subject_token_violation.rs                                        11       0  100.00%
crates/trogon-nats/src/token.rs                                                           6       0  100.00%
crates/trogon-nats/src/nats_token.rs                                                    157       0  100.00%
crates/trogon-nats/src/connect.rs                                                        82       6  92.68%   41-46
crates/trogon-nats/src/auth.rs                                                          114       0  100.00%
crates/trogon-nats/src/client.rs                                                         22      22  0.00%    50-86
crates/trogon-nats/src/mocks.rs                                                         314       0  100.00%
crates/trogon-nats/src/messaging.rs                                                     534       2  99.63%   144, 154
crates/acp-nats/src/nats/subjects/client_ops/session_request_permission.rs               12       0  100.00%
crates/acp-nats/src/nats/subjects/client_ops/terminal_create.rs                          12       0  100.00%
crates/acp-nats/src/nats/subjects/client_ops/terminal_release.rs                         12       0  100.00%
crates/acp-nats/src/nats/subjects/client_ops/fs_write_text_file.rs                       12       0  100.00%
crates/acp-nats/src/nats/subjects/client_ops/terminal_kill.rs                            12       0  100.00%
crates/acp-nats/src/nats/subjects/client_ops/fs_read_text_file.rs                        12       0  100.00%
crates/acp-nats/src/nats/subjects/client_ops/terminal_wait_for_exit.rs                   12       0  100.00%
crates/acp-nats/src/nats/subjects/client_ops/terminal_output.rs                          12       0  100.00%
crates/acp-nats/src/nats/subjects/client_ops/session_update.rs                           12       0  100.00%
crates/trogon-nats/src/lease/lease_key.rs                                                19       0  100.00%
crates/trogon-nats/src/lease/acquire.rs                                                   5       5  0.00%    9-14
crates/trogon-nats/src/lease/nats_kv_lease_config.rs                                     26       0  100.00%
crates/trogon-nats/src/lease/lease_timing.rs                                             15       0  100.00%
crates/trogon-nats/src/lease/provision.rs                                               187      10  94.65%   82-92
crates/trogon-nats/src/lease/release.rs                                                   5       5  0.00%    8-12
crates/trogon-nats/src/lease/renew.rs                                                   246      19  92.28%   23-29, 48-59
crates/trogon-nats/src/lease/mod.rs                                                     523      13  97.51%   113-126
crates/trogon-nats/src/lease/ttl.rs                                                      68       0  100.00%
crates/trogon-nats/src/lease/lease_bucket.rs                                             19       0  100.00%
crates/trogon-nats/src/lease/renew_interval.rs                                           57       0  100.00%
crates/trogon-decider-runtime/src/snapshot/mod.rs                                         3       0  100.00%
crates/trogon-decider-runtime/src/snapshot/read_snapshot.rs                              11       0  100.00%
crates/trogon-decider-runtime/src/snapshot/snapshot_type.rs                              73       0  100.00%
crates/trogon-decider-runtime/src/stream/stream_position.rs                              26       0  100.00%
crates/trogon-decider-runtime/src/stream/mod.rs                                          38       0  100.00%
crates/trogon-decider-runtime/src/stream/read_stream.rs                                   7       0  100.00%
crates/trogon-decider-runtime/src/stream/append_stream.rs                                 5       0  100.00%
crates/trogon-decider-runtime/src/event/codec/event_decode.rs                            29       0  100.00%
crates/trogon-decider-runtime/src/event/codec/event_payload_error.rs                     36       0  100.00%
crates/acp-nats/src/nats/subjects/commands/resume.rs                                     15       0  100.00%
crates/acp-nats/src/nats/subjects/commands/cancel.rs                                     15       0  100.00%
crates/acp-nats/src/nats/subjects/commands/close.rs                                      15       0  100.00%
crates/acp-nats/src/nats/subjects/commands/load.rs                                       15       0  100.00%
crates/acp-nats/src/nats/subjects/commands/prompt.rs                                     15       0  100.00%
crates/acp-nats/src/nats/subjects/commands/set_mode.rs                                   15       0  100.00%
crates/acp-nats/src/nats/subjects/commands/set_config_option.rs                          15       0  100.00%
crates/acp-nats/src/nats/subjects/commands/set_model.rs                                  15       0  100.00%
crates/acp-nats/src/nats/subjects/commands/fork.rs                                       15       0  100.00%
crates/mcp-nats-server/src/allowed_host.rs                                               87       0  100.00%
crates/mcp-nats-server/src/config.rs                                                    257       0  100.00%
crates/mcp-nats-server/src/main.rs                                                      357     127  64.43%   149-166, 202-204, 214, 220-221, 228-231, 255-257, 261-270, 292-305, 310-358, 489, 492, 500-542
crates/acp-nats/src/agent/bridge.rs                                                     123       4  96.75%   108-111
crates/acp-nats/src/agent/fork_session.rs                                                94       0  100.00%
crates/acp-nats/src/agent/authenticate.rs                                                49       0  100.00%
crates/acp-nats/src/agent/logout.rs                                                      49       0  100.00%
crates/acp-nats/src/agent/resume_session.rs                                              90       0  100.00%
crates/acp-nats/src/agent/test_support.rs                                               267       0  100.00%
crates/acp-nats/src/agent/close_session.rs                                               63       0  100.00%
crates/acp-nats/src/agent/mod.rs                                                         65       0  100.00%
crates/acp-nats/src/agent/prompt.rs                                                     471       0  100.00%
crates/acp-nats/src/agent/set_session_mode.rs                                            67       0  100.00%
crates/acp-nats/src/agent/js_request.rs                                                 283       0  100.00%
crates/acp-nats/src/agent/list_sessions.rs                                               47       0  100.00%
crates/acp-nats/src/agent/load_session.rs                                                89       0  100.00%
crates/acp-nats/src/agent/set_session_config_option.rs                                   67       0  100.00%
crates/acp-nats/src/agent/ext_notification.rs                                            82       0  100.00%
crates/acp-nats/src/agent/initialize.rs                                                  79       0  100.00%
crates/acp-nats/src/agent/new_session.rs                                                 82       0  100.00%
crates/acp-nats/src/agent/ext_method.rs                                                  82       0  100.00%
crates/acp-nats/src/agent/cancel.rs                                                     101       0  100.00%
crates/acp-nats/src/agent/set_session_model.rs                                           67       0  100.00%
crates/trogon-gateway/src/source/linear/server.rs                                       386       0  100.00%
crates/trogon-gateway/src/source/linear/config.rs                                        17       0  100.00%
crates/trogon-gateway/src/source/linear/signature.rs                                     54       1  98.15%   16
crates/trogon-gateway/src/source/github/server.rs                                       328       0  100.00%
crates/trogon-gateway/src/source/github/signature.rs                                     50       0  100.00%
crates/trogon-gateway/src/source/github/config.rs                                        17       0  100.00%
crates/trogon-gateway/src/source/incidentio/incidentio_event_type.rs                     62       0  100.00%
crates/trogon-gateway/src/source/incidentio/server.rs                                   343       0  100.00%
crates/trogon-gateway/src/source/incidentio/signature.rs                                206       0  100.00%
crates/trogon-gateway/src/source/incidentio/incidentio_signing_secret.rs                 56       0  100.00%
crates/trogon-gateway/src/source/incidentio/config.rs                                    16       0  100.00%
crates/trogon-gateway/src/source/gitlab/gitlab_signing_token.rs                          61       0  100.00%
crates/trogon-gateway/src/source/gitlab/signature.rs                                    165       0  100.00%
crates/trogon-gateway/src/source/gitlab/server.rs                                       460       0  100.00%
crates/acp-nats/src/nats/extensions.rs                                                    3       0  100.00%
crates/acp-nats/src/nats/parsing.rs                                                     278       1  99.64%   151
crates/acp-nats/src/nats/mod.rs                                                          23       0  100.00%
crates/mcp-nats/src/nats/subjects/subscriptions/one_client.rs                             9       0  100.00%
crates/mcp-nats/src/nats/subjects/subscriptions/all_client.rs                             6       0  100.00%
crates/mcp-nats/src/nats/subjects/subscriptions/one_server.rs                             9       0  100.00%
crates/mcp-nats/src/nats/subjects/subscriptions/all_server.rs                             6       0  100.00%
crates/trogon-gateway/src/source/discord/config.rs                                      105       0  100.00%
crates/trogon-gateway/src/source/discord/gateway.rs                                     426       1  99.77%   137
crates/acp-nats-agent/src/connection.rs                                                1260       1  99.92%   590
TOTAL                                                                                 49055     798  98.37%

Diff against main

Filename                                                                             Stmts    Miss  Cover
---------------------------------------------------------------------------------  -------  ------  --------
crates/trogon-scheduler/src/commands/schedule_next_occurrence.rs                      +313      +3  +99.04%
crates/trogon-scheduler/src/commands/state.rs                                         +284       0  +100.00%
crates/trogon-scheduler/src/commands/remove_schedule.rs                                +25       0  +100.00%
crates/trogon-scheduler/src/commands/record_schedule_occurrence.rs                    +397      +5  +98.74%
crates/trogon-scheduler/src/commands/pause_schedule.rs                                 +20       0  +100.00%
crates/trogon-scheduler/src/commands/create_schedule.rs                                +20       0  +100.00%
crates/trogon-scheduler/src/commands/resume_schedule.rs                                +46       0  +100.00%
crates/trogon-scheduler/src/commands/domain/recurrence.rs                             +179      +1  +99.44%
crates/trogon-scheduler/src/commands/domain/schedule_occurrence_sequence.rs            +30       0  +100.00%
crates/trogon-scheduler/src/processor/execution/worker/dispatcher.rs                     0      -1  +0.11%
crates/trogon-scheduler/src/processor/execution/reconciliation/recorded_events.rs      +31       0  +0.12%
crates/trogonai-proto/src/scheduler/schedules/codec.rs                                +129       0  +100.00%
TOTAL                                                                                +1474      +8  +0.03%

Results for commit: fe46982

Minimum allowed coverage is 95%

♻️ This comment has been updated with latest results

@yordis yordis added the rust:coverage-baseline-reset Relax Rust coverage gate to establish a new baseline label Jun 16, 2026
@yordis
yordis force-pushed the yordis/create-pr-v2 branch from 74a107e to fac5e38 Compare June 16, 2026 05:42
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
@yordis
yordis force-pushed the yordis/create-pr-v2 branch from fac5e38 to da2e793 Compare June 16, 2026 06:14
Comment thread rsworkspace/crates/trogon-scheduler/src/commands/state.rs

@coderabbitai coderabbitai 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.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@rsworkspace/crates/trogon-scheduler/src/commands/rrule.rs`:
- Around line 88-93: The RRuleCursor::AtOrAfter case on line 91 incorrectly
skips boundary occurrences because set.after() has exclusive semantics and only
returns dates strictly after the provided instant. Fix the AtOrAfter branch by
checking if the cursor instant itself is a valid occurrence first before falling
back to the next candidate from the after() call. This ensures that AtOrAfter
includes an occurrence exactly at the cursor instant, not just after it.
- Around line 45-47: The Expansion variant in the error enum is storing a String
message instead of preserving the typed error from the rrule crate, which
discards error context. Refactor the Expansion variant to store the actual
source error as a typed field (matching the pattern used by the Timestamp
variant) with the #[source] attribute, rather than converting it to a String via
to_string(). Update the error display message to reference the source error
appropriately, and modify the code that constructs this error to pass the typed
error directly instead of converting it to a String.

In
`@rsworkspace/crates/trogon-scheduler/src/commands/schedule_next_occurrence.rs`:
- Around line 105-127: Replace the saturating_add(1) call on last_sequence with
checked arithmetic that returns an error when overflow would occur, rather than
silently saturating to u64::MAX. When calling schedule_or_complete_event around
line 126, use checked_add instead of saturating_add and map any overflow
condition to a ScheduleNextOccurrenceError variant (you may need to add a new
error variant if one doesn't exist for sequence overflow). This ensures that
duplicate occurrence sequences cannot be emitted when the sequence number
reaches its maximum value.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b569e2cd-4913-4c2a-b04e-d240bed3b7d9

📥 Commits

Reviewing files that changed from the base of the PR and between 7bdcf72 and da2e793.

⛔ Files ignored due to path filters (13)
  • rsworkspace/crates/trogonai-proto/src/gen/trogonai.scheduler.schedules.state.v1.state.__view.rs is excluded by !**/gen/**
  • rsworkspace/crates/trogonai-proto/src/gen/trogonai.scheduler.schedules.state.v1.state.rs is excluded by !**/gen/**
  • rsworkspace/crates/trogonai-proto/src/gen/trogonai.scheduler.schedules.v1.events.__oneof.rs is excluded by !**/gen/**
  • rsworkspace/crates/trogonai-proto/src/gen/trogonai.scheduler.schedules.v1.events.__view.rs is excluded by !**/gen/**
  • rsworkspace/crates/trogonai-proto/src/gen/trogonai.scheduler.schedules.v1.events.__view_oneof.rs is excluded by !**/gen/**
  • rsworkspace/crates/trogonai-proto/src/gen/trogonai.scheduler.schedules.v1.events.rs is excluded by !**/gen/**
  • rsworkspace/crates/trogonai-proto/src/gen/trogonai.scheduler.schedules.v1.mod.rs is excluded by !**/gen/**
  • rsworkspace/crates/trogonai-proto/src/gen/trogonai.scheduler.schedules.v1.schedule_completed.__view.rs is excluded by !**/gen/**
  • rsworkspace/crates/trogonai-proto/src/gen/trogonai.scheduler.schedules.v1.schedule_completed.rs is excluded by !**/gen/**
  • rsworkspace/crates/trogonai-proto/src/gen/trogonai.scheduler.schedules.v1.schedule_occurrence_recorded.__view.rs is excluded by !**/gen/**
  • rsworkspace/crates/trogonai-proto/src/gen/trogonai.scheduler.schedules.v1.schedule_occurrence_recorded.rs is excluded by !**/gen/**
  • rsworkspace/crates/trogonai-proto/src/gen/trogonai.scheduler.schedules.v1.schedule_occurrence_scheduled.__view.rs is excluded by !**/gen/**
  • rsworkspace/crates/trogonai-proto/src/gen/trogonai.scheduler.schedules.v1.schedule_occurrence_scheduled.rs is excluded by !**/gen/**
📒 Files selected for processing (18)
  • proto/trogonai/scheduler/schedules/state/v1/state.proto
  • proto/trogonai/scheduler/schedules/v1/events.proto
  • proto/trogonai/scheduler/schedules/v1/schedule_completed.proto
  • proto/trogonai/scheduler/schedules/v1/schedule_occurrence_recorded.proto
  • proto/trogonai/scheduler/schedules/v1/schedule_occurrence_scheduled.proto
  • rsworkspace/crates/trogon-scheduler/src/commands/create_schedule.rs
  • rsworkspace/crates/trogon-scheduler/src/commands/domain/mod.rs
  • rsworkspace/crates/trogon-scheduler/src/commands/domain/schedule_occurrence_sequence.rs
  • rsworkspace/crates/trogon-scheduler/src/commands/mod.rs
  • rsworkspace/crates/trogon-scheduler/src/commands/pause_schedule.rs
  • rsworkspace/crates/trogon-scheduler/src/commands/record_schedule_occurrence.rs
  • rsworkspace/crates/trogon-scheduler/src/commands/remove_schedule.rs
  • rsworkspace/crates/trogon-scheduler/src/commands/resume_schedule.rs
  • rsworkspace/crates/trogon-scheduler/src/commands/rrule.rs
  • rsworkspace/crates/trogon-scheduler/src/commands/schedule_next_occurrence.rs
  • rsworkspace/crates/trogon-scheduler/src/commands/state.rs
  • rsworkspace/crates/trogon-scheduler/src/processor/execution/reconciliation/recorded_events.rs
  • rsworkspace/crates/trogonai-proto/src/scheduler/schedules/codec.rs

Comment thread rsworkspace/crates/trogon-scheduler/src/commands/rrule.rs Outdated
Comment thread rsworkspace/crates/trogon-scheduler/src/commands/rrule.rs Outdated
Comment thread rsworkspace/crates/trogon-scheduler/src/commands/schedule_next_occurrence.rs Outdated
Boundary occurrences, durable sequence integrity, and recurrence error context must survive so armed wakeups and gapless sequencing stay trustworthy.

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
A finished recurrence must stay finished: without a durable completion marker an idle re-arm could append duplicate completion events and resurrect planning.

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
Comment thread rsworkspace/crates/trogon-scheduler/src/commands/record_schedule_occurrence.rs Outdated
A finished recurrence is finished regardless of pause state; deferring completion until resume would leave a done schedule durably marked incomplete.

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>

@cursor cursor 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.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit c8afffc. Configure here.

Comment thread rsworkspace/crates/trogon-scheduler/src/commands/resume_schedule.rs
yordis added 2 commits June 16, 2026 23:38
Recurrence is domain: keeping expansion and the next-step decision in the aggregate, with proto event translation confined to the command boundary, keeps the deciders thin and the domain free of wire types.

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
An exhausted schedule is terminal until re-created; resuming it would re-enable delivery downstream for a schedule that can never fire again.

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
@yordis
yordis merged commit 9148524 into main Jun 17, 2026
7 checks passed
@yordis
yordis deleted the yordis/create-pr-v2 branch June 17, 2026 03:52
yordis added a commit that referenced this pull request Jun 18, 2026
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rust:coverage-baseline-reset Relax Rust coverage gate to establish a new baseline

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant