fix(ci): use opencode-go plan model for AI review #5

Merged
Noel merged 14 commits from fix/ai_pr_review into main 2026-10-18 16:24:58 +00:00
Owner

The 'opencode' provider prefix points at OpenCode Zen (pay-per-call,
no funds), which failed every review run with 'Insufficient account
funds'. The opencode-go $10 plan covers deepseek-v4-pro with high
and max variants - use opencode-go/deepseek-v4-pro#max.

The 'opencode' provider prefix points at OpenCode Zen (pay-per-call, no funds), which failed every review run with 'Insufficient account funds'. The opencode-go $10 plan covers deepseek-v4-pro with high and max variants - use opencode-go/deepseek-v4-pro#max.
Noel added 1 commit 2026-10-18 14:53:34 +00:00
fix(ci): use opencode-go plan model for AI review
PR Check / Dockerfile lint (droast) (pull_request) Skipped
PR Check / Security scan (Snyk) (pull_request) Skipped
PR Check / ESLint (pull_request) Successful in 34s
PR Check / Typecheck (pull_request) Successful in 38s
PR Check / Secret scan (gitleaks) (pull_request) Successful in 5s
PR Check / Dependency audit (pull_request) Successful in 8s
PR Check / AI code review (opencode) (pull_request) Failing after 13s
8b6bcb6d70
The 'opencode' provider prefix points at OpenCode Zen (pay-per-call,
no funds), which failed every review run with 'Insufficient account
funds'. The opencode-go $10 plan covers deepseek-v4-pro with high
and max variants - use opencode-go/deepseek-v4-pro#max.
Noel added 1 commit 2026-10-18 14:57:48 +00:00
main changed the review model to the default thinking budget; keep
opencode-go/deepseek-v4-pro#max (plan-included, max effort) which
supersedes both earlier variants.
Noel added 1 commit 2026-10-18 14:58:11 +00:00
fix: remove leftover merge conflict marker from pr-checker.yml
PR Check / Dockerfile lint (droast) (pull_request) Skipped
PR Check / Security scan (Snyk) (pull_request) Skipped
PR Check / ESLint (pull_request) Successful in 35s
PR Check / Typecheck (pull_request) Successful in 37s
PR Check / Secret scan (gitleaks) (pull_request) Successful in 6s
PR Check / Dependency audit (pull_request) Successful in 8s
PR Check / AI code review (opencode) (pull_request) Failing after 11s
8f36f14720
Noel added 1 commit 2026-10-18 15:04:16 +00:00
ci: make dependency audit blocking, log opencode errors
PR Check / Dockerfile lint (droast) (pull_request) Skipped
PR Check / Security scan (Snyk) (pull_request) Skipped
PR Check / ESLint (pull_request) Successful in 34s
PR Check / Typecheck (pull_request) Successful in 37s
PR Check / Secret scan (gitleaks) (pull_request) Successful in 5s
PR Check / Dependency audit (pull_request) Failing after 8s
PR Check / AI code review (opencode) (pull_request) Failing after 13s
a6761fae9a
- audit no longer runs with continue-on-error: a failed audit must
  turn the pipeline red, not pass silently
- opencode review runs with --print-logs so auth and provider errors
  (e.g. invalid API key vs missing Go subscription) appear in the job
  log instead of an opaque exit 1
Noel added 1 commit 2026-10-18 15:08:47 +00:00
ci: bind opencode API key explicitly via opencode.json
PR Check / Dockerfile lint (droast) (pull_request) Skipped
PR Check / Security scan (Snyk) (pull_request) Skipped
PR Check / ESLint (pull_request) Successful in 35s
PR Check / Typecheck (pull_request) Successful in 37s
PR Check / Secret scan (gitleaks) (pull_request) Successful in 6s
PR Check / Dependency audit (pull_request) Failing after 9s
PR Check / AI code review (opencode) (pull_request) Failing after 11s
5f1d64db90
The headless CI container has no stored credentials, so auth depends
entirely on the injected key. Generate an opencode.json at runtime
that binds OPENCODE_API_KEY to the opencode-go provider explicitly,
removing any dependence on env-var-to-provider mapping behavior.
Noel added 1 commit 2026-10-18 15:11:33 +00:00
fix(ci): make droast job actually run
PR Check / Security scan (Snyk) (pull_request) Skipped
PR Check / ESLint (pull_request) Successful in 35s
PR Check / Typecheck (pull_request) Successful in 37s
PR Check / Secret scan (gitleaks) (pull_request) Successful in 5s
PR Check / Dependency audit (pull_request) Failing after 9s
PR Check / Dockerfile lint (droast) (pull_request) Failing after 5s
PR Check / AI code review (opencode) (pull_request) Failing after 12s
cf6f209ebf
The dockerfile-lint job skipped on every PR despite Dockerfiles
existing: the act runner's hashFiles() evaluation returned empty.
Replace it with an explicit file-discovery step. Also run the droast
binary in node:22-bookworm (arch-aware install) instead of the
vendor image, which ships no node and would fail actions/checkout
with exit 127 - same failure mode as the gitleaks image.
Noel added 1 commit 2026-10-18 15:18:55 +00:00
fix(ci): install opencode v2 for the review job
PR Check / Security scan (Snyk) (pull_request) Skipped
PR Check / ESLint (pull_request) Successful in 34s
PR Check / Typecheck (pull_request) Successful in 37s
PR Check / Secret scan (gitleaks) (pull_request) Successful in 6s
PR Check / Dependency audit (pull_request) Failing after 8s
PR Check / Dockerfile lint (droast) (pull_request) Failing after 4s
PR Check / AI code review (opencode) (pull_request) Failing after 2m43s
783c9ccda3
The classic installer (opencode.ai/install) ships only OpenCode 1.x
- v1.19.3 on arm64 - which cannot resolve model variants and failed
with ProviderModelNotFoundError for deepseek-v4-pro#max. Use the v2
installer (currently v2.0.32, same version as local dev); verified
working in a fresh arm64 container with key-only auth.
Noel added 1 commit 2026-10-18 15:34:18 +00:00
fix(ci): deny write tools, never swallow review errors
PR Check / Security scan (Snyk) (pull_request) Skipped
PR Check / ESLint (pull_request) Successful in 34s
PR Check / Typecheck (pull_request) Successful in 37s
PR Check / Secret scan (gitleaks) (pull_request) Successful in 6s
PR Check / Dependency audit (pull_request) Failing after 8s
PR Check / Dockerfile lint (droast) (pull_request) Failing after 4s
PR Check / AI code review (opencode) (pull_request) Successful in 3m9s
f8d128705f
- deny edit/bash/webfetch in the generated opencode.json: headless
  permission prompts are the most likely cause of the review agent
  working silently for minutes and then dying; denying write tools
  also makes the reviewer provably read-only
- capture the exit code without triggering 'set -e' ('|| EXIT_CODE=$?')
  so the captured output is always printed before failing - the
  previous version aborted before 'cat' and produced silent failures
Author
Owner



build · deepseek-v4-pro
→ Read .pr-review-diff.patch
build · deepseek-v4-pro
→ Read .gitea/workflows/pr-checker.yml
build · deepseek-v4-pro
Reviewing the diff, all changes are in .gitea/workflows/pr-checker.yml (CI workflow logic/security). Findings:

[BLOCKER] .gitea/workflows/pr-checker.yml:249-261 - The OPENCODE_API_KEY secret is written in plaintext into opencode.json in the repo checkout, then the review agent runs with file-read access to that workspace, and its output is posted verbatim as a PR comment (lines 345-360 read all of /tmp/review.md, including --print-logs output, into the comment body with no redaction). The PR diff itself (attacker-controlled content) mentions opencode.json, inviting the agent to read it, and a malicious PR can prompt-inject the agent into quoting the file's apiKey in the review output - exfiltrating the credential to anyone who can see the PR. The permission: edit/bash/webfetch deny config does not stop this: reading files and posting output are outside that permission system. Fix: drop the opencode.json generation entirely and rely on the exported env var (the agent cannot reach process env since bash is denied), or at minimum write the config outside the checkout (e.g. $HOME/.config/opencode/opencode.json, chmod 600) and trap 'rm -f ...' EXIT.

[WARN] .gitea/workflows/pr-checker.yml:133-136 - The droast binary is downloaded and executed as root with no integrity verification (and no longer from the publisher's own container image). A compromised release or MITM on the mirror would run arbitrary code inside CI. Fix: pin and verify a SHA256 checksum from the release's checksums file before chmod +x.

[WARN] .gitea/workflows/pr-checker.yml:218 - curl -fsSL ... | bash fetches the latest opencode v2 with no version pin and no checksum. The removed OPENCODE_VERSION env was only ever "latest", so nothing is actually pinned; a breaking v2 release will fail this job mid-PR, and the unauthenticated-installer pattern is a supply-chain risk. Fix: pin a specific version the installer accepts (or download a release asset and verify its checksum like droast/gitleaks).

[NIT] .gitea/workflows/pr-checker.yml:249-261 - The printf-based JSON generation does no escaping: if the API key ever contains " or \, opencode.json becomes invalid JSON and opencode fails opaquely - the exact failure mode the "belt and suspenders" aims to prevent. Fix: jq -n --arg k "$OPENCODE_API_KEY" '{...}' (via node, since jq is absent, as done at line 354).

[NIT] .gitea/workflows/pr-checker.yml:337-339 - On failure, cat /tmp/review.md dumps raw provider error text into CI logs; since the file may contain the config/key path from --print-logs, prefer grepping out or truncating error output rather than full echo, as a defense-in-depth complement to the BLOCKER fix.

VERDICT: REQUEST_CHANGES

 > build · deepseek-v4-pro → Read .pr-review-diff.patch > build · deepseek-v4-pro → Read .gitea/workflows/pr-checker.yml > build · deepseek-v4-pro Reviewing the diff, all changes are in `.gitea/workflows/pr-checker.yml` (CI workflow logic/security). Findings: [BLOCKER] .gitea/workflows/pr-checker.yml:249-261 - The `OPENCODE_API_KEY` secret is written in plaintext into `opencode.json` in the repo checkout, then the review agent runs with file-read access to that workspace, and its output is posted verbatim as a PR comment (lines 345-360 read all of `/tmp/review.md`, including `--print-logs` output, into the comment body with no redaction). The PR diff itself (attacker-controlled content) mentions `opencode.json`, inviting the agent to read it, and a malicious PR can prompt-inject the agent into quoting the file's `apiKey` in the review output - exfiltrating the credential to anyone who can see the PR. The `permission: edit/bash/webfetch deny` config does not stop this: reading files and posting output are outside that permission system. Fix: drop the `opencode.json` generation entirely and rely on the exported env var (the agent cannot reach process env since bash is denied), or at minimum write the config outside the checkout (e.g. `$HOME/.config/opencode/opencode.json`, chmod 600) and `trap 'rm -f ...' EXIT`. [WARN] .gitea/workflows/pr-checker.yml:133-136 - The droast binary is downloaded and executed as root with no integrity verification (and no longer from the publisher's own container image). A compromised release or MITM on the mirror would run arbitrary code inside CI. Fix: pin and verify a SHA256 checksum from the release's checksums file before `chmod +x`. [WARN] .gitea/workflows/pr-checker.yml:218 - `curl -fsSL ... | bash` fetches the latest opencode v2 with no version pin and no checksum. The removed `OPENCODE_VERSION` env was only ever "latest", so nothing is actually pinned; a breaking v2 release will fail this job mid-PR, and the unauthenticated-installer pattern is a supply-chain risk. Fix: pin a specific version the installer accepts (or download a release asset and verify its checksum like droast/gitleaks). [NIT] .gitea/workflows/pr-checker.yml:249-261 - The `printf`-based JSON generation does no escaping: if the API key ever contains `"` or `\`, `opencode.json` becomes invalid JSON and opencode fails opaquely - the exact failure mode the "belt and suspenders" aims to prevent. Fix: `jq -n --arg k "$OPENCODE_API_KEY" '{...}'` (via node, since jq is absent, as done at line 354). [NIT] .gitea/workflows/pr-checker.yml:337-339 - On failure, `cat /tmp/review.md` dumps raw provider error text into CI logs; since the file may contain the config/key path from `--print-logs`, prefer grepping out or truncating error output rather than full echo, as a defense-in-depth complement to the BLOCKER fix. VERDICT: REQUEST_CHANGES
