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
14 changes: 14 additions & 0 deletions .cursor/rules/pstack-models.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
description: pstack per-role model choices (overrides skill defaults)
alwaysApply: true
---
# budget: small (medium)
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Commit Authorship
name: Commit Checks

on:
pull_request:
Expand All @@ -7,9 +7,9 @@ permissions:
contents: read

jobs:
check-authorship:
name: Check commit authorship
runs-on: [self-hosted, Linux]
check-commits:
name: Check commits
runs-on: ubuntu-latest

steps:
- name: Check out repository
Expand All @@ -24,3 +24,11 @@ jobs:
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 }}
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"
15 changes: 2 additions & 13 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,32 +1,24 @@
# Build artifacts
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
.cursor/
.claude/
AGENTS.md
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.
# 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
Expand All @@ -35,10 +27,7 @@ internal/ui/dist/*
!internal/ui/dist/index.html
.worktrees/

# worktrunk configs
.config/wt.toml

# workspace files
*.code-workspace
.omo/
/artifacts/
10 changes: 10 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Agent instructions

Follow [`CONTRIBUTING.md`](CONTRIBUTING.md). It is the source of truth for project conventions, including the no-comments policy.

## Agent workflow

- Work on a feature branch off `main`; do not commit to `main`.
- 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.
41 changes: 38 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <inst> <c>`. 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 — <description>` 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

Expand Down Expand Up @@ -158,6 +158,21 @@ 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.

Rationale: [Lauren Tan (@poteto) on comments](https://x.com/poteto/status/2110758788525621282).

## Architecture Notes

- **Entry point:** `cmd/canton-devkit/main.go`
Expand All @@ -167,7 +182,7 @@ Rules:

## CI Pipeline

- All CI jobs (`test`, `mockup-syntax`, `lint`, `frontend`) run on `[self-hosted, Linux]` runners on every PR and 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`)

Expand All @@ -176,6 +191,26 @@ Rules:
- 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` 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).
- 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:
Expand All @@ -185,4 +220,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.
86 changes: 86 additions & 0 deletions scripts/ci/check-commit-verification.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
#!/usr/bin/env bash
#
# 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 <base-ref> [head-ref]
# check-commit-verification.sh <revision-range>

set -euo pipefail

usage() {
echo "usage: $0 <base-ref> [head-ref]" >&2
echo " $0 <revision-range>" >&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."
Loading