Commit Graph

20 Commits

Author SHA1 Message Date
9c1794c58a fix(config): T3 backend → backend-architect; update agency-agents submodule
- T3 backend squad lead should be an architect, not a developer (per review)
- Submodule updated to include frontend-architect + backend-developer roles
2026-03-16 10:36:33 -04:00
8adab6fbc5 refactor(config): replace senior-developer with role-specific specialists
- T2 frontend: software-architect → frontend-architect
- T3 backend: senior-developer → backend-developer
- T3 frontend: senior-developer → frontend-architect
- T3 default: senior-developer → backend-developer
- T4 backend: backend-architect → backend-developer (implementation, not architecture)
- T4 default: senior-developer → backend-developer

Depends on: coding-with-hans-heinemann/agency-agents#1 (new agent roles)
2026-03-16 10:11:47 -04:00
d02faf5cac feat(config): expand role_registry + fix T4 default runtime
Role registry additions:
- T2: add ai, security, mobile domains
- T3: add data, ai, security, mobile, database, devops, docs domains
- T4: add data (data-engineer), embedded (firmware-engineer)
- T5: add accessibility, e2e, frontend, data verifier roles

TeamRunner consistency fix:
- T4 briefs now default to 'coding_agent' runtime (Claude Code)
  per build spec: 'Claude Code as default T4 runtime'
  T3 can still override preferred_runtime per task
2026-03-16 09:14:22 -04:00
c70448b61c chore: sync agency-agents submodule with upstream 2026-03-16 09:00:15 -04:00
aef553bdc8 refactor: T4 fast-cheap; move adapter registries from code to team.yaml 2026-03-16 01:14:35 -04:00
8277a00118 perf(team_runner): T4 capability fast-cheap — implementers produce structured JSON, don't need capable tier 2026-03-16 01:14:08 -04:00
45e3b7663e fix: lazy-import anthropic SDK; tolerate LLM adapter failure in dry-run mode
--dry-run was crashing with ModuleNotFoundError because:
1. adapters/llm/anthropic.py imported 'anthropic' at module level
2. TeamRunner.__init__ always built the LLM adapter regardless of dry_run flag

Fixes:
- Move 'import anthropic' inside AnthropicAdapter.__init__ (lazy import)
  so the module loads cleanly without the SDK installed
- In TeamRunner.__init__, wrap _build_llm in a try/except when dry_run=True
  so missing adapter deps are logged as warnings, not fatal errors

dry-run now works with no third-party packages installed.
2026-03-16 01:03:17 -04:00
7b1cf7315c refactor(team_runner): make runtimes config-driven — replace hardcoded slots with dict
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-16 00:50:17 -04:00
71316b3090 refactor(team_runner): replace static adapter imports with dynamic importlib loading
Concrete adapter classes (AnthropicAdapter, GitHubAdapter, etc.) are no
longer imported at the top of team_runner.py. Instead, each registry maps
short names to 'module.path:ClassName' strings resolved lazily via
importlib.import_module at instantiation time.

This means:
- Adding a new adapter requires only an entry in the registry string dict
  (or a full dotted path directly in team.yaml) — no changes to TeamRunner.
- Third-party / custom adapters work out of the box: set e.g.
  adapters.llm: mypackage.llm.openai:OpenAIAdapter in team.yaml.
- The runner no longer hard-wires knowledge of which concrete classes exist.

Addresses tandrewng review comment on PR #1.
2026-03-16 00:30:28 -04:00
bd96a83069 fix: derive LLM provider from adapter, not config
Remove redundant models.provider from team.yaml. Each adapter knows its
own provider key — AnthropicAdapter always looks up 'anthropic' in the
capability_map. This avoids a footgun where adapters.llm and models.provider
could disagree.

