Skip to content

v2.4.0 — DeepSea-inspired mining suite + btop-grade block template#1

Open
MarcanoFilms wants to merge 11 commits into
mainfrom
feat/deepsea-mining
Open

v2.4.0 — DeepSea-inspired mining suite + btop-grade block template#1
MarcanoFilms wants to merge 11 commits into
mainfrom
feat/deepsea-mining

Conversation

@MarcanoFilms

Copy link
Copy Markdown
Owner

Release 2.4.0. Adds a DeepSea-Dashboard–inspired mining suite and a higher-definition block-template treemap, on top of the v2.3 work.

What's new (user-facing)

  • Mining economics[mining] config (rig watts, electricity price, currency, pool fee, optional BTC price). The earnings panel shows Net/day (after pool fee), Power/day, and Profit/day in fiat. All opt-in: with defaults left at zero, nothing changes.
  • Worker online/offline alerts — toast when an Ocean worker stops hashing or comes back; the first observation is a silent baseline (no startup spam), reset when the payout address changes.
  • Payout progress bar — unpaid balance toward the Ocean payout threshold (formalized OceanEarnings.payout_threshold).
  • Block-template treemap — switched from quadrant (2×2) to sextant (2×3) rendering for ~50% more vertical resolution: btop-grade definition, mempool.space palette preserved.

Cleanups

  • app.py: except (ValueError, Exception)except Exception (redundant).
  • milestone_tracker: removed an unreachable % 100_000 branch.
  • Sanitized tests/test_state.py to the BIP-173 example address (no real wallet in the public repo).
  • .gitignore the .claude/ agent dir; bumped version to 2.4.0.

Commit structure

The first commit (chore: snapshot v2.3 WIP…) preserves uncommitted in-progress work so the feature commits apply on a clean base — it can be reset/re-split if a different structure is preferred.

Verification

  • 130 tests pass (17 new: 9 profitability + 8 worker-monitor).
  • Ruff clean on all new/modified files (pre-existing lint debt remains in some untouched v2.3 files).
  • App boots via Textual's test pilot; net-earnings render, ~…(est.) parsing, and worker-offline notifications verified by hand.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LZou3BQhbCSVhYfguwg2ZN

MarcanoFilms and others added 11 commits June 24, 2026 07:29
…me, Command Palette

Six-phase UI upgrade for sovereign Bitcoin Knots operators:

Phase 1 – Dashboard feels alive
- NodeStatus: rolling Sparkline trend charts for peers and mempool
- LiveIndicator: pulsing ● dot, goes stale after 90s without refresh
- Alert animation: opacity dip on peer/mempool threshold crossing
- BIP110Detector: red opacity flash on new spam violation

Phase 2 – Branding
- SplashScreen (ModalScreen): ASCII oracle eye, auto-dismiss 2.5s
- Configurable via [ui] splash = false

Phase 3 – Lite / Pro mode
- LiteDashboard: single-screen (Score + Sync + Peers + Mempool + DATUM)
- Sidebar filters available screens by tier at runtime
- Ctrl+P → Toggle Lite/Pro mode; [ui] mode = "lite" | "pro"

Phase 4 – Pruned / Archival awareness
- getindexinfo RPC → [ARCHIVAL] badge in SovereignStatusBar
- tx_index field added to SovereigntySnapshot

Phase 5 – Sovereignty Score
- analysis/sovereignty_score.py: composite 0-100 with letter grade A+…F
- Penalties: sync (25), peers (20), no-Knots (10), template spam (5/10/20),
  tip spam (8/15), chain health (5/10)
- #metric-score card on Dashboard and LiteDashboard
- MilestoneTracker: JSON-persisted toast on round-number block heights

Phase 6 – Stream recording theme
- Ctrl+T cycles oracle ↔ stream theme via screen CSS class toggle
- Screen.theme-stream descendant selectors in sovereign.tcss
- OracleCommandProvider (Ctrl+P): 16 fuzzy-search actions
- TooltipManager: first-open panel tips stored in ~/.local/share/…

Config: new [ui] section (mode/theme/screen_transitions/splash/tooltips/
sparkline_samples) — all keys optional, existing config.toml unchanged.

Tests: 87/87 pass (1.78s)
- 31 new unit tests for sovereignty_score.py
- 15 new unit tests for [ui] config parsing
- Smoke test fixed: splash=False + patched NodeClient.call for fast teardown

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…r in Textual 0.82

Widget.opacity is a read-only CSS property in Textual 0.82; animating it via
widget.animate("opacity", ...) raises AttributeError at runtime. The correct
API is widget.styles.animate("opacity", ...) which targets the CSS layer.