Noel added 1 commit 2026-10-18 15:54:07 +00:00
fix(ci): address AI review findings (credentials, supply chain)
PR Check / Security scan (Snyk) (pull_request) Skipped
PR Check / ESLint (pull_request) Successful in 33s
PR Check / Typecheck (pull_request) Successful in 38s
PR Check / Secret scan (gitleaks) (pull_request) Successful in 5s
PR Check / Dependency audit (pull_request) Failing after 9s
PR Check / Dockerfile lint (droast) (pull_request) Failing after 4s
PR Check / AI code review (opencode) (pull_request) Failing after 3m9s
85f488a94d
- [BLOCKER] remove opencode.json from the checkout: it held the API
  key in plaintext, readable by the review agent, and a malicious PR
  diff could prompt-inject the agent into quoting it in the publicly
  visible review comment. Env-only auth (verified headless). The
  permission config moves to $HOME/.config/opencode - outside the
  checkout and secret-free.
- [WARN] verify the droast binary against the publisher's
  sha256sums.txt of the same pinned release
- [WARN] pin the opencode v2 installer to 2.0.32

Findings validated with the validate-pr-review skill; findings 4/5
are moot with the blocker fix.
Noel added 1 commit 2026-10-18 16:01:15 +00:00
fix(ci): apply review findings round two
PR Check / Security scan (Snyk) (pull_request) Skipped
PR Check / ESLint (pull_request) Successful in 36s
PR Check / Typecheck (pull_request) Successful in 39s
PR Check / Secret scan (gitleaks) (pull_request) Successful in 6s
PR Check / Dependency audit (pull_request) Failing after 9s
PR Check / Dockerfile lint (droast) (pull_request) Failing after 5s
PR Check / AI code review (opencode) (pull_request) Successful in 4m17s
a3e6aef901
- droast: chmod +x was lost in the checksum rewrite (would have
  failed with exit 126); checksums now pinned in the workflow
  instead of trust-on-first-use
- permission config migrated to the OpenCode v2 schema (permissions
  array, bash renamed shell, websearch and external_directory denied)
- posting gate is now the output contract (verdict line present)
  instead of the exit code: opencode can exit 1 on benign tool
  denials after a completed review
- find -print -quit instead of piping into head (SIGPIPE, exit 141)
- audit comment now says to re-add continue-on-error
Author
Owner



