Files
home-network-k3s-impl/infra/agent/versions.env
T
jakman85andClaude Opus 5 c5b5b8672a
gate / gate (pull_request) Failing after 1m51s
gate / conformance (pull_request) Has been skipped
feat(pm-agent): an in-cluster AI Program Manager that turns Gitea issues into pull requests
A service that reads this repository's Gitea issues, decides what to do about each
thread as the Program Manager persona, and runs one worker agent per assignment that
authors a change, runs the merge gate and opens a pull request. It reacts to issue
creation and to comments; the assignment and all correspondence travel through the
issue thread and the PR. It authenticates with an Anthropic subscription token. It
never pushes to main and never merges.

Three choices carry the design, with alternatives recorded in docs/plans/:
 - it POLLS rather than receiving webhooks (Gitea's webhook SSRF guard, lost
   deliveries, and no inbound reach needed at all);
 - it keeps NO state: the trigger is "the newest thing in this thread was not
   written by me", so the issue thread is the state — no PVC, no backup obligation;
 - the model holds NO tools: its reply is one JSON object this code validates, so
   nothing in the path executes text.

The boundary is platform/kyverno/admission/pm-agent-job-shape.yaml (Enforce,
failurePolicy: Fail), not the RBAC: Kubernetes places no `use` check on
serviceAccountName, so "may create Jobs" is "may run arbitrary code as the
namespace's most privileged identity". Six rules admit only the committed shape, and
the worker identity is bound to nothing with no token mounted, so there is nothing to
escalate to. 28/28 offline Kyverno assertions.

Nothing has run: the image has never been built or pushed, and both the image digest
and the two credentials are deliberate placeholders. See the handoff entry's
"What I did NOT verify".

Refs CLAUDE.md §1/§3/§6, R-SEC-02, R-GITOPS-02.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
2026-10-05 22:28:10 -05:00

48 lines
2.8 KiB
Bash

# infra/agent/versions.env — pins for the `agent-runner` image (the PM agent service).
#
# WHAT THIS FILE DOES *NOT* PIN: the platform toolchain. The agent-runner is built FROM
# the pinned dev toolbox (infra/devcontainer/), which already pins fedora, python3,
# git, sops, age, flux, kubectl, kyverno, chainsaw, promtool, yamllint and
# check-jsonschema in ONE place. A worker agent runs `./ci/gate.sh` before it pushes, so
# it needs exactly that toolchain — and CLAUDE.md §3 is explicit that only the pinned
# toolbox result counts. Re-pinning those versions here would create a second source of
# truth and, the first time the two drifted, the worker's "green" would stop meaning the
# gate's green. So this file pins ONLY what the toolbox does not carry.
# The toolbox image the runner is layered on. Built by `infra/devcontainer/dev.sh build`
# (tag `home-k3s-dev:local`); infra/agent/build-image.sh asserts it exists rather than
# silently building a different base.
AGENT_BASE_IMAGE=home-k3s-dev:local
# Node.js — the runtime for the Claude Code CLI, installed from the Fedora base's module
# stream. A major version, not a patch: the CLI supports the active LTS line and the
# distro package is the reproducible way to get it inside a pinned base.
NODEJS_MAJOR=22
# Claude Code CLI (npm `@anthropic-ai/claude-code`), EXACT version.
#
# WHY 2.1.285 AND NOT `latest`: `latest` makes the image non-reproducible, and the
# autoupdater is disabled in the runtime anyway (see the Containerfile), so a floating
# tag would only move under us at build time. 2.1.285 is the version the registry
# publishes under the `stable` dist-tag (measured 2026-10-05:
# `curl -s https://registry.npmjs.org/@anthropic-ai/claude-code | jq .'dist-tags'`
# -> {"stable":"2.1.285","latest":"2.1.290","next":"2.1.290"}).
#
# FLOOR, NOT PREFERENCE: pm-dispatch and pm-worker both pass
# `--permission-prompts none`, which requires >= 2.1.259. A downgrade below that floor
# does not fail at build — it fails at 3am with a worker waiting forever for a
# permission answer nobody can give. build-image.sh asserts the floor.
CLAUDE_CODE_VERSION=2.1.285
CLAUDE_CODE_MIN_VERSION=2.1.259
# The model the PM persona and the worker agents run on. `claude-opus-5` is the current
# most-capable general model; the worker does real repository work against a gate, so this
# is deliberately not a cheaper tier. Overridable per-deployment via the ConfigMap
# (PM_MODEL / PM_WORKER_MODEL) without rebuilding the image.
AGENT_MODEL=claude-opus-5
# Image coordinates. The repository path is NOT a preference: the admission policy
# platform/kyverno/admission/pm-agent-job-shape.yaml admits a worker Job only when its
# image is `${AGENT_IMAGE_REPO}@sha256:<digest>`. A different path is a DENIED Job.
AGENT_IMAGE_REPO=gitea.home.keithjackson.dev/home-network/agent-runner