Skip to content
Draft
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
69 changes: 69 additions & 0 deletions .github/workflows/dtc-pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Copyright 2026 UCP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: DTC Review Pipeline

on:
schedule:
# Sync Next DTC Agenda assignees every 15 minutes
- cron: "*/15 * * * *"
repository_dispatch:
types:
- projects_v2_item
workflow_dispatch:
inputs:
mode:
description: "Command to execute (sync-agenda-assignees or scan-spotlight)"
required: false
type: choice
options:
- sync-agenda-assignees
- scan-spotlight
default: "sync-agenda-assignees"

permissions:
contents: read # Check out org-tools/dtc-pipeline scripts

jobs:
dtc-pipeline:
name: Run DTC Pipeline
runs-on: ubuntu-latest
permissions:
contents: read # Check out org-tools/dtc-pipeline scripts
steps:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Set up uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
python-version: "3.12"
enable-cache: "false"

- name: Sync Next DTC Agenda assignees
if: inputs.mode != 'scan-spotlight'
env:
ORG_TRIAGE_TOKEN: ${{ secrets.ORG_TRIAGE_TOKEN }}
DTC_PROJECT_ID: ${{ vars.DTC_PROJECT_ID }}
run: uv run --frozen python org-tools/dtc-pipeline/scripts/dtc_pipeline.py sync-agenda-assignees --apply

- name: Run Community Spotlight scan
if: inputs.mode == 'scan-spotlight'
env:
ORG_TRIAGE_TOKEN: ${{ secrets.ORG_TRIAGE_TOKEN }}
DTC_PROJECT_ID: ${{ vars.DTC_PROJECT_ID }}
ORG_NAME: ${{ github.repository_owner }}
run: uv run --frozen python org-tools/dtc-pipeline/scripts/dtc_pipeline.py scan-spotlight --org "$ORG_NAME" --repo ucp --apply
3 changes: 3 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,6 @@ jobs:
uv run --with jsonschema==4.26.0 --with markdown-it-py==3.0.0
--with markdown==3.10.2
python -m unittest discover -s org-tools/requirements-extractor/tests

- name: Run dtc-pipeline tests
run: uv run --frozen python -m unittest discover -s org-tools/dtc-pipeline/tests
5 changes: 4 additions & 1 deletion org-tools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ This directory contains CLI utilities and configuration files for organization-w

```text
org-tools/
├── dtc-pipeline/ # DTC review pipeline & Community Spotlight engine (see dtc-pipeline/README.md)
├── governance/ # PR governance gate and approval verification (see governance/README.md)
├── label-sync/ # GitHub label synchronization utility (see label-sync/README.md)
├── requirements-extractor/ # Requirements catalog from specification prose (see requirements-extractor/README.md)
Expand All @@ -22,6 +23,7 @@ org-tools/
- **[🛡️ Automated Governance Gate](governance/README.md)**: Enforces path-based repository ownership rules and PR approval thresholds.
- **[📋 Requirements Extractor](requirements-extractor/README.md)**: Generates a machine-readable catalog of a specification's RFC 2119 requirements, and checks in CI that a committed catalog matches the specification.
- **[🤖 Central PR Triage Tool](triage/README.md)**: Automatically applies the `status:needs-triage` label to eligible open, non-draft Pull Requests.
- **[🗳️ DTC Review Pipeline & Community Spotlight Engine](dtc-pipeline/README.md)**: Provisions the unified 5-view `UCP DTC Review Pipeline` Project v2 board, auto-assigns TC members who drag items into `Next DTC Agenda`, and runs the 3-gate + 100-point Community Spotlight scan.

---

Expand All @@ -36,5 +38,6 @@ uv run --with markdown-it-py==3.0.0 --with markdown==3.10.2 \
uv run python3 -m unittest discover -s org-tools/label-sync && \
uv run python3 -m unittest discover -s org-tools/triage/tests && \
uv run --with jsonschema==4.26.0 --with markdown-it-py==3.0.0 --with markdown==3.10.2 \
python3 -m unittest discover -s org-tools/requirements-extractor/tests
python3 -m unittest discover -s org-tools/requirements-extractor/tests && \
uv run python3 -m unittest discover -s org-tools/dtc-pipeline/tests
```
54 changes: 54 additions & 0 deletions org-tools/dtc-pipeline/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# UCP DTC Review Pipeline & Community Spotlight Engine

Implements the governance workflow for surfacing and resolving Issues and Pull Requests in weekly Domain Technical Council (DTC) meetings across `Universal-Commerce-Protocol/ucp`:

