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
4 changes: 4 additions & 0 deletions .github/labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,10 @@
color: "DCDCD6"
description: "The design spec, its tokens and their build"

- name: "scope/adr"
color: "DCDCD6"
description: "The architecture decision records and their rules"

# ── Release Labels ──────────────────────────────────────────────────────────
- name: "autorelease: pending"
color: "DCDCD6"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pr-title.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
scopes: |
adr
agent
agents
ai
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ These rules apply to every contributor. [`AGENTS.md`](AGENTS.md) sends agents he
- Connect an open tool through its standard interface, such as a git remote, a webhook, a commit status, an OCI image or an S3 API. Write devops-cli code only where no interface of a tool covers the need, and then write one thin adapter that is not specific to one tool. A new integration that is specific to one tool is a major review finding.
- Add only a dependency or a tool that has a good reputation and that its maintainers release and repair now. Its license is Apache-2.0, MIT, BSD or a similar permissive license; an MPL-2.0 license needs a note in the proposal. Do not add a component under AGPL, SSPL, BSL or another strong-copyleft or source-available license. Before you add it, read its license, its last release and its maintenance status on the primary sources of the project.
- Use the simple, usual solution. When you choose between them, use Podman and not Docker, OpenTofu and not Terraform, and Valkey and not Redis.
- **Decide and Report**: Decide an open design question with the best-practice answer or the answer of an open tool. Record the decision and its reason in the issue or in an ADR, and report it after you act. Ask the owner only a question that only the owner can answer: a merge, a secret, a setting, a host, a verdict or a release. Ask it one time, with the options and your recommendation.
- **Decide and Report**: Decide an open design question with the best-practice answer or the answer of an open tool. Record the decision and its reason in the issue or in an ADR ([docs/adr/README.md](docs/adr/README.md) gives the rules of a record), and report it after you act. Ask the owner only a question that only the owner can answer: a merge, a secret, a setting, a host, a verdict or a release. Ask it one time, with the options and your recommendation.
- **Artifacts and Charts**: Each artifact of the project, such as a document page, a dashboard, a report, a chart or a diagram, meets the WCAG 2.2 AA contrast for text, uses a chart palette that a person with color blindness can read, works in the light and the dark theme, and reads on a phone and on a wide screen. A chart has a title and axis labels with units, starts a bar of a quantity at zero, shows the uncertainty or the sample size where it is important, and has no decoration that holds no data. The look follows the Google SRE books (SLOs, error budgets, burn rates, golden signals, toil, capacity and the form of a postmortem). It uses no Google brand color, logo or trademark, no Google Sans or Product Sans, and no artifact looks like a Google product.
- **Line Breaks Belong to Source Files**: Hard-wrap text only in source files and Markdown documents. Write emitted text (terminal messages, Rich renderables, log records, `lang/en/` strings) as continuous paragraphs. Split a long string in the source with implicit string concatenation. A hand-written Markdown document can put each sentence on its own line.
- **Strongly Typed Domain Exceptions**:
Expand Down Expand Up @@ -202,7 +202,7 @@ This table holds the naming rules of the project. Each rule names the check that
| Environment variable | `DEVOPS_CLI_` and the setting's dotted key in upper case, with `_` for `.`. A settings field declares its variable with a `Variable` marker (`src/devops_cli/config/env.py`) and its description with `Field(description=...)`; a credential is one entry of `CREDENTIALS` in the same module | `tests/security/test_config_declarations.py` holds the set of variables and keyring entries. `devops config show`, `devops config env` and `docs/ENV_VARS.md` are generated from the declarations. |
| Metric | `devops_cli_<name>`; a counter ends in `_total` and no other metric does. Each metric is an entry of `INSTRUMENTS` in `src/devops_cli/telemetry/instruments.py`, sent with `emit()` | `tests/telemetry/test_telemetry_instruments.py` checks the `_total` suffix, and fails on a metric that a module writes by name or on an `emit()` of an instrument that `INSTRUMENTS` does not hold. |
| Issue label | `<category>/<value>`: the workflow labels from `src/devops_cli/roadmap/workflow_labels.py`, the `scope/*` labels from `.github/labels.yml` | `devops gh label sync`. |
| Decision record | `docs/adr/<NNNN>-<slug>.md` | None. |
| Decision record | `docs/adr/<NNNN>-<slug>.md`, with the front matter and the limits of [docs/adr/README.md](docs/adr/README.md) | `tests/invariants/test_adr_records.py`. |
| Release tag | `v<major>.<minor>.<patch>` | release-please writes it. Nobody tags by hand. |
| Agent file, worktree and scratch script | Under `.data/agent/`. The worktree of an issue is `.data/agent/worktrees/w-<issue>`. | `.gitignore`. `devops repos worktrees add` makes the worktree, or takes over the staged branch of the issue. |

