Forgejo agent control plane: CLI host, review gates, Telegram intake, Coolify failure-to-agent #1
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Repo
PlasticDigits/gitlab-cursor-webhook (existing Rust workspace:
gchcontroller,gchconfig,gch-core, SQLite).Do not implement this in cl8y-forgejo. That repo’s Postgres is for Forgejo/Woodpecker only. This service already has SQLite and must keep its own data plane. Port GitLab → Forgejo in this repo (or rename later); do not start a third agent repo.
No React UI. PLAN says the cross-repo board is a Forgejo organization project (columns: Intake / Ready / Agent / Exception / Ops:human / Discovery). A React dashboard on the Coolify host would waste RAM. Product apps (dex) stay Rust/TS/React; this control plane stays Rust, memory-tight, on a dedicated CLI host (not Coolify Docker, not Woodpecker agent VMs).
Depends on: Forgejo reachable, ops-preflight (CURSOR_API_KEY holder, Telegram allowlist), Woodpecker deploy-from-
mainfor the Coolify success path. This issue owns failure logs → agent.Current codebase
gitlab-cursor-webhooktoday:security,agent:{tag}).agent -p --force --truston the VM, destroys on complete.cl8y-forgejo already added (do not duplicate):
scripts/select_cursor_model.py/scripts/run_cursor_agent.sh— Grok high, never Fast; floorcursor-grok-4.6-high.docs/runbooks/agentic-workflows.md— operating model.Mismatch vs the new plan:
/bor 1:1 forward-to-bot.Why this is needed
Daily work is paste-to-agent and Coolify clicks. Community reports die behind GitLab’s credit-card wall unless
/band DM-forward file Forgejo issues. Unattended landing needs autoland + verify-before-merge, or leftover-verify becomes fake ops. Per-review Hetzner VMs will blow the 15-server cap and the Coolify RAM budget if anyone “just runs agents on Coolify.”Constraints and guardrails
needs-human./b {notes}, last ~20 buffered messages, leave/bvisible, reply in-group. Privacy off + rolling buffer (nogetChatHistory). Allowlist maintainer Telegram user id.GET /api/v1/deployments/{uuid}logs withread:sensitive→ enqueue fix agent. Token never in the Telegram bot process if it can be split; at minimum no deploy-from-chat.Relevant files (webhook repo)
crates/gchcontroller— HTTP, GitLab HMAC, Terraform applycrates/gch-core— filter, dedup, SQLitecrates/gchconfig— CLIterraform/modules/agent-vm— stop using for reviews.env.example,docker-compose.yml,docs/runbook-cl8y-dex-terraclassic.mdFrom cl8y-forgejo (reference, vendor or call):
docs/runbooks/agentic-workflows.mdscripts/select_cursor_model.py,scripts/run_cursor_agent.shdocs/adr/0004-cursor-cli-grok-high.mdRecommended direction
Phased in this repo:
A. Forgejo ingress + CLI host
Replace GitLab webhook with Forgejo HMAC (
X-Forgejo-Signature/ documented scheme). Map issue/PR events. Runagent -p --trust --workspaceon a local worktree (or--worktree) on the controller host. Keep SQLite. Disable Terraform provision by default (GCH_PROVISION_ENABLED=falseas the production default for reviews). Reuse ALLOWED_USERS as Forgejo usernames / trusted org.B. Gate graph
Job states: research (optional) → implement → bug-review → security (conditional) → verify → autoland or
needs-human. Each step new empty context. Structured findings JSON. Circuit breaker after 2 cycles. Research brief can be posted back to Telegram requester.C. Telegram intake
Same binary or a
gch-intakecrate sharinggch-core(one process preferred to save RAM)./b+ forward. Dedup by fingerprint. Privileged Forgejo token only in the file-issue path.D. Coolify failure
Inbound Coolify notification webhook or poll; fetch logs; enqueue implement with write-set = that app repo. Never from untrusted chat.
E. Digest
Post a short Telegram digest of autolands (titles + links), not 23 diffs.
Port mapping from GitLab labels (
agent:verify) to Forgejo labels/issue comments as needed so existing dex habits survive.Acceptance criteria
/bin a lab group files or +1s a Forgejo issue and replies in-group;/bfrom a non-allowlisted user is ignored./bthread cannot merge or deploy.Test plan (happy paths)
issuesevent with DoR → implement → bug review clean → verify tests pass → PR autoland (lab repo without prod secrets).needs-human, stop looping./bduplicate → +1, same issue number in public reply.agent --list-modelsgrows a 4.7-high slug → selector (or Rust port) picks it.Test plan (attack, hack, abuse)
/bwith image+OCR jailbreak; public reply is still the template; no secret echo./b: ignored even in the group.chatMemberitself into new groups without operator; ignore unknown chats.http://169.254.169.254or internal Coolify URLs from user text.read:sensitiveif split; document blast radius if single process./b— rate limit per user/chat; bounded buffer (20 messages); SQLite busy timeout; no unbounded VM spawn.cdto another repo’s checkout; write-set enforced.Verification criteria
Lab: a community-like Telegram report becomes a Forgejo issue without paste; a green gated change lands without a maintainer merge click; a failed Coolify deploy starts a fix job with logs;
hcloud server listdoes not grow a VM per review. Production enablement only after HMAC, allowlist, and rate-limit tests are in CI (cargo test/ clippy).Closing:
gitlab-cursor-webhookis archival. Do not implement here. Tracking moved to PlasticDigits/cl8y-forgejo (new agent-control repo; this project stays read-only for ideas).