1. **General DTC Escalation & Native `Next DTC Agenda` Column Gate**
- Embeds the framing check directly into Column 2 (**`Next DTC Agenda`**, Orange, with column subtitle _"`⚠️ Confirm Framing Comment (or self-contained body) is in place before moving here.`"_) — 100% native in GitHub Projects UI with zero custom badge fields, comment scraping, webhooks, or bot noise on PR threads.
2. **Unified 5-View GitHub Project v2 Architecture (`UCP DTC Review Pipeline`)**
- Provisions and configures a **single Kanban Board per vertical** (`Shopping TC`, `Payments TC`, `Food TC`, `Lodging TC`) with a **6-column `Status` workflow** (handling triage, next-meeting agenda slotting, and post-meeting resolution outcomes in one board view with zero custom date or Iteration fields):
1. `Triage / Unscheduled` (Gray — set automatically by GitHub Projects' built-in _Item added to project_ workflow)
2. `Next DTC Agenda` (Orange — `⚠️ Confirm Framing Comment (or self-contained body) is in place before moving here.`; queued for the upcoming weekly meeting, capped at 5–7 items via GitHub Projects' native Board Column Limit)
3. `Approved` (Green — approved by DTC; `gov:tc-meeting` removed and circle-back comment posted once `meeting-minutes` merges)
4. `Follow-up / Revisions` (Purple — discussed in DTC; direction approved with revisions or follow-up requested)
5. `Redirected / Declined` (Red — redirected to a Domain Working Group / self-hosted extension or declined)
6. `Closed / Merged` (Gray — set automatically by GitHub Projects' built-in _Item closed_ and _Pull request merged_ workflows)
- Configures 5 views total: the 4 per-vertical Kanban boards (`Shopping TC`, `Payments TC`, `Food TC`, `Lodging TC`, grouped by `Status`) plus the cross-vertical `Community Spotlight Pool` Table view, surfacing `Track` (`General Track` | `Community Spotlight`), `Priority Score` (`NUMBER`), and the native repository `Milestone` field across all 5 views.
- Orders General Track `T - 24h` agenda slotting by Release Train Milestone urgency (`Active Milestone` [breaking `!` changes first due to the 2-week public notice window, then `area:common` items requiring GC sign-off] $\rightarrow$ `Next Milestone` $\rightarrow$ `No Milestone`), while keeping the 100-point Community Spotlight heuristic strictly Milestone-blind so external contributors are never penalized for lacking internal Milestone sponsorship.
3. **Dedicated Community Contribution Track ("Community Spotlight")**
- **Gate 1 (Non-DTC Corporate Affiliation):** Queries the GitHub Org Teams API (`@shopping-tech-council`, `@payments-tech-council`, `@food-tech-council`, `@lodging-tech-council`, `@governance-council`, `@maintainers`), parses `MAINTAINERS.md` for excluded member companies, inspects GitHub user `company` and email domains, and excludes bots.
- **Gate 2 (DTC Governance Scope Check):** Bundles linked Proposal Issues and PRs; matches PRs carrying `gov:needs-tc-review` or `gov:tc-meeting` (applied by `.github/org-tools/governance`), plus standalone proposal issues carrying `area:<domain>` and proposal prefixes/labels.
- **Gate 3 (Baseline Readiness & Hygiene Gate):** Enforces non-draft state, clean merge state (`mergeable_state != "dirty"`), passing `cla/google` and validation CI checks, structured proposal issue headers (`enhancement-proposal.yml` / `feature-request.yml`), and excludes items carrying `status:blocked`, `status:stale`, or `wontfix`.
- **100-Point Deterministic Priority Formula:**
$$\text{Priority Score (0–100)} = \text{Readiness (0–40)} + \text{Capped Traction (0–30)} + \text{Wait-Time Boost (0–30)} - \text{Cooldown (0 or 30)}$$

## Usage

### Run Unit Tests

```bash
uv run python -m unittest discover -s org-tools/dtc-pipeline/tests -v
```

### Run Community Spotlight Scan (Read-Only)

```bash
uv run python org-tools/dtc-pipeline/scripts/dtc_pipeline.py scan-spotlight --org Universal-Commerce-Protocol --repo ucp
```

### Provision or Clone a GitHub Project v2 Board

```bash
uv run python org-tools/dtc-pipeline/scripts/dtc_pipeline.py provision-project --owner Universal-Commerce-Protocol --title "UCP DTC Review Pipeline" --public
```

### Configure the 5 Project Views

```bash
uv run python org-tools/dtc-pipeline/scripts/dtc_pipeline.py configure-views --project-id PVT_...
```

### Auto-Assign TC Member Who Moved Items to `Next DTC Agenda`

```bash
uv run python org-tools/dtc-pipeline/scripts/dtc_pipeline.py sync-agenda-assignees --project-id PVT_... --apply
```
Loading
Loading