Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
0513a32
feat(trogon-cron): use native NATS scheduling
yordis Apr 12, 2026
6938f23
refactor(trogon-cron): keep write checks aligned
yordis Apr 12, 2026
a392093
fix(trogon-cron): keep deleted jobs reusable
yordis Apr 12, 2026
e7a71aa
fix(trogon-cron): preserve sampling source subjects
yordis Apr 12, 2026
f92b9ee
refactor(trogon-cron): clarify control-plane boundaries
yordis Apr 12, 2026
9919953
refactor(trogon-cron): tighten command handler boundaries
yordis Apr 12, 2026
9885b54
refactor(trogon-cron): simplify NATS storage boundaries
yordis Apr 12, 2026
acb4f3e
refactor(trogon-cron): remove fake storage abstractions
yordis Apr 12, 2026
bebe20e
refactor: keep behavior at concrete boundaries
yordis Apr 12, 2026
3f52c9c
refactor: keep job commands valid by construction
yordis Apr 13, 2026
f7a64b8
refactor(trogon-cron): keep stream transitions consistent
yordis Apr 13, 2026
2821077
refactor(trogon-cron): keep event boundaries direct
yordis Apr 13, 2026
e940e83
fix(trogon-nats): keep coverage builds using real stream traits
yordis Apr 13, 2026
6c5ba32
fix(trogon-cron): reject impossible command transitions early
yordis Apr 13, 2026
06082e4
refactor: keep write rules at the decision boundary
yordis Apr 13, 2026
e5a6ab8
refactor: keep stream identity at the boundary
yordis Apr 13, 2026
c8ff32a
fix(ci): keep coverage focused on exercised cron paths
yordis Apr 13, 2026
1b2a468
refactor: keep stream ids typed at the command boundary
yordis Apr 13, 2026
f2f3826
refactor: keep snapshot envelopes generic
yordis Apr 13, 2026
8b03daa
refactor: keep command state owned by the handler
yordis Apr 14, 2026
10888ba
refactor: keep command names aligned with domain intent
yordis Apr 14, 2026
e750da3
refactor: keep commands as the only command boundary
yordis Apr 14, 2026
0010fe4
refactor: keep projection concerns at the projection boundary
yordis Apr 14, 2026
6846f90
refactor(eventsourcing): keep event envelopes opaque at the boundary
yordis Apr 14, 2026
1cdc193
refactor(cron): keep event components at their boundaries
yordis Apr 14, 2026
31f2f5a
refactor(cron): keep cron jobs projection explicit in shared storage
yordis Apr 14, 2026
1b52858
refactor(eventsourcing): keep stream and snapshot policies at the bou…
yordis Apr 14, 2026
3fa0c9c
refactor(cron): keep service startup at the binary boundary
yordis Apr 14, 2026
0185c24
fix(ci): keep coverage builds from failing on gated command paths
yordis Apr 14, 2026
b6cea8a
fix(cron): keep command entrypoints real under coverage
yordis Apr 14, 2026
fd32b76
refactor(eventsourcing): keep command execution at the shared boundary
yordis Apr 15, 2026
bbe08d3
refactor(eventsourcing): keep expected versions at the shared boundary
yordis Apr 15, 2026
ce4590e
refactor(eventsourcing): keep expected state at the shared boundary
yordis Apr 15, 2026
c217bed
refactor(eventsourcing): keep snapshot revisions inside execution
yordis Apr 15, 2026
76665f6
refactor(eventsourcing): keep OCC precedence at execution time
yordis Apr 15, 2026
e89a932
refactor(eventsourcing): keep command execution behind one boundary
yordis Apr 15, 2026
baadb86
refactor(cron): keep command defaults explicit at the boundary
yordis Apr 15, 2026
dcd0189
refactor(eventsourcing): keep command stores aligned with the boundary
yordis Apr 15, 2026
9126442
refactor(cron): keep command runtime noise out of call sites
yordis Apr 15, 2026
b79db23
refactor(cron): keep command boundaries transport-agnostic
yordis Apr 15, 2026
1d85d59
refactor(cron): keep scheduling as a processor over raw events
yordis Apr 16, 2026
f5f8168
refactor(cron): keep job ids valid across the domain
yordis Apr 16, 2026
e082c43
refactor(cron): keep identifiers inside the domain module
yordis Apr 16, 2026
749941e
feat(eventsourcing): make decider behavior easy to verify
yordis Apr 16, 2026
2ba8efb
feat(eventsourcing): make stream histories composable in tests
yordis Apr 16, 2026
d8650ad
fix(cron): keep duplicate registration out of OCC
yordis Apr 16, 2026
6f88b64
refactor(eventsourcing): keep command outcomes explicit at the boundary
yordis Apr 16, 2026
de7e586
refactor(cron): keep command failures scoped to each command
yordis Apr 16, 2026
839979a
refactor(eventsourcing): keep command OCC rules explicit
yordis Apr 16, 2026
360eebc
Rename `CommandStateModel` and `SnapshotStateModel` traits
yordis Apr 16, 2026
f913bfd
Move job spec types from config to domain::spec
yordis Apr 16, 2026
feb51b8
refactor(eventsourcing): keep snapshot wiring at one boundary
yordis Apr 16, 2026
4e6d9aa
fix(cron): keep deleted job ids terminal
yordis Apr 16, 2026
dd4c884
refactor(eventsourcing): keep event codecs pluggable
yordis Apr 17, 2026
0416720
refactor(cron): keep event codecs explicit in the domain
yordis Apr 17, 2026
da07baf
Rename `ExpectedState`/`ExpectedStateRule` to
yordis Apr 17, 2026
387fbb2
refactor(eventsourcing): keep execution decisions explicit at the bou…
yordis Apr 17, 2026
3559a83
Strengthen `DeliverySpec` field types with validation
yordis Apr 17, 2026
1d72468
refactor(cron): keep read paths separate from commands
yordis Apr 17, 2026
0689ce0
refactor(cron): keep queries on the read model
yordis Apr 17, 2026
d1f2efc
Cache bucket/stream handles in Store instead of reopening
yordis Apr 18, 2026
68a0ac0
Add UuidV7 abstraction to trogon-std and migrate usages
yordis Apr 18, 2026
c7373b5
Split `EventStore` into `StreamRead` and `StreamAppend` traits
yordis Apr 18, 2026
7c190ad
refactor(eventsourcing): keep execution results intact at the boundary
yordis Apr 18, 2026
e5a3a98
Refactor snapshot state to use `From`/`TryFrom` traits
yordis Apr 18, 2026
4a1a5bc
Remove `Infallible` conversions by using `From` instead of `TryFrom`
yordis Apr 18, 2026
4dfd7fb
Simplify snapshot state by removing `SnapshotState` trait
yordis Apr 19, 2026
3ed8a78
Move domain types to `jobs` module and relocate schedule logic
yordis Apr 19, 2026
7e51803
Split `change_job_state` into `pause_job` and `resume_job` commands
yordis Apr 19, 2026
6a05286
Rename `RegisterJob` command to `AddJob`
yordis Apr 19, 2026
022d96b
Replace job payload/metadata with MessageContent/MessageHeaders
yordis Apr 19, 2026
5aaeedc
Add MessageHeaders and MessageContent types for job specs
yordis Apr 19, 2026
285bd25
Rename `JobRegistered`/`RegisteredJobSpec` to `JobAdded`/`JobDetails`
yordis Apr 19, 2026
216525c
Add generic `JetStreamStore` with pluggable subject resolver
yordis Apr 19, 2026
38a6f02
Merge event and snapshot stores into a single store parameter
yordis Apr 19, 2026
8471877
refactor(cron): keep store wiring direct at the boundary
yordis Apr 19, 2026
0eb7226
Split `SnapshotStore` into `SnapshotRead` and `SnapshotWrite` traits
yordis Apr 20, 2026
75709a1
Refactor `JobEvent` variants to use tuple structs
yordis Apr 20, 2026
93453eb
Replace `SnapshotStoreConfig` static consts with `SnapshotSchema` trait
yordis Apr 20, 2026
2f3bcf8
Refactor snapshot schema and command execution API
yordis Apr 20, 2026
333dfd3
Use optimistic concurrency when writing snapshots
yordis Apr 21, 2026
cb75240
Reorganize eventsourcing NATS modules under `nats` namespace
yordis Apr 21, 2026
baea3d6
Extract snapshot types into dedicated module
yordis Apr 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion devops/docker/compose/compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@ name: trogonai

services:
nats:
image: nats:2.11-alpine
image: synadia/nats-server:nightly
Comment thread
yordis marked this conversation as resolved.
Comment thread
yordis marked this conversation as resolved.
command:
- "--jetstream"
- "--store_dir=/data"
- "--http_port=8222"
ports:
- "127.0.0.1:14222:4222"
- "127.0.0.1:18222:8222"
volumes:
- nats_data:/data
restart: unless-stopped
Expand Down Expand Up @@ -85,6 +88,20 @@ services:
start_period: 10s
retries: 3

trogon-cron:
build:
context: ../../../rsworkspace
dockerfile: ../devops/docker/compose/services/trogon-cron/Dockerfile
environment:
NATS_URL: "nats://nats:4222"
Comment thread
cursor[bot] marked this conversation as resolved.
RUST_LOG: "${RUST_LOG:-info}"
Comment thread
cursor[bot] marked this conversation as resolved.
Comment thread
cursor[bot] marked this conversation as resolved.
depends_on:
nats:
condition: service_healthy
restart: unless-stopped
profiles:
- cron

ngrok:
image: ngrok/ngrok:alpine
environment:
Expand Down
43 changes: 43 additions & 0 deletions devops/docker/compose/services/trogon-cron/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
FROM rust:1.93-slim AS chef

RUN cargo install cargo-chef --locked

WORKDIR /build

FROM chef AS planner

COPY Cargo.toml Cargo.lock ./
COPY crates/ crates/

RUN cargo chef prepare --recipe-path recipe.json

FROM chef AS builder

RUN apt-get update && apt-get install -y --no-install-recommends \
pkg-config libssl-dev \
&& rm -rf /var/lib/apt/lists/*

COPY --from=planner /build/recipe.json recipe.json
RUN cargo chef cook --release --recipe-path recipe.json -p trogon-cron

COPY Cargo.toml Cargo.lock ./
COPY crates/ crates/

RUN cargo build --release -p trogon-cron && \
strip target/release/trogon-cron

FROM debian:bookworm-20250317-slim AS runtime

RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*

RUN useradd --no-create-home --shell /usr/sbin/nologin trogon

COPY --from=builder /build/target/release/trogon-cron /usr/local/bin/trogon-cron

USER trogon

STOPSIGNAL SIGTERM

ENTRYPOINT ["/usr/local/bin/trogon-cron", "serve"]
Comment thread
cursor[bot] marked this conversation as resolved.
2 changes: 2 additions & 0 deletions rsworkspace/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Always use `enum` over booleans in the edges such as HTTP, gRPC, Databases, etc,

Loading