Expand Down
2 changes: 1 addition & 1 deletion docs/TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Every new test follows these rules. Some of them name a path, fixture or check t
- A new test file sits in the mirror directory of the source module it tests, as `tests/<package path>/test_<module>.py` for `src/devops_cli/<package path>/<module>.py`. This is the one rule for a new test file: it never goes to the top of `tests/`, and no flat file is added. `devops new test <module>` writes the file at that path, and `devops new command <group> <command>` writes the test of a command in `tests/commands/`.
- A package is tested through its public interface, in one file per behaviour, named after the behaviour, such as `tests/roadmap/test_duplicate_candidates.py` *(target)*; not in one file per source module. A test of behaviour that crosses packages goes to the package that owns the behaviour.
- A file is never named after the work that produced it: a review session, an issue, a pull request, a batch or a hardening pass. A regression test joins the file of the behaviour it pins.
- `tests/invariants/` is the only place for test files outside the mirror. It holds the invariant tests, one file per subject: `test_agents_md.py`, `test_architectural_invariants.py`, `test_change_folders.py`, `test_committed_addresses.py`, `test_configmap_rollout_rule.py`, `test_construct_gate_check.py`, `test_devcontainer_config.py`, `test_dry_run_class_ratchet.py`, `test_hermetic_floor.py`, `test_host_path_roots.py`, `test_image_layers.py`, `test_k8s_argocd_apps.py`, `test_k8s_crawl4ai.py`, `test_k8s_manifests.py`, `test_k8s_mcp_server_policies.py`, `test_k8s_searxng.py`, `test_living_specs.py`, `test_mcp_server_image.py`, `test_pull_request_template.py`, `test_roadmap_eval_fixtures.py`, `test_roadmap_stage_measure_doc.py`, `test_roadmap_workflow_doc.py`, `test_runner_hooks.py`, `test_runner_image.py`, `test_service_image.py`, `test_skills.py`, `test_source_tree.py`, `test_suite_refuses_real_programs.py`, `test_swallowed_failures_check.py`, `test_task_prompts_check.py` and `test_workflow_contracts.py`. A new invariant test goes into its subject's file, created if absent, never into a parallel file.
- `tests/invariants/` is the only place for test files outside the mirror. It holds the invariant tests, one file per subject: `test_adr_records.py`, `test_agents_md.py`, `test_architectural_invariants.py`, `test_change_folders.py`, `test_committed_addresses.py`, `test_configmap_rollout_rule.py`, `test_construct_gate_check.py`, `test_devcontainer_config.py`, `test_dry_run_class_ratchet.py`, `test_hermetic_floor.py`, `test_host_path_roots.py`, `test_image_layers.py`, `test_k8s_argocd_apps.py`, `test_k8s_crawl4ai.py`, `test_k8s_manifests.py`, `test_k8s_mcp_server_policies.py`, `test_k8s_searxng.py`, `test_living_specs.py`, `test_mcp_server_image.py`, `test_pull_request_template.py`, `test_roadmap_eval_fixtures.py`, `test_roadmap_stage_measure_doc.py`, `test_roadmap_workflow_doc.py`, `test_runner_hooks.py`, `test_runner_image.py`, `test_service_image.py`, `test_skills.py`, `test_source_tree.py`, `test_suite_refuses_real_programs.py`, `test_swallowed_failures_check.py`, `test_task_prompts_check.py` and `test_workflow_contracts.py`. A new invariant test goes into its subject's file, created if absent, never into a parallel file.
- `tests/support/` holds what tests share, and no test module or conftest lives in it, which the registration enforces: the fakes in `fakes/<edge>.py`, the builders in `builders.py`, and shared fixtures. Every submodule and subpackage under it is registered as a plugin, so a fixture added there needs no conftest edit: the root conftest's one `pytest_plugins` entry names `tests.support.bootstrap`, which isolates HOME and then registers the rest, so a support module that imports devops-cli binds its paths under the isolated HOME. The root conftest marks `tests.support` for assertion rewriting first and imports it only inside functions, and `PytestAssertRewriteWarning` is an error, so a support module imported too early fails the run. A support module defines no `pytest_*` name that is not a hook, and defines each fixture it registers with `pytest.fixture` rather than importing another module's or handing one out by a module-level `__getattr__`: the registration fails a run whose support module holds a fixture or hook its source does not show. An invariant holds the top level and the class bodies of every helper module under `tests/` to docstrings, imports at the top level, defs, classes, assignments to names alone and `if TYPE_CHECKING:` blocks with no `else`; the values bound to names, decorators, default arguments, base classes and metaclasses still run on import unchecked. A module imports from a support module with `from tests.support[.x] import ...`, and no module but `bootstrap` holds `tests.support` or a package under it, which another invariant enforces, so none reads a support module it does not import.
- A test finds the repository root and its test data through `tests.support.paths`: `REPO_ROOT`, `TESTS_ROOT`, `FIXTURES` (`tests/fixtures/`) and `GOLDEN` (`tests/golden/`). It never builds a path from its own `__file__`, so it reads the same paths at any depth.
- A test file imports what it shares from `tests/support/`, never from another test file or from a conftest. One check over every Python file under `tests/` but `tests/fixtures/` fails the full gate on a module that reads `__file__` outside `tests/support/` or imports a test module or a conftest, naming each as `path:line`: an imported module under `tests`, or a top-level one, is a test module when pytest collects its file by the `python_files` patterns; `from X import n` imports the module `X.n` when `X` is a package or `X/n.py` exists; and a relative import is resolved against the importing module's package, one past the top-level package being reported too. It runs as part of the `test-tree` row of `devops ci` (`tests/gate/tree_checks/module_independence.py`), which parses each file once.
Expand Down
20 changes: 16 additions & 4 deletions docs/adr/0001-github-is-the-roadmap-source.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# GitHub is the roadmap's source of truth

Amended on 2026-10-28 by [ADR 0016](0016-labels-hold-the-roadmap-items-fields.md). Labels and milestones hold an Item's Status, Priority, Value and Effort, and no roadmap job reads or writes the project board. An Item is an issue with a `priority/*` label, and the issue body holds its job record.
---
status: accepted
date: 2026-10-01
decision-makers: [owner]
amended-by: ["0012", "0016"]
body-hash: 31269ae64e3feaa0b0fba33edddfcaaaf7feec6c63a6acbbbab4dd82092a5ccf
---

Amended on 2026-10-22 by [ADR 0012](0012-releases-are-derived-by-release-please-from-trunk-and-milestones-are-planning-buckets.md). A milestone is a planning bucket, not a release. The roadmap command renders `docs/ROADMAP.md` from GitHub, and no release writes it. The change takes effect after v0.2.39, in the order of the Cutover section of ADR 0012.
# GitHub is the roadmap's source of truth

The roadmap used to live in a hand-edited `docs/ROADMAP.md` that was synced out to GitHub issues, milestones and the project board. We reversed that: issues are the items, milestones are the releases, and board fields hold status and priority, while `docs/ROADMAP.md` is generated from them as a read-only view. The roadmap has to work for any GitHub repository devops-cli manages, not only one that keeps a markdown file in this repo's grammar. Automated intake and reprioritization would also turn every change into a commit and a pull request to review, adding to the review load this work is meant to reduce.

Expand All @@ -15,3 +19,11 @@ The roadmap used to live in a hand-edited `docs/ROADMAP.md` that was synced out

- `devops gh issue sync-roadmap` and `reconcile-roadmap` are removed rather than kept alongside the new flow, per the pre-1.0 policy.
- Task files stop carrying status, milestone and priority, because GitHub owns those.

## Status History

Amended on 2026-10-28 by [ADR 0016](0016-labels-hold-the-roadmap-items-fields.md). Labels and milestones hold an Item's Status, Priority, Value and Effort, and no roadmap job reads or writes the project board. An Item is an issue with a `priority/*` label, and the issue body holds its job record.

Amended on 2026-10-22 by [ADR 0012](0012-releases-are-derived-by-release-please-from-trunk-and-milestones-are-planning-buckets.md). A milestone is a planning bucket, not a release. The roadmap command renders `docs/ROADMAP.md` from GitHub, and no release writes it. The change takes effect after v0.2.39, in the order of the Cutover section of ADR 0012.

2026-11-12: Fact out of date: labels hold the Item fields, not board fields; a milestone is not a release; no command renders `docs/ROADMAP.md` (#1952).
19 changes: 15 additions & 4 deletions docs/adr/0002-roadmap-jobs-act-as-a-machine-account.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
# Roadmap jobs act as a machine account with a classic token

[ADR 0015](0015-roadmap-jobs-act-as-a-github-app-on-the-personal-account.md) supersedes this ADR.
---
status: superseded
date: 2026-10-01
decision-makers: [owner]
superseded-by: ["0015"]
amended-by: ["0016"]
body-hash: 4560986068f0966b2e9a9678dd62b2f8ed8b7e06b2368b4bcbb02accd02b295f
---

Amended on 2026-10-28 by [ADR 0016](0016-labels-hold-the-roadmap-items-fields.md). No roadmap job reads or writes a project board, so the jobs need no access to a board and no `project` scope. A job tells a person's change from its own by its job record, which is a hidden block of the issue body. Labels hold the fields, and the issue events keep the history of each label change.
# Roadmap jobs act as a machine account with a classic token

The roadmap jobs change issues and the board with no person present, and reprioritization has to tell a person's change from its own so it never reverts one. They act as a dedicated machine account (GitHub's terms allow one free machine account per person) that holds a classic personal access token with the `project` and `repo` scopes and is invited as a Write collaborator on each managed repository and its board. A GitHub App or a fine-grained token would be the usual choice, but neither can reach a board owned by a personal account; only a classic token can.

Expand All @@ -14,3 +19,9 @@ The roadmap jobs change issues and the board with no person present, and reprior
## Consequences

- GitHub keeps no history of board field changes except Status, so before overwriting a field a job compares it with the value it last set, and leaves it alone if a person changed it since.

## Status History

[ADR 0015](0015-roadmap-jobs-act-as-a-github-app-on-the-personal-account.md) supersedes this ADR.

Amended on 2026-10-28 by [ADR 0016](0016-labels-hold-the-roadmap-items-fields.md). No roadmap job reads or writes a project board, so the jobs need no access to a board and no `project` scope. A job tells a person's change from its own by its job record, which is a hidden block of the issue body. Labels hold the fields, and the issue events keep the history of each label change.
25 changes: 19 additions & 6 deletions docs/adr/0003-polling-is-how-the-roadmap-sees-changes.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# Polling is how the roadmap sees changes; webhooks only cut latency

Amended on 2026-11-11 by [ADR 0021](0021-the-roadmap-service-is-a-webhook-router-cluster-pods-run-the-roadmap-jobs-and-valkey-holds-their-shared-state.md). The poll becomes the sweep, a cluster schedule every 5 minutes, and the row intervals round up to 5-minute ticks. A short row asks GitHub to redeliver each failed delivery, and the sweep stays the source of truth. No lane stays.

The webhook clause is superseded on 2026-10-29 by [ADR 0017](0017-each-subscribed-webhook-event-runs-the-update-scoped-to-it.md): each subscribed webhook event runs the update scoped to it at once, and the poll reconciles.
---
status: superseded
date: 2026-10-01
decision-makers: [owner]
superseded-by: ["0017", "0021"]
amended-by: ["0016"]
body-hash: 09a8bb152ef54c3b78bb1603c0403513e7349bfae3071ed60336e85bee896982
---

Amended on 2026-10-28 by [ADR 0016](0016-labels-hold-the-roadmap-items-fields.md). Labels hold Status, Priority, Value and Effort, so a change of a field is a `labeled` or `unlabeled` issue event. The poll reads those events, and the repository webhook sends them. No roadmap job reads a board.
# Polling is how the roadmap sees changes; webhooks only cut latency

The service finds changes by polling GitHub on a short tick, using conditional requests so an unchanged answer costs nothing, and treats a repository webhook only as a hint that makes a job due sooner. GitHub sends no webhook when a board owned by a personal account changes, so edits to status, priority, Value and Effort can only be found by polling, and GitHub never retries a failed delivery. Polling is needed anyway, and making it the source of truth means a missed webhook only delays a job until the next tick.

Expand All @@ -18,3 +21,13 @@ The service finds changes by polling GitHub on a short tick, using conditional r
- The webhook endpoint is exposed through the existing Cloudflare Tunnel on a single path; every other route of the service stays private.
- Removing the poll "because we have webhooks" would silently stop board changes from triggering anything.
- Every poll and every webhook goes to both of a repository's lanes, the release lane (close, reprioritize, metrics) and the model lane (intake, refine) (#1532). Each lane judges only its own rows against the shared `schedule.json`, so a release-lane round never waits for a model-bound one, and the shared round pause holds both.

## Status History

Amended on 2026-11-11 by [ADR 0021](0021-the-roadmap-service-is-a-webhook-router-cluster-pods-run-the-roadmap-jobs-and-valkey-holds-their-shared-state.md). The poll becomes the sweep, a cluster schedule every 5 minutes, and the row intervals round up to 5-minute ticks. A short row asks GitHub to redeliver each failed delivery, and the sweep stays the source of truth. No lane stays.

The webhook clause is superseded on 2026-10-29 by [ADR 0017](0017-each-subscribed-webhook-event-runs-the-update-scoped-to-it.md): each subscribed webhook event runs the update scoped to it at once, and the poll reconciles.

Amended on 2026-10-28 by [ADR 0016](0016-labels-hold-the-roadmap-items-fields.md). Labels hold Status, Priority, Value and Effort, so a change of a field is a `labeled` or `unlabeled` issue event. The poll reads those events, and the repository webhook sends them. No roadmap job reads a board.

2026-11-12: Superseded by [ADR 0017](0017-each-subscribed-webhook-event-runs-the-update-scoped-to-it.md) and [ADR 0021](0021-the-roadmap-service-is-a-webhook-router-cluster-pods-run-the-roadmap-jobs-and-valkey-holds-their-shared-state.md).
Loading