Skip to content

refactor(agents): redesign the fleet into 8 scoped agents - #299

Merged
juninmd merged 2 commits into
masterfrom
claude/project-thread-an900h
Nov 22, 2026
Merged

juninmd merged 2 commits into
masterfrom
claude/project-thread-an900h

Conversation

@juninmd

@juninmd juninmd commented Nov 22, 2026

Copy link
Copy Markdown
Owner

Requested by Antonio · project thread

Summary

  • 15 → 8 agents, one scope each (approved proposal). Former agents become stages of composite agents (core/composite.ts).
    • pr-assistant absorbs code-reviewer (redundant) and conflict-resolver (already inline).
    • flow-watch = ci-health + pr-sla, observe only (no remediation tasks, no nudge comments).
    • secret-guard = scan + remove. History rewrite only after owner approval: Telegram button (sg:<id>, private chat or TELEGRAM_APPROVER_IDS) or owner /aprovar on the secret-guard issue. Approval is bound to the exact finding set; fail-closed.
    • repo-standards = AGENTS.md/.agents in every active repo (missing AGENTS.md first, REPO_STANDARDS_MAX_PRS, never two open PRs) + README.
    • builder = product-manager + senior-developer + interface-developer. PRs always draft + keep-draft: pr-assistant reviews, never marks ready, never merges (not even /merge). Label failure closes the PR.
  • Former names keep working as aliases that run only their stage; code-reviewer/conflict-resolver become no-ops with a warning (no second pr-assistant pass).
  • Agent contract: core/agent-contract.ts refreshes global AGENTS.md + skills from juninmd/skills at most hourly (only with AGENT_CONTRACT_REFRESH=true, set in the Dockerfile; image copy is the fallback). The commit shows in PR bodies and review footers.
  • Long generic prompts (senior-developer: 461 lines, Python-centric, 180-line rule contradicting AGENTS.md) replaced by short scopes; docs, .env.example updated.

Quality Checklist

  • User-facing behavior is described clearly (README, AGENTS.md).
  • Security impact: rewrite gated by owner approval; public issue lists rules only, file/line go to private Telegram; contract clone runs without credentials.
  • Performance: standardizer reads with mapLimit(8); contract refresh TTL 1h, shared in-flight promise.
  • Logs: stage skips/failures logged with reason; retired names warn.
  • UI changes: N/A (no UI).
  • Tests listed below.

Verification

  • bun run typecheck → tsc --noEmit clean.
  • bun test → 317 pass, 0 fail (baseline 306); new fleet-redesign.test.ts, secret-guard-approval.test.ts. Mutation-checked: removing the keep-draft guard or the mark-ready guard makes the tests fail.
  • bun scripts/check-no-cron.ts → no cron workflows.
  • Homologation on real GitHub, read-only (every non-GET intercepted → 0 writes): flow-watch full run and pr-sla alias; pr-assistant on real PR feat(pr-assistant): bloquear merge sem AGENTS.md #298 with keep-draft → keep_draft, no merge; repo-standards reads on this repo; approval gate check; real fetch of juninmd/skills@d261512 (40 skills + AGENTS.md installed to a temp HOME). The session token only reaches this repo, so other repos were not exercised.
  • Independent review pass done; its findings (forgeable marker, silent secret with issues disabled, label failure, duplicate CronJob passes, stale scan, consent text, atomic write) are fixed in the second commit.

Not verified: Docker build, Telegram callbacks with a real bot (unit-tested), CronJob manifests (live outside this repo; aliases keep them working).


Generated by Claude Code

Fifteen agents overlapped (three touched every PR) and carried long generic
prompts. Each agent now has one scope and one autonomy level:

- pr-assistant absorbs code-reviewer (redundant) and conflict-resolver
  (already inline); builder PRs labelled keep-draft are reviewed but never
  marked ready nor merged.
- flow-watch (ci-health + pr-sla) only reports.
- secret-guard (scan + remove) rewrites history only after the owner
  approves via a Telegram button or an owner /aprovar on the approval issue.
- repo-standards covers every active repo, missing AGENTS.md first, capped
  per run, never a second open PR.
- builder (product-manager + senior-developer + interface-developer) opens
  draft PRs only.

Former names stay valid and run only their stage, so CronJobs keep working.
opencode runs refresh the global AGENTS.md + skills from juninmd/skills at
most hourly (image copy as fallback) and record the commit in PRs/reviews.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cn6JQLt2WHRBiK4sRPxupu
- Telegram approval marker counts only from this bot's login or the owner.
- Approval button is sent even when the repo has issues disabled.
- Public approval issue lists rules only; consent text says the whole file
  is deleted from history and all branches/tags are force-pushed.
- keep-draft label failure closes the PR (fail closed).
- code-reviewer / conflict-resolver CronJobs become no-ops instead of a
  second full pr-assistant pass.
- remove stage never runs on stale findings; AGENTS.md install is atomic.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cn6JQLt2WHRBiK4sRPxupu
@juninmd juninmd added the auto-merge-skip Skip autonomous merge label Nov 22, 2026 — with Claude
@juninmd juninmd self-assigned this Nov 22, 2026
@juninmd
juninmd merged commit 25a3370 into master Nov 22, 2026
3 checks passed
@juninmd
juninmd deleted the claude/project-thread-an900h branch November 22, 2026 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-merge-skip Skip autonomous merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants