Skip to content

Land the layering-cleanup plan and promote its two open items (v1.6.1) - #45

Merged
binlecode merged 1 commit into
mainfrom
docs/land-layering-cleanup-plan
Jul 30, 2026
Merged

binlecode merged 1 commit into
mainfrom
docs/land-layering-cleanup-plan

Conversation

@binlecode

Copy link
Copy Markdown
Owner

Summary

docs/TODO-layering-cleanup-2026-07-02.md drove LC-1 → LC-3 (shipped v1.2.4–v1.3.0: SystemSnapshot as the sole frame contract, ProcessSample through L2, and analytics.py taking AlertEngine / throttling / session energy out of the widget) — but it lived only on the unmerged lc-2-process-sample branch. The code shipped while its rationale stayed unpublished.

This lands it as the design record, then deletes that branch.

§§1–9 are kept verbatim as the July plan, so their line references point at July code — flagged in the header rather than silently rewritten, since rewriting them would destroy the record of what was actually decided.

Status verified against main @ v1.6.0

Confirmed shipped: MetricsUpdated carries exactly the snapshot (§8-3), and every internal §8-5 lists is gone from tui/ — analytics.py holds attribute_power, domain_throttling, bandwidth_percent, package_power_percent, AlertFrame, AlertEngine.

New §10 records the only open scope:

Item Status
§10.1 — LC-4 RollingStats Open, low priority. Watt/GB-s deques + _avg_max still in HardwareDashboard.
§10.2 — Export parity Open, highest value here. Processes / alerts / session energy never reach --json / --serve.
§10.3 — §8-1's literal grep Does not pass; should be reworded, not "fixed".

§10.2 is the one that matters

export.py emits nothing for three data points the TUI has:

  • Processes — on the snapshot, but the export loops build Monitor(interval_s, subsamples) without include_processes=True, so the list is always empty.
  • Alerts / throttle flags and session energy — produced by analytics.AlertEngine, which only the dashboard widget ever drives.

Someone profiling a local inference run through the export backends gets watts and utilization but cannot answer which process drew them, did the chip throttle, or what did the run cost in energy — the questions that profiling session exists to ask. Both candidate designs are recorded (opt-in export flags vs. moving AlertEngine behind Monitor), with a recommendation and the per-PID Prometheus cardinality constraint that keeps process data NDJSON-only either way.

§10.3 — why not just fix the import

grep "from actop.utils import" actop/tui/*.py still matches: tui/app.py imports get_soc_info for one construction-time call, create_dashboard_config(args, get_soc_info()). The criterion was written to kill per-frame L1 acquisition in the view, and that is gone — nothing in the render loop touches L1. Routing a single startup call through another module to satisfy a grep would add indirection for no layering gain, so the doc says reword the criterion.

Roadmap

Both open items promoted into docs/TODO-architecture-roadmap.md, which is where that file says open work is tracked (it explicitly excludes completed work).

Validation

Docs only — no code change.

.venv/bin/ruff check .            # All checks passed
.venv/bin/ruff format --check .   # 64 files already formatted
.venv/bin/pytest -q -m "not local"  # 95 passed, 44 deselected

🤖 Generated with Claude Code

docs/TODO-layering-cleanup-2026-07-02.md drove LC-1 through LC-3 (shipped
v1.2.4-v1.3.0: SystemSnapshot as sole frame contract, ProcessSample through L2,
analytics.py taking AlertEngine/throttle/session-energy out of the widget), but
it lived only on the unmerged lc-2-process-sample branch. The code shipped while
its rationale stayed unpublished.

Landed as the design record, with status verified against main at v1.6.0. Kept
sections 1-9 verbatim so they read as the July plan (their line references point
at July code, noted in the header); added section 10 for the only open scope:

- 10.1 LC-4: watt/GB-s history deques and _avg_max never moved to an
  analytics.RollingStats. Low priority - relocates working code.
- 10.2 Export parity: per-process rows, throttle/alert flags, and session energy
  are TUI-only and never reach --json/--serve, so profiling a local inference run
  through the export backends cannot answer which process drew the watts, whether
  the chip throttled, or the run's total energy. Records both candidate designs,
  the recommendation, and the per-PID Prometheus cardinality constraint.
- 10.3 One acceptance criterion does not literally pass and should be reworded,
  not "fixed": tui/app.py imports get_soc_info for a single construction-time
  call. The criterion targeted per-frame L1 acquisition in the view, which is
  gone; beating the grep would add indirection for no layering gain.

Both open items promoted into TODO-architecture-roadmap.md, which is where open
work is tracked.

Docs only - no code change. 95 passed (-m "not local"), ruff clean.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@binlecode
binlecode merged commit 9544ad7 into main Jul 30, 2026
5 checks passed
@binlecode
binlecode deleted the docs/land-layering-cleanup-plan branch July 30, 2026 00:35
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