Commit Graph

3 Commits

Author SHA1 Message Date
freemo 921c13f410 fix(agents): restore server mode + prompt_async supervisor launch from 9bbec0e6
Restores the working OpenCode server mode + curl-based async supervisor
launch functionality from commit 9bbec0e6 (2026-04-02) and updates it for
the current 13-supervisor architecture.

Changes applied to 7 agent files (938 insertions, 221 deletions):

1. product-builder.md: Restored from 9bbec0e6 and updated for 13 supervisors
   - Full bash permissions for curl/sleep
   - Server URL: http://localhost:4096
   - Launch via POST /session + POST /session/:id/prompt_async
   - Session resume (adopts existing [CA-AUTO] sessions)
   - Added ca-test-infra-improver and ca-project-owner to launch sequence
   - Updated concurrent worker calculations (~5N + ~8 singletons)

2. issue-implementor.md: Restored curl-based worker dispatch
   - 10-second polling loop with bash sleep
   - Worker sessions via prompt_async
   - Session resume for existing workers

3. ca-continuous-pr-reviewer.md: Restored curl dispatch pattern
4. ca-uat-tester.md: Restored curl pool mode
5. ca-bug-hunter.md: Restored curl pool mode
6. ca-test-infra-improver.md: Added self-dispatch permission
7. ca-session-cleanup.md: Restored utility agent

Architecture: 5 pool supervisors (N workers each) + 8 singleton supervisors
= 13 total supervisors running async via prompt_async.

Replaces the broken prompt_async implementation from commit 074c472e that
removed supervisors from task permissions without working server launch.

To use: Start OpenCode with --port 4096, then launch product-builder.

Refs: commit 9bbec0e6 (working version), commit 074c472e (broken version)
2026-04-02 20:56:06 -04:00
freemo 074c472e36 build(agents): restructure product-builder as supervisor launcher, force prompt_async everywhere
The product-builder was ignoring prompt_async instructions and implementing
tickets directly because its identity was "autonomous product builder that
handles everything." The LLM absorbed this framing and defaulted to doing
the work itself rather than launching supervisors.

Root cause fix — two structural changes applied to product-builder AND all
5 pool supervisors:

1. IDENTITY REFRAME: The product-builder is now explicitly a "Supervisor
   Launcher and Monitor" — not a "product builder." The opening section
   states: "YOUR ONLY JOB: Launch 13 supervisor sessions via bash curl
   and keep them alive." A prominent DO NOT list prohibits implementing
   issues, creating PRs, writing code, or doing any work a supervisor
   handles. The file was compressed from 975 to 312 lines — prerequisites
   are brief, the supervisor launch is the first major section, and the
   monitoring loop is the primary content.

2. WORKER AGENTS REMOVED FROM TASK PERMISSIONS: Every pool supervisor had
   its worker agent in the task permissions, giving the LLM the choice to
   use the Task tool instead of prompt_async. Now removed:
   - issue-implementor: removed ca-issue-worker
   - ca-continuous-pr-reviewer: removed ca-pr-self-reviewer, ca-pr-checker
   - ca-uat-tester: removed ca-uat-tester (self-dispatch)
   - ca-bug-hunter: removed ca-bug-hunter (self-dispatch)
   - ca-test-infra-improver: removed ca-test-infra-improver (self-dispatch)

   Each supervisor now has a prominent framing block at the top: "YOU ARE A
   POOL SUPERVISOR. You dispatch workers via bash curl prompt_async. Worker
   agents have been REMOVED from your task permissions."

   Non-worker task permissions preserved (ca-ref-reader, ca-spec-reader,
   ca-new-issue-creator, etc.) for legitimate one-shot subagent calls.
2026-04-02 18:50:22 -04:00
freemo d2322b3206 build(agents): add test infrastructure improver and project owner agents (13 supervisors)
Adds two new agent types to the autonomous system, bringing the total
from 11 to 13 supervisors launched by the product-builder via prompt_async.

New agents:

1. ca-test-infra-improver (12th supervisor — pool with N workers):
   Dual-mode agent following the ca-bug-hunter pattern. In pool mode,
   dispatches N parallel workers via prompt_async to analyze 8 aspects
   of the testing infrastructure: CI execution time, coverage gaps, test
   architecture (BDD quality), flaky tests, CI pipeline optimization,
   test data quality, missing test levels (Behave/Robot/ASV per
   CONTRIBUTING.md), and dependency security. Workers file actionable
   Type/Testing or Type/Task issues. Hard constraint: never disables
   or weakens existing checks — only proposes additions and optimizations.
   Uses Gemini 2.5 Pro for large context. Follows all established patterns
   (clone isolation, bash sleep, prompt_async dispatch, session resume,
   bot signature).

2. ca-project-owner (13th supervisor — singleton, no pool):
   Acts as autonomous project owner. Continuously triages State/Unverified
   issues following CONTRIBUTING.md's 6-step triage process. Assigns
   MoSCoW labels (Must Have / Should Have / Could Have) based on the
   specification and milestone goals. Makes strategic priority decisions.
   Tags specific developers with questions in Forgejo comments (discovers
   expertise from git history and Forgejo assignments). Periodically
   re-evaluates MoSCoW labels as the project evolves. Follows up on
   unanswered questions after 48 hours. Single instance, not a pool —
   one project owner is sufficient. Uses Opus for nuanced strategic
   judgment. Launched via prompt_async like all other supervisors.

Modified files:

- product-builder.md: Updated from 11 to 13 supervisors in all locations
  (architecture table, Phase C.2 launch list with entries #12 and #13,
  validation count, checkpoint text, self-coordinate table). Added
  test-infra-pool to pool supervisors list and project-owner to singletons.

- ca-human-liaison.md: Clarified MoSCoW responsibility split — the liaison
  only adjusts MoSCoW labels when relaying explicit human feedback. The
  ca-project-owner handles autonomous MoSCoW assignment.
2026-04-02 15:19:53 -04:00