Fixed in: live_indicator, node_status, bip110_detector, splash, app.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Textual 0.82 raises ScreenError when dismiss() is called directly from a
message handler (on_key, action_*). Defer via call_after_refresh() so the
dismiss runs after the current message is fully processed. Timer callback
uses self.dismiss directly (safe — not a message handler).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…discard AwaitComplete

Root cause: Textual's invoke() awaits any awaitable returned by a callback.
dismiss() returns AwaitComplete, so passing self.dismiss directly to set_timer
or call_after_refresh caused invoke() to await it while active_message_pump
was still the SplashScreen, triggering ScreenError.

Fix:
- _safe_dismiss(): wraps dismiss(), returns None so invoke() has nothing to await
- on_key: async, calls await self.action_dismiss() — the built-in Screen action
  that calls dismiss() without awaiting its AwaitComplete
- _auto_dismiss timer: uses _safe_dismiss (not self.dismiss directly)
- BINDINGS: "escape" → "dismiss" (built-in action, already safe)

Added 3 regression tests that verify keypress, escape, and auto-timer dismiss
all complete without ScreenError (tests/ui/test_splash_screen.py).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Preserves the current working state so the new feature commits apply on a
clean base. Combined work-in-progress, not yet otherwise committed:

- Antigravity v2.3 follow-up (uncommitted): Ocean per-worker stats with
  ASIC-model detection, 3hr/24hr hashrate intervals, dense two-column
  PyBlock-style dashboard, node-status sparklines, status-bar polish.
- Earlier session work (untracked): block-template treemap widget
  (quadrant rendering), anim helpers, PyBlock API client, Ocean address
  persistence, and their tests.

This is a mechanical snapshot to protect existing work; it can be reset
and re-split if a different commit structure is preferred.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LZou3BQhbCSVhYfguwg2ZN
…nomics

Adds a [mining] config section (power_watts, power_cost_per_kwh, currency,
pool_fee_pct, btc_price) and a pure profitability module that turns gross
pool sat/day into pool-fee- and electricity-adjusted figures, with an
optional fiat profit/day when a BTC price is supplied. DeepSea-Dashboard
inspired, adapted for the terminal.

All inputs default to zero, so users who don't configure economics see no
change. Fully unit-tested (gross-only, fee clamping, power with/without
price, fiat profit/loss, conversion consistency).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LZou3BQhbCSVhYfguwg2ZN
In-memory WorkerMonitor diffs the active-worker set across refreshes and
returns came_online / went_offline transitions. The first observation is a
baseline that emits nothing, so a restart never replays stale alerts.
DeepSea-Dashboard inspired. Unit-tested incl. baseline, simultaneous
transitions, reset, and arbitrary iterables.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LZou3BQhbCSVhYfguwg2ZN
Wires the two new building blocks into the DATUM/Ocean panel:
- Net/day, Power/day and Profit/day lines appear in the earnings column
  only when [mining] economics are configured.
- Worker status changes raise toast notifications (offline = warning,
  back online = info); the monitor is reset when the payout address
  changes so a new account isn't reported as "came online".
- Robust BTC->sats parsing that tolerates the "~… (est.)" estimate form.

Also formalizes OceanEarnings.payout_threshold as a declared field (it was
being set dynamically), backing the existing payout-progress bar.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LZou3BQhbCSVhYfguwg2ZN
- app.py: `except (ValueError, Exception)` -> `except Exception` (the
  first member was already subsumed by the second).
- milestone_tracker: drop the unreachable `% 100_000` branch; every
  multiple of 100k is already caught by the `% 10_000` check, which
  returned the same event id.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LZou3BQhbCSVhYfguwg2ZN
Switches the block-template cells from quadrant (2x2 = 4 sub-pixels) to
sextant glyphs (U+1FB00 range, 2x3 = 6 sub-pixels), giving 50% more
vertical resolution per character — the dense, high-definition texture of
btop's graphs — while keeping two colours per cell for clean tx borders.
Raises the cell budget to 900 to use the larger sub-pixel canvas.

Preserves antigravity's mempool.space palette and rounded border. A
generic two-means colour reduction maps the 6 sub-pixels to a (glyph,
fg, bg) cell via a verified row-major bit table.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LZou3BQhbCSVhYfguwg2ZN
- Bump version 2.3.0 -> 2.4.0.
- README: add the v2.4 mining suite to the intro and feature table.
- Sanitize tests/test_state.py: replace a real wallet with the BIP-173
  example address so the public repo doesn't embed a personal payout.
- gitignore the .claude/ agent working directory.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LZou3BQhbCSVhYfguwg2ZN
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