Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ Agent enablement for a fleet of repositories: autonomy and repeatable quality in
## Release History

- Version 2.0:
- Repurposed from a .NET sample-project template into a governance and workflow-audit catalog: the shared fleet rules (`AGENTS.md`, `CODESTYLE.md`, `WORKFLOW.md`), a machine-readable `spec/`, the fleet `registry/`, per-repo audit `reports/`, branch rulesets, and three procedures an agent routes between by what a repository actually holds: `STANDUP.md` from nothing to operational, `AUDIT.md` to measure without changing anything, and `RESYNC.md` to bring a repository that has fallen behind back into line. Adds a host tool contract with version floors (`spec/host-tools.json` and a carried `host-tools.json` per repository), and a derived detector for files the hub hosts rather than carries, so a retired file is found rather than remembered. Ships no application code, and the old sample project and its build pipeline are removed.
- Repurposed from a .NET sample-project template into a governance and workflow-audit catalog. It holds the shared fleet rules (`AGENTS.md`, `CODESTYLE.md`, `WORKFLOW.md`), a machine-readable `spec/`, the fleet `registry/`, per-repo audit `reports/`, branch rulesets, and three procedures. An agent routes between them by what a repository actually holds. `STANDUP.md` takes a repository from nothing to operational, and `AUDIT.md` measures without changing anything. `RESYNC.md` brings a repository that has fallen behind back into line. Adds a host tool contract with version floors (`spec/host-tools.json` and a carried `host-tools.json` per repository). Also adds a derived detector for files the hub hosts rather than carries, so a retired file is found rather than remembered. Ships no application code, and the old sample project and its build pipeline are removed.
- Version 1.0:
- .NET sample-project template with a build and publish pipeline.
2 changes: 1 addition & 1 deletion OPERATIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ repo-config/configure.sh apply owner/repo release|operational

`check` is read-only and exits non-zero on drift. `apply` is idempotent and drives entirely from the committed payloads, so it is a no-op on a conformant repo. `check` also asserts one group `apply` never writes, the existence and deployment-branch policy of every environment the registry's `environments` declares for the repo. So the two are not exact inverses. [docs/repo-config.md](./docs/repo-config.md) "Deployment Environments" says why.

Both modes need admin on the repository and project access on the token. The project access is needed because the fleet project link is read and written through GraphQL. A token that cannot read projects stops `apply` in its pre-flight with nothing written, naming the scope to grant, and reads as a failing project group under `check`. A token that can read them but not write one reaches the link write itself and fails there.
Both modes need admin on the repository and project access on the token. The project access is needed because the fleet project link is read and written through GraphQL. A token that cannot read projects stops `apply` in its pre-flight with nothing written, naming the scope to grant. Under `check` such a token reads as a failing project group. A token that can read them but not write one reaches the link write itself and fails there.

`apply` is not a narrow toggle. One run patches every key in `repo-config/settings.json`, sets the default branch, and enables both Dependabot features. That run also creates or updates every label in `repo-config/labels.json`. It creates or updates both branch rulesets too, and links the repository to the fleet project `repo-config/project.json` declares. On a repository that has deliberately drifted it silently reasserts the fleet configuration.

Expand Down
2 changes: 1 addition & 1 deletion STANDUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ python3 scripts/host_gate.py --repo "<path-to-target-checkout>" # after sectio

A finding at either point is a **host** misconfiguration to fix on the machine or surface to the maintainer, never something to patch per repo. [`docs/host-setup.md`][host-setup] is the contract it checks.

The scratch commit exercises the whole signing pipeline rather than one delivery path. That is because `ssh-add -L` or `gpg --list-secret-keys` only prove an agent holds a key. They say nothing about a host that signs straight from a key file with no agent running at all. That is a live and correctly configured case [git-commit-conventions][git-commit-conventions] documents in "Signing, verified not configured", the same rules [GOVERNANCE.md "Git and Commit Rules"][governance-git-and-commit-rules] points to. Signing is **SSH or GPG**, so this judges the configured format by its actual result, never by which delivery path produced it. A passing result is `sig=G`, or `sig=U` for a cryptographically good signature from an unrecognized signer. That signer is either a GPG key whose trust is merely undefined or an SSH key missing from the local `allowed_signers` file. A missing `--global` value, `sig` not reading `G` or `U`, or either printed email not matching the noreply address is a **host** misconfiguration to surface to the maintainer ([`docs/host-setup.md`][host-setup] is the setup procedure), not something to patch per repo. Patching it locally hides a broken host that then produces wrong identities in every other repo on that machine.
The scratch commit exercises the whole signing pipeline rather than one delivery path. That is because `ssh-add -L` or `gpg --list-secret-keys` only prove an agent holds a key. They say nothing about a host that signs straight from a key file with no agent running at all. That is a live and correctly configured case [git-commit-conventions][git-commit-conventions] documents in "Signing, verified not configured", the same rules [GOVERNANCE.md "Git and Commit Rules"][governance-git-and-commit-rules] points to. Signing is **SSH or GPG**, so this judges the configured format by its actual result, never by which delivery path produced it. A passing result is `sig=G`, or `sig=U` for a cryptographically good signature from an unrecognized signer. That signer is either a GPG key whose trust is merely undefined or an SSH key missing from the local `allowed_signers` file. A missing `--global` value, `sig` not reading `G` or `U`, or either printed email not matching the noreply address is a **host** misconfiguration. Surface it to the maintainer rather than patching it per repo. Patching it locally hides a broken host that then produces wrong identities in every other repo on that machine. [`docs/host-setup.md`][host-setup] is the setup procedure.

