Skip to content

Preserve source observation time for event deadlines - #43

Merged
asher-aqi merged 7 commits into
mainfrom
feat/observed-at
Nov 14, 2026
Merged

asher-aqi merged 7 commits into
mainfrom
feat/observed-at

Conversation

@asher-aqi

@asher-aqi asher-aqi commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Summary

Buffered sources can now supply Event.observedAt for quiet and age deadlines in TypeScript and Python. Omission keeps ingestion timing.

observedAt  -> quiet periods, act age, background pruning
seenAt      -> actual ingestion
engine time -> settlement, waits, retries, leases, timeouts
at          -> informational source time

Admission rejects invalid or future observation times before admitting the batch. TypeScript validates captured root fields before JSON normalization can erase an invalid value, while retaining read-once getters and ordinary nested-data normalization. Both runtimes retain the field through logs, snapshots and recovery. The reducer revision advances to 2. Seven shared scenarios cover the new behavior; existing shared fixtures remain unchanged.

Original implementation evidence

  • Before implementation, the new runtime tests had 11 TypeScript failures and 12 Python failures. Final focused tests pass: 22 TypeScript and 23 Python.
  • The validation follow-up first failed five new tests, then passed all six, including the unchanged nested-data control. The final pnpm check run passed 1,511 tests with two existing Redis malformed-position skips. Python passed 306 tests with zero skips, including cross-runtime recovery; the follow-up changes only TypeScript. Local Redis and Postgres stores were exercised.
  • Oracle checks passed 128 tests. Benchmark contract checks passed 77. TypeScript and Python typechecks, Ruff and the Python wheel build passed. The snippet checker accepted 38 blocks, with four optional-package snippets skipped.
  • Independent clock and API reviews found no blocker. Local checks used Node 22 and Python 3.12; CI covers the other supported runtime versions.

Integration check

The branch now includes main's folded-event exports at b8a4c9b. Focused fold and observation-time checks pass: 34 TypeScript and 35 Python tests. All eight CI jobs passed on this head; the optional Macroscope review check was skipped.

Merge danger

Door: Two-way before sources opt in. Afterward, downgrading changes the timing of stored observations.

Blast radius: Scheduling.

Processes sharing a store must use the same reducer version before supplying observedAt. The existing mismatch handler replays and resnapshots; it does not fence older readers. No package version or release changes are included.

asher-aqi and others added 6 commits November 11, 2026 22:49
A buffered source needs to retain its observation clock without backdating processing. Pin the public input, quiet and age deadlines, pruning, invalid input, and unchanged arrival-clock behavior before implementing it.
Allow buffered sources to supply observation time for quiet and age deadlines while processing clocks continue to govern leases, waits, retries and settlement. Preserve arrival behavior when the field is absent, and retain both clocks through storage and replay.

Co-Authored-By: Codex gpt-6-astra <noreply@openai.com>
The clock extension intentionally advances the reducer revision. Keep the recovery and invariant tests checking that exact revision, and describe observation extrema in the summary documentation.
Apply the existing Python formatter to the new fixtures and recovery cases so the format check passes. Their parsed Python syntax is unchanged.
Function and symbol values currently disappear before validation. Reproduce whole-batch admission and cover top-level toJSON, getters and unchanged nested data normalization.
Reject invalid captured observation values before serialization can omit them. Read each root property once and leave nested event data on its existing JSON path.
Verify the reviewed folded-event exports together with source observation clocks before merging the next stack layer.
@asher-aqi
asher-aqi merged commit b850c85 into main Nov 14, 2026
9 checks passed
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