chore: normalize forgejo source-of-truth for ISO build #2
9 changed files with 93 additions and 26 deletions
34
AGENTS.md
34
AGENTS.md
|
|
@ -10,11 +10,26 @@ load-bearing responsibility.
|
|||
| ---------------------------------- | ----------------------------------- | ------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
|
||||
| **Pi ISO Developer** | Pi harness (this dev agent) | Source changes, docs, static checks, commits, pushes | Does not start ISO builds or flash media unless explicitly assigned |
|
||||
| **Codex ISO Builder** | codex pkg on the FreeBSD build host | `./build.sh`, mounted-image inspection, publishing, hardware validation | Should avoid broad source refactors; reports exact logs/output back through git or handoff notes |
|
||||
| **Hermes USB/IMG Deployer** | Hermes on Debian/Linux | Downloading verified published artifacts, USB target identification, flashing | Does not need Codeberg; never flashes unverified artifacts or partition paths |
|
||||
| **Hermes USB/IMG Deployer** | Hermes on Debian/Linux | Downloading verified published artifacts, USB target identification, flashing | Does not need git-host access; never flashes unverified artifacts or partition paths |
|
||||
| **Claude Reviewer / XFCE Tweaker** | Claude (Linux) | Review/plans plus Track E XFCE GUI polish | Cannot build ISO, cannot run FreeBSD-only validation, should mark speculative runtime claims as such |
|
||||
| **Opencode / Z.ai Integrator** | Opencode CLI on Linux | Linux-side Herdr/dashboard experiments plus Pi/DeepSeek v4 provider-lane smoke wiring | Cannot claim FreeBSD runtime proof; uses Sam-provided API keys only for provider validation |
|
||||
| **Operator (Sam)** | Human operator | Product, hardware, acceptance, release judgment | Human approval required for release/tagging decisions |
|
||||
|
||||
## Agent / Codebase Check-In Matrix
|
||||
|
||||
Use this as the lightweight "who checks in where" matrix while work spans
|
||||
multiple repos. Pushed commits, mounted-image reports, manifests, or explicit
|
||||
handoff docs are the expected check-in surface.
|
||||
|
||||
| Agent lane / identity | Primary codebase(s) | Typical check-in artifact |
|
||||
| ------------------------------ | ------------------------------------ | -------------------------------------------------------------- |
|
||||
| **Pi ISO Developer** | `clawdie-iso` | Small pushed commit on active branch plus static-check result |
|
||||
| **Codex ISO Builder** | `clawdie-iso`, adjacent `../colibri` | Build log, mounted-image sweep, publish manifest, smoke notes |
|
||||
| **Hermes USB/IMG Deployer** | published ISO artifacts | Checksum/manifest verification plus flash-target confirmation |
|
||||
| **Claude Reviewer / Tweaker** | `clawdie-iso` | Review/GUI-polish commit or explicit handoff note |
|
||||
| **Opencode / Z.ai Integrator** | `clawdie-ai`, `colibri` | Provider smoke output, small manifest, or handoff doc |
|
||||
| **Operator (Sam)** | all three repos | Final acceptance note, branch choice, release/publish approval |
|
||||
|
||||
### Git Coordination Rules
|
||||
|
||||
- Coordinate through git: fetch before commenting on remote state, push small
|
||||
|
|
@ -58,7 +73,7 @@ Prettier still catches table padding, list spacing, and emphasis drift.
|
|||
`private/` is gitignored and may contain operator-private strategy notes or PRDs.
|
||||
Agents on this host may read files there only when directly relevant to the
|
||||
assigned work. Do not commit, quote, summarize publicly, or copy private content
|
||||
to Codeberg unless the operator explicitly approves it.
|
||||
to Forgejo unless the operator explicitly approves it.
|
||||
|
||||
If working on custom ISO / hardware-report monetization, check
|
||||
`private/PRD-CUSTOM-ISO.md` when present. Codex ISO Builder should focus first
|
||||
|
|
@ -155,12 +170,17 @@ retrying.
|
|||
|
||||
## Cross-Repo Coordination
|
||||
|
||||
Clawdie spans two repos. Changes often require coordinated updates.
|
||||
Clawdie spans three repos. Changes often require coordinated updates.
|
||||
|
||||
| Repo | Purpose | Remote |
|
||||
| ------------- | ---------------------------------------- | ------------------------------------------ |
|
||||
| `Clawdie-AI` | Agent runtime, control plane, channels | `git@codeberg.org:Clawdie/Clawdie-AI.git` |
|
||||
| `clawdie-iso` | ISO builder, firstboot wizard, installer | `git@codeberg.org:Clawdie/Clawdie-ISO.git` |
|
||||
| Repo | Purpose | Remote |
|
||||
| ------------- | ---------------------------------------- | --------------------------------------------------- |
|
||||
| `Clawdie-AI` | Agent runtime, control plane, channels | `git@code.smilepowered.org:clawdie/clawdie-ai.git` |
|
||||
| `clawdie-iso` | ISO builder, firstboot wizard, installer | `git@code.smilepowered.org:clawdie/clawdie-iso.git` |
|
||||
| `Colibri` | Cross-platform Rust control plane core | `git@code.smilepowered.org:clawdie/colibri.git` |
|
||||
|
||||
Primary remote: `code.smilepowered.org` (self-hosted Forgejo, SSH via local host
|
||||
config). Codeberg is the public mirror only; do not treat it as the source of
|
||||
truth for agent coordination or branch-state claims.
|
||||
|
||||
When changes span both repos, create a handoff doc in the secondary repo
|
||||
listing what needs updating. See `Clawdie-AI/AGENTS.md` for full protocol.
|
||||
|
|
|
|||
|
|
@ -334,8 +334,8 @@ network setup hooks
|
|||
```sh
|
||||
ls -l /etc/resolv.conf
|
||||
cat /etc/resolv.conf
|
||||
host codeberg.org
|
||||
ping -c 1 codeberg.org
|
||||
host code.smilepowered.org
|
||||
ping -c 1 code.smilepowered.org
|
||||
```
|
||||
|
||||
#### 2. Touchpad base/input enablement and diagnostics
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ later from the live session.
|
|||
## Quick Start: Build Image
|
||||
|
||||
```sh
|
||||
git clone https://codeberg.org/Clawdie/Clawdie-ISO.git
|
||||
git clone https://code.smilepowered.org/clawdie/clawdie-iso.git
|
||||
cd Clawdie-ISO
|
||||
|
||||
# Full build: fetch FreeBSD, packages, Clawdie-AI, then assemble image.
|
||||
|
|
|
|||
26
build-vps.sh
26
build-vps.sh
|
|
@ -65,8 +65,28 @@ fi
|
|||
# --- step 2: fetch Clawdie-AI tarball ---
|
||||
if [ "$CLAWDIE_VERSION" = "latest" ] || [ -z "$CLAWDIE_VERSION" ]; then
|
||||
echo "==> [2/6] Resolving latest Clawdie-AI version..."
|
||||
CLAWDIE_VERSION=$(curl -s "https://codeberg.org/api/v1/repos/Clawdie/Clawdie-AI/releases?limit=1" \
|
||||
| grep -o '"tag_name":"[^"]*"' | head -1 | cut -d'"' -f4 | sed 's/^v//')
|
||||
CLAWDIE_VERSION=$(
|
||||
curl -fsS "https://code.smilepowered.org/api/v1/repos/clawdie/clawdie-ai/releases?limit=20" 2>/dev/null \
|
||||
| grep -o '"tag_name":"[^"]*"' \
|
||||
| head -1 \
|
||||
| cut -d'"' -f4 \
|
||||
| sed 's/^v//'
|
||||
)
|
||||
if [ -z "$CLAWDIE_VERSION" ]; then
|
||||
CLAWDIE_VERSION=$(
|
||||
git ls-remote --tags "https://code.smilepowered.org/clawdie/clawdie-ai.git" 2>/dev/null \
|
||||
| awk -F/ '$2 == "tags" && $3 ~ /^v[0-9]+\.[0-9]+\.[0-9]+$/ { print $3 }' \
|
||||
| sed 's/^v//' \
|
||||
| sort -t. -k1,1n -k2,2n -k3,3n \
|
||||
| tail -n 1 \
|
||||
| sed 's/^v//'
|
||||
)
|
||||
fi
|
||||
if [ -z "$CLAWDIE_VERSION" ]; then
|
||||
echo "ERROR: could not resolve latest Clawdie-AI release/tag from Forgejo."
|
||||
echo " Pin --clawdie-version X.Y.Z explicitly."
|
||||
exit 1
|
||||
fi
|
||||
echo " Resolved: v${CLAWDIE_VERSION}"
|
||||
fi
|
||||
|
||||
|
|
@ -74,7 +94,7 @@ CLAWDIE_TARBALL="${CACHE_DIR}/clawdie-ai-v${CLAWDIE_VERSION}.tar.gz"
|
|||
if [ "$SKIP_FETCH" -eq 0 ] || [ ! -f "$CLAWDIE_TARBALL" ]; then
|
||||
echo "==> [2/6] Downloading Clawdie-AI v${CLAWDIE_VERSION}..."
|
||||
curl -L --progress-bar -o "$CLAWDIE_TARBALL" \
|
||||
"https://codeberg.org/Clawdie/Clawdie-AI/archive/v${CLAWDIE_VERSION}.tar.gz"
|
||||
"https://code.smilepowered.org/clawdie/clawdie-ai/archive/v${CLAWDIE_VERSION}.tar.gz"
|
||||
else
|
||||
echo "==> [2/6] Clawdie-AI cached."
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ IMAGE_SIZE="28G"
|
|||
# build.sh derives IMAGE_NAME from desktop, the FreeBSD major-version codename,
|
||||
# and the build date.
|
||||
|
||||
# Clawdie-AI ref to bundle from Codeberg.
|
||||
# Clawdie-AI ref to bundle from Forgejo.
|
||||
# Use main for install validation so ISO firstboot exercises the current
|
||||
# post-install setup/token flow. Use --clawdie-version X.Y.Z for release builds.
|
||||
CLAWDIE_VERSION="main"
|
||||
|
|
|
|||
37
build.sh
37
build.sh
|
|
@ -338,7 +338,7 @@ json_escape() {
|
|||
|
||||
resolve_clawdie_commit() {
|
||||
_ref="$1"
|
||||
_repo="https://codeberg.org/Clawdie/Clawdie-AI.git"
|
||||
_repo="https://code.smilepowered.org/clawdie/clawdie-ai.git"
|
||||
if printf '%s' "$_ref" | grep -Eq '^[0-9a-fA-F]{40}$'; then
|
||||
printf '%s\n' "$_ref"
|
||||
return 0
|
||||
|
|
@ -356,6 +356,29 @@ resolve_clawdie_commit() {
|
|||
fi
|
||||
}
|
||||
|
||||
resolve_latest_clawdie_tag() {
|
||||
_repo_api="https://code.smilepowered.org/api/v1/repos/clawdie/clawdie-ai"
|
||||
_repo_git="https://code.smilepowered.org/clawdie/clawdie-ai.git"
|
||||
|
||||
_tag=$(
|
||||
curl -fsS "${_repo_api}/releases?limit=20" 2>/dev/null \
|
||||
| grep -o '"tag_name":"[^"]*"' \
|
||||
| head -1 \
|
||||
| cut -d'"' -f4
|
||||
)
|
||||
if [ -n "$_tag" ]; then
|
||||
printf '%s\n' "$_tag"
|
||||
return 0
|
||||
fi
|
||||
|
||||
git ls-remote --tags "$_repo_git" 2>/dev/null \
|
||||
| awk -F/ '$2 == "tags" && $3 ~ /^v[0-9]+\.[0-9]+\.[0-9]+$/ { print $3 }' \
|
||||
| sed 's/^v//' \
|
||||
| sort -t. -k1,1n -k2,2n -k3,3n \
|
||||
| tail -n 1 \
|
||||
| sed 's/^/v/'
|
||||
}
|
||||
|
||||
is_pinned_clawdie_ref() {
|
||||
_ref="$1"
|
||||
printf '%s' "$_ref" | grep -Eq '^[0-9a-fA-F]{40}$|^v[0-9]+\.[0-9]+\.[0-9]+$'
|
||||
|
|
@ -1523,11 +1546,15 @@ else
|
|||
fi
|
||||
|
||||
# --- step 4: fetch + prepare Clawdie-AI tarball (offline-ready) ---
|
||||
# Resolve "latest" to the most recent Codeberg tag.
|
||||
# Resolve "latest" from Forgejo releases first, then tags.
|
||||
if [ "${CLAWDIE_REF:-${CLAWDIE_VERSION:-}}" = "latest" ] || [ -z "${CLAWDIE_REF:-}" ]; then
|
||||
echo "==> [4/7] Resolving latest Clawdie-AI version..."
|
||||
CLAWDIE_VERSION=$(curl -s "https://codeberg.org/api/v1/repos/Clawdie/Clawdie-AI/releases?limit=1" \
|
||||
| grep -o '"tag_name":"[^"]*"' | head -1 | cut -d'"' -f4 | sed 's/^v//')
|
||||
CLAWDIE_VERSION=$(resolve_latest_clawdie_tag | sed 's/^v//')
|
||||
if [ -z "$CLAWDIE_VERSION" ]; then
|
||||
echo "ERROR: could not resolve latest Clawdie-AI release/tag from Forgejo."
|
||||
echo " Pin --clawdie-ref main or --clawdie-version X.Y.Z explicitly."
|
||||
exit 1
|
||||
fi
|
||||
CLAWDIE_REF="v${CLAWDIE_VERSION}"
|
||||
echo " Resolved: ${CLAWDIE_REF}"
|
||||
fi
|
||||
|
|
@ -1551,7 +1578,7 @@ else
|
|||
fi
|
||||
|
||||
CLAWDIE_TARBALL="${CACHE_DIR}/clawdie-ai-${CLAWDIE_CACHE_KEY}.tar.gz"
|
||||
CLAWDIE_TARBALL_URL="https://codeberg.org/Clawdie/Clawdie-AI/archive/${CLAWDIE_ARCHIVE_REF}.tar.gz"
|
||||
CLAWDIE_TARBALL_URL="https://code.smilepowered.org/clawdie/clawdie-ai/archive/${CLAWDIE_ARCHIVE_REF}.tar.gz"
|
||||
if [ "$SKIP_FETCH" -eq 0 ] || [ ! -f "$CLAWDIE_TARBALL" ]; then
|
||||
echo "==> [4/7] Fetching Clawdie-AI ${CLAWDIE_REF} (${CLAWDIE_ARCHIVE_REF})..."
|
||||
mkdir -p "$CACHE_DIR"
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ clawdie_shell_deploy_upgrade() {
|
|||
mkdir -p "$STAGING_DIR"
|
||||
|
||||
if ! tar -xzf "$CLAWDIE_TARBALL" -C "$STAGING_DIR" --strip-components=1 2>/dev/null; then
|
||||
# Try without --strip-components (Codeberg archives have a top-level dir)
|
||||
# Try without --strip-components (Forgejo archives have a top-level dir)
|
||||
tar -xzf "$CLAWDIE_TARBALL" -C "$(dirname "$STAGING_DIR")" 2>/dev/null || {
|
||||
log_msg "[deploy] ERROR: Failed to extract upgrade tarball"
|
||||
return 1
|
||||
|
|
|
|||
|
|
@ -42,24 +42,24 @@ cd /home/clawdie/clawdie-iso && sudo ./build.sh && sudo ./scripts/publish.sh
|
|||
## Future: Forgejo Actions (push-triggered CI/CD)
|
||||
|
||||
When the ISO build is stable and you want push-triggered rebuilds, add a
|
||||
self-hosted Forgejo runner on the controlplane. Codeberg runs Forgejo — no
|
||||
new account needed.
|
||||
self-hosted Forgejo runner on the controlplane. `code.smilepowered.org` is the
|
||||
source of truth; Codeberg is only the public mirror.
|
||||
|
||||
### Install runner
|
||||
|
||||
```sh
|
||||
pkg install forgejo-runner
|
||||
# or fetch binary from codeberg.org/forgejo/runner/releases
|
||||
# or fetch binary from the upstream Forgejo runner releases
|
||||
```
|
||||
|
||||
### Register
|
||||
|
||||
1. Codeberg → `Clawdie/Clawdie-ISO` → Settings → Actions → Runners → Create Runner → copy token
|
||||
1. Forgejo → `clawdie/clawdie-iso` → Settings → Actions → Runners → Create Runner → copy token
|
||||
2. Run:
|
||||
|
||||
```sh
|
||||
forgejo-runner register \
|
||||
--url https://codeberg.org \
|
||||
--url https://code.smilepowered.org \
|
||||
--token <TOKEN> \
|
||||
--name clawdie-build \
|
||||
--labels freebsd \
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@ cat > "${HTML_LATEST}" << HTMLEOF
|
|||
<a class="brand" href="/">Clawdie<span>.</span></a>
|
||||
<div class="nav-links">
|
||||
<a href="/docs/">Docs</a>
|
||||
<a href="https://codeberg.org/Clawdie/Clawdie-ISO" target="_blank">ISO</a>
|
||||
<a href="https://code.smilepowered.org/clawdie/clawdie-iso" target="_blank">ISO</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue