Skip to content
Closed
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
67 changes: 67 additions & 0 deletions .github/workflows/control-plane-sli-receipt-quality-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Control Plane SLI Receipt Quality CI

on:
pull_request:
branches: [main]
paths:
- ".github/workflows/control-plane-sli-receipt-quality-ci.yml"
- "scripts/ci/control_plane_sli_receipt.py"
- "tests/test_control_plane_sli_receipt.py"
- "docs/doctoring/control-plane-sli-receipts.md"
- "CHANGELOG.md"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ADR-only edits to AGENTS.md, ARCHITECTURE.md, and CLAUDE.md do not retrigger this exact-head gate. Add those paths plus the quality-workflow contract test so a documentation-only honesty change still produces current-head evidence.


permissions:
contents: read

concurrency:
group: control-plane-sli-receipt-quality-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
exact-head-quality:
runs-on: ubuntu-24.04
timeout-minutes: 20
steps:
- name: Checkout exact source revision
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
persist-credentials: false

- name: Set up Python 3.14
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.14"

- name: Install hash-locked repository quality tooling
shell: bash --noprofile --norc -e -o pipefail {0}
run: >-
python -m pip install --disable-pip-version-check --require-hashes
-r requirements-opencode-review-ci-hashes.txt

- name: Run focused SLI receipt tests with complete branch coverage
shell: bash --noprofile --norc -e -o pipefail {0}
run: |
test "$(git rev-parse HEAD)" = "${{ github.event.pull_request.head.sha || github.sha }}"
python -m coverage erase
python -m coverage run --branch --source=scripts.ci.control_plane_sli_receipt \
-m pytest tests/test_control_plane_sli_receipt.py -q
python -m coverage report --show-missing --fail-under=100

- name: Enforce public docstrings and compilation
shell: bash --noprofile --norc -e -o pipefail {0}
run: |
python -m interrogate --fail-under 100 --ignore-init-method \
scripts/ci/control_plane_sli_receipt.py
python -m compileall -q \
scripts/ci/control_plane_sli_receipt.py \
tests/test_control_plane_sli_receipt.py

- name: Run complete central test suite
shell: bash --noprofile --norc -e -o pipefail {0}
run: python -m pytest tests -q

- name: Verify clean patch
shell: bash --noprofile --norc -e -o pipefail {0}
run: git diff --check

1 change: 1 addition & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@

Materialize accepts only exact SHA-256 pins or a bounded relative `-r` include (no `.`/`..`); a lone `--require-hashes` directive is not trust evidence. See [`docs/doctoring/hourly-nvidia-nim-autofix.md`](docs/doctoring/hourly-nvidia-nim-autofix.md).
Conflict-scope roots fail closed when the immediate parent directory is a symbolic link.
Control-plane SLI receipts are local, finite, and read-only; they are not merge or writer authority. See [`docs/doctoring/control-plane-sli-receipts.md`](docs/doctoring/control-plane-sli-receipts.md).
7 changes: 7 additions & 0 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ flowchart LR
Products -->|"standalone or as module"| Buyer
```

## Control-plane SLI receipts

`scripts/ci/control_plane_sli_receipt.py` turns a local finite evidence
document into one `cwl.control-plane-sli/v1` receipt. The collector does
not query GitHub or acquire mutation authority. Named wait reasons and
acceptance debt are operator evidence only.

## Hourly NVIDIA NIM repair gate

```mermaid
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Semantic Versioning where the repository publishes a release.

### Added

- Added a bounded read-only control-plane SLI receipt builder that consumes a finite local evidence document and emits canonical `cwl.control-plane-sli/v1` JSON without GitHub queries or mutation authority.
- Added a trusted pull-request comment router for `@cwl-noema-review` and review-only `@opencode-agent` dispatches, with an organization sweep, exact-head receipts, repository allowlisting, fixed runners, immutable checkout pins, and a permanent 100% statement/branch/docstring quality gate.
- Added exact-base `uv.lock` materialization that reconstructs standalone nested projects with a checksum-pinned official `uv` exporter, isolated frozen/offline execution, strict exact-pin and SHA-256 output validation, and complete Python 3.10/3.14 quality evidence.
- Added a permanent exact-head contract workflow for the hourly review-repair scheduler, immutable reusable-workflow source, NVIDIA NIM model boundary, credential isolation, and fail-closed unattended-agent permissions.
Expand Down
2 changes: 2 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ repeatable compile command.
without running the test suite will break CI.
- **100% coverage and 100% docstrings on `scripts/ci/`** are hard gates, not aspirations. New helper
code needs matching tests and docstrings.
- **Control-plane SLI receipts** (`scripts/ci/control_plane_sli_receipt.py`) are local, finite, and
read-only. They are operator evidence, not merge or writer authority.
- **`pull_request_target` trust boundary.** The required review workflows run the *base branch's*
trusted scripts. A PR that edits the trusted review workflows can fail its own checks until the
base branch catches up; a same-head manual `workflow_dispatch` Strix run may supply review evidence
Expand Down
55 changes: 55 additions & 0 deletions docs/doctoring/control-plane-sli-receipts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Bounded control-plane SLI receipts

## Decision

`scripts/ci/control_plane_sli_receipt.py` builds one canonical
`cwl.control-plane-sli/v1` receipt from a local, finite-cardinality evidence
document. The builder does not query GitHub, interpret reviews, or acquire
mutation authority. Unknown fields, duplicate JSON members, non-finite
numbers, unbounded arrays, impossible recovery counts, and out-of-order or
future timestamps fail closed.

Receipts are operator evidence: they tell a buyer whether the org control
plane is executable now, deferred for a named wait reason, or carrying
operational-acceptance debt. They are not merge authority.

## Why the boundary exists

A commercial operator cannot see queue health from GitHub check rollups
alone. Waiting on review or Checks is not a coding stop, but the wait must
be named and aged. An unbounded or authority-bearing collector would turn
that observability surface into a second control plane.

CWE-807 (reliance on untrusted inputs in a security decision) is the
rejection reason for treating a receipt as merge or writer authority
(MITRE, 2026). Timestamps are canonical whole-second UTC RFC 3339 values
ending in `Z` (Internet Engineering Task Force, 2002).

## Trust-boundary sequence

```mermaid
flowchart LR
A["Local finite evidence JSON"] --> B["Strict load: no NaN, no duplicate keys"]
B --> C["Field, regex, and cardinality guards"]
C --> D["Age, retry, transition, redirection aggregates"]
D --> E["Canonical cwl.control-plane-sli/v1 JSON"]
```

Each arrow is fail-closed. A later stage does not repair an earlier
rejection.

## Verification contract

`tests/test_control_plane_sli_receipt.py` exercises a two-repository fixture,
strict JSON boundaries, impossible premature-stop recovery counts, and
timestamp canonicalization. The permanent quality workflow runs that suite
with 100% branch coverage, interrogate, compileall, and the full central
test suite on the exact pull-request head.

## References

Internet Engineering Task Force. (2002). *Date and time on the Internet:
Timestamps* (RFC 3339). https://www.rfc-editor.org/rfc/rfc3339

MITRE. (2026). *CWE-807: Reliance on untrusted inputs in a security
decision*. https://cwe.mitre.org/data/definitions/807.html
Loading
Loading