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.
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.
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.
- 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
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.
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.
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.
- 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
build · deepseek-v4-pro
[0m→ [0mRead .pr-review-diff.patch
build · deepseek-v4-pro
[0m→ [0mRead .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
[0m
> build · deepseek-v4-pro
[0m→ [0mRead .pr-review-diff.patch
> build · deepseek-v4-pro
[0m→ [0mRead .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
- [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.
- 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
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
[0m
> build · deepseek-v4-pro
[0m→ [0mRead .pr-review-diff.patch
> build · deepseek-v4-pro
[0m→ [0mRead .pr-review-diff.patch [90m[offset=163][0m
> build · deepseek-v4-pro
[0m→ [0mRead .gitea/workflows/pr-checker.yml
[0m$ [0mbash -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.
[0m$ [0mbash -e -c 'false && echo x; echo y'; echo "false-&&-exit: $?"
y
false-&&-exit: 0
[0m$ [0mcd /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
[0m✗ [0mWebFetch https://api.github.com/repos/immanuell/dockerfile-roast/releases/tags/1.7.0 failed
[91m[1mError: [0mStatusCode: non 2xx status code (404 GET https://api.github.com/repos/immanuell/dockerfile-roast/releases/tags/1.7.0)
> build · deepseek-v4-pro
[0m✗ [0mWebFetch https://api.github.com/repos/immanuell/dockerfile-roast/releases failed
[91m[1mError: [0mStatusCode: non 2xx status code (404 GET https://api.github.com/repos/immanuell/dockerfile-roast/releases)
> build · deepseek-v4-pro
[0m✗ [0mWeb Search "immanuell dockerfile-roast droast GitHub releases" failed
[91m[1mError: [0mWeb search cancelled
> build · deepseek-v4-pro
[0m✗ [0mWebFetch https://github.com/immanuell/dockerfile-roast failed
[91m[1mError: [0mStatusCode: non 2xx status code (404 GET https://github.com/immanuell/dockerfile-roast)
> build · deepseek-v4-pro
[0m✗ [0mWebFetch https://api.github.com/repos/immanuell/droast/releases failed
[91m[1mError: [0mStatusCode: non 2xx status code (404 GET https://api.github.com/repos/immanuell/droast/releases)
[0m✗ [0mWebFetch https://github.com/immanuell/dockerfile-roast/releases/download/1.7.0/droast-linux-x86_64 failed
[91m[1mError: [0mStatusCode: 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
[0m✗ [0mWebFetch https://hub.docker.com/r/immanuell/droast failed
[91m[1mError: [0mStatusCode: non 2xx status code (404 GET https://hub.docker.com/r/immanuell/droast)
> build · deepseek-v4-pro
[0m✗ [0mWebFetch https://hub.docker.com/v2/repositories/immanuell/droast/tags failed
[91m[1mError: [0mStatusCode: non 2xx status code (404 GET https://hub.docker.com/v2/repositories/immanuell/droast/tags)
[0m% [0mWebFetch 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.
[0m% [0mWebFetch 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.
[0m$ [0mcd /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
[0m$ [0mcd /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
- 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
build · deepseek-v4-pro
[0m→ [0mRead .pr-review-diff.patch
build · deepseek-v4-pro
[0m✗ [0mRead /workspace/Curriculum_Vitae/CV_Site_Nuxt/.pr-review-diff.patch failed
[91m[1mError: [0mFile not found: /workspace/Curriculum_Vitae/CV_Site_Nuxt/.pr-review-diff.patch
build · deepseek-v4-pro
[0m→ [0mRead .pr-review-diff.patch [90m[offset=152][0m
build · deepseek-v4-pro
[0m$ [0mwc -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.
[0m→ [0mRead .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).
[0m→ [0mSkill "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).
[0m% [0mWebFetch https://opencode.ai/v2/docs/config
build · deepseek-v4-pro
[0m% [0mWebFetch 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
[0m
> build · deepseek-v4-pro
[0m→ [0mRead .pr-review-diff.patch
> build · deepseek-v4-pro
[0m✗ [0mRead /workspace/Curriculum_Vitae/CV_Site_Nuxt/.pr-review-diff.patch failed
[91m[1mError: [0mFile not found: /workspace/Curriculum_Vitae/CV_Site_Nuxt/.pr-review-diff.patch
> build · deepseek-v4-pro
[0m→ [0mRead .pr-review-diff.patch [90m[offset=152][0m
> build · deepseek-v4-pro
[0m$ [0mwc -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.
[0m→ [0mRead .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).
[0m→ [0mSkill "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).
[0m% [0mWebFetch https://opencode.ai/v2/docs/config
> build · deepseek-v4-pro
[0m% [0mWebFetch 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
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 main2026-10-18 16:24:58 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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.
- 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[0m
[BLOCKER] .gitea/workflows/pr-checker.yml:249-261 - The
OPENCODE_API_KEYsecret is written in plaintext intoopencode.jsonin 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-logsoutput, into the comment body with no redaction). The PR diff itself (attacker-controlled content) mentionsopencode.json, inviting the agent to read it, and a malicious PR can prompt-inject the agent into quoting the file'sapiKeyin the review output - exfiltrating the credential to anyone who can see the PR. Thepermission: edit/bash/webfetch denyconfig does not stop this: reading files and posting output are outside that permission system. Fix: drop theopencode.jsongeneration 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) andtrap '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 ... | bashfetches the latest opencode v2 with no version pin and no checksum. The removedOPENCODE_VERSIONenv 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.jsonbecomes 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.mddumps 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
[0m
lint-exit: 0
Review:
.gitea/workflows/pr-checker.yml[BLOCKER] .gitea/workflows/pr-checker.yml:134 - The droast download URL uses org
immanuell, but the repo isimmanuwell/dockerfile-roast.curl -fsSL https://github.com/immanuell/dockerfile-roast/...returns 404 (verified live), so theInstall droaststep fails on every run and the dockerfile-lint job is permanently red. The pinned SHAs themselves are correct (verified against the realimmanuwellrelease assets). Fix: change the URL tohttps://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_CODEis initialized to0at 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 ungatedPost review as PR commentstep (line 366, noifon verdict) publishes the garbage output as the review comment. The gate fails open in exactly the case it was built to catch. Fix:exit 1in the else branch, and re-verify verdict presence in the Post step (e.g. gate it with anif: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: APPROVEregardless 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 | bashonly pins the version argument, not the installer script itself (unpinnedcurl | bashsupply-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-errorkey was removed entirely; there is nothing to flip. Reword to describe re-addingcontinue-on-error: true.VERDICT: REQUEST_CHANGES
[0m
[BLOCKER] .gitea/workflows/pr-checker.yml:363 - The review gate fails open. If
opencode runexits 0 but the output lacks aVERDICT: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 runsexit "${EXIT_CODE:-1}"→exit 0. The job goes green and the following "Post review as PR comment" step (noif: 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 ispermissions(docs: "In V2, usepermissions,shell, andsubagentinstead ofpermission,bash, andtask"). If the installed 2.0.32 binary ignores the deprecated field, every deny silently no-ops and the base policy (action: "*", effect: "allow") leavesshell/webfetchavailable to a prompt-injected agent running withOPENCODE_API_KEYin its environment. Fix: usepermissions, 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 | bashexecutes an unpinned, mutable installer script, while this same PR SHA256-pins gitleaks and droast. Steps share the container filesystem, so a backdooredopencodebinary 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: APPROVEline that the agent quotes in its output (or that appears in--print-logsoutput), 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 tochmod/droast --versionon an unverified binary. Add|| exit 1(orset -e).[NIT] .gitea/workflows/pr-checker.yml:167 -
droast ... .lints the whole tree includingnode_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: truewas removed; reword to "re-addcontinue-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
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.