Skip to content

Commit 953df84

Browse files
committed
chore(ci): make github actions the merge gate
1 parent b7864c6 commit 953df84

9 files changed

Lines changed: 132 additions & 171 deletions

File tree

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Dependency Audit
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
paths:
7+
- package.json
8+
- bun.lock
9+
- .github/workflows/dependency-audit.yml
10+
push:
11+
branches: [main]
12+
paths:
13+
- package.json
14+
- bun.lock
15+
- .github/workflows/dependency-audit.yml
16+
schedule:
17+
- cron: "17 9 * * 1"
18+
workflow_dispatch:
19+
20+
permissions:
21+
contents: read
22+
23+
concurrency:
24+
group: dependency-audit-${{ github.event.pull_request.number || github.ref }}
25+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
26+
27+
jobs:
28+
lockfile:
29+
name: Check Bun lockfile
30+
runs-on: ubuntu-latest
31+
timeout-minutes: 5
32+
steps:
33+
- uses: actions/checkout@v4
34+
- uses: ./.github/actions/setup-bun
35+
36+
- name: Verify lockfile is current
37+
run: bun install --frozen-lockfile --dry-run
38+
39+
audit:
40+
name: Audit dependencies
41+
runs-on: ubuntu-latest
42+
timeout-minutes: 10
43+
continue-on-error: true
44+
steps:
45+
- uses: actions/checkout@v4
46+
- uses: ./.github/actions/setup-bun
47+
48+
- name: Run Bun audit
49+
run: |
50+
set +e
51+
bun audit --audit-level=moderate | tee audit.txt
52+
status="${PIPESTATUS[0]}"
53+
{
54+
echo "## Bun Audit"
55+
echo
56+
echo '```text'
57+
cat audit.txt
58+
echo '```'
59+
} >> "$GITHUB_STEP_SUMMARY"
60+
exit "$status"

.github/workflows/validate.yml

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,68 @@
1-
name: Validate
1+
name: CI
22

