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
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Agent enablement for a fleet of repositories: autonomy and repeatable quality in

## Build and Distribution <!-- omit from toc -->

- **Source Code**: [GitHub][github-link] for source, issues, discussions, and CI/CD pipelines.
- **Source Code**: [GitHub][github-link] for source, issues, and CI/CD pipelines.
- **Versioned Releases**: [GitHub Releases][releases-link] for version-tagged source archives.

### Build Status <!-- omit from toc -->
Expand Down Expand Up @@ -292,7 +292,7 @@ A human-readable index of the rules agents enforce, implement, and audit. The au

## Questions or Issues

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.
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. An open question that is not yet a defect is filed there too. This repository is public for reference rather than for outside participation. So its registry entry takes the `collaborators` policy that [`repo-config/README.md` "Public Interaction"][repo-config-public-interaction] describes. Under it only collaborators can open or comment on an issue or a pull request. It has no channel for anyone else to raise one. Anyone can still read the issues and fork the repository. 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].

Expand Down Expand Up @@ -347,7 +347,6 @@ Licensed under the [MIT License][license]\

[actions-link]: https://github.com/ptr727/ProjectTemplate/actions
[commits-link]: https://github.com/ptr727/ProjectTemplate/commits
[discussions-link]: https://github.com/ptr727/ProjectTemplate/discussions
[github-link]: https://github.com/ptr727/ProjectTemplate
[issues-link]: https://github.com/ptr727/ProjectTemplate/issues
[releases-link]: https://github.com/ptr727/ProjectTemplate/releases
Expand Down Expand Up @@ -391,6 +390,7 @@ Licensed under the [MIT License][license]\
[readme-structure]: ./spec/readme-structure.md
[repo-config]: ./repo-config/
[repo-config-doc]: ./docs/repo-config.md
[repo-config-public-interaction]: ./repo-config/README.md#public-interaction
[reports]: ./reports/
[repos]: ./registry/repos.json
[resync]: ./RESYNC.md
Expand Down
7 changes: 4 additions & 3 deletions docs/repo-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The hub holds all fleet-wide repository configuration:
- `configure.sh` applies or checks those payloads through the GitHub API.
- `central/` holds the READMEs `scripts/central_config.py` writes into the central bot-settings repositories, per "Central Bot Settings" below.

Downstream repositories carry no `repo-config/` directory. The registry's `workflowModel` selects the `develop` payload, and its `environments` declares the deployment environments the check mode asserts. Both are read from `registry/repos.json` rather than from a payload here. A `check` before registry enrollment passes the model explicitly, and `apply` refuses a repository with no registry entry.
Downstream repositories carry no `repo-config/` directory. The registry's `workflowModel` selects the `develop` payload, and its `environments` declares the deployment environments the check mode asserts. Its `publicInteraction` selects a public repository's interaction limit and whether Discussions stay on. All three are read from `registry/repos.json` rather than from a payload here. A `check` before registry enrollment passes the model explicitly, and `apply` refuses a repository with no registry entry.

The carried `AUDIT.md` reaches the hub at `main` for its configuration check, or at `develop` for an entry not yet promoted. The fleet-wide `spec/audit.py` reads the same hub payloads directly. Both paths compare live state against one source.

Expand All @@ -29,13 +29,13 @@ Downstream repositories carry no copy of `spec/secrets.json`. `baseline` applies

**Configure by importing the JSON payloads, never by hand-building the rules** (hand reconstruction has gone wrong on past setups). The result must be **exactly two rulesets named `develop` and `main`**, and the names are load-bearing (`AGENTS.md` and the workflows reference them). Only the `develop` *content* varies by model.

Run `configure.sh apply` from a hub checkout at `main`, naming the target repository and its model. `apply` refuses, writing nothing, a repository with no entry in the registry it reads. Without the entry, the rulesets and policy files would come from the default policy. Once `apply` has created both rulesets, remove all classic branch-protection rules and stray rulesets. Removed first, they would leave the branches unprotected wherever `apply` then refuses. A repository whose entry has merged to `develop` but not yet been promoted is configured and checked from a hub checkout at `develop`. Every other repository's run stays on `main`. Both modes need project access on the token as well as admin on the repository, since the 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. The script applies `settings.json`, the Dependabot security features, the label set, both rulesets, the link to the fleet project, and the repository's secrets from `~/.secrets/`. The link is written only where it is absent. The declared project title is compared with the live one first. The comparison exists because a project number is reusable and the same declared number is applied to every fleet repository. A registered repository can omit the model and use the registry lookup. The model is passed as:
Run `configure.sh apply` from a hub checkout at `main`, naming the target repository and its model. `apply` refuses, writing nothing, a repository with no entry in the registry it reads. Without the entry, the rulesets and policy files would come from the default policy. Once `apply` has created both rulesets, remove all classic branch-protection rules and stray rulesets. Removed first, they would leave the branches unprotected wherever `apply` then refuses. A repository whose entry has merged to `develop` but not yet been promoted is configured and checked from a hub checkout at `develop`. Every other repository's run stays on `main`. Both modes need project access on the token as well as admin on the repository, since the 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. The script applies `settings.json` and, on a public repository, the interaction limit. It also applies the Dependabot security features, the label set, both rulesets, the link to the fleet project, and the repository's secrets from `~/.secrets/`. The link is written only where it is absent. The declared project title is compared with the live one first. The comparison exists because a project number is reusable and the same declared number is applied to every fleet repository. A registered repository can omit the model and use the registry lookup. The model is passed as:

```sh
repo-config/configure.sh apply owner/repo release|operational
```

Then validate the result with `repo-config/configure.sh check owner/repo release|operational`, run from the same checkout. The command asserts every applied ruleset, setting, label, security feature, and the fleet project link, plus the deployment environments described below. It exits non-zero on drift (the settings checks are driven by the committed payloads, and the ruleset checks by the payloads composed for the repo). Or import each ruleset by hand from the payloads `configure.sh` composes for the repo. Write them with `uv run --no-project --script scripts/agent_policy.py rulesets --registry registry/repos.json --name <repo> --model <release|operational> --out-dir <dir>`. Then run `gh api -X POST repos/<owner>/<repo>/rulesets --input <dir>/<name>.json` for each of `develop` and `main`. `gh ruleset` is read-only, so creation goes through `gh api`. [`repo-config/README.md` "Rulesets"][repo-config-readme-rulesets] says what the composition changes. The required check binds by name and only turns green after the repo's PR workflow runs once. To edit a live ruleset, GET it, change the field, and PUT the whole writable subset back (a partial PUT `422`s).
Then validate the result with `repo-config/configure.sh check owner/repo release|operational`, run from the same checkout. The command asserts every applied ruleset, setting, interaction limit, label, security feature, and the fleet project link, plus the deployment environments described below. An interaction limit with fewer than 30 days left is a warning rather than drift, and a fresh `apply` renews it, per [`repo-config/README.md` "Public Interaction"][repo-config-readme-public-interaction]. It exits non-zero on drift (the settings checks are driven by the committed payloads, and the ruleset checks by the payloads composed for the repo). Or import each ruleset by hand from the payloads `configure.sh` composes for the repo. Write them with `uv run --no-project --script scripts/agent_policy.py rulesets --registry registry/repos.json --name <repo> --model <release|operational> --out-dir <dir>`. Then run `gh api -X POST repos/<owner>/<repo>/rulesets --input <dir>/<name>.json` for each of `develop` and `main`. `gh ruleset` is read-only, so creation goes through `gh api`. [`repo-config/README.md` "Rulesets"][repo-config-readme-rulesets] says what the composition changes. The required check binds by name and only turns green after the repo's PR workflow runs once. To edit a live ruleset, GET it, change the field, and PUT the whole writable subset back (a partial PUT `422`s).

## Central Bot Settings

Expand Down Expand Up @@ -105,4 +105,5 @@ done

[governance-git-and-commit-rules]: ../GOVERNANCE.md#git-and-commit-rules
[repo-config-readme-provisioning]: ../repo-config/README.md#provisioning-from-secrets
[repo-config-readme-public-interaction]: ../repo-config/README.md#public-interaction
[repo-config-readme-rulesets]: ../repo-config/README.md#rulesets
2 changes: 2 additions & 0 deletions registry/repos.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@
"requiredSecrets": ["DOCKER_HUB_USERNAME", "DOCKER_HUB_ACCESS_TOKEN", "CODECOV_TOKEN"],
"consumerModel": "pull",
"releaseTrigger": "two-phase",
"publicInteraction": "community",
"pythonDirectories": ["RegressionTests"],
"agentPolicy": {
"review": {
Expand Down Expand Up @@ -198,6 +199,7 @@
"requiredSecrets": ["DOCKER_HUB_USERNAME", "DOCKER_HUB_ACCESS_TOKEN", "CODECOV_TOKEN"],
"consumerModel": "pull",
"releaseTrigger": "two-phase",
"publicInteraction": "community",
"driftNotes": ["Docker image wrapping upstream Nx products. C# (CreateMatrix) is the codegen generator, not a shipped package (IsPackable=false, no nuget push).", "Release is the two-phase model (weekly schedule + workflow_dispatch publish, not ordinary merges) plus an extra Make/Matrix.json path-scoped push that republishes when the codegen version pin bumps.", "Docker Hub README published per-image via a Matrix.json-derived matrix.", "Branch hygiene: 3 stale Dependabot nuget branches (PRs closed/superseded) linger, safe to delete, and main+develop are otherwise clean after the 2026-07 sweep."]
},
{
Expand Down
4 changes: 4 additions & 0 deletions registry/repos.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,10 @@
},
"consumerModel": { "enum": ["push", "pull"] },
"releaseTrigger": { "$ref": "#/$defs/releaseTrigger" },
"publicInteraction": {
"enum": ["collaborators", "community"],
"$comment": "Who may interact with the repository while it is public. Absent means collaborators, so a repository made public starts locked down rather than open. collaborators is a repository public for reference only: repo-config/configure.sh apply sets GitHub's collaborators_only interaction limit and turns Discussions off. community is a product with a user community: apply sets the existing_users limit, which blocks only accounts younger than 24 hours, and keeps Discussions on. The field has no effect on a private repository, whose visibility configure.sh reads live. A limit expires after six months at most, so configure.sh check warns before it lapses and a fresh apply renews it. spec/validate.py checks the value."
},
"driftNotes": {
"type": "array",
"items": {
Expand Down
Loading
Loading