Skip to content

Give continuous events individual quiet durations - #44

Merged
asher-aqi merged 6 commits into
mainfrom
feat/continuous-quiet
Nov 14, 2026
Merged

asher-aqi merged 6 commits into
mainfrom
feat/continuous-quiet

Conversation

@asher-aqi

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

Copy link
Copy Markdown
Member

Summary

Continuous inputs can keep different quiet durations while sharing one window. Optional Event.quietForMs sets an event's duration in TypeScript and Python. Once a continuous entry supplies it:

end(event) = observation(event) + (quietForMs ?? streamGapMs)
continuous deadline = latest end among fresh continuous entries

Other triggers retain their precedence. Omission keeps existing timing, including backwards clocks. Admission rejects invalid values or use on another kind before accepting the batch. Explicit durations survive storage and recovery; policy changes recompute omitted durations.

Stacked on #43. Merge that prerequisite first, then retarget this PR to main.

Original implementation evidence

  • Initial tests failed 17 TypeScript and 18 Python cases. Review found two more defects, reproduced before fixing: invalid fields erased by JSON copying, and an unused infinite default producing NaN.
  • One final full run: 1,539 TypeScript passes with two existing Redis malformed-position skips; 339 Python passes with zero skips, including interop. Local Redis, Postgres, SQLite and memory adapters were exercised.
  • Oracle 128 and benchmark contracts 77 passed. Typechecks, Ruff, format and package builds passed. Docs checked 39 blocks, with four optional-package snippets skipped.
  • Seven shared scenarios were added; no earlier fixture line changed. Runtime tests cover refusal/cursors, mixed durations, independent triggers, restart, conflict, waits/retries and policy changes. Independent review findings are resolved.

Integration check

The branch includes main's folded-event exports at 6662e07. The changes introduced by this layer are unchanged after removing diff line numbers and blob hashes. The combined stack has the same tree as the previously tested composition. All eight distinct CI jobs passed on this updated head. The optional Macroscope review check was skipped.

Merge danger

Door: Two-way before sources opt in. Afterward, a downgrade changes stored event timing.

Blast radius: Scheduling.

Reducer revision advances to 3. Processes sharing a store must use the same revision before opt-in; the existing replay path does not fence older writers. No package version or publication change is included.

Pin distinct continuous durations, latest-end aggregation, unchanged defaults and atomic admission before implementing the extension.
Combine distinct continuous quiet durations by their latest end time while retaining independent triggers, processing clocks and default behavior. Persist explicit durations and rebuild summaries through replay and policy changes.
Invalid timing fields must not disappear during JSON copying. An explicit continuous duration must also work when no entry uses the configured default gap.
Keep the continuous-duration extension based on the corrected observation-time contract and its boundary tests.
Validate captured duration fields before JSON can erase them. Exclude the missing default-duration group from deadline arithmetic, so an unused infinite policy gap cannot suppress an explicit deadline.
Carry the merged main exports through the quiet-duration branch so subsequent stack layers retain both public APIs.
@asher-aqi
asher-aqi changed the base branch from feat/observed-at to main November 14, 2026 04:21
@asher-aqi
asher-aqi merged commit d254535 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