After `git init` and before the first commit, confirm the repo added no override of its own. This one needs a repository, since `--local` fails outside one. Read it here and run it in section 0B. That section places it between the init and the first commit, so nothing here is a prompt to init early:

Expand Down
2 changes: 1 addition & 1 deletion TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ One pull request writing down the agent-to-agent messaging this fleet has now us
- **Settled** - The addressing has a guardrail worth keeping in the write-up. A bare peer name was refused and the transport required the `[ref]` a listing prints. That is what stops a message reaching the wrong repository's agent.
- **Settled** - The method earns its place on evidence rather than novelty. One exchange produced the causal commit for the section 6 ruleset defect, `90e3255`, which the hub session had not identified from the symptom. That exchange also produced a one-line reproduction of the gojq key-sorting behavior that made an earlier fix pass for the wrong reason. The exchange further produced four procedure gaps a reader found that no gate reports.
- **Settled** - A peer's finding is checked rather than adopted. Two of those four did not reproduce at the hub, the `AGENTS.md` anchor rewrite and the settings-diff exposure, and one did and shipped as #653. So the write-up states verification as a step rather than as a courtesy.
- **Settled** - The boundary that matters most is not politeness but permission. A peer cannot widen what the asking session may do, so work blocked in one session goes back to the maintainer rather than sideways to another agent.
- **Settled** - The boundary that matters most is not politeness but permission. A peer cannot widen what the asking session may do. So work blocked in one session goes back to the maintainer rather than sideways to another agent.

### Whether a Removed App Execution Alias Comes Back

Expand Down
4 changes: 2 additions & 2 deletions catalog/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Reusable reference snippets: concrete config artifacts a repo can copy or compar
**reference material, not run here**. This repo ships no build, so the workflow snippets below are not active. Each is the canonical shape the audit (`AUDIT.md`) checks a downstream implementation against.

- `snippets/workflows/`: the reusable build/publish workflow tasks that a code-shipping repo runs (this docs repo keeps only the source-only orchestrator set in `.github/workflows/`). See `snippets/workflows/README.md` for the mapping from each file to the `WORKFLOW.md` guarantees it implements.
- `snippets/configs/`: the config exemplars `vscode-tasks.json` (.NET clean-compile task group) and `vscode-tasks-python.json` (the Python equivalent, running `ruff`/type-check/`pytest`, all `type: process` so no `&&` chaining breaks Windows PowerShell 5.1), plus `dependabot.yml` (multi-ecosystem dual-target reference), `docker-hub-readme.md` (the size-limited Docker Hub overview, distinct from the project `README.md`).
- `snippets/configs/`: the config exemplars `vscode-tasks.json` (.NET clean-compile task group) and `vscode-tasks-python.json`. The latter is the Python equivalent, running `ruff`/type-check/`pytest`, all `type: process` so no `&&` chaining breaks Windows PowerShell 5.1. Also here are `dependabot.yml` (multi-ecosystem dual-target reference) and `docker-hub-readme.md` (the size-limited Docker Hub overview, distinct from the project `README.md`).
- `snippets/devcontainer/`: `.devcontainer` definitions for the .NET and Python toolchains.
- `snippets/vscode/`: the composable `.code-workspace` fragments: `base.jsonc` (standard set) plus `dotnet.jsonc`, `python.jsonc`, `docker.jsonc` per-type additions. See `snippets/vscode/README.md`.
- `snippets/husky/` and `snippets/pre-commit/`: the two local commit-hook shapes, Husky.Net for a repo that already keeps a .NET tool manifest declaring it and the `pre-commit` framework for a repo without one, both carrying any language's checks plus the same shared doc gates (prose/comment-style, line endings) via `snippets/hub_fetch_run.py`. A repo may instead wire an equivalent hook of its own at `.husky/pre-commit`, sourcing nothing and enabled with `core.hooksPath`, which is what this repository's own `.husky/` does. See each directory's own README.md.
- `snippets/husky/` and `snippets/pre-commit/`: the two local commit-hook shapes. Husky.Net is for a repo that already keeps a .NET tool manifest declaring it, and the `pre-commit` framework is for a repo without one. Both carry any language's checks plus the same shared doc gates (prose/comment-style, line endings) via `snippets/hub_fetch_run.py`. A repo may instead wire an equivalent hook of its own at `.husky/pre-commit`, sourcing nothing and enabled with `core.hooksPath`. That is what this repository's own `.husky/` does. See each directory's own README.md.
27 changes: 14 additions & 13 deletions catalog/snippets/husky/README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
# Husky snippet

