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
39 changes: 10 additions & 29 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
## Description
<!-- Provide a concise description of the changes introduced by this pull request and the underlying motivation or problem being resolved. -->
## Summary
<!-- What this pull request changes, and why. -->

---

## Type of Change
<!-- Mark the relevant option with an 'x'. -->
<!-- Mark the one that applies with an 'x'. -->
- [ ] `feat`: New feature or capability
- [ ] `fix`: Bug fix or defect remediation
- [ ] `refactor`: Code reorganization with zero functional behavior change
Expand All @@ -14,33 +14,14 @@

---

## Target Base Branch
<!-- In accordance with AGENTS.md, all feature, fix, refactoring, and docs PRs must target the active release branch. -->
- Base branch targeting: `release/v<version>` (not `main`)
## Base Branch
<!-- Every pull request except the release pull request targets the active release branch. -->
- `release/v<version>` (not `main`)

---

## Enterprise SDLC Quality Gate Checklist
<!-- Every PR must satisfy the following quality gates prior to maintainer review. -->
- [ ] **Test-First Implementation (TDD)**: Comprehensive unit and integration tests authored before implementation code.
- [ ] **Full CI Quality Gate**: `devops ci` (or `uv run devops ci`) executed locally with 10/10 green quality gates.
- [ ] **Strict Code Coverage**: Maintained strict $\ge 90\%$ code coverage requirement across `src/`.
- [ ] **Architectural Invariants Gate**:
- [ ] Cyclomatic complexity $\le 10$ project-wide across all functions and closures (`devops scan complexity`).
- [ ] Maximum nesting depth $\le 5$ (< 6 indentation levels) across all code blocks (`test_no_excessive_nesting_in_src`).
- [ ] Standardized domain exceptions inheriting from `DevOpsCLIError` with zero bare `ValueError`/`RuntimeError`.
- [ ] Pytest collection hygiene enforced (`__test__ = False` on dummy/mock models).
- [ ] **Zero-Trust Security & Egress Safety**:
- [ ] Zero plaintext secrets, API keys, or credentials stored in code, configurations, or commit history.
- [ ] No information leaked or extracted from private or `.gitignored` paths (`.env*`, `.ssh/`, `.data/`).
- [ ] SSRF mitigation and bounded subprocess timeouts strictly enforced.
- [ ] **Canonical Location Formatting**: All CLI outputs, Rich tables, reports, and review findings formatted as `filename.ext:n-n`.
- [ ] **Documentation Synchronization**: CLI options, markdown guides, and README synchronized via `devops docs generate --sync-readme`.
- [ ] **Conventional Commit Messages**: Commit history adheres strictly to Conventional Commits format (`feat(scope): ...`, `fix(scope): ...`).
## Item
<!-- Name the one issue this pull request delivers and the task file it adds or changes. `devops pr check-readiness` blocks a pull request whose body closes no issue or several, or that does not change that issue's task file. -->
Closes #<issue>

---

## Related Issues / Milestones
<!-- Link any related issues or milestones below (e.g. Closes #123, Refs Milestone v0.2.14). -->
- Related Milestone:
- Related Issues:
Task file: `docs/agent/tasks/task-<issue>-<slug>.md`
8 changes: 4 additions & 4 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ This document provides foundational context, architectural principles, and opera
- **Author All Code, Documentation, Status & Wording as Merged/Committed (Zero Administrative Tracking PRs)**:
- The status and wording of all code, documentation, checklists, deliverable descriptions, and task tracking files (`docs/agent/tasks/`) **MUST BE AUTHORED FROM THE OUTSET EXACTLY AS THEY WILL AND SHOULD READ ONCE COMMITTED AND MERGED**.
- **Strict Prohibition of Standalone Tracking Commits & Follow-Up Status PRs**: AI agents, automated workflows, and developers **MUST NEVER CREATE UNNECESSARY TASK TRACKING COMMITS OR PULL REQUESTS** solely to flip, update, or reconcile task statuses (e.g. changing `In Progress` / `In Review` to `Merged` or `Done`) after a PR has merged. Such PRs are completely pointless administrative clutter.
- All deliverable checkboxes must already be marked complete (`- [x]`), verification results recorded, and the deliverable described in its final completed state within the functional deliverable PR itself. Once the PR merges, the task file and codebase require zero post-merge administrative commits or follow-up pull requests.
- The deliverable is described in its final completed state within the functional deliverable PR itself. A box is ticked (`- [x]`) only for work that is done. Work that was not done is a plain bullet naming its follow-up issue, and a check only a person can run is a plain bullet starting `Pending a person:` followed by the exact commands. Verification is the PR's passing checks, which `devops pr check-readiness` reads; typed pass counts and coverage figures are not required. Once the PR merges, the task file and codebase require zero post-merge administrative commits or follow-up pull requests.
- **Strict Prohibition of Inconsistent N-Gate Numbering & Unified `Gated` Terminology**:
- Arbitrary, brittle, or hardcoded gate numbering (e.g. `7-Gate`, `10-Gate`, `7-gate`, `10-gate`) across code, test assertions, docstrings, CLI help strings, diagrams, and documentation is **strictly prohibited**.
- Numbering quality gates is brittle and inconsistent as verification suites evolve. AI agents, reviewers, and developers must always use the unified `Gated` terminology (e.g. `Gated CI Quality Gate`, `Gated CI validation suite`, `Gated quality check`).
Expand Down Expand Up @@ -172,17 +172,17 @@ All work follows a test-first progressive verification strategy to optimize deve
- If no issue exists: **IMMEDIATELY AUTHOR A FORMAL TRACKING ISSUE** (`devops gh issues create` or FastMCP `gh_issue_create`), assign the active release milestone (`--milestone "v<version>"`), assign declarative taxonomy labels matching `.github/labels.yml` (`type/*`, `scope/*`, `priority/*`, `status/in-progress`), and synchronize it to the project board (`devops gh project sync` or FastMCP `gh_project_sync`).
- **Modular Per-Task Tracking Architecture (`docs/agent/tasks/`) & Real-Time Card Movement**:
- **Zero Merge Conflicts Mandate & Full Decommissioning of Monolithic Index**: To eliminate git merge conflicts between concurrent feature branches, task tracking is maintained **exclusively in dedicated, isolated per-task files** under `docs/agent/tasks/` (`docs/agent/tasks/task-<issue>-<slug>.md`). The monolithic `docs/agent/task.md` index file is **completely decommissioned and retired**. Centralized task visualization and sprint management are handled natively via GitHub Projects v2 (`https://github.com/dan-petty/devops-cli/projects`) and GitHub Issues views (`https://github.com/dan-petty/devops-cli/issues/views`).
- **Topic Branch Task Isolation**: Topic branches (`feat/*`, `fix/*`, `refactor/*`, `chore/*`) must **ONLY create or modify their own dedicated task file** (`docs/agent/tasks/task-<issue>-<slug>.md`). Editing or modifying other branches' task files, or re-introducing a centralized index file, is strictly prohibited.
- **Topic Branch Task Isolation**: Topic branches (`feat/*`, `fix/*`, `refactor/*`, `chore/*`) must **ONLY create or modify their own dedicated task file** (`docs/agent/tasks/task-<issue>-<slug>.md`). Editing or modifying other branches' task files, or re-introducing a centralized index file, is strictly prohibited. The one exception: a PR that changes a rule every task file follows brings the existing task files into line in that same PR.
- **Commit Context Mandate, Zero Standalone Tracking Commits & Zero Post-Merge Status PRs**:
- Updates to task tracking files under `docs/agent/tasks/` MUST ONLY be made in the context of the functional changes delivering that specific task (bundled atomically into functional deliverable commits). They must NEVER be committed as standalone or isolated one-off commits.
- **Strict Prohibition of Post-Merge Status PRs**: AI agents, automated workflows, and developers MUST NEVER open separate pull requests or author follow-up commits solely to update task statuses post-merge. All task documentation must be authored as merged/committed from the outset.
- **Issue-Only Linking (No Pull Request or Review State in Task Files)**: A task file links its GitHub issue (`**Issue**: [#<issue>](https://github.com/dan-petty/devops-cli/issues/<issue>)`) and nothing else. The issue links the pull request that closes it through the PR body's closing keyword (`Closes #<issue>`), and GitHub shows that pull request on the issue. Task files MUST NEVER carry a `**PR**` field or an `In Review` status. The pull request number is unknown until the PR exists, so recording it takes a second commit, which re-runs every check and is itself a prohibited standalone tracking commit. Allowed statuses are `Backlog`, `Ready`, `In Progress` and `Done`, enforced by `tests/test_agent_task_files.py`.
- **Issue-Only Linking (No Pull Request or Review State in Task Files)**: A task file links its GitHub issue (`**Issue**: [#<issue>](https://github.com/dan-petty/devops-cli/issues/<issue>)`) and nothing else. The issue links the pull request that closes it through the PR body's closing keyword (`Closes #<issue>`), and GitHub shows that pull request on the issue. Task files MUST NEVER carry a `**PR**` field or an `In Review` status. The pull request number is unknown until the PR exists, so recording it takes a second commit, which re-runs every check and is itself a prohibited standalone tracking commit. Allowed statuses are `Backlog`, `Ready`, `In Progress` and `Done`, enforced by `tests/test_agent_task_files.py`. `devops pr check-readiness` blocks every PR except the release PR (`release/vX.Y.Z` into the default branch) unless its body closes exactly one issue and it adds, modifies or renames that issue's task file.
- Maintain synchronization between `docs/agent/tasks/` and GitHub Projects v2 cards across these lifecycle states. `In Review` exists only on the card, derived from GitHub (`plan_item_changes`), never in a task file:
- **Backlog**: Queued deliverables, backlog requirements, and upcoming milestone items awaiting assignment.
- **Ready**: Scoped items with concrete acceptance criteria and tests designed, awaiting active development.
- **In Progress (WIP)**: Active work items currently being authored or edited. **Card must be moved to In Progress before modifying code in `src/`**. If an early pull request is opened to pair or satisfy remote branch tracking, it MUST be opened as a **Draft Pull Request** (`--draft`).
- **In Review & Merged (Authored as Merged/Committed)**: Pull Request opened and marked ready for review (or converted from draft via `devops pr ready`), with automated review, CI checks running, and peer feedback in progress.
- **Mandatory Author-as-Merged Rule**: Within the PR branch itself, all deliverable checkboxes in `docs/agent/tasks/task-<issue>-<slug>.md` must already be checked off (`- [x]`), verification results recorded, the deliverable described in its final completed state, and the status set to `**Status**: Done`, all in the commit that delivers the work. Once the PR merges, the issue is closed and project cards transition to Done, requiring zero post-merge administrative commits or follow-up pull requests.
- **Mandatory Author-as-Merged Rule**: Within the PR branch itself, `docs/agent/tasks/task-<issue>-<slug>.md` describes the deliverable in its final completed state with the status set to `**Status**: Done`, all in the commit that delivers the work. A box is ticked (`- [x]`) only for work that is done; unfinished work and checks only a person can run are plain bullets, and `tests/test_agent_task_files.py` fails on any `- [ ]` outside a code fence. Verification is the PR's passing checks, which readiness reads; typed pass counts and coverage figures are not required. Once the PR merges, the issue is closed and project cards transition to Done, requiring zero post-merge administrative commits or follow-up pull requests.
- **Mandatory Custom Field Reconciliation (`devops gh project sync`)**:
- Ground all task lifecycles, issue tracking, and sprint planning in GitHub Projects v2 (`.github/project-template.json`) and roadmap milestones (`docs/ROADMAP.md`).
- Every project item MUST be enriched with all 6 standardized custom fields: `Status`, `Milestone`, `Priority`, `Category`, `Value`, and `Effort`.
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- **One Roadmap Store for Releases, Items and Board Fields (`devops_cli.roadmap`)**:
- `RoadmapStore` reads and writes Releases, Items, Candidates, board fields and issue-event changes behind one interface, with a GitHub adapter over `gh` and an in-memory adapter for tests. Reads page through every result and raise rather than return an empty or partial result. Each Item write also records the value the store set in the board's `Job record` field (ADR 0002), so a later job can tell a person's change from its own (#768).
- **Readiness Requires a PR to Close One Issue and Change Its Task File (`devops pr check-readiness`)**:
- Every PR except the release PR (`release/vX.Y.Z` from the same repository into the default branch) is blocked unless its body closes exactly one issue, read as `devops gh issues close-merged` reads it, and it adds, modifies or renames that issue's `docs/agent/tasks/task-<issue>-*.md`. Each missing piece is one blocker that names it. A repository whose base has no `docs/agent/tasks/` is not checked (#704).
- The changed files come from `pulls/{n}/files?per_page=100`, paged to the end. Where the check applies, a failed read is a blocker that names the failure; elsewhere it is a warning. The read replaces `gh pr diff --name-only`, which returned an empty list on any failure (#704).

### Changed
- **`devops gh milestones edit` and `close` Take a Version (`devops gh milestones`)**:
- Both take a version, with or without the leading `v`, and no longer a milestone number. The milestone commands and the milestone close after `devops release tag --push` run on the roadmap store (#768).
- **A Task File Ticks a Box Only for Work That Is Done (`docs/agent/tasks/`, `AGENTS.md`)**:
- `tests/test_agent_task_files.py` fails on an unchecked box outside a code fence. Work not done is a plain bullet naming its follow-up issue, and a check only a person can run is a plain bullet starting "Pending a person:". The 17 task files that held unchecked boxes are brought into line, and `AGENTS.md` no longer asks for typed verification results: the PR's passing checks are the verification (#704).
- **The PR Template and the Release PR Body Ask Only What No Check Decides (`.github/pull_request_template.md`, `devops release`)**:
- The template asks for a summary, the type of change, the base branch, `Closes #<issue>` and the task file. Its 15-box quality-gate checklist is gone, and so is the example closing reference in a comment, which read as closing that issue in any body that kept it (#704).
- The release PR body no longer carries the seven quality boxes it ticked on every ready release PR without reading anything (#704).

### Fixed
- **Editing a Milestone No Longer Closes It (`devops gh milestones edit`)**:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ The comprehensive Value vs. Effort Prioritization Matrix, phased milestone deliv
| | `devops pr ready [OPTIONS] <number>` | Mark a draft pull request as ready for review. |
| | `devops pr diff [OPTIONS] <number>` | View diff of a pull request. |
| | `devops pr close [OPTIONS] <number>` | Close a pull request. |
| | `devops pr check-readiness [OPTIONS] <number>` | Validate PR merge readiness: verify no unresolved review threads, no conflicts, and clean state. |
| | `devops pr check-readiness [OPTIONS] <number>` | Validate PR merge readiness: conflicts, draft state, checks, review threads and grounding. |
| | `devops pr update [OPTIONS] <number>` | Update pull request branch with latest commits from its base branch. |
| | `devops pr threads COMMAND [ARGS]...` | GitHub Pull Request workflows and reviews. |
| **gh** | `devops gh api [OPTIONS] <endpoint>` | Execute a GitHub API request with token-bucket pacing, rate-limit backoff, and optional caching. |
Expand Down
16 changes: 14 additions & 2 deletions docs/CLI_REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5762,7 +5762,13 @@ devops pr close [OPTIONS] <number>

### `devops pr check-readiness`

**Validate PR merge readiness: verify no unresolved review threads, no conflicts, and clean state.**
**Validate PR merge readiness: conflicts, draft state, checks, review threads and grounding.**

Validate PR merge readiness: conflicts, draft state, checks, review threads and grounding.

Grounding applies to every PR but the release PR (release/vX.Y.Z into the default branch):
its body closes exactly one issue, and it adds, modifies or renames that issue's
docs/agent/tasks/task-\<issue\>-*.md. A base branch without docs/agent/tasks/ is exempt.

```bash
devops pr check-readiness [OPTIONS] <number>
Expand Down Expand Up @@ -6866,7 +6872,13 @@ devops gh pr close [OPTIONS] <number>

#### `devops gh pr check-readiness`

**Validate PR merge readiness: verify no unresolved review threads, no conflicts, and clean state.**
**Validate PR merge readiness: conflicts, draft state, checks, review threads and grounding.**

Validate PR merge readiness: conflicts, draft state, checks, review threads and grounding.

Grounding applies to every PR but the release PR (release/vX.Y.Z into the default branch):
its body closes exactly one issue, and it adds, modifies or renames that issue's
docs/agent/tasks/task-\<issue\>-*.md. A base branch without docs/agent/tasks/ is exempt.

```bash
devops gh pr check-readiness [OPTIONS] <number>
Expand Down
Loading
Loading