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
12 changes: 7 additions & 5 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@

## Testing

- [ ] `forge build --sizes`
- [ ] `npx hardhat compile`
- [ ] `forge test` (if applicable)
- [ ] `npm test` (if applicable)
- [ ] `./scripts/fast-check.sh`

## Deploy Evidence

- URL (or `N/A` with reason):

## Checklist

- [ ] Feature/bug changes include tests
- [ ] Fast-check gate passed locally
- [ ] No secrets committed (for example `.env`, private keys, API keys)
- [ ] If `AppStorage` changed: append-only (no reordering/removals/type changes)
- [ ] Diamond auth paths use the correct sender pattern (`LibMeta.msgSender()` vs `msg.sender`)
- [ ] Docs updated (if behavior or public API changed)

36 changes: 36 additions & 0 deletions .github/workflows/fast-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: fast-check

on:
pull_request:
workflow_dispatch:

concurrency:
group: fast-check-${{ github.ref }}
cancel-in-progress: true

env:
FOUNDRY_PROFILE: ci

jobs:
fast-check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: npm

- name: Install dependencies
run: npm ci

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Run fast-check gate
run: ./scripts/fast-check.sh
32 changes: 32 additions & 0 deletions .github/workflows/post-merge-recap.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: post-merge-recap

on:
push:
branches:
- main
- master
workflow_dispatch:

permissions:
contents: read

jobs:
recap:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Generate recap
run: ./scripts/post-merge-recap.sh "${{ github.event.before }}" "${{ github.sha }}" > post-merge-recap.md

- name: Publish step summary
run: cat post-merge-recap.md >> "$GITHUB_STEP_SUMMARY"

- name: Upload recap artifact
uses: actions/upload-artifact@v4
with:
name: post-merge-recap
path: post-merge-recap.md
38 changes: 38 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,41 @@ Externally, users typically call the diamond address with facet ABIs. Selector r
- Use a branch name with `codex/` prefix.
- Keep changes scoped to one concern per PR when possible.
- Include a short test section in the PR description (what you ran locally).

## Workflow Velocity Upgrades (2026-02-16)

### Definition Of Done

- Bug fixes and features must ship via PR.
- PRs must include tests that cover the change.
- PRs must include deployment evidence when applicable (URL or explicit `N/A` reason in PR body).

### Start-Task Preflight

Use the global preflight command before major work:

```bash
cstart <task-slug>
```

### Fast Check Gate

```bash
./scripts/fast-check.sh
```

Default checks:

- `forge build --sizes`
- `npx hardhat compile`
- `npm test`

### PR Automation

```bash
./scripts/open-pr.sh
```

### Post-Merge Recap

`post-merge-recap` runs on pushes to `main`/`master` and uploads a markdown recap artifact.
11 changes: 11 additions & 0 deletions scripts/fast-check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -euo pipefail

forge build --sizes
npx hardhat compile

if [ "$#" -gt 0 ]; then
npx hardhat test "$@"
else
npm test
fi
61 changes: 61 additions & 0 deletions scripts/open-pr.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#!/usr/bin/env bash
set -euo pipefail

if ! command -v gh >/dev/null 2>&1; then
echo "GitHub CLI (gh) is required." >&2
exit 1
fi

if ! git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
echo "Run this command inside a git repository." >&2
exit 1
fi

branch="$(git rev-parse --abbrev-ref HEAD)"
case "$branch" in
main|master)
echo "Refusing to open PR from protected branch '$branch'. Create/use a feature branch." >&2
exit 1
;;
esac

if git rev-parse --verify --quiet "refs/remotes/origin/$branch" >/dev/null; then
git push
else
git push -u origin HEAD
fi

base="${BASE_BRANCH:-$(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's@^refs/remotes/origin/@@')}"
if [ -z "$base" ]; then
base="master"
fi

title="${PR_TITLE:-$(git log -1 --pretty=%s)}"

body_file="$(mktemp)"
cat > "$body_file" <<'BODY'
## Summary

## Testing

- [ ] `./scripts/fast-check.sh`

## Deploy Evidence

- URL (or `N/A` with reason):

## Checklist

- [ ] Feature/bug changes include tests
- [ ] Fast-check gate passed locally
- [ ] Deploy evidence included
BODY

existing_pr="$(gh pr list --head "$branch" --base "$base" --state open --json number --jq '.[0].number')"

if [ -n "$existing_pr" ] && [ "$existing_pr" != "null" ]; then
gh pr edit "$existing_pr" --title "$title" --body-file "$body_file"
gh pr view "$existing_pr" --json url --jq '.url'
else
gh pr create --base "$base" --head "$branch" --title "$title" --body-file "$body_file"
fi
44 changes: 44 additions & 0 deletions scripts/post-merge-recap.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/usr/bin/env bash
set -euo pipefail

before="${1:-}"
after="${2:-HEAD}"
zero="0000000000000000000000000000000000000000"

if [ -n "$before" ] && [ "$before" != "$zero" ]; then
range="$before..$after"
else
range="$after~20..$after"
fi

echo "# Post-Merge Recap"
echo
echo "- Repository: $(basename "$(git rev-parse --show-toplevel)")"
echo "- Generated: $(date -u +"%Y-%m-%dT%H:%M:%SZ")"
echo "- Range: $range"
echo
echo "## Commits"
commits="$(git log --no-merges --pretty='- %h %s (%an)' "$range" 2>/dev/null || true)"
if [ -n "$commits" ]; then
echo "$commits"
else
echo "- No non-merge commits in range."
fi

echo
echo "## Merge Commits"
merges="$(git log --merges --pretty='- %h %s (%an)' "$range" 2>/dev/null || true)"
if [ -n "$merges" ]; then
echo "$merges"
else
echo "- No merge commits in range."
fi

echo
echo "## Referenced PRs"
prs="$(git log --pretty='%s' "$range" 2>/dev/null | grep -Eo '#[0-9]+' | sort -u || true)"
if [ -n "$prs" ]; then
printf '%s\n' "$prs" | sed 's/^/- /'
else
echo "- None found in commit subjects."
fi
Loading