build · deepseek-v4-pro
→ Read .pr-review-diff.patch
build · deepseek-v4-pro
→ Read .pr-review-diff.patch [offset=163]
build · deepseek-v4-pro
→ Read .gitea/workflows/pr-checker.yml
$ bash -e -c '[ 0 -ne 0 ] && echo warn; echo after' ; echo "outer-exit: $?"; uname -m
after
outer-exit: 0
aarch64
build · deepseek-v4-pro
The diff is a CI workflow change (.gitea/workflows/pr-checker.yml). Let me verify the claimed droast SHA256 hashes against the real release assets and check the binary's flags, since a wrong hash or flag breaks the job.
$ bash -e -c 'false && echo x; echo y'; echo "false-&&-exit: $?"
y
false-&&-exit: 0
$ cd /tmp/opencode && for a in x86_64 arm64; do curl -fsSL -o droast-$a "https://github.com/immanuell/dockerfile-roast/releases/download/1.7.0/droast-linux-$a" && sha256sum droast-$a; done
curl: (22) The requested URL returned error: 404
curl: (22) The requested URL returned error: 404
build · deepseek-v4-pro
✗ WebFetch https://api.github.com/repos/immanuell/dockerfile-roast/releases/tags/1.7.0 failed
Error: StatusCode: non 2xx status code (404 GET https://api.github.com/repos/immanuell/dockerfile-roast/releases/tags/1.7.0)
build · deepseek-v4-pro
✗ WebFetch https://api.github.com/repos/immanuell/dockerfile-roast/releases failed
Error: StatusCode: non 2xx status code (404 GET https://api.github.com/repos/immanuell/dockerfile-roast/releases)
build · deepseek-v4-pro
✗ Web Search "immanuell dockerfile-roast droast GitHub releases" failed
Error: Web search cancelled
build · deepseek-v4-pro
✗ WebFetch https://github.com/immanuell/dockerfile-roast failed
Error: StatusCode: non 2xx status code (404 GET https://github.com/immanuell/dockerfile-roast)
build · deepseek-v4-pro
✗ WebFetch https://api.github.com/repos/immanuell/droast/releases failed
Error: StatusCode: non 2xx status code (404 GET https://api.github.com/repos/immanuell/droast/releases)
✗ WebFetch https://github.com/immanuell/dockerfile-roast/releases/download/1.7.0/droast-linux-x86_64 failed
Error: StatusCode: non 2xx status code (404 GET https://github.com/immanuell/dockerfile-roast/releases/download/1.7.0/droast-linux-x86_64)
build · deepseek-v4-pro
✗ WebFetch https://hub.docker.com/r/immanuell/droast failed
Error: StatusCode: non 2xx status code (404 GET https://hub.docker.com/r/immanuell/droast)
build · deepseek-v4-pro
✗ WebFetch https://hub.docker.com/v2/repositories/immanuell/droast/tags failed
Error: StatusCode: non 2xx status code (404 GET https://hub.docker.com/v2/repositories/immanuell/droast/tags)
% WebFetch https://api.github.com/search/repositories?q=droast
build · deepseek-v4-pro
The repo is immanuwell (double l), not immanuell as in the workflow URL. Let me verify the correct release assets and their hashes.
% WebFetch https://api.github.com/repos/immanuwell/dockerfile-roast/releases/tags/1.7.0
build · deepseek-v4-pro
The SHA hashes match the real release assets, but the workflow URL points to immanuell/... while the repo is immanuwell/.... Let me confirm the correct URL works and test the binary's CLI flags.
$ cd /tmp/opencode && curl -fsSL -o droast-arm64 "https://github.com/immanuwell/dockerfile-roast/releases/download/1.7.0/droast-linux-arm64" && sha256sum droast-arm64 && chmod +x droast-arm64 && ./droast-arm64 --version; echo "version-exit: $?"
0800e80d11f668615fc87750f58809b56bedca83ec6d8a539daa56f42da64bc3 droast-arm64
droast 1.7.0
version-exit: 0
build · deepseek-v4-pro
$ cd /tmp/opencode && mkdir -p droasttest && printf 'FROM node:22\nRUN apt-get update\n' > droasttest/Dockerfile && ./droast-arm64 --no-roast --min-severity warning droasttest; echo "lint-exit: $?"
✓ droasttest/Dockerfile passed with no issues.

lint-exit: 0

build · deepseek-v4-pro
Both droast hashes in the workflow match the real release assets, --version and the lint flags work — but the URL's GitHub org is misspelled. I verified everything I need.

Review: .gitea/workflows/pr-checker.yml

[BLOCKER] .gitea/workflows/pr-checker.yml:134 - The droast download URL uses org immanuell, but the repo is immanuwell/dockerfile-roast. curl -fsSL https://github.com/immanuell/dockerfile-roast/... returns 404 (verified live), so the Install droast step fails on every run and the dockerfile-lint job is permanently red. The pinned SHAs themselves are correct (verified against the real immanuwell release assets). Fix: change the URL to https://github.com/immanuwell/dockerfile-roast/releases/download/1.7.0/${DROAST_ASSET}.

[BLOCKER] .gitea/workflows/pr-checker.yml:363 - exit "${EXIT_CODE:-1}" can never exit 1: EXIT_CODE is initialized to 0 at line 280, and :- only substitutes when the var is unset/empty. If opencode exits 0 but emits no VERDICT line (truncated output, model refusal, format deviation), the else branch exits 0 → the job stays green and the ungated Post review as PR comment step (line 366, no if on verdict) publishes the garbage output as the review comment. The gate fails open in exactly the case it was built to catch. Fix: exit 1 in the else branch, and re-verify verdict presence in the Post step (e.g. gate it with an if: condition or grep again).

[WARN] .gitea/workflows/pr-checker.yml:358 - The verdict regex scans all of stdout+stderr in /tmp/review.md. The prompt text itself contains the literal lines VERDICT: APPROVE / VERDICT: REQUEST_CHANGES (lines 348-349); if logs echo the prompt (error dump, model parroting instructions) the gate passes and a failed review gets posted. Anchor to the tail: tail -n 5 /tmp/review.md | grep -qE '^VERDICT: ...'.

[WARN] .gitea/workflows/pr-checker.yml:353-360 - Trusting a model-emitted VERDICT line over the exit code widens the prompt-injection surface the comments elsewhere try to close: a malicious PR diff can instruct the reviewer to emit VERDICT: APPROVE regardless of findings, and this gate will publish it. At minimum require the verdict to be the last line and log an explicit warning when overriding a non-zero exit.

[NIT] .gitea/workflows/pr-checker.yml:224 - curl -fsSL https://opencode.ai/v2/install | bash only pins the version argument, not the installer script itself (unpinned curl | bash supply-chain risk) — inconsistent with the careful droast checksum pinning. Pin the installer's checksum or install via npm with an exact version.

[NIT] .gitea/workflows/pr-checker.yml:112-113 - Comment says "flip to true only if a CVE fix is genuinely blocked" but the continue-on-error key was removed entirely; there is nothing to flip. Reword to describe re-adding continue-on-error: true.

VERDICT: REQUEST_CHANGES

 > build · deepseek-v4-pro → Read .pr-review-diff.patch > build · deepseek-v4-pro → Read .pr-review-diff.patch [offset=163] > build · deepseek-v4-pro → Read .gitea/workflows/pr-checker.yml $ bash -e -c '[ 0 -ne 0 ] && echo warn; echo after' ; echo "outer-exit: $?"; uname -m after outer-exit: 0 aarch64 > build · deepseek-v4-pro The diff is a CI workflow change (`.gitea/workflows/pr-checker.yml`). Let me verify the claimed droast SHA256 hashes against the real release assets and check the binary's flags, since a wrong hash or flag breaks the job. $ bash -e -c 'false && echo x; echo y'; echo "false-&&-exit: $?" y false-&&-exit: 0 $ cd /tmp/opencode && for a in x86_64 arm64; do curl -fsSL -o droast-$a "https://github.com/immanuell/dockerfile-roast/releases/download/1.7.0/droast-linux-$a" && sha256sum droast-$a; done curl: (22) The requested URL returned error: 404 curl: (22) The requested URL returned error: 404 > build · deepseek-v4-pro ✗ WebFetch https://api.github.com/repos/immanuell/dockerfile-roast/releases/tags/1.7.0 failed Error: StatusCode: non 2xx status code (404 GET https://api.github.com/repos/immanuell/dockerfile-roast/releases/tags/1.7.0) > build · deepseek-v4-pro ✗ WebFetch https://api.github.com/repos/immanuell/dockerfile-roast/releases failed Error: StatusCode: non 2xx status code (404 GET https://api.github.com/repos/immanuell/dockerfile-roast/releases) > build · deepseek-v4-pro ✗ Web Search "immanuell dockerfile-roast droast GitHub releases" failed Error: Web search cancelled > build · deepseek-v4-pro ✗ WebFetch https://github.com/immanuell/dockerfile-roast failed Error: StatusCode: non 2xx status code (404 GET https://github.com/immanuell/dockerfile-roast) > build · deepseek-v4-pro ✗ WebFetch https://api.github.com/repos/immanuell/droast/releases failed Error: StatusCode: non 2xx status code (404 GET https://api.github.com/repos/immanuell/droast/releases) ✗ WebFetch https://github.com/immanuell/dockerfile-roast/releases/download/1.7.0/droast-linux-x86_64 failed Error: StatusCode: non 2xx status code (404 GET https://github.com/immanuell/dockerfile-roast/releases/download/1.7.0/droast-linux-x86_64) > build · deepseek-v4-pro ✗ WebFetch https://hub.docker.com/r/immanuell/droast failed Error: StatusCode: non 2xx status code (404 GET https://hub.docker.com/r/immanuell/droast) > build · deepseek-v4-pro ✗ WebFetch https://hub.docker.com/v2/repositories/immanuell/droast/tags failed Error: StatusCode: non 2xx status code (404 GET https://hub.docker.com/v2/repositories/immanuell/droast/tags) % WebFetch https://api.github.com/search/repositories?q=droast > build · deepseek-v4-pro The repo is `immanuwell` (double l), not `immanuell` as in the workflow URL. Let me verify the correct release assets and their hashes. % WebFetch https://api.github.com/repos/immanuwell/dockerfile-roast/releases/tags/1.7.0 > build · deepseek-v4-pro The SHA hashes match the real release assets, but the workflow URL points to `immanuell/...` while the repo is `immanuwell/...`. Let me confirm the correct URL works and test the binary's CLI flags. $ cd /tmp/opencode && curl -fsSL -o droast-arm64 "https://github.com/immanuwell/dockerfile-roast/releases/download/1.7.0/droast-linux-arm64" && sha256sum droast-arm64 && chmod +x droast-arm64 && ./droast-arm64 --version; echo "version-exit: $?" 0800e80d11f668615fc87750f58809b56bedca83ec6d8a539daa56f42da64bc3 droast-arm64 droast 1.7.0 version-exit: 0 > build · deepseek-v4-pro $ cd /tmp/opencode && mkdir -p droasttest && printf 'FROM node:22\nRUN apt-get update\n' > droasttest/Dockerfile && ./droast-arm64 --no-roast --min-severity warning droasttest; echo "lint-exit: $?" ✓ droasttest/Dockerfile passed with no issues. lint-exit: 0 > build · deepseek-v4-pro Both droast hashes in the workflow match the real release assets, `--version` and the lint flags work — but the URL's GitHub org is misspelled. I verified everything I need. **Review: `.gitea/workflows/pr-checker.yml`** [BLOCKER] .gitea/workflows/pr-checker.yml:134 - The droast download URL uses org `immanuell`, but the repo is `immanuwell/dockerfile-roast`. `curl -fsSL https://github.com/immanuell/dockerfile-roast/...` returns 404 (verified live), so the `Install droast` step fails on every run and the dockerfile-lint job is permanently red. The pinned SHAs themselves are correct (verified against the real `immanuwell` release assets). Fix: change the URL to `https://github.com/immanuwell/dockerfile-roast/releases/download/1.7.0/${DROAST_ASSET}`. [BLOCKER] .gitea/workflows/pr-checker.yml:363 - `exit "${EXIT_CODE:-1}"` can never exit 1: `EXIT_CODE` is initialized to `0` at line 280, and `:-` only substitutes when the var is unset/empty. If opencode exits 0 but emits no VERDICT line (truncated output, model refusal, format deviation), the else branch exits 0 → the job stays green and the ungated `Post review as PR comment` step (line 366, no `if` on verdict) publishes the garbage output as the review comment. The gate fails open in exactly the case it was built to catch. Fix: `exit 1` in the else branch, and re-verify verdict presence in the Post step (e.g. gate it with an `if:` condition or grep again). [WARN] .gitea/workflows/pr-checker.yml:358 - The verdict regex scans all of stdout+stderr in /tmp/review.md. The prompt text itself contains the literal lines `VERDICT: APPROVE` / `VERDICT: REQUEST_CHANGES` (lines 348-349); if logs echo the prompt (error dump, model parroting instructions) the gate passes and a failed review gets posted. Anchor to the tail: `tail -n 5 /tmp/review.md | grep -qE '^VERDICT: ...'`. [WARN] .gitea/workflows/pr-checker.yml:353-360 - Trusting a model-emitted VERDICT line over the exit code widens the prompt-injection surface the comments elsewhere try to close: a malicious PR diff can instruct the reviewer to emit `VERDICT: APPROVE` regardless of findings, and this gate will publish it. At minimum require the verdict to be the last line and log an explicit warning when overriding a non-zero exit. [NIT] .gitea/workflows/pr-checker.yml:224 - `curl -fsSL https://opencode.ai/v2/install | bash` only pins the version argument, not the installer script itself (unpinned `curl | bash` supply-chain risk) — inconsistent with the careful droast checksum pinning. Pin the installer's checksum or install via npm with an exact version. [NIT] .gitea/workflows/pr-checker.yml:112-113 - Comment says "flip to true only if a CVE fix is genuinely blocked" but the `continue-on-error` key was removed entirely; there is nothing to flip. Reword to describe re-adding `continue-on-error: true`. VERDICT: REQUEST_CHANGES
Noel added 2 commits 2026-10-18 16:09:47 +00:00
- release-please-config.json: node release type, root package,
  plain v-tags, default versioning
- .release-please-manifest.json: track current version (1.0.0)
- package.json: add version field required by the node release type
- release-please.yml: use the config/manifest files
docs: add OKF_Nuxt decision records and log
PR Check / Security scan (Snyk) (pull_request) Skipped
PR Check / ESLint (pull_request) Successful in 35s
PR Check / Typecheck (pull_request) Successful in 38s
PR Check / Secret scan (gitleaks) (pull_request) Successful in 5s
PR Check / Dependency audit (pull_request) Failing after 8s
PR Check / Dockerfile lint (droast) (pull_request) Failing after 5s
PR Check / AI code review (opencode) (pull_request) Canceled after 16s
bb0ab03a97
Noel added 1 commit 2026-10-18 16:11:37 +00:00
feat: merged main into this branch
PR Check / Security scan (Snyk) (pull_request) Skipped
PR Check / ESLint (pull_request) Successful in 35s
PR Check / Typecheck (pull_request) Successful in 38s
PR Check / Secret scan (gitleaks) (pull_request) Successful in 6s
PR Check / Dependency audit (pull_request) Failing after 8s
PR Check / Dockerfile lint (droast) (pull_request) Failing after 5s
PR Check / AI code review (opencode) (pull_request) Successful in 4m41s
cefdb34d7e
Author
Owner



build · deepseek-v4-pro
→ Read .pr-review-diff.patch
build · deepseek-v4-pro
✗ Read /workspace/Curriculum_Vitae/CV_Site_Nuxt/.pr-review-diff.patch failed
Error: File not found: /workspace/Curriculum_Vitae/CV_Site_Nuxt/.pr-review-diff.patch
build · deepseek-v4-pro
→ Read .pr-review-diff.patch [offset=152]
build · deepseek-v4-pro
$ wc -l .pr-review-diff.patch && git log --oneline -5 && git status --short
152 .pr-review-diff.patch
cefdb34 feat: merged main into this branch
bb0ab03 docs: add OKF_Nuxt decision records and log
9987d6b chore: add release-please configuration (from release_please_advanced)
a3e6aef fix(ci): apply review findings round two
c70f5d7 Merge pull request 'docs(okf): add Nuxt knowledge bundle in OKF v0.2' (#3) from feat/okf_nuxt into main
?? .pr-review-diff.patch
build · deepseek-v4-pro
The diff covers only .gitea/workflows/pr-checker.yml. Let me read the full workflow file for context on the surrounding code.
→ Read .gitea/workflows/pr-checker.yml
build · deepseek-v4-pro
The diff is CI workflow logic with executable shell code, so it's reviewable. Let me verify the OpenCode v2 permission schema claims made in the workflow (this affects whether the secret-protection design actually holds).
→ Skill "OpenCode"
build · deepseek-v4-pro
Let me verify the v2 permission schema to check whether the workflow's deny list is complete (e.g., whether write is a distinct action from edit, and whether shell is the correct action name).
% WebFetch https://opencode.ai/v2/docs/config
build · deepseek-v4-pro
% WebFetch https://opencode.ai/v2/docs/permissions
build · deepseek-v4-pro
Review complete. The diff is CI workflow logic with executable shell — reviewable code, reviewed against the actual OpenCode v2 permission docs.

[BLOCKER] .gitea/workflows/pr-checker.yml:363 - The review gate fails open. If opencode run exits 0 but the output lacks a VERDICT: line (e.g., model emits the "docs/config only" one-liner without the verdict, deviates from format, or output is truncated without a non-zero exit), the else branch runs exit "${EXIT_CODE:-1}" → exit 0. The job goes green and the following "Post review as PR comment" step (no if: failure() guard) still runs and posts the non-review output as a comment — the "NOT posting this output" error message is false. Fix: exit non-zero unconditionally, e.g. exit "${EXIT_CODE:-1}" → exit 1 (or [ "$EXIT_CODE" -ne 0 ] && exit "$EXIT_CODE" || exit 1).

[WARN] .gitea/workflows/pr-checker.yml:270 - The written config uses the V1 field name permission (singular). The V2 schema field is permissions (docs: "In V2, use permissions, shell, and subagent instead of permission, bash, and task"). If the installed 2.0.32 binary ignores the deprecated field, every deny silently no-ops and the base policy (action: "*", effect: "allow") leaves shell/webfetch available to a prompt-injected agent running with OPENCODE_API_KEY in its environment. Fix: use permissions, and add a CI self-check that the config is loaded/enforced (or at least validated) before running the review.

[WARN] .gitea/workflows/pr-checker.yml:224 - curl -fsSL https://opencode.ai/v2/install | bash executes an unpinned, mutable installer script, while this same PR SHA256-pins gitleaks and droast. Steps share the container filesystem, so a backdoored opencode binary persists and later runs with the API key env. Fix: pin the installer script or binary by hash like the other tools.

[WARN] .gitea/workflows/pr-checker.yml:358 - The verdict gate greps the entire file, not the final line(s). A malicious PR can inject a VERDICT: APPROVE line that the agent quotes in its output (or that appears in --print-logs output), making the gate pass without a completed review. Fix: tail -n 5 /tmp/review.md | grep -qE '^VERDICT: (APPROVE|REQUEST_CHANGES)'.

[NIT] .gitea/workflows/pr-checker.yml:138 - sha256sum -c - failure isn't explicitly fatal; if the runner shell lacks errexit, the step falls through to chmod/droast --version on an unverified binary. Add || exit 1 (or set -e).

[NIT] .gitea/workflows/pr-checker.yml:167 - droast ... . lints the whole tree including node_modules, while the discovery step prunes .git/node_modules; vendored Dockerfiles can produce findings on third-party code. Scope droast to the same pruned paths.

[NIT] .gitea/workflows/pr-checker.yml:112-113 - Comment says "flip to true" but continue-on-error: true was removed; reword to "re-add continue-on-error: true".

[NIT] .gitea/workflows/pr-checker.yml:284-349 - The review prompt is a double-quoted shell string; any future edit adding $, backticks, or " gets shell-expanded or breaks the step. Use a single-quoted heredoc.

VERDICT: REQUEST_CHANGES

 > build · deepseek-v4-pro → Read .pr-review-diff.patch > build · deepseek-v4-pro ✗ Read /workspace/Curriculum_Vitae/CV_Site_Nuxt/.pr-review-diff.patch failed Error: File not found: /workspace/Curriculum_Vitae/CV_Site_Nuxt/.pr-review-diff.patch > build · deepseek-v4-pro → Read .pr-review-diff.patch [offset=152] > build · deepseek-v4-pro $ wc -l .pr-review-diff.patch && git log --oneline -5 && git status --short 152 .pr-review-diff.patch cefdb34 feat: merged main into this branch bb0ab03 docs: add OKF_Nuxt decision records and log 9987d6b chore: add release-please configuration (from release_please_advanced) a3e6aef fix(ci): apply review findings round two c70f5d7 Merge pull request 'docs(okf): add Nuxt knowledge bundle in OKF v0.2' (#3) from feat/okf_nuxt into main ?? .pr-review-diff.patch > build · deepseek-v4-pro The diff covers only `.gitea/workflows/pr-checker.yml`. Let me read the full workflow file for context on the surrounding code. → Read .gitea/workflows/pr-checker.yml > build · deepseek-v4-pro The diff is CI workflow logic with executable shell code, so it's reviewable. Let me verify the OpenCode v2 permission schema claims made in the workflow (this affects whether the secret-protection design actually holds). → Skill "OpenCode" > build · deepseek-v4-pro Let me verify the v2 permission schema to check whether the workflow's deny list is complete (e.g., whether `write` is a distinct action from `edit`, and whether `shell` is the correct action name). % WebFetch https://opencode.ai/v2/docs/config > build · deepseek-v4-pro % WebFetch https://opencode.ai/v2/docs/permissions > build · deepseek-v4-pro Review complete. The diff is CI workflow logic with executable shell — reviewable code, reviewed against the actual OpenCode v2 permission docs. [BLOCKER] .gitea/workflows/pr-checker.yml:363 - The review gate fails open. If `opencode run` exits 0 but the output lacks a `VERDICT:` line (e.g., model emits the "docs/config only" one-liner without the verdict, deviates from format, or output is truncated without a non-zero exit), the else branch runs `exit "${EXIT_CODE:-1}"` → `exit 0`. The job goes green and the following "Post review as PR comment" step (no `if: failure()` guard) still runs and posts the non-review output as a comment — the "NOT posting this output" error message is false. Fix: exit non-zero unconditionally, e.g. `exit "${EXIT_CODE:-1}"` → `exit 1` (or `[ "$EXIT_CODE" -ne 0 ] && exit "$EXIT_CODE" || exit 1`). [WARN] .gitea/workflows/pr-checker.yml:270 - The written config uses the V1 field name `permission` (singular). The V2 schema field is `permissions` (docs: "In V2, use `permissions`, `shell`, and `subagent` instead of `permission`, `bash`, and `task`"). If the installed 2.0.32 binary ignores the deprecated field, every deny silently no-ops and the base policy (`action: "*", effect: "allow"`) leaves `shell`/`webfetch` available to a prompt-injected agent running with `OPENCODE_API_KEY` in its environment. Fix: use `permissions`, and add a CI self-check that the config is loaded/enforced (or at least validated) before running the review. [WARN] .gitea/workflows/pr-checker.yml:224 - `curl -fsSL https://opencode.ai/v2/install | bash` executes an unpinned, mutable installer script, while this same PR SHA256-pins gitleaks and droast. Steps share the container filesystem, so a backdoored `opencode` binary persists and later runs with the API key env. Fix: pin the installer script or binary by hash like the other tools. [WARN] .gitea/workflows/pr-checker.yml:358 - The verdict gate greps the entire file, not the final line(s). A malicious PR can inject a `VERDICT: APPROVE` line that the agent quotes in its output (or that appears in `--print-logs` output), making the gate pass without a completed review. Fix: `tail -n 5 /tmp/review.md | grep -qE '^VERDICT: (APPROVE|REQUEST_CHANGES)'`. [NIT] .gitea/workflows/pr-checker.yml:138 - `sha256sum -c -` failure isn't explicitly fatal; if the runner shell lacks errexit, the step falls through to `chmod`/`droast --version` on an unverified binary. Add `|| exit 1` (or `set -e`). [NIT] .gitea/workflows/pr-checker.yml:167 - `droast ... .` lints the whole tree including `node_modules`, while the discovery step prunes `.git`/`node_modules`; vendored Dockerfiles can produce findings on third-party code. Scope droast to the same pruned paths. [NIT] .gitea/workflows/pr-checker.yml:112-113 - Comment says "flip to true" but `continue-on-error: true` was removed; reword to "re-add `continue-on-error: true`". [NIT] .gitea/workflows/pr-checker.yml:284-349 - The review prompt is a double-quoted shell string; any future edit adding `$`, backticks, or `"` gets shell-expanded or breaks the step. Use a single-quoted heredoc. VERDICT: REQUEST_CHANGES
Noel added 1 commit 2026-10-18 16:24:07 +00:00
fix(ci): close the fail-open gate, enforce read-only sandbox
PR Check / Security scan (Snyk) (pull_request) Skipped
PR Check / ESLint (pull_request) Successful in 35s
PR Check / Typecheck (pull_request) Canceled after 21s
PR Check / Secret scan (gitleaks) (pull_request) Canceled after 0s
PR Check / Dependency audit (pull_request) Canceled after 0s
PR Check / Dockerfile lint (droast) (pull_request) Canceled after 0s
PR Check / AI code review (opencode) (pull_request) Canceled after 0s
3e68e630df
Findings validated from review comments 71 and 75:

- [BLOCKER] the no-verdict branch exited \${EXIT_CODE:-1} which is 0
  when opencode succeeded without a verdict - job went green and the
  post step published non-review output. The else branch now exits 1
  unconditionally, the verdict is anchored to the last five lines (the
  prompt itself contains VERDICT lines), and the post step re-verifies
  the contract before posting.
- [BLOCKER] the v1 'permission' object is ignored by the opencode v2
  CLI - shell commands executed in both review runs despite deny. The
  config now uses the v2 'permissions' array with 'shell' as the
  action name, denying edit/shell/webfetch/websearch/external_directory.
- hygiene: droast linting prunes node_modules, audit comment names the
  exact key to re-add, shell blocks verified with sh -n.
Noel merged commit 93e6af36d7 into main 2026-10-18 16:24:58 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: CV_Website/CV_Site_Nuxt#5