Skip to content

feat(scheduler): support schedule definition history - #183

Merged
yordis merged 1 commit into
mainfrom
yordis/refactor-event-at-by
May 28, 2026
Merged

feat(scheduler): support schedule definition history#183
yordis merged 1 commit into
mainfrom
yordis/refactor-event-at-by

Conversation

@yordis

@yordis yordis commented May 27, 2026

Copy link
Copy Markdown
Member
  • Preserve schedule lifecycle decisions as replayable domain history without mixing delivery records into command-state streams.
  • Keep recorder-assigned time and caller context on the event envelope so scheduler payloads remain focused on business facts.

@cursor

cursor Bot commented May 27, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
New public proto contracts and a breaking rename from ScheduleAdded to ScheduleCreated require coordinated codegen and consumers; scope is mostly schema/docs plus test strings, not runtime logic in this diff.

Overview
Introduces Buf configuration (buf.yaml, buf.lock) for the trogonai proto module and adds scheduler schedule definition protos under trogonai.scheduler.schedules.v1: scheduling strategies (Schedule with at/every/cron/RRULE), delivery (NATS subject, optional TTL and latest-from-subject sampling), static message payload/headers, lifecycle status, and domain events ScheduleCreated (full definition) plus SchedulePaused, ScheduleResumed, and ScheduleRemoved (lifecycle-only updates).

Architecture docs now state that recorded_at lives on the persisted event envelope, not in domain payloads. NATS stream-store tests were updated from ScheduleAdded to ScheduleCreated for the Trogon event type header.

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

@coderabbitai

coderabbitai Bot commented May 27, 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 48 minutes and 56 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ 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: e92a31dd-d0ba-48d7-9410-6d72b3dbe8c7

📥 Commits

Reviewing files that changed from the base of the PR and between ad539d4 and 3e9f209.

⛔ Files ignored due to path filters (1)
  • buf.lock is excluded by !**/*.lock
📒 Files selected for processing (11)
  • buf.yaml
  • docs/architecture/event-metadata.md
  • proto/trogonai/scheduler/schedules/v1/delivery.proto
  • proto/trogonai/scheduler/schedules/v1/message.proto
  • proto/trogonai/scheduler/schedules/v1/schedule.proto
  • proto/trogonai/scheduler/schedules/v1/schedule_created.proto
  • proto/trogonai/scheduler/schedules/v1/schedule_paused.proto
  • proto/trogonai/scheduler/schedules/v1/schedule_removed.proto
  • proto/trogonai/scheduler/schedules/v1/schedule_resumed.proto
  • proto/trogonai/scheduler/schedules/v1/schedule_status.proto
  • rsworkspace/crates/trogon-decider-nats/src/stream_store.rs

Walkthrough

This PR introduces a complete scheduler service protobuf schema suite, Buf v2 configuration for proto management, and a documentation clarification. It defines scheduling primitives (message templates, status states), four schedule trigger variants (at, every, cron, rrule), NATS delivery configuration with optional source sampling, and stream events for schedule creation and lifecycle transitions (paused, resumed, removed).

Changes

Scheduler Service Protobuf Schemas

Layer / File(s) Summary
Buf configuration and message primitives
buf.yaml, proto/trogonai/scheduler/schedules/v1/message.proto
Buf v2 config declares googleapis and trogon-proto dependencies, lint rules, and breaking-change policy. Message schema defines static payload structure with content and headers.
Schedule status lifecycle states
proto/trogonai/scheduler/schedules/v1/schedule_status.proto
ScheduleStatus oneof message supports Scheduled and Paused states to represent participation in future fire decisions.
Schedule variants contract
proto/trogonai/scheduler/schedules/v1/schedule.proto
Schedule oneof with four trigger strategies: At (timestamp), Every (duration), Cron (NATS expr + timezone), and RRule (RFC 5545 with timestamps, timezone, rdate/exdate lists).
Delivery configuration
proto/trogonai/scheduler/schedules/v1/delivery.proto
Delivery oneof containing NatsMessage with subject, optional TTL, and optional Source configuration for sampling latest payload at fire time.
ScheduleCreated stream message
proto/trogonai/scheduler/schedules/v1/schedule_created.proto
Composite event carrying schedule_id, status, schedule, delivery, and message in a single stream record.
Schedule lifecycle events
proto/trogonai/scheduler/schedules/v1/schedule_paused.proto, schedule_removed.proto, schedule_resumed.proto
Simple identity events for schedule state transitions, each carrying schedule_id to track affected schedule.

Event Envelope Metadata Documentation

Layer / File(s) Summary
Event metadata clarification
docs/architecture/event-metadata.md
Specifies recorder-assigned time is persisted as recorded_at on the event envelope, not on individual domain payloads.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

📋 A scheduler takes shape in proto,
With schedules that tick and flows that grow—
At, Every, Cron, and RRule's might,
Status, Delivery, Messages in flight,
And lifecycle events that softly go.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding protobuf definitions for schedule domain events (ScheduleCreated, SchedulePaused, ScheduleRemoved, ScheduleResumed) with supporting message types to preserve schedule lifecycle history.
Description check ✅ Passed The description is directly related to the changeset, explaining the intent to preserve schedule lifecycle decisions as domain history and keep recorder-assigned time on event envelopes, which aligns with the protobuf schema additions for schedule events.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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/refactor-event-at-by

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.

@github-actions

github-actions Bot commented May 27, 2026

Copy link
Copy Markdown

badge

Code Coverage Summary

Details
Filename                                                                              Stmts    Miss  Cover    Missing
----------------------------------------------------------------------------------  -------  ------  -------  ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
crates/trogon-nats/src/jetstream/claim_check.rs                                         346       0  100.00%
crates/trogon-nats/src/jetstream/create_conflicts.rs                                     24       0  100.00%
crates/trogon-nats/src/jetstream/publish.rs                                              64       0  100.00%
crates/trogon-nats/src/jetstream/mocks.rs                                              1637       7  99.57%   450, 824-826, 1003-1005
crates/trogon-nats/src/jetstream/stream_max_age.rs                                       18       0  100.00%
crates/trogon-nats/src/jetstream/traits.rs                                               40      40  0.00%    181-251
crates/acp-nats/src/nats/subjects/global/logout.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/initialize.rs                                    6       0  100.00%
crates/acp-nats/src/nats/subjects/global/session_list.rs                                  6       0  100.00%
crates/acp-nats/src/nats/subjects/global/ext_notify.rs                                    9       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/commands/cancel.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/resume.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/load.rs                                       15       0  100.00%
crates/acp-nats/src/nats/subjects/commands/fork.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/set_mode.rs                                   15       0  100.00%
crates/trogon-telemetry/src/log.rs                                                       68       1  98.53%   33
crates/trogon-telemetry/src/lib.rs                                                      197      23  88.32%   94, 99, 104, 114-115, 121-139, 175, 178, 181, 187
crates/trogon-telemetry/src/resource_attribute.rs                                        23       0  100.00%
crates/trogon-telemetry/src/metric.rs                                                    26       1  96.15%   29
crates/trogon-telemetry/src/service_name.rs                                              44       0  100.00%
crates/trogon-telemetry/src/trace.rs                                                     23       1  95.65%   22
crates/acp-nats/src/client/ext.rs                                                       308       8  97.40%   163-172, 189-198
crates/acp-nats/src/client/terminal_kill.rs                                             290       0  100.00%
crates/acp-nats/src/client/terminal_release.rs                                          347       0  100.00%
crates/acp-nats/src/client/terminal_create.rs                                           274       0  100.00%
crates/acp-nats/src/client/terminal_output.rs                                           206       0  100.00%
crates/acp-nats/src/client/request_permission.rs                                        308       0  100.00%
crates/acp-nats/src/client/fs_write_text_file.rs                                        418       0  100.00%
crates/acp-nats/src/client/fs_read_text_file.rs                                         356       0  100.00%
crates/acp-nats/src/client/mod.rs                                                      2851       0  100.00%
crates/acp-nats/src/client/rpc_reply.rs                                                  64       0  100.00%
crates/acp-nats/src/client/session_update.rs                                             55       0  100.00%
crates/acp-nats/src/client/terminal_wait_for_exit.rs                                    378       0  100.00%
crates/acp-nats/src/client/ext_session_prompt_response.rs                               135       0  100.00%
crates/trogon-gateway/src/source/incidentio/incidentio_event_type.rs                     62       0  100.00%
crates/trogon-gateway/src/source/incidentio/incidentio_signing_secret.rs                 67       0  100.00%
crates/trogon-gateway/src/source/incidentio/signature.rs                                206       0  100.00%
crates/trogon-gateway/src/source/incidentio/server.rs                                   343       0  100.00%
crates/trogon-gateway/src/source/incidentio/config.rs                                    16       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/mcp-nats/src/nats/subjects/client/roots_list_changed.rs                           12       0  100.00%
crates/mcp-nats/src/nats/subjects/client/initialized.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/list_roots.rs                                   12       0  100.00%
crates/mcp-nats/src/nats/subjects/client/create_message.rs                               12       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                                       311       0  100.00%
crates/trogon-gateway/src/source/sentry/signature.rs                                     54       0  100.00%
crates/acp-nats/src/jetstream/ext_policy.rs                                              26       0  100.00%
crates/acp-nats/src/jetstream/provision.rs                                               53       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/acp-nats/src/telemetry/metrics.rs                                                 53       0  100.00%
crates/acp-nats-server/src/transport.rs                                                1852     110  94.06%   277, 452, 536, 554, 581, 635, 640, 659, 671, 790, 813-815, 867, 884-887, 982-985, 1059, 1062, 1065, 1074, 1078, 1081, 1084-1087, 1106, 1138-1141, 1149-1154, 1166-1170, 1174-1183, 1195-1196, 1214-1215, 1225, 1241-1245, 1273-1279, 1290, 1293-1300, 1305-1309, 1312-1317, 1334, 1336-1337, 1419-1420, 1432-1433, 1453-1454, 1506-1522, 2218, 2261, 2313, 2368, 2380
crates/acp-nats-server/src/connection.rs                                                171      32  81.29%   76-83, 88-99, 115, 117-118, 123, 132-133, 138, 142, 146, 149, 157, 161, 164, 167-171, 207
crates/acp-nats-server/src/main.rs                                                      896      10  98.88%   100, 231-238, 437
crates/acp-nats-server/src/config.rs                                                    137       9  93.43%   41, 50-61
crates/acp-nats-server/src/acp_connection_id.rs                                          45       0  100.00%
crates/mcp-nats/src/nats/subjects/mod.rs                                                 89       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/subscribe_resource.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/complete.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/ping.rs                                          9       0  100.00%
crates/mcp-nats/src/nats/subjects/server/call_tool.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/prompt_list_changed.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/unsubscribe_resource.rs                         12       0  100.00%
crates/mcp-nats/src/nats/subjects/server/cancelled.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/get_task_result.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/get_task.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/list_tasks.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/progress.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/read_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/set_logging_level.rs                            12       0  100.00%
crates/mcp-nats/src/nats/subjects/server/logging_message.rs                              12       0  100.00%
crates/trogon-decider-runtime/src/stream/stream_position.rs                              29       0  100.00%
crates/trogon-decider-runtime/src/stream/append_stream.rs                                 5       0  100.00%
crates/trogon-decider-runtime/src/stream/read_stream.rs                                  10       0  100.00%
crates/trogon-decider-runtime/src/stream/mod.rs                                          38       0  100.00%
crates/trogon-gateway/src/source/discord/gateway.rs                                     426       1  99.77%   137
crates/trogon-gateway/src/source/discord/config.rs                                      108       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/trogon-gateway/src/source/gitlab/gitlab_signing_token.rs                          74       0  100.00%
crates/trogon-std/src/duration.rs                                                        45       0  100.00%
crates/trogon-std/src/uuid.rs                                                             7       0  100.00%
crates/trogon-std/src/signal.rs                                                          26      12  53.85%   6-11, 18-25, 34
crates/trogon-std/src/args.rs                                                            19       9  52.63%   11-28
crates/trogon-std/src/json.rs                                                            30       0  100.00%
crates/trogon-std/src/secret_string.rs                                                   35       0  100.00%
crates/trogon-std/src/http.rs                                                            19       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-std/src/time/system.rs                                                     31       0  100.00%
crates/trogon-std/src/time/mock.rs                                                      125       0  100.00%
crates/trogon-decider-runtime/src/snapshot/read_snapshot.rs                              11       0  100.00%
crates/trogon-decider-runtime/src/snapshot/mod.rs                                         3       0  100.00%
crates/mcp-nats/src/transport.rs                                                        722       0  100.00%
crates/mcp-nats/src/config.rs                                                           110       0  100.00%
crates/mcp-nats/src/jsonrpc.rs                                                           22       0  100.00%
crates/mcp-nats/src/mcp_peer_id.rs                                                       33       0  100.00%
crates/mcp-nats/src/server.rs                                                            31       0  100.00%
crates/mcp-nats/src/mcp_prefix.rs                                                        36       0  100.00%
crates/mcp-nats/src/client.rs                                                            31       0  100.00%
crates/trogon-decider-nats/src/stream_store.rs                                          725      84  88.41%   70-213, 240-258, 301, 329-330, 333, 349-353, 519-520, 561, 574-578
crates/trogon-decider-nats/src/store.rs                                                 145      65  55.17%   33-187
crates/trogon-decider-nats/src/snapshot_store.rs                                        740     140  81.08%   64-217, 265-267, 305-313, 322-323, 338-344, 458-473, 502-511, 563, 568, 646-648, 654-656, 688-689, 699-700, 718, 742-743
crates/trogon-gateway/src/source/linear/signature.rs                                     54       1  98.15%   16
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/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/update.rs                                    27       0  100.00%
crates/acp-nats/src/nats/subjects/responses/prompt_response.rs                           27       0  100.00%
crates/acp-nats/src/nats/subjects/responses/cancelled.rs                                 15       0  100.00%
crates/trogon-gateway/src/source/github/server.rs                                       328       0  100.00%
crates/trogon-gateway/src/source/github/signature.rs                                     61       0  100.00%
crates/trogon-gateway/src/source/github/config.rs                                        17       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/trogon-gateway/src/source/standard_webhooks.rs                                   172       0  100.00%
crates/trogon-gateway/src/source/notion/verification_token.rs                           240       0  100.00%
crates/trogon-gateway/src/source/notion/server.rs                                       318       8  97.48%   93-97, 130-131, 150-151
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%   47-49
crates/trogon-gateway/src/source/notion/signature.rs                                     56       1  98.21%   32
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/mcp-nats-server/src/allowed_host.rs                                               90       0  100.00%
crates/mcp-nats-server/src/config.rs                                                    276       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/mcp-nats/src/nats/subjects/subscriptions/all_server.rs                             6       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/one_client.rs                             9       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/mcp-nats/src/telemetry/transport.rs                                                6       0  100.00%
crates/trogon-nats/src/mocks.rs                                                         317       0  100.00%
crates/trogon-nats/src/messaging.rs                                                     561       2  99.64%   144, 154
crates/trogon-nats/src/auth.rs                                                          114       0  100.00%
crates/trogon-nats/src/token.rs                                                           6       0  100.00%
crates/trogon-nats/src/client.rs                                                         22      22  0.00%    50-86
crates/trogon-nats/src/subject_token_violation.rs                                        17       0  100.00%
crates/trogon-nats/src/connect.rs                                                        94       9  90.43%   22-23, 33, 60-65
crates/trogon-nats/src/nats_token.rs                                                    157       0  100.00%
crates/acp-nats/src/nats/subjects/subscriptions/all_session.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/all_agent.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/prompt_wildcard.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/all_agent_ext.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/client_ops/terminal_output.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/fs_write_text_file.rs                       12       0  100.00%
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_kill.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/session_update.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/fs_read_text_file.rs                        12       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-decider-runtime/src/event/event_identity.rs                                 3       0  100.00%
crates/trogon-gateway/src/source/slack/socket_mode.rs                                   731       0  100.00%
crates/trogon-gateway/src/source/slack/server.rs                                        854       0  100.00%
crates/trogon-gateway/src/source/slack/config.rs                                         68       0  100.00%
crates/trogon-gateway/src/source/slack/signature.rs                                      77       0  100.00%
crates/trogon-decider-runtime/src/headers/header_value.rs                                37       0  100.00%
crates/trogon-decider-runtime/src/headers/from_entries_error.rs                          11       0  100.00%
crates/trogon-decider-runtime/src/headers/mod.rs                                         74       0  100.00%
crates/trogon-decider-runtime/src/headers/header_map.rs                                  54       3  94.44%   20-22
crates/trogon-decider-runtime/src/headers/header_name.rs                                 33       0  100.00%
crates/mcp-nats/src/nats/parsing.rs                                                     191       0  100.00%
crates/mcp-nats/src/nats/mod.rs                                                          99       0  100.00%
crates/acp-nats/src/agent/set_session_mode.rs                                            67       0  100.00%
crates/acp-nats/src/agent/test_support.rs                                               267       0  100.00%
crates/acp-nats/src/agent/js_request.rs                                                 283       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/cancel.rs                                                     101       0  100.00%
crates/acp-nats/src/agent/list_sessions.rs                                               47       0  100.00%
crates/acp-nats/src/agent/authenticate.rs                                                49       0  100.00%
crates/acp-nats/src/agent/initialize.rs                                                  79       0  100.00%
crates/acp-nats/src/agent/load_session.rs                                                89       0  100.00%
crates/acp-nats/src/agent/fork_session.rs                                                94       0  100.00%
crates/acp-nats/src/agent/ext_notification.rs                                            82       0  100.00%
crates/acp-nats/src/agent/set_session_model.rs                                           67       0  100.00%
crates/acp-nats/src/agent/resume_session.rs                                              90       0  100.00%
crates/acp-nats/src/agent/logout.rs                                                      49       0  100.00%
crates/acp-nats/src/agent/ext_method.rs                                                  82       0  100.00%
crates/acp-nats/src/agent/set_session_config_option.rs                                   67       0  100.00%
crates/acp-nats/src/agent/bridge.rs                                                     123       4  96.75%   108-111
crates/acp-nats/src/agent/new_session.rs                                                 82       0  100.00%
crates/acp-nats/src/agent/close_session.rs                                               63       0  100.00%
crates/trogon-nats/src/lease/renew_interval.rs                                           61       0  100.00%
crates/trogon-nats/src/lease/lease_config_error.rs                                       11       0  100.00%
crates/trogon-nats/src/lease/lease_key.rs                                                19       0  100.00%
crates/trogon-nats/src/lease/nats_kv_lease_config.rs                                     26       0  100.00%
crates/trogon-nats/src/lease/mod.rs                                                     561      13  97.68%   180-193
crates/trogon-nats/src/lease/release.rs                                                   5       5  0.00%    8-12
crates/trogon-nats/src/lease/acquire.rs                                                   5       5  0.00%    9-14
crates/trogon-nats/src/lease/ttl.rs                                                      73       0  100.00%
crates/trogon-nats/src/lease/renew.rs                                                   246      19  92.28%   23-29, 48-59
crates/trogon-nats/src/lease/lease_timing.rs                                             15       0  100.00%
crates/trogon-nats/src/lease/lease_bucket.rs                                             19       0  100.00%
crates/trogon-nats/src/lease/provision.rs                                               187      10  94.65%   82-92
crates/trogon-std/src/telemetry/http.rs                                                 217       0  100.00%
crates/acp-nats/src/nats/subjects/stream.rs                                              56       0  100.00%
crates/acp-nats/src/nats/subjects/mod.rs                                                362       0  100.00%
crates/trogon-service-config/src/lib.rs                                                  92       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/jsonrpc.rs                                                            6       0  100.00%
crates/acp-nats/src/client_proxy.rs                                                     181       0  100.00%
crates/acp-nats/src/error.rs                                                             82       0  100.00%
crates/acp-nats/src/ext_method_name.rs                                                   68       0  100.00%
crates/acp-nats/src/lib.rs                                                               69       0  100.00%
crates/acp-nats/src/config.rs                                                           203       0  100.00%
crates/acp-nats/src/req_id.rs                                                            39       0  100.00%
crates/acp-nats/src/acp_prefix.rs                                                        50       0  100.00%
crates/acp-nats/src/pending_prompt_waiters.rs                                           134       0  100.00%
crates/acp-nats/src/in_flight_slot_guard.rs                                              32       0  100.00%
crates/acp-nats/src/session_id.rs                                                        71       0  100.00%
crates/acp-nats/src/nats/extensions.rs                                                    3       0  100.00%
crates/acp-nats/src/nats/mod.rs                                                          23       0  100.00%
crates/acp-nats/src/nats/parsing.rs                                                     278       1  99.64%   151
crates/trogon-nats/src/telemetry/messaging.rs                                            82       0  100.00%
crates/trogon-gateway/src/source/twitter/server.rs                                      525       0  100.00%
crates/trogon-gateway/src/source/twitter/config.rs                                       17       0  100.00%
crates/trogon-gateway/src/source/twitter/signature.rs                                    69       0  100.00%
crates/acp-nats-agent/src/connection.rs                                                1270       1  99.92%   607
crates/trogon-decider-runtime/src/execution.rs                                         1335       0  100.00%
crates/trogon-decider/src/lib.rs                                                        143       0  100.00%
crates/trogon-decider/src/decision.rs                                                    37       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                                                    660       0  100.00%
crates/trogon-decider-runtime/src/snapshot/codec/snapshot_decode_error.rs                22       3  86.36%   11-13
crates/trogon-decider-runtime/src/snapshot/codec/snapshot_encode_error.rs                22       3  86.36%   11-13
crates/trogon-decider-runtime/src/snapshot/codec/snapshot_envelope_decode_error.rs       38       0  100.00%
crates/trogon-decider-runtime/src/snapshot/codec/snapshot_envelope_encode_error.rs       20       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/encoded_snapshot.rs                     57       0  100.00%
crates/trogon-gateway/src/source/telegram/server.rs                                     339       0  100.00%
crates/trogon-gateway/src/source/telegram/registration.rs                               327       0  100.00%
crates/trogon-gateway/src/source/telegram/config.rs                                     109       0  100.00%
crates/trogon-gateway/src/source/telegram/signature.rs                                   32       0  100.00%
crates/mcp-nats-stdio/src/config.rs                                                     160       0  100.00%
crates/mcp-nats-stdio/src/main.rs                                                       212       0  100.00%
crates/trogon-gateway/src/source_integration_id.rs                                       61       3  95.08%   55, 57, 65
crates/trogon-gateway/src/config.rs                                                    2655      46  98.27%   105, 124, 342-343, 346, 744, 747, 907, 964, 1047, 1050, 1053, 1057, 1141-1148, 1225, 1228, 1231, 1236, 1294, 1297, 1300, 1379, 1382, 1385, 1389, 1453, 1456, 1459, 1522, 1525, 1528, 1533, 1608, 1611, 1614, 1619, 1677, 1680, 1683, 1896-1898
crates/trogon-gateway/src/source_status.rs                                               28       0  100.00%
crates/trogon-gateway/src/http.rs                                                       217       1  99.54%   128
crates/trogon-gateway/src/main.rs                                                       116       0  100.00%
crates/trogon-gateway/src/streams.rs                                                    169      10  94.08%   11, 23, 31, 39, 47, 55, 63, 71, 79, 87
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%
TOTAL                                                                                 40009     892  97.77%

Diff against main

Filename                                   Stmts    Miss  Cover
---------------------------------------  -------  ------  -------
crates/acp-nats-server/src/transport.rs        0      +4  -0.22%
TOTAL                                          0      +4  -0.01%

Results for commit: 3e9f209

Minimum allowed coverage is 95%

♻️ This comment has been updated with latest results

@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 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 3a6f203. Configure here.

Comment thread proto/trogonai/scheduler/schedules/v1/schedule.proto Outdated
@yordis
yordis force-pushed the yordis/refactor-event-at-by branch 5 times, most recently from 4754e16 to 33fa5b7 Compare May 27, 2026 20:55

@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: 4

🤖 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 `@proto/trogonai/scheduler/schedules/v1/message.proto`:
- Line 8: The Message.proto field Message.content should be changed from string
to bytes because the payload is transport-opaque/binary; update the field
declaration from "string content = 1 [features.field_presence =
LEGACY_REQUIRED];" to "bytes content = 1 [features.field_presence =
LEGACY_REQUIRED];" (preserving the field number and options), then regenerate
the protobuf artifacts and update any call sites that treated content as a UTF-8
string to use bytes/byte[]/Buffer as appropriate (e.g., places referencing
Message.content, serialization/deserialization helpers, and any validation
assuming UTF-8).

In `@proto/trogonai/scheduler/schedules/v1/schedule_added.proto`:
- Around line 5-8: The proto imports in
trogonai/scheduler/schedules/v1/schedule_added.proto (the lines importing
"trogonai/scheduler/schedules/v1/delivery.proto",
"trogonai/scheduler/schedules/v1/message.proto",
"trogonai/scheduler/schedules/v1/schedule.proto", and
"trogonai/scheduler/schedules/v1/schedule_status.proto") fail because Buf's
module root doesn't map "trogonai/..." to the repo's proto/ folder; add or
update your Buf configuration (e.g., create/update buf.yaml or buf.work.yaml) to
set the build root(s) to include "proto" (build.roots: ["proto"]) or otherwise
configure the module/import mapping so imports starting with "trogonai/..."
resolve to proto/trogonai/..., then re-run buf generate/compile.

In `@proto/trogonai/scheduler/schedules/v1/schedule_paused.proto`:
- Line 3: The proto package declaration in schedule_paused.proto ("package
trogonai.scheduler.schedules.v1;") does not match the file directory per Buf’s
PACKAGE_DIRECTORY_MATCH rule; fix by either updating the package declaration to
match the actual module root layout (e.g., adjust the package to reflect the
module root you want) or move the file into the directory that matches that
package, or alternatively update the Buf module root configuration so proto/ is
treated as the module root; locate this in
proto/trogonai/scheduler/schedules/v1/schedule_paused.proto and change the
package line or adjust Buf module configuration accordingly to restore
consistency.

In `@proto/trogonai/scheduler/schedules/v1/schedule.proto`:
- Around line 34-35: The timezone fields currently declare
[features.field_presence = LEGACY_REQUIRED] which enforces proto2-style required
presence and contradicts the intended semantics "empty omits the header"; update
the schema for the timezone fields (the `string timezone = 2` and the other
`timezone = 3` declaration) to use optional presence (remove the LEGACY_REQUIRED
option or replace it with [features.field_presence = OPTIONAL] / standard proto3
optional semantics) so an omitted/empty field can be omitted on the wire and
consumers/producers behave as documented.
🪄 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: 9db56a01-b1d3-4aa7-8a39-7529fa39a587

📥 Commits

Reviewing files that changed from the base of the PR and between 7844fbb and 4754e16.

📒 Files selected for processing (9)
  • docs/architecture/event-metadata.md
  • proto/trogonai/scheduler/schedules/v1/delivery.proto
  • proto/trogonai/scheduler/schedules/v1/message.proto
  • proto/trogonai/scheduler/schedules/v1/schedule.proto
  • proto/trogonai/scheduler/schedules/v1/schedule_added.proto
  • proto/trogonai/scheduler/schedules/v1/schedule_paused.proto
  • proto/trogonai/scheduler/schedules/v1/schedule_removed.proto
  • proto/trogonai/scheduler/schedules/v1/schedule_resumed.proto
  • proto/trogonai/scheduler/schedules/v1/schedule_status.proto

Comment thread proto/trogonai/scheduler/schedules/v1/message.proto Outdated
Comment thread proto/trogonai/scheduler/schedules/v1/schedule_created.proto
Comment thread proto/trogonai/scheduler/schedules/v1/schedule_paused.proto
Comment thread proto/trogonai/scheduler/schedules/v1/schedule.proto Outdated
@yordis
yordis force-pushed the yordis/refactor-event-at-by branch 9 times, most recently from 5ad1cd0 to ad539d4 Compare May 28, 2026 00:44

@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: 1

♻️ Duplicate comments (1)
proto/trogonai/scheduler/schedules/v1/schedule.proto (1)

35-37: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Resolve required-presence contradiction for timezone fields.

Line 35/Line 48 describe optional/empty timezone behavior, but Line 36 and Line 49 enforce LEGACY_REQUIRED, which makes omission invalid on the wire.

Suggested schema fix
-    google.type.TimeZone timezone = 2 [features.field_presence = LEGACY_REQUIRED];
+    google.type.TimeZone timezone = 2;
...
-    google.type.TimeZone timezone = 3 [features.field_presence = LEGACY_REQUIRED];
+    google.type.TimeZone timezone = 3;
In Protobuf Editions (edition 2024), does [features.field_presence = LEGACY_REQUIRED] on a singular message field require wire presence, and therefore conflict with comments that describe the field as optional/omittable?

Also applies to: 48-49

🤖 Prompt for 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.

In `@proto/trogonai/scheduler/schedules/v1/schedule.proto` around lines 35 - 37,
The timezone field declaration uses "google.type.TimeZone timezone" but sets
[features.field_presence = LEGACY_REQUIRED], which forces wire presence and
contradicts the comment that the timezone is optional/omittable; remove the
LEGACY_REQUIRED option (or replace it with no field_presence option) on the
"google.type.TimeZone timezone" declarations so the timezone can be omitted, and
make the same change for the second occurrence of "google.type.TimeZone
timezone" in this proto to keep semantics consistent.
🤖 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 `@proto/trogonai/scheduler/schedules/v1/schedule_created.proto`:
- Around line 14-22: The persistence/rehydration mapping must be extended to
include the new proto type trogonai.scheduler.schedules.v1.ScheduleCreated so
created events are encoded/decoded and persisted like ScheduleAdded; in
rsworkspace/crates/trogon-decider-nats/src/stream_store.rs add the
ScheduleCreated type to the event-type/header assertions and to the dispatch +
codec tables used for encoding/decoding (the same spots where
trogonai.scheduler.schedules.v1.ScheduleAdded is registered), ensuring the
decode/encode handlers and any persistence keys or enum variants referencing
ScheduleAdded are duplicated/handled for ScheduleCreated so reads and writes
round-trip correctly.

---

Duplicate comments:
In `@proto/trogonai/scheduler/schedules/v1/schedule.proto`:
- Around line 35-37: The timezone field declaration uses "google.type.TimeZone
timezone" but sets [features.field_presence = LEGACY_REQUIRED], which forces
wire presence and contradicts the comment that the timezone is
optional/omittable; remove the LEGACY_REQUIRED option (or replace it with no
field_presence option) on the "google.type.TimeZone timezone" declarations so
the timezone can be omitted, and make the same change for the second occurrence
of "google.type.TimeZone timezone" in this proto to keep semantics consistent.
🪄 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: 4c6a1bbb-051d-4629-ac8f-ccbcb4a753e1

📥 Commits

Reviewing files that changed from the base of the PR and between 4754e16 and ad539d4.

⛔ Files ignored due to path filters (1)
  • buf.lock is excluded by !**/*.lock
