diff --git a/README.md b/README.md index a7ae17657..95771285b 100644 --- a/README.md +++ b/README.md @@ -23,13 +23,13 @@ Agent enablement for a fleet of repositories: autonomy and repeatable quality in **Summary**: -- Agent enablement for the fleet: shared rules, a machine-readable spec, a fleet registry, per-repo audit reports, and an audit-agent instruction set, so an agent works autonomously inside guardrails that prove the result. Ships no application code. +- Agent enablement for the fleet: shared rules, a machine-readable spec, a fleet registry, per-repo audit reports, and an audit-agent instruction set. These let an agent work autonomously inside guardrails that prove the result. Ships no application code. See [Release History][history] for the full history. ## Getting Started -This repo has two kinds of reader, a human and an AI coding agent, and they enter at different doors. **An agent starts at [AGENTS.md][agents]**, which maps a task to the document that governs it and is written to be read one section at a time. **A human starts here**, and the table below is the fork: find the row that describes why you opened this page, and read the one it points at rather than the whole file. +This repo has two kinds of reader, a human and an AI coding agent, and they enter at different doors. **An agent starts at [AGENTS.md][agents]**. It maps a task to the document that governs it and is written to be read one section at a time. **A human starts here**, and the table below is the fork. Find the row that describes why you opened this page, and read the one it points at rather than the whole file. | You are | Your question | Start at | | --- | --- | --- | @@ -41,7 +41,7 @@ This repo has two kinds of reader, a human and an AI coding agent, and they ente | Reporting a defect or proposing a rule | Where does that go, and what does it need? | [Questions or Issues][questions-or-issues] | | An AI coding agent | Which document governs the task in front of me? | [`AGENTS.md`][agents] | -Nothing here is installed as a dependency. The rules are read, the baseline is carried into a repository as files it then owns, and the one thing that is genuinely installed is the host guardrail kit, which lands in your home directory rather than in any repository. +Nothing here is installed as a dependency. The rules are read, and the baseline is carried into a repository as files it then owns. The one thing that is genuinely installed is the host guardrail kit, which lands in your home directory rather than in any repository. ## Table of Contents @@ -73,22 +73,22 @@ Nothing here is installed as a dependency. The rules are read, the baseline is c ## What This Repo Is -**The purpose is agent enablement.** An AI coding agent is fast and inconsistent, so a fleet built by one drifts a different way in every repository, and the drift stays invisible until something breaks where it matters. What this repo makes repeatable is the outcome: an agent stands a repository up, changes it, and releases it on its own, and lands in the same known-good shape every time. The guardrails are what make granting that autonomy sound rather than reckless. +**The purpose is agent enablement.** An AI coding agent is fast and inconsistent, so a fleet built by one drifts a different way in every repository. For the same reason, the drift stays invisible until something breaks where it matters. What this repo makes repeatable is the outcome: an agent stands a repository up, changes it, and releases it on its own, and lands in the same known-good shape every time. The guardrails are what make granting that autonomy sound rather than reckless. -**Guardrails here enable rather than restrain.** A rule earns its place by removing a decision an agent would otherwise make differently every time, or by making a failure loud that would otherwise pass green. Write safety bounds what an agent can reach outside the project in front of it, the review loop closes before anything merges, and the audit proves the result instead of accepting the agent's report of it. Autonomy extends exactly as far as the verification reaches. +**Guardrails here enable rather than restrain.** A rule earns its place by removing a decision an agent would otherwise make differently every time. A rule can instead earn it by making a failure loud that would otherwise pass green. Write safety bounds what an agent can reach outside the project in front of it. The review loop closes before anything merges. The audit proves the result instead of accepting the agent's report of it. Autonomy extends exactly as far as the verification reaches. -**Nothing here is finished.** Every rule traces to a specific failure, nearly all of them observed in this fleet rather than imagined, and a procedure that lets a new one through is corrected as part of the work that found it. The ground truth improves by being used. +**Nothing here is finished.** Every rule traces to a specific failure, nearly all of them observed in this fleet rather than imagined. A procedure that lets a new failure through is corrected as part of the work that found it. The ground truth improves by being used. -This repo is the single home for those rules, a machine-readable spec they are checked against, a registry of the projects, and an audit-agent instruction set. It ships no application code. Each project owns its own implementation and is **audited** against the ground truth here, to the letter (exact file, section, or config) or to intent (an equivalent outcome). +This repo is the single home for those rules and for a machine-readable spec they are checked against. It is likewise the single home for a registry of the projects and an audit-agent instruction set. It ships no application code. Each project owns its own implementation. Each project is **audited** against the ground truth here, to the letter (exact file, section, or config) or to intent (an equivalent outcome). - **[AGENTS.md][agents]** - the agent entry point: context and delegation rules, plus the map from a task to the section that governs it. -- **[GOVERNANCE.md][governance]** - cross-cutting rules for AI coding agents: git, branching, release model, doc style, the recurring-violation rules (comments, ASCII charset, US spelling, line endings), PR review etiquette, and workflow YAML conventions. +- **[GOVERNANCE.md][governance]** - cross-cutting rules for AI coding agents. They cover git, branching, release model, doc style, the recurring-violation rules (comments, ASCII charset, US spelling, line endings), PR review etiquette, and workflow YAML conventions. - **[CODESTYLE.md][codestyle]** - code style for .NET and Python. - **[WORKFLOW.md][workflow]** - the CI/CD workflow contract (behavioral guarantees D1-D9) and its audit methodology. - **[STANDUP.md][standup]** - how an agent stands a repository up and carries the baseline it is owed. - **[AUDIT.md][audit]** - how an agent audits a repository against the spec and reports drift. - **[RESYNC.md][resync]** - how an agent brings an already-stood-up repository back into line, in the order the remedies require. -- **[spec/][spec]** - the machine-readable ground truth: project-type requirements, the file/section baseline, required/forbidden secrets, the host tool contract and its version floors, and the preferred README structure. +- **[spec/][spec]** - the machine-readable ground truth. It covers project-type requirements, the file/section baseline, required/forbidden secrets, the host tool contract and its version floors, and the preferred README structure. - **[registry/repos.json][repos]** - the fleet registry: every project, its type(s), publish mechanism, and status (cataloged, standardization backlog, archived, or excluded). `spec/audit.py` checks the registry against the owner's actual GitHub repos, not just against itself, so a repo can't go missing from it unnoticed. - **[repo-config/][repo-config]** - hub-only branch rulesets, fleet settings, the apply script, and the GitHub setup reference (kept out of `.github/`, which is Actions-owned). - **[host-setup/][host-setup-dir]** - the host guardrail kit, which is per machine rather than per repository. @@ -96,27 +96,27 @@ This repo is the single home for those rules, a machine-readable spec they are c - **[reports/][reports]** - per-repo audit output. - **[docs/][docs]** - the human setup and reference guides: host prerequisites, SSH signing, devcontainers, and the carry procedures. -**The words a request is phrased in are defined here.** A repository is asked to audit itself against the hub, or to close the review loop on a pull request, and the phrasing carries the whole instruction, so each term below names the file that answers it and a request using one is a complete instruction rather than a starting point for interpretation. +**The words a request is phrased in are defined here.** A repository is asked to audit itself against the hub, or to close the review loop on a pull request. The phrasing carries the whole instruction, so each term below names the file that answers it. For the same reason, a request using one is a complete instruction rather than a starting point for interpretation. - **The hub** - this repository. It is the single authority on what a fleet project is supposed to hold, and every rule naming the hub means this one. - **The fleet** - the projects listed in [registry/repos.json][repos], each audited downward against the ground truth here rather than negotiating its own. - **Stand a repository up** - carry the baseline a project is owed for its declared types and workflow model, per [STANDUP.md][standup]. An absent file is a baseline that never arrived rather than drift. - **Audit a repository** - read a live project against the spec and report its drift, per [AUDIT.md][audit]. The audit never edits what it measures, so a fix is a separate change. - **Resync a repository** - bring an already-stood-up project up to the current hub, per [RESYNC.md][resync]. It audits for the findings and then applies them in order, which includes deleting what the hub hosts rather than carries. -- **Close the review loop** - request a review at the defined moments, confirm the head commit is covered, triage every finding, reply and resolve, and escalate when stuck, per [GOVERNANCE.md "PR Review Etiquette"][governance-pr-review-etiquette]. +- **Close the review loop** - request a review at the defined moments and confirm the head commit is covered. Triage every finding, reply and resolve, and escalate when stuck. The steps are set out in [GOVERNANCE.md "PR Review Etiquette"][governance-pr-review-etiquette]. - **Carried against reached** - a project carries the content it is audited against and reaches the machinery that is identical everywhere, per [GOVERNANCE.md "Hub-Hosted Tooling"][governance-hub-hosted-tooling]. ## What It Achieves -Keeping a fleet of repositories consistent has always been a tax paid in review attention, and it stops scaling at the point where one person can no longer hold every repo in their head. An agent changes that arithmetic in both directions at once. It can apply a convention across every repository in an afternoon, and it can spread a mistake exactly as fast. What makes the speed worth having is a ground truth an agent can read, a gate that proves the result rather than reporting it, and a boundary naming the decisions that are never the agent's to make. Each objective below is a standing capability, with the machinery that delivers it named so the claim is checkable. +Keeping a fleet of repositories consistent has always been a tax paid in review attention. It stops scaling at the point where one person can no longer hold every repo in their head. An agent changes that arithmetic in both directions at once. It can apply a convention across every repository in an afternoon, and it can spread a mistake exactly as fast. What makes the speed worth having is a ground truth an agent can read and a gate that proves the result rather than reporting it. A boundary naming the decisions that are never the agent's to make is equally what makes the speed worth having. Each objective below is a standing capability, with the machinery that delivers it named so the claim is checkable. -- **Workflow consistency, by contract rather than by copy.** Every repo satisfies one behavioral CI/CD contract ([WORKFLOW.md][workflow], guarantees D1 to D9) instead of inheriting one YAML file it then edits. The fixed part is the orchestration seam, meaning job names, the ruleset-bound required check, and the artifact handoff. What a repo builds inside that seam is its own, so a Hugo site and a NuGet package satisfy the same contract without pretending to be the same pipeline. -- **Technical consistency that does not depend on anyone remembering it.** One line-ending policy, one comment shape, one character set, one US-English convention, and one config per linter shared by the editor, the CLI, and CI. A rule that holds in review therefore holds on a laptop and in the pipeline, because all three read the same file rather than three copies that drift apart. +- **Workflow consistency, by contract rather than by copy.** Every repo satisfies one behavioral CI/CD contract ([WORKFLOW.md][workflow], guarantees D1 to D9) instead of inheriting one YAML file it then edits. The fixed part is the orchestration seam, meaning job names, the ruleset-bound required check, and the artifact handoff. What a repo builds inside that seam is its own. A Hugo site and a NuGet package therefore satisfy the same contract without pretending to be the same pipeline. +- **Technical consistency that does not depend on anyone remembering it.** One line-ending policy, one comment shape, one character set, one US-English convention, and one config per linter shared by the editor, the CLI, and CI. A rule that holds in review therefore holds on a laptop and in the pipeline. This is because all three read the same file rather than three copies that drift apart. - **Best practices promoted once, not re-litigated per repo.** A practice that proves itself becomes fleet law in [GOVERNANCE.md][governance] or [CODESTYLE.md][codestyle] and is carried, rather than being rediscovered and re-argued in the next repository. Every rule here traces to a specific failure that actually happened, which is why the collection is opinionated and small rather than exhaustive. -- **Feedback loops that close on the procedure, not the instance.** [AUDIT.md][audit] reads a live repo and reports drift, the per-repo reports in [reports/][reports] record it, and a repo that cannot be stood up from the docs alone is a documentation defect tracked in the [conformance matrix][matrix]. When a downstream agent hits something the procedure did not cover, the fix lands in the procedure so the next repo never meets it. +- **Feedback loops that close on the procedure, not the instance.** [AUDIT.md][audit] reads a live repo and reports drift. The per-repo reports in [reports/][reports] record it. A repo that cannot be stood up from the docs alone is a documentation defect tracked in the [conformance matrix][matrix]. When a downstream agent hits something the procedure did not cover, the fix lands in the procedure so the next repo never meets it. - **Onboarding a new language or deployment target is a spec change.** Thirteen project types are declared today in [spec/project-types.json][project-types]. Adding one means declaring its detection, its checks, and the files it carries, then proving a context-free agent can stand it up cold. No fleet-wide rewrite, and no per-repo improvisation. -- **Re-deployment that is measured and traceable.** Versions come from git history through NBGV rather than a hand-edited number, a release is always a deliberate act and never a side effect of a merge, and staleness is detected by **content hash against the hub's own past revisions**, so the audit can say whether a repo is behind the canonical or has forked it. A version stamp is a claim a repo can keep while editing the content underneath, so it is never trusted for that answer. -- **Every carried unit declares how much freedom it grants.** This is the distinction that makes the whole thing tolerable to work in, and it is a field on each [spec/files.json][files] entry rather than something a reader infers from the file's shape. An entry that names no level takes `presence`, the most permissive one, so silence grants freedom rather than withholding it: +- **Re-deployment that is measured and traceable.** Versions come from git history through NBGV rather than a hand-edited number. A release is always a deliberate act and never a side effect of a merge. Staleness is detected by **content hash against the hub's own past revisions**. The audit can therefore say whether a repo is behind the canonical or has forked it. A version stamp is a claim a repo can keep while editing the content underneath, so it is never trusted for that answer. +- **Every carried unit declares how much freedom it grants.** This is the distinction that makes the whole thing tolerable to work in. It is a field on each [spec/files.json][files] entry rather than something a reader infers from the file's shape. An entry that names no level takes `presence`, the most permissive one, so silence grants freedom rather than withholding it: | Level | The obligation | Who owns the content | | --- | --- | --- | @@ -125,11 +125,11 @@ Keeping a fleet of repositories consistent has always been a tax paid in review | `intent` | Reach the same outcome, judged by meaning | The repo owns the wording and shape. | | `presence` | The unit exists | The repo owns all of it. | -- **The human contributes where domain expertise is decisive, and only there.** The maintainer keeps what an agent cannot know or must not decide: creating a repository, granting a write outside the owner boundary, changing a ruleset, approving every merge, and every judgment about the domain a repo actually serves. The agent takes the mechanical scale-out, which is the part that does not benefit from human attention and degrades under it. A repo's own knowledge also has a declared destination rather than an improvised one, chosen by what the content is: `CODESTYLE.md` for conventions beyond the carried rules, `ARCHITECTURE.md` for how a code repo is built, `OPERATIONS.md` for how a live-service repo is run, and `TODO.md` for its backlog. Which of those a repo carries follows from what it is, so this hub holds the two that apply to it. Domain expertise therefore lands somewhere declared instead of being diluted into a carried file that the next re-vendor overwrites. +- **The human contributes where domain expertise is decisive, and only there.** The maintainer keeps what an agent cannot know or must not decide: creating a repository, granting a write outside the owner boundary, changing a ruleset, approving every merge, and every judgment about the domain a repo actually serves. The agent takes the mechanical scale-out, which is the part that does not benefit from human attention and degrades under it. A repo's own knowledge also has a declared destination rather than an improvised one, chosen by what the content is. The destinations are `CODESTYLE.md` for conventions beyond the carried rules and `ARCHITECTURE.md` for how a code repo is built. They are also `OPERATIONS.md` for how a live-service repo is run and `TODO.md` for its backlog. Which of those a repo carries follows from what it is, so this hub holds the two that apply to it. Domain expertise therefore lands somewhere declared instead of being diluted into a carried file that the next re-vendor overwrites. ## How This Repo Operates -ProjectTemplate follows the same model it documents, and audits its own rules against itself (it classifies as the source-only, docs, and python project types in [WORKFLOW.md][workflow]). +ProjectTemplate follows the same model it documents. It audits its own rules against itself (it classifies as the source-only, docs, and python project types in [WORKFLOW.md][workflow]). The doors a session enters through, and where each leads, matching the "Getting Started" table above: @@ -150,14 +150,14 @@ The full entry-point map behind these doors, with the gap register and the roadm Within this repo, day-to-day development follows the same branching, CI, review, and release model it documents for the fleet: -- **Branching.** Persistent `main` and `develop`, each with its own ruleset. This repo uses the default `release` workflow model: commit on feature branches only, feature branch to `develop` is squash-merged, `develop` to `main` is a merge commit, and `develop` is forward-only (no `main -> develop` back-merges). Live-service config repos instead use the `operational` model (registry `workflowModel`), with direct signed commits to `develop`, promoted to `main` by an occasional PR. See [GOVERNANCE.md "Branching Model"][governance-branching-model]. -- **CI lints and tests, and builds nothing.** The PR gate calls the fleet's reusable validator, `.github/workflows/validate-task.yml`, whose header names every job it runs, among them the unit-test job that runs the Python suite under `tests/` with coverage uploaded to Codecov. The hub's own validate hook, `.github/actions/validate/action.yml`, adds the registry and spec checks and the self-tests outside that suite, and the ruleset-bound `Check pull request workflow status job` aggregator gates the merge. The same lint configs (`.markdownlint-cli2.jsonc`, `cspell.json`) drive the editor extensions, the CLI, and CI. -- **Review loop.** Every PR enters the GitHub Copilot review loop and must reach a green review result before merging. The agent drives that loop and merges only with explicit maintainer permission. CodeRabbit and Qodo remain advisory candidates under the measured [pull request reviewer evaluation][pr-reviewer-evaluation], and the [reviewer reference][pr-reviewer-reference] records how each reviewer behaves and which repositories it covers. See [GOVERNANCE.md "PR Review Etiquette"][governance-pr-review-etiquette]. +- **Branching.** Persistent `main` and `develop`, each with its own ruleset. This repo uses the default `release` workflow model: commit on feature branches only, and a feature branch to `develop` is squash-merged. In that model, promotion from `develop` to `main` is a merge commit, and `develop` is forward-only (no `main -> develop` back-merges). Live-service config repos instead use the `operational` model (registry `workflowModel`), with direct signed commits to `develop`, promoted to `main` by an occasional PR. See [GOVERNANCE.md "Branching Model"][governance-branching-model]. +- **CI lints and tests, and builds nothing.** The PR gate calls the fleet's reusable validator, `.github/workflows/validate-task.yml`, whose header names every job it runs. Among them is the unit-test job that runs the Python suite under `tests/` with coverage uploaded to Codecov. The hub's own validate hook, `.github/actions/validate/action.yml`, adds the registry and spec checks and the self-tests outside that suite. The ruleset-bound `Check pull request workflow status job` aggregator gates the merge. The same lint configs (`.markdownlint-cli2.jsonc`, `cspell.json`) drive the editor extensions, the CLI, and CI. +- **Review loop.** Every PR enters the GitHub Copilot review loop and must reach a green review result before merging. The agent drives that loop and merges only with explicit maintainer permission. CodeRabbit and Qodo remain advisory candidates under the measured [pull request reviewer evaluation][pr-reviewer-evaluation]. The [reviewer reference][pr-reviewer-reference] records how each reviewer behaves and which repositories it covers. See [GOVERNANCE.md "PR Review Etiquette"][governance-pr-review-etiquette]. - **Release.** A `develop -> main` merge is promoted through a GitHub release (tag plus a source zip, README, and LICENSE). Versioning is NBGV-driven from [version.json][version]. See [WORKFLOW.md][workflow]. ## Using This Repo -Four things are deployed from here, and they land in different places. The host guardrails install once per machine, the fleet skills install once per user on that machine, the baseline is carried once per repository, and the audit is run whenever a repository changes materially. Do them in that order on a new machine, because the guardrails bound every session that follows and retrofitting them means the sessions in between ran unguarded. +Four things are deployed from here, and they land in different places. The host guardrails install once per machine, and the fleet skills install once per user on that machine. The baseline is carried once per repository, and the audit is run whenever a repository changes materially. Do them in that order on a new machine. This is because the guardrails bound every session that follows and retrofitting them means the sessions in between ran unguarded. ### Deploy the Host Guardrails @@ -184,46 +184,46 @@ Restart Claude Code sessions on the machine afterward so the hook and the render ### Install the Fleet Skills -The skills are the per-topic rules packaged so they surface in an agent session by trigger, instead of being re-read from the law docs each time. They install once per user per machine, from a hub checkout, and land beside the guardrails rather than in any repository: +The skills are the per-topic rules packaged to surface in an agent session by trigger, instead of being re-read from the law docs each time. They install once per user per machine, from a hub checkout, and land beside the guardrails rather than in any repository: ```shell python3 scripts/skills_install.py # or the scripts/skills_install.sh / .ps1 wrapper python3 scripts/skills_install.py --report # read-only: what does each channel hold? ``` -A host stood up end to end by the [`host-setup/`][host-setup-dir] bootstrap gets this step at the end of its host mode, so a fresh machine finishes with the tools, the identity, and the skills together. [`docs/host-setup.md`][host-setup] "Fleet Skills Install" carries the details, including how the install degrades where the `claude` CLI is absent. +A host stood up end to end by the [`host-setup/`][host-setup-dir] bootstrap gets this step at the end of its host mode. A fresh machine therefore finishes with the tools, the identity, and the skills together. [`docs/host-setup.md`][host-setup] "Fleet Skills Install" carries the details, including how the install degrades where the `claude` CLI is absent. ### Carry the Rules Into a Repository -A repository that does not exist yet is stood up with [`STANDUP.md`][standup], which is ordered rather than a menu: verify commit identity and signing before the first commit, hand the maintainer what only they can supply, classify the repo and write its [registry][repos] entry, carry the instruction set before authoring anything of your own, then carry the remaining baseline, the workflows, and the settings. The two steps with a closing window are first, because signing has to be live before the first commit and the rules have to be loaded before the first authored file. +A repository that does not exist yet is stood up with [`STANDUP.md`][standup], which is ordered rather than a menu. The order is to verify commit identity and signing before the first commit, and to hand the maintainer what only they can supply. Next, classify the repo and write its [registry][repos] entry, and carry the instruction set before authoring anything of your own. Then carry the remaining baseline, the workflows, and the settings. The two steps with a closing window are first. This is because signing has to be live before the first commit, and the rules have to be loaded before the first authored file. -A repository that already exists is measured with [`AUDIT.md`][audit] instead. The audit is read-only and ends in a report under [reports/][reports], so nothing is changed by measuring, and applying what it found is a separate reviewable change per its section 10. Onboarding is complete when the repo passes, or has a hub-committed report plus a tracking issue for the residual deltas, per [GOVERNANCE.md "Repository Onboarding and Conformance"][governance-repository-onboarding-and-conformance]. +A repository that already exists is measured with [`AUDIT.md`][audit] instead. The audit is read-only and ends in a report under [reports/][reports], so nothing is changed by measuring. Applying what it found is a separate reviewable change per its section 10. Onboarding is complete when the repo passes, or has a hub-committed report plus a tracking issue for the residual deltas, per [GOVERNANCE.md "Repository Onboarding and Conformance"][governance-repository-onboarding-and-conformance]. -A repository that is stood up already and has fallen behind is resynced with [`RESYNC.md`][resync], which is the third entry point and the one a request to sync a repository with the hub resolves to. It runs the audit for the findings and then applies them in an order that matters: the rules first, because they govern what comes after them, then the deletions, because a re-vendor would otherwise refresh a file that is about to go, then the re-vendors, the workflow contracts, and the repository configuration. It also states what the measurement cannot see, since a carried file at `intent` fidelity is checked for presence alone and a hub revision inside one raises no finding at all. +A repository that is stood up already and has fallen behind is resynced with [`RESYNC.md`][resync]. That is the third entry point and the one a request to sync a repository with the hub resolves to. It runs the audit for the findings and then applies them in an order that matters. The rules come first, because they govern what comes after them. The deletions come next, because a re-vendor would otherwise refresh a file that is about to go. The re-vendors, the workflow contracts, and the repository configuration follow. A carried file at `intent` fidelity is checked for presence alone, and a hub revision inside one raises no finding at all. [`RESYNC.md`][resync] therefore also states what the measurement cannot see. -The mechanical helpers that go with those procedures are documented beside them: [`docs/repo-config.md`][repo-config-doc] for branch rulesets and repository settings, and [`docs/content-import.md`][content-import] for importing existing content into a new repo. +The mechanical helpers that go with those procedures are documented beside them. [`docs/repo-config.md`][repo-config-doc] covers branch rulesets and repository settings, and [`docs/content-import.md`][content-import] covers importing existing content into a new repo. ### Adopting Outside This Fleet -The rules, the spec, and the procedures are readable and reusable by anyone, and the guardrail kit installs on any host. What does not transfer is the registry, since [registry/repos.json][repos] lists this fleet's projects, and standing a repository up writes an entry in it. Adopting outside this fleet therefore means running your own hub, forked or copied, holding your own registry and your own reports, with `AGENTS.md`, `GOVERNANCE.md`, `CODESTYLE.md`, `WORKFLOW.md`, and `spec/` adapted to what your projects actually are. There is no supported mode where an outside repository points at this hub's registry. +The rules, the spec, and the procedures are readable and reusable by anyone, and the guardrail kit installs on any host. What does not transfer is the registry, since [registry/repos.json][repos] lists this fleet's projects, and standing a repository up writes an entry in it. Adopting outside this fleet therefore means running your own hub, forked or copied, holding your own registry and your own reports. For the same reason it also means adapting `AGENTS.md`, `GOVERNANCE.md`, `CODESTYLE.md`, `WORKFLOW.md`, and `spec/` to what your projects actually are. There is no supported mode where an outside repository points at this hub's registry. ## Diverging From a Rule -A rule that cannot be diverged from is a rule people work around silently, which is worse than the divergence, so both kinds of exception have a declared channel. The two kinds are genuinely different: one is a repository not matching a carried unit, and the other is a host guard denying a write. Neither is granted by editing the thing that blocked you. +A rule that cannot be diverged from is a rule people work around silently, which is worse than the divergence. Both kinds of exception therefore have a declared channel. The two kinds are genuinely different: one is a repository not matching a carried unit, and the other is a host guard denying a write. Neither is granted by editing the thing that blocked you. ### A Repository Diverging From a Carried Unit -**Check the unit's fidelity level first, because most apparent divergences are not divergences at all.** Each [spec/files.json][files] entry declares one of `verbatim`, `interface`, `intent`, or `presence`, defaulting to `presence`, and the two permissive levels already hand the repo its content outright. A repo rewriting a `presence` or `intent` file to suit itself is exercising the freedom the level grants rather than breaking a rule, and the audit asserts nothing beyond presence for it. See [spec/fidelity-model.md][fidelity-model] for which unit sits where and why. +**Check the unit's fidelity level first, because most apparent divergences are not divergences at all.** Each [spec/files.json][files] entry declares one of `verbatim`, `interface`, `intent`, or `presence`, defaulting to `presence`. The two permissive levels already hand the repo its content outright. A repo rewriting a `presence` or `intent` file to suit itself is exercising the freedom the level grants rather than breaking a rule. The audit asserts nothing beyond presence for it. See [spec/fidelity-model.md][fidelity-model] for which unit sits where and why. -**A divergence from a `verbatim` or `interface` unit is recorded, not hidden.** The ledger is [spec/divergences.json][divergences]. Every entry names a path, a disposition, and a reason. A `dispositions` entry also names the repos it covers. An `investigate` entry carries a `tracking` value naming where its pending decision is being made, and every other disposition may leave that value null. `uv run --no-project --script spec/fidelity_honesty.py --report` joins the ledger against live fleet reality to regenerate [reports/divergences.md][divergences-report]. A divergence recorded as `accepted` is a legitimate permanent one and no further action is owed. A live divergence with no entry renders as `UNTRIAGED`, which is the point: the audit does not care whether a difference is deliberate, only whether someone decided about it. Edit the ledger and regenerate the report, never the report. +**A divergence from a `verbatim` or `interface` unit is recorded, not hidden.** The ledger is [spec/divergences.json][divergences]. Every entry names a path, a disposition, and a reason. A `dispositions` entry also names the repos it covers. An `investigate` entry carries a `tracking` value naming where its pending decision is being made, and every other disposition may leave that value null. `uv run --no-project --script spec/fidelity_honesty.py --report` joins the ledger against live fleet reality to regenerate [reports/divergences.md][divergences-report]. A divergence recorded as `accepted` is a legitimate permanent one and no further action is owed. A live divergence with no entry renders as `UNTRIAGED`, which is the point. The audit does not care whether a difference is deliberate, only whether someone decided about it. Edit the ledger and regenerate the report, never the report. -**A rule that is wrong for many repositories is a hub defect rather than a per-repo exception.** [AUDIT.md][audit] section 9 says so directly, that a repeated letter miss many repos share is a signal the spec needs adjusting, so raise it here instead of accumulating one exception per repository. +**A rule that is wrong for many repositories is a hub defect rather than a per-repo exception.** [AUDIT.md][audit] section 9 says so directly: a repeated letter miss many repos share is a signal the spec needs adjusting. Therefore raise it here instead of accumulating one exception per repository. ### A Write the Host Guard Denies -The guard denies a `gh` write whose explicit target sits under an owner other than the checkout's `origin` owner, which is the shape that once put a stray comment on a stranger's repository. Sibling repositories under the same owner are allowed, so the denial appears only on a write that leaves the owner, and the common case that raises it is a fork, where `origin` is yours and `upstream` is the project you forked from. +The guard denies a `gh` write whose explicit target sits under an owner other than the checkout's `origin` owner. That is the shape that once put a stray comment on a stranger's repository. Sibling repositories under the same owner are allowed, so the denial appears only on a write that leaves the owner. The common case that raises it is a fork, where `origin` is yours and `upstream` is the project you forked from. -The only way past it is a grant the maintainer makes **outside the session**, in `GH_WRITE_GUARD_ALLOW`. It is deliberately not something an agent can do for itself once blocked, so an inline `GH_WRITE_GUARD_ALLOW=owner/repo gh ...` prefix and an `export` inside a shell call both leave the write denied. The worked example, the file the grant goes in, and how to confirm one took effect are in [`host-setup/agent-safety/claude/README.md` "Granting a Write That the Guard Denies"][agent-safety-claude-grant]. +The only way past it is a grant the maintainer makes **outside the session**, in `GH_WRITE_GUARD_ALLOW`. It is deliberately not something an agent can do for itself once blocked. An inline `GH_WRITE_GUARD_ALLOW=owner/repo gh ...` prefix and an `export` inside a shell call therefore both leave the write denied. The worked example, the file the grant goes in, and how to confirm one took effect are in [`host-setup/agent-safety/claude/README.md` "Granting a Write That the Guard Denies"][agent-safety-claude-grant]. ## Rules @@ -258,7 +258,7 @@ A human-readable index of the rules agents enforce, implement, and audit. The au ### If a Python Project -- Configure ruff and a type checker in `pyproject.toml`: pyright strict, mypy with its strict flags (run in CI and the editor, with pyright kept editor-only), or both. Every checker CI runs is a gate. +- Configure ruff and a type checker in `pyproject.toml`. Use pyright strict, mypy with its strict flags (run in CI and the editor, with pyright kept editor-only), or both. Every checker CI runs is a gate. ### If Both C# and Python @@ -267,8 +267,8 @@ A human-readable index of the rules agents enforce, implement, and audit. The au ### If Publishing a Package (NuGet or PyPI) - Publish via OIDC Trusted Publishing, never a stored API key. -- Keep the push in a separate publish job in the repo's own publisher, never in a build leaf and never in a reusable workflow another repository hosts. Trusted publishing validates the OIDC token's `job_workflow_ref` claim against the repository owning the package, so a push from elsewhere is rejected at the token exchange, and the split is also what keeps `id-token: write` at one entry point. -- Keep the registry's trusted-publishing policy pointed at that publisher's own workflow file, and confirm it before the first release after any change that moves the push. A smoke build never reaches the token exchange, so a stale policy surfaces only on a real release. +- Keep the push in a separate publish job in the repo's own publisher. Never put it in a build leaf or in a reusable workflow another repository hosts. Trusted publishing validates the OIDC token's `job_workflow_ref` claim against the repository owning the package, so a push from elsewhere is rejected at the token exchange. The split is also what keeps `id-token: write` at one entry point. +- Keep the registry's trusted-publishing policy pointed at that publisher's own workflow file. Confirm it before the first release after any change that moves the push. A smoke build never reaches the token exchange, so a stale policy surfaces only on a real release. ### If a Docker Image @@ -284,22 +284,22 @@ A human-readable index of the rules agents enforce, implement, and audit. The au ## Questions or Issues -File everything at [Issues][issues-link], including a defect in a rule, a procedure that did not survive contact with a real repository, and a proposal for a new rule. Use [Discussions][discussions-link] for an open question that is not yet a defect. A question an agent parks for the maintainer is not an open question of that kind, and is filed here as an issue carrying the `decision` label, on the terms [GOVERNANCE.md "Communicating with the User"][governance-communicating-with-the-user] sets. This repo ships no application code, so an issue here is about the rules, the spec, the procedures, or the tooling under [`scripts/`][scripts] and [`spec/`][spec], never about a downstream project's behavior, which belongs on that project's own tracker. +File everything at [Issues][issues-link]. That includes a defect in a rule, a procedure that did not survive contact with a real repository, and a proposal for a new rule. Use [Discussions][discussions-link] for an open question that is not yet a defect. A question an agent parks for the maintainer is not an open question of that kind. It is filed here as an issue carrying the `decision` label, on the terms [GOVERNANCE.md "Communicating with the User"][governance-communicating-with-the-user] sets. This repo ships no application code, so an issue here is about the rules, the spec, the procedures, or the tooling under [`scripts/`][scripts] and [`spec/`][spec]. For the same reason it is never about a downstream project's behavior, which belongs on that project's own tracker. -An issue is most useful when it names the ground truth it disagrees with, so include the file and section that states the rule, the repository and branch where the problem was observed, and what you expected instead. A finding measured against a specific commit is worth more than one measured against a memory of the docs, per [GOVERNANCE.md "Verification Discipline"][governance-verification-discipline]. +An issue is most useful when it names the ground truth it disagrees with. So include the file and section that states the rule, the repository and branch where the problem was observed, and what you expected instead. A finding measured against a specific commit is worth more than one measured against a memory of the docs, per [GOVERNANCE.md "Verification Discipline"][governance-verification-discipline]. Two kinds of report are worth calling out because they are the ones that improve the procedures rather than one repository: -- **A procedure that could not be followed cold.** The onboarding docs are sufficient only when a context-free agent can stand a repo shape up from them alone, so a step that needed knowledge the docs never gave is a documentation defect tracked in the [conformance matrix][matrix] and fixed here rather than worked around per repo. +- **A procedure that could not be followed cold.** The onboarding docs are sufficient only when a context-free agent can stand a repo shape up from them alone. A step that needed knowledge the docs never gave is therefore a documentation defect tracked in the [conformance matrix][matrix]. For the same reason it is fixed here rather than worked around per repo. - **A rule that many repositories miss the same way.** That is a signal the spec needs adjusting rather than a queue of per-repo exceptions, per [AUDIT.md][audit] section 9. -Issues are also filed here **by agents working in downstream repositories**, which is the normal path rather than an exception, since the agent that hit the gap is the one holding the evidence for it. +Issues are also filed here **by agents working in downstream repositories**. This is the normal path rather than an exception, since the agent that hit the gap is the one holding the evidence for it. ## Development Environment Setup Contributors sign every commit. See [docs/ssh-signing.md][ssh-signing] for SSH commit-signing setup, [docs/host-setup.md][host-setup] for host prerequisites, and [docs/devcontainer.md][devcontainer] for devcontainer SSH-agent forwarding. Run the linters before pushing (see [GOVERNANCE.md "Running the Linters Locally"][governance-running-the-linters-locally-known-working-invocations]). -Changes land the same way every fleet change does: a feature branch, a squash merge into `develop`, a Copilot review loop driven to green, and a merge only with the maintainer's explicit approval. The backlog is [`TODO.md`][todo], which holds the work that is ready to pick up along with the reasoning behind each item, so read it before proposing something it already covers. +Changes land the same way every fleet change does: a feature branch and a squash merge into `develop`. The process also has a Copilot review loop driven to green and a merge only with the maintainer's explicit approval. The backlog is [`TODO.md`][todo], which holds the work that is ready to pick up along with the reasoning behind each item. Therefore read it before proposing something it already covers. ## 3rd Party Tools diff --git a/docs/host-setup.md b/docs/host-setup.md index 4e8912224..a20d7f3fe 100644 --- a/docs/host-setup.md +++ b/docs/host-setup.md @@ -8,7 +8,7 @@ Supported hosts: - **macOS** - both the devcontainer flow and the host-install flow. - **Windows** - the devcontainer flow requires **WSL2**, and native Windows (PowerShell + winget) is supported only for the host-install flow described in `README.md`. The bind-mounts in the `catalog/snippets/devcontainer/` definitions rely on POSIX paths and only work from Linux/macOS/WSL2. -> **Shell assumptions in this doc**: every command snippet below assumes a **POSIX shell** (bash/zsh) and POSIX path conventions (`~/.ssh/...`, `mkdir -p`, `$(...)` command substitution), except where a block is marked `powershell`. Such a block is the **Windows-native** form of the step it sits in, meant to run in PowerShell rather than translated. On Windows, run the POSIX snippets from **WSL2** or **Git Bash**, since they will not work as-is in PowerShell or `cmd.exe`. The git config and `gh` commands are portable, and only the file and path manipulation differs by shell. +> **Shell assumptions in this doc**: every command snippet below assumes a **POSIX shell** (bash/zsh) and POSIX path conventions (`~/.ssh/...`, `mkdir -p`, `$(...)` command substitution). A block marked `powershell` is the exception. Such a block is the **Windows-native** form of the step it sits in, meant to run in PowerShell rather than translated. On Windows, run the POSIX snippets from **WSL2** or **Git Bash**, since they will not work as-is in PowerShell or `cmd.exe`. The git config and `gh` commands are portable, and only the file and path manipulation differs by shell. ## What a Host Must Provide @@ -24,43 +24,43 @@ This section is the **contract**: which tools a host needs and which repo proced | `docker` | the four linters, which run as pinned images rather than local installs | `docker --version` | **29.6.2**, target | | `uv` / `uvx` | coverage runs, the Python toolchain (`ruff`, `pyright` or `mypy`) in a Python repo, and the hub scripts run as `uv run --no-project --script`, the prose gate, the audit, and the review loop among them | `uv --version` | **0.12.2**, target | -The **Floor** column exists because presence and sufficiency are different questions and the answer to the first was being read as the answer to the second. A tool below its floor still answers `--version`, so every other column reports it as fine while `scripts/host_gate.py` fails it. The kind is named beside the number, since a **measured** floor sits above a version known to break a documented procedure and gives a failing host a defect to point at, where a **target** floor names the version the repo's toolchain is configured for and does not. The next section carries the reasoning behind each one. +The **Floor** column exists because presence and sufficiency are different questions and the first's answer was being read as the second's. A tool below its floor still answers `--version`, so every other column reports it as fine while `scripts/host_gate.py` fails it. The kind is named beside the number, since the two kinds differ. A **measured** floor sits above a version known to break a documented procedure and gives a failing host a defect to point at. A **target** floor names the version the repo's toolchain is configured for and gives no such defect to point at. The next section carries the reasoning behind each one. -Two consequences worth reading off the table rather than discovering later. **Python 3 needs no packages installed.** A script needing a library declares it inline, and the test suite names its libraries in `tests/requirements.txt`. `uv` resolves both, so a bare interpreter beside `uv` is enough. And **the linters need only `docker`**, not `node`, `dotnet` or a local `markdownlint`, since each runs as a pinned image, which is what keeps a local run and CI the same check. +Two consequences worth reading off the table rather than discovering later. **Python 3 needs no packages installed.** A script needing a library declares it inline, and the test suite names its libraries in `tests/requirements.txt`. `uv` resolves both, so a bare interpreter beside `uv` is enough. And **the linters need only `docker`**, not `node`, `dotnet` or a local `markdownlint`, since each runs as a pinned image. That is what keeps a local run and CI the same check. -**The interpreter is called `python3` everywhere, and on native Windows that is something the tooling provides rather than something the platform ships.** Windows registers `python` and `py` through the interpreter's own installer, and gives `python3` by default to an *app execution alias stub*, a zero-byte reparse point in the WindowsApps directory belonging to App Installer, which only ever offers to open the Microsoft Store. A Microsoft Store Python registers aliases under those same two names carrying the same reparse tag, and those reach a real interpreter somebody chose, so the target package rather than the tag is what tells a placeholder from a working setup. The installer removes only the placeholder and reports anything else. Measured on a fleet Windows host, that stub writes its `Python was not found` message to **stderr** and exits **9009**, so it fails loudly and a `&&` chain does stop on it. What it does instead is occupy the name: WindowsApps is on `PATH` by default, so wherever it sits ahead of the install directory the stub answers and the installed interpreter cannot be reached under that name at all. [`host-setup/windows/install-tools.ps1`][install-tools-windows] fixes both halves when it manages the `python` tool: it removes those stubs, and it puts a real `python3` beside the interpreter it installed. Stock Debian is the mirror image, carrying `python3` and no bare `python`, so `python3` is the one name that is correct on all three platforms and is what every script and brief should use. +**The interpreter is called `python3` everywhere, and on native Windows that is something the tooling provides rather than something the platform ships.** Windows registers `python` and `py` through the interpreter's own installer. Windows gives `python3` by default to an *app execution alias stub*. That stub is a zero-byte reparse point in the WindowsApps directory belonging to App Installer, which only ever offers to open the Microsoft Store. A Microsoft Store Python registers aliases under those same two names carrying the same reparse tag. Those reach a real interpreter somebody chose. So the target package rather than the tag is what tells a placeholder from a working setup. The installer removes only the placeholder and reports anything else. Measured on a fleet Windows host, that stub writes its `Python was not found` message to **stderr** and exits **9009**. It therefore fails loudly, and a `&&` chain does stop on it. What it does instead is occupy the name. WindowsApps is on `PATH` by default, so wherever it sits ahead of the install directory the stub answers. The installed interpreter then cannot be reached under that name at all. [`host-setup/windows/install-tools.ps1`][install-tools-windows] fixes both halves when it manages the `python` tool: it removes those stubs, and it puts a real `python3` beside the interpreter it installed. Stock Debian is the mirror image, carrying `python3` and no bare `python`, so `python3` is the one name that is correct on all three platforms. For that reason it is what every script and brief should use. -**Removing a stub is not the same act as the Settings toggle, and the toggle keeps reading `On` afterwards.** The alias has two layers: the package's own copy under the App Installer subdirectory of WindowsApps, which `winget.exe` sits beside and which the installer never touches, and the enabled copy in WindowsApps itself, which is the one on `PATH` and the one the installer removes. Removing it frees the name immediately, measured rather than assumed. But the store the Settings page reads is not that file and no documented interface writes it, so the page still shows `On`, and the alias can return when App Installer is next serviced. `install-tools.ps1` re-removes it on every apply rather than assuming a host stays fixed, and turning the two toggles off in Settings is what stops it coming back at all. +**Removing a stub is not the same act as the Settings toggle, and the toggle keeps reading `On` afterwards.** The alias has two layers. One is the package's own copy under the App Installer subdirectory of WindowsApps. `winget.exe` sits beside it, and the installer never touches it. The other is the enabled copy in WindowsApps itself, which is the one on `PATH` and the one the installer removes. Removing it frees the name immediately, measured rather than assumed. But the store the Settings page reads is not that file, and no documented interface writes it. The page therefore still shows `On`, and the alias can return when App Installer is next serviced. `install-tools.ps1` re-removes it on every apply rather than assuming a host stays fixed. Turning the two toggles off in Settings is what stops it coming back at all. -**Two further Windows states survive that and are reported rather than fixed.** A `python3` from MSYS2, Cygwin or Scoop earlier on `PATH` is a real interpreter that answers cleanly, so it is the wrong one silently rather than loudly. `install-tools.ps1 -Report python` names it, and `PATH` order is the only thing deciding it. And an activated virtual environment on Windows carries `python.exe` but no `python3.exe`, so a bare `python3` there reaches the host interpreter rather than the environment's. Use `python` inside an environment, which is the interpreter an environment puts first on purpose. +**Two further Windows states survive that and are reported rather than fixed.** A `python3` from MSYS2, Cygwin or Scoop earlier on `PATH` is a real interpreter that answers cleanly. It is therefore the wrong one silently rather than loudly. `install-tools.ps1 -Report python` names it, and `PATH` order is the only thing deciding it. And an activated virtual environment on Windows carries `python.exe` but no `python3.exe`, so a bare `python3` there reaches the host interpreter rather than the environment's. Use `python` inside an environment, which is the interpreter an environment puts first on purpose. A missing tool is a host gap, not a repo problem. Install it and re-run, rather than working around it in a repo. ### Where a Tool Comes From, and How Old It May Be -Presence is the weaker half of this contract. Both host defects this fleet has actually hit are **version** facts on a tool that is installed, answers `--version`, and looks healthy, so the table above cannot see either one. [`spec/host-tools.json`][host-tools] carries the floors as data and records the defect each one encodes, and [`scripts/host_gate.py`][host-gate] reads it. A floor is one of two kinds and names its own kind in the `why` it carries. A **measured** floor sits above a version known to break a documented procedure, which is what both `gh` and `git-restore-mtime` carry. A **target** floor names the version the repo's own toolchain is configured for, which is what `python3` carries at 3.13, where `pyproject.toml` sets ruff and mypy to that version, so a lower interpreter is unverified rather than known broken and the entry says exactly that. Either kind is a floor and not a ceiling: the platform rather than this repo decides how high a host can go, since a Linux distribution ships the line it ships, so a host at the floor and a host above it both pass. Everything else carries none, deliberately: a floor nobody can justify becomes a host failure nobody can act on. +Presence is the weaker half of this contract. Both host defects this fleet has actually hit are **version** facts on a tool that is installed, answers `--version`, and looks healthy. The table above therefore cannot see either one. [`spec/host-tools.json`][host-tools] carries the floors as data and records the defect each one encodes, and [`scripts/host_gate.py`][host-gate] reads it. A floor is one of two kinds and names its own kind in the `why` it carries. A **measured** floor sits above a version known to break a documented procedure, which is what both `gh` and `git-restore-mtime` carry. A **target** floor names the version the repo's own toolchain is configured for. That is what `python3` carries at 3.13, where `pyproject.toml` sets ruff and mypy to that version. A lower interpreter is therefore unverified rather than known broken, and the entry says exactly that. Either kind is a floor and not a ceiling. The platform rather than this repo decides how high a host can go, since a Linux distribution ships the line it ships. A host at the floor and a host above it therefore both pass. Everything else carries none, deliberately: a floor nobody can justify becomes a host failure nobody can act on. -**`gh` must not come from the distribution's package on Linux.** This is the one place this document names a source, because here the source *is* the requirement rather than a convenience. The GitHub CLI maintainers state that the community-distributed `2.45.x` / `2.46.x` is **broken by deprecated GitHub APIs**, so install from the official apt repository at [cli.github.com][cli-install-link] and upgrade from there. Both `gh` limitations recorded in [`OPERATIONS.md`][operations] were observed on a host carrying a distribution `gh 2.46.0`, and both are the deprecation class that note describes. On **Windows** `winget` tracks upstream releases, and on macOS Homebrew does, so neither raises this hazard and neither needs a note of its own. +**`gh` must not come from the distribution's package on Linux.** This is the one place this document names a source, because here the source *is* the requirement rather than a convenience. The GitHub CLI maintainers state that the community-distributed `2.45.x` / `2.46.x` is **broken by deprecated GitHub APIs**. Therefore install from the official apt repository at [cli.github.com][cli-install-link] and upgrade from there. Both `gh` limitations recorded in [`OPERATIONS.md`][operations] were observed on a host carrying a distribution `gh 2.46.0`, and both are the deprecation class that note describes. On **Windows** `winget` tracks upstream releases, and on macOS Homebrew does, so neither raises this hazard and neither needs a note of its own. -**`git-restore-mtime` must not come from it either, where a repo uses it.** Debian and Ubuntu package **2022.12**, which shells out to `git whatchanged`. Current `git` refuses that without a hidden opt-in flag a caller cannot pass through, so the tool restores nothing, prints its ordinary statistics and **exits 0**. A deploy keyed on mtimes then ships a full copy and reports success. Take the upstream release from [git-tools][git-tools-link], or in CI the [action][git-restore-mtime-action-link] that vendors it. Note the direction of that interaction: a **newer** `git` is the trigger rather than the remedy, so a host old enough to still allow `whatchanged` hides the defect rather than avoiding it. No procedure in this repo needs the tool, so the gate declares it **optional** and skips it when absent. +**`git-restore-mtime` must not come from it either, where a repo uses it.** Debian and Ubuntu package **2022.12**, which shells out to `git whatchanged`. Current `git` refuses that without a hidden opt-in flag a caller cannot pass through. The tool therefore restores nothing, prints its ordinary statistics and **exits 0**. A deploy keyed on mtimes then ships a full copy and reports success. Take the upstream release from [git-tools][git-tools-link], or in CI the [action][git-restore-mtime-action-link] that vendors it. Note the direction of that interaction: a **newer** `git` is the trigger rather than the remedy. A host old enough to still allow `whatchanged` therefore hides the defect rather than avoiding it. No procedure in this repo needs the tool, so the gate declares it **optional** and skips it when absent. -**`docker` must not come from the distribution's own package either, with one exception.** Debian and Ubuntu package `docker.io`, an older build that trails and conflicts with `docker-ce`, so [`host-setup/linux/install-tools.sh`][host-setup-dir] removes it and installs from Docker's own apt repository at [download.docker.com][docker-install-link] instead, the same shape it already uses for `gh` and `node`. The exception is a **WSL distribution**, where the only sanctioned source is Docker Desktop's own WSL integration (Settings, Resources, WSL integration, on the Windows side, reported read-only by [`setup-wsl.ps1`][host-setup-windows]) and a native install is refused outright, with no override: running `docker-ce` directly inside a WSL distribution risks a second engine beside Desktop's own. On native **Windows**, `winget` already tracks upstream Desktop releases, so neither hazard arises there. +**`docker` must not come from the distribution's own package either, with one exception.** Debian and Ubuntu package `docker.io`, an older build that trails and conflicts with `docker-ce`. [`host-setup/linux/install-tools.sh`][host-setup-dir] therefore removes it and installs from Docker's own apt repository at [download.docker.com][docker-install-link] instead, the same shape it already uses for `gh` and `node`. The exception is a **WSL distribution**, where the only sanctioned source is Docker Desktop's own WSL integration. That integration is under Settings, Resources, WSL integration, on the Windows side, and [`setup-wsl.ps1`][host-setup-windows] reports it read-only. A native install is refused outright there, with no override, because running `docker-ce` directly inside a WSL distribution risks a second engine beside Desktop's own. On native **Windows**, `winget` already tracks upstream Desktop releases, so neither hazard arises there. -**`docker`'s floor is read from the engine, not from the CLI banner.** The `docker` on `PATH` inside a WSL distribution can be a separately packaged client that talks to Docker Desktop's engine over the integration socket, and the two then carry different versions: a host was recorded with a distribution client at `29.1.3` against an engine at `29.7.2`, so `docker --version` failed a floor the engine cleared comfortably. The gate therefore asks the daemon first, with `docker version --format '{{.Server.Version}}'`, and falls back to the `docker --version` banner only where that exits non-zero, which is what a stopped or unreachable daemon does. The **Present when** column above still names the banner, because presence is what it answers and a host with the daemon stopped still has `docker` installed. +**`docker`'s floor is read from the engine, not from the CLI banner.** The `docker` on `PATH` inside a WSL distribution can be a separately packaged client that talks to Docker Desktop's engine over the integration socket. The two then carry different versions. A host was recorded with a distribution client at `29.1.3` against an engine at `29.7.2`, so `docker --version` failed a floor the engine cleared comfortably. The gate therefore asks the daemon first, with `docker version --format '{{.Server.Version}}'`. It likewise falls back to the `docker --version` banner only where that exits non-zero, which is what a stopped or unreachable daemon does. The **Present when** column above still names the banner, because it answers presence and a host with the daemon stopped still has `docker` installed. -**The rest of the table takes the distribution's package, and one more does not.** `git` and the Python interpreter come from the distribution, because each keeps up well enough that a second source buys nothing and costs a repository to trust. `jq` is the same on a current Debian or Ubuntu, which carries a version at or above the floor, and the upstream release binary is the answer only where it does not. `uv` is published by its authors as a release archive and packaged by neither distribution, so upstream is the only source there is. Where a repository needs `node`, the distribution's package trails upstream by whole release lines, so it comes from the NodeSource repository on the line upstream currently carries as long term support. Where a repository needs `dotnet`, the distribution's feed is preferred where it carries an SDK and Microsoft's feed is the fallback, because mixing the two is what breaks a host rather than either one alone, and Microsoft's carries `amd64` only. Where a repository needs `pwsh`, that same feed is the only source, since no distribution packages it, and the tooling installs it as the `powershell` tool under `--optional`, with `pwsh` the command that tool provides. +**The rest of the table takes the distribution's package, and one more does not.** `git` and the Python interpreter come from the distribution. This is because each keeps up well enough that a second source buys nothing and costs a repository to trust. `jq` is the same on a current Debian or Ubuntu, which carries a version at or above the floor. The upstream release binary is the answer only where the distribution does not. `uv` is published by its authors as a release archive and packaged by neither distribution, so upstream is the only source there is. Where a repository needs `node`, it comes from the NodeSource repository on the line upstream currently carries as long term support. This is because the distribution's package trails upstream by whole release lines. Where a repository needs `dotnet`, the distribution's feed is preferred where it carries an SDK and Microsoft's feed is the fallback. This is because mixing the two is what breaks a host rather than either one alone, and Microsoft's carries `amd64` only. Where a repository needs `pwsh`, that same feed is the only source, since no distribution packages it. Where a repository needs it, the tooling installs it as the `powershell` tool under `--optional`, with `pwsh` the command that tool provides. Ripgrep also comes from the distribution, where every supported current release meets its floor. It provides `rg` search and `rg --files` discovery for coding agents. -Neither `node`, `dotnet`, nor `pwsh` is in the table above, deliberately: they serve the repositories that need them rather than the fleet contract, and a repository needing one declares it in the `host-tools.json` at its own root, which [`scripts/host_gate.py`][host-gate] merges over this one. The merge tightens only, so a repository may raise a floor or add one and may not lower or remove one. +Neither `node`, `dotnet`, nor `pwsh` is in the table above, deliberately. They serve the repositories that need them rather than the fleet contract. A repository needing one declares it in the `host-tools.json` at its own root, which [`scripts/host_gate.py`][host-gate] merges over this one. The merge tightens only, so a repository may raise a floor or add one and may not lower or remove one. -**A host being stood up needs no Python.** The tooling under [`host-setup/`][host-setup-dir] is shell and PowerShell, deliberately, because requiring an interpreter to upgrade a package or install a tool would make the first step of standing a host up depend on the thing that step exists to provide. The Python floor above is a development requirement, meaning [`scripts/`][scripts-dir] and [`spec/`][spec-dir], and a host that only runs services never has to meet it. `bootstrap.sh` needs `curl`, `tar`, and `flock`, each of which a base install carries or can install without a network tool of its own. `bootstrap.ps1` needs only `tar.exe`, which has shipped with Windows since 1803, and installs its one further dependency, PowerShell 7, itself through `winget`. The one exception is the skills step at the end of a stand-up, which drives the Python installer in [`scripts/`][scripts-dir], and it runs last for exactly that reason: `install-tools` has provided the interpreter by then, and run alone on a host without one it stops and names the tools step as its prerequisite. +**A host being stood up needs no Python.** The tooling under [`host-setup/`][host-setup-dir] is shell and PowerShell, deliberately, because requiring an interpreter to upgrade a package or install a tool would make the first step of standing a host up depend on the thing that step exists to provide. The Python floor above is a development requirement, meaning [`scripts/`][scripts-dir] and [`spec/`][spec-dir], and a host that only runs services never has to meet it. `bootstrap.sh` needs `curl`, `tar`, and `flock`, each of which a base install carries or can install without a network tool of its own. `bootstrap.ps1` needs only `tar.exe`, which has shipped with Windows since 1803, and installs its one further dependency, PowerShell 7, itself through `winget`. The one exception is the skills step at the end of a stand-up, which drives the Python installer in [`scripts/`][scripts-dir]. It runs last for exactly that reason: `install-tools` has provided the interpreter by then. The skills step, run alone on a host without one, stops and names the tools step as its prerequisite. -**Standing a host up.** [`host-setup/`][host-setup-dir] carries the tooling that makes a host satisfy this contract, and its README is the usage. A host with nothing runs [`host-setup/bootstrap.sh`][bootstrap], which fetches this repository and runs that tooling from the fetched tree. A native Windows host with nothing runs [`host-setup/bootstrap.ps1`][bootstrap-ps1] the same way, which finds or installs PowerShell 7 before it fetches anything, since every script under [`host-setup/windows/`][host-setup-windows] requires it. Neither is called by [`scripts/host_gate.py`][host-gate] and neither calls it: the gate measures a host against the floors above, and the tooling is a remedy a person chooses when the gate reports a gap. +**Standing a host up.** [`host-setup/`][host-setup-dir] carries the tooling that makes a host satisfy this contract, and its README is the usage. A host with nothing runs [`host-setup/bootstrap.sh`][bootstrap], which fetches this repository and runs that tooling from the fetched tree. A native Windows host with nothing runs [`host-setup/bootstrap.ps1`][bootstrap-ps1] the same way. That script finds or installs PowerShell 7 before it fetches anything, since every script under [`host-setup/windows/`][host-setup-windows] requires it. Neither is called by [`scripts/host_gate.py`][host-gate] and neither calls it. The gate measures a host against the floors above, and the tooling is a remedy a person chooses when the gate reports a gap. -**Every repository carries a `host-tools.json` at its root, whether or not it declares anything in it.** [`spec/files.json`][files] lists it as a baseline file of every repository, on the same footing as [`OPERATIONS.md`][operations], so a maintainer who needs to declare a floor finds the file where it already is rather than having to know one may be created. A repository with nothing to add carries an empty `tools` list, and that stub is the conformant state rather than a leftover to remove. [`scripts/host_gate.py`][host-gate] treats an absent one as nothing to report, because the gate measures a host against floors and the audit in [`AUDIT.md`][audit] is what reports a baseline file a repository does not carry. What the gate does say, on a bare run started in a subdirectory, is that an ancestor's overlay went unapplied, and it stays silent about a stub, which has no floor to miss. An overlay it cannot parse is named like a declaring one, since the failed parse is what leaves the question open. +**Every repository carries a `host-tools.json` at its root, whether or not it declares anything in it.** [`spec/files.json`][files] lists it as a baseline file of every repository, on the same footing as [`OPERATIONS.md`][operations]. A maintainer who needs to declare a floor therefore finds the file where it already is rather than having to know one may be created. A repository with nothing to add carries an empty `tools` list, and that stub is the conformant state rather than a leftover to remove. [`scripts/host_gate.py`][host-gate] treats an absent one as nothing to report, because the gate measures a host against floors and the audit in [`AUDIT.md`][audit] is what reports a baseline file a repository does not carry. What the gate does say, on a bare run started in a subdirectory, is that an ancestor's overlay went unapplied. The gate stays silent about a stub, which has no floor to miss. An overlay it cannot parse is named like a declaring one, since the failed parse is what leaves the question open. -A repository that needs more than the fleet does declares it in its own `host-tools.json`, which the gate layers over the hub's. It may add a tool nobody else uses, raise a floor, or turn an optional tool required. It may **not** lower a floor or turn a required tool optional, since those edits retire a fleet check from inside the repository it protects, and the gate reports a rejected relaxation rather than dropping it. +A repository that needs more than the fleet does declares it in its own `host-tools.json`, which the gate layers over the hub's. It may add a tool nobody else uses, raise a floor, or turn an optional tool required. It may **not** lower a floor or turn a required tool optional, since those edits retire a fleet check from inside the repository it protects. The gate reports a rejected relaxation rather than dropping it. A repository-only tool can declare constrained package metadata under `install.linux` or `install.windows`. Linux accepts only an `apt` package name. Windows accepts only a `winget` package ID. The installer reads those values as package identifiers and never evaluates `remedy` text from the repository. @@ -76,11 +76,11 @@ host-setup\windows\install-tools.ps1 -Install -Repo C:\path\to\repository The report, list, dry-run, install, and upgrade actions accept the same repository option. A platform with no matching metadata reports no constrained installer for that tool. The Linux reader needs `jq`, which the fleet tools provide. Install the fleet tools first when a minimal host does not carry it. -**A report can be written for a program to read.** Both installers take a JSON flag beside their report action, `--report --json` on Linux and `-Report -Json` on Windows, and the flag applies to no other action. Each writes one object carrying a `schema` number, the `platform`, a `tools` list with one entry per tool, and a top-level `notes` list for what belongs to no tool. A change to what a field means raises `schema`, so a reader checks it before trusting any field. The [Linux README][host-setup-linux-readme] defines the fields every platform shares, and the [Windows README][host-setup-windows-readme] names the one field it adds and the values it reports differently. +**A report can be written for a program to read.** Both installers take a JSON flag beside their report action, `--report --json` on Linux and `-Report -Json` on Windows, and the flag applies to no other action. Each writes one object carrying a `schema` number and the `platform`. The object also carries a `tools` list with one entry per tool, and a top-level `notes` list for what belongs to no tool. A change to what a field means raises `schema`, so a reader checks it before trusting any field. The [Linux README][host-setup-linux-readme] defines the fields every platform shares, and the [Windows README][host-setup-windows-readme] names the one field it adds and the values it reports differently. ## Git Identity -Configure your name and email, used for commit authorship. **The email is the committing account's GitHub `noreply` address, never a private, personal, or invented one**, per [GOVERNANCE.md "Git and Commit Rules"][governance-git-and-commit-rules], which owns the rule and states the fleet's value. A private address trips GitHub's email-privacy push protection (GH007), and an invented one pollutes history. +Configure your name and email, used for commit authorship. **The email is the committing account's GitHub `noreply` address, never a private, personal, or invented one**. This is per [GOVERNANCE.md "Git and Commit Rules"][governance-git-and-commit-rules], which owns the rule and states the fleet's value. A private address trips GitHub's email-privacy push protection (GH007), and an invented one pollutes history. ```shell git config --global user.name "Your Name" @@ -130,7 +130,7 @@ systemctl --user enable --now ssh-agent.socket ssh-add ~/.ssh/id_ed25519 ``` -For non-systemd shells, add to `~/.bashrc` or `~/.zshrc`. The check probes the agent for at least one loaded key, because `[ -z "$SSH_AUTH_SOCK" ]` alone would miss the case where `SSH_AUTH_SOCK` is set but points at a stale socket or a keyless agent: +For non-systemd shells, add to `~/.bashrc` or `~/.zshrc`. The check probes the agent for at least one loaded key. This is because `[ -z "$SSH_AUTH_SOCK" ]` alone would miss the case where `SSH_AUTH_SOCK` is set but points at a stale socket or a keyless agent: ```shell if [ -z "$SSH_AUTH_SOCK" ] || ! ssh-add -l >/dev/null 2>&1; then @@ -217,9 +217,9 @@ The opt-in sets nothing on a host where `gh` is not installed or not logged in, ## Agent Tool Updates -The coding-agent tools, Claude Code, Codex, opencode, herdr, and cswap, are not host requirements. A host carries whichever of them its user chose, so the tooling keeps current only the ones already installed and installs one only when it is named. An upgrade that installed every tool would put an agent on a host where nobody asked for one, which is a larger change than an upgrade is allowed to make. +The coding-agent tools, Claude Code, Codex, opencode, herdr, and cswap, are not host requirements. A host carries whichever of them its user chose. The tooling therefore keeps current only the ones already installed, and installs one only when it is named. An upgrade that installed every tool would put an agent on a host where nobody asked for one. That is a larger change than an upgrade is allowed to make. -Each tool lives in its user's home and carries its own updater, so the updater runs as that user, never as root, and drives each tool's own update command rather than replacing it. cswap on Windows is the one exception, upgraded through the `uv tool upgrade` its own updater only prints there, since that updater cannot replace a launcher that is running. A tool a package manager owns, such as an npm or Homebrew install, is reported and left to that manager. herdr's agent integrations are reinstalled after an upgrade wherever herdr reports one outdated. A herdr server already running keeps its panes on the previous binary until someone restarts it, since stopping it would end every agent inside it, so the report marks that restart as pending rather than taking it. +Each tool lives in its user's home and carries its own updater, so the updater runs as that user, never as root. For the same reason it drives each tool's own update command rather than replacing it. cswap on Windows is the one exception, upgraded through the `uv tool upgrade` its own updater only prints there. This is because that updater cannot replace a launcher that is running. A tool a package manager owns, such as an npm or Homebrew install, is reported and left to that manager. herdr's agent integrations are reinstalled after an upgrade wherever herdr reports one outdated. A herdr server already running keeps its panes on the previous binary until restarted, since stopping it would end every agent inside it. The report therefore marks that restart as pending rather than taking it. [`host-setup/linux/install-agents.sh`][install-agents] and [`host-setup/windows/install-agents.ps1`][install-agents-windows] implement this. `bootstrap.sh --upgrade` and `bootstrap.ps1 -Upgrade` run the upgrade after the packages, and `--agents`/`-Agents` installs the named tools. A scheduled run reaches the same script as the user who owns the tools. @@ -230,8 +230,8 @@ Host-level safety guards are required where an agent runs with the maintainer's The requirements every agent's kit is built and audited against, agent-agnostic, are in [`host-setup/agent-safety/README.md`][agent-safety], the spec. Each agent's own implementation detail lives one level down, following the same contract-vs-implementation split this file uses -for [`host-setup/`][host-setup-dir]'s own per-platform subdirectories: this file states the -requirement, the per-agent `README.md` owns the how-to. +for [`host-setup/`][host-setup-dir]'s own per-platform subdirectories. This file states the +requirement. The per-agent `README.md` owns the how-to. ### Claude Code Host Safety @@ -285,9 +285,9 @@ This setting grants filesystem writes only under the worktree parent. It does no Claude Code does not read Codex's `config.toml`. Keep its permission mode in Claude Code's user-level configuration. -**The one-time approval prompt on `EnterWorktree` into the fleet's worktree parent is expected, and not eliminable through permission rules.** Claude Code's own `EnterWorktree` tool defaults to `.claude/worktrees//` under the repository root. Entering a path outside that directory (the fleet's own `~/repos/worktrees/-` convention always is) asks for approval first, because the move relocates the session's working directory, write access, and project configuration. Neither an `EnterWorktree(...)` permission rule nor "don't ask again" suppresses this specific prompt -- only bypassPermissions mode does, whether set as a standing default (the nested `defaultMode` key under `permissions` in `settings.json`, set to `"bypassPermissions"`) or a one-time session override (`--permission-mode bypassPermissions`, or its `--dangerously-skip-permissions` alias), none of which is recommended as a standing setting. Stop trying to permission this prompt away. It fires once per worktree entered, by design. +**The one-time approval prompt on `EnterWorktree` into the fleet's worktree parent is expected, and not eliminable through permission rules.** Claude Code's own `EnterWorktree` tool defaults to `.claude/worktrees//` under the repository root. Entering a path outside that directory (the fleet's own `~/repos/worktrees/-` convention always is) asks for approval first. This is because the move relocates the session's working directory, write access, and project configuration. Neither an `EnterWorktree(...)` permission rule nor "don't ask again" suppresses this specific prompt. Only bypassPermissions mode does, whether set as a standing default or as a one-time session override. The standing default is the nested `defaultMode` key under `permissions` in `settings.json`, set to `"bypassPermissions"`. The one-time override is `--permission-mode bypassPermissions`, or its `--dangerously-skip-permissions` alias. None of these is recommended as a standing setting. Stop trying to permission this prompt away. It fires once per worktree entered, by design. -Separately, ordinary `Bash(...)` rules do stop the *follow-up* command prompts once inside the worktree, as long as the pattern matches what actually runs there. A command executed after Claude has moved into the worktree (via `cd`, or via `EnterWorktree` itself) runs with no `-C`/prefix naming the worktree, so a rule scoped to `Bash(git -C :*)` does not match it -- match the bare command instead: +Separately, ordinary `Bash(...)` rules do stop the *follow-up* command prompts once inside the worktree, as long as the pattern matches what actually runs there. A command executed after Claude has moved into the worktree (via `cd`, or via `EnterWorktree` itself) runs with no `-C`/prefix naming the worktree. A rule scoped to `Bash(git -C :*)` therefore does not match it. Match the bare command instead: ```json { @@ -308,9 +308,9 @@ Separately, ordinary `Bash(...)` rules do stop the *follow-up* command prompts o `additionalDirectories` grants filesystem read/write scope under that path. It does not itself suppress a Bash or `EnterWorktree` confirmation, so it is necessary alongside the rules above, not a substitute for them. -**These `:*` rules are a confirmation-prompt convenience, not a safety boundary, and admit destructive variants of the same commands** (`git add -A`, `git commit -a`, `git worktree add --force`). Claude Code's permission layer decides whether a prompt appears before a command runs, it does not decide whether the command itself is safe -- that is `git-commit-conventions`' "stage by explicit path, never `git add -A`" prose discipline for staging, and `gh-write-guard.py`'s own rule 6 for a mutation aimed at the primary checkout specifically, neither of which this permission block replaces or narrows. A worktree the agent's own task owns is exactly where these ordinary forms are expected to run, so the trade is deliberate: broader, prompt-free convenience for routine work inside a task's own worktree, resting on the agent's documented discipline rather than a mechanical block, the same posture Claude Code's permission system takes everywhere else. +**These `:*` rules are a confirmation-prompt convenience, not a safety boundary, and admit destructive variants of the same commands** (`git add -A`, `git commit -a`, `git worktree add --force`). Claude Code's permission layer decides whether a prompt appears before a command runs. It does not decide whether the command itself is safe. That is `git-commit-conventions`' "stage by explicit path, never `git add -A`" prose discipline for staging, and `gh-write-guard.py`'s own rule 6 for a mutation aimed at the primary checkout specifically. Neither of these is replaced or narrowed by this permission block. A worktree the agent's own task owns is exactly where these ordinary forms are expected to run, so the trade is deliberate. The trade is broader, prompt-free convenience for routine work inside a task's own worktree, resting on the agent's documented discipline rather than a mechanical block. That is the same posture Claude Code's permission system takes everywhere else. -**Call `EnterWorktree` after `git worktree add`, not just `cd`.** The `repo-worktree` skill already documents this (`git worktree add`, then attach with `EnterWorktree` `path:`), and it is worth the one extra approval: Claude Code tracks a session as "isolated in a worktree" only once `EnterWorktree` (or the `--worktree` launch flag) has actually run, and while a session is tracked that way it gets a further, built-in enforcement layer with no configuration at all -- blocking a file edit that targets the main checkout, a Bash/PowerShell/Monitor command whose working directory resolves to (or can't be verified to stay outside) the main checkout, a git redirect into the main checkout (`git -C`, `--git-dir`, `GIT_DIR`/`GIT_WORK_TREE`, or a `cd` into the main checkout before running git), and any command shape it can't verify stays inside the worktree at all. A `cd` alone, with no `EnterWorktree` call, gets none of this: the session's own bookkeeping never marked it as isolated, so these checks never engage, and `host-setup/agent-safety/claude/gh-write-guard.py`'s own rule 6 is what remains -- covering a `-C` or an earlier `cd` redirect and a `sh -c`/`bash -c` wrapper, but, unlike Claude Code's own layer, deliberately not a `checkout`/`switch` of an actual ref carrying no force flag, or a fast-forward-only `pull` (the documented base-clone cleanup step needs exactly those, though a `checkout` of something that is not a ref, such as `git checkout .`, is still denied), and silently inert on a git old enough to lack `rev-parse --path-format`. Its own `claude/README.md` "Scope and Limits" states these precisely. +**Call `EnterWorktree` after `git worktree add`, not just `cd`.** The `repo-worktree` skill already documents this (`git worktree add`, then attach with `EnterWorktree` `path:`), and it is worth the one extra approval. Claude Code tracks a session as "isolated in a worktree" only once `EnterWorktree` (or the `--worktree` launch flag) has actually run. While a session is tracked that way, it gets a further, built-in enforcement layer with no configuration at all. That layer blocks a file edit that targets the main checkout. It also blocks a Bash/PowerShell/Monitor command whose working directory resolves to (or can't be verified to stay outside) the main checkout. It also blocks a git redirect into the main checkout (`git -C`, `--git-dir`, `GIT_DIR`/`GIT_WORK_TREE`, or a `cd` into the main checkout before running git). It blocks any command shape it can't verify stays inside the worktree at all. A `cd` alone, with no `EnterWorktree` call, gets none of this. The session's own bookkeeping never marked the session as isolated, so these checks never engage, and `host-setup/agent-safety/claude/gh-write-guard.py`'s own rule 6 is what remains. It covers a `-C` or an earlier `cd` redirect and a `sh -c`/`bash -c` wrapper. Unlike Claude Code's own layer, it deliberately does not cover a `checkout`/`switch` of an actual ref carrying no force flag, or a fast-forward-only `pull`. The documented base-clone cleanup step needs exactly those, though a `checkout` of something that is not a ref, such as `git checkout .`, is still denied. Rule 6 is also silently inert on a git old enough to lack `rev-parse --path-format`. Its own `claude/README.md` "Scope and Limits" states these precisely. ### opencode Worktree Access @@ -318,7 +318,7 @@ opencode does not read Codex's `config.toml`. Keep its permission mode in openco ## Fleet Skills Install -The fleet's agent skills are hand-authored in the hub at `.agents/skills/` and installed per user by [`scripts/skills_install.py`][skills-install]: an overlay copy into `~/.agents/skills/` for Codex and opencode, and a user-scope Claude Code plugin install where the `claude` CLI is present. Every run stamps the hub commit it installed from into `~/.agents/skills-install-stamp.json`. The copy keeps the revision it was taken from. The Claude Code plugin loads its registered directory in place and serves whatever it holds at read time. That directory is a hub checkout or, on a bootstrapped host, the tree the bootstrap keeps. `--report` answers each by name. It gives the commit the copy came from, judged against the promoted `main` as last fetched (or `--intended `, or on a bootstrapped host the commit its loader resolved). It also gives the commit the registered directory is serving now, and its branch where it is a git checkout. It exits non-zero when the copy is not current, and the live channel following its registered directory is the design rather than a fault. An install leaves a registration from another existing directory where it is and prints the command that moves it, and `--snapshot-only` refreshes the copy without touching the registration at all. +The fleet's agent skills are hand-authored in the hub at `.agents/skills/` and installed per user by [`scripts/skills_install.py`][skills-install]. The install is an overlay copy into `~/.agents/skills/` for Codex and opencode. It is also a user-scope Claude Code plugin install where the `claude` CLI is present. Every run stamps the hub commit it installed from into `~/.agents/skills-install-stamp.json`. The copy keeps the revision it was taken from. The Claude Code plugin loads its registered directory in place and serves whatever it holds at read time. That directory is a hub checkout or, on a bootstrapped host, the tree the bootstrap keeps. `--report` answers each by name. It gives the commit the copy came from, judged against the promoted `main` as last fetched. That judgment can instead be against `--intended `, or on a bootstrapped host against the commit its loader resolved. It also gives the commit the registered directory is serving now, and its branch where it is a git checkout. It exits non-zero when the copy is not current, and the live channel following its registered directory is the design rather than a fault. An install leaves a registration from another existing directory where it is and prints the command that moves it. `--snapshot-only` refreshes the copy without touching the registration at all. Install from a hub checkout, once per machine: @@ -328,11 +328,11 @@ python3 scripts/skills_install.py --snapshot-only # the Codex/opencode copy al python3 scripts/skills_install.py --report # read-only: what does each channel hold? ``` -A bootstrapped host does not run this by hand: the `--host` mode of [`host-setup/bootstrap.sh`][bootstrap] and [`bootstrap.ps1`][bootstrap-ps1] ends with the same installer, driven from the fetched tree by `install-skills.sh` or `install-skills.ps1`, and the `--skills` action runs that step on its own. Those runs keep their tree rather than removing it, since the Claude Code plugin loads it in place, and the [`host-setup/`][host-setup-dir] README's "Where the Tree Lives" says where it sits. On such a host the live channel serves that kept tree, which has no git, rather than a hub checkout. `--report` reads it as `live.vcs: archive` with `branch: null`, which is not a detached checkout. `live.commit` is the commit the bootstrap fetched, and is null where the bootstrap could not resolve one. +A bootstrapped host does not run this by hand. The `--host` mode of [`host-setup/bootstrap.sh`][bootstrap] and [`bootstrap.ps1`][bootstrap-ps1] ends with the same installer, driven from the fetched tree by `install-skills.sh` or `install-skills.ps1`. The `--skills` action runs that step on its own. Those runs keep their tree rather than removing it, since the Claude Code plugin loads it in place. The [`host-setup/`][host-setup-dir] README's "Where the Tree Lives" says where it sits. On such a host the live channel serves that kept tree, which has no git, rather than a hub checkout. `--report` reads it as `live.vcs: archive` with `branch: null`, which is not a detached checkout. `live.commit` is the commit the bootstrap fetched, and is null where the bootstrap could not resolve one. -The `claude` CLI is deliberately absent from the tool catalog in [`spec/host-tools.json`][host-tools]. A Codex-only machine is a complete machine, so the installer degrades where the CLI is missing, still landing the overlay half, saying so, and recording the partial install in the stamp, where cataloging the CLI would instead fail every host that never wanted it. +The `claude` CLI is deliberately absent from the tool catalog in [`spec/host-tools.json`][host-tools]. A Codex-only machine is a complete machine, so the installer degrades where the CLI is missing. It still lands the overlay half, says so, and records the partial install in the stamp. Cataloging the CLI would instead fail every host that never wanted it. -**The refresh cadence**: re-run the installer from a hub checkout on a freshly fetched `main` when `--report` exits non-zero, and after any promotion to `main` that touches `.agents/skills/`. A copy taken from `develop` reads not current by design, since the snapshot is judged against the promoted revision, and `--intended HEAD` judges it against the checkout instead. Session entry runs no automatic check, by design: the trigger is suspicion, and a rule that keeps needing to be restated in a session is the loudest form of it, which is the symptom the `check-this-repo` skill routes to this report. On a bootstrapped host with `live.vcs: archive`, the refresh is re-running `bootstrap.sh --skills` or `bootstrap.ps1 -Skills` instead. Pass `--dir` or `-Dir` naming the parent of `live.checkout` where an earlier run kept the tree somewhere other than the default. Re-running the installer from any other directory leaves an existing registration where it is. The maintainer runs the refresh by hand, and an automated one stays out of scope until the fleet has evidence the manual cadence fails. +**The refresh cadence**: re-run the installer from a hub checkout on a freshly fetched `main` when `--report` exits non-zero. Re-run it likewise after any promotion to `main` that touches `.agents/skills/`. A copy taken from `develop` reads not current by design, since the snapshot is judged against the promoted revision. `--intended HEAD` judges it against the checkout instead. Session entry runs no automatic check, by design: the trigger is suspicion. A rule that keeps needing to be restated in a session is the loudest form of it. That is the symptom the `check-this-repo` skill routes to this report. On a bootstrapped host with `live.vcs: archive`, the refresh is re-running `bootstrap.sh --skills` or `bootstrap.ps1 -Skills` instead. Pass `--dir` or `-Dir` naming the parent of `live.checkout` where an earlier run kept the tree somewhere other than the default. Re-running the installer from any other directory leaves an existing registration where it is. The maintainer runs the refresh by hand, and an automated one stays out of scope until the fleet has evidence the manual cadence fails. ## Verify Host Setup @@ -345,11 +345,11 @@ d=$(mktemp -d "${TMPDIR:-/tmp}/sign-check.XXXXXX") && ( trap 'rm -rf "$d"' 0; em gh auth status ``` -`sig` must read `G` (good signature) or `U` (good signature, unrecognized signer). For GPG, `U` is a valid signature from a key whose trust level is merely undefined, common right after generating a new key. For SSH, it's a valid signature from a key not found in the local `allowed_signers` file, which doesn't affect whether GitHub itself verifies the commit, only local `git verify-commit` output. Both the `author` and `committer` email must be an actual noreply address, and both must match `user.email` from the config line above, all enforced by the snippet itself. `ssh-add -L` (or a `gpg --list-secret-keys` equivalent) is not a substitute: it only proves an agent holds a key, and a host that signs straight from a key file with no agent running passes this scratch commit while failing that probe, per [GOVERNANCE.md "Git and Commit Rules"][governance-git-and-commit-rules]. If signing fails locally, the devcontainer will fail too, so fix here first. +`sig` must read `G` (good signature) or `U` (good signature, unrecognized signer). For GPG, `U` is a valid signature from a key whose trust level is merely undefined, common right after generating a new key. For SSH, it's a valid signature from a key not found in the local `allowed_signers` file. That status doesn't affect whether GitHub itself verifies the commit, only local `git verify-commit` output. Both the `author` and `committer` email must be an actual noreply address, and both must match `user.email` from the config line above. The snippet itself enforces both. `ssh-add -L` (or a `gpg --list-secret-keys` equivalent) is not a substitute: it only proves an agent holds a key. A host that signs straight from a key file with no agent running passes this scratch commit while failing that probe. Both claims are per [GOVERNANCE.md "Git and Commit Rules"][governance-git-and-commit-rules]. If signing fails locally, the devcontainer will fail too, so fix here first. -The gate replaced a line that ran `--version` on each tool and read only whether it answered. That form reported a host carrying the broken `gh` as fully set up, which is the failure it exists to stop. It exits non-zero on a missing required tool or one below its floor, and a below-floor finding prints the defect behind the floor rather than the number alone, names where to install from, and prints the command that installs or upgrades the tool on the current platform, so that failure carries its own fix. A missing tool prints the one-line fact, and [`host-setup/`][host-setup-dir] is its remedy. +The gate replaced a line that ran `--version` on each tool and read only whether it answered. That form reported a host carrying the broken `gh` as fully set up, which is the failure it exists to stop. It exits non-zero on a missing required tool or one below its floor. A below-floor finding prints the defect behind the floor rather than the number alone. The finding also names where to install from and prints the command that installs or upgrades the tool on the current platform. That failure therefore carries its own fix. A missing tool prints the one-line fact, and [`host-setup/`][host-setup-dir] is its remedy. -**This block is POSIX, and on native Windows one line needs translating.** Run the POSIX form from WSL2 or Git Bash per the shell note, or use the PowerShell form below. Git Bash inherits the Windows `PATH`, so `python3` reaches the same interpreter there that it does in PowerShell, which is the point of [`install-tools.ps1`][install-tools-windows] supplying that name in the first place. +**This block is POSIX, and on native Windows one line needs translating.** Run the POSIX form from WSL2 or Git Bash per the shell note, or use the PowerShell form below. Git Bash inherits the Windows `PATH`, so `python3` reaches the same interpreter there that it does in PowerShell. That is the point of [`install-tools.ps1`][install-tools-windows] supplying that name in the first place. ```powershell python3 scripts/host_gate.py # presence and version floors, from spec/host-tools.json @@ -376,7 +376,7 @@ gh auth status Verified on Windows 11 Pro 10.0.26200 with PowerShell 7.6.4, where `python3 scripts/host_gate.py` exits 0 over eight declared tools. It was supplied under [#483][issue-483], which had deferred it until somebody had executed it on a Windows host. One line differs from the POSIX block, the filter, because `grep` has no Windows peer and `Select-String` is the one that ships. -**The gate probes `py -3` before `python3`, which is the one place that name survives.** Which interpreter *runs* `host_gate.py` does not decide what it measures, because the gate reads its answer from its own probes rather than from itself. What those probes must avoid is grading something other than the host: a bare `python3` is reached through `PATH`, where an activated virtual environment or a foreign interpreter from MSYS2, Cygwin or Scoop answers ahead of the managed one. `py` is the launcher, reaches a registered system interpreter whatever is active, and exists on no other platform, so it answers first on Windows and not at all on Linux or macOS, which leaves the `python3` probe to answer for those. The prescription is therefore narrow and internal: `py -3` is the gate's first probe, and `python3` is the name everything else uses. +**The gate probes `py -3` before `python3`, which is the one place that name survives.** Which interpreter *runs* `host_gate.py` does not decide what it measures, because the gate reads its answer from its own probes rather than from itself. What those probes must avoid is grading something other than the host. A bare `python3` is reached through `PATH`. There an activated virtual environment or a foreign interpreter from MSYS2, Cygwin or Scoop answers ahead of the managed one. `py` is the launcher, reaches a registered system interpreter whatever is active, and exists on no other platform. It therefore answers first on Windows and not at all on Linux or macOS, which leaves the `python3` probe to answer for those. The prescription is therefore narrow and internal: `py -3` is the gate's first probe, and `python3` is the name everything else uses. **What the host can do once this passes**, which is the point of the contract above: @@ -389,7 +389,7 @@ Verified on Windows 11 Pro 10.0.26200 with PowerShell 7.6.4, where `python3 scri | Let an agent work with the `gh` credentials live | the host-safety kit is installed | | Have the fleet skills surface in every agent session | the skills snapshot is current per `skills_install.py --report` | -A host that fails any row is not ready for the procedure that row names, and the fix belongs on the host rather than in a repo. +A host that fails any row is not ready for the procedure that row names. The fix belongs on the host rather than in a repo. ## Next Steps diff --git a/host-setup/README.md b/host-setup/README.md index 2a03a4952..6b5f47f19 100644 --- a/host-setup/README.md +++ b/host-setup/README.md @@ -5,11 +5,11 @@ What a machine needs before it can be worked in, and the tooling that puts it th ## What Is Here - [`bootstrap.sh`][bootstrap] stands a Debian or Ubuntu host up from nothing. It is the one file fetched on its own, because a host with no git and no checkout is what it exists to fix. It fetches this repository and runs the tooling from that tree. -- [`bootstrap.ps1`][bootstrap-ps1] does the same for native Windows. It runs under Windows PowerShell 5.1, the version every fresh Windows host guarantees, and hands off to PowerShell 7 once it has found or installed it, since every script it drives requires that version. -- [`menu.sh`][menu] is a human-facing front end over this repository's tooling: the host actions above, plus the repo-level tools ([`spec/audit.py`][audit-runner], [`scripts/carry.py`][carry], [`scripts/build_dist.py`][build-dist]) most of this repository authors for an agent following instructions rather than for a person choosing from a menu. -- [`menu.ps1`][menu-ps1] is the same front end for native Windows, over `host-setup\windows\` instead. It runs under Windows PowerShell 5.1 and hands off to PowerShell 7 the same way `bootstrap.ps1` does, and it adds one menu entry with no Linux peer, reporting the WSL platform through `setup-wsl.ps1`. -- [`linux/`][linux] holds the tooling itself, for Debian and Ubuntu based hosts, Proxmox and WSL included. `install-tools.sh` installs and upgrades the host tools, `upgrade-host.sh` upgrades the packages of the current release or moves to the next one, `setup-github.sh` configures the SSH key, git, and commit signing, `install-agents.sh` keeps the user's installed coding-agent tools current, and `install-skills.sh` drives the hub's skills installer from the same tree. -- [`windows/`][windows] holds the tooling for native Windows, through `winget` and PowerShell 7. `install-tools.ps1` installs and upgrades the host tools, `upgrade-host.ps1` upgrades the winget packages and updates the WSL platform, `setup-github.ps1` configures the SSH key, git, and commit signing, `setup-wsl.ps1` installs a WSL distribution and reports the Docker Desktop integration, `install-agents.ps1` keeps the user's installed coding-agent tools current, and `install-skills.ps1` drives the hub's skills installer from the same tree. +- [`bootstrap.ps1`][bootstrap-ps1] does the same for native Windows. It runs under Windows PowerShell 5.1, the version every fresh Windows host guarantees. It hands off to PowerShell 7 once it has found or installed it, since every script it drives requires that version. +- [`menu.sh`][menu] is a human-facing front end over this repository's tooling: the host actions above, plus the repo-level tools ([`spec/audit.py`][audit-runner], [`scripts/carry.py`][carry], [`scripts/build_dist.py`][build-dist]). Those tools are of the kind most of this repository authors for an agent following instructions rather than for a person choosing from a menu. +- [`menu.ps1`][menu-ps1] is the same front end for native Windows, over `host-setup\windows\` instead. It runs under Windows PowerShell 5.1 and hands off to PowerShell 7 the same way `bootstrap.ps1` does. It adds one menu entry with no Linux peer, reporting the WSL platform through `setup-wsl.ps1`. +- [`linux/`][linux] holds the tooling itself, for Debian and Ubuntu based hosts, Proxmox and WSL included. `install-tools.sh` installs and upgrades the host tools, and `upgrade-host.sh` upgrades the packages of the current release or moves to the next one. `setup-github.sh` configures the SSH key, git, and commit signing. `install-agents.sh` keeps the user's installed coding-agent tools current, and `install-skills.sh` drives the hub's skills installer from the same tree. +- [`windows/`][windows] holds the tooling for native Windows, through `winget` and PowerShell 7. `install-tools.ps1` installs and upgrades the host tools, and `upgrade-host.ps1` upgrades the winget packages and updates the WSL platform. `setup-github.ps1` configures the SSH key, git, and commit signing. `setup-wsl.ps1` installs a WSL distribution and reports the Docker Desktop integration. `install-agents.ps1` keeps the user's installed coding-agent tools current, and `install-skills.ps1` drives the hub's skills installer from the same tree. - [`agent-safety/`][agent-safety] holds the host-safety guards, deployed per machine and per account. ## Standing a Host Up @@ -49,7 +49,7 @@ Invoke-WebRequest -UseBasicParsing -Uri https://raw.githubusercontent.com/ptr727 powershell -ExecutionPolicy Bypass -File bootstrap.ps1 ``` -The first line is the Windows counterpart of installing `curl`: a fresh console's default TLS floor can predate 1.2, which every host this fetches from requires. The third runs under the `powershell.exe` a fresh host guarantees rather than `pwsh`, since `bootstrap.ps1` finds or installs PowerShell 7 itself and hands the rest of the run to it. `-ExecutionPolicy Bypass` clears both the default `Restricted` policy and the mark of the web `Invoke-WebRequest` leaves on the file, in one flag. +The first line is the Windows counterpart of installing `curl`. A fresh console's default TLS floor can predate 1.2, which every host this fetches from requires. The third runs under the `powershell.exe` a fresh host guarantees rather than `pwsh`. That is because `bootstrap.ps1` finds or installs PowerShell 7 itself and hands the rest of the run to it. `-ExecutionPolicy Bypass` clears both the default `Restricted` policy and the mark of the web `Invoke-WebRequest` leaves on the file, in one flag. ```powershell .\bootstrap.ps1 -Report # what each tool would do, changing nothing @@ -96,29 +96,29 @@ powershell -ExecutionPolicy Bypass -File menu.ps1 host-setup\menu.ps1 # from a checkout of this repository, or of any other repo in the fleet ``` -It answers a different question than `bootstrap.sh`/`bootstrap.ps1` do. Those stand a host up and stop. The menu loops, because a person sitting down with it usually wants more than one thing done in a sitting, and it tells the hub apart from whichever repo it happens to be run from: a checkout of `ptr727/ProjectTemplate` gets the hub tasks (audit a cataloged repo, check the generated Skills distributions), a checkout of any other repo gets the downstream tasks too (check or pull the hub's verbatim-owned files into that repo's own worktree, and the same pair again for the verbatim rule sections inside a file that repo also owns the rest of, per [`scripts/carry.py`][carry]), and every run gets the host tasks this directory's `linux/` or `windows/` tooling already provides. Only the downstream tasks need a repo to run from. The hub tasks fetch the hub themselves when there is no local checkout to reuse, so they still show and still work when the menu is run entirely standalone, off no checkout at all. +It answers a different question than `bootstrap.sh`/`bootstrap.ps1` do. Those stand a host up and stop. The menu loops, because a person sitting down with it usually wants more than one thing done in a sitting. It also tells the hub apart from whichever repo it happens to be run from. A checkout of `ptr727/ProjectTemplate` gets the hub tasks (audit a cataloged repo, check the generated Skills distributions). A checkout of any other repo gets the downstream tasks too. These check or pull the hub's verbatim-owned files into that repo's own worktree. They do the same pair again for the verbatim rule sections inside a file that repo also owns the rest of. Both are per [`scripts/carry.py`][carry]. Every run gets the host tasks this directory's `linux/` or `windows/` tooling already provides. Only the downstream tasks need a repo to run from. The hub tasks fetch the hub themselves when there is no local checkout to reuse. They therefore still show and still work when the menu is run entirely standalone, off no checkout at all. -Reaching `spec/audit.py` and `scripts/carry.py` from outside a hub checkout means fetching one, the same "hosted and reached, never carried" model [`scripts/README.md`][scripts-readme] states for those tools generally. The menu clones fresh rather than reusing the bootstrap loader's tarball, since `scripts/carry.py` itself checks that its hub argument is a real git checkout on a freshly fetched `origin/main` with no local changes, and a full clone rather than a shallow one, since `spec/audit.py` walks the hub's own commit history to judge whether a carried copy is trailing the file it was copied from. Run from inside the hub itself, that same freshness is confirmed against the local checkout before a hub task uses it, falling back to a fresh clone when the local checkout has moved on, so an audit or a Skills-distribution check never silently reads a stale or feature-branch tree. Installing the skills from a fresh clone hands off to that clone's own `bootstrap.sh --skills` or `bootstrap.ps1 -Skills` instead of running the installer there. The installer registers the directory it runs from as a Claude Code marketplace loaded in place, and the menu removes its clone on exit, which would leave that registration naming nothing. The bootstrap's kept tree is the one that outlives the run. +Reaching `spec/audit.py` and `scripts/carry.py` from outside a hub checkout means fetching one, the same "hosted and reached, never carried" model [`scripts/README.md`][scripts-readme] states for those tools generally. The menu clones fresh rather than reusing the bootstrap loader's tarball. This is because `scripts/carry.py` itself checks that its hub argument is a real git checkout on a freshly fetched `origin/main` with no local changes. The clone is also a full one rather than a shallow one. This is because `spec/audit.py` walks the hub's own commit history to judge whether a carried copy is trailing the file it was copied from. Run from inside the hub itself, that same freshness is confirmed against the local checkout before a hub task uses it. Run from inside the hub itself, the menu also falls back to a fresh clone when the local checkout has moved on. An audit or a Skills-distribution check therefore never silently reads a stale or feature-branch tree. Installing the skills from a fresh clone hands off to that clone's own `bootstrap.sh --skills` or `bootstrap.ps1 -Skills` instead of running the installer there. The installer registers the directory it runs from as a Claude Code marketplace loaded in place. The menu removes its clone on exit, which would leave that registration naming nothing. The bootstrap's kept tree is the one that outlives the run. ## Which Revision a Run Used -`bootstrap.sh` resolves the ref it was given to the commit it names, prints that commit, and downloads that exact revision. A run therefore says which revision of the tooling it used, and a second run of the same ref cannot silently be a different tree. Where the resolve fails, which an unauthenticated rate limit can cause, the run says it cannot attribute itself and continues, since the download itself is unaffected. +`bootstrap.sh` resolves the ref it was given to the commit it names, prints that commit, and downloads that exact revision. A run therefore says which revision of the tooling it used, and a second run of the same ref cannot silently be a different tree. Where the resolve fails, which an unauthenticated rate limit can cause, the run says it cannot attribute itself and continues. This is because the download itself is unaffected. -`--ref` takes a branch, a tag, a pull request ref, or a commit. It is not only for testing an unmerged change: [`AUDIT.md`][audit] and the sync procedure both tell an agent to fetch this repository immediately before reading it, and a loader that could only reach `main` could not support a repository testing a change before it promotes. +`--ref` takes a branch, a tag, a pull request ref, or a commit. It is not only for testing an unmerged change. [`AUDIT.md`][audit] and the sync procedure both tell an agent to fetch this repository immediately before reading it. A loader that could only reach `main` could not support a repository testing a change before it promotes. ## Where the Tree Lives -A run that installs the skills, `--host`, `--dev`, or `--skills`, keeps its tree, because the Claude Code plugin it registers loads that directory in place rather than copying it. Removing the tree would leave the plugin registered against a directory that no longer exists. The kept tree sits at `skills-tree` under `${XDG_DATA_HOME:-~/.local/share}/host-setup` on Linux and under `%LOCALAPPDATA%\host-setup` on Windows, or under `--dir` where one is given. It carries the commit the run resolved, which is what `skills_install.py --report` names for it, since a tarball has no git to ask. The next such run extracts beside it and swaps the new tree in immediately before the skills step, moving the old one aside first and removing it last. A run that fails before that step, a failed download or a failed tools step alike, therefore leaves the plugin loading what it loaded before. Every other action, and a dry run of these three, extracts a transient tree under another name, which it removes on exit unless `--keep` is given. A run holds a lock on a `.lock` file named for its tree until it ends. A second run against the same directory then stops rather than replace a tree the first is still extracting. Both loaders take the same lock, and the operating system releases it however a run ends. A removal can clear a tree and still fail on the directory itself. The empty directory it leaves at a tree name is removed rather than refused. The installer never moves a registration whose directory still exists, so a host whose plugin already names a hub checkout keeps that checkout, and `skills_install.py --report` names the directory the plugin actually loads. +A run that installs the skills, `--host`, `--dev`, or `--skills`, keeps its tree. This is because the Claude Code plugin it registers loads that directory in place rather than copying it. Removing the tree would leave the plugin registered against a directory that no longer exists. The kept tree sits at `skills-tree` under `${XDG_DATA_HOME:-~/.local/share}/host-setup` on Linux and under `%LOCALAPPDATA%\host-setup` on Windows, or under `--dir` where one is given. It carries the commit the run resolved, which is what `skills_install.py --report` names for it, since a tarball has no git to ask. The next such run extracts beside it and swaps the new tree in immediately before the skills step. It moves the old one aside first and removes it last. A run that fails before that step, a failed download or a failed tools step alike, therefore leaves the plugin loading what it loaded before. Every other action, and a dry run of these three, extracts a transient tree under another name. It removes that tree on exit unless `--keep` is given. A run holds a lock on a `.lock` file named for its tree until it ends. A second run against the same directory then stops rather than replace a tree the first is still extracting. Both loaders take the same lock, and the operating system releases it however a run ends. A removal can clear a tree and still fail on the directory itself. The empty directory it leaves at a tree name is removed rather than refused. The installer never moves a registration whose directory still exists, so a host whose plugin already names a hub checkout keeps that checkout. `skills_install.py --report` names the directory the plugin actually loads. -The kept tree is never a git checkout, which is what keeps the loader's two properties: it needs no git, and it never modifies a checkout that belongs to somebody else. +The kept tree is never a git checkout, which is what keeps the loader's two properties. The loader needs no git, and it never modifies a checkout that belongs to somebody else. ## Three Rules This Directory Follows -**Group by whichever axis has one member.** `linux/` is three concerns on one platform, so it is a platform directory. Windows host tooling therefore sits at `windows/` rather than beside the Linux scripts, because the `winget` equivalent of `install-tools.sh` is a different program rather than a translation of one. It carries one registry record per tool where the Linux script carries four functions, since every Windows source is `winget` and the per-tool variation those functions exist for does not arise. `windows/` also carries a fourth script with no Linux peer, because WSL is a Windows-side concern. The loader and the menu are one concern, two platforms, so `bootstrap.ps1` sits beside `bootstrap.sh`, and `menu.ps1` beside `menu.sh`, at the top level rather than inside `windows/`. `agent-safety/` follows the same platform-grouping shape one level down: it holds one concern (host-safety guards) implemented per *agent* rather than per OS, so `claude/`, `codex/`, and `opencode/` sit beside each other the way `linux/` and `windows/` do, each holding that one agent's own files (a Claude Code implementation carries its own `install.sh`/`install.ps1` pair inside `claude/`, the same platform variation `linux/`/`windows/` carry at the top level, just nested one directory deeper because the outer axis here is the agent, not the OS). Its root `README.md` is the agent-agnostic spec those per-agent directories each implement, not a concern directory of its own. +**Group by whichever axis has one member.** `linux/` is three concerns on one platform, so it is a platform directory. Windows host tooling therefore sits at `windows/` rather than beside the Linux scripts. This is because the `winget` equivalent of `install-tools.sh` is a different program rather than a translation of one. It carries one registry record per tool where the Linux script carries four functions. This is because every Windows source is `winget`, and the per-tool variation those functions exist for does not arise. `windows/` also carries a fourth script with no Linux peer, because WSL is a Windows-side concern. The loader and the menu are one concern, two platforms. So `bootstrap.ps1` sits beside `bootstrap.sh`, and `menu.ps1` beside `menu.sh`, at the top level rather than inside `windows/`. `agent-safety/` follows the same platform-grouping shape one level down. It holds one concern (host-safety guards) implemented per *agent* rather than per OS. So `claude/`, `codex/`, and `opencode/` sit beside each other the way `linux/` and `windows/` do, each holding that one agent's own files. For example, a Claude Code implementation carries its own `install.sh`/`install.ps1` pair inside `claude/`, the same platform variation `linux/`/`windows/` carry at the top level. The pair is just nested one directory deeper because the outer axis here is the agent, not the OS. The `agent-safety/` root `README.md` is the agent-agnostic spec those per-agent directories each implement, not a concern directory of its own. -**Nothing here needs Python to stand a host up, and neither loader needs an interpreter to fetch what it drives.** [`docs/host-setup.md`][host-setup] carries that as part of the contract, with the reasoning. `bootstrap.sh` needs only `curl`, `tar`, and `flock`, the last from the `util-linux` package every Debian-family base install carries. `bootstrap.ps1` needs only `tar.exe`, which has shipped with Windows since 1803, and installs its one further dependency, `pwsh`, itself through `winget`. The one exception is the `install-skills` pair, which drives the Python installer at `scripts/skills_install.py` and runs last in a stand-up for exactly that reason: `install-tools` has provided the interpreter by then, and run alone on a host without one it stops and names the tools step as its prerequisite. The menu needs `git` to fetch the hub, and it checks for `uv` the same lazy way: only the tasks that run a hub Python tool ask for it, and every host task still works without one. Installing the skills from a clone the menu fetched also needs what the bootstrap it hands off to needs. That is `curl`, `tar`, and `flock` on Linux, and a host that reaches `codeload.github.com` as well as `github.com`. Reaching `api.github.com` too lets the install record which commit it holds. Neither loader runs a gate as a closing step: [`scripts/host_gate.py`][host-gate] measures a host against the floors and is not called from here, and nothing here is called from it. A host set up by hand years ago is an ordinary host, so the gate reports what it is missing and running this tooling is a remedy a person chooses. The two are joined at code time instead, by [`tests/test_bootstrap.py`][test-bootstrap] asserting that every tool the spec requires is one this tooling can provide. +**Nothing here needs Python to stand a host up, and neither loader needs an interpreter to fetch what it drives.** [`docs/host-setup.md`][host-setup] carries that as part of the contract, with the reasoning. `bootstrap.sh` needs only `curl`, `tar`, and `flock`, the last from the `util-linux` package every Debian-family base install carries. `bootstrap.ps1` needs only `tar.exe`, which has shipped with Windows since 1803, and installs its one further dependency, `pwsh`, itself through `winget`. The one exception is the `install-skills` pair, which drives the Python installer at `scripts/skills_install.py`. It runs last in a stand-up for exactly that reason: `install-tools` has provided the interpreter by then. Run alone on a host without one, the pair stops and names the tools step as its prerequisite. The menu needs `git` to fetch the hub, and it checks for `uv` the same lazy way. Only the tasks that run a hub Python tool ask for it, and every host task still works without one. Installing the skills from a clone the menu fetched also needs what the bootstrap it hands off to needs. That is `curl`, `tar`, and `flock` on Linux, and a host that reaches `codeload.github.com` as well as `github.com`. Reaching `api.github.com` too lets the install record which commit it holds. Neither loader runs a gate as a closing step. [`scripts/host_gate.py`][host-gate] measures a host against the floors and is not called from here, and nothing here is called from it. A host set up by hand years ago is an ordinary host. The gate therefore reports what it is missing, and running this tooling is a remedy a person chooses. The two are joined at code time instead, by [`tests/test_bootstrap.py`][test-bootstrap] asserting that every tool the spec requires is one this tooling can provide. -**The scripts under `linux/` and `windows/` share no file, and the duplication is deliberate.** Each is independently fetchable and runnable on its own, which is the property that lets a host with no checkout use one without the others. A shared helper file would take that away: the moment one script sources a sibling, fetching it alone yields a script that dies on a missing file. What is duplicated is about thirty lines each of logging, the dry-run wrapper, the confirmation prompt, and a temporary directory, and those copies are identical rather than merely similar. Do not factor them out. `bootstrap.ps1` and `menu.ps1` exercise the same fetchability argument their `.sh` counterparts always have, rather than merely being written to allow for it. The `install-skills` pair is the one recorded exception to independent fetchability: it drives `scripts/skills_install.py` at the tree root, because the skills content lives in the tree, so a copy fetched alone has nothing to install and the property cannot apply to it. +**The scripts under `linux/` and `windows/` share no file, and the duplication is deliberate.** Each is independently fetchable and runnable on its own, which is the property that lets a host with no checkout use one without the others. A shared helper file would take that away. The moment one script sources a sibling, fetching it alone yields a script that dies on a missing file. What is duplicated is about thirty lines each of logging, the dry-run wrapper, the confirmation prompt, and a temporary directory. Those copies are identical rather than merely similar. Do not factor them out. `bootstrap.ps1` and `menu.ps1` exercise the same fetchability argument their `.sh` counterparts always have, rather than merely being written to allow for it. The `install-skills` pair is the one recorded exception to independent fetchability. It drives `scripts/skills_install.py` at the tree root, because the skills content lives in the tree. A copy fetched alone therefore has nothing to install, and the property cannot apply to it. diff --git a/host-setup/linux/README.md b/host-setup/linux/README.md index 804f739e4..caac14c44 100644 --- a/host-setup/linux/README.md +++ b/host-setup/linux/README.md @@ -7,7 +7,7 @@ The tooling that makes a Debian or Ubuntu based host satisfy the contract in [`d - [`install-tools.sh`][install-tools] installs and upgrades the host tools. It reports what each is installed at, what upstream carries, where it comes from, and its status. Its `--sudo-timestamp` action is the one thing it does that is about the host rather than a tool. - [`upgrade-host.sh`][upgrade-host] upgrades the packages of the current release. Moving to the next release is a separate action behind its own flag. - [`setup-github.sh`][setup-github] configures the SSH key, git, and commit signing. It checks both key registrations against what GitHub publishes. -- [`install-agents.sh`][install-agents] keeps this user's coding-agent tools current through each tool's own updater, touching only the ones already installed, and installs one only when it is named. +- [`install-agents.sh`][install-agents] keeps this user's coding-agent tools current through each tool's own updater, touching only the ones already installed. The script installs a tool only when that tool is named. - [`install-skills.sh`][install-skills] drives the hub's skills installer at [`scripts/skills_install.py`][skills-install] from this tree. Each runs on its own, and each takes `--help`. @@ -71,7 +71,7 @@ An install or upgrade collects a tool whose install fails and carries on, so one **For `dotnet`, the distro feed is the default and Microsoft's feed is the fallback.** The fallback is added only where the distro carries no SDK at all, because mixing the two feeds is what breaks a host. Microsoft's feed carries amd64 only, so any other architecture without a distro SDK is a named skip. The default set is the newest SDK line the feed carries. `--optional` adds every other line, for a host that builds against more than one. -**`powershell` is optional and comes from Microsoft's feed, the same one `dotnet` falls back to.** The distro never carries a package, so there is no distro version to prefer and no mixing concern to weigh. It joins the default selection only under `--optional`, and naming it on the command line selects it either way. Like `dotnet`, the feed carries amd64 only, so any other architecture is a named skip. It is not part of the fleet contract, which is why it stays optional: a repository that needs `pwsh` opts in rather than every host carrying it. +**`powershell` is optional and comes from Microsoft's feed, the same one `dotnet` falls back to.** The distro never carries a package, so there is no distro version to prefer and no mixing concern to weigh. It joins the default selection only under `--optional`, and naming it on the command line selects it either way. Like `dotnet`, the feed carries amd64 only, so any other architecture is a named skip. It is not part of the fleet contract, which is why it stays optional. A repository that needs `pwsh` opts in rather than every host carrying it. ## The Sudo Credential Cache @@ -127,7 +127,7 @@ Two steps cannot be automated, because they happen in a browser. The public key The agent tools install into the user's home, so this script refuses root rather than reporting root's empty home as every tool absent. A scheduled run that starts as root reaches it through `runuser -u --`. It appends `~/.local/bin` and `~/.opencode/bin` to `PATH`, since such a run carries none of the per-user directories these installers write to. -`--upgrade` runs each installed tool's own updater with standard input closed and a time bound, so an updater that stops to ask fails rather than hanging the run. `--install` takes tool names or `--all`, and with neither it refuses, so nothing is installed by default. herdr refuses to update from inside one of its own panes, so a run there skips that one step and still refreshes the integrations. [`docs/host-setup.md`][host-setup] "Agent Tool Updates" states why the set is opt-in. +`--upgrade` runs each installed tool's own updater with standard input closed and a time bound. An updater that stops to ask therefore fails rather than hanging the run. `--install` takes tool names or `--all`, and with neither it refuses, so nothing is installed by default. herdr refuses to update from inside one of its own panes, so a run there skips that one step and still refreshes the integrations. [`docs/host-setup.md`][host-setup] "Agent Tool Updates" states why the set is opt-in. ## install-skills.sh Is the Exception diff --git a/host-setup/windows/README.md b/host-setup/windows/README.md index 627abaa4c..e46778313 100644 --- a/host-setup/windows/README.md +++ b/host-setup/windows/README.md @@ -4,11 +4,11 @@ The tooling that makes a native Windows host satisfy the contract in [`docs/host ## What Is Here -- [`install-tools.ps1`][install-tools] installs and upgrades the host tools, and reports what each one is installed at, where it came from, and which scope it sits in. Installing, upgrading or reinstalling `docker` also brings the WSL platform up to Docker Desktop's own floor where it is behind. +- [`install-tools.ps1`][install-tools] installs and upgrades the host tools. It reports what each one is installed at, where it came from, and which scope it sits in. Installing, upgrading or reinstalling `docker` also brings the WSL platform up to Docker Desktop's own floor where it is behind. - [`upgrade-host.ps1`][upgrade-host] upgrades the packages `winget` manages and updates the WSL platform. - [`setup-github.ps1`][setup-github] configures the SSH key, git, and commit signing. - [`setup-wsl.ps1`][setup-wsl] installs a WSL distribution and reports how Docker Desktop is integrated with the ones this host runs. -- [`install-agents.ps1`][install-agents] keeps this user's coding-agent tools current through each tool's own updater, cswap excepted, which goes through `uv tool upgrade` since its updater cannot replace its own running launcher on Windows, touching only the ones already installed, and installs one only when it is named. A tool winget owns is left to `upgrade-host.ps1`. It refuses an elevated session, since the tools live in the user's profile. codex and opencode document no Windows installer outside a package manager, so it installs neither and names the route their documentation gives. +- [`install-agents.ps1`][install-agents] keeps this user's coding-agent tools current through each tool's own updater, touching only the ones already installed. cswap is the exception to each tool's own updater, going through `uv tool upgrade` since its updater cannot replace its own running launcher on Windows. The script installs a tool only when that tool is named. A tool winget owns is left to `upgrade-host.ps1`. It refuses an elevated session, since the tools live in the user's profile. codex and opencode document no Windows installer outside a package manager, so it installs neither and names the route their documentation gives. Each runs on its own, and each takes `-Help`. @@ -31,29 +31,29 @@ host-setup\windows\install-agents.ps1 -Upgrade **Script execution.** A `git clone` carries no mark of the web, so these run under the default `RemoteSigned` policy. A browser-downloaded zip does carry one, and is blocked until `Unblock-File` clears the mark. The `.\` prefix is required when running a script from the current directory, exactly as it is for [`agent-safety/claude/install.ps1`][agent-safety]. -`pwsh -File .\install-tools.ps1` answers the `.\` rule and **not** the policy, which still applies to it: on a marked file under `RemoteSigned` it fails with a `SecurityError` naming the file as unsigned. The form that gets past the mark is `pwsh -ExecutionPolicy Bypass -File .\install-tools.ps1`, the same shape [`agent-safety/claude/README.md`][agent-safety-claude-readme] gives for the host-safety installer -- `-ExecutionPolicy Bypass` sets only the process scope, which a machine- or user-level policy set by Group Policy still overrides. Prefer clearing the mark with `Unblock-File` over bypassing, since the bypass covers every script that the run touches and does not universally guarantee the run. +`pwsh -File .\install-tools.ps1` answers the `.\` rule and **not** the policy, which still applies to it. On a marked file under `RemoteSigned` it fails with a `SecurityError` naming the file as unsigned. The form that gets past the mark is `pwsh -ExecutionPolicy Bypass -File .\install-tools.ps1`, the same shape [`agent-safety/claude/README.md`][agent-safety-claude-readme] gives for the host-safety installer. `-ExecutionPolicy Bypass` sets only the process scope, which a machine- or user-level policy set by Group Policy still overrides. Prefer clearing the mark with `Unblock-File` over bypassing, since the bypass covers every script that the run touches and does not universally guarantee the run. ## Why winget Is the Only Source -Every tool the contract names has a winget package, so nothing here carries a fallback. That is the whole difference from the Linux script, which needs three kinds of source because the distribution's package trails upstream on `gh`, on `node` and on `uv`. Where `winget` tracks upstream, the machinery that exists to work around a stale feed has nothing to do. +Every tool the contract names has a winget package, so nothing here carries a fallback. That is the whole difference from the Linux script. The Linux script needs three kinds of source because the distribution's package trails upstream on `gh`, on `node` and on `uv`. Where `winget` tracks upstream, the machinery that exists to work around a stale feed has nothing to do. Ripgrep uses the upstream project's documented `BurntSushi.ripgrep.MSVC` package. It provides the `rg` command used for repository searches and `rg --files` discovery. -A tool that turns out to have no winget package is a finding to raise rather than a second source to add quietly, because the moment one tool comes from somewhere else this directory stops being one program and becomes two. +A tool that turns out to have no winget package is a finding to raise rather than a second source to add quietly. This is because the moment one tool comes from somewhere else, this directory stops being one program and becomes two. ## Elevation and Scope -**Run these unelevated.** No `--scope` is passed unless `-Scope` names one, so `winget` acts on the copy it finds and an installer that needs administrator raises its own prompt. That is the path with the fewest failures, for three reasons that point the same way: forcing user scope installs a second copy beside a working machine wide one rather than upgrading it, some installers fail outright when launched from an already elevated process, and a user scope install made from an elevated process lands in the administrator's profile rather than the caller's. +**Run these unelevated.** No `--scope` is passed unless `-Scope` names one. So `winget` acts on the copy it finds, and an installer that needs administrator raises its own prompt. That is the path with the fewest failures, for three reasons that point the same way. Forcing user scope installs a second copy beside a working machine wide one rather than upgrading it. Some installers fail outright when launched from an already elevated process. A user scope install made from an elevated process lands in the administrator's profile rather than the caller's. Nothing here elevates itself. A run that is already elevated says so and carries on, since that is a caution rather than a refusal. -**Scope is measured, not assumed.** `winget list --scope user` and `--scope machine` answer separately, so the report names where each tool actually sits and catches the case worth catching, which is a tool installed in **both** scopes with one copy shadowing the other on `PATH`. +**Scope is measured, not assumed.** `winget list --scope user` and `--scope machine` answer separately, so the report names where each tool actually sits. The report thereby catches the case worth catching, which is a tool installed in **both** scopes with one copy shadowing the other on `PATH`. **`-Reinstall` is the only action that removes anything**, and it always asks first. An `-Upgrade` whose `-Scope` disagrees with the installed copy refuses and names it, rather than upgrading in place or adding a second copy. -**A state that could not be read is never reported as an absence.** Where `winget` does not answer what is installed, the tool reports `unreadable` rather than `missing`, and an install or upgrade skips it and collects it as a failure. Installing against a state nobody measured is how a second copy lands beside a first one that was there all along. +**A state that could not be read is never reported as an absence.** Where `winget` does not answer what is installed, the tool reports `unreadable` rather than `missing`. In that case an install or upgrade skips it and collects it as a failure. Installing against a state nobody measured is how a second copy lands beside a first one that was there all along. -**What provenance can and cannot be detected.** Scope is solid, and so is a tool that answers on `PATH` while `winget` knows no package for it, which reports as `unmanaged`. Whether a package was installed *by* winget is not solid and is not claimed: winget runs the vendor's own installer for an `exe` or an `msi`, so the resulting uninstall entry is identical whether winget invoked it or a person did. The one positive marker is the uninstall key winget writes for itself on a portable or archive package, which the report names where it is present and says nothing about where it is absent. +**What provenance can and cannot be detected.** Scope is solid, and so is a tool that answers on `PATH` while `winget` knows no package for it, which reports as `unmanaged`. Whether a package was installed *by* winget is not solid and is not claimed. For an `exe` or an `msi`, winget runs the vendor's own installer. The resulting uninstall entry is therefore identical whether winget invoked it or a person did. The one positive marker is the uninstall key winget writes for itself on a portable or archive package. The report names it where it is present and says nothing about where it is absent. **A newer `dotnet` SDK from outside the managed package is named rather than compared.** The `dotnet` row reads the one winget package the fleet manages, `Microsoft.DotNet.SDK.10`. Visual Studio lands its own SDKs, previews included, in the same directory, and so does another winget SDK package such as the preview one. The `dotnet` status still compares the managed package alone, since that is the copy an upgrade acts on. Where `dotnet --list-sdks` holds a newer SDK, the report names it in a note, because `dotnet` runs it wherever no `global.json` pins another. @@ -61,19 +61,19 @@ Nothing here elevates itself. A run that is already elevated says so and carries Some applications update themselves and never rewrite the version recorded at install time. `winget` reports them as permanently behind, and its manifest marks them as requiring explicit targeting so an upgrade of everything leaves them alone. -These are listed apart, left alone, and printed with **no command beside them**. Offering one invites a full reinstall over a working, already current copy in pursuit of a number that will not move. `MSYS2` is the worked example: it upgrades through `pacman` from inside the msys shell, and the version `winget` shows is the installer's rather than the one it runs. `install-tools.ps1` reports such a tool as `self-updating` rather than `outdated` for the same reason. +These are listed apart, left alone, and printed with **no command beside them**. Offering one invites a full reinstall over a working, already current copy in pursuit of a number that will not move. `MSYS2` is the worked example. It upgrades through `pacman` from inside the msys shell, and the version `winget` shows is the installer's rather than the one it runs. `install-tools.ps1` reports such a tool as `self-updating` rather than `outdated` for the same reason. ## Why There Is No Linter Category -Neither this tooling nor its Linux sibling installs `markdownlint`, `cspell`, `actionlint`, `editorconfig-checker`, `shellcheck`, `shfmt`, `PSScriptAnalyzer`, `check-jsonschema` or `ruff`, and that is a decision rather than a gap. +Neither this tooling nor its Linux sibling installs `markdownlint`, `cspell`, `actionlint`, `editorconfig-checker`, `shellcheck`, `shfmt`, `PSScriptAnalyzer`, `check-jsonschema` or `ruff`. That is a decision rather than a gap. -Each of those runs as a pinned container image or through `uvx`, which is what keeps a local run and CI the same check: the image tag fixes the version. Installing native copies through `winget` would put a second, unpinned version of each on the host, and a local run would then differ from CI, which is the exact property the pinned images exist to guarantee. The only host requirements any of it creates are `docker` and `uv`, and both are already in the registry. +Each of those runs as a pinned container image or through `uvx`, which is what keeps a local run and CI the same check. The image tag fixes the version. Installing native copies through `winget` would put a second, unpinned version of each on the host. A local run would then differ from CI, which is the exact property the pinned images exist to guarantee. The only host requirements any of it creates are `docker` and `uv`, and both are already in the registry. ## bootstrap.ps1 -[`bootstrap.ps1`][bootstrap-ps1] is a fifth script, and the odd one out: it sits beside [`bootstrap.sh`][bootstrap] at the top of [`host-setup/`][host-setup-readme] rather than here, since it is the same concern as that file rather than a fifth member of this registry. It exists to stand up a host that has no git and no checkout, the same problem `bootstrap.sh` solves on Linux. +[`bootstrap.ps1`][bootstrap-ps1] is a fifth script, and the odd one out. It sits beside [`bootstrap.sh`][bootstrap] at the top of [`host-setup/`][host-setup-readme] rather than here. This is because it is the same concern as that file rather than a fifth member of this registry. It exists to stand up a host that has no git and no checkout, the same problem `bootstrap.sh` solves on Linux. -An unverified loader is worse than none, and that is why this one does more than fetch a tarball. It runs under Windows PowerShell 5.1, the one shell a fresh Windows host guarantees, and hands off to `pwsh` only once it has found or installed it through `winget`, since every script in this directory refuses to run under anything older. It pins TLS 1.2 itself rather than assume a fresh console's default reaches GitHub. And it checks a fetched tree for the marker it wrote before removing anything under `-Dir`, the same rule `bootstrap.sh` follows on Linux. None of that verifies the tooling it goes on to run, which stays exactly as unverified against a genuinely fresh host as it always was. It verifies the one step earlier this loader adds, standing up the interpreter everything past it depends on. +An unverified loader is worse than none, and that is why this one does more than fetch a tarball. It runs under Windows PowerShell 5.1, the one shell a fresh Windows host guarantees. It hands off to `pwsh` only once it has found or installed it through `winget`. That is because every script in this directory refuses to run under anything older. It pins TLS 1.2 itself rather than assume a fresh console's default reaches GitHub. And it checks a fetched tree for the marker it wrote before removing anything under `-Dir`, the same rule `bootstrap.sh` follows on Linux. None of that verifies the tooling it goes on to run, which stays exactly as unverified against a genuinely fresh host as it always was. It verifies the one step earlier this loader adds, standing up the interpreter everything past it depends on. ```powershell pwsh -NoProfile -File ..\bootstrap.ps1 -Help @@ -82,7 +82,7 @@ pwsh -NoProfile -File ..\bootstrap.ps1 -Help ## menu.ps1 -[`menu.ps1`][menu-ps1] sits beside [`menu.sh`][menu] at the top of [`host-setup/`][host-setup-readme] for the same reason `bootstrap.ps1` sits beside `bootstrap.sh`: it fronts this registry's scripts rather than joining it, and [`host-setup/README.md`][host-setup-readme] "The Human Menu" carries its full contract. It shares `bootstrap.ps1`'s PowerShell 5.1 to `pwsh` handoff, and it adds one entry with no Linux peer, `setup-wsl.ps1 -Status`, since WSL is a Windows-side concern. +[`menu.ps1`][menu-ps1] sits beside [`menu.sh`][menu] at the top of [`host-setup/`][host-setup-readme] for the same reason `bootstrap.ps1` sits beside `bootstrap.sh`. That reason is that `menu.ps1` fronts this registry's scripts rather than joining it. [`host-setup/README.md`][host-setup-readme] "The Human Menu" carries `menu.ps1`'s full contract. `menu.ps1` shares `bootstrap.ps1`'s PowerShell 5.1 to `pwsh` handoff, and it adds one entry with no Linux peer, `setup-wsl.ps1 -Status`, since WSL is a Windows-side concern. ```powershell pwsh -NoProfile -File ..\menu.ps1 -Help @@ -91,19 +91,19 @@ pwsh -NoProfile -File ..\menu.ps1 -Help ## Docker Desktop and WSL -`setup-wsl.ps1` **reports** the Docker Desktop integration and never writes it. Docker holds those settings in memory and rewrites its settings file from that copy while it runs, so an edit made here is discarded at Docker's next save and an edit made while it is stopped is undone by the next start. Change it in Docker Desktop under Settings, Resources, WSL integration. +`setup-wsl.ps1` **reports** the Docker Desktop integration and never writes it. Docker holds those settings in memory and rewrites its settings file from that copy while it runs. An edit made here is therefore discarded at Docker's next save. An edit made while it is stopped is likewise undone by the next start. Change it in Docker Desktop under Settings, Resources, WSL integration. `upgrade-host.ps1 -Wsl` **refuses while Docker Desktop is running**, because Docker holds the WSL service open and the update then fails part way rather than declining. Quit Docker from its tray icon first, since pausing it is not enough. The refusal fires under `-DryRun` too, so a dry run reports the truth rather than printing a command that would not have worked. Docker's own `docker-desktop` distribution is excluded from every distribution listing, since it is Docker's rather than one an operator installed. -`install-tools.ps1` checks, before installing or upgrading `docker`, that `wsl.exe` is present and reports a WSL version at or above `2.1.5`, Docker Desktop's own documented floor for the platform it depends on. Where `wsl.exe` is missing entirely it skips `docker` and names the remedy (`wsl --install --no-distribution`), the one case this still leaves to a person: standing up WSL from nothing is a different action from bringing an existing platform current, the same reasoning that keeps a distribution *install* in `setup-wsl.ps1` rather than folded in here. The same check surfaces as a note under `-Report`, read-only, before a caller ever runs `-Install`. +`install-tools.ps1` checks, before installing or upgrading `docker`, that `wsl.exe` is present and reports a WSL version at or above `2.1.5`. That is Docker Desktop's own documented floor for the platform it depends on. Where `wsl.exe` is missing entirely it skips `docker` and names the remedy (`wsl --install --no-distribution`), the one case this still leaves to a person. Standing up WSL from nothing is a different action from bringing an existing platform current. That is the same reasoning that keeps a distribution *install* in `setup-wsl.ps1` rather than folded in here. The same check surfaces as a note under `-Report`, read-only, before a caller ever runs `-Install`. -Where WSL is present but behind the floor, or `docker` itself is about to change version, `install-tools.ps1` drives the fix itself rather than only naming it, asking first unless `-Yes` was given. Where Docker Desktop is running, it stops it through its own CLI (`docker desktop stop`, not the tray icon) rather than leave it up through the change, runs `wsl --update` where the floor is not met, and once the `docker` package itself is also settled, shuts every WSL distribution down with `wsl --shutdown` and starts Docker Desktop again (`docker desktop start`). A run that finds Docker Desktop already stopped has nothing to restore, so it stops there too: neither the shutdown nor the restart runs. +Where WSL is present but behind the floor, or `docker` itself is about to change version, `install-tools.ps1` drives the fix itself. It does so rather than only naming it, asking first unless `-Yes` was given. Where Docker Desktop is running, it stops it through its own CLI (`docker desktop stop`, not the tray icon) rather than leave it up through the change, runs `wsl --update` where the floor is not met, and once the `docker` package itself is also settled, shuts every WSL distribution down with `wsl --shutdown` and starts Docker Desktop again (`docker desktop start`). A run that finds Docker Desktop already stopped has nothing to restore, so it stops there too: neither the shutdown nor the restart runs. -This moved a boundary the tool used to hold: WSL used to be read-only here, and `upgrade-host.ps1 -Wsl` was the only thing that ever ran `wsl --update`, on the reasoning that an update restarts every distribution and that does not belong as a side effect of installing a different tool. Two things moved it. Docker Desktop's own per-distro WSL integration goes stale across an engine bump often enough to have a name on Docker's own tracker (`WSL integration with distro '' unexpectedly stopped`), and the dialog's own "Restart the WSL integration" button does not clear it, since it retries the proxy inside the distro that is already running against the same stale state. A full stop, `wsl --shutdown`, start cycle does clear it. And once a `docker` version bump already needed that exact stop-then-restart window for its own integration to recover, updating WSL inside that same window costs nothing extra, and skips the `upgrade-host.ps1 -Wsl` refusal a Docker Desktop already running would otherwise walk straight into. +This moved a boundary the tool used to hold. WSL used to be read-only here, and `upgrade-host.ps1 -Wsl` was the only thing that ever ran `wsl --update`. The reasoning was that an update restarts every distribution and that does not belong as a side effect of installing a different tool. Two things moved it. Docker Desktop's own per-distro WSL integration goes stale across an engine bump often enough to have a name on Docker's own tracker (`WSL integration with distro '' unexpectedly stopped`). The dialog's own "Restart the WSL integration" button does not clear it. This is because it retries the proxy inside the distro that is already running against the same stale state. A full stop, `wsl --shutdown`, start cycle does clear it. And once a `docker` version bump already needed that exact stop-then-restart window to recover its own integration, updating WSL in that window costs nothing extra. Updating WSL in that window also skips the `upgrade-host.ps1 -Wsl` refusal a Docker Desktop already running would otherwise walk straight into. -`wsl --update` installs through its own MSI and raises a UAC prompt when this `pwsh` is not itself elevated, the state the rest of this tooling deliberately stays in. Nothing can answer that prompt unattended, so where the process is neither elevated nor at an interactive console, `install-tools.ps1` refuses to start the update rather than hang, and restores Docker Desktop to how it found it first. +`wsl --update` installs through its own MSI and raises a UAC prompt when this `pwsh` is not itself elevated. That is the state the rest of this tooling deliberately stays in. Nothing can answer that prompt unattended. So where the process is neither elevated nor at an interactive console, `install-tools.ps1` refuses to start the update rather than hang. In that case it restores Docker Desktop to how it found it first. ## Differences From the Linux Tooling @@ -122,7 +122,7 @@ This moved a boundary the tool used to hold: WSL used to be read-only here, and | `ssh-agent` is a socket, started per shell | `ssh-agent` is a Windows service, reported and not started | Starting it needs administrator, and nothing here elevates | | no WSL script | `setup-wsl.ps1` | WSL is a Windows-side concern with no Linux-side peer | -The scripts here share no file with each other, and the roughly thirty duplicated lines of logging, the dry-run wrapper and the confirmation prompt are identical rather than merely similar. That is the same rule the Linux scripts follow, for the same reason, and it is stated in [`host-setup/README.md`][host-setup-readme]. Do not factor them out. +The scripts here share no file with each other. The roughly thirty duplicated lines of logging, the dry-run wrapper and the confirmation prompt are identical rather than merely similar. That is the same rule the Linux scripts follow, for the same reason, and it is stated in [`host-setup/README.md`][host-setup-readme]. Do not factor them out. ## Verification @@ -150,7 +150,7 @@ host-setup\windows\setup-wsl.ps1 -Install Debian -DryRun `-Repo` adds the repository's `install.windows` entries to the report or action. Only `winget` package IDs are accepted. The script does not execute the declaration's `remedy` text. -Two of those are guards rather than previews, and each prints a refusal rather than a command: `upgrade-host.ps1 -Wsl -DryRun` on a host running Docker Desktop, and an `-Upgrade` whose `-Scope` disagrees with the installed copy. A `[dry run]` line from either means the guard sits in the wrong place. +Two of those are guards rather than previews, and each prints a refusal rather than a command. They are `upgrade-host.ps1 -Wsl -DryRun` on a host running Docker Desktop, and an `-Upgrade` whose `-Scope` disagrees with the installed copy. A `[dry run]` line from either means the guard sits in the wrong place. The scripts are checked by `PSScriptAnalyzer`, which runs in CI as the peer of the `shellcheck` step and locally through the invocation in [`GOVERNANCE.md`][governance]. [`tests/test_bootstrap.py`][test-bootstrap] asserts that every tool the spec requires is one this registry carries, and that no script here opens with a shebang.