coact.analysis¶
Analysis utilities — small tools to see and move between the layers.
COACT_SPEC §7. Thin tooling around the two transforms:
diff()— what extras an agent adds over its source skill (audit drift between the SSOT skill and a derived agent).estimate()— the §3.5 / DECISIONS-D9 cost gate: the implied fan-out token multiplier of an agent set, flagging interdependent sets where multi-agent is a poor fit.inventory()— enumerate a project’s reusable AI assets: skills, derived agents, and MCP-exposed tools (reusesskilldiscovery; adds the agent + MCP dimensions).back()— best-effort, lossy agent→skill extraction (harvest an ad-hoc agent back into reusable procedural knowledge).
Functions
|
Best-effort, lossy agent→skill extraction (harvest an agent into a skill). |
|
Show what extras |
|
Surface the fan-out cost tradeoff for an agent set (DECISIONS D9). |
|
Enumerate skills, derived agents, and MCP-exposed tools in a project. |
Classes
|
What a derived agent adds over its source skill. |
|
The implied cost tradeoff of realizing an agent set as a running fleet. |
|
One picture of a project's reusable AI assets. |
- class coact.analysis.AgentDiff(skill_name, agent_name, rows=list())[source]¶
Bases:
objectWhat a derived agent adds over its source skill.
- class coact.analysis.Estimate(n_agents, interdependent, shared_skills, token_multiplier_vs_chat, recommendation)[source]¶
Bases:
objectThe implied cost tradeoff of realizing an agent set as a running fleet.
- class coact.analysis.Inventory(project, skills=list(), agents=list(), mcp_tools=list())[source]¶
Bases:
objectOne picture of a project’s reusable AI assets.
- coact.analysis.back(agent)[source]¶
Best-effort, lossy agent→skill extraction (harvest an agent into a skill).
Strips the persona/return-contract envelope down to a reusable skill stub (name + description + a pointer to the skills it referenced). The actual procedure usually lives in those referenced skills, so this cannot recover it — the result is a starting point the user fleshes out, not a faithful inverse of COMPLETE.
>>> from coact import AgentDefinition >>> sk = back(AgentDefinition(name='ux', description='Analyze.', skills=['ux', 'shared'])) >>> sk.meta.name 'ux' >>> 'lossy' in sk.body.lower() True- Return type:
Skill
- coact.analysis.diff(skill, agent)[source]¶
Show what extras
agentadds over its sourceskill.skillis any skill source;agentis anAgentDefinition, an agent*.mdpath, or a skill source (which is completed first).>>> from skill.base import Skill, SkillMeta >>> s = Skill(meta=SkillMeta(name='ux', description='Analyze bundles.'), body='steps') >>> from coact import complete >>> d = diff(s, complete(s)) >>> any(f == 'prompt' and cls.startswith('extra') for f, cls, _ in d.rows) True- Return type:
- coact.analysis.estimate(agents)[source]¶
Surface the fan-out cost tradeoff for an agent set (DECISIONS D9).
>>> from coact import AgentDefinition >>> a = AgentDefinition(name='a', description='x', skills=['shared']) >>> b = AgentDefinition(name='b', description='y', skills=['shared']) >>> est = estimate([a, b]) >>> est.interdependent, est.shared_skills (True, ['shared'])- Return type: