ci: use cheaper review model and cache pipeline installs
PR Check / Security scan (Snyk) (pull_request) Skipped
PR Check / Lint + typecheck (pull_request) Successful in 1m42s
PR Check / Secret scan (gitleaks) (pull_request) Successful in 6s
PR Check / Dependency audit (pull_request) Successful in 9s
PR Check / Dockerfile lint (droast) (pull_request) Successful in 5s
PR Check / AI code review (opencode) (pull_request) Successful in 45s

- review model: opencode-go/claude-haiku-5-5#medium instead of
  deepseek-v4.1-flash#max; flash has no medium variant
- merge lint and typecheck into one job with a single pnpm install
- cache the pnpm store and opencode binary via actions/cache@v4.1.0,
  keyed on a sha256 of the lockfile (hashFiles is empty on this runner)
- update the decision records and log
This commit is contained in:
Noel Sabia committed 2026-10-20 20:56:52 +02:00
1 parent 71b73aacc8
commit fa8fafb7ef
5 files changed
+110 -44

No files matched your search

+22 -4
View File
@@ -22,9 +22,10 @@ Every pull request is checked by three layers, ordered by cost:
1. **Pre-commit hooks** (local, seconds, deterministic): gitleaks, file
hygiene, conventional-commit check, actionlint, eslint --fix on staged
files. A commit that fails here never exists.
2. **Gitea Actions** (per PR push, minutes): ESLint, vue-tsc typecheck,
gitleaks over full history, pnpm audit (blocking), droast Dockerfile
lint, Snyk (currently disabled).
2. **Gitea Actions** (per PR push, minutes): ESLint + vue-tsc typecheck
in one job (one install, cached pnpm store), gitleaks over full
history, pnpm audit (blocking), droast Dockerfile lint, Snyk
(currently disabled).
3. **AI code review** (per PR push): opencode with a plan-covered model,
verdict-based, posted as a PR comment.
@@ -42,6 +43,23 @@ sees intent, contracts and cross-file consequences that no linter can. The
ordering also protects the budget: the AI review only runs for code that
already passed the deterministic gates.
# Caching
Two caches, both served by the runner's own cache server (no external
service, entries stay on the home server):
* **pnpm store**, keyed on the store layout version (v11) and a `sha256sum`
of `pnpm-lock.yaml`. Installs hardlink from the store instead of
downloading tarballs again. The key is built in a shell step because
`hashFiles()` evaluates empty in this act runner.
* **opencode binary**, keyed on the pinned CLI version (`~/.opencode/bin`).
Small next to the model call, but it removes a network fetch per review.
Lint and typecheck also share one job: same image, same lockfile, same
install. Splitting them duplicated the install and made both compete for
the runner's two vCPUs. A future `pnpm build` job reuses the same store
cache key.
# What the pipeline bought us in practice
Recorded so the reasoning survives: during the first week the pipeline
@@ -57,7 +75,7 @@ exposure in the review setup — each fixed where it was cheapest.
|---|---|
| Error logs posted as review comments | Posting gate is the output contract (a `VERDICT:` line), not the exit code |
| Vendor container images without arm64 manifests | Binaries installed arch-aware in `node:22-bookworm`, never vendor CI images |
| `hashFiles()` silently empty in the act runner | File discovery via `find` in a step, not workflow expressions |
| `hashFiles()` silently empty in the act runner | File discovery via `find` and cache keys via `sha256sum`, both in shell steps - never workflow expressions |
| Silent advisory failures | `continue-on-error` removed everywhere; a failed check is red |
| Supply-chain (curl-piped binaries) | Pinned versions, checksums pinned in the workflow |