📒 Files selected for processing (10)
  • buf.yaml
  • docs/architecture/event-metadata.md
  • proto/trogonai/scheduler/schedules/v1/delivery.proto
  • proto/trogonai/scheduler/schedules/v1/message.proto
  • proto/trogonai/scheduler/schedules/v1/schedule.proto
  • proto/trogonai/scheduler/schedules/v1/schedule_created.proto
  • proto/trogonai/scheduler/schedules/v1/schedule_paused.proto
  • proto/trogonai/scheduler/schedules/v1/schedule_removed.proto
  • proto/trogonai/scheduler/schedules/v1/schedule_resumed.proto
  • proto/trogonai/scheduler/schedules/v1/schedule_status.proto
✅ Files skipped from review due to trivial changes (1)
  • docs/architecture/event-metadata.md
🚧 Files skipped from review as they are similar to previous changes (3)
  • proto/trogonai/scheduler/schedules/v1/schedule_paused.proto
  • proto/trogonai/scheduler/schedules/v1/schedule_removed.proto
  • proto/trogonai/scheduler/schedules/v1/schedule_resumed.proto

Comment thread proto/trogonai/scheduler/schedules/v1/schedule_created.proto
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
@yordis
yordis force-pushed the yordis/refactor-event-at-by branch from ad539d4 to 3e9f209 Compare May 28, 2026 00:55
@yordis
yordis merged commit 1fc7222 into main May 28, 2026
6 of 7 checks passed
@yordis
yordis deleted the yordis/refactor-event-at-by branch May 28, 2026 01:03
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