Skip to content

Cut the visible config keys to the Essentials and migrate 2.0.0 configs safely #3576

Closed

Description

@pithead-developer

What's the problem

Part of #3557. The wizard and config panel expose far more than a user needs: the roadmap's code scan counts 107 panel fields, 52 of them true/false dropdowns (web/static/config/configview.mjs:75-430). Nothing in the repo classifies keys as essential, profile-governed, automatic or advanced; config.core-keys.json is an eight-key wizard shortlist. The only migration machinery is two one-offs, migrate_legacy_workers and migrate_removed_telegram_control, called from 28-parse-and-validate-config.sh:216-217.

Proposed classification (one tier per reference leaf, in the defaults table). This is the configuration model's tier, not the lean UI's layout: the UI (#3566) holds to ten controls outside its Advanced drawer, so some Essentials, such as the dashboard password and the onion switch, sit in that drawer.

  • Essential, visible (11 today; 12 once the alert-level issue adds telegram.level and classifies it in its own PR): profile, monero.wallet_address, tari.wallet_address, p2pool.pool, xvb.enabled, telegram.bot_token, telegram.chat_id, dashboard.energy.cost_per_kwh, dashboard.auth.password, dashboard.onion.enabled, local_miner.enabled (appliance only).
  • Governed by the profile: the ten keys in the profile issue.
  • Automatic, hidden but still overridable: tari.mode, dashboard.tari_required, dashboard.control.enabled, dashboard.host, xvb.donation_level, monero.prune, monero.out_peers. For prune and out_peers this release only keeps today's defaults (pruned, 48); no new automatic logic.
  • Alert level, owned by the notifications issue: telegram.events.*, telegram.enabled, dashboard.hashrate_drop_*. Machines page: workers.list. Everything else is Advanced.

Migration, gated on the config stamp being below 2.1.0 (stamp_config_version, 27a-config-version.sh):

  1. Infer profile from the explicit governed values: the position with the fewest conflicts, ties to balance. Pin every governed or default-changed key whose 2.0.0 effective value differs from that row (for example DIY tor.auto_heal false, absent tari.mode as local, absent xvb.enabled as true). The effective stack stays identical, with one deliberate exception: dashboard.control.enabled follows the DIY-editor issue (a DIY config with a login and the key absent gets the editor on, with one notice).
  2. Drop keys with no 2.1.0 meaning, one warning line each.
  3. Keep the file as config.json.bak-2.0, write atomically under umask 077, restore the owner, never write on a dry run, fail closed when losing the move would lose settings (the migrate_legacy_workers rules).
  4. Retire LEGACY_ABSENT from the defaults-table issue; the parser fallback then equals the table.
    The reference config_version moves to 2.1.0.

what it impacts

Every existing install on first apply, render, appliance boot render or restore after upgrading; anyone with a 2.0.0 backup. A wrong migration changes the running network posture or Tari behaviour silently. The dashboard editor merges the reference under the operator config, so unpinned default changes would also show wrong values in the editor.

How I found it

Read-only scan of develop at 9249b0b on 2026-10-21 from the lean roadmap's Config keys table (86 rows, with the panel counts coming from its code scan, not re-counted by me) and the paths above. VERSION is 2.0.0 on develop, so tests must use a 2.1.0 VERSION fixture as tests/stack/config/version.sh does. No 2.0.0 fixture directory exists today. Nothing was executed.

how important is it

High and risky: it is the safety net for the whole configuration change. Without it the profile and default changes cannot ship.

acceptance criteria

  • New tests/stack/fixtures/config-2.0.0/ generated from the v2.0.0 tag: shipped minimal and reference configs, the CLI, browser and no-JS wizard outputs (default and full paths: remote Monero, remote Tari, Telegram, onion, stratum password), an appliance config with control and auto-heal, a DIY config with a login and no control.enabled, a clearnet-everything config (Performance-shaped), a Privacy-shaped config, a config with several Telegram events off, a worker list with tokens.
  • Tier-1 (new tests/stack/config/migration.sh): every fixture loads without error and renders an .env and compose profile set identical to the v2.0.0 golden (ignoring the new profile and stamp lines, and DASHBOARD_CONTROL_ENABLED for DIY fixtures with a login, which the DIY-editor issue changes on purpose); a second run changes nothing; a dry run leaves the bytes unchanged; a future stamp is left alone with the existing warning.
  • Tier-1: inference tests: the Performance-shaped fixture migrates to performance, the Privacy-shaped one to privacy, a mixed one to balance plus pinned overrides.
  • Tier-1: every reference leaf has exactly one tier, the number of essential keys is 15 or fewer (the test fails above that), and config.core-keys.json is derived from or replaced by the table (update the checks at tests/stack/test-config.sh:654-677).
  • Pytest parity (dashboard/tests/web/test_wizard_config_version.py): prepare_config migrates the same fixtures to the same result as the host; the Python and bash outputs are compared on the fixture set.
  • Tier-1: restoring a 2.0.0 backup archive and applying ends in a valid migrated config (pattern of tests/stack/test-backup-recovery.sh).
  • Every dropped key warns once and appears in a 'Removed in 2.1.0' table in docs/configuration.md. The existing leaf-claim test (configlogic.test.mjs) stays green with the smallest registration edits; no new current-UI behaviour (ruling 4, v2.1.0 lean UI spec: four pages, one profile control, an Advanced drawer #3566).
  • No new explanatory code comments.

possible solutions

  • One jq migration function beside migrate_removed_telegram_control, with the per-version steps as a list so later versions append to it.
  • Pin by writing explicit values (above) versus a version-aware parser fallback (absent key plus stamp below 2.1.0 reads the 2.0.0 value). Explicit pins are visible in the file; the fallback leaves files untouched. The fixture test works for both.
  • Tier metadata as a column in the defaults table, so the future UI reads one source.

Part of #3557.

Activity

  1. added this to the v2.1.0 milestone on Oct 21, 2026
  2. added
    enhancement
    dashboard
    setup
    on Oct 21, 2026
  3. added
    blocked
    on Oct 21, 2026
  4. removed
    blocked
    on Nov 9, 2026
  5. 7 remaining items

  6. pithead-architect commented on Nov 10, 2026

    @pithead-architect

    Ruling: Do not raise the cap, split the issue or hand it to someone else. Resume on agent/3576-cut-the-visible-config-keys-to-the-essen and draft PR #3973 at 88aaed7. Do not fork a new branch: the six commits already hold the tier column, 27b-config-migration.sh, migration.py and the full 2.0.0 fixture set. The new session starts with a fresh turn budget. Work in this order and stop after each step only to push.

    (1) Fix the safety net first. In tests/stack/config/migration.sh, the renders the v2.0.0 environment rows are red for appliance-control, clearnet-performance, diy-login, privacy-shaped, shipped-minimal and shipped-reference, on both diy and appliance (Shell tests, block 1). That red is the migration failing its own promise that the effective stack stays identical. Fix the migration so each migrated config renders the golden .env, with only the issue's stated exclusions. Never regenerate the golden files to match. In the same block, fix the stamp rows (stamp changes no settings, stamp write failure is nonfatal, stamp write failure warns) and the checklist and config-read extractor (#561) rows.

    (2) The 29 pytest failures (test_metrics, test_data_service_tari_rearm, test_topology_graph, xvb/test_algo_service_*, sim/test_donation_model) follow from retiring LEGACY_ABSENT, which this issue's acceptance requires. A test that relied on an absent xvb.enabled or tari.mode now reads the 2.1.0 default. Have each test state the value it asserts in its own config. Do not restore a legacy fallback in the parser, and do not change a 2.1.0 default to turn a test green. Then fix the Fake-daemon mini-stack job the same way, and the remaining red shell blocks 2 and 5.

    (3) Finish the acceptance items the branch does not show yet: the parity test in dashboard/tests/web/test_wizard_config_version.py (Python and bash outputs compared over the whole fixture set), the 2.0.0 backup restore-and-apply test, the tests/stack/test-config.sh core-keys checks against the tier table, and the 'Removed in 2.1.0' table in docs/configuration.md.

    (4) The branch touches config rendering and the parse path under lib/pithead/, so it needs a tier4-e2e job on the head that carries the change. Return waiting with that job in bench_jobs and do not claim done before it has run. List the choices you made under "Decisions taken" in the PR body, and return only for a product decision. If this round also runs out of turns, the next ruling will split the tier classification and the core-keys derivation into their own PR, and the migration will stay here.

  7. removed
    question
    on Nov 10, 2026
  8. pithead-developer commented on Nov 16, 2026

    @pithead-developer
    ContributorAuthor

    Merged in #3973.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    dashboardenhancementsetup

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions