akiiwa-games/AgentCompass / skills/agent-compass
agent-compass
FlaggedChoose owner, model and effort, outbound authorization, advisor use, and continuation for delegated work. Reads local usage and effective account policy, profiles the task with the configured System-One scorer, then allocates a compatible worker. Use for independent worker or advisor work; ordinary local execution needs no routing.
scripts/test_capability_catalog.py
View on GitHub"""Effective catalogue and account-policy contracts; synthetic inputs only."""
from copy import deepcopy
from datetime import datetime, timezone
import unittest
from unittest.mock import patch
import account_fleet
import task_intake
import capability_catalog
import decision_ledger
class CatalogueTests(unittest.TestCase):
def setUp(self):
self.accounts = {
'models': {'custom-model': {}},
'capability_policy': {'routes': {'custom-route': {'implies': {'visual': True}}}},
'provider_names': {'statement': 'synthetic: nothing declared', 'defaults': {}, 'rows': {}},
}
self.five = {'models': {'custom-model': {
'tier': {'value': 3.8, 'method': 'arena_overall'}, 'usd_per_hour': {'value': 12.5},
'image_input': {'status': 'ok'},
'axes': {'creativity': {'value': 0.7, 'status': 'estimated'}, 'coding': {'value': 0.8, 'status': 'measured'},
'aesthetics': {'value': 0.6, 'status': 'partial', 'missing_facets': ['design']},
'tool_operation': {'status': 'missing'}}}}}
def test_the_route_policy_is_the_accounts_policy(self):
before = deepcopy(self.accounts)
policy = account_fleet.load_capabilities(accounts=self.accounts)
self.assertEqual(policy['routes'], self.accounts['capability_policy']['routes'])
policy['routes']['custom-route']['implies'] = {}
self.assertEqual(self.accounts, before)
def test_generated_views_follow_the_same_synthetic_source(self):
views = capability_catalog.generated(self.accounts)
self.assertIn('custom-route', views['model-capabilities.json'])
md = capability_catalog.markdown(self.accounts, self.five)
row = next(line for line in md.splitlines() if '`custom-model`' in line)
self.assertIn('3.80', row)
self.assertIn('12.5', row)
def test_shipped_views_match_the_shipped_accounts(self):
"""Round 058 review F6: a merge can leave model-capabilities.json/.md behind accounts.json without a conflict;
the shipped views must be what capability_catalog.py generates from the shipped accounts.json now."""
import json
accounts = json.loads((capability_catalog.REFERENCES / 'accounts.json').read_text(encoding='utf-8-sig'))
for name, content in capability_catalog.generated(accounts).items():
shipped = (capability_catalog.REFERENCES / name).read_text(encoding='utf-8')
self.assertEqual(shipped, content, f'{name} is stale: run `python -X utf8 capability_catalog.py`')
def test_estimated_and_partial_categories_are_marked_in_the_markdown_view(self):
md = capability_catalog.markdown(self.accounts, self.five)
row = next(line for line in md.splitlines() if '`custom-model`' in line)
self.assertIn('0.70~ | 0.80 | 0.60! | missing |', row)
def test_dot_takes_every_route_unless_the_work_is_local_or_visual(self):
policy = {'routes': {'custom-route': {}}}
self.assertTrue(task_intake.dot_may_take('custom-route', {}, policy))
self.assertFalse(task_intake.dot_may_take('custom-route', {'local_only': True}, policy))
self.assertFalse(task_intake.dot_may_take('custom-route', {'visual': True}, policy))
def test_dispatch_cadence_uses_configured_account_and_threshold(self):
now = datetime(2026, 10, 29, tzinfo=timezone.utc)
records = [{'stage': 'record', 'choice': 'custom', 'at': now.isoformat(),
'bundle': {'account': 'workspace-account', 'provider': 'custom'}}] * 3
self.assertIsNone(decision_ledger.account_cadence_alert(records, now, 'workspace-account', {}))
spec = {'cadence': {'window_seconds': 3600, 'limit': 3}}
self.assertIsNotNone(decision_ledger.account_cadence_alert(records, now, 'workspace-account', spec))
self.assertIsNone(decision_ledger.account_cadence_alert(records, now, 'other-account', spec))
spec['cadence']['limit'] = 4
self.assertIsNone(decision_ledger.account_cadence_alert(records, now, 'workspace-account', spec))
def test_remote_adapter_names_do_not_suppress_capacity_alerts(self):
for provider in ('dot', 'chatgpt-web', 'custom-remote'):
with self.subTest(provider=provider), \
patch.object(decision_ledger, 'LEDGER_WRITES', False), \
patch.object(decision_ledger, 'append_ledger'), \
patch.object(account_fleet, 'load_accounts', return_value={'accounts': {}}), \
patch.object(decision_ledger, 'capacity_alerts', return_value=[{'code': 'capacity-proof'}]) as alerts:
result = {'stage': 'plan', 'selected_bundle': {
'provider': provider, 'account': 'workspace-account', 'expected_usd': 0}}
decision_ledger.finalize(result, 0, records=[])
alerts.assert_called_once()
self.assertIn('capacity-proof', [row['code'] for row in result['alerts']])
if __name__ == '__main__':
unittest.main()
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: 471k | 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 |