Examples¶
End-to-end examples demonstrating Colony's multi-agent analysis capabilities. Each example includes a ready-to-run YAML config, an annotated walkthrough of the agent hierarchy, and key code from the Colony codebase.
Prerequisites
All examples assume a running Colony cluster. See Installation and the colony-env guide for setup.
Code Analysis¶
-
Codebase Analysis
Analyze a large codebase end-to-end. The coordinator spawns ClusterAnalyzer agents that shard the repo into VCM pages, perform local analysis, resolve cross-page queries, and synthesize a structural report.
beginnerpage-shardingvcmcross-page-queries -
Change Impact Analysis
Trace the ripple effects of code changes across a codebase. Worker agents use multi-hop dependency propagation, hypothesis games validate critical impacts, and a game-theoretic merge produces a ranked impact report.
intermediatehypothesis-gamespage-graphmerge-policies -
Compliance Audit
Check license, security, and quality compliance. Agents build obligation graphs linking requirements to source evidence, detect license compatibility conflicts, and produce actionable remediation guidance.
intermediateobligation-graphsmerge-policies -
Intent Inference
Map code to business purposes. Agents infer function-level, class-level, or module-level intent, build intent graphs, detect misalignments between stated purpose and actual behavior, and reach consensus via game protocols.
intermediateconsensus-gamesintent-graphs -
Contract Inference
Infer function contracts — preconditions, postconditions, and invariants — at configurable formalism levels. Hypothesis games challenge and validate each contract before acceptance.
intermediatehypothesis-gamesformal-specs -
Program Slicing
Extract the minimal code subset affecting a target variable. Supports backward, forward, chopping, and conditioned slices with LLM-based interprocedural dependency reasoning across page boundaries.
intermediateslicinginterprocedural
Advanced Workflows¶
-
Multi-Analysis Workflow
Run impact analysis, compliance audit, and intent inference simultaneously on the same paged codebase. All agent teams share the VCM and page graph — pages loaded for one analysis are reusable by others via the shared KV cache.
advancedconcurrent-teamsshared-vcmcache-reuse
Running Any Example¶
Every example follows the same workflow:
Explore the CLI
Use polymath list analyses to see all available analysis types, polymath list capabilities to see attachable capabilities, and polymath describe impact to see the full agent hierarchy for a specific analysis.