Skip to content

feat(pipeline): Golden Chain for Cloud Dev — tri pipeline for agent swarm #140

Closed

Description

@gHashTag

Context

Cloud Dev agent swarm works: issue → container → Claude Code → PR. But the pipeline needs hardening. Currently manual spawn via Railway API, no feedback loop, agents can't verify their own code.

Golden Chain: tri pipeline for creating agents

Phase 1: tri cloud pipeline (автоматизация)

tri cloud pipeline <issue-number>
  1. Read issue from GitHub
  2. Spawn container on Railway
  3. Monitor status via heartbeats
  4. If agent STUCK >10min → kill + respawn
  5. If agent DONE → verify PR (zig build locally)  
  6. If PR passes → auto-merge
  7. Cleanup container

Phase 2: Self-healing loop

  • Agent fails → auto-create fix-issue with review findings
  • Fix-issue auto-spawns fix-agent
  • Fix-agent pushes to same branch → PR auto-updates
  • Max 3 retry loops per original issue

Phase 3: Improvements needed

Entrypoint fixes

  • Advisory self-review (zig build removed — too heavy for Railway)
  • Informative Telegram messages (issue title + detail)
  • Fix heartbeat subshell bug (doesn't see parent vars)
  • Add set -o pipefail for proper exit code capture
  • Telegram streaming of Claude Code output (PR feat(cloud): Stream all container logs to Telegram in realtime #133)
  • HTML escape for Telegram messages
  • Proper exit after "staying alive" phase (don't restart)

Orchestrator fixes

  • tri cloud spawn should work from CLI (not just Railway API)
  • tri cloud status — real-time dashboard in terminal
  • tri cloud pipeline — full Golden Chain automation
  • Service reuse (hit 25 service/day limit — need to recycle)
  • Container resource limits (memory, CPU, disk)

CI/CD fixes

  • zig build in container: needs -Dci=true flag or lighter build
  • Pre-cache zig-cache in Docker image for faster builds
  • Agent should git checkout existing branch (not create new) for fix-issues

Monitoring

Agent intelligence

  • Agent reads CLAUDE.md and follows project conventions
  • Agent can run zig build -Dci=true for lighter build check
  • Agent self-reviews diff before pushing
  • Agent creates meaningful commit messages (not generic)
  • Multi-file awareness (reads related files before editing)

Architecture

tri cloud pipeline <N>
  └─ tri cloud spawn <N>           # Railway API
      └─ agent-entrypoint.sh       # Container boot
          └─ claude -p "..."        # Claude Code via z.ai
              └─ git push + gh pr   # Result
  └─ tri cloud monitor <N>         # Watch heartbeats
  └─ tri cloud verify <N>          # Check PR locally
  └─ tri cloud merge <N>           # Auto-merge if clean
  └─ tri cloud cleanup <N>         # Destroy container

Exit criteria

  • tri cloud pipeline 999 spawns agent, monitors, verifies, merges, cleans up
  • Zero human intervention for simple issues
  • Max 3 auto-retries before escalating to human

Activity

  1. gHashTag commented on Mar 11, 2026

    @gHashTag
    OwnerAuthor

    📖 Trinity Agent | 2026-03-11T15:30:24Z
    📋 Step: 3/8 — Reading issue #140
    🔄 Status: READING
    ⏱️ Elapsed: 9s

  2. gHashTag commented on Mar 11, 2026

    @gHashTag
    OwnerAuthor

    ❌ Trinity Agent Dashboard — Issue #140

    Field Value
    Status FAILED
    Step 7/8
    Detail Exit code: 0, Commits: 0
    Elapsed 463s
    Container agent-140
    Updated 2026-03-11T15:37:58Z
  3. gHashTag commented on Mar 11, 2026

    @gHashTag
    OwnerAuthor

    ⚡ Trinity Agent | 2026-03-11T15:30:28Z
    📋 Step: 4/8 — Claude Code running (timeout: 3600s)
    🔄 Status: CODING
    ⏱️ Elapsed: 13s

  4. gHashTag commented on Mar 11, 2026

    @gHashTag
    OwnerAuthor

    🔄 Trinity Agent | 2026-03-11T15:37:52Z
    📋 Step: 5/8 — Self-review (advisory)
    🔄 Status: REVIEWING
    ⏱️ Elapsed: 457s

  5. gHashTag commented on Mar 11, 2026

    @gHashTag
    OwnerAuthor

    🧪 Trinity Agent | 2026-03-11T15:37:55Z
    📋 Step: 6/8 — Checking/creating PR
    🔄 Status: TESTING
    ⏱️ Elapsed: 460s

  6. gHashTag commented on Mar 11, 2026

    @gHashTag
    OwnerAuthor

    ❌ Trinity Agent | 2026-03-11T15:37:58Z
    📋 Step: 7/8 — Exit code: 0, Commits: 0
    🔄 Status: FAILED
    ⏱️ Elapsed: 463s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions