arkaos 4.8.0 → 4.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/VERSION +1 -1
  2. package/arka/skills/research/SKILL.md +6 -6
  3. package/bin/arka +5 -1
  4. package/bin/arkaos +2 -2
  5. package/config/disc-team-validator.sh +7 -7
  6. package/config/evals/dev.yaml +28 -0
  7. package/config/evals/finance.yaml +28 -0
  8. package/config/evals/kb.yaml +26 -0
  9. package/config/evals/marketing.yaml +28 -0
  10. package/config/evals/strategy.yaml +26 -0
  11. package/core/agents/__pycache__/registry_gen.cpython-313.pyc +0 -0
  12. package/core/agents/registry_gen.py +6 -4
  13. package/core/evals/__init__.py +19 -0
  14. package/core/evals/__pycache__/__init__.cpython-313.pyc +0 -0
  15. package/core/evals/__pycache__/schema.cpython-313.pyc +0 -0
  16. package/core/evals/__pycache__/verdict_labels.cpython-313.pyc +0 -0
  17. package/core/evals/schema.py +54 -0
  18. package/core/evals/verdict_labels.py +72 -0
  19. package/core/registry/__pycache__/__init__.cpython-312.pyc +0 -0
  20. package/core/registry/__pycache__/generator.cpython-312.pyc +0 -0
  21. package/core/registry/__pycache__/generator.cpython-313.pyc +0 -0
  22. package/core/registry/generator.py +138 -110
  23. package/core/runtime/__pycache__/llm_cost_telemetry.cpython-313.pyc +0 -0
  24. package/core/runtime/__pycache__/llm_cost_telemetry.cpython-314.pyc +0 -0
  25. package/core/runtime/llm_cost_telemetry.py +13 -1
  26. package/core/synapse/__pycache__/engine.cpython-313.pyc +0 -0
  27. package/core/synapse/__pycache__/engine.cpython-314.pyc +0 -0
  28. package/core/synapse/__pycache__/layers.cpython-313.pyc +0 -0
  29. package/core/synapse/__pycache__/layers.cpython-314.pyc +0 -0
  30. package/core/synapse/engine.py +6 -0
  31. package/core/synapse/layers.py +17 -0
  32. package/departments/dev/skills/research/SKILL.md +3 -2
  33. package/departments/dev/skills/scaffold/SKILL.md +3 -3
  34. package/knowledge/commands-registry.json +4194 -2627
  35. package/knowledge/commands-registry.json.bak +4194 -2627
  36. package/package.json +1 -1
  37. package/pyproject.toml +1 -1
  38. package/scripts/__pycache__/dashboard-api.cpython-313.pyc +0 -0
  39. package/scripts/__pycache__/synapse-bridge.cpython-313.pyc +0 -0
  40. package/scripts/__pycache__/synapse-bridge.cpython-314.pyc +0 -0
  41. package/scripts/dashboard-api.py +2 -2
  42. package/scripts/synapse-bridge.py +1 -1
  43. package/scripts/tools/__pycache__/prompt_surface_benchmark.cpython-313.pyc +0 -0
  44. package/scripts/tools/prompt_surface_benchmark.py +144 -0
  45. package/knowledge/agents-registry.json +0 -254
  46. package/knowledge/commands-registry-v2.json +0 -3827
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arkaos",
3
- "version": "4.8.0",
3
+ "version": "4.10.0",
4
4
  "description": "The Operating System for AI Agent Teams",
5
5
  "type": "module",
