valkryhx/google_adk_agent / skills/agent_team_to_be_update
Agent 团队协作(去中心化拉模型)
Flagged赋予 Agent 作为集群指挥官(Leader)的能力,通过去中心化任务队列将子任务派发给 Worker 节点并发执行。
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 17.9 KB |
| decentralized_tools.py | script | 36.2 KB |
| dependency_analyzer.py | script | 10.9 KB |
| inbox_watcher.py | script | 8.5 KB |
| loop_executor.py | script | 16.4 KB |
| mailbox.py | script | 15.3 KB |
| models.py | script | 9.1 KB |
| path_guard.py | script | 13.3 KB |
| planner.py | script | 14.6 KB |
| polling_daemon.py | script | 7.7 KB |
| self_claim_loop.py | script | 20.1 KB |
| task_queue.py | script | 24.1 KB |
| team_config.py | script | 7.5 KB |
| test/__init__.py | script | 40 B |
| test/test_blog_system_develop.py | script | 12.0 KB |
| test/test_dag_create_validation.py | script | 2.7 KB |
| test/test_decentralized_arch.py | script | 36.9 KB |
| test/test_deepresearch.py | script | 14.6 KB |
| test/test_loop_dag.py | script | 17.0 KB |
| test/test_real_training.py | script | 9.2 KB |
| test/test_tdd_gate.py | script | 4.5 KB |
| tools.py | script | 85.8 KB |
| verification_hooks.py | script | 10.7 KB |
| worktree_manager.py | script | 12.8 KB |
test/test_tdd_gate.py
View on GitHub#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
TDD Gate Tests for SelfClaimLoop verification hook integration.
Verifies that:
1. A task with a FAILING verification_command is NOT marked completed
(status stays pending after handle_task_error resets it).
2. A task with a PASSING verification_command IS marked completed.
3. A task with no verification_commands completes unconditionally.
"""
import asyncio
import os
import sys
import tempfile
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from models import Task
from task_queue import TaskQueue
from self_claim_loop import SelfClaimLoop
def _make_queue(tmpdir: str, team_id: str = "tdd_test") -> TaskQueue:
return TaskQueue(team_id=team_id, base_dir=tmpdir)
def _make_loop(queue: TaskQueue, tmpdir: str) -> SelfClaimLoop:
loop = SelfClaimLoop(
agent_id="test_worker",
agent_port=0,
team_id=queue.team_id,
coordination_dir=tmpdir,
task_executor=lambda task: {"success": True}, # always "succeeds"
)
# Bypass mailbox send (no real mailbox in unit test)
loop.mailbox = _NoOpMailbox()
loop._leader_agent_id = "test_leader"
return loop
class _NoOpMailbox:
"""Stub mailbox that silently drops messages."""
def send_message(self, **kwargs):
pass
async def _run_task(loop: SelfClaimLoop, task: Task):
"""Helper: claim and execute a single task through SelfClaimLoop."""
await loop._try_claim_and_execute(task)
# ---------------------------------------------------------------------------
# Test 1: Failing verification_command keeps task out of completed
# ---------------------------------------------------------------------------
def test_failing_verification_blocks_completion():
with tempfile.TemporaryDirectory() as tmpdir:
queue = _make_queue(tmpdir)
task = queue.create_task(
name="failing_task",
description="Should fail verification",
verification_commands=["python -c \"assert 1 == 2, 'intentional failure'\""],
)
scl = _make_loop(queue, tmpdir)
asyncio.run(_run_task(scl, task))
refreshed = queue.get_task(task.id)
assert refreshed.status != "completed", (
f"Expected task NOT completed after failing verification, got status={refreshed.status}"
)
print(f"[PASS] test_failing_verification_blocks_completion: status={refreshed.status}")
# ---------------------------------------------------------------------------
# Test 2: Passing verification_command allows completion
# ---------------------------------------------------------------------------
def test_passing_verification_allows_completion():
with tempfile.TemporaryDirectory() as tmpdir:
queue = _make_queue(tmpdir)
task = queue.create_task(
name="passing_task",
description="Should pass verification",
verification_commands=["python -c \"assert 1 == 1\""],
)
scl = _make_loop(queue, tmpdir)
asyncio.run(_run_task(scl, task))
refreshed = queue.get_task(task.id)
assert refreshed.status == "completed", (
f"Expected task completed after passing verification, got status={refreshed.status}"
)
print(f"[PASS] test_passing_verification_allows_completion: status={refreshed.status}")
# ---------------------------------------------------------------------------
# Test 3: No verification_commands — task completes unconditionally
# ---------------------------------------------------------------------------
def test_no_verification_commands_completes():
with tempfile.TemporaryDirectory() as tmpdir:
queue = _make_queue(tmpdir)
task = queue.create_task(
name="no_verification_task",
description="No verification commands set",
)
scl = _make_loop(queue, tmpdir)
asyncio.run(_run_task(scl, task))
refreshed = queue.get_task(task.id)
assert refreshed.status == "completed", (
f"Expected task completed (no verification), got status={refreshed.status}"
)
print(f"[PASS] test_no_verification_commands_completes: status={refreshed.status}")
if __name__ == "__main__":
print("\n" + "=" * 60)
print("TDD Gate Tests")
print("=" * 60 + "\n")
test_failing_verification_blocks_completion()
test_passing_verification_allows_completion()
test_no_verification_commands_completes()
print("\n" + "=" * 60)
print("All TDD gate tests passed!")
print("=" * 60)
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 470k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |