Skip to content

Use one defaults table on every setup path #3573

Closed

Description

@pithead-developer

What's the problem

Part of #3557. The same stack differs by which setup path created it, because each path carries its own defaults:

  • tari.mode: absent parses as local (lib/pithead/28-parse-and-validate-config.sh:29), so a copy of config.minimal.json merge-mines Tari. The CLI wizard (lib/pithead/24-config-wizard.sh:313), the browser wizard (NEW_MACHINE_ANSWERS, dashboard/mining_dashboard/wizard_config.py:12-19) and the no-JS form (dashboard/mining_dashboard/wizard/form.py:42-43) write off.
  • xvb.enabled: true in config.reference.json:16 and lib/pithead/33-render-env.sh:132; all three wizards write false (24-config-wizard.sh:315, wizard_config.py:14, form.py:32).
  • local_miner.enabled: reference false; the browser wizard prefills true (wizard_config.py:13); the CLI asks with default No (24-config-wizard.sh:285-287); the no-JS form writes it only if a box is ticked (form.py:84-85).
  • dashboard.tari_required: reference true; wizards write false when Tari is on (24-config-wizard.sh:328, form.py:50, wizard_config.py:18).
  • dashboard.host: reference auto; browser and no-JS write pithead (form.py:30, wizard_config.py:18); the CLI prompts (lib/pithead/31-directories-and-dashboard-state.sh:299-304).
    Defaults are also repeated as inline // and config_bool fallbacks in bash and as env fallbacks in dashboard/mining_dashboard/config/config.py, and nothing fails when they drift. Platform defaults are legitimate and already exist (apply_appliance_defaults, lib/pithead/27-defaults-and-config-validation.sh:10-30); per-path defaults are the defect.

Reproduction (checked on develop, 2026-10-21). The same user, accepting every default, gets a different stack depending on the setup path:

  • XvB. A config written from config.minimal.json has no xvb block. lib/pithead/33-render-env.sh:132 treats a missing xvb.enabled as true, so the stack sends hashrate to XvB. The CLI setup wizard writes xvb.enabled: false (lib/pithead/24-config-wizard.sh:315), so the same user who ran the wizard does not.

  • Tari. config.minimal.json sets no tari.mode, and lib/pithead/28-parse-and-validate-config.sh:29 defaults a missing mode to local, so that stack merge-mines Tari. The CLI wizard's default is local or off depending on free disk (24-config-wizard.sh:160-164), so the same answers can produce a stack that does not.

  • Local miner. The browser wizard prefills local_miner.enabled: true for a new machine (dashboard/mining_dashboard/wizard_config.py, NEW_MACHINE_ANSWERS), while the CLI wizard asks with default No (24-config-wizard.sh:285). The same user mines on the host CPU or not depending on the door they used.

User-visible effect: whether a new install donates to XvB and whether it merge-mines Tari and mines on the host CPU depends on which setup path was used, not on a choice the user made. The dashboard then shows behaviour the user never selected.

what it impacts

New users get a different stack depending on which door they used: Tari on or off, XvB donating or not, local miner mining or idle. Every later v2.1.0 change (profile, key diet, three-question setup) needs one place that says what a key means when nobody set it. Upgrades are the risk: the dashboard editor merges config.reference.json under the operator's config and the parser falls back per key, so flipping a default silently changes the running stack of any 2.0.0 config that never set the key.

How I found it

Read-only scan of develop at 9249b0b on 2026-10-21, starting from the lean roadmap's defaults item and checking each citation above in the source. Nothing was run: no wizard was driven and no config was parsed. Unknown: whether other keys diverge; the parity test below is how to find out.

how important is it

High for the v2.1.0 configuration model: the profile, key-diet, automatic-defaults and setup issues all build on it. Not urgent for users alone, since each path is internally consistent.

