Prepares the repo for parallel agent work. No application code. - CLAUDE.md: conventions, branch naming, and the six non-negotiable invariants from the design (immutable raw bytes, no stored odometers, SI integers, dual-layer user isolation, secret containment, single ingestion path). Also records a model-allocation policy: the orchestrator runs Opus 5, workers default to Sonnet, and Opus is reserved for review plus the areas where a mistake is silent and expensive (ingest, wear SQL, auth/RLS, the Bryton protocol client). And the Gitea Actions gotchas, so nobody rediscovers them: GITEA_TOKEN cannot push to the container registry, jobs.*.environment is ignored, and cron needs a workflow_dispatch pair. - CONTRIBUTING.md: day-to-day flow, worktrees for parallel branches, review expectations. - .gitea/workflows/ci.yml: repo hygiene (branch naming, secret scan, no ride data in git), plus API/web/migration jobs that guard on whether the code exists yet, so CI is meaningful now and grows into the real thing rather than being rewritten. - .gitea/PULL_REQUEST_TEMPLATE.md: forces an honest "how this was verified" and an invariant checklist. - scripts/pr.sh, scripts/review.sh: open and inspect PRs via the Gitea API. - Directory scaffold with placeholder READMEs. Agents open PRs; humans merge them. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
29 lines
1.0 KiB
Bash
Executable File
29 lines
1.0 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Fetch a PR's diff and metadata for review.
|
|
#
|
|
# scripts/review.sh 7 # print the diff
|
|
# scripts/review.sh 7 --meta # title, author, branch, CI state
|
|
#
|
|
# Requires GITEA_TOKEN.
|
|
set -euo pipefail
|
|
|
|
GITEA_URL="${GITEA_URL:-http://192.168.0.3:3000}"
|
|
OWNER="${GITEA_OWNER:-BBergle}"
|
|
REPO="${GITEA_REPO:-bike-app}"
|
|
|
|
[ -n "${GITEA_TOKEN:-}" ] || { echo "error: GITEA_TOKEN not set" >&2; exit 1; }
|
|
PR="${1:-}"
|
|
[ -n "$PR" ] || { echo "usage: scripts/review.sh <pr-number> [--meta]" >&2; exit 1; }
|
|
|
|
api() { curl -sS -H "Authorization: token $GITEA_TOKEN" "$GITEA_URL/api/v1/repos/$OWNER/$REPO/$1"; }
|
|
|
|
if [ "${2:-}" = "--meta" ]; then
|
|
api "pulls/$PR" | jq '{number, title, user: .user.login, head: .head.ref, base: .base.ref,
|
|
mergeable, draft, additions, deletions, changed_files}'
|
|
echo "--- commit status ---"
|
|
SHA="$(api "pulls/$PR" | jq -r '.head.sha')"
|
|
api "commits/$SHA/status" | jq '{state, statuses: [.statuses[]? | {context, state}]}'
|
|
else
|
|
api "pulls/$PR.diff"
|
|
fi
|