Future adapters (OpenAIAdapter, OllamaAdapter) will hardcode their own key
the same way.
2026-03-15 23:47:52 -04:00
60576fbf2f fix: remove hardcoded max_tokens/temperature from _dispatch_via_llm
Both values are now sourced from team.yaml (models.default_max_tokens and
models.default_temperature) via the adapter's __init__, eliminating the
last hardcoded magic numbers. Callers can still override per-call via
context dict if needed.
2026-03-15 21:43:01 -04:00
8524b63a76 fix: read default_temperature from team.yaml; update docstrings
- Add default_temperature: 0 to config/team.yaml models block
- Read self._default_temperature from models cfg in __init__
- Use self._default_temperature as fallback in complete() instead of hardcoded 0
- Update class docstring to document both default_max_tokens and default_temperature
- Update complete() context param docs to reference team.yaml keys
2026-03-15 21:40:05 -04:00
6856f10c27 fix(adapter/llm): make max_tokens configurable via team.yaml models.default_max_tokens 2026-03-15 18:55:57 -04:00
e097f4be21 feat(core): implement TeamRunner orchestration loop
Full T1→T5 pipeline orchestration with adapter registry, escalation,
and blackboard event emission.

Key design decisions:
- Adapter registry maps config keys to concrete classes; VCS and notify
  are optional (swallow init errors and degrade gracefully)
- _dispatch_brief() routes to LLM adapter (standard) or coding runtime
  (coding_agent) based on brief.preferred_runtime
- _run_with_escalation() drives the retry/salvage loop: persists amended
  briefs to the Blackboard before each re-submission
- Tier parsers (_parse_t1/t2/t3_output) build child TaskBriefs, preserving
  the goal_anchor invariant and resolving agent personalities from the registry
- T5 Verifier is always spawned after T4; VCS commit only happens on
  verified pass (status "passed" or "done")
- --dry-run flag: logs all actions, skips LLM, VCS, and notify calls
- Exposes CLI via `python -m core.team_runner` with --config, --dry-run,
  --verbose flags

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-15 03:15:37 -04:00
97e7be80d1 feat(adapter/runtime): implement OpenClaw and ClaudeCode runtime adapters
OpenClawRuntimeAdapter:
- spawn() shells out to `openclaw session spawn --task <t> --mode run`
- get_result() polls `openclaw session get <id>` until terminal status or timeout
- kill() calls `openclaw session kill <id>`, silently succeeds if finished
- Parses JSON or raw-text session IDs; raises NotImplementedError with
  helpful message when openclaw CLI is absent from PATH

ClaudeCodeRuntimeAdapter:
- spawn() launches `claude --permission-mode bypassPermissions --print <task>`
  in a temp dir (or context["workdir"]), returns a UUID job_id
- Tracks all Popen instances in a thread-safe dict
- get_result() calls communicate(timeout=...), raises TimeoutError on timeout
- kill() terminates the Popen; silently ignores already-finished processes

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-15 03:15:21 -04:00
c88c4309ac feat(adapter/notify): implement OpenClawNotifyAdapter
Sends notifications via `openclaw system event --text <msg> --mode now`.
- Always logs locally (info/warning/error) regardless of CLI availability
- Gracefully handles FileNotFoundError (openclaw not on PATH) and
  TimeoutExpired; notifications are best-effort and never crash the pipeline
- OPENCLAW_SIGNAL_NUMBER env var stored for future direct-signal support

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-15 03:15:13 -04:00
b212082b58 feat(adapter/vcs): implement GitHubAdapter
Uses PyGithub to interact with the GitHub REST API.
- Reads GITHUB_TOKEN from env; parses owner/repo from SSH or HTTPS URL
- create_branch() creates a branch off the configured base branch
- commit() accepts dict[str, str] {path: content} or list[str] of
  local paths; uses Contents API (create_file / update_file)
- create_pr() and get_pr_status() delegate to PyGithub pull-request API

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-15 03:15:06 -04:00
9646a146bc feat(adapter/llm): implement AnthropicAdapter
Implements AnthropicAdapter using the anthropic SDK.
- Reads ANTHROPIC_API_KEY from env; raises ValueError if missing
- resolve_model() looks up capability_map in team.yaml config,
  falls back to "capable" tier then hard-coded claude-sonnet-4-6
- complete() supports system_prompt, max_tokens (default 4096),
  and temperature (default 0) via the context dict
- Adds PyGithub to requirements.txt (needed by GitHubAdapter)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-15 03:15:01 -04:00
70f1c2f49e chore: point agents submodule at forked repo for resilience 2026-03-15 02:34:11 -04:00
eaf7fd8f6f feat: initial bootstrap — structure, task_brief, blackboard, adapter bases, escalation, prompts
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-15 02:19:14 -04:00