From 02ac19964d34d767bcc0e3b6105d47d7391b343b Mon Sep 17 00:00:00 2001 From: Zhe Li Date: Wed, 18 Nov 2026 17:23:42 +0000 Subject: [PATCH 01/13] feat(cursor): use small (cheap) pstack budget for poteto-mode Pin poteto-mode / pstack roles to the official small budget so cloud agents spend medium/low reasoning instead of skill defaults (xhigh/high). Track .cursor/rules so the always-applied rule ships with the repo. Co-authored-by: Zhe Li --- .cursor/rules/pstack-models.mdc | 18 ++++++++++++++++++ .gitignore | 6 +++++- 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 .cursor/rules/pstack-models.mdc diff --git a/.cursor/rules/pstack-models.mdc b/.cursor/rules/pstack-models.mdc new file mode 100644 index 00000000..fd49ca4f --- /dev/null +++ b/.cursor/rules/pstack-models.mdc @@ -0,0 +1,18 @@ +--- +description: pstack per-role model choices (overrides skill defaults) +alwaysApply: true +--- +# pstack model configuration. One line per role. Delete a line to fall back to the skill default. +# `inherit-parent` or `auto` as a value: the role runs on the parent chat model (omit Task `model` and spawn `generalPurpose`). Alias entries in a panel list still count toward its fan-out. +# Committed so Cursor Cloud Agents pick it up for poteto-mode. +# defaults: 3 +# budget: small (medium) +feature, refactoring: claude-opus-5-5-medium-fast +bug-fix: claude-opus-5-5-medium-fast +perf-issue: claude-opus-5-5-medium-fast +hillclimb: claude-opus-5-5-medium-fast +judgment and prose: claude-opus-5-5-medium-fast +arena runners: claude-fable-5-2-low, claude-opus-5-5-low-fast, gemini-4-carbon-low +arena cross-judge pool: claude-opus-5-5-low-fast, gemini-4-carbon-low +swarm workers: claude-opus-5-5-low-fast +interrogate reviewers: claude-fable-5-2-low, claude-opus-5-5-low-fast, gemini-4-carbon-low diff --git a/.gitignore b/.gitignore index fd6fabe9..1c5b6dd6 100644 --- a/.gitignore +++ b/.gitignore @@ -17,7 +17,11 @@ tmp/ .vscode/ # AI files -.cursor/ +# Ignore Cursor local state, but keep committed always-applied rules +# (e.g. pstack-models.mdc for poteto-mode) so Cloud Agents pick them up. +.cursor/* +!.cursor/rules/ +!.cursor/rules/** .claude/ AGENTS.md CLAUDE.md From 34ae4afff1b650506526f9820fb00302edb2b8f7 Mon Sep 17 00:00:00 2001 From: Zhe Li Date: Wed, 18 Nov 2026 17:28:18 +0000 Subject: [PATCH 02/13] feat(cursor): drop -fast from poteto-mode model slugs Keep the small budget mapping but use non-fast Opus slugs throughout. Co-authored-by: Zhe Li --- .cursor/rules/pstack-models.mdc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.cursor/rules/pstack-models.mdc b/.cursor/rules/pstack-models.mdc index fd49ca4f..14252485 100644 --- a/.cursor/rules/pstack-models.mdc +++ b/.cursor/rules/pstack-models.mdc @@ -7,12 +7,12 @@ alwaysApply: true # Committed so Cursor Cloud Agents pick it up for poteto-mode. # defaults: 3 # budget: small (medium) -feature, refactoring: claude-opus-5-5-medium-fast -bug-fix: claude-opus-5-5-medium-fast -perf-issue: claude-opus-5-5-medium-fast -hillclimb: claude-opus-5-5-medium-fast -judgment and prose: claude-opus-5-5-medium-fast -arena runners: claude-fable-5-2-low, claude-opus-5-5-low-fast, gemini-4-carbon-low -arena cross-judge pool: claude-opus-5-5-low-fast, gemini-4-carbon-low -swarm workers: claude-opus-5-5-low-fast -interrogate reviewers: claude-fable-5-2-low, claude-opus-5-5-low-fast, gemini-4-carbon-low +feature, refactoring: claude-opus-5-5-medium +bug-fix: claude-opus-5-5-medium +perf-issue: claude-opus-5-5-medium +hillclimb: claude-opus-5-5-medium +judgment and prose: claude-opus-5-5-medium +arena runners: claude-fable-5-2-low, claude-opus-5-5-low, gemini-4-carbon-low +arena cross-judge pool: claude-opus-5-5-low, gemini-4-carbon-low +swarm workers: claude-opus-5-5-low +interrogate reviewers: claude-fable-5-2-low, claude-opus-5-5-low, gemini-4-carbon-low From 8665d172fd78a2fec4705ef9ed70731a37029828 Mon Sep 17 00:00:00 2001 From: Zhe Li Date: Wed, 18 Nov 2026 17:31:49 +0000 Subject: [PATCH 03/13] chore(cursor): trim pstack-models header comments Keep the small-budget role map; drop redundant setup comments. Co-authored-by: Zhe Li --- .cursor/rules/pstack-models.mdc | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.cursor/rules/pstack-models.mdc b/.cursor/rules/pstack-models.mdc index 14252485..db9086e2 100644 --- a/.cursor/rules/pstack-models.mdc +++ b/.cursor/rules/pstack-models.mdc @@ -2,10 +2,6 @@ description: pstack per-role model choices (overrides skill defaults) alwaysApply: true --- -# pstack model configuration. One line per role. Delete a line to fall back to the skill default. -# `inherit-parent` or `auto` as a value: the role runs on the parent chat model (omit Task `model` and spawn `generalPurpose`). Alias entries in a panel list still count toward its fan-out. -# Committed so Cursor Cloud Agents pick it up for poteto-mode. -# defaults: 3 # budget: small (medium) feature, refactoring: claude-opus-5-5-medium bug-fix: claude-opus-5-5-medium From 1edd4a64c3d8bf0a3e2a3bc7b87594a74396a7b3 Mon Sep 17 00:00:00 2001 From: Zhe Li Date: Wed, 18 Nov 2026 17:35:13 +0000 Subject: [PATCH 04/13] chore: trim .gitignore comments and note frontend check TODO Drop section banners; keep .cursor/rules allowlist; mark the Vite placeholder warning as needing a GitHub check. Co-authored-by: Zhe Li --- .gitignore | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index 1c5b6dd6..b61dae32 100644 --- a/.gitignore +++ b/.gitignore @@ -1,24 +1,17 @@ -# Build artifacts bin/ dist/ -# Scratch dir for local validation / temporary files .tmp/ tmp/ -# Local environment .env .env.* !.env.example -# OS/editor files .DS_Store .idea/ .vscode/ -# AI files -# Ignore Cursor local state, but keep committed always-applied rules -# (e.g. pstack-models.mdc for poteto-mode) so Cloud Agents pick them up. .cursor/* !.cursor/rules/ !.cursor/rules/** @@ -31,6 +24,7 @@ CLAUDE.md # fresh clone; `make frontend` overwrites it with the real bundle. # See internal/ui/assets.go. # +# TODO: Create a github check for this # DO NOT commit a real Vite build's index.html over the placeholder: the # hashed assets/*.js and *.css it references are git-ignored, so a checkout # would point at files that don't exist. Keep the DEVKIT_FRONTEND_PLACEHOLDER @@ -39,10 +33,8 @@ internal/ui/dist/* !internal/ui/dist/index.html .worktrees/ -# worktrunk configs .config/wt.toml -# workspace files *.code-workspace .omo/ /artifacts/ From cf57253025c029097b35049db95bbde539a44d20 Mon Sep 17 00:00:00 2001 From: Zhe Li Date: Wed, 18 Nov 2026 19:49:48 +0000 Subject: [PATCH 05/13] feat(agents): track AGENTS.md with no-comments policy Stop ignoring AGENTS.md so Cloud Agents load it. Ban narrating and why-comments; keep license, public API docs, parity TODOs, issue links, and external-constraint comments. Co-authored-by: Zhe Li --- .gitignore | 1 - AGENTS.md | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 AGENTS.md diff --git a/.gitignore b/.gitignore index b61dae32..b2420507 100644 --- a/.gitignore +++ b/.gitignore @@ -16,7 +16,6 @@ tmp/ !.cursor/rules/ !.cursor/rules/** .claude/ -AGENTS.md CLAUDE.md # Vite/React build output for the embedded Web UI. The placeholder diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 00000000..4d45c5fd --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,15 @@ +# Agent instructions + +## Comments + +Do not add comments by default. No narration, section banners, or why-comments. + +Allowed only: + +- Legal / license headers +- Public API doc comments that define a contract +- `TODO(#issue):` / `FIXME(#issue):` parity markers (CLI ↔ Web UI), per CONTRIBUTING +- Issue/RFC links that state a constraint code cannot express +- Behavior forced by an external dependency, platform, vendor, or protocol we cannot reshape + +Encode other constraints in types, names, tests, or CI. Before review, run `/no-comments` on the diff. From 03ed1195e96aad8dab65b33c4a02bf946534e132 Mon Sep 17 00:00:00 2001 From: Zhe Li Date: Wed, 18 Nov 2026 19:52:14 +0000 Subject: [PATCH 06/13] chore: simplify .gitignore for artifacts and AI paths Move artifacts/ to the top-level ignore list and drop the local AI path ignore block from this file. Co-authored-by: Zhe Li --- .gitignore | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index b2420507..45eeb39c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +artifacts/ bin/ dist/ @@ -12,12 +13,6 @@ tmp/ .idea/ .vscode/ -.cursor/* -!.cursor/rules/ -!.cursor/rules/** -.claude/ -CLAUDE.md - # Vite/React build output for the embedded Web UI. The placeholder # index.html is tracked so go:embed has at least one match on a # fresh clone; `make frontend` overwrites it with the real bundle. @@ -36,4 +31,3 @@ internal/ui/dist/* *.code-workspace .omo/ -/artifacts/ From c853097bd983d1ec9c5b4aa6d81a241cfa905799 Mon Sep 17 00:00:00 2001 From: Zhe Li Date: Wed, 18 Nov 2026 19:53:49 +0000 Subject: [PATCH 07/13] docs: drop parity TODO comment requirement from CONTRIBUTING Require a linked follow-up issue instead of in-code TODO comments when CLI and Web UI cannot land in the same PR. Co-authored-by: Zhe Li --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e225ae06..1e0a325b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -110,7 +110,7 @@ When the work spans both: - **Mirror the verbs.** If the UI gets `POST /api/instances/{name}/containers/{c}/restart`, the CLI should get `dpm localnet container restart `. The CLI name is a wrapper around the same handler logic; both pass through the same shared function. - **Mirror the guards.** If the Web UI's pre-flight gate refuses to start a Splice 0.6.4 instance on a 4 GiB host, `dpm localnet up --version 0.6.4` must refuse it for the same reason. Don't let one surface be lenient where the other is strict. -**When you can't reach parity in the same PR**, file a follow-up issue and add a `// TODO(#issue): CLI parity — ` comment at the divergence point so reviewers can see it. Never close out a feature as "done" while one surface is silently missing it. +**When you can't reach parity in the same PR**, file a follow-up issue and link it from the PR. Never close out a feature as "done" while one surface is silently missing it. ### Docker Compose teardown must be `-p`-only @@ -185,4 +185,4 @@ Before submitting: 3. No test coverage regression (check with `go tool cover`) 4. Relevant documentation added/updated 5. PR title is clear and understandable -6. **CLI ↔ Web UI parity:** if the change touches a user-facing feature, both surfaces are updated (or a follow-up issue is filed with a `TODO(#issue): CLI parity` / `TODO(#issue): UI parity` comment at the divergence point). See "CLI ↔ Web UI parity" rule above. +6. **CLI ↔ Web UI parity:** if the change touches a user-facing feature, both surfaces are updated (or a follow-up issue is filed and linked from the PR). See "CLI ↔ Web UI parity" rule above. From a4c6dc87a237b95f79f56e4bc6e46924cf2f07f8 Mon Sep 17 00:00:00 2001 From: Zhe Li Date: Wed, 18 Nov 2026 19:57:40 +0000 Subject: [PATCH 08/13] docs: move no-comments policy into CONTRIBUTING Treat the comment keep-list as shared project law for humans and agents. AGENTS.md points at CONTRIBUTING and keeps agent workflow only. Co-authored-by: Zhe Li --- AGENTS.md | 17 ++++++----------- CONTRIBUTING.md | 13 +++++++++++++ 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 4d45c5fd..bb910a6c 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,15 +1,10 @@ # Agent instructions -## Comments +Follow [`CONTRIBUTING.md`](CONTRIBUTING.md). It is the source of truth for project conventions, including the no-comments policy. -Do not add comments by default. No narration, section banners, or why-comments. +## Agent workflow -Allowed only: - -- Legal / license headers -- Public API doc comments that define a contract -- `TODO(#issue):` / `FIXME(#issue):` parity markers (CLI ↔ Web UI), per CONTRIBUTING -- Issue/RFC links that state a constraint code cannot express -- Behavior forced by an external dependency, platform, vendor, or protocol we cannot reshape - -Encode other constraints in types, names, tests, or CI. Before review, run `/no-comments` on the diff. +- Work on a feature branch off `main`; do not commit to `main`. +- Match this repo's commit authorship CI: human author/committer (no AI-tool identities or AI `Co-authored-by` trailers). +- Before review, run `/no-comments` on the diff. +- Prefer the smallest change that satisfies CONTRIBUTING; do not expand scope. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1e0a325b..999eea40 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -158,6 +158,19 @@ Rules: - Cobra command builders return `*cobra.Command` - `App` struct uses dependency injection for `io.Writer` (testability) +### Comments + +Do not add comments by default. No narration or why-comments. + +Allowed only: + +- Legal / license headers +- Public API doc comments that define a contract +- Issue/RFC links that state a constraint code cannot express +- Behavior forced by an external dependency, platform, vendor, or protocol we cannot reshape + +Encode other constraints in types, names, tests, or CI. + ## Architecture Notes - **Entry point:** `cmd/canton-devkit/main.go` From f0a6356843d354c1644562b270d83c9b7a12a510 Mon Sep 17 00:00:00 2001 From: Zhe Li Date: Wed, 18 Nov 2026 20:00:18 +0000 Subject: [PATCH 09/13] docs: cite poteto rationale for no-comments policy Link Lauren Tan's post from the CONTRIBUTING Comments section. Co-authored-by: Zhe Li --- CONTRIBUTING.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 999eea40..48b9ae16 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -171,6 +171,8 @@ Allowed only: Encode other constraints in types, names, tests, or CI. +Rationale: [Lauren Tan (@poteto) on comments](https://x.com/poteto/status/2110758788525621282). + ## Architecture Notes - **Entry point:** `cmd/canton-devkit/main.go` From 8f597ecd5d044aa4184a90ed0bd5bd4dc19db548 Mon Sep 17 00:00:00 2001 From: Zhe Li Date: Wed, 18 Nov 2026 20:04:01 +0000 Subject: [PATCH 10/13] ci: require GitHub-verified signatures on PR commits Unverified badges come from Cursor SSH signatures on human-authored commits (unknown_key). Add a CI check mirroring authorship so merges cannot land unsigned or untrusted signatures. Co-authored-by: Zhe Li --- .github/workflows/commit-verification.yml | 28 +++++++ AGENTS.md | 1 + CONTRIBUTING.md | 22 +++++- scripts/ci/check-commit-verification.sh | 92 +++++++++++++++++++++++ 4 files changed, 142 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/commit-verification.yml create mode 100755 scripts/ci/check-commit-verification.sh diff --git a/.github/workflows/commit-verification.yml b/.github/workflows/commit-verification.yml new file mode 100644 index 00000000..ea34bbee --- /dev/null +++ b/.github/workflows/commit-verification.yml @@ -0,0 +1,28 @@ +name: Commit Verification + +on: + pull_request: + +permissions: + contents: read + +jobs: + check-verification: + name: Check commit verification + runs-on: [self-hosted, Linux] + + steps: + - name: Check out repository + # actions/checkout@v5 + uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd + with: + # Full history so the base..head range is resolvable. + fetch-depth: 0 + + - name: Check GitHub Verified badge on each commit + env: + BASE_SHA: ${{ github.event.pull_request.base.sha }} + HEAD_SHA: ${{ github.event.pull_request.head.sha }} + GITHUB_REPOSITORY: ${{ github.repository }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: scripts/ci/check-commit-verification.sh "$BASE_SHA" "$HEAD_SHA" diff --git a/AGENTS.md b/AGENTS.md index bb910a6c..8fd51e48 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -6,5 +6,6 @@ Follow [`CONTRIBUTING.md`](CONTRIBUTING.md). It is the source of truth for proje - Work on a feature branch off `main`; do not commit to `main`. - Match this repo's commit authorship CI: human author/committer (no AI-tool identities or AI `Co-authored-by` trailers). +- Match commit verification CI: every commit must be GitHub-**Verified**. Do not leave Cursor-signed commits on a human author (`Unverified` / `unknown_key`); the human author must re-sign with their GitHub signing key before merge (see CONTRIBUTING "Commit signatures"). - Before review, run `/no-comments` on the diff. - Prefer the smallest change that satisfies CONTRIBUTING; do not expand scope. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 48b9ae16..24a9446c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -182,7 +182,7 @@ Rationale: [Lauren Tan (@poteto) on comments](https://x.com/poteto/status/211075 ## CI Pipeline -- All CI jobs (`test`, `mockup-syntax`, `lint`, `frontend`) run on `[self-hosted, Linux]` runners on every PR and push to `main`. +- All CI jobs (`test`, `mockup-syntax`, `lint`, `frontend`, commit authorship, commit verification) run on `[self-hosted, Linux]` runners on every PR (and the build jobs also on push to `main`). - macOS / Windows CI was removed in commit `9a0dae1` — cross-platform validation now lives in `.github/workflows/release.yml`. - All GitHub Actions must be SHA-pinned (no floating tags like `@v4`) @@ -191,6 +191,26 @@ Rationale: [Lauren Tan (@poteto) on comments](https://x.com/poteto/status/211075 - Commit messages must explain **why** the change is needed - Keep messages clear and informative +## Commit signatures + +Every commit on a pull request must show as **Verified** on GitHub. CI runs +`scripts/ci/check-commit-verification.sh` (workflow **Check commit verification**). + +- Sign with a GPG or SSH key registered to the commit author under + GitHub → Settings → SSH and GPG keys (**Signing keys**, not only Authentication). +- Enable signing locally (`git config commit.gpgsign true`, and for SSH: + `gpg.format ssh` + `user.signingkey` pointing at your public key). +- **Unverified** means the commit is signed, but GitHub does not trust the key + for that author (common reason: `unknown_key`). Cursor / Cloud Agent SSH + signatures on human-authored commits produce this badge — re-sign as the + author before review: + +```sh +# After your signing key is registered on GitHub: +git rebase --exec 'git commit --amend --no-edit -S' origin/main +git push --force-with-lease +``` + ## PR Checklist Before submitting: diff --git a/scripts/ci/check-commit-verification.sh b/scripts/ci/check-commit-verification.sh new file mode 100755 index 00000000..ac2c434a --- /dev/null +++ b/scripts/ci/check-commit-verification.sh @@ -0,0 +1,92 @@ +#!/usr/bin/env bash +# +# Fail if any commit in a range is not GitHub-verified (green Verified badge). +# Uses the GitHub Commits API — local git verify-commit is not enough, because +# GitHub only marks a signature verified when the signing key is registered to +# the commit author (or when GitHub itself signed the commit). +# +# Usage: check-commit-verification.sh [head-ref] +# check-commit-verification.sh +# +# Env: +# GITHUB_REPOSITORY owner/repo (required) +# GITHUB_TOKEN optional; raises API rate limits in Actions + +set -euo pipefail + +usage() { + echo "usage: $0 [head-ref]" >&2 + echo " $0 " >&2 + exit 2 +} + +[ "$#" -ge 1 ] || usage + +if [ "$#" -eq 1 ]; then + range="$1" +else + range="$1..${2:-HEAD}" +fi + +: "${GITHUB_REPOSITORY:?GITHUB_REPOSITORY must be set (owner/repo)}" + +if ! command -v jq >/dev/null 2>&1; then + echo "jq is required" >&2 + exit 2 +fi + +commits="$(git rev-list --no-merges "$range")" + +if [ -z "$commits" ]; then + echo "OK: no commits in range $range" + exit 0 +fi + +api="https://api.github.com/repos/${GITHUB_REPOSITORY}/commits" +auth_args=() +if [ -n "${GITHUB_TOKEN:-}" ]; then + auth_args=(-H "Authorization: Bearer ${GITHUB_TOKEN}") +fi + +violations=0 + +for sha in $commits; do + subject="$(git show -s --format='%s' "$sha")" + payload="$( + curl -sS \ + -H "Accept: application/vnd.github+json" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + "${auth_args[@]}" \ + "${api}/${sha}" + )" + + if ! printf '%s' "$payload" | jq -e '.commit.verification' >/dev/null 2>&1; then + violations=$((violations + 1)) + echo "FAILED: ${sha} ${subject}" + echo " could not read commit.verification from GitHub API" + msg="$(printf '%s' "$payload" | jq -r '.message // empty' 2>/dev/null || true)" + [ -n "$msg" ] && echo " api: ${msg}" + continue + fi + + verified="$(printf '%s' "$payload" | jq -r '.commit.verification.verified')" + reason="$(printf '%s' "$payload" | jq -r '.commit.verification.reason')" + + if [ "$verified" != "true" ]; then + violations=$((violations + 1)) + echo "FAILED: ${sha} ${subject}" + echo " verified: false (reason: ${reason})" + fi +done + +if [ "$violations" -gt 0 ]; then + echo + echo "${violations} commit(s) are not GitHub-verified in range ${range}." + echo "Sign each commit with a GPG or SSH key registered to the commit" + echo "author on GitHub (Settings → SSH and GPG keys → Signing keys), then" + echo "force-push. A Cursor/Cloud-Agent SSH signature on a human-authored" + echo "commit yields reason=unknown_key (Unverified) — re-sign as the author." + exit 1 +fi + +echo "OK: all $(echo "$commits" | wc -l | tr -d ' ') commit(s) are GitHub-verified." From 92b22e3db25c9b48b6ccf38a732c3107f8352dc4 Mon Sep 17 00:00:00 2001 From: Zhe Li Date: Wed, 18 Nov 2026 20:08:43 +0000 Subject: [PATCH 11/13] chore(ci): trim narration from commit-verification script header Align with CONTRIBUTING no-comments; keep Usage plus the GitHub-API platform constraint that local verify-commit cannot express. Co-authored-by: Zhe Li --- scripts/ci/check-commit-verification.sh | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/scripts/ci/check-commit-verification.sh b/scripts/ci/check-commit-verification.sh index ac2c434a..2961c052 100755 --- a/scripts/ci/check-commit-verification.sh +++ b/scripts/ci/check-commit-verification.sh @@ -1,16 +1,10 @@ #!/usr/bin/env bash # -# Fail if any commit in a range is not GitHub-verified (green Verified badge). -# Uses the GitHub Commits API — local git verify-commit is not enough, because -# GitHub only marks a signature verified when the signing key is registered to -# the commit author (or when GitHub itself signed the commit). +# Fail if any commit in a range is not GitHub-verified. +# GitHub's Commits API is authoritative; local git verify-commit is not. # # Usage: check-commit-verification.sh [head-ref] # check-commit-verification.sh -# -# Env: -# GITHUB_REPOSITORY owner/repo (required) -# GITHUB_TOKEN optional; raises API rate limits in Actions set -euo pipefail From 12fabd423fa506f81591f4d42fbacf7d835a93eb Mon Sep 17 00:00:00 2001 From: Zhe Li Date: Wed, 18 Nov 2026 20:13:15 +0000 Subject: [PATCH 12/13] ci: run commit verification on ubuntu-latest Use GitHub-hosted runners for the signature check instead of self-hosted. Co-authored-by: Zhe Li --- .github/workflows/commit-verification.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/commit-verification.yml b/.github/workflows/commit-verification.yml index ea34bbee..6d7ad290 100644 --- a/.github/workflows/commit-verification.yml +++ b/.github/workflows/commit-verification.yml @@ -9,7 +9,7 @@ permissions: jobs: check-verification: name: Check commit verification - runs-on: [self-hosted, Linux] + runs-on: [ubuntu-latest] steps: - name: Check out repository From 04a196d2521970fae0417672392ea2510c58cff9 Mon Sep 17 00:00:00 2001 From: Zhe Li Date: Thu, 19 Nov 2026 00:54:31 +0100 Subject: [PATCH 13/13] ci: merge authorship and verification into Check commits One PR workflow runs both scripts so the ruleset needs a single required status check instead of two overlapping commit gates. --- .github/workflows/commit-authorship.yml | 26 ------------------- ...mit-verification.yml => commit-checks.yml} | 14 +++++++--- AGENTS.md | 3 +-- CONTRIBUTING.md | 4 +-- 4 files changed, 13 insertions(+), 34 deletions(-) delete mode 100644 .github/workflows/commit-authorship.yml rename .github/workflows/{commit-verification.yml => commit-checks.yml} (65%) diff --git a/.github/workflows/commit-authorship.yml b/.github/workflows/commit-authorship.yml deleted file mode 100644 index ab4fff1b..00000000 --- a/.github/workflows/commit-authorship.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Commit Authorship - -on: - pull_request: - -permissions: - contents: read - -jobs: - check-authorship: - name: Check commit authorship - runs-on: [self-hosted, Linux] - - steps: - - name: Check out repository - # actions/checkout@v5 - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd - with: - # Full history so the base..head range is resolvable. - fetch-depth: 0 - - - name: Check commit author, committer, and co-author fields - env: - BASE_SHA: ${{ github.event.pull_request.base.sha }} - HEAD_SHA: ${{ github.event.pull_request.head.sha }} - run: scripts/ci/check-authorship.sh "$BASE_SHA" "$HEAD_SHA" diff --git a/.github/workflows/commit-verification.yml b/.github/workflows/commit-checks.yml similarity index 65% rename from .github/workflows/commit-verification.yml rename to .github/workflows/commit-checks.yml index 6d7ad290..c9b71e46 100644 --- a/.github/workflows/commit-verification.yml +++ b/.github/workflows/commit-checks.yml @@ -1,4 +1,4 @@ -name: Commit Verification +name: Commit Checks on: pull_request: @@ -7,9 +7,9 @@ permissions: contents: read jobs: - check-verification: - name: Check commit verification - runs-on: [ubuntu-latest] + check-commits: + name: Check commits + runs-on: ubuntu-latest steps: - name: Check out repository @@ -19,6 +19,12 @@ jobs: # Full history so the base..head range is resolvable. fetch-depth: 0 + - name: Check commit author, committer, and co-author fields + env: + BASE_SHA: ${{ github.event.pull_request.base.sha }} + HEAD_SHA: ${{ github.event.pull_request.head.sha }} + run: scripts/ci/check-authorship.sh "$BASE_SHA" "$HEAD_SHA" + - name: Check GitHub Verified badge on each commit env: BASE_SHA: ${{ github.event.pull_request.base.sha }} diff --git a/AGENTS.md b/AGENTS.md index 8fd51e48..2188ebaa 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -5,7 +5,6 @@ Follow [`CONTRIBUTING.md`](CONTRIBUTING.md). It is the source of truth for proje ## Agent workflow - Work on a feature branch off `main`; do not commit to `main`. -- Match this repo's commit authorship CI: human author/committer (no AI-tool identities or AI `Co-authored-by` trailers). -- Match commit verification CI: every commit must be GitHub-**Verified**. Do not leave Cursor-signed commits on a human author (`Unverified` / `unknown_key`); the human author must re-sign with their GitHub signing key before merge (see CONTRIBUTING "Commit signatures"). +- Match this repo's commit checks CI: human author/committer (no AI-tool identities or AI `Co-authored-by` trailers), and every commit GitHub-**Verified**. Do not leave Cursor-signed commits on a human author (`Unverified` / `unknown_key`); the human author must re-sign with their GitHub signing key before merge (see CONTRIBUTING "Commit signatures"). - Before review, run `/no-comments` on the diff. - Prefer the smallest change that satisfies CONTRIBUTING; do not expand scope. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 24a9446c..b6114c44 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -182,7 +182,7 @@ Rationale: [Lauren Tan (@poteto) on comments](https://x.com/poteto/status/211075 ## CI Pipeline -- All CI jobs (`test`, `mockup-syntax`, `lint`, `frontend`, commit authorship, commit verification) run on `[self-hosted, Linux]` runners on every PR (and the build jobs also on push to `main`). +- Build CI jobs (`test`, `mockup-syntax`, `lint`, `frontend`) run on `[self-hosted, Linux]` runners on every PR and push to `main`. Commit checks (`Check commits`: authorship + GitHub Verified) run on `ubuntu-latest` on every PR. - macOS / Windows CI was removed in commit `9a0dae1` — cross-platform validation now lives in `.github/workflows/release.yml`. - All GitHub Actions must be SHA-pinned (no floating tags like `@v4`) @@ -194,7 +194,7 @@ Rationale: [Lauren Tan (@poteto) on comments](https://x.com/poteto/status/211075 ## Commit signatures Every commit on a pull request must show as **Verified** on GitHub. CI runs -`scripts/ci/check-commit-verification.sh` (workflow **Check commit verification**). +`scripts/ci/check-commit-verification.sh` as part of workflow **Check commits**. - Sign with a GPG or SSH key registered to the commit author under GitHub → Settings → SSH and GPG keys (**Signing keys**, not only Authentication).