feat(activity): scale large reports with streaming aggregation - #1420
Conversation
roborev: Combined Review (
|
roborev: Combined Review (
|
roborev: Combined Review (
|
roborev: Combined Review (
|
roborev: Combined Review (
|
roborev: Combined Review (
|
- Preserve paging generations and redact report failures. - Align fractional bucket membership with the wire format. - Make large report requests failure-safe. - Keep session paging bounded and consistent. - Secure report paging and restore SQLite append speed. - Remove completed planning artifacts. - Harden paging and range scans. - Add scalable report paging and progress. - Stream report interval aggregation. - Align the scaling implementation plan. - Bound report candidate pairing at range edges. - Specify the scalable report architecture.
roborev: Combined Review (
|
- Preserve paging generations and redact report failures. - Align fractional bucket membership with the wire format. - Make large report requests failure-safe. - Keep session paging bounded and consistent. - Secure report paging and restore SQLite append speed. - Remove completed planning artifacts. - Harden paging and range scans. - Add scalable report paging and progress. - Stream report interval aggregation. - Align the scaling implementation plan. - Bound report candidate pairing at range edges. - Specify the scalable report architecture. fix(activity): inherit paging options from cursors Continuation cursors already bind the session sort, direction, and bucket. Applying request defaults first made valid non-default cursors unusable unless callers repeated every paging flag. Resolve explicit overrides against the signed cursor before defaulting omitted options. Cursor-only paging now preserves one deterministic ordering in daemon and direct database modes, while explicit mismatches remain invalid.
Long report refreshes inserted progress above the summary cards. Each update moved the full dashboard even though the existing report remained usable. Use the refresh control's fixed status footprint for each report phase and restore the relative update age when loading finishes. Localized text truncates inside that footprint instead of changing toolbar wrapping.
roborev: Combined Review (
|
Cobra populated omitted Activity sort and direction flags with their defaults. Cursor continuations then sent those values as explicit overrides and rejected valid non-default orderings unless users repeated every flag. Leave omitted flag values empty until the shared page normalizer runs. An explicitly supplied value still remains distinguishable and must match the signed cursor.
roborev: Combined Review (
|
Direct schema-v6 reports returned every session row but claimed that the report contained zero sessions. Consumers outside the paged server path could therefore receive contradictory report metadata. Derive the total from the complete artifact session set so direct and paged reports agree across every storage backend.
roborev: Combined Review (
|
Large Activity reports now finish without sending raw message-pair intervals
to the browser or keeping one interval object per pair during aggregation. The
version 6 report endpoint streams honest phase and row counters when requested,
preserves plain JSON on the same URL, and returns a bounded summary plus the
first session page. The CLI uses the same paging contract in daemon and direct
SQLite modes.
Session sorting, chart-bucket filtering, and subsequent pages now run on the
server. The Activity page keeps the current report visible while requests run,
cancels obsolete requests, clears stale bucket selections after every full
report refresh, and replaces the summary and table together if the archive
generation changed.
SQLite reuses its existing session-ordered message index for candidate scans,
avoiding a global timestamp index and its append-time write amplification.
PostgreSQL and DuckDB retain range-oriented candidate indexes. All three
backends feed shared Go semantics for clipping, gap handling, model attribution,
bucket membership, and aggregation.
The size-bounded cache only accelerates requests; signed, self-describing report
IDs let cache misses and daemon restarts recompute safely. PostgreSQL now applies
the persisted signing secret, empty keys are rejected, and every decoded report
query is checked against the public range, bucket, filter, and gap limits before
a rebuild starts. Cache-miss session pages retain the long-running request
contract, while streaming progress callbacks stay local to their owning client.
The remaining deliberate limit is usage deduplication: exact, mostly unique
usage data still needs memory proportional to matching report-range usage rows.
A strict bound would require an external spill-and-reduce design and is outside
this change.