Skip to content

valkryhx/google_adk_agent / skills/agent_team_to_be_update

Agent 团队协作(去中心化拉模型)

Flagged

赋予 Agent 作为集群指挥官(Leader)的能力,通过去中心化任务队列将子任务派发给 Worker 节点并发执行。

FileKindSize
SKILL.mdskill md17.9 KB
decentralized_tools.pyscript36.2 KB
dependency_analyzer.pyscript10.9 KB
inbox_watcher.pyscript8.5 KB
loop_executor.pyscript16.4 KB
mailbox.pyscript15.3 KB
models.pyscript9.1 KB
path_guard.pyscript13.3 KB
planner.pyscript14.6 KB
polling_daemon.pyscript7.7 KB
self_claim_loop.pyscript20.1 KB
task_queue.pyscript24.1 KB
team_config.pyscript7.5 KB
test/__init__.pyscript40 B
test/test_blog_system_develop.pyscript12.0 KB
test/test_dag_create_validation.pyscript2.7 KB
test/test_decentralized_arch.pyscript36.9 KB
test/test_deepresearch.pyscript14.6 KB
test/test_loop_dag.pyscript17.0 KB
test/test_real_training.pyscript9.2 KB
test/test_tdd_gate.pyscript4.5 KB
tools.pyscript85.8 KB
verification_hooks.pyscript10.7 KB
worktree_manager.pyscript12.8 KB

test/test_dag_create_validation.py

View on GitHub
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Regression tests for dag_create input validation and atomic behavior."""

import asyncio
import os
import shutil
import sys
import tempfile
import uuid

import pytest

# Add skill root to import path
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))

from decentralized_tools import dag_create
from task_queue import TaskQueue


@pytest.fixture
def isolated_coord_root():
    """Provide an isolated coordination root via ADK_COORDINATION_DIR."""
    local_tmp_root = tempfile.gettempdir()
    tmpdir = os.path.join(local_tmp_root, f"dag_create_validation_{uuid.uuid4().hex}")
    os.makedirs(tmpdir, exist_ok=False)
    old_coord_root = os.environ.get("ADK_COORDINATION_DIR")
    os.environ["ADK_COORDINATION_DIR"] = tmpdir
    try:
        yield tmpdir
    finally:
        if old_coord_root is None:
            os.environ.pop("ADK_COORDINATION_DIR", None)
        else:
            os.environ["ADK_COORDINATION_DIR"] = old_coord_root
        shutil.rmtree(tmpdir, ignore_errors=True)


def _build_queue(team_id: str, coord_root: str) -> TaskQueue:
    return TaskQueue(team_id=team_id, base_dir=os.path.join(coord_root, team_id))


def test_dag_create_missing_name_fails_without_partial_tasks(isolated_coord_root):
    team_id = "test-team"
    tasks = [
        {"name": "Task A", "description": "valid"},
        {"description": "missing name field"},
    ]

    with pytest.raises(ValueError, match=r"tasks\[2\]\.name is required"):
        asyncio.run(dag_create(team_id=team_id, tasks=tasks, broadcast=False))

    queue = _build_queue(team_id, isolated_coord_root)
    assert queue.list_tasks() == []


def test_dag_create_unknown_dependency_fails_without_partial_tasks(isolated_coord_root):
    team_id = "test-team"
    tasks = [
        {"name": "Task A"},
        {"name": "Task B", "blocked_by": ["Task C"]},
    ]

    with pytest.raises(ValueError, match="unknown or future task name: Task C"):
        asyncio.run(dag_create(team_id=team_id, tasks=tasks, broadcast=False))

    queue = _build_queue(team_id, isolated_coord_root)
    assert queue.list_tasks() == []


def test_dag_create_valid_tasks_creates_expected_dependency(isolated_coord_root):
    team_id = "test-team"
    tasks = [
        {"name": "Task A"},
        {"name": "Task B", "blocked_by": ["Task A"]},
    ]

    result = asyncio.run(dag_create(team_id=team_id, tasks=tasks, broadcast=False))
    queue = _build_queue(team_id, isolated_coord_root)
    created = queue.list_tasks()

    assert len(created) == 2
    by_name = {task.name: task for task in created}
    assert by_name["Task B"].blocked_by == [by_name["Task A"].id]
    assert "[DAG CREATED]" in result
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: 469kUpdated Claude CodeCodexVerifiedInstall
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: 321kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 321kUpdated Claude CodeCodexVerifiedInstall
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 availableStars: 321kUpdated Claude CodeCodexVerifiedInstall