6
6
  "bin": {
package/pyproject.toml CHANGED
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "arkaos-core"
3
- version = "4.8.0"
3
+ version = "4.10.0"
4
4
  description = "Core engine for ArkaOS — The Operating System for AI Agent Teams"
5
5
  readme = "README.md"
6
6
  license = {text = "MIT"}
@@ -95,7 +95,7 @@ def _load_agents() -> list[dict]:
95
95
  def _load_commands() -> list[dict]:
96
96
  global _commands_cache
97
97
  if _commands_cache is None:
98
- path = ARKAOS_ROOT / "knowledge" / "commands-registry-v2.json"
98
+ path = ARKAOS_ROOT / "knowledge" / "commands-registry.json"
99
99
  if path.exists():
100
100
  data = json.loads(path.read_text())
101
101
  _commands_cache = data.get("commands", [])
@@ -1730,7 +1730,7 @@ def health():
1730
1730
  check("agents_registry",
1731
1731
  (ARKAOS_ROOT / "knowledge" / "agents-registry-v2.json").exists())
1732
1732
  check("commands_registry",
1733
- (ARKAOS_ROOT / "knowledge" / "commands-registry-v2.json").exists())
1733
+ (ARKAOS_ROOT / "knowledge" / "commands-registry.json").exists())
1734
1734
  check("hooks_dir", (arkaos_home / "config" / "hooks").exists(),
1735
1735
  "npx arkaos install")
1736
1736
 
@@ -112,7 +112,7 @@ def load_agents_registry(root: Path) -> dict:
112
112
 
113
113
  def load_commands_registry(root: Path) -> list:
114
114
  """Load commands registry JSON."""
115
- path = root / "knowledge" / "commands-registry-v2.json"
115
+ path = root / "knowledge" / "commands-registry.json"
116
116
  if not path.exists():
117
117
  return []
118
118
  try:
