Skip to content

Structure the Two install-tools.sh Report Cases a JSON Consumer Cannot Read #2299

Open

Description

@ptr727

Problem

A consumer of host-setup/linux/install-tools.sh --report --json cannot tell, from the structured fields alone, what --upgrade would do in two cases. HomeAutomation-Config's daily check-tools.sh reads only the structured fields, never the free text, and these are the two cases where that reading shows a wrong target or stays silent.

  1. A missing tool whose upstream repository is not configured reports the distribution's candidate as available. tool_effective_status turns only current and outdated into unmanaged, so a gh or node that is not installed, on a host with no github-cli.sources or nodesource.sources, stays missing, while its target is apt_candidate_version. --upgrade writes the upstream repository first and installs the upstream release, so a consumer rendering installed -> available names a distribution version the upgrade will not install.
  2. A gap in a tool's package set appears only in its free-text notes. A python3 that is current with packages from its required set not installed reports status: "current" and a note such as 2 package(s) not installed: .... --upgrade installs those packages, so the tool has pending work that no structured field says.

Constructed Reproduction

A host where node is not installed and /etc/apt/sources.list.d/nodesource.sources does not exist, and the distribution carries a nodejs candidate. The report row is:

{"tool": "node", "installed": null, "available": "<distribution candidate>", "status": "missing", ...}

Suggested Shape

  • For case 1, either report such a tool as unmanaged (with installed: null), or report available: null with a status a consumer can read as "would install from upstream".
  • For case 2, a structured field on the tool row, for example "pending_packages": ["..."], or a status other than current when the set is incomplete.

Either is a schema change for a consumer that switches on status, so a schema bump may be warranted.

Consumer

HomeAutomation-Config's check-tools.sh reads status, installed, and available, and renders unmanaged as moving to its upstream. It would pick up either change without parsing text, tracked in ptr727/HomeAutomation-Config#731.

Activity

  1. ptr727 commented on Oct 8, 2026

    @ptr727
    OwnerAuthor

    Claimed for the wsl lane (#2478), worked on this WSL2 Debian host.

    • Branch: feature/wsl-2299
    • Predicted file set: host-setup/linux/install-tools.sh, tests/test_install_tools.py, and docs/host-setup.md only where it documents the --json report fields

    Any other group needing one of these files waits for this branch to merge.

  2. ptr727 commented on Oct 8, 2026

    @ptr727
    OwnerAuthor

    Claim corrected: docs/host-setup.md is held by feature/wsl-672 and is out of this branch. The report fields are defined in the platform READMEs, so the file set for feature/wsl-2299 is host-setup/linux/install-tools.sh, tests/test_install_tools.py, host-setup/linux/README.md, and host-setup/windows/README.md only if a shared field or the shared schema number changes.

  3. ptr727 commented on Oct 8, 2026

    @ptr727
    OwnerAuthor

    Paused for a maintainer call. Branch feature/wsl-2299 holds a committed, unpushed fix for Linux. No pull request is open yet.

    What the Linux branch does. The JSON report moves to schema 2:

    • A tool that is not installed while its upstream repository is unconfigured reads unmanaged.
    • Every row carries pending_packages.
    • A current tool whose package set is part installed reads incomplete.

    Why it stopped. The two installers share the schema number and the common fields. The pre-push review found that the Windows installer has the case-2 shape, so leaving install-tools.ps1 at schema 1 is not a decision a worker should make alone:

    • A python whose python3 name answers nothing on PATH reports status: "current".
    • The work an apply would do appears only in a note, "python3 answers nothing on PATH, and -Install python creates it beside the managed interpreter".
    • Invoke-Apply runs Repair-PythonName after every python that did not fail, a current one included, so -Install and -Upgrade both act on it.

    This is not a package set, but a consumer reading status sees the same thing: current while an apply has work to do. Case 1 does not arise on Windows. Every source is winget, so a missing tool's available is the version an install takes.

    The question. Which of these should happen?

    1. Ship Linux schema 2 now. Windows stays at schema 1, its README records the python gap as a known difference, and a follow-up issue brings Windows to the same contract.
    2. Hold this branch until install-tools.ps1 also reports that python state in a structured field (for example incomplete) and moves to schema 2, so both platforms change their schema together.
    3. Something else.

    A second blocker, separate from the question. docs/host-setup.md around line 79 says the Linux README "defines the fields every platform shares". It also says a reader checks schema without noting that the number is per platform. Both statements stop being true once the platforms differ, and that file is claimed by feature/wsl-672.

  4. ptr727 commented on Oct 8, 2026

    @ptr727
    OwnerAuthor

    Maintainer answer, 2026-10-08, to the question above: hold for both platforms. Schema 2 ships when host-setup/windows/install-tools.ps1 also reports the pending python-name repair in a structured field and moves to schema 2 with it, so the two reports bump together rather than one platform at a time.

    feature/wsl-2299 holds the Linux half. It is pushed with no pull request, so the windows lane can add the .ps1 half on the same branch and open a single pull request for both. docs/host-setup.md line 79, which states the Linux README defines the fields every platform shares, needs its update in that same change once feature/wsl-672 releases the file.

  5. ptr727 commented on Oct 8, 2026

    @ptr727
    OwnerAuthor

    One finding from the last local review on feature/wsl-2299 (head dc22d52) is still open, because that branch had used its edit budget before the push: host-setup/linux/README.md line 58 ends "as it leaves any installed apt package". That is false for node, since node_install goes through apt_install_displacing, which replaces a distro nodejs with the NodeSource release in either mode. Drop the clause or name node as the exception when the Windows half opens the pull request.

  6. ptr727 commented on Nov 22, 2026

    @ptr727
    OwnerAuthor

    Maintainer's answer, 2026-11-22 (backlog burndown round 3): release feature/wsl-2299's file claim. The branch stays on the remote as a reference, and isn't deleted. Its files (host-setup/linux/install-tools.sh, host-setup/linux/README.md, host-setup/windows/README.md, tests/test_install_tools.py) are free for the backlog. #2299 is redone from develop in the WSL lane later.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions