feat(domain): add the tutor event-envelope tracer - #16
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ac694c0413
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const Rfc3339Schema = Schema.String.check( | ||
| Schema.isPattern(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$/), | ||
| ); |
There was a problem hiding this comment.
Validate calendar values in RFC 3339 timestamps
For event input such as 2026-99-99T99:99:99Z, this pattern succeeds even though the value is not a valid RFC 3339 timestamp. Consequently decodeEventEnvelopeV1 accepts malformed dates and foldEvents may order them lexicographically as legitimate events, violating the tracer's fail-closed input boundary; validate the parsed calendar date and time rather than only their digit shape.
Useful? React with 👍 / 👎.
Design spec
design-specs/0014-tutor-event-envelope-tracer.mdJourney
A maintainer runs a deterministic tutor lifecycle tracer that decodes commands, accepts lawful transitions, rejects stale or illegal transitions, and emits replayable envelopes and receipts.
Experience it
Evidence
What is real
The in-memory command/event/receipt seam is executable and deterministic. It does not claim D1 persistence, Worker routing, scheduling semantics, provider behavior, deployment, or production acceptance.