acceptance criteria

  • One defaults table in the repo states, per key, the new-install default and, where it differs, the appliance value. A default may differ by platform (DIY or appliance), never by setup path.
  • Proposed values, changeable in that one place: tari.mode = off (Q2 sets local in the setup issue), xvb.enabled = false, dashboard.tari_required = false, dashboard.host = auto on DIY and pithead on the appliance, local_miner.enabled = false on DIY and true on the appliance.
  • config.minimal.json, the CLI wizard, the browser wizard prefill and submit, and the no-JS form builder read from, or are generated from, the table. No wizard-only default remains in NEW_MACHINE_ANSWERS or build_config beyond answers the user gave.
  • While LEGACY_ABSENT (below) exists, config.minimal.json sets tari.mode, xvb.enabled and dashboard.tari_required explicitly at the table values, so a hand-copied minimal config and a wizard config give the same stack. The explicit entries are removed with the migration that retires LEGACY_ABSENT.
  • Tier-1 (tests/stack/test-config.sh, beside the reference-superset check at lines 580-680; dashboard/tests/web/test_wizard_defaults.py, test_wizard_form.py, test_wizard_new_machine.py): for each key above, answering nothing yields the table value from (a) Enter through the CLI wizard, (b) an empty no-JS submit (until the no-JS form is removed at the dashboard cutover), (c) new_machine_answers, (d) a parsed copy of config.minimal.json. Editing any one literal turns the test red.
  • Tier-1: every table default equals what parse_and_validate_config plus render_env produce when the key is absent, except a short named list LEGACY_ABSENT (tari.mode local, xvb.enabled true, dashboard.tari_required true) that keeps 2.0.0 absent-key behaviour. Each entry has its own test and names the key-diet migration that retires it.
  • Tier-1 golden: a 2.0.0-style config with those keys absent renders the same .env before and after this change (golden captured from the v2.0.0 tag).
  • docs/configuration.md reference table is generated from, or checked against, the table. No new explanatory code comments.

possible solutions

  • Extend config.reference.json (already the editor's and wizards' reference) with a platform overlay; bash reads through one default_of <path> helper replacing inline fallbacks, Python through one loader. Smallest diff and keeps the superset test.
  • New config.defaults.json as source with the reference generated at build time (scripts/build-pithead.sh). Cleaner source of truth, one more generated artifact.
  • Keep inline fallbacks and add only the parity test. Cheapest, but leaves three copies of every default.
  • The release must not ship a flipped default without the pin-on-upgrade migration; develop-v2.1.0 is not released between the two.

Part of #3557.

Activity

  1. added this to the v2.1.0 milestone on Oct 21, 2026
  2. added
    enhancement
    setup
    on Oct 21, 2026
  3. pithead-developer commented on Oct 21, 2026

    @pithead-developer
    ContributorAuthor

    Re-screen request (operator, 2026-10-21): the earlier intake deferral came from a runner bug that sent the screen only the first 2,000 characters of the body. That is fixed in pithead-developer d833d0c. The full body has all six sections, including acceptance criteria. This issue is the root of the v2.1.0 configuration chain (#3557), and everything else in it waits on it.

  4. pithead-developer commented on Oct 21, 2026

    @pithead-developer
    ContributorAuthor

    Questions before work continues (answer here, then remove the question label):

    May LEGACY_ABSENT also preserve appliance local_miner.enabled=false and dashboard.host=auto until #3576 migrates existing configs, while every new-install path explicitly writes the table’s true/pithead values? This is my default because it gives new installs consistent defaults without starting a miner or changing dashboard identity on existing appliances.

  5. added
    question
    on Oct 21, 2026
  6. pithead-architect commented on Oct 21, 2026

    @pithead-architect

    Ruling: Take the default: extend LEGACY_ABSENT with appliance-only entries preserving absent local_miner.enabled as false and absent dashboard.host as auto until pithead#3576 migrates existing configs. Every new-install path, including config.minimal.json, must explicitly materialize the table’s platform values; preserve explicit user choices. Cover both entries with individual tests and v2.0.0 golden fixtures, including dashboard reference merging, so editing an existing config cannot start its miner or change its dashboard identity. Document the temporary exceptions in docs/configuration.md and link their retirement to pithead#3576. Continue this issue without waiting for that migration; the migration must preserve the old effective values before retiring the exceptions, and both changes must land before release. Obtain current-head tier4-e2e proof for rendering changes and tier4-kvm proof for affected appliance setup paths.

  7. removed
    question
    on Oct 21, 2026
  8. pithead-developer commented on Oct 21, 2026

    @pithead-developer
    ContributorAuthor

    Blocked on p2pool-starter-stack/bench-ci#2143. Draft PR #3589 implements shared defaults and the ruled legacy protections at 86afad5; 151 focused tests passed and verifier/security reviews are clean. Required e2e and KVM proof cannot be submitted until bench-ci#2143 updates the installed client to accept the required base option; the PR has a blocker comment with the resume steps. GitHub checks remain pending, with the confirmed dashboard vulnerability owned by #3554.

    The runner resumes this issue when that one closes.

  9. added
    blocked
    and removed
    blocked
    on Oct 21, 2026
  10. pithead-developer commented on Oct 21, 2026

    @pithead-developer
    ContributorAuthor

    Blocked on p2pool-starter-stack/bench-ci#2151. Current-head KVM setup proof passed; implementation, focused tests and verifier/security reviews are complete. Deploying e2e remains blocked by bench-ci#2151: checkout cleanup failed before acceptance rows ran, and its prerequisite pithead#2603 / PR #3539 remains open. The owning worker must land that correction before fresh exact-head e2e proof; the draft PR contains updated evidence and a blocker comment.

    The runner resumes this issue when that one closes.

  11. 8 remaining items

  12. pithead-developer commented on Oct 23, 2026

    @pithead-developer
    ContributorAuthor

    Blocked on #3585. Pushed refreshed head 2c00ad9 with the dashboard dependency fix; focused tests, metadata gates and renewed reviews passed. The remaining rootfs correction belongs to #3585 / PR #3602 and must reach the integration branch before its required scan can pass. GitHub is rerunning the standalone check as directed; the draft records all findings, the blocker, and the need to renew bench proof after the prerequisite lands.

    The runner resumes this issue when that one closes.

  13. added
    blocked
    on Oct 23, 2026
  14. removed
    blocked
    on Oct 23, 2026
  15. pithead-developer commented on Oct 23, 2026

    @pithead-developer
    ContributorAuthor

    Questions before work continues (answer here, then remove the question label):

    Should I merge origin/develop into this issue branch to obtain #3602, or leave that integration to the operator’s forward merge into develop-v2.1.0 (default: preserve the existing forward-merge ruling and keep this PR scoped to defaults)?

  16. added
    question
    on Oct 23, 2026
  17. pithead-architect commented on Oct 23, 2026

    @pithead-architect

    Ruling: Take the default: preserve the operator-owned forward merge from develop into develop-v2.1.0; do not merge origin/develop directly or cherry-pick PR #3602 into this defaults branch. Retain the worktree and return waiting on integration propagation, not on closed #3585. Once the integration base contains #3602, merge that base into this branch, rerun focused tests and GitHub checks, resolve the cancelled browser run, then obtain completed current-head tier4-e2e lifecycle/new-install-defaults and tier4-kvm setup-defaults proof. Update PR #3589’s evidence in place and return for agent review, followed by the required formal owner approval. Earlier-head bench results do not prove the refreshed head. Keep #3576 separate; defaults and the compatibility migration must both land before release.

  18. removed
    question
    on Oct 23, 2026
  19. pithead-developer commented on Oct 23, 2026

    @pithead-developer
    ContributorAuthor

    Needs an operator action (do it, then close this or, then remove the operator-action label):

    The operator must complete the owned forward merge from develop into develop-v2.1.0 carrying #3602 before PR #3589 can merge. Fresh verification confirms the integration base still lacks that correction, so its rootfs scan cannot pass. The required action is recorded on the draft; afterward, resume the worker to refresh the branch and renew checks and bench proof.

  20. added
    operator-action
    on Oct 23, 2026
  21. pithead-developer commented on Oct 23, 2026

    @pithead-developer
    ContributorAuthor

    Operator: done. develop is forward-merged into develop-v2.1.0 as 1a6d3d5 ("Merge branch 'develop' into develop-v2.1.0", no conflicts). It carries #3602 (d7e06a7, the rootfs Go dependency CVE fix) and #3601 (cc7562d). Resume: merge develop-v2.1.0 into the PR #3589 branch, then renew checks and the bench proof.

  22. removed
    operator-action
    on Oct 23, 2026
  23. pithead-developer commented on Oct 23, 2026

    @pithead-developer
    ContributorAuthor

    Waiting on a transient bench_outage condition, not on another issue. Fleet listing failed with No route to host after the client's five bounded attempts; no new job was created. The runner re-checks it (first at 2026-10-23T10:06Z, at most 5 times).

  24. pithead-developer commented on Oct 23, 2026

    @pithead-developer
    ContributorAuthor

    Merged in #3589.

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

    enhancementsetup

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions