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 AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ All work follows a test-first progressive verification strategy to optimize deve
- 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`.
- 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 (`infer_item_status`), never in a 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`).
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- **Gitleaks Scans Every File of a List Target (`devops_cli.security.gitleaks`)**:
- A list target, such as the files of a review, now runs Gitleaks once per file and merges the outcomes, keeping every finding and the worst status. Before, the binary scanned only the first file, and since #763 the built-in patterns did too (#781).
- **Board-Owned Project Status and Truthful Reconciliation (`devops gh project reconcile`, `devops gh project sync`)**:
- The board owns Status: reconcile sets it only when unset, or when an item's state forces Done, In Review or In Progress, so manual triage is no longer reverted. Status labels match exactly, Priority only fills an unset field from its label, and Category, Value and Effort are no longer inferred (#703).
- `devops gh project reconcile` lists every field change with its old and new value and the source that decided it, and refuses to guess a board number when no board matches the template (#703).
- Failed reads of the board, issues or pull requests now raise instead of reading as empty, roadmap sync and release epics read every issue rather than the first 200 or 300, and each pull request is reconciled once (#703).
- **Quality Gate Within Its Five-Minute Budget (`devops ci`, `tests/`)**:
- The secops dry-run tests enable dry-run mode instead of running trivy, kube-linter and pluto over the whole workspace until they time out (#748).
- The test network guard now fails external DNS lookups too; tests that validate egress against a resolving hostname declare the `public_dns` fixture (#748).
Expand Down
6 changes: 3 additions & 3 deletions docs/CLI_REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6124,7 +6124,7 @@ devops gh project status [OPTIONS]

#### `devops gh project sync`

**Sync task items from docs/agent/tasks directory into GitHub Projects status.**
**Create or update the project board from its template, add open issues, and reconcile Status, Priority and Milestone; task files are not read.**

```bash
devops gh project sync [OPTIONS]
Expand All @@ -6138,11 +6138,11 @@ devops gh project sync [OPTIONS]
| `--template`, `-t` | `path` | `.github/project-template.json` | Path to project template JSON |
| `--repo`, `-R` | `string` | - | Target repository |
| `--dry-run`, `--no-dry-run` | `boolean` | - | Preview task card items without remote mutations |
| `--reconcile-fields`, `--no-reconcile-fields` | `boolean` | `True` | Automatically infer and update project custom fields from taxonomy labels and issue state. |
| `--reconcile-fields`, `--no-reconcile-fields` | `boolean` | `True` | Also reconcile Status, Priority and Milestone from issue state and labels. |

#### `devops gh project reconcile`

**Reconcile custom fields (Status, Priority, Category, Value, Effort) on project items.**
**Reconcile Status, Priority and Milestone on project items, listing each change and its source; the board owns Status.**

```bash
devops gh project reconcile [OPTIONS]
Expand Down
8 changes: 4 additions & 4 deletions docs/MCP_TOOLS.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ The `devops-cli` FastMCP server exposes DevOps automation and AI review capabili
| [`gh_pages_verify`](#gh-pages-verify) | Verify local repository readiness for GitHub Pages publishing. |
| [`gh_project_audit`](#gh-project-audit) | Audit project board health and alignment against standardized template. |
| [`gh_project_list`](#gh-project-list) | List available GitHub Projects v2 boards for user or organization. |
| [`gh_project_reconcile`](#gh-project-reconcile) | Reconcile custom fields (Status, Priority, Category, Value, Effort) on GitHub Projects v2 items. |
| [`gh_project_reconcile`](#gh-project-reconcile) | Reconcile Status, Priority and Milestone on GitHub Projects v2 items, listing each change and its source. |
| [`gh_project_status`](#gh-project-status) | Inspect GitHub Projects v2 template configuration, fields, and view definitions. |
| [`gh_project_sync`](#gh-project-sync) | Synchronize task items from task tracking into GitHub Projects v2 status. |
| [`gh_project_sync`](#gh-project-sync) | Create or update the project board, add open issues, and reconcile Status, Priority and Milestone. |
| [`gh_rate_limit`](#gh-rate-limit) | Inspect GitHub REST and GraphQL API rate limits, quotas, and reset countdowns. |
| [`gh_run_view`](#gh-run-view) | View details and diagnostic failure logs of a specific GitHub Actions workflow run. |
| [`gh_runs_list`](#gh-runs-list) | List recent GitHub Actions CI/CD workflow runs. |
Expand Down Expand Up @@ -823,7 +823,7 @@ List available GitHub Projects v2 boards for user or organization.

### `gh_project_reconcile`

Reconcile custom fields (Status, Priority, Category, Value, Effort) on GitHub Projects v2 items.
Reconcile Status, Priority and Milestone on GitHub Projects v2 items, listing each change and its source.

**Parameters:**

Expand All @@ -841,7 +841,7 @@ Inspect GitHub Projects v2 template configuration, fields, and view definitions.

### `gh_project_sync`

Synchronize task items from task tracking into GitHub Projects v2 status.
Create or update the project board, add open issues, and reconcile Status, Priority and Milestone.

**Parameters:**

Expand Down
2 changes: 1 addition & 1 deletion docs/ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ High-density product roadmap, engineering milestones, and open-source integratio
- *Constraint*: A port-less rule is worse than it looks: an agent-supplied `https://host:8443` entry, via the MCP tool, opens every port and protocol to that host. A policy is only as real as the CNI: `devops k8s bootstrap` starts minikube with no `--cni` (`commands/k8s/cluster_runtime.py:94,99`) while its help claims Calico (`lang/en/help.py:260`); that false claim is a separate item, and until it is fixed a zero denial count proves nothing. Under `--network=none` a connect fails inside the container, so no host-side enforcer sees it; report such lanes as uncounted, never as zero. Select the collector by label, never a resolved `/32`.
- *Measured*: Whitelist entry `https://1.1.1.1:8443` yields a bare `1.1.1.1/32` rule with no `ports` (`.venv/bin/python -c "from devops_cli.sandbox.models import SandboxNetworkConfig as C; print(C(mode='public_whitelist', public_whitelist=['https://1.1.1.1:8443']).to_k8s_network_policy()['spec']['egress'])"`); 0 trace-context injections in the sandbox and docker packages (`grep -rn 'TRACEPARENT\|inject_env\|inject_trace_env' src/devops_cli/sandbox src/devops_cli/docker | wc -l`); 0 alerting rules (`grep -rn 'alert:' k8s | wc -l`).
- *Source*: vibes `patterns/zero-trust-sandboxing-and-observability.md`, `resources/k8s/agent-sandbox/network-policy.yaml`, `resources/observability/prometheus-agent-alerts.yaml`
- [ ] **Board-Owned Project Status, Declared Field Sources and Truthful Project Sync (P0 - Critical, Issue #703)**:
- [x] **Board-Owned Project Status, Declared Field Sources and Truthful Project Sync (P0 - Critical, Issue #703)**:
- *Context & Rationale*: Docs say `devops gh project sync` pushes task-file status to the board (`src/devops_cli/lang/en/help.py:746-748`, `docs/MCP_TOOLS.md:852`, `docs/agent/tasks/README.md:13`), but `sync_remote_project` only counts task items (`src/devops_cli/github/projects.py:1485`). `project reconcile` recomputes Status, Priority, Category, Value and Effort every pass (`projects.py:1169-1225`), and `_filter_differing_fields` (`:1154`) overwrites differing board values, so hand corrections revert, breaking `AGENTS.md:61`. Status matches labels by substring with a Ready fallback (`:1004-1021`): `status/ready-to-merge` and `status/triage` both yield Ready, and no `.github/labels.yml` label yields Backlog. Category/Value/Effort come from `TAXONOMY_CATEGORY_MAPPING` (`:1046`) keyed on the `type/feature` label roadmap sync puts on every issue (`github/roadmap_sync.py:121`), not the ROADMAP matrix; `_derive_scope` (`:77`) keyword-matches, which `AGENTS.md:21` prohibits. Nothing records which branch decided, results are counts (`projects.py:1431-1432`), and a failed issue fetch returns `[]` (`github/issues.py:118-140`). vibes `tools/sdlc_project_manager.py` hit the same faults; `tools/portfolio_balance.py` `classify()` returns `(kind, source)`.
- *Deliverable*: Measure first: `project reconcile --dry-run` lists each change with field, old and new value, and source, and `reconcile_project_custom_fields` returns that list (live runs need `read:project`). Then the board owns Status: reconcile writes it only when unset or when issue/PR state forces Done, In Review or In Progress; other moves belong to the built-in workflows `project workflows list` audits. Status labels match exactly; `status/blocked` maps only if the template gains Blocked; `CONST_PROJECT_WORKFLOW_EXPECTATIONS` expects the template's Backlog, not Todo. Reconcile never overwrites a non-empty Category/Value/Effort with an inferred value. Once a join key exists (a test that every scheduled matrix row joins its item, or a key column), sync stamps Value/Effort from the matrix and Category through a declared category map; until then it stays unset. Sync reports the `scope/cli` fallback share. Fetch failures raise, fetches paginate past 200, and reconcile refuses a missing template board instead of defaulting to board 2 (`src/devops_cli/commands/gh.py:613`). Rewrite the three `project sync` texts. Separate: suffix priority (R1-16's first PR), priority refresh in `issues reconcile-roadmap`, promotion (planned `devops gh pm deps`), Ready ordering (Sprint Kanban `sort_by`), the literal-subset lint (Anti-Brittle Constant Elimination).
- *Constraint*: Making task files write Status creates a second owner fighting the board and `Closes #N`. A reconciler that overwrites Status reverts manual triage; one that skips closed or PR-backed items leaves merged work outside Done. An inferred field that keeps writing is worse than an unset one: the board presents it as decided. A raised fetch error must stay distinct from a successful empty list, or a new repository never syncs.
Expand Down
4 changes: 2 additions & 2 deletions docs/agent/tasks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Historically, a monolithic `docs/agent/task.md` file was used for task tracking
2. **Decommissioned Monolithic Index**: Centralized task visualization, roadmap tracking, and sprint management are managed natively through GitHub Projects v2 (`https://github.com/dan-petty/devops-cli/projects`) and GitHub Issues views (`https://github.com/dan-petty/devops-cli/issues/views`). No central index markdown file is maintained.
3. **Commit Context Rule**: Updates to task tracking files **MUST ONLY** occur in the commit that delivers the feature or fix, written as the file should read once merged (`**Status**: Done`). Standalone task-tracking commits, including follow-ups that only add a pull request number, are strictly prohibited.
4. **Issue-Only Linking**: A task file links its GitHub issue and nothing else. The issue links the pull request that closes it (`Closes #<issue>`), and GitHub shows that pull request on the issue. Task files never carry a pull request number or a review state: the number is unknown until the pull request exists, so recording it takes a second commit that re-runs every check.
5. **Automated Project Synchronization**: `devops gh project sync` (and FastMCP `gh_project_sync`) natively inspects `docs/agent/tasks/` and synchronizes all task cards into GitHub Projects v2.
5. **Project Synchronization**: `devops gh project sync` (and FastMCP `gh_project_sync`) creates or updates the board from `.github/project-template.json`, adds the repository's open issues, and reconciles Status, Priority and Milestone from GitHub. It does not read task files: the board owns Status, and task files are the implementation record.

---

Expand Down Expand Up @@ -65,7 +65,7 @@ A task file records one of four statuses. `tests/test_agent_task_files.py` enfor
- **In Progress (WIP)**: Active work item currently being authored. If an early PR is opened to share work, it must be a Draft Pull Request (`--draft`).
- **Done**: Written by the delivering pull request, which merges with the work and closes the issue.

Review is not a task-file status. A GitHub Projects v2 card shows **In Review** while the pull request that closes its issue is open and ready for review; `devops gh project sync` derives it from GitHub (`infer_item_status`).
Review is not a task-file status. A GitHub Projects v2 card shows **In Review** while the pull request that closes its issue is open and ready for review; `devops gh project sync` derives it from GitHub (`plan_item_changes`).

---

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Task 703: Board-Owned Project Status, Declared Field Sources and Truthful Project Sync

**Issue**: [#703](https://github.com/dan-petty/devops-cli/issues/703)
**Status**: Backlog
**Status**: Done
**Milestone**: `v0.2.24`
**Priority**: `priority/p0-critical`
**Scope**: `type/feature`, `scope/github`, `priority/p0-critical`
Expand All @@ -20,3 +20,20 @@ Docs say `devops gh project sync` pushes task-file status to the board (`src/dev
- Unit and integration test coverage with structural tuple equality assertions.
- Maintain cyclomatic complexity $M \le 10$ and nesting depth $\le 5$.
- 100% passing across Gated CI validation suite (`uv run devops ci`).

## 2. Delivered

- [x] `reconcile_project_custom_fields` returns `changes`: each field change with its item, old and new value, and the source that decided it (the planned changes in a dry run, the applied ones otherwise). `devops gh project reconcile` prints them as a table.
- [x] The board owns Status. `plan_item_changes` sets it only when unset (from an exact `status/*` label, otherwise Backlog) or when the item's state forces Done (closed issue, merged or closed pull request), In Review (open pull request, or an issue with a linked open pull request) or In Progress (draft pull request).
- [x] Status labels match exactly, so `status/ready-to-merge` and `status/triage` no longer read as Ready; `status/blocked` maps only when the board's template has a Blocked status. `CONST_PROJECT_WORKFLOW_EXPECTATIONS` expects Backlog, not Todo.
- [x] Priority only fills an unset field from its `priority/*` label. Category, Value and Effort are never inferred: no join key between the matrix and items exists, so they stay unset unless set by hand. The taxonomy and title-keyword mappings are removed.
- [x] Fetch failures raise `GitHubOperationError` instead of returning `[]` or `None`: the board items, repository issues and pull requests, and `get_repository_issues`, whose REST fallback now paginates. Roadmap sync, milestone reconciliation and release epics read every issue (`limit=None`) and no longer treat a failed read as an empty repository.
- [x] The issues fetch drops pull requests, which the pulls fetch supplies with their merge state, so each pull request is reconciled once.
- [x] `project reconcile` and `project workflows list` refuse to guess board #2 when no board matches the template.
- [x] `devops gh issues sync-roadmap` reports how many eligible items fell back to `scope/cli`.
- [x] The `project sync` help, the `gh_project_sync` and `gh_project_reconcile` MCP descriptions, `docs/agent/tasks/README.md` and the project-management knowledge base say what sync and reconcile do.

## 3. Verification

- `devops gh project reconcile --dry-run` against board #2 (read-only): would change 337 of 472 items, 480 field changes. Every change fills an unset field or forces a closed item to Done: Status unset to Done 212, unset to Backlog 81, unset to In Review 2, set to Done (closed) 42; Priority unset to a label's value 143. No set Status is moved for any other reason, and no Category, Value or Effort is written. Before dropping pull requests from the issues fetch, the same run counted 683 items, reconciling each pull request twice.
- The 15 test files that touch projects, issues, roadmap sync, release epics and the `gh` commands: 351 passed.
6 changes: 3 additions & 3 deletions docs/commands/gh.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ devops gh project status [OPTIONS]

### `devops gh project sync`

**Sync task items from docs/agent/tasks directory into GitHub Projects status.**
**Create or update the project board from its template, add open issues, and reconcile Status, Priority and Milestone; task files are not read.**

```bash
devops gh project sync [OPTIONS]
Expand All @@ -239,11 +239,11 @@ devops gh project sync [OPTIONS]
| `--template`, `-t` | `path` | `.github/project-template.json` | Path to project template JSON |
| `--repo`, `-R` | `string` | - | Target repository |
| `--dry-run`, `--no-dry-run` | `boolean` | - | Preview task card items without remote mutations |
| `--reconcile-fields`, `--no-reconcile-fields` | `boolean` | `True` | Automatically infer and update project custom fields from taxonomy labels and issue state. |
| `--reconcile-fields`, `--no-reconcile-fields` | `boolean` | `True` | Also reconcile Status, Priority and Milestone from issue state and labels. |

### `devops gh project reconcile`

**Reconcile custom fields (Status, Priority, Category, Value, Effort) on project items.**
**Reconcile Status, Priority and Milestone on project items, listing each change and its source; the board owns Status.**

```bash
devops gh project reconcile [OPTIONS]
Expand Down
Loading
Loading