`pre-commit` is the reference git pre-commit hook (installed under `.husky/` by Husky). It
runs **language formatting/lint and the fleet's shared doc gates**: CSharpier and
`dotnet format` style via `dotnet husky run` for .NET, plus `ruff format --check` / `ruff check` /
the repo's type checker for a Python repo (native tooling, no Docker, the same checks the
`../pre-commit/.pre-commit-config.yaml` snippet runs), plus the diff-scoped prose/comment-style
gate and the whole-tree line-ending check. Copy `../hub_fetch_run.py` alongside `pre-commit` for
the doc gates to run: it fetches those two checks fresh from `ptr727/ProjectTemplate`'s `main`
branch and runs them, rather than vendoring or pinning a copy. A pin nothing keeps current
goes stale by construction, and CI (this repo's own, and the hub's) is the backstop for a
change that lands broken on `main` before it does real damage locally. The prose gate adds one
runs **language formatting/lint and the fleet's shared doc gates**. For .NET it runs CSharpier and
`dotnet format` style via `dotnet husky run`. For a Python repo it runs `ruff format --check` /
`ruff check` / the repo's type checker (native tooling, no Docker, the same checks the
`../pre-commit/.pre-commit-config.yaml` snippet runs). It also runs the diff-scoped
prose/comment-style gate and the whole-tree line-ending check. Copy `../hub_fetch_run.py`
alongside `pre-commit` for the doc gates to run. The script fetches those two checks fresh from
`ptr727/ProjectTemplate`'s `main` branch and runs them, rather than vendoring or pinning a copy.
A pin that nothing keeps current goes stale by construction. CI (this repo's own, and the hub's) is
the backstop for a change that lands broken on `main` before it does real damage locally. The prose gate adds one
`api.github.com` commit lookup to its fetch, with a `git ls-remote` against `github.com`
where that fails. An allow-list permitting only
`raw.githubusercontent.com` gets an unresolved-commit fallback. These are network calls
alongside the Docker pulls the Lint tasks below already do. A fetch failure fails the commit
rather than silently skipping the gate.

This snippet is for a repo that already keeps a .NET tool manifest declaring Husky.Net, since
the hook sources `.husky/_/husky.sh`, a file `dotnet husky install` generates after
This snippet is for a repo that already keeps a .NET tool manifest declaring Husky.Net.
That is because the hook sources `.husky/_/husky.sh`, a file `dotnet husky install` generates after
`dotnet tool restore` restores that manifest. This snippet ships no manifest, so a host .NET
toolchain alone is not enough and a repo without one uses `../pre-commit/` instead. Neither snippet is scoped to a language by
what it runs, and the two shared doc gates are what every repo owes either way.
Expand All @@ -37,7 +37,8 @@ A copied `.husky/pre-commit` is an extensionless shebang script, so pin it to **
editor. The fleet's `[*]` `.editorconfig` default already gives it LF, no path-specific
override needed. A CRLF shebang breaks execution.

Both language blocks run unconditionally, with no tool-presence guard: a repo that keeps a
Both language blocks run unconditionally, with no tool-presence guard.
A repo that keeps a
block declares that tool required, so a missing one fails the commit loudly rather than
skipping the check silently. Drop the `dotnet husky run` block in a repo with no .NET project,
and the Python block in a repo with no Python, rather than leaving either in place to no-op.
and the Python block in a repo with no Python. Do not leave either in place to no-op.
30 changes: 17 additions & 13 deletions catalog/snippets/pre-commit/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Pre-commit snippet

