This repository was archived by the owner on Sep 8, 2026. It is now read-only.
Repository navigation
Return structured errors and validate legacy append (#9, #10) - #21
Merged
Merged
Conversation
FixedGaugeRollup::build asserted that its resolution is positive and its maximum gap non-negative, and Database::rollup_gauge forwarded caller-supplied values straight into it, so a resolution of zero from a library user aborted the whole process. The same reachability applied to GaugeAggregate/CounterAggregate push and merge, which asserted timestamp ordering on runtime data, and to GaugeBucket::merge_exact, which asserted bucket adjacency. A new Error::InvalidArgument(&'static str) variant now carries these precondition failures: build, push, merge, and merge_exact return Result, rollup_gauge propagates it, and a failed push provably leaves the aggregate state untouched. CalendarGaugeRollup::build's existing negative-gap check moves from InvalidConfig to the same variant so both builders reject the same mistake the same way; InvalidConfig remains for durable handle/policy settings. The debug_assert in GaugeBucket::add_covered_interval stays: it is a private helper whose callers iterate strictly increasing bucket edges, so no caller input can reach it once build has validated its arguments. Fixes #9 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TCz23P2PXpQ7QAiVtCM5so
Database::append wrote FRAME_KIND_LEGACY_POINTS frames with zero validation while Transaction commits run the catalog's validate_points, so an interval that ends before it starts could only be rejected on one of the two write paths, and Store::append inherited the hole. The catalog-independent interval check now lives in a shared validate_point_intervals helper that validate_points calls first and append runs before encoding anything, so both writers reject an inverted interval with the identical InvalidModel error and a rejected batch never reaches the log. Series existence and run provenance deliberately stay commit-only: append is the documented catalog-less fast path — the benches, the property tests, and the database round-trip tests all feed it raw telemetry with undefined series and unresolvable run ids, and no catalog ever exists on that path to validate against. Both append doc comments now state that contract. Recovery of already-written legacy frames stays lenient so files produced before this change still open. Fixes #10 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TCz23P2PXpQ7QAiVtCM5so
This was referenced Jul 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Error::InvalidArgumentfrom public aggregate and rollup APIs instead of panicking on bad inputRoadmap
This hardens M0 semantics and makes the M1 catalog boundary clear: transactions enforce catalog links, while the old append path enforces only point rules that do not need catalog state.
Checks
cargo fmt --all -- --checkcargo clippy --all-targets --all-features -- -D warningscargo test --all-targets --all-features(70 library tests plus property and bench targets)Closes #9
Closes #10