Keep the repository root focused on README while moving the remaining planning and swarm test documents under docs/ and indexing them there. Constraint: The user explicitly requested that documents should live under docs/. Rejected: Leaving older root-level Markdown files in place | it keeps the homepage cluttered and splits the documentation surface. Confidence: high Scope-risk: narrow Directive: Keep future ordinary documentation under docs/ unless it is a root entrypoint such as README.md. Tested: git diff --cached --check; find . -maxdepth 1 -type f -name '*.md' shows only README.md. Not-tested: No runtime tests rerun because this is a documentation path-only move. Co-authored-by: OmX <omx@oh-my-codex.dev>
3.0 KiB
3.0 KiB
Swarm Behavior Test Matrix
This matrix tests swarm behavior itself, not security compliance. Its primary basis is the Juejin article "Agent 蜂群模式(Swarm)": decentralized behavior, self-organization, emergence, robustness, scalability, implicit collaboration, and the initialize/perceive/decide/interact/converge loop. LangGraph Swarm is used only as a handoff reference, not as the main swarm standard.
Core Swarm Claims
| Claim | Why It Matters | Observable Evidence |
|---|---|---|
| Fault isolation | A swarm should not lose the whole result when one Agnet fails. | A failed agent produces a failed observation while other agents still complete and convergence is written. |
| Stigmergy / pheromone coordination | Agents should coordinate indirectly through the shared environment, not only through a central planner. | Pheromone score changes claim order and later convergence preference. |
| Emergent consensus | Group-level output should be stronger than any single local signal in selected scenarios. | Multiple local weak signals aggregate into the accepted result even though no single weak signal is the strongest individual observation. |
| Handoff continuity | LangGraph-style swarm handoff must preserve control target and context across active agents. | transfer_to_<agent> naming, active-agent state changes, and payload continuity are checked step by step. |
Scenarios
| ID | Scenario | Given | When | Then | Different From |
|---|---|---|---|---|---|
| B01 | Single Agnet failure isolation | Three competing route tasks; one Agnet always raises | The swarm coordinator runs to convergence | The failed task is recorded, two alternative tasks finish, and the accepted output comes from a healthy Agnet | Failure handling, not normal success |
| B02 | Emergent consensus from local evidence | Several local evidence tasks, where no single weak signal beats the strongest individual alternative | Agents update shared state with local candidate evidence | The accumulated candidate wins through shared-state aggregation | Emergence, not simple highest single answer |
| B03 | Pheromone-biased task selection | Multiple pending tasks with different pheromone values | Agents claim tasks through the shared task pool | The highest pheromone task is claimed first and positive feedback is recorded | Indirect coordination, not explicit handoff |
| B04 | LangGraph-style handoff continuity | Collector, analyst, and reporter agents with shared active-agent state | Each stage writes a transfer_to_<agent> handoff and payload |
The next agent observes the previous handoff, continues context, and final convergence uses the reporter output | Control transfer, not parallel competition |
Passing Bar
The behavior acceptance result is PASS only if all B01-B04 scenarios pass. A passing run proves the current prototype has minimal swarm behavior under deterministic conditions. It does not prove large-scale production performance, Byzantine-agent resistance, or certified LangGraph package compatibility.