Skip to content

perf(monitor): keep refresh work compact and observable - #18

Merged
schiste merged 1 commit into
masterfrom
agent/implement-aetower-monitor-refresh-optimi
Oct 13, 2026
Merged

schiste merged 1 commit into
masterfrom
agent/implement-aetower-monitor-refresh-optimi

Conversation

@schiste

@schiste schiste commented Oct 13, 2026 •

Copy link
Copy Markdown
Owner

Problem

The Monitor's routine refresh path decoded the full snapshot even when the flat list only needed compact process rows. Failed or cancelled refreshes also lost phase-attempt metadata, which skewed attempt counts and timing means.

Root cause

The UI did not use a compact delta projection for the default Monitor view. In the error path, AppState recorded zero timings instead of preserving the worker's attempted phases and partial measurements.

Decision

Use compact process-row snapshots and deltas for the default flat Monitor, with full-snapshot fallback when a view feature or incomplete delta requires it. Preserve the thermal forecast across the FFI projection. Record phase durations as optional, count attempts separately from measured timing samples, and carry partial timings through failure and cancellation. Keep bridge_fetch_millis scoped to the full snapshot fetch.

Validation

  • swift test --package-path macos --filter 'MonitorLiveRowsTests|SnapshotRefreshTelemetryTests|MonitorViewModelTests': 12/12 passed.
  • swift test --package-path macos: 212/212 passed.
  • Aethyme verify-only submit on merged tree fe0fd9377ca78a2e75836ca7a16f8d1e373bed09: cargo-test passed, exit 0, 163.2 s.
  • SwiftLint strict on the 12 changed Swift files: 0 violations.
  • cargo fmt --all --manifest-path rust/Cargo.toml --check: passed.
  • git diff --check: passed.
  • Independent review: PASS; no blocking findings.

Risks and limitations

  • The regression test checks telemetry aggregation with synthetic failure timings; it does not exercise the worker failure and AppState cancellation paths end-to-end.
  • Monitor payload errors are still swallowed with try? and can be reported as no-change.
  • No before/after runtime benchmark or Release rebuild is claimed here. Local rebuild remains separate.

Scope and size

This is one cohesive change across the compact projection, UI fallbacks, FFI shape, telemetry, and tests. The broker warned that the PR exceeds its 800-line heuristic (14 files, 1,515 changed lines); splitting these coupled paths would make the behavior harder to review and keep synchronized.

Tracking

No matching pre-existing Aetower issue was found; this PR is the standalone delivery record.

Problem:
Routine Monitor refreshes decode large full snapshots, while failed refresh telemetry loses phase-attempt metadata and can distort phase means.

Decision:
Use compact process-row snapshots and deltas for the default flat Monitor path, with full-snapshot fallback when needed. Record nullable phase timings, separate attempts from measured samples, and carry partial timings through failed or cancelled refreshes.

Rationale:
Avoid unnecessary deep FFI decoding without changing rich-view behavior, preserve the legacy bridge_fetch_millis scope, and never treat an unmeasured duration as zero.

Validation:
- `swift test --package-path macos --filter 'MonitorLiveRowsTests|SnapshotRefreshTelemetryTests|MonitorViewModelTests'` passed (12/12).
- `swift test --package-path macos` passed (212/212).
- SwiftLint strict passed on 12 modified Swift files (0 violations).
- `cargo fmt --all --manifest-path rust/Cargo.toml --check` passed.
- `git diff --check` passed.
- Independent review returned PASS; it noted that failure telemetry aggregation is tested with synthetic timings, not end-to-end through AppState.
- The affected Aethyme `cargo-test` gate was not run because `.aethyme/gates.toml` has `reviewed=false`.

Alternatives considered:
Continue fetching full snapshots on every Monitor refresh; rejected because it preserves unnecessary deep decoding.

Risks:
Monitor payload errors remain swallowed by `try?` and may be classified as no-change. Release build and local app rebuild remain unverified.

Memory:
No new persistent state or external data collection.
@schiste
schiste marked this pull request as ready for review October 13, 2026 09:37
@schiste
schiste merged commit 00ceb76 into master Oct 13, 2026
7 checks passed
@schiste
schiste deleted the agent/implement-aetower-monitor-refresh-optimi branch October 13, 2026 10:00
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