33
on:
44
push:
55
branches: [main]
66
pull_request:
7+
branches: [main]
8+
workflow_dispatch:
9+
10+
concurrency:
11+
group: ci-${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
permissions:
15+
contents: read
716

817
jobs:
18+
build:
19+
name: Build
20+
runs-on: ubuntu-latest
21+
timeout-minutes: 15
22+
steps:
23+
- uses: actions/checkout@v4
24+
- uses: ./.github/actions/setup-bun
25+
26+
- name: Build packages
27+
run: bun run build
28+
29+
typecheck:
30+
name: Typecheck
31+
runs-on: ubuntu-latest
32+
timeout-minutes: 15
33+
steps:
34+
- uses: actions/checkout@v4
35+
- uses: ./.github/actions/setup-bun
36+
37+
- name: Typecheck packages
38+
run: bun run typecheck
39+
40+
lint:
41+
name: Lint
42+
runs-on: ubuntu-latest
43+
timeout-minutes: 10
44+
steps:
45+
- uses: actions/checkout@v4
46+
- uses: ./.github/actions/setup-bun
47+
48+
- name: Run Biome
49+
run: bun run lint
50+
51+
test:
52+
name: Test
53+
runs-on: ubuntu-latest
54+
timeout-minutes: 20
55+
steps:
56+
- uses: actions/checkout@v4
57+
- uses: ./.github/actions/setup-bun
58+
59+
- name: Run tests
60+
run: bun run test
61+
962
links:
1063
name: Check Links
1164
runs-on: ubuntu-latest
65+
timeout-minutes: 10
1266
steps:
1367
- uses: actions/checkout@v4
1468

@@ -25,6 +79,7 @@ jobs:
2579
marketplace:
2680
name: Validate Marketplace
2781
runs-on: ubuntu-latest
82+
timeout-minutes: 10
2883
steps:
2984
- uses: actions/checkout@v4
3085
- uses: ./.github/actions/setup-bun
@@ -41,6 +96,7 @@ jobs:
4196
evals:
4297
name: Validate Evals
4398
runs-on: ubuntu-latest
99+
timeout-minutes: 15
44100
steps:
45101
- uses: actions/checkout@v4
46102
- uses: ./.github/actions/setup-bun

.pre-commit-config.yaml

Lines changed: 0 additions & 55 deletions
This file was deleted.

AGENTS.md

Lines changed: 9 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -257,47 +257,23 @@ If you spot a camelCase key already on disk or in a response (e.g. a legacy endp
257257

258258
## Testing & Verification
259259

260-
### Pre-Push Hooks (Automated)
260+
### CI Gates
261261

262-
The repository uses [prek](https://github.com/nickel-lang/prek) (`@j178/prek`) for Git hooks. Pre-commit hooks sync Beads JSONL before commits, and pre-push hooks automatically run build, typecheck, lint, tests, and example validation before pushing. **Do not manually run the pre-push checks before pushing** — just push to the feature branch and let the pre-push hook validate.
262+
GitHub Actions is the authoritative merge gate. The `CI` workflow runs build, typecheck, lint, tests, marketplace checks, docs link checks, and eval schema validation on pushes to `main`, pull requests to `main`, and manual dispatches.
263263

264-
**Setup (automatic):**
265-
The hooks are installed automatically when you run `bun install` via the `prepare` script. To manually install:
264+
Run the same core checks locally when you need fast feedback:
266265
```bash
267-
bunx prek install -t pre-commit -t pre-push
266+
bun run verify
267+
bun run validate:examples
268268
```
269269

270-
**What runs before commit:**
271-
- `br sync --flush-only` - Export Beads DB state to tracked JSONL when `br` is installed
272-
- `.beads/` cleanliness check - If sync changes `.beads/`, stage those changes and commit again
270+
Beads sync is explicit. If you change the Beads graph, run `br sync --flush-only`, stage `.beads/`, and include the exported JSONL in the commit. Hooks must not silently mutate or stash shared worktrees.
273271

274-
**What runs on push:**
275-
- `.beads/` cleanliness check - Re-runs Beads sync when `br` is installed and blocks pushes with uncommitted Beads state
276-
- `bun run build` - Build all packages
277-
- `bun run typecheck` - TypeScript type checking
278-
- `bun run lint` - Biome linting
279-
- `bun run test` - All tests
280-
- `bun run validate:examples` - Validate example eval YAML files against the agentv schema
272+
NTM hooks are optional local coordination tooling. Do not commit generated `.beads/hooks/*` files or local `.ntm/config.toml`; they embed machine-specific paths and can bypass the repo's normal Git behavior when installed via `core.hooksPath`.
281273

282-
If any check fails, the push is blocked until the issues are fixed.
283-
284-
**Docs-only exception:**
285-
For changes that only touch documentation, comments, or repository instructions and cannot affect runtime behavior, push with `--no-verify` to skip the full pre-push suite:
286-
```bash
287-
git push --no-verify
288-
```
289-
290-
**Manual run (without pushing):**
291-
```bash
292-
bunx prek run --all-files --stage pre-push
293-
```
294-
295-
NTM hooks are optional local coordination tooling. Do not commit generated `.beads/hooks/*` files or local `.ntm/config.toml`; they embed machine-specific paths and can bypass the repo's prek hooks when installed via `core.hooksPath`.
296-
297-
If an existing checkout has NTM hooks installed, restore the repo-standard prek hook path before reinstalling:
274+
If an existing checkout has NTM or prek hooks installed, restore Git's default hook path:
298275
```bash
299276
git config --unset core.hooksPath
300-
bun install
301277
```
302278

303279
### Functional Testing (CLI)
@@ -566,7 +542,7 @@ Both steps are required before running builds, tests, or evals in the worktree.
566542

567543
### After Checking Out an Existing Branch or PR
568544

569-
Whenever you `git checkout`, `gh pr checkout`, `git pull`, or otherwise switch to a ref that may have changed `package.json` / `bun.lock`, run `bun install` before building, testing, or pushing. The pre-push hook builds all workspaces — if dependencies are stale, the push fails with errors like `Cannot find module 'recharts'` even though the source change is unrelated. `bun install` is cheap when already up-to-date, so run it by default after any ref switch.
545+
Whenever you `git checkout`, `gh pr checkout`, `git pull`, or otherwise switch to a ref that may have changed `package.json` / `bun.lock`, run `bun install` before building or testing. If dependencies are stale, CI/local checks can fail with errors like `Cannot find module 'recharts'` even though the source change is unrelated. `bun install` is cheap when already up-to-date, so run it by default after any ref switch.
570546

571547
## Version Management
572548

CONTRIBUTING.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ Also ensure:
3737
- PR explains what changed and why
3838
- tests/docs are updated when relevant
3939
- no unrelated refactors in the same PR
40-
- prek hooks pass (`br sync --flush-only` runs before commit when available; `build`, `typecheck`, `lint`, `test` run automatically on push)
40+
- CI-relevant checks pass locally when needed (`bun run verify` and `bun run validate:examples`)
41+
- Beads changes are exported with `br sync --flush-only` and staged under `.beads/`
4142

4243
## Workflow
4344

apps/cli/test/setup-core-build.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
* is slow and hides staleness issues — we simply verify dist exists and
77
* fail fast with a clear message if it doesn't.
88
*
9-
* The pre-push hook runs `bun run build` before `bun run test`, so dist
10-
* is always available in the normal workflow. For ad-hoc runs, build first:
9+
* CI runs `bun run build` before `bun run test`, so dist is available in
10+
* the normal merge gate. For ad-hoc local runs, build first:
1111
*
1212
* bun run --filter @agentv/core build && bun --filter agentv test
1313
*/

0 commit comments

Comments
 (0)