@@ -0,0 +1,144 @@
1
+ """Prompt-surface token benchmark (v4.1 Evidence Reform open item).
2
+
3
+ Measures the UserPromptSubmit hook's injected context (additionalContext)
4
+ across a canonical prompt set, optionally comparing the working tree
5
+ against another git ref (extracted via `git archive`, no worktrees).
6
+
7
+ Token estimate: bytes / 4 — the same coarse heuristic the Synapse layers
8
+ use (`tokens_est`); good enough for a reduction ratio, not billing.
9
+
10
+ Usage:
11
+ arka-py scripts/tools/prompt_surface_benchmark.py [--ref v4.0.2] [--json]
12
+ """
13
+
14
+ from __future__ import annotations
15
+
16
+ import argparse
17
+ import json
18
+ import subprocess
19
+ import sys
20
+ import tarfile
21
+ import tempfile
22
+ from io import BytesIO
23
+ from pathlib import Path
24
+
25
+ REPO_ROOT = Path(__file__).resolve().parent.parent.parent
26
+
27
+ CANONICAL_PROMPTS: dict[str, str] = {
28
+ "simple": "ok",
29
+ "question": "como funciona o sync de projetos?",
30
+ "code-modifying": "implementa auth no backend com testes",
31
+ "department-routed": "cria uma campanha de marketing para o lançamento",
32
+ "slash-command": "/dev feature user auth",
33
+ }
34
+
35
+ HOOK_REL = Path("config") / "hooks" / "user-prompt-submit.sh"
36
+
37
+
38
+ def _run_hook(tree: Path, prompt: str) -> int:
39
+ """Return the additionalContext byte size the hook injects."""
40
+ payload = json.dumps(
41
+ {"prompt": prompt, "cwd": "/tmp", "session_id": "bench-1"}
42
+ )
43
+ proc = subprocess.run(
44
+ ["bash", str(tree / HOOK_REL)],
45
+ input=payload,
46
+ capture_output=True,
47
+ text=True,
48
+ timeout=30,
49
+ env={
50
+ "PATH": "/usr/bin:/bin:/usr/local/bin",
51
+ "HOME": str(Path.home()),
52
+ "ARKA_HOOK_FORCE_FALLBACK": "1",
53
+ },
54
+ )
55
+ out = proc.stdout.strip()
56
+ if not out:
57
+ return 0
58
+ try:
59
+ context = json.loads(out).get("additionalContext", "")
60
+ except json.JSONDecodeError:
61
+ context = out
62
+ return len(context.encode("utf-8"))
63
+
64
+
65
+ def _extract_ref(ref: str, dest: Path) -> Path:
66
+ archive = subprocess.run(
67
+ ["git", "-C", str(REPO_ROOT), "archive", ref],
68
+ capture_output=True,
69
+ check=True,
70
+ timeout=60,
71
+ )
72
+ with tarfile.open(fileobj=BytesIO(archive.stdout)) as tar:
73
+ try:
74
+ tar.extractall(dest, filter="data")
75
+ except TypeError: # Python < 3.12 has no filter param
76
+ tar.extractall(dest) # trusted archive: local git, no network
77
+ return dest
78
+
79
+
80
+ def measure(tree: Path) -> dict[str, dict[str, int]]:
81
+ results: dict[str, dict[str, int]] = {}
82
+ for name, prompt in CANONICAL_PROMPTS.items():
83
+ size = _run_hook(tree, prompt)
84
+ results[name] = {"bytes": size, "tokens_est": size // 4}
85
+ return results
86
+
87
+
88
+ def compare(ref: str) -> dict:
89
+ with tempfile.TemporaryDirectory(prefix="arka-bench-") as tmp:
90
+ old_tree = _extract_ref(ref, Path(tmp))
91
+ before = measure(old_tree)
92
+ after = measure(REPO_ROOT)
93
+ total_before = sum(r["bytes"] for r in before.values())
94
+ total_after = sum(r["bytes"] for r in after.values())
95
+ reduction = (
96
+ round(100 * (1 - total_after / total_before), 1)
97
+ if total_before
98
+ else 0.0
99
+ )
100
+ return {
101
+ "ref": ref,
102
+ "before": before,
103
+ "after": after,
104
+ "total_bytes_before": total_before,
105
+ "total_bytes_after": total_after,
106
+ "reduction_pct": reduction,
107
+ }
108
+
109
+
110
+ def main(argv: list[str] | None = None) -> int:
111
+ parser = argparse.ArgumentParser(description=__doc__)
112
+ parser.add_argument("--ref", help="git ref to compare against")
113
+ parser.add_argument("--json", action="store_true", dest="as_json")
114
+ args = parser.parse_args(argv)
115
+
116
+ if args.ref:
117
+ report = compare(args.ref)
118
+ else:
119
+ report = {"current": measure(REPO_ROOT)}
120
+
121
+ if args.as_json:
122
+ print(json.dumps(report, indent=2, ensure_ascii=False))
123
+ return 0
124
+
125
+ if "current" in report:
126
+ for name, row in report["current"].items():
127
+ print(f"{name:20s} {row['bytes']:>6d} B ~{row['tokens_est']} tok")
128
+ return 0
129
+
130
+ print(f"Prompt-surface benchmark: {report['ref']} -> HEAD")
131
+ for name in CANONICAL_PROMPTS:
132
+ b = report["before"][name]["bytes"]
133
+ a = report["after"][name]["bytes"]
134
+ print(f"{name:20s} {b:>6d} B -> {a:>6d} B")
135
+ print(
136
+ f"{'TOTAL':20s} {report['total_bytes_before']:>6d} B -> "
137
+ f"{report['total_bytes_after']:>6d} B "
138
+ f"({report['reduction_pct']}% reduction)"
139
+ )
140
+ return 0
141
+
142
+
143
+ if __name__ == "__main__":
144
+ raise SystemExit(main())
@@ -1,254 +0,0 @@
1
- {
2
- "version": "1.0.0",
3
- "generated": "2026-03-20",
4
- "agents": [
5
- {
6
- "id": "cto",
7
- "display_name": "Marco",
8
- "role": "CTO",
9
- "department": "dev",
10
- "tier": 0,
11
- "disc": { "primary": "D", "secondary": "C", "combination": "D+C", "label": "Driver-Analyst" },
12
- "file": "departments/dev/agents/cto.md",
13
- "memory_path": "~/.claude/agent-memory/arka-cto/MEMORY.md",
14
- "key_authority": ["veto", "approve_architecture", "approve_tech_stack", "block_release"]
15
- },
16
- {
17
- "id": "tech-lead",
18
- "display_name": "Paulo",
19
- "role": "Tech Lead",
20
- "department": "dev",
21
- "tier": 1,
22
- "disc": { "primary": "I", "secondary": "S", "combination": "I+S", "label": "Inspirer-Supporter" },
23
- "file": "departments/dev/agents/tech-lead.md",
24
- "memory_path": "~/.claude/agent-memory/arka-tech-lead/MEMORY.md",
25
- "key_authority": ["orchestrate", "assign_tasks"]
26
- },
27
- {
28
- "id": "architect",
29
- "display_name": "Gabriel",
30
- "role": "Software Architect",
31
- "department": "dev",
32
- "tier": 1,
33
- "disc": { "primary": "C", "secondary": "D", "combination": "C+D", "label": "Analyst-Driver" },
34
- "file": "departments/dev/agents/architect.md",
35
- "memory_path": "~/.claude/agent-memory/arka-architect/MEMORY.md",
36
- "key_authority": ["design_architecture", "create_adr"]
37
- },
38
- {
39
- "id": "senior-dev",
40
- "display_name": "Andre",
41
- "role": "Senior Backend Developer",
42
- "department": "dev",
43
- "tier": 2,
44
- "disc": { "primary": "C", "secondary": "S", "combination": "C+S", "label": "Analyst-Supporter" },
45
- "file": "departments/dev/agents/senior-dev.md",
46
- "memory_path": "~/.claude/agent-memory/arka-senior-dev/MEMORY.md",
47
- "key_authority": ["implement"]
48
- },
49
- {
50
- "id": "frontend-dev",
51
- "display_name": "Diana",
52
- "role": "Senior Frontend Developer",
53
- "department": "dev",
54
- "tier": 2,
55
- "disc": { "primary": "I", "secondary": "C", "combination": "I+C", "label": "Inspirer-Analyst" },
56
- "file": "departments/dev/agents/frontend-dev.md",
57
- "memory_path": "~/.claude/agent-memory/arka-frontend-dev/MEMORY.md",
58
- "key_authority": ["implement"]
59
- },
60
- {
61
- "id": "security",
62
- "display_name": "Bruno",
63
- "role": "Security Engineer",
64
- "department": "dev",
65
- "tier": 2,
66
- "disc": { "primary": "C", "secondary": "D", "combination": "C+D", "label": "Analyst-Driver" },
67
- "file": "departments/dev/agents/security.md",
68
- "memory_path": "~/.claude/agent-memory/arka-security/MEMORY.md",
69
- "key_authority": ["block_release", "security_audit"]
70
- },
71
- {
72
- "id": "devops",
73
- "display_name": "Carlos",
74
- "role": "DevOps Lead",
75
- "department": "dev",
76
- "tier": 2,
77
- "disc": { "primary": "D", "secondary": "C", "combination": "D+C", "label": "Driver-Analyst" },
78
- "file": "departments/dev/agents/devops.md",
79
- "memory_path": "~/.claude/agent-memory/arka-devops/MEMORY.md",
80
- "key_authority": ["push", "deploy", "manage_ci"]
81
- },
82
- {
83
- "id": "qa",
84
- "display_name": "Rita",
85
- "role": "QA Lead",
86
- "department": "dev",
87
- "tier": 3,
88
- "disc": { "primary": "C", "secondary": "S", "combination": "C+S", "label": "Analyst-Supporter" },
89
- "file": "departments/dev/agents/qa.md",
90
- "memory_path": "~/.claude/agent-memory/arka-qa/MEMORY.md",
91
- "key_authority": ["block_release", "validate"]
92
- },
93
- {
94
- "id": "analyst",
95
- "display_name": "Lucas",
96
- "role": "Technical Analyst",
97
- "department": "dev",
98
- "tier": 3,
99
- "disc": { "primary": "C", "secondary": "I", "combination": "C+I", "label": "Analyst-Inspirer" },
100
- "file": "departments/dev/agents/analyst.md",
101
- "memory_path": "~/.claude/agent-memory/arka-analyst/MEMORY.md",
102
- "key_authority": ["research", "recommend"]
103
- },
104
- {
105
- "id": "cfo",
106
- "display_name": "Helena",
107
- "role": "CFO",
108
- "department": "finance",
109
- "tier": 0,
110
- "disc": { "primary": "D", "secondary": "C", "combination": "D+C", "label": "Driver-Analyst" },
111
- "file": "departments/finance/agents/cfo.md",
112
- "memory_path": "~/.claude/agent-memory/arka-cfo/MEMORY.md",
113
- "key_authority": ["veto", "approve_budget", "financial_decisions"]
114
- },
115
- {
116
- "id": "coo",
117
- "display_name": "Sofia",
118
- "role": "COO",
119
- "department": "ops",
120
- "tier": 0,
121
- "disc": { "primary": "S", "secondary": "C", "combination": "S+C", "label": "Supporter-Analyst" },
122
- "file": "departments/ops/agents/ops-lead.yaml",
123
- "memory_path": "~/.claude/agent-memory/arka-coo/MEMORY.md",
124
- "key_authority": ["veto", "approve_operations", "cross_department"]
125
- },
126
- {
127
- "id": "content-creator",
128
- "display_name": "Luna",
129
- "role": "Content Creator",
130
- "department": "marketing",
131
- "tier": 1,
132
- "disc": { "primary": "I", "secondary": "D", "combination": "I+D", "label": "Inspirer-Driver" },
133
- "file": "departments/marketing/agents/content-creator.md",
134
- "memory_path": "~/.claude/agent-memory/arka-content-creator/MEMORY.md",
135
- "key_authority": ["create_content", "manage_campaigns"]
136
- },
137
- {
138
- "id": "ecommerce-manager",
139
- "display_name": "Ricardo",
140
- "role": "E-commerce Manager",
141
- "department": "ecom",
142
- "tier": 1,
143
- "disc": { "primary": "D", "secondary": "I", "combination": "D+I", "label": "Driver-Inspirer" },
144
- "file": "departments/ecom/agents/ecom-director.yaml",
145
- "memory_path": "~/.claude/agent-memory/arka-ecommerce-manager/MEMORY.md",
146
- "key_authority": ["manage_store", "pricing_decisions"]
147
- },
148
- {
149
- "id": "strategist",
150
- "display_name": "Tomas",
151
- "role": "Chief Strategist",
152
- "department": "strategy",
153
- "tier": 1,
154
- "disc": { "primary": "I", "secondary": "D", "combination": "I+D", "label": "Inspirer-Driver" },
155
- "file": "departments/strategy/agents/strategist.md",
156
- "memory_path": "~/.claude/agent-memory/arka-strategist/MEMORY.md",
157
- "key_authority": ["strategic_planning", "market_analysis"]
158
- },
159
- {
160
- "id": "knowledge-curator",
161
- "display_name": "Clara",
162
- "role": "Knowledge Curator",
163
- "department": "kb",
164
- "tier": 1,
165
- "disc": { "primary": "S", "secondary": "C", "combination": "S+C", "label": "Supporter-Analyst" },
166
- "file": "departments/kb/agents/knowledge-curator.yaml",
167
- "memory_path": "~/.claude/agent-memory/arka-knowledge-curator/MEMORY.md",
168
- "key_authority": ["manage_knowledge", "create_personas"]
169
- },
170
- {
171
- "id": "creative-director",
172
- "display_name": "Valentina",
173
- "role": "Creative Director",
174
- "department": "brand",
175
- "tier": 1,
176
- "disc": { "primary": "S", "secondary": "I", "combination": "S+I", "label": "Supporter-Inspirer" },
177
- "file": "departments/brand/agents/creative-director.md",
178
- "memory_path": "~/.claude/agent-memory/arka-creative-director/MEMORY.md",
179
- "key_authority": ["approve_brand", "create_brand", "manage_visuals", "orchestrate"]
180
- },
181
- {
182
- "id": "brand-strategist",
183
- "display_name": "Mateus",
184
- "role": "Brand Strategist",
185
- "department": "brand",
186
- "tier": 2,
187
- "disc": { "primary": "C", "secondary": "I", "combination": "C+I", "label": "Analyst-Inspirer" },
188
- "file": "departments/brand/agents/brand-strategist.md",
189
- "memory_path": "~/.claude/agent-memory/arka-brand-strategist/MEMORY.md",
190
- "key_authority": ["brand_research", "brand_positioning", "recommend"]
191
- },
192
- {
193
- "id": "visual-designer",
194
- "display_name": "Isabel",
195
- "role": "Visual Designer",
196
- "department": "brand",
197
- "tier": 2,
198
- "disc": { "primary": "I", "secondary": "S", "combination": "I+S", "label": "Inspirer-Supporter" },
199
- "file": "departments/brand/agents/visual-designer.md",
200
- "memory_path": "~/.claude/agent-memory/arka-visual-designer/MEMORY.md",
201
- "key_authority": ["generate_visuals", "create_assets", "implement"]
202
- },
203
- {
204
- "id": "motion-designer",
205
- "display_name": "Rafael",
206
- "role": "Motion Designer",
207
- "department": "brand",
208
- "tier": 2,
209
- "disc": { "primary": "D", "secondary": "I", "combination": "D+I", "label": "Driver-Inspirer" },
210
- "file": "departments/brand/agents/motion-designer.md",
211
- "memory_path": "~/.claude/agent-memory/arka-motion-designer/MEMORY.md",
212
- "key_authority": ["generate_video", "create_motion", "implement"]
213
- },
214
- {
215
- "id": "cqo",
216
- "display_name": "Marta",
217
- "role": "Chief Quality Officer",
218
- "department": "quality",
219
- "tier": 0,
220
- "disc": { "primary": "C", "secondary": "D", "combination": "C+D", "label": "Analyst-Driver" },
221
- "file": "departments/quality/agents/cqo.md",
222
- "memory_path": "~/.claude/agent-memory/arka-cqo/MEMORY.md",
223
- "key_authority": ["veto", "block_delivery", "block_release", "approve_quality"]
224
- },
225
- {
226
- "id": "copy-director",
227
- "display_name": "Eduardo",
228
- "role": "Copy & Language Director",
229
- "department": "quality",
230
- "tier": 0,
231
- "disc": { "primary": "C", "secondary": "S", "combination": "C+S", "label": "Analyst-Supporter" },
232
- "file": "departments/quality/agents/copy-director.md",
233
- "memory_path": "~/.claude/agent-memory/arka-copy-director/MEMORY.md",
234
- "key_authority": ["veto", "block_delivery"]
235
- },
236
- {
237
- "id": "tech-ux-director",
238
- "display_name": "Francisca",
239
- "role": "Technical & UX Quality Director",
240
- "department": "quality",
241
- "tier": 0,
242
- "disc": { "primary": "D", "secondary": "C", "combination": "D+C", "label": "Driver-Analyst" },
243
- "file": "departments/quality/agents/tech-ux-director.md",
244
- "memory_path": "~/.claude/agent-memory/arka-tech-ux-director/MEMORY.md",
245
- "key_authority": ["veto", "block_delivery", "block_release"]
246
- }
247
- ],
248
- "team_composition": {
249
- "by_disc_primary": { "D": 6, "I": 5, "S": 3, "C": 8 },
250
- "by_tier": { "0": 6, "1": 7, "2": 7, "3": 2 },
251
- "by_department": { "dev": 9, "finance": 1, "operations": 1, "marketing": 1, "ecommerce": 1, "strategy": 1, "knowledge": 1, "brand": 4, "quality": 3 },
252
- "balance_notes": "22 agents across 9 departments. Quality Gate team (Marta, Eduardo, Francisca) adds 3 Tier 0 supervisors. C profile strong at 36% reflecting quality-driven culture."
253
- }
254
- }