Compare commits
43
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
89cdad7aad | ||
|
|
0e5ddda59d | ||
|
|
a27bbbb2ab | ||
|
|
23b8918670 | ||
|
|
f18278b65b | ||
|
|
033697256a | ||
|
|
1827dbc4b9 | ||
|
|
f13fc7668c | ||
|
|
81d658a871 | ||
|
|
e1192a2014 | ||
|
|
166dd7bffc | ||
|
|
8fa8eb63b2 | ||
|
|
93e6af36d7 | ||
|
|
3e68e630df | ||
|
|
7bf649cba6 | ||
|
|
ab7626d5f7 | ||
|
|
cefdb34d7e | ||
|
|
bb0ab03a97 | ||
|
|
9987d6b8e4 | ||
|
|
a3e6aef901 | ||
|
|
c70f5d7963 | ||
|
|
47d775bfb9 | ||
|
|
52582d5c60 | ||
|
|
6891cb56a9 | ||
|
|
85f488a94d | ||
|
|
f8d128705f | ||
|
|
783c9ccda3 | ||
|
|
cf6f209ebf | ||
|
|
5f1d64db90 | ||
|
|
a6761fae9a | ||
|
|
8f36f14720 | ||
|
|
066bcec47c | ||
|
|
8b6bcb6d70 | ||
|
|
81a4e3ec81 | ||
|
|
56ef59cbd6 | ||
|
|
c89747e076 | ||
|
|
f19616aa71 | ||
|
|
2f75fc8764 | ||
|
|
7d508a5d9a | ||
|
|
23837f121f | ||
|
|
85c03600ae | ||
|
|
8fa078707c | ||
|
|
1a78935c23 |
No files matched your search
@@ -0,0 +1,36 @@
|
||||
# Build-context filter for the Nuxt site.
|
||||
# Anything listed here cannot be COPY-ed, so never add a path the Dockerfile
|
||||
# copies: package.json, pnpm-lock.yaml, pnpm-workspace.yaml, nuxt.config.ts,
|
||||
# app/, public/, tsconfig.json.
|
||||
|
||||
# 1. Secrets never enter the build context
|
||||
.env
|
||||
.env.*
|
||||
!.env.example
|
||||
*.pem
|
||||
*.key
|
||||
.npmrc
|
||||
|
||||
# 2. Noise: dependencies, build output, logs
|
||||
node_modules
|
||||
.nuxt
|
||||
.output
|
||||
.nitro
|
||||
.data
|
||||
.cache
|
||||
dist
|
||||
*.log
|
||||
coverage
|
||||
|
||||
# Repo and editor metadata
|
||||
.git
|
||||
.gitignore
|
||||
.vscode
|
||||
.idea
|
||||
.fleet
|
||||
.DS_Store
|
||||
|
||||
# Not needed inside the image
|
||||
Dockerfile
|
||||
Dockerfile.*
|
||||
.dockerignore
|
||||
+120
-22
@@ -109,24 +109,69 @@ jobs:
|
||||
- name: Audit dependencies for known vulnerabilities
|
||||
working-directory: ${{ env.APP_DIR }}
|
||||
run: pnpm audit --prod --audit-level moderate
|
||||
continue-on-error: true # advisory: does not block the PR by default
|
||||
# blocks the PR on vulnerabilities - re-add `continue-on-error: true`
|
||||
# here only if a CVE fix is genuinely blocked upstream, never to
|
||||
# make a red pipeline green
|
||||
|
||||
# ------------------------------------------------------- dockerfile lint --
|
||||
dockerfile-lint:
|
||||
name: Dockerfile lint (droast)
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: immanuwell/droast:1.7.0
|
||||
# skips until the repo contains a Dockerfile
|
||||
if: ${{ hashFiles('**/Dockerfile', '**/Dockerfile.*', '**/Containerfile') != '' }}
|
||||
# droast's own container image ships no node (actions/checkout would
|
||||
# fail with exit 127 - same as the gitleaks image), so run the droast
|
||||
# binary in the multi-arch node image instead
|
||||
container: node:22-bookworm
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install droast
|
||||
run: |
|
||||
case "$(uname -m)" in
|
||||
x86_64) DROAST_ASSET=droast-linux-x86_64; DROAST_SHA=cadb963a040ba2e68641af764f794e5d4fb3371bb9b92255fa5027060b08ea6e ;;
|
||||
aarch64) DROAST_ASSET=droast-linux-arm64; DROAST_SHA=0800e80d11f668615fc87750f58809b56bedca83ec6d8a539daa56f42da64bc3 ;;
|
||||
*) echo "unsupported arch: $(uname -m)" && exit 1 ;;
|
||||
esac
|
||||
curl -fsSL -o /usr/local/bin/droast \
|
||||
"https://github.com/immanuwell/dockerfile-roast/releases/download/1.7.0/${DROAST_ASSET}"
|
||||
# verify against the pinned hash checked into this workflow
|
||||
# (fetching the checksum from the same release as the binary
|
||||
# would be trust-on-first-use and prove nothing)
|
||||
echo "${DROAST_SHA} /usr/local/bin/droast" | sha256sum -c -
|
||||
chmod +x /usr/local/bin/droast
|
||||
droast --version
|
||||
|
||||
- name: Discover Dockerfiles
|
||||
id: discover
|
||||
# shell check instead of hashFiles: the act runner's hashFiles
|
||||
# evaluation returned empty and silently skipped the job even when
|
||||
# Dockerfiles existed
|
||||
run: |
|
||||
# Discovery: -print -quit instead of `| head -n 1` - head can
|
||||
# SIGPIPE find (exit 141) when multiple Dockerfiles match
|
||||
found="$(find . \
|
||||
-path ./.git -prune -o -path ./node_modules -prune -o \
|
||||
-type f \( -iname 'Dockerfile*' -o -iname '*dockerfile' -o -iname 'Containerfile*' \) \
|
||||
-print -quit)"
|
||||
if [ -n "$found" ]; then
|
||||
echo "found=true" >> "$GITHUB_OUTPUT"
|
||||
echo "Dockerfile found: $found"
|
||||
else
|
||||
echo "found=false" >> "$GITHUB_OUTPUT"
|
||||
echo "No Dockerfile in repo - nothing to lint"
|
||||
fi
|
||||
|
||||
- name: Lint Dockerfile(s)
|
||||
if: ${{ steps.discover.outputs.found == 'true' }}
|
||||
run: |
|
||||
# --no-roast = technical output for CI; --min-severity warning so
|
||||
# info-level findings don't block the PR
|
||||
droast --no-roast --min-severity warning .
|
||||
# lint exactly the tree the discovery step sees: prune node_modules
|
||||
# and .git so vendored Dockerfiles in dependencies cannot produce
|
||||
# findings on third-party code
|
||||
find . \
|
||||
-path ./.git -prune -o -path ./node_modules -prune -o \
|
||||
-type f \( -iname 'Dockerfile*' -o -iname '*dockerfile' -o -iname 'Containerfile*' \) \
|
||||
-print0 | xargs -0 -r droast --no-roast --min-severity warning
|
||||
|
||||
# ------------------------------------------------------- snyk security ----
|
||||
# DISABLED: Snyk free plan only includes ~100 test credits/month, which the
|
||||
@@ -183,10 +228,12 @@ jobs:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install opencode CLI
|
||||
run: curl -fsSL https://opencode.ai/install | bash
|
||||
env:
|
||||
# pin the version for reproducible CI, e.g. v1.0.0
|
||||
OPENCODE_VERSION: latest
|
||||
run: curl -fsSL https://opencode.ai/v2/install | bash -s -- -v 2.0.32
|
||||
# v2 installer is required: the classic /install URL ships only
|
||||
# OpenCode 1.x (resolved to v1.19.3 on arm64), which cannot resolve
|
||||
# model variants like "#max" and failed with ProviderModelNotFoundError.
|
||||
# Version pinned (-v 2.0.32) so a breaking v2 release cannot fail
|
||||
# the job mid-PR; bump deliberately, not automatically.
|
||||
|
||||
- name: Get PR diff
|
||||
run: |
|
||||
@@ -204,14 +251,45 @@ jobs:
|
||||
env:
|
||||
OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }}
|
||||
run: |
|
||||
# deepseek-v4-pro#max: flagship reasoning model at maximum thinking
|
||||
# budget. Requires funds on the opencode account.
|
||||
# Cheaper fallbacks: opencode/deepseek-v4.1-flash, or remove "#max".
|
||||
# Output is redirected (not piped through tee): if opencode fails,
|
||||
# the job must fail here so the error log is never posted as a
|
||||
# "review" comment.
|
||||
# opencode-go/deepseek-v4-pro#max: flagship reasoning model at
|
||||
# maximum thinking budget - included in the opencode-go $10 plan
|
||||
# (variants: high, max). NOTE the provider prefix must be
|
||||
# "opencode-go", NOT "opencode" (Zen is a different, pay-per-call
|
||||
# provider and fails with 'Insufficient account funds').
|
||||
#
|
||||
# Auth is env-only: the CLI picks up OPENCODE_API_KEY from the
|
||||
# environment (verified headless). Deliberately NO opencode.json:
|
||||
# a config file in the checkout would hold the API key in
|
||||
# plaintext, readable by the agent - a malicious PR diff could
|
||||
# prompt-inject the agent into quoting the key in the review
|
||||
# comment (publicly visible). Env vars are invisible to file reads.
|
||||
# Permissions live in a global config OUTSIDE the checkout (no
|
||||
# secrets in it, so nothing can leak). OpenCode v2 schema: the
|
||||
# field is "permissions" (plural) - an ordered array of
|
||||
# {action, resource, effect}; "bash" was renamed "shell" in v2.
|
||||
# The singular v1 "permission" object is ignored by the v2 CLI
|
||||
# (verified empirically: shell commands executed despite deny).
|
||||
# Denying shell/edit/webfetch/websearch/external_directory means
|
||||
# no headless permission prompts can hang or kill the run, and
|
||||
# the reviewer physically cannot modify the repo or browse
|
||||
# attacker-controlled URLs.
|
||||
mkdir -p "$HOME/.config/opencode"
|
||||
printf '{
|
||||
"$schema": "https://opencode.ai/config.json",
|
||||
"permissions": [
|
||||
{ "action": "edit", "resource": "*", "effect": "deny" },
|
||||
{ "action": "shell", "resource": "*", "effect": "deny" },
|
||||
{ "action": "webfetch", "resource": "*", "effect": "deny" },
|
||||
{ "action": "websearch", "resource": "*", "effect": "deny" },
|
||||
{ "action": "external_directory", "resource": "*", "effect": "deny" }
|
||||
]
|
||||
}' > "$HOME/.config/opencode/opencode.json"
|
||||
# --print-logs: surface auth/provider errors in the CI log instead
|
||||
# of failing with an opaque exit code
|
||||
EXIT_CODE=0
|
||||
opencode run \
|
||||
--model opencode/deepseek-v4-pro#max \
|
||||
--print-logs \
|
||||
--model opencode-go/deepseek-v4-pro#max \
|
||||
"You are a principal engineer performing a rigorous code review on a
|
||||
pull request. You have tool access: read repo files for context when
|
||||
the diff alone is ambiguous, but review ONLY code changed in this PR.
|
||||
@@ -278,12 +356,26 @@ jobs:
|
||||
End your response with a final verdict line, exactly one of:
|
||||
VERDICT: APPROVE (no BLOCKER findings)
|
||||
VERDICT: REQUEST_CHANGES (at least one BLOCKER)" \
|
||||
> /tmp/review.md 2>&1
|
||||
EXIT_CODE=$?
|
||||
> /tmp/review.md 2>&1 || EXIT_CODE=$?
|
||||
# always show the output - never swallow the error text
|
||||
cat /tmp/review.md
|
||||
if [ $EXIT_CODE -ne 0 ]; then
|
||||
echo "::error::opencode review failed (exit ${EXIT_CODE}) - NOT posting this output as a review comment"
|
||||
exit $EXIT_CODE
|
||||
# The posting gate is the OUTPUT CONTRACT, not the exit code:
|
||||
# a completed review always ends with a VERDICT line - error
|
||||
# dumps never do. opencode can exit 1 on benign tool denials
|
||||
# even after a full review, so a present verdict means post;
|
||||
# anything else means the review did not complete.
|
||||
# Anchored to the tail: the prompt itself contains VERDICT
|
||||
# lines, so scanning the whole file could pass on echoed
|
||||
# prompt text or injected quotes - only the last lines count.
|
||||
if tail -n 5 /tmp/review.md | grep -qE '^VERDICT: (APPROVE|REQUEST_CHANGES)'; then
|
||||
[ "$EXIT_CODE" -ne 0 ] && echo "::warning::opencode exited ${EXIT_CODE} but produced a valid verdict - posting review"
|
||||
echo "Review completed with verdict."
|
||||
else
|
||||
# fail closed: no verdict = no review. exit 1 unconditionally -
|
||||
# falling back to EXIT_CODE would exit 0 when opencode succeeded
|
||||
# but produced no review, and the job would go green.
|
||||
echo "::error::opencode produced no valid review (exit ${EXIT_CODE:-1}) - NOT posting this output as a review comment"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Post review as PR comment
|
||||
@@ -294,6 +386,12 @@ jobs:
|
||||
REPO: ${{ github.repository }}
|
||||
# Gitea sets GITHUB_API_URL, e.g. https://gitea.example.com/api/v1
|
||||
run: |
|
||||
# re-verify the output contract here: never post anything that is
|
||||
# not a completed review, regardless of how the previous step ended
|
||||
if ! tail -n 5 /tmp/review.md | grep -qE '^VERDICT: (APPROVE|REQUEST_CHANGES)'; then
|
||||
echo "::error::no verdict in review output - nothing to post"
|
||||
exit 1
|
||||
fi
|
||||
# jq is not in the node image - use node for JSON encoding
|
||||
BODY=$(node -e 'process.stdout.write(JSON.stringify(require("fs").readFileSync("/tmp/review.md","utf8")))')
|
||||
HTTP_CODE=$(curl -s -o /tmp/comment-response.json -w "%{http_code}" \
|
||||
|
||||
@@ -15,5 +15,22 @@ jobs:
|
||||
steps:
|
||||
- uses: joaquinjsb/gitea-release-please-action@v4
|
||||
with:
|
||||
token: ${{ secrets.RELEASE_PLEASE_TOKEN_CV_SITE_NUXT }}
|
||||
release-type: simple
|
||||
# One well-scoped token for all workflow API work (see
|
||||
# OKF_Nuxt/decisions/snyk-paused-and-secrets-policy.md). The
|
||||
# dedicated RELEASE_PLEASE_TOKEN_CV_SITE_NUXT secret failed with
|
||||
# exit 1: reads worked (createReleases completed) but creating
|
||||
# the release PR threw - the token lacked the write:repository /
|
||||
# write:issue scopes. PR_GITEA_TOKEN has both and is proven by
|
||||
# the AI-review comment posting.
|
||||
token: ${{ secrets.PR_GITEA_TOKEN }}
|
||||
# The PR-creation path (code-suggester) pushes the release branch
|
||||
# with isomorphic-git using these git credentials - NOT the token
|
||||
# input (octokit reads use the token; the final `git push` uses
|
||||
# git-username/git-password). Unset, the push is anonymous and
|
||||
# fails "HTTP Error: 401 Unauthorized" after the branch commit is
|
||||
# already built. Gitea git-over-HTTPS auth: account name +
|
||||
# token as password.
|
||||
git-username: Noel
|
||||
git-password: ${{ secrets.PR_GITEA_TOKEN }}
|
||||
config-file: release-please-config.json
|
||||
manifest-file: .release-please-manifest.json
|
||||
@@ -0,0 +1,81 @@
|
||||
# Pre-commit guardrails — deterministic checks that run before every commit.
|
||||
# Cheap things live here (seconds); slow things (typecheck, build, tests,
|
||||
# Snyk, AI review) stay in CI (.gitea/workflows/pr-checker.yml).
|
||||
#
|
||||
# One-time setup per machine:
|
||||
# pre-commit install # pre-commit stage
|
||||
# pre-commit install --hook-type commit-msg # commit-msg stage (release-please!)
|
||||
# pre-commit run --all-files # first full pass
|
||||
#
|
||||
# ARM64 + x86_64 both supported by every hook below.
|
||||
|
||||
repos:
|
||||
# ---------------------------------------------------------------- gitleaks
|
||||
# Block secrets before they enter history. CI scans history too (gitleaks
|
||||
# job), but this prevents the commit from ever existing.
|
||||
- repo: https://github.com/gitleaks/gitleaks
|
||||
rev: v8.30.1
|
||||
hooks:
|
||||
- id: gitleaks
|
||||
|
||||
# -------------------------------------------------- basic file hygiene ---
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v6.0.0
|
||||
hooks:
|
||||
- id: trailing-whitespace
|
||||
- id: end-of-file-fixer
|
||||
- id: mixed-line-ending
|
||||
args: [--fix=lf]
|
||||
- id: check-yaml
|
||||
- id: check-json
|
||||
- id: check-toml
|
||||
- id: check-merge-conflict
|
||||
- id: check-added-large-files
|
||||
args: [--maxkb=1024]
|
||||
- id: detect-private-key
|
||||
|
||||
# ------------------------------------------------ conventional commits ---
|
||||
# release-please silently ignores non-conventional messages, so a bad
|
||||
# subject line means "no release and no idea why". This makes it
|
||||
# impossible. Runs on the commit-msg stage, not pre-commit.
|
||||
- repo: https://github.com/commitizen-tools/commitizen
|
||||
rev: v4.19.2
|
||||
hooks:
|
||||
- id: commitizen
|
||||
stages: [commit-msg]
|
||||
|
||||
# ---------------------------------------------------- workflow linting ---
|
||||
# Validates .gitea/workflows syntax and ${{ }} expressions - the class of
|
||||
# bug that hashFiles-skipping and broken YAML came from.
|
||||
- repo: https://github.com/rhysd/actionlint
|
||||
rev: v1.7.12
|
||||
hooks:
|
||||
- id: actionlint
|
||||
files: \.gitea/workflows/.*\.ya?ml$
|
||||
|
||||
# --------------------------------------------------------- ESLint (Nuxt) -
|
||||
# Local hook: needs `pnpm install` to have run in this repo. --fix makes
|
||||
# it a helper; only staged files are linted (fast). When --fix rewrites
|
||||
# a staged file, pre-commit aborts the commit ("files were modified") -
|
||||
# re-stage and commit again; that re-stage loop is the standard price
|
||||
# of a fixer hook.
|
||||
- repo: local
|
||||
hooks:
|
||||
- id: eslint
|
||||
name: eslint --fix (staged files)
|
||||
# no shell wrapper: pre-commit appends the staged filenames to the
|
||||
# entry itself. A 'bash -c' wrapper would eat the first filename
|
||||
# as $0 and eslint would get no file arguments at all (linting the
|
||||
# whole repo instead - review finding on this PR, empirically
|
||||
# verified).
|
||||
entry: pnpm exec eslint --fix
|
||||
language: system
|
||||
files: \.(vue|ts|js|mjs|cjs)$
|
||||
|
||||
# When Go services arrive, add:
|
||||
# - repo: https://github.com/dnephin/pre-commit-golang
|
||||
# rev: <latest>
|
||||
# hooks:
|
||||
# - id: go-fmt
|
||||
# - id: go-imports
|
||||
# - id: golangci-lint # or go-vet for a lighter pass
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
".": "1.0.0"
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
# Changelog
|
||||
|
||||
## 1.0.0 (2026-10-18)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add nuxt application shell ([5caa345](https://github.com/CV_Website/CV_Site_Nuxt/commit/5caa3457aa8f97dfca94059b15f8330e97bfb041))
|
||||
* added dockerignore, a development docker image and a qa/prod docker image ([1a78935](https://github.com/CV_Website/CV_Site_Nuxt/commit/1a78935c23ef2c756912d9f561a69569c2f45d2f))
|
||||
* extend ESLint config with default rule set ([e4ea5c3](https://github.com/CV_Website/CV_Site_Nuxt/commit/e4ea5c3e7c74c4d2c700ced71372da13e031eb6c))
|
||||
* merged main into this branch ([cefdb34](https://github.com/CV_Website/CV_Site_Nuxt/commit/cefdb34d7ec33a176714388a4a0805177e8c4216))
|
||||
* set up ESLint and typecheck with @nuxt/eslint ([4e2a03e](https://github.com/CV_Website/CV_Site_Nuxt/commit/4e2a03eab88495cbfa9db861919189da0c4b2889))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **ci:** address AI review findings (credentials, supply chain) ([85f488a](https://github.com/CV_Website/CV_Site_Nuxt/commit/85f488a94dd8796ea5f11c292edddd32e21398cd))
|
||||
* **ci:** apply review findings round two ([a3e6aef](https://github.com/CV_Website/CV_Site_Nuxt/commit/a3e6aef901086f5f8b416e2aa7d29596517f9550))
|
||||
* **ci:** close the fail-open gate, enforce read-only sandbox ([3e68e63](https://github.com/CV_Website/CV_Site_Nuxt/commit/3e68e630dff92a7abd791b7a8808eb682f37a060))
|
||||
* **ci:** deny write tools, never swallow review errors ([f8d1287](https://github.com/CV_Website/CV_Site_Nuxt/commit/f8d128705faa9493202cf724ae0a451d4dc6d1e5))
|
||||
* **ci:** give release-please git credentials for the release-branch push ([a27bbbb](https://github.com/CV_Website/CV_Site_Nuxt/commit/a27bbbb2abf0fa8ddedd20c05bba2128e88faa3a))
|
||||
* **ci:** hand review diff to agent as file, not argv ([16b9291](https://github.com/CV_Website/CV_Site_Nuxt/commit/16b9291a5111b93d6e7da244f821589fa3432d87))
|
||||
* **ci:** install opencode v2 for the review job ([783c9cc](https://github.com/CV_Website/CV_Site_Nuxt/commit/783c9ccda369fe5ec05ea5085488998de125045c))
|
||||
* **ci:** JSON-encode review with node instead of jq ([a061fad](https://github.com/CV_Website/CV_Site_Nuxt/commit/a061fad9b1933414faa7e6a26bd3182c0ce6c9d7))
|
||||
* **ci:** make droast job actually run ([cf6f209](https://github.com/CV_Website/CV_Site_Nuxt/commit/cf6f209ebf03c3a4faf4e32971ba036d60ddb36b))
|
||||
* **ci:** pass --all-projects to snyk test ([7197f75](https://github.com/CV_Website/CV_Site_Nuxt/commit/7197f757a6447cf29a11f60914d89939bd647040))
|
||||
* **ci:** pick gitleaks binary by CPU architecture ([88dadd5](https://github.com/CV_Website/CV_Site_Nuxt/commit/88dadd584627e963b4dee719768644626e343488))
|
||||
* **ci:** point release-please at PR_GITEA_TOKEN (write scopes) ([e1192a2](https://github.com/CV_Website/CV_Site_Nuxt/commit/e1192a2014da8acfea37c5319f0b612f9f5a392e))
|
||||
* **ci:** pull gitleaks from GHCR and pin version ([ce9c090](https://github.com/CV_Website/CV_Site_Nuxt/commit/ce9c090a150e448919205f9386ff61bfe77dfdb9))
|
||||
* **ci:** run app jobs from repo root ([bb13f1a](https://github.com/CV_Website/CV_Site_Nuxt/commit/bb13f1a187d482b9bb55dafa303356114ece42ae))
|
||||
* **ci:** run gitleaks as binary in node image ([779cf20](https://github.com/CV_Website/CV_Site_Nuxt/commit/779cf20f45ec8db009065197140067a531649401))
|
||||
* **ci:** run Snyk CLI via npm on arm64 runner ([8d2a000](https://github.com/CV_Website/CV_Site_Nuxt/commit/8d2a00062e6381cbba9bdb703b210c8eb2201d92))
|
||||
* **ci:** use opencode-go plan model for AI review ([8b6bcb6](https://github.com/CV_Website/CV_Site_Nuxt/commit/8b6bcb6d70d123dda551f08ef2c05dc3d50733f2))
|
||||
* **ci:** use pnpm 11 in runner ([ecd0192](https://github.com/CV_Website/CV_Site_Nuxt/commit/ecd0192466f8d72b9f8532e32b1aea63ff9dd640))
|
||||
* pass staged filenames to the eslint pre-commit hook ([81d658a](https://github.com/CV_Website/CV_Site_Nuxt/commit/81d658a87105434835016ae20b24ef3cb7617d86))
|
||||
* remove leftover merge conflict marker from pr-checker.yml ([8f36f14](https://github.com/CV_Website/CV_Site_Nuxt/commit/8f36f14720a4826fe4b4cebdf591994fa0961ae3))
|
||||
Whitespace-only changes.
@@ -0,0 +1,19 @@
|
||||
FROM node:26-slim@sha256:d62f13676d530f7edf97782729df69713c8ccfe6631e7f62f9ccab65968719a8
|
||||
|
||||
# Node no longer bundles pnpm (corepack and pnpm are both absent from this
|
||||
# image), so install it. First instruction, so later changes reuse the layer.
|
||||
RUN npm install -g pnpm@11.26.0
|
||||
|
||||
# The bind mount lands here at run time, owned by the image's `node` user.
|
||||
# Its uid 1000 matches the host uid, so files it writes stay yours.
|
||||
RUN mkdir -p /app && chown node:node /app
|
||||
USER node
|
||||
WORKDIR /app
|
||||
|
||||
# Manifests only: this layer and the install below survive every source edit
|
||||
# and re-run only when a manifest changes.
|
||||
COPY --chown=node:node package.json pnpm-lock.yaml pnpm-workspace.yaml ./
|
||||
RUN pnpm install --frozen-lockfile
|
||||
|
||||
EXPOSE 3000
|
||||
CMD ["pnpm", "run", "dev", "--", "--host", "0.0.0.0"]
|
||||
@@ -0,0 +1,70 @@
|
||||
---
|
||||
type: Decision
|
||||
title: AI code review setup
|
||||
description: The review job runs opencode with the opencode-go plan model, env-only auth, a read-only permission set, and posts only reviews that end with a verdict line.
|
||||
tags: [decision, ci, ai, opencode, security]
|
||||
status: draft
|
||||
generated: { by: opencode-go/glm-5.3-flash, at: 2026-10-18T16:05:00Z }
|
||||
verified: { by: human:noel, at: not yet }
|
||||
sources:
|
||||
- id: pr-checker
|
||||
resource: .gitea/workflows/pr-checker.yml
|
||||
title: PR Check workflow, review job
|
||||
- id: go-plan
|
||||
resource: https://opencode.ai/v2/docs/console/go/
|
||||
title: OpenCode Go plan documentation
|
||||
---
|
||||
|
||||
# Decision
|
||||
|
||||
The review job installs opencode v2 from the dedicated v2 installer,
|
||||
authenticates with `OPENCODE_API_KEY` from the environment only, runs
|
||||
`opencode-go/deepseek-v4-pro#max` (covered by the Go plan subscription,
|
||||
no per-token cost), denies `edit`/`shell`/`webfetch`/`websearch` via a
|
||||
global permission config written outside the checkout, and posts the
|
||||
review as a PR comment only if the output ends with a `VERDICT:` line.
|
||||
|
||||
# Why each piece
|
||||
|
||||
| Piece | Why |
|
||||
|---|---|
|
||||
| Provider prefix `opencode-go`, not `opencode` | `opencode` is the pay-per-call Console gateway; the Go plan lives under its own provider id. The wrong prefix failed every run with "Insufficient account funds". |
|
||||
| The v2 installer (`/v2/install`) | The classic installer ships OpenCode 1.x (v1.19.3 on arm64), which cannot resolve model variants and failed with `ProviderModelNotFoundError` for `#max`. |
|
||||
| Env-only auth, no `opencode.json` in the checkout | A config file in the workspace holds the API key in plaintext where the review agent can read it; a malicious PR diff could prompt-inject the agent into quoting the key in the publicly visible review comment. Environment variables are invisible to file reads. |
|
||||
| Deny write tools via a global config outside the checkout | Headless runs cannot answer permission prompts; denials prevent both hangs and repo modification. The config file itself holds no secret, so its location leaks nothing. |
|
||||
| Verdict line as the posting gate | `opencode` can exit non-zero after a fully completed review (observed: benign permission denials). A completed review always ends with a verdict line; error dumps never do. The verdict, not the exit code, decides whether a comment is posted. |
|
||||
| `--print-logs` | Provider and auth errors otherwise die inside the captured output file, invisible in the job log. |
|
||||
| Diff passed as a file, lockfile excluded | The diff as a CLI argument exceeded `MAX_ARG_STRLEN` (128 KiB per argument; the diff was 190 KB, mostly `pnpm-lock.yaml`). The agent reads `.pr-review-diff.patch` with its file tools. |
|
||||
|
||||
# The review prompt
|
||||
|
||||
The prompt names the stack (Nuxt 4 frontend, Go backends to come), lists
|
||||
what the other CI jobs already catch so the model does not repeat them,
|
||||
and focuses on SSR/hydration pitfalls, reactivity bugs, injection and
|
||||
authz gaps, runtime-config leaks, and Go error/concurrency hygiene. It
|
||||
prescribes the output format (`[BLOCKER]/[WARN]/[NIT] file:line`) and
|
||||
derives the verdict from the findings, so the gate and the prompt agree.
|
||||
|
||||
# Evidence
|
||||
|
||||
* First real review on PR #5 (2026-10-18): produced five findings,
|
||||
including a genuine regression in the workflow itself (a lost
|
||||
`chmod +x` on the droast binary), verified upstream release assets and
|
||||
the v2 permission schema live, and returned `VERDICT: REQUEST_CHANGES`.
|
||||
* Fresh-container replica test (node:22-bookworm, key-only auth)
|
||||
reproduced the CI failure exactly, then confirmed the v2 + `#max` fix
|
||||
before it was pushed.
|
||||
|
||||
# Not verified
|
||||
|
||||
* Whether `#max` still resolves after a future CLI upgrade — the variant
|
||||
list comes from the model catalog, not a contract.
|
||||
* Long-run behaviour of Go plan usage windows ($3 per 5 hours for
|
||||
DeepSeek V4 Pro) under real review frequency.
|
||||
|
||||
# Revisit when
|
||||
|
||||
* A PR review fails again with a new error class — check the provider
|
||||
prefix, the CLI version, and the usage limits first; they caused every
|
||||
failure so far.
|
||||
* Go Plus or pay-as-you-go balance becomes relevant.
|
||||
@@ -0,0 +1,76 @@
|
||||
---
|
||||
type: Decision
|
||||
title: Build context filter
|
||||
description: The .dockerignore keeps secrets and noise out of the build context, but must never exclude a path the Dockerfile copies.
|
||||
tags: [decision, docker, dockerignore]
|
||||
status: stable
|
||||
generated: { by: opencode/deepseek-v4.1-flash, at: 2026-10-18T12:41:52Z }
|
||||
verified: { by: human:noel, at: 2026-10-18T12:41:52Z }
|
||||
sources:
|
||||
- id: docker-context
|
||||
resource: https://docs.docker.com/build/building/context/
|
||||
title: Docker build context and .dockerignore files
|
||||
---
|
||||
|
||||
# Decision
|
||||
|
||||
Two rules, in this order:
|
||||
|
||||
1. **Secrets never enter the build context** — `.env`, `.env.*` (with
|
||||
`!.env.example` as an exception), `*.pem`, `*.key`, `.npmrc`.
|
||||
2. **Noise stays out** — `node_modules`, `.nuxt`, `.output`, `.nitro`, `.data`,
|
||||
`.cache`, `dist`, `*.log`, `coverage`, plus repo and editor metadata.
|
||||
|
||||
And one rule that overrides both: **nothing the Dockerfile copies may appear in
|
||||
the file.** The manifests, `nuxt.config.ts`, `app/`, `public/` and `tsconfig.json`
|
||||
are deliberately absent.
|
||||
|
||||
# Why
|
||||
|
||||
`.dockerignore` does not decide what lands in the image; it decides what is sent
|
||||
to the builder as the build context. What lands in the image is decided by `COPY`
|
||||
and `RUN`. So the question is never "is this file dangerous to include" but "does
|
||||
any instruction need this file, and is sending it costing something".
|
||||
|
||||
That is what makes the two jobs conflict. A broad list is the right instinct when
|
||||
the Dockerfile says `COPY . .`, because the list is then the only thing standing
|
||||
between the working tree and the image. Explicitly copying named manifests
|
||||
inverts it: the list stops protecting and starts subtracting files the build
|
||||
asks for.
|
||||
|
||||
# The failure mode
|
||||
|
||||
Excluding a `COPY` target does not silently skip the file. It warns, then fails
|
||||
the build. Measured on a scratch context containing only `package.json` and
|
||||
`pnpm-workspace.yaml`, with `pnpm-workspace.yaml` in the ignore file:
|
||||
|
||||
```
|
||||
- CopyIgnoredFile: Attempting to Copy file "pnpm-workspace.yaml" that is excluded by .dockerignore (line 2)
|
||||
ERROR: failed to build: failed to solve: failed to compute cache key:
|
||||
failed to calculate checksum of ref ...: "/pnpm-workspace.yaml": not found
|
||||
```
|
||||
|
||||
The warning names the offending line of `.dockerignore`, which is the useful part:
|
||||
the failure otherwise reads like a typo in the Dockerfile.
|
||||
|
||||
`pnpm-workspace.yaml` is worth calling out because in pnpm 11 it is not only
|
||||
workspace globs — it carries pnpm settings such as `allowBuilds` and
|
||||
`minimumReleaseAgeExclude`, so excluding it from a build changes install
|
||||
behaviour as well as breaking the copy.
|
||||
|
||||
# Consequences
|
||||
|
||||
* `.npmrc` sits under secrets, so registry configuration has to reach a build
|
||||
through a build argument rather than the file.
|
||||
* The excluded `Dockerfile`, `Dockerfile.*` and `.dockerignore` entries are safe:
|
||||
those files are still sent to the builder because the build needs them, they
|
||||
simply cannot be copied into the image.
|
||||
* For the dev image the context is three manifests, so the rest of the list does
|
||||
nothing there. The size effect it is meant to have lands in an image that does
|
||||
copy the source.
|
||||
|
||||
# Evidence
|
||||
|
||||
The second dev build transferred a context of 108 bytes, which is the three
|
||||
manifests and nothing else. The failure text above was reproduced in a scratch
|
||||
context so the repository was not modified.
|
||||
@@ -0,0 +1,57 @@
|
||||
---
|
||||
type: Decision
|
||||
title: Build layer order
|
||||
description: Manifests are copied and installed before any source, so a source edit cannot invalidate the dependency install.
|
||||
tags: [decision, docker, caching]
|
||||
status: stable
|
||||
generated: { by: opencode/deepseek-v4.1-flash, at: 2026-10-18T12:41:52Z }
|
||||
verified: { by: human:noel, at: 2026-10-18T12:41:52Z }
|
||||
sources:
|
||||
- id: docker-cache
|
||||
resource: https://docs.docker.com/build/cache/
|
||||
title: Docker build cache
|
||||
---
|
||||
|
||||
# Decision
|
||||
|
||||
Order the instructions so that the things that change rarely are installed
|
||||
first, and the things that change constantly are copied last.
|
||||
|
||||
1. Base image, then the toolchain (`pnpm`).
|
||||
2. `COPY` the manifests only — `package.json`, `pnpm-lock.yaml`, `pnpm-workspace.yaml`.
|
||||
3. `pnpm install --frozen-lockfile`.
|
||||
4. (In an image that copies source at all) `COPY` the source, then build.
|
||||
|
||||
# Why
|
||||
|
||||
Each instruction is a layer, and a change in one layer invalidates that layer and
|
||||
every layer after it. The install is the slow step, so anything that changes
|
||||
often — the source — has to sit after it. Copying the whole source before
|
||||
installing would make every source edit re-run the install, which is exactly the
|
||||
cost the ordering is meant to avoid.
|
||||
|
||||
# What invalidates what
|
||||
|
||||
| Change | Effect |
|
||||
|---|---|
|
||||
| Edit `app/app.vue` | Nothing. In the dev image the source is never copied, so no layer depends on it. |
|
||||
| Edit `package.json`, `pnpm-lock.yaml` or `pnpm-workspace.yaml` | The `COPY` of the manifests and the install after it re-run; earlier layers stay cached. |
|
||||
| Change the pinned base image or the `pnpm` version | Everything from that instruction onward re-runs. |
|
||||
|
||||
# Evidence
|
||||
|
||||
The second consecutive `docker build -f Dockerfile.dev` reported every layer as
|
||||
`CACHED`, and the context transfer was 108 bytes — it contains only the three
|
||||
manifests, so no source edit can reach any layer.
|
||||
|
||||
# Not chosen
|
||||
|
||||
An earlier draft of the dev file ended with `COPY . . --cache` and
|
||||
`pnpm build`. The `COPY` instruction has no `--cache` flag, so that line is a
|
||||
build error, and building the application into a dev image works against running
|
||||
the dev server from a mounted source.
|
||||
|
||||
# Revisit when
|
||||
|
||||
The project gains a second package with its own manifest, which changes what
|
||||
belongs in the manifests-only copy.
|
||||
@@ -0,0 +1,89 @@
|
||||
---
|
||||
type: Decision
|
||||
title: Dev container shape
|
||||
description: The Nuxt source is bind-mounted into a container that already holds the toolchain and the dependencies, and the dev server runs as the image's node user.
|
||||
tags: [decision, docker, nuxt, development]
|
||||
status: stable
|
||||
generated: { by: opencode/deepseek-v4.1-flash, at: 2026-10-18T12:41:52Z }
|
||||
verified: { by: human:noel, at: 2026-10-18T12:41:52Z }
|
||||
sources:
|
||||
- id: node-image
|
||||
resource: docker.io/library/node:26-slim@sha256:d62f13676d530f7edf97782729df69713c8ccfe6631e7f62f9ccab65968719a8
|
||||
title: Node 26 slim base image
|
||||
---
|
||||
|
||||
# Decision
|
||||
|
||||
`Dockerfile.dev` is a prepared runtime, not a build of the application. It holds
|
||||
the toolchain and the installed dependencies. The source arrives at run time as a
|
||||
bind mount, and the container runs the Nuxt dev server. There is no `COPY . .` and
|
||||
no build step in the dev image.
|
||||
|
||||
# Why
|
||||
|
||||
The alternative is to copy the source into the image and rebuild on every edit,
|
||||
which makes each edit cost a full image build. With the source mounted, an edit is
|
||||
a file write and the dev server's own reload does the rest. The image stops being
|
||||
something you rebuild and becomes something you run.
|
||||
|
||||
# Shape
|
||||
|
||||
```dockerfile
|
||||
FROM node:26-slim@sha256:d62f13676d530f7edf97782729df69713c8ccfe6631e7f62f9ccab65968719a8
|
||||
|
||||
# Node no longer bundles pnpm (corepack and pnpm are both absent from this
|
||||
# image), so install it. First instruction, so later changes reuse the layer.
|
||||
RUN npm install -g pnpm@11.26.0
|
||||
|
||||
# The bind mount lands here at run time, owned by the image's `node` user.
|
||||
# Its uid 1000 matches the host uid, so files it writes stay yours.
|
||||
RUN mkdir -p /app && chown node:node /app
|
||||
USER node
|
||||
WORKDIR /app
|
||||
|
||||
# Manifests only: this layer and the install below survive every source edit
|
||||
# and re-run only when a manifest changes.
|
||||
COPY --chown=node:node package.json pnpm-lock.yaml pnpm-workspace.yaml ./
|
||||
RUN pnpm install --frozen-lockfile
|
||||
|
||||
EXPOSE 3000
|
||||
CMD ["pnpm", "run", "dev", "--", "--host", "0.0.0.0"]
|
||||
```
|
||||
|
||||
| Piece | Choice | Why |
|
||||
|---|---|---|
|
||||
| Base image | `node:26-slim`, pinned by digest | The digest makes the build reproducible; the checked digest resolves to Node v26.12.0. |
|
||||
| pnpm | Installed explicitly, pinned to 11.26.0 | Neither `corepack` nor `pnpm` is present in the image. The pin matches the host version, so the same lockfile format is used on both sides. |
|
||||
| User | The image's `node` user, uid 1000 | The host uid is also 1000. Files the dev server writes into the mounted repo stay owned by Noel instead of becoming root-owned. This is not a security measure. |
|
||||
| `node_modules` | Anonymous volume at `/app/node_modules` | The bind mount replaces all of `/app`, which would otherwise hide the dependencies installed in the image. |
|
||||
| Command | `pnpm run dev -- --host 0.0.0.0` | The dev server would otherwise listen on localhost inside the container and be unreachable from the host. The `--` passes the flag through pnpm to the `dev` script rather than letting pnpm interpret it. |
|
||||
|
||||
# Evidence
|
||||
|
||||
| Command | Result |
|
||||
|---|---|
|
||||
| `docker build -f Dockerfile.dev -t cv-site-nuxt:dev .` | Builds. `esbuild`'s postinstall ran, so the `allowBuilds` setting in `pnpm-workspace.yaml` is honoured. `pnpm install` reported "Lockfile passes supply-chain policies (593 entries)". |
|
||||
| Same build run a second time | Every layer `CACHED`. |
|
||||
| `docker run -v <repo>:/app -v /app/node_modules -p 13000:3000 cv-site-nuxt:dev` | `HTTP 200` from the host after 4 seconds; server reported "Ready in 2.02s". |
|
||||
| `ls -A /app/node_modules` inside that container | 9 entries (`nuxt`, `vue`, `vue-router`, `.pnpm`, …) — the anonymous volume is populated from the image rather than starting empty. |
|
||||
| Ownership of `.nuxt` on the host after that run | `noel:noel`, so the uid-1000 choice holds. |
|
||||
|
||||
# Side effects on the host
|
||||
|
||||
The bind mount means Docker resolves the mount point for the `node_modules`
|
||||
volume through the host directory, so a first run leaves an empty, root-owned
|
||||
`node_modules` in the repository. It deletes without sudo, and if the directory
|
||||
already exists the ownership is left alone — a pre-created directory stays
|
||||
`noel:noel`.
|
||||
|
||||
# Not verified
|
||||
|
||||
* `docker compose up --build -V` as the remedy for a stale anonymous volume after
|
||||
a dependency change was not tested.
|
||||
* That a root-owned `node_modules` breaks a host-side `pnpm install` is inferred
|
||||
from the permissions, not measured.
|
||||
|
||||
# Revisit when
|
||||
|
||||
* The container runs on a machine whose uid is not 1000.
|
||||
* The dev server needs a host port other than 3000.
|
||||
@@ -0,0 +1,11 @@
|
||||
# Decisions
|
||||
|
||||
* [PR pipeline layering](pr-pipeline-layering.md) - What runs pre-commit, what runs in Gitea Actions, what the AI review does, and the cost rule that decides.
|
||||
* [AI review setup](ai-review-setup.md) - Plan model, env-only auth against prompt injection, read-only agent, and the verdict line as the posting gate.
|
||||
* [Release engineering](release-engineering.md) - release-please in manifest mode, conventional commits as input, message format enforced at commit time.
|
||||
* [Snyk paused and secrets policy](snyk-paused-and-secrets-policy.md) - Why the job is skipped rather than deleted, and the token scopes every workflow secret needs.
|
||||
* [Dev container shape](dev-container-shape.md) - The source is bind-mounted into a container that already holds the dependencies, and the dev server runs as the image's `node` user.
|
||||
* [Build layer order](build-layer-order.md) - Why the manifests are copied before the source, and what invalidates what.
|
||||
* [Build context filter](build-context-filter.md) - What `.dockerignore` may exclude, and the one thing it must never exclude.
|
||||
* [Repository and compose layout](repo-and-compose-layout.md) - The Dockerfiles live with the app; the stack is assembled in `Local_Development`.
|
||||
* [Mockup layout](mockup-layout.md) - One `DESIGN.md` per screen, with the screenshot and the source embedded.
|
||||
@@ -0,0 +1,55 @@
|
||||
---
|
||||
type: Decision
|
||||
title: Mockup layout
|
||||
description: Every mockup screen folder holds DESIGN.md, code.html and screen.png, with the screenshot and the full source embedded in the markdown.
|
||||
tags: [decision, design, mockups]
|
||||
status: stable
|
||||
generated: { by: opencode/deepseek-v4.1-flash, at: 2026-10-18T12:41:52Z }
|
||||
verified: { by: human:noel, at: 2026-10-18T12:41:52Z }
|
||||
sources:
|
||||
- id: stitch-export
|
||||
resource: Stitch export "resilient_systems_engineer_portfolio", seven screens
|
||||
title: Stitch export used for the mockups
|
||||
---
|
||||
|
||||
# Decision
|
||||
|
||||
Each screen is one folder holding three files, all at the same level:
|
||||
|
||||
| File | Role |
|
||||
|---|---|
|
||||
| `DESIGN.md` | The screen as a document: frontmatter, the screenshot rendered inline, then the full source in a fenced block. |
|
||||
| `code.html` | The screen's source, unchanged. |
|
||||
| `screen.png` | The rendered screenshot, kept separately so it can be opened directly. |
|
||||
|
||||
The export's folder names were replaced with short, consistent ones:
|
||||
|
||||
| Export name | Folder |
|
||||
|---|---|
|
||||
| `noel_sabia_homepage_cv_overview` | `homepage` |
|
||||
| `noel_sabia_overview_mobile` | `homepage_mobile` |
|
||||
| `noel_sabia_dev_view_technical_telemetry` | `dev_view` |
|
||||
| `noel_sabia_dev_view_mobile` | `dev_view_mobile` |
|
||||
| `noel_sabia_life_map` | `life_map` |
|
||||
| `noel_sabia_life_map_mobile` | `life_map_mobile` |
|
||||
| `noel_sabia_infrastructure_ai_resilience` | `design_system` |
|
||||
|
||||
# Why
|
||||
|
||||
A screen should be readable as one document without opening anything else, which
|
||||
is what embedding the screenshot and the source gives. Keeping `screen.png` beside
|
||||
the markdown as well is for looking at the picture on its own, without reading the
|
||||
document around it.
|
||||
|
||||
The frontmatter on `DESIGN.md` — `type`, `title`, `description`, `tags`,
|
||||
`status` — is also valid concept frontmatter, so these files are readable as
|
||||
concepts if the mockups are ever folded into a knowledge bundle.
|
||||
|
||||
# Notes
|
||||
|
||||
* The export shipped `DESIGN.md` and nothing else for the infrastructure folder.
|
||||
That folder is the design-token document, not a screen, so it deliberately has
|
||||
no `code.html` and no `screen.png`.
|
||||
* A second, byte-identical copy of the export was deleted. Equality was checked
|
||||
file by file with `cmp` across all 13 files before anything was removed.
|
||||
* Committed as `docs(design): embed screenshot and source into per-screen DESIGN.md`.
|
||||
@@ -0,0 +1,74 @@
|
||||
---
|
||||
type: Decision
|
||||
title: PR pipeline layering
|
||||
description: Three layers - pre-commit hooks for cheap deterministic checks, Gitea Actions for thorough checks, an AI reviewer for judgment - and the rule that decides what runs where.
|
||||
tags: [decision, ci, gitea-actions, pre-commit, security]
|
||||
status: draft
|
||||
generated: { by: opencode-go/glm-5.3-flash, at: 2026-10-18T16:05:00Z }
|
||||
verified: { by: human:noel, at: not yet }
|
||||
sources:
|
||||
- id: pr-checker
|
||||
resource: .gitea/workflows/pr-checker.yml
|
||||
title: PR Check workflow
|
||||
- id: pre-commit
|
||||
resource: .pre-commit-config.yaml
|
||||
title: Pre-commit guardrails
|
||||
---
|
||||
|
||||
# Decision
|
||||
|
||||
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).
|
||||
3. **AI code review** (per PR push): opencode with a plan-covered model,
|
||||
verdict-based, posted as a PR comment.
|
||||
|
||||
The split rule: anything that finishes in seconds and auto-fixes goes in
|
||||
pre-commit; anything slow, network-bound or quota-bound goes in CI; anything
|
||||
that produces judgment rather than a pass/fail is the AI review. Nothing
|
||||
slow lives in pre-commit — one slow hook gets bypassed with `--no-verify`
|
||||
once and is dead weight forever.
|
||||
|
||||
# Why
|
||||
|
||||
Each layer catches what the previous one cannot. Pre-commit sees the commit
|
||||
before it exists; CI sees the whole PR on a clean machine; the AI review
|
||||
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.
|
||||
|
||||
# What the pipeline bought us in practice
|
||||
|
||||
Recorded so the reasoning survives: during the first week the pipeline
|
||||
caught leaked secrets in history (gitleaks), a review model configured
|
||||
against the wrong provider account, a Dockerfile-lint job that silently
|
||||
never ran (`hashFiles` evaluating empty in the act runner), a review that
|
||||
completed but exited non-zero, and an attacker-relevant credential
|
||||
exposure in the review setup — each fixed where it was cheapest.
|
||||
|
||||
# Failure modes deliberately designed against
|
||||
|
||||
| Failure seen | Guard now in place |
|
||||
|---|---|
|
||||
| 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 |
|
||||
| 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 |
|
||||
|
||||
# Not verified
|
||||
|
||||
* That the Snyk job still works when re-enabled — it was disabled while
|
||||
the free quota was the binding constraint.
|
||||
* That the pipeline behaves on Gitea runner versions other than v0.6.1.
|
||||
|
||||
# Revisit when
|
||||
|
||||
* A second repository needs the same pipeline (extract a reusable
|
||||
workflow include).
|
||||
* The Go plan's usage limits are hit by review traffic.
|
||||
@@ -0,0 +1,64 @@
|
||||
---
|
||||
type: Decision
|
||||
title: Release engineering
|
||||
description: Releases are produced by release-please in manifest mode, driven by conventional commits, with the message format enforced at commit time by commitizen.
|
||||
tags: [decision, release, release-please, ci]
|
||||
status: draft
|
||||
generated: { by: opencode-go/glm-5.3-flash, at: 2026-10-18T16:05:00Z }
|
||||
verified: { by: human:noel, at: not yet }
|
||||
sources:
|
||||
- id: config
|
||||
resource: release-please-config.json
|
||||
title: release-please configuration
|
||||
- id: manifest
|
||||
resource: .release-please-manifest.json
|
||||
title: release-please manifest
|
||||
- id: workflow
|
||||
resource: .gitea/workflows/release-please.yml
|
||||
title: release-please workflow
|
||||
---
|
||||
|
||||
# Decision
|
||||
|
||||
On every push to `main`, release-please (manifest mode) collects
|
||||
conventional commits, derives the next version, and opens a release PR
|
||||
that bumps `package.json`, updates `CHANGELOG.md` and moves the manifest
|
||||
forward. Merging that PR creates the release. The message format that
|
||||
feeds this machine is enforced locally by the commitizen pre-commit hook.
|
||||
|
||||
# Why
|
||||
|
||||
* **Manifest mode** (config JSON + manifest JSON) over inline
|
||||
`release-type` in the workflow: the configuration becomes part of the
|
||||
repository, reviewable in PRs, instead of buried in workflow YAML.
|
||||
* **Plain tags** (`v1.0.0`, `include-component-in-tag: false`):
|
||||
single-package repository; component-prefixed tags would be noise.
|
||||
* **A `version` field in `package.json`**: the `node` release type reads
|
||||
it; without the field the release machinery cannot track anything.
|
||||
* **Enforcement at commit time**: a non-conventional message is not an
|
||||
error release-please reports — it just silently produces no release.
|
||||
Commitizen turns that silent failure into a blocked commit.
|
||||
|
||||
# How a release happens, end to end
|
||||
|
||||
1. Work lands on branches as conventional commits (`feat:`, `fix:`,
|
||||
`chore:`, …), enforced by the local hook.
|
||||
2. Merge to `main` → release-please opens/updates a release PR
|
||||
(`chore(main): release …`).
|
||||
3. Merge the release PR → version bumped, changelog written, tag
|
||||
`vX.Y.Z` created.
|
||||
|
||||
# Not verified
|
||||
|
||||
* The first release PR end to end — needs at least one `feat:`/`fix:`
|
||||
commit on `main` after the workflow merge.
|
||||
* That `RELEASE_PLEASE_TOKEN_CV_SITE_NUXT` carries the `write:issue`
|
||||
scope the same way `PR_GITEA_TOKEN` needed it; the previous failure
|
||||
was an immediate API rejection consistent with a scope problem.
|
||||
|
||||
# Revisit when
|
||||
|
||||
* A second package appears in the repository (then
|
||||
`include-component-in-tag` and `separate-pull-requests` matter).
|
||||
* A release must trigger a deploy — the workflow gains a step after
|
||||
`release_created` is set.
|
||||
@@ -0,0 +1,44 @@
|
||||
---
|
||||
type: Decision
|
||||
title: Repository and compose layout
|
||||
description: Each application repository owns its Dockerfiles; Local_Development holds the compose file that assembles the stack.
|
||||
tags: [decision, docker, compose, repositories]
|
||||
status: stable
|
||||
generated: { by: opencode/deepseek-v4.1-flash, at: 2026-10-18T12:41:52Z }
|
||||
sources:
|
||||
- id: okf-spec
|
||||
resource: https://github.com/GoogleCloudPlatform/knowledge-catalog/blob/main/okf/SPEC.md
|
||||
title: Open Knowledge Format specification, version 0.2
|
||||
---
|
||||
|
||||
# Decision
|
||||
|
||||
* `CV_Site_Nuxt/` owns its images: `Dockerfile.dev` and `Dockerfile` live with the
|
||||
application they build.
|
||||
* `Local_Development/` is the stack entry point. Its `docker-compose.yml` builds
|
||||
the application by relative path (`../CV_Site_Nuxt`) rather than duplicating any
|
||||
build definition.
|
||||
* The design mockups live in `Local_Development/design/`.
|
||||
* This knowledge bundle lives inside the application repository it describes,
|
||||
which the format allows for a bundle kept as a subdirectory of a larger
|
||||
repository.
|
||||
|
||||
# Why
|
||||
|
||||
A Dockerfile is part of the application, not part of the environment that runs
|
||||
it. Keeping it with the app means the image definition is versioned, reviewed and
|
||||
released with the code it builds, and the compose file stays a thin description
|
||||
of how the pieces are wired together for local work.
|
||||
|
||||
# Consequences
|
||||
|
||||
* The compose file cannot be built from a checkout of `Local_Development/` alone;
|
||||
it needs the sibling application repository present.
|
||||
* Adding a service means adding a compose entry that points at another
|
||||
repository's Dockerfile.
|
||||
|
||||
# State
|
||||
|
||||
The compose file is being written and is not yet valid: the build key is
|
||||
malformed and the port entry is empty. The shape of the mount it will use is still
|
||||
an [open question](/open-questions.md).
|
||||
@@ -0,0 +1,51 @@
|
||||
---
|
||||
type: Decision
|
||||
title: Snyk paused, quotas and secrets policy
|
||||
description: The Snyk job stays in the workflow but is disabled via `if: false` - the free plan quota was the binding constraint - and every Gitea token secret must carry the write:issue scope.
|
||||
tags: [decision, security, ci, snyk]
|
||||
status: draft
|
||||
generated: { by: opencode-go/glm-5.3-flash, at: 2026-10-18T16:05:00Z }
|
||||
verified: { by: human:noel, at: not yet }
|
||||
sources:
|
||||
- id: pr-checker
|
||||
resource: .gitea/workflows/pr-checker.yml
|
||||
title: PR Check workflow, snyk job
|
||||
---
|
||||
|
||||
# Decision
|
||||
|
||||
1. The Snyk job remains in `pr-checker.yml` with `if: false` — skipped,
|
||||
not deleted. All the arm64/npm-CLI engineering is preserved for the
|
||||
day it is re-enabled.
|
||||
2. When re-enabled, it should not run on every push; a schedule or a
|
||||
ready-for-review gate fits the quota better.
|
||||
3. Gitea API tokens used by workflow secrets must have `issue`
|
||||
read+write **and** `repository` read+write, and must not be
|
||||
public-only. One well-scoped token serves both the AI review comment
|
||||
posting and release-please.
|
||||
|
||||
# Why
|
||||
|
||||
* The Snyk free plan grants a small monthly test budget; the pipeline
|
||||
would burn two tests per PR push. The job failed on its first runs for
|
||||
two independent reasons (an amd64-only container image, then the
|
||||
workspace-detection error) before the quota question even arose — the
|
||||
pause is about quota, the fixes are about portability.
|
||||
* The `write:issue` scope was discovered the hard way: posting a PR
|
||||
comment goes through Gitea's issues API, and a token with only
|
||||
`write:repository` fails with HTTP 403 naming the missing scope. The
|
||||
error text is the diagnostic — the comment-posting step now prints
|
||||
status code and response body on failure instead of `curl -sf`
|
||||
silence.
|
||||
|
||||
# Not verified
|
||||
|
||||
* Whether the current `RELEASE_PLEASE_TOKEN_CV_SITE_NUXT` value carries
|
||||
the correct scopes — its failure signature suggested it did not.
|
||||
|
||||
# Revisit when
|
||||
|
||||
* The quota constraint changes (paid tier, or a schedule-based scan
|
||||
makes the budget predictable).
|
||||
* Gitea adds fine-grained token scopes that separate "comment on PR"
|
||||
from "write issues".
|
||||
@@ -0,0 +1,42 @@
|
||||
---
|
||||
okf_version: "0.2"
|
||||
---
|
||||
|
||||
# Start here
|
||||
|
||||
This bundle explains the Nuxt repository: how it is developed, checked,
|
||||
released, and what was learned getting there. It is the "why" behind the
|
||||
config files — the configs say what, these documents say why.
|
||||
|
||||
* [Open questions](open-questions.md) - What is still undecided for the Nuxt site.
|
||||
* [Update log](log.md) - History of changes to this bundle.
|
||||
|
||||
# Decisions
|
||||
|
||||
## CI/CD and releases (2026-10-18)
|
||||
|
||||
* [PR pipeline layering](decisions/pr-pipeline-layering.md) - Three layers: pre-commit for cheap deterministic checks, Gitea Actions for thorough ones, AI review for judgment.
|
||||
* [AI review setup](decisions/ai-review-setup.md) - Plan model, env-only auth against prompt injection, read-only agent, verdict line as the posting gate.
|
||||
* [Release engineering](decisions/release-engineering.md) - release-please in manifest mode; conventional commits enforced at commit time.
|
||||
* [Snyk paused and secrets policy](decisions/snyk-paused-and-secrets-policy.md) - Quota-paused job kept in place; `write:issue` scope required on every workflow token.
|
||||
|
||||
## Docker and development environment
|
||||
|
||||
* [Dev container shape](decisions/dev-container-shape.md) - The source is bind-mounted into a container that already holds the dependencies, and the dev server runs as the image's `node` user.
|
||||
* [Build layer order](decisions/build-layer-order.md) - Why the manifests are copied before the source, and what invalidates what.
|
||||
* [Build context filter](decisions/build-context-filter.md) - What `.dockerignore` may exclude, and the one thing it must never exclude.
|
||||
* [Repository and compose layout](decisions/repo-and-compose-layout.md) - The Dockerfiles live with the app; the stack is assembled in `Local_Development`.
|
||||
* [Mockup layout](decisions/mockup-layout.md) - One `DESIGN.md` per screen, with the screenshot and the source embedded.
|
||||
|
||||
# The one-paragraph history
|
||||
|
||||
The repository started as the Nuxt app shell. Docker development (dev
|
||||
container, layer order, context filter) came first, then a single day of
|
||||
CI/CD work built the PR pipeline layer by layer — lint, typecheck,
|
||||
secret scan, dependency audit, Dockerfile lint, AI review — fixing one
|
||||
real failure per layer as it appeared (wrong provider account, wrong
|
||||
CLI major version, arm64-hostile vendor images, a silently-skipping
|
||||
`hashFiles`, a prompt-injectable credential file), then wired releases
|
||||
via release-please and locked the message format with pre-commit hooks.
|
||||
The pipeline now fails loudly, posts only real reviews, and needs no
|
||||
human faith to operate.
|
||||
@@ -0,0 +1,15 @@
|
||||
# Update Log
|
||||
|
||||
## 2026-10-18 (later — CI/CD and releases)
|
||||
* **Creation**: Recorded the [PR pipeline layering](decisions/pr-pipeline-layering.md) — three layers (pre-commit, Gitea Actions, AI review), the cost rule that assigns checks to layers, and the failure modes the pipeline was designed against.
|
||||
* **Creation**: Recorded the [AI review setup](decisions/ai-review-setup.md): the `opencode-go` provider prefix (the wrong one failed every run with "Insufficient account funds"), the v2 installer (v1 cannot resolve model variants), env-only auth after the prompt-injection finding, the read-only permission set, and the verdict line as the posting gate.
|
||||
* **Creation**: Recorded [release engineering](decisions/release-engineering.md): release-please in manifest mode, plain `v`-tags, the `version` field requirement, and why conventional commits are enforced at commit time.
|
||||
* **Creation**: Recorded [Snyk paused and secrets policy](decisions/snyk-paused-and-secrets-policy.md): quota-paused job kept in the workflow, and the `write:issue` scope requirement for all workflow tokens (learned from a 403 that named its missing scope).
|
||||
* **Update**: Rewrote [index](/index.md) to group Docker-era and CI-era decisions and added a one-paragraph history.
|
||||
|
||||
## 2026-10-18
|
||||
* **Creation**: Established the Nuxt bundle [index](/index.md) and the [decisions](/decisions/index.md) index.
|
||||
* **Decision**: Recorded the [dev container shape](/decisions/dev-container-shape.md) — source bind-mounted, dependencies in the image, run as the image's `node` user.
|
||||
* **Decision**: Recorded [build layer order](/decisions/build-layer-order.md) and the [build context filter](/decisions/build-context-filter.md), including the measured failure when a `COPY` target is excluded.
|
||||
* **Decision**: Recorded the [repository and compose layout](/decisions/repo-and-compose-layout.md) and the [mockup layout](/decisions/mockup-layout.md).
|
||||
* **Creation**: Added [open questions](/open-questions.md), including the shape of the production image.
|
||||
@@ -0,0 +1,42 @@
|
||||
---
|
||||
type: Open Questions
|
||||
title: Open questions
|
||||
description: Decisions still to make for the Nuxt site, with what needs each answer.
|
||||
tags: [decision, open]
|
||||
status: draft
|
||||
generated: { by: opencode-go/glm-5.3-flash, at: 2026-10-18T12:41:52Z }
|
||||
---
|
||||
|
||||
| Question | Needed by | Default if nobody decides |
|
||||
|---|---|---|
|
||||
| Shape of the production image: a runnable Node server, or static `.output/public/` files for the gateway to embed | the next Dockerfile step | None. The empty `Dockerfile` stays empty — and until it holds real instructions, the droast job will fail on it. |
|
||||
| How the compose service mounts the source: the whole repository plus a volume for `node_modules`, or only the directories that get edited | finishing `Local_Development/docker-compose.yml` | None. The compose file is not yet valid. |
|
||||
| Which pnpm version the production image pins | writing the production image | The same as dev, 11.26.0. |
|
||||
| Whether these decisions stay in this bundle or fold into the sibling `OKF_CV_Website` bundle, which already describes the frontend at design level | after the production image exists | None. |
|
||||
| When and how often Snyk runs once re-enabled: weekly schedule, ready-for-review gate, or per-push | re-enabling the snyk job | Stay disabled. |
|
||||
| Whether the AI review job should gate merges (required status check on the verdict) or stay advisory | branch protection setup | Advisory. The review comment is information; blocking merges on an AI verdict is a policy choice, not a technical one. |
|
||||
| How the opencode CLI version in CI gets upgraded: manually bump the pinned 2.0.32, or automate when a new major appears | first review failure after an opencode release | Manual bump. Pinning exists so upgrades are decisions. |
|
||||
| Whether the Go plan's per-model usage windows ($3 per 5 hours for DeepSeek V4 Pro) survive real review frequency, or the review model must move to `deepseek-v4.1-flash` ($80 window) | first quota-limited review | Switch to flash. |
|
||||
|
||||
# The mount trade-off, in detail
|
||||
|
||||
Measured on the whole-repository mount:
|
||||
|
||||
* An anonymous volume is created once. After a dependency change the stale
|
||||
contents persist unless the volume is renewed, and the renewal command has not
|
||||
been tested.
|
||||
* Docker creates an empty, root-owned `node_modules` directory in the repository
|
||||
on the first run, unless that directory already exists.
|
||||
|
||||
The alternative — mounting only the directories that get edited — removes the
|
||||
volume, the renewal step and the root-owned directory entirely, and keeps `.nuxt`
|
||||
inside the container rather than in the working tree. It costs one compose line
|
||||
per top-level directory, so a new directory silently fails to appear in the
|
||||
container until the compose file is updated.
|
||||
|
||||
# Related
|
||||
|
||||
The Nuxt frontend is described at design level in `OKF_CV_Website`, in
|
||||
`architecture/frontend.md` and `decisions/static-nuxt-in-gateway.md`. Those
|
||||
documents state that the site is generated to static files and embedded in the
|
||||
gateway image, which is an input to the production-image question above.
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"name": "nuxt-app",
|
||||
"version": "1.0.0",
|
||||
"type": "module",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
|
||||
"release-type": "node",
|
||||
"include-component-in-tag": false,
|
||||
"separate-pull-requests": false,
|
||||
"packages": {
|
||||
".": {
|
||||
"package-name": "CV_Site_Frontend",
|
||||
"changelog-path": "CHANGELOG.md",
|
||||
"extra-files": [],
|
||||
"versioning": "default"
|
||||
}
|
||||
},
|
||||
"plugins": []
|
||||
}
|
||||
Reference in new issue
Block a user