`.pre-commit-config.yaml` is the reference config for the `pre-commit` framework
(pre-commit.com), for a repo that keeps no .NET tool manifest declaring Husky.Net, and for any
repo that prefers it to Husky.Net. The toolchain the repo already keeps is the discriminator,
not the repo's own languages: Husky.Net runs from a .NET tool manifest declaring it, and this
(pre-commit.com), for a repo that keeps no .NET tool manifest declaring Husky.Net.
It is also the reference config for any repo that prefers the framework to Husky.Net. The toolchain the repo
already keeps is the discriminator, not the repo's own languages. Husky.Net runs from a .NET tool manifest declaring it, and this
framework needs none.
In a repo with Python, it runs `ruff format --check` and `ruff check`. It also runs that repo's
declared type checker, `pyright` or `mypy`, matching whichever `python-codestyle` says its CI
Expand All @@ -13,22 +13,23 @@ profile with a `uv.lock` may swap in `uv run <tool>` per entry to pin the projec
version instead. The config also runs the same two shared doc gates the Husky.Net snippet
carries: the diff-scoped prose/comment-style gate and the whole-tree line-ending check. Those two
are what every repo owes regardless of language. The prose gate's `--diff HEAD` sees the staged
state under this runner rather than the working tree, since `pre-commit` sets unstaged changes aside
before it runs a hook, so a partially staged file is judged on its staged edits alone here where
state under this runner rather than the working tree.
This is because `pre-commit` sets unstaged changes aside before it runs a hook.
So a partially staged file is judged on its staged edits alone here, where
the Husky.Net shape judges all of them. That set-aside covers tracked files only. So the gate
reads the paths `pre-commit` passes it rather than scanning `.`, which keeps an untracked file out
of the check. Those are the staged paths, or the conflicted ones while a merge is in progress.
`require_serial` keeps `pre-commit` from running the gate in parallel batches, each of which would
fetch it again. A path named that way is judged even inside a generated tree. So the
hook's `exclude` mirrors the gate's default `generated_trees`, and a repo adding to that list adds
the same names there. The pull request gate reads every line the branch changes against its base. A repo with no Python drops the `ruff-format`,
`ruff-check` and `type-check` hooks and keeps the doc gates, which is what a Docker, config, or
docs repo wires.
`ruff-check` and `type-check` hooks and keeps the doc gates.
That is what a Docker, config, or docs repo wires.

Copy `../hub_fetch_run.py` alongside `.pre-commit-config.yaml` (repo root) for the doc gates
to run: it fetches those two checks fresh from `ptr727/ProjectTemplate`'s `main` branch and
to run. The script fetches those two checks fresh from `ptr727/ProjectTemplate`'s `main` branch and
runs them, rather than vendoring or pinning a copy. A pin that no tool keeps current goes
stale by construction, and CI (this repo's own, and the hub's) is the backstop for a change
stale by construction. CI (this repo's own, and the hub's) is the backstop for a change
that lands broken on `main` before it does real damage locally. The prose gate adds one
`api.github.com` commit lookup to its fetch, with a `git ls-remote` against `github.com`
where that fails. An allow-list permitting only
Expand All @@ -37,16 +38,19 @@ alongside the Docker pulls the VS Code Lint tasks already do. A fetch failure fa
rather than silently skipping the gate.

Install and enable with `uv tool install pre-commit` once, then `pre-commit install`.
`pre-commit` itself is never added as a project dependency: the lint-only profile has no
`pre-commit` itself is never added as a project dependency.
The lint-only profile has no
project environment to add it to, and `uv tool install` gives a persistent command independent
of any project. The hooks use `uvx` to run tools independently of the project.
If `pre-commit install` reports the command not found right after installing it, `uv tool
install`'s own bin directory is not yet on `PATH`: run `uv tool update-shell` and restart or
install`'s own bin directory is not yet on `PATH`.
Run `uv tool update-shell` and restart or
re-source the shell, or add the directory `uv tool dir --bin` prints directly.
Full linting (workflow YAML, Markdown,
spelling, EditorConfig) stays out of the hook: it runs in CI as pinned action wrappers, and on
spelling, EditorConfig) stays out of the hook. It runs in CI as pinned action wrappers, and on
demand via the VS Code **Lint** tasks. A Python repo takes those from
`catalog/snippets/configs/vscode-tasks-python.json` (Docker at `:latest`), and a repo with no
`catalog/snippets/configs/vscode-tasks-python.json` (Docker at `:latest`).
A repo with no
Python takes the Lint group alone rather than that file's Python tasks. Either way they carry
the prose gate in whole-repo mode, for on-demand full-tree validation beyond the diff-scoped
commit-time run. Their `Lint: EOL` task runs the same whole-tree EOL check the hook runs.
Expand Down
Loading
Loading