f59b906395
Audited the working tree and all 26 commits of history for credentials: none
found. No API keys, no private keys, no tokens — the live bot token, webhook
secret and admin token appear nowhere in the repo or its history.
What was there was infrastructure disclosure, which is recon material rather
than a leak, but has no business in a public repo:
- Tailnet addresses and cluster-internal hostnames in code, docs and the CI
template. The model endpoint is now supplied at runtime via
PRAGENT_MODEL_BASE_URL and patched into opencode.json by install_config();
the committed config carries a placeholder, guarded by a test.
- A host path (/home/marcos) as the default rtk directory — now unset.
- Real usernames in the onboarding docs — now alice/acme.
- A standing list of one-time setup tokens that were never revoked, named
individually. Removed. Note that removing the list does not revoke the
tokens: they should still be revoked in the Gitea admin UI.
The substitution happens in Python rather than via opencode's {env:VAR} config
templating, because the reviewer subprocess runs with an allow-listed
environment — resolving it before the process starts keeps that allow-list from
having to grow.
README rewritten for a reader who has never seen the project: what it does and
what that output looks like, honest status (pilot works, framework designed but
unbuilt), the security model up front given what this thing is, and the measured
cost numbers including the two effects that make naive estimates wrong.
History still contains the old addresses. They are tailnet-only and not
credentials, so no rewrite.
Tests: 131 -> 137.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B11e8TZZxJyzHW7jj7KWUN
52 lines
2.3 KiB
YAML
52 lines
2.3 KiB
YAML
# pragent pilot — AI Review workflow template.
|
|
#
|
|
# Copy this file into the repo you want reviewed as:
|
|
# .gitea/workflows/ai-review.yml
|
|
#
|
|
# Prerequisites (see pilot/README.md):
|
|
# 1. pragent-bot added as a collaborator with Write access.
|
|
# 2. repo secret PRAGENT_BOT_TOKEN set to the bot's access token.
|
|
#
|
|
# Reviews fire ONLY on PRs carrying the `AI-REVIEW` label. Remove the label to
|
|
# stop a re-review on subsequent pushes. The job is fail-open (never blocks CI).
|
|
|
|
name: AI Review
|
|
|
|
on:
|
|
pull_request:
|
|
types: [opened, synchronize, reopened, labeled]
|
|
|
|
jobs:
|
|
review:
|
|
# Only run when the PR has the AI-REVIEW label. Acts as a cheap gate: no
|
|
# model call, no cost, when the label is absent.
|
|
if: contains(github.event.pull_request.labels.*.name, 'AI-REVIEW')
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Run pragent pilot review
|
|
env:
|
|
GITEA_API: http://gitea-http.gitea.svc.cluster.local:3000
|
|
GITEA_REPOSITORY: ${{ github.repository }}
|
|
PR_INDEX: ${{ github.event.pull_request.number }}
|
|
PR_TITLE: ${{ github.event.pull_request.title }}
|
|
PR_BODY: ${{ github.event.pull_request.body }}
|
|
# .pr-review.json is read from the base branch, not the PR head, so a
|
|
# PR cannot ship its own reviewer instructions.
|
|
PR_BASE_REF: ${{ github.event.pull_request.base.ref }}
|
|
PRAGENT_BOT_TOKEN: ${{ secrets.PRAGENT_BOT_TOKEN }}
|
|
PRAGENT_SHA: ${{ github.event.pull_request.head.sha }}
|
|
# The CI runner has no opencode CLI (and no factory checkout), so the
|
|
# legacy single-model-call engine is the only one that works here.
|
|
# review_pr defaults to `opencode` for the webhook service.
|
|
PRAGENT_ENGINE: ollama
|
|
# On-network model: headroom proxy on kubernets (tailnet IP).
|
|
OLLAMA_URL: ${{ vars.PRAGENT_MODEL_URL }}
|
|
OLLAMA_MODEL: glm-5.2:cloud
|
|
OLLAMA_MAX_TOKENS: "6000"
|
|
DIFF_MAX_CHARS: "150000"
|
|
run: |
|
|
set -e
|
|
# Fetch the reviewer script from the pragent repo (private → bot token).
|
|
curl -fsS -H "Authorization: token $PRAGENT_BOT_TOKEN" \
|
|
"$GITEA_API/api/v1/repos/gitea_admin/pragent/raw/pilot/ai_review.py?ref=main" -o ai_review.py
|
|
python3 ai_review.py |