From 3f55f1497d309451d099c09632d4b7b66989ec49 Mon Sep 17 00:00:00 2001 From: crunchtools-ci Date: Tue, 17 Nov 2026 17:29:30 -0500 Subject: [PATCH 1/2] chore: float the sdlc gates on quay.io/crunchtools/sdlc Converted by python-sdlc's scripts/convert_repo.py. The hooks and the `sdlc ci` job run .sdlc/bin/sdlc, which takes its launcher from quay.io/crunchtools/sdlc:latest, so nothing in this repo pins a python-sdlc release and no version-bump pull request follows this one. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/ci.yml | 44 +++++++++++++---------- .github/workflows/gatehouse.yml | 36 ++++++++++++------- .pre-commit-config.yaml | 32 +++++++++++++---- .sdlc/bin/sdlc | 62 +++++++++++++++++++++++++++++++++ 4 files changed, 136 insertions(+), 38 deletions(-) create mode 100755 .sdlc/bin/sdlc diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 91943d3..3af87ab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,20 +1,30 @@ -# The repo's own checks, from python-sdlc at the release .pre-commit-config.yaml -# pins -- the same image and the same commands the laptop runs, so a green push -# predicts a green CI (constitution XII, v1.30.0). +# The repo's own checks, from quay.io/crunchtools/sdlc -- the same image, the +# same launcher and the same commands the laptop's hooks run, so a green push +# predicts a green CI (constitution XII). Nothing here pins a release: the +# image prints its own launcher, and both float on :latest. # -# NOT every check on this pull request: Gourmand and Gatehouse run as their own -# workflows, which is why `sdlc ci` leaves them out (XII: "CI runs push's checks -# except Gourmand and Gatehouse, which CI runs through their own workflows"). -# The Gourmand job below is one of them. +# The variable SDLC_IMAGE -- a repository's, or the organization's for the +# whole fleet -- picks other tooling: `main` for what has merged to python-sdlc +# and not been released, or a release such as `0.9.0` to hold one back. A +# variable, which only an admin sets, rather than a line a pull request could +# change in passing. +# +# Gourmand runs as its own job, not inside `sdlc ci`: XII has CI run push's +# checks except Gourmand and Gatehouse, which run through their own workflows +# (Gatehouse: gatehouse.yml). # # The job NAME `sdlc ci` is the required check in the org ruleset "Python SDLC -# gates". Renaming the job stops it gating, silently. +# gates", and the Gourmand job keeps the name its own workflow gave it. Renaming +# a job stops it gating, silently. +# +# python-sdlc's examples/ci.yml, written by scripts/convert_repo.py. Copy it +# unchanged. name: CI on: push: - branches: [main] + branches: [main, master] pull_request: workflow_dispatch: @@ -26,20 +36,16 @@ jobs: name: sdlc ci runs-on: ubuntu-latest steps: - - uses: actions/checkout@v7 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - # The release is read from .pre-commit-config.yaml, so one line pins the - # launcher, the image and every tool in it, for the laptop and CI both. + # .sdlc/bin/sdlc is python-sdlc's bin/sdlc-bootstrap: it asks the image + # for its launcher and runs it, as the hooks do. - name: sdlc ci - run: | - set -eu - rev=$(awk '/repo: https:\/\/github.com\/crunchtools\/python-sdlc/ {f=1; next} - f && /rev:/ {print $2; exit}' .pre-commit-config.yaml) - [ -n "$rev" ] || { echo "no python-sdlc rev in .pre-commit-config.yaml" >&2; exit 2; } - git clone -q --depth 1 --branch "$rev" https://github.com/crunchtools/python-sdlc "$RUNNER_TEMP/sdlc" - $RUNNER_TEMP/sdlc/bin/sdlc ci + env: + SDLC_IMAGE: ${{ vars.SDLC_IMAGE }} + run: .sdlc/bin/sdlc ci gourmand: name: Code Quality (Gourmand) diff --git a/.github/workflows/gatehouse.yml b/.github/workflows/gatehouse.yml index ea771bb..a4377cf 100644 --- a/.github/workflows/gatehouse.yml +++ b/.github/workflows/gatehouse.yml @@ -13,13 +13,18 @@ # Three jobs with DIFFERENT authority: # • guard — a real blocking gate. Mark it a REQUIRED status check so a PR # that tampers with your workflow files is rejected. -# • review — ADVISORY. It posts findings as PR comments and always passes; -# do NOT mark it required. An LLM reviewer is non-deterministic, +# • review — ADVISORY. It posts findings as PR comments and no finding +# fails it; it fails only when the review did not happen: +# fewer than half of the agents finished (provider down, +# key refused), or the reviewer could not run at all. Do +# NOT mark it required. An LLM reviewer is non-deterministic, # so it must never hold merge authority. (Opt into blocking with # `blocking: true` below only if you accept that tradeoff — and # even then, keep it out of branch protection.) -# • triage — deterministic. Fails while any finding has no reply -# (`fixed in ` or `not a bug: `). Safe to mark +# • triage — deterministic. Fails while any finding has no answer +# (`fixed in `, `not a bug: ` or +# `deferred: `), or while the +# last review did not finish. Safe to mark # REQUIRED: it never judges code, only whether a human answered. name: Gatehouse @@ -28,7 +33,7 @@ on: pull_request_target: types: [opened, synchronize, reopened] # A reply rings the doorbell: this run's own checks do not count toward - # branch rules, so examples/gatehouse-retriage.yml answers it by re-running + # branch rules, so gatehouse-retriage.yml answers it by re-running # triage inside the pull_request_target run. Add that file too. pull_request_review_comment: types: [created, edited, deleted] @@ -37,7 +42,8 @@ permissions: {} # default-deny; each job grants only what it needs jobs: # ── 1) Protect the workflow files themselves ──────────────────────────────── - # Rejects PRs from forks that touch .github/workflows/. Safe under + # Rejects PRs from forks that touch .github/workflows/ or .sdlc/ (the + # launcher the required `sdlc ci` check runs). Safe under # pull_request_target because it only reads the changed-file LIST via the # API — it never checks out or runs your code. And because pull_request_target # runs the BASE version of this file, a PR can't edit this job to disable it. @@ -66,11 +72,11 @@ jobs: echo "Head branch is in $GITHUB_REPOSITORY; allowing."; exit 0 fi # Both sides of a rename: `gh pr diff --name-only` lists only the new - # path, so a fork could move a workflow out of .github/workflows/ unseen. + # path, so a fork could move a file out of .github/workflows/ or .sdlc/ unseen. changed="$(gh api --paginate "repos/$GITHUB_REPOSITORY/pulls/$PR/files" \ --jq '.[] | .filename, (.previous_filename // empty)')" - if echo "$changed" | grep -qE '^\.github/workflows/'; then - echo "::error::PR modifies .github/workflows/ — not accepted from external contributors." + if echo "$changed" | grep -qE '^(\.github/workflows|\.sdlc)/'; then + echo "::error::PR modifies .github/workflows/ or .sdlc/ — not accepted from external contributors." # Explain once, on the PR event; replies re-run the check, not the comment. if [ "$EVENT" = "pull_request_target" ]; then gh pr comment "$PR" --repo "$GITHUB_REPOSITORY" --body \ @@ -82,7 +88,8 @@ jobs: # ── 2) Review the PR diff (no checkout, BYO key) ──────────────────────────── # The reviewer is maintained centrally in gatehouse's reusable workflow and the - # pinned container — so security fixes reach you without copying logic around. + # container it names, called at the major tag — so a fix reaches you with no + # change to this file. # Scope OPENROUTER_API_KEY to this reusable workflow so only it can read the key. review: name: Gatehouse review @@ -91,7 +98,7 @@ jobs: contents: read pull-requests: write uses: crunchtools/gatehouse/.github/workflows/review.yml@v0 - # Advisory by default — findings post as comments, the check always passes. + # Advisory by default — findings post as comments and never fail the check. # Uncomment to let critical/high findings fail the check (still not required): # with: # blocking: true @@ -100,7 +107,12 @@ jobs: # ── 3) Every finding answered ────────────────────────────────────────────── # Runs after the review on a push, and alone on a reply (review is skipped - # then, hence always()). Read-only, no secrets. + # then, hence always()). Read-only, no secrets. LOW findings need an answer + # only from Bug Hunter and Security Scan; other LOWs are advisory. To change + # which agents' LOWs are required (agent names, comma-separated), set the + # same list here and on the review job above, so the review posts them all: + # with: + # required_low_agents: "Bug Hunter,Security Scan,Test Coverage" triage: name: Gatehouse triage needs: review diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fa10e15..36c99b3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,9 +1,16 @@ -# Every check runs from python-sdlc, pinned here once (constitution XII, -# v1.30.0). This `rev:` fixes the launcher, the image and every tool inside it, -# for this laptop and for CI, which reads the same line. +# Every check runs from quay.io/crunchtools/sdlc (constitution XII). Nothing +# here pins it: .sdlc/bin/sdlc asks the image for its own launcher and runs it, +# so the launcher, the image and every tool inside it float together on +# :latest -- for this laptop and, through .github/workflows/ci.yml, for CI. +# There is no `rev:` to bump, ever. # -# What each hook runs is configured in pyproject.toml: [tool.sdlc.commit], -# [tool.sdlc.push], [tool.sdlc.ci]. `sdlc tiers` prints it. +# SDLC_IMAGE=main git push judges this push with what has merged to +# python-sdlc and not been released. A repo opts +# its CI in with the repository variable SDLC_IMAGE. +# +# What each hook runs is configured in pyproject.toml ([tool.sdlc.commit], +# [tool.sdlc.push], [tool.sdlc.ci]) or, in a repo with no pyproject.toml, +# sdlc.toml. `.sdlc/bin/sdlc tiers` prints it. # # `default_install_hook_types` must name both: without pre-push, `pre-commit # install` wires only the commit hook and every verdict silently stops running. @@ -11,8 +18,19 @@ default_install_hook_types: [pre-commit, pre-push] repos: - - repo: https://github.com/crunchtools/python-sdlc - rev: v0.8.0 + - repo: local hooks: - id: sdlc-commit + name: sdlc commit + entry: .sdlc/bin/sdlc commit + language: system + pass_filenames: false + always_run: true + stages: [pre-commit, pre-merge-commit] - id: sdlc-push + name: sdlc push + entry: .sdlc/bin/sdlc push + language: system + pass_filenames: false + always_run: true + stages: [pre-push] diff --git a/.sdlc/bin/sdlc b/.sdlc/bin/sdlc new file mode 100755 index 0000000..6fbb342 --- /dev/null +++ b/.sdlc/bin/sdlc @@ -0,0 +1,62 @@ +#!/bin/sh +# Run `sdlc` with no `rev:` to pin: get the launcher from the image, then run it. +# +# The launcher (bin/sdlc) ships inside quay.io/crunchtools/sdlc, so it floats +# with the image tag exactly as the tools in the image do: `:latest` by +# default, SDLC_IMAGE=main for what has merged and not been released, a +# release such as SDLC_IMAGE=0.9.0, or SDLC_IMAGE=@sha256:. Nothing +# else: this file runs whatever it pulls, so it pulls from that one repository. +# A seat trying a local build runs a python-sdlc clone's bin/sdlc instead. The +# image prints the launcher with its own ref written into it (`sdlc launcher +# `), so the launcher and the image it starts cannot disagree. +# +# A converted repo carries this file as .sdlc/bin/sdlc, and its hooks and its +# CI job run it (scripts/convert_repo.py writes it). Nothing in it names a +# release, so nothing ever bumps it, and the constitution pins its bytes. An +# `sdlc` RPM would install the same file as /usr/bin/sdlc. +# +# Host contract: podman and POSIX sh, nothing else. Never a pipe into `sh`: a +# failed pull would hand sh nothing, and nothing runs and exits 0. An image +# that cannot print its launcher is a 2 -- the gate could not run. + +set -u + +FLEET=quay.io/crunchtools/sdlc +refuse() { + printf 'sdlc: GATE CANNOT RUN: SDLC_IMAGE=%s is not main, latest, X.Y.Z or @sha256:<64 hex> of %s\n' \ + "${SDLC_IMAGE:-}" "$FLEET" >&2 + exit 2 +} + +# The value, with the repository named in full or not at all. +want=${SDLC_IMAGE:-latest} +case $want in + "$FLEET":*) want=${want#"$FLEET":} ;; + "$FLEET"@*) want=${want#"$FLEET"} ;; +esac +case $want in + main|latest) image=$FLEET:$want ;; + @sha256:*) + hex=${want#@sha256:} + case $hex in *[!0-9a-f]*) refuse ;; esac + [ "${#hex}" -eq 64 ] || refuse + image=$FLEET$want ;; + *[!0-9.]*|.*|*.|*..*|*.*.*.*) refuse ;; + *.*.*) image=$FLEET:$want ;; + *) refuse ;; +esac + +dir=$(mktemp -d) || exit 2 +trap 'rm -rf "$dir"' EXIT +trap 'exit 2' HUP INT TERM + +# --pull=newer: :latest moves, and a stale local copy is how a two-week-old +# reviewer once judged trentina. Offline, podman keeps the copy it has. +if ! podman --events-backend=none run --rm --log-driver=none --network=none \ + --cap-drop=all --security-opt=no-new-privileges --pull=newer \ + -- "$image" launcher "$image" > "$dir/sdlc" || [ ! -s "$dir/sdlc" ]; then + printf 'sdlc: GATE CANNOT RUN: %s could not print its launcher\n' "$image" >&2 + exit 2 +fi +# The launcher reads SDLC_IMAGE too; it gets the full reference checked here. +SDLC_IMAGE=$image sh "$dir/sdlc" "$@" From ac79719338be80090a1cacdac71b495e1e164110 Mon Sep 17 00:00:00 2001 From: Josui Date: Tue, 17 Nov 2026 17:40:14 -0500 Subject: [PATCH 2/2] chore: validate against constitution v1.46.0 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01R7Y1jf39CzcsfQWLaZQnLK --- .github/workflows/constitution.yml | 2 +- .github/workflows/container.yml | 2 +- .github/workflows/dependabot-automerge.yml | 2 +- .github/workflows/security.yml | 2 +- .specify/memory/constitution.md | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/constitution.yml b/.github/workflows/constitution.yml index f14e9d2..73a30c5 100644 --- a/.github/workflows/constitution.yml +++ b/.github/workflows/constitution.yml @@ -18,4 +18,4 @@ permissions: jobs: constitution: name: Constitution - uses: crunchtools/constitution/.github/workflows/validate.yml@v1.41.0 + uses: crunchtools/constitution/.github/workflows/validate.yml@v1.46.0 diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml index d126389..6ea2ea3 100644 --- a/.github/workflows/container.yml +++ b/.github/workflows/container.yml @@ -18,7 +18,7 @@ permissions: {} jobs: container: - uses: crunchtools/constitution/.github/workflows/container-release.yml@v1.41.0 + uses: crunchtools/constitution/.github/workflows/container-release.yml@v1.46.0 permissions: contents: read pull-requests: read diff --git a/.github/workflows/dependabot-automerge.yml b/.github/workflows/dependabot-automerge.yml index aec2a2a..b75f8fb 100644 --- a/.github/workflows/dependabot-automerge.yml +++ b/.github/workflows/dependabot-automerge.yml @@ -15,4 +15,4 @@ permissions: jobs: automerge: name: Dependabot - uses: crunchtools/constitution/.github/workflows/dependabot-automerge.yml@v1.41.0 + uses: crunchtools/constitution/.github/workflows/dependabot-automerge.yml@v1.46.0 diff --git a/.github/workflows/security.yml b/.github/workflows/security.yml index 6f99a2c..4471d44 100644 --- a/.github/workflows/security.yml +++ b/.github/workflows/security.yml @@ -22,7 +22,7 @@ jobs: permissions: contents: read issues: write - uses: crunchtools/constitution/.github/workflows/dependency-audit.yml@v1.41.0 + uses: crunchtools/constitution/.github/workflows/dependency-audit.yml@v1.46.0 codeql: name: CodeQL Analysis diff --git a/.specify/memory/constitution.md b/.specify/memory/constitution.md index 9fbdda6..d39b8e4 100644 --- a/.specify/memory/constitution.md +++ b/.specify/memory/constitution.md @@ -4,7 +4,7 @@ > **Ratified:** 2026-06-14 > **Amended:** 2026-11-09 > **Status:** Active -> **Inherits:** [crunchtools/constitution](https://github.com/crunchtools/constitution) v1.41.0 +> **Inherits:** [crunchtools/constitution](https://github.com/crunchtools/constitution) v1.46.0 > **Profile:** MCP Server This file holds what is specific to mcp-github. The fleet rules and the MCP