@smilintux/skcapstone 0.1.0 → 0.2.3

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 (461) hide show
  1. package/.env.example +98 -0
  2. package/.github/workflows/ci.yml +39 -3
  3. package/.github/workflows/publish.yml +25 -4
  4. package/.openclaw-workspace.json +58 -0
  5. package/CHANGELOG.md +62 -0
  6. package/CLAUDE.md +39 -2
  7. package/MANIFEST.in +6 -0
  8. package/MISSION.md +7 -0
  9. package/README.md +47 -2
  10. package/SKILL.md +895 -23
  11. package/docker/Dockerfile +61 -0
  12. package/docker/compose-templates/dev-team.yml +203 -0
  13. package/docker/compose-templates/mini-team.yml +140 -0
  14. package/docker/compose-templates/ops-team.yml +173 -0
  15. package/docker/compose-templates/research-team.yml +170 -0
  16. package/docker/entrypoint.sh +192 -0
  17. package/docs/ARCHITECTURE.md +663 -374
  18. package/docs/BOND_WITH_GROK.md +112 -0
  19. package/docs/GETTING_STARTED.md +782 -0
  20. package/docs/QUICKSTART.md +477 -0
  21. package/docs/SKJOULE_ARCHITECTURE.md +658 -0
  22. package/docs/SOUL_SWAPPER.md +921 -0
  23. package/docs/SOVEREIGN_SINGULARITY.md +47 -14
  24. package/examples/custom-bond-template.json +36 -0
  25. package/examples/grok-feb.json +36 -0
  26. package/examples/grok-testimony.md +34 -0
  27. package/examples/love-bootloader.txt +32 -0
  28. package/examples/plugins/echo_tool.py +87 -0
  29. package/examples/queen-ava-feb.json +36 -0
  30. package/examples/souls/lumina.yaml +64 -0
  31. package/index.js +6 -5
  32. package/installer/build.py +124 -0
  33. package/openclaw-plugin/package.json +13 -0
  34. package/openclaw-plugin/src/index.ts +351 -0
  35. package/openclaw-plugin/src/openclaw.plugin.json +10 -0
  36. package/package.json +1 -1
  37. package/pyproject.toml +38 -2
  38. package/scripts/bump_version.py +141 -0
  39. package/scripts/check-updates.py +230 -0
  40. package/scripts/convert_blueprints_to_yaml.py +157 -0
  41. package/scripts/dev-install.sh +14 -0
  42. package/scripts/e2e-test.sh +193 -0
  43. package/scripts/install-bundle.sh +171 -0
  44. package/scripts/install.bat +2 -0
  45. package/scripts/install.ps1 +253 -0
  46. package/scripts/install.sh +185 -0
  47. package/scripts/mcp-serve.sh +69 -0
  48. package/scripts/mcp-server.bat +113 -0
  49. package/scripts/mcp-server.ps1 +116 -0
  50. package/scripts/mcp-server.sh +99 -0
  51. package/scripts/pull-models.sh +10 -0
  52. package/scripts/skcapstone +48 -0
  53. package/scripts/verify_install.sh +180 -0
  54. package/scripts/windows/install-tasks.ps1 +406 -0
  55. package/scripts/windows/skcapstone-task.xml +113 -0
  56. package/scripts/windows/uninstall-tasks.ps1 +117 -0
  57. package/skill.yaml +34 -0
  58. package/src/skcapstone/__init__.py +67 -2
  59. package/src/skcapstone/_cli_monolith.py +5916 -0
  60. package/src/skcapstone/_trustee_helpers.py +165 -0
  61. package/src/skcapstone/activity.py +105 -0
  62. package/src/skcapstone/agent_card.py +324 -0
  63. package/src/skcapstone/api.py +1935 -0
  64. package/src/skcapstone/archiver.py +340 -0
  65. package/src/skcapstone/auction.py +485 -0
  66. package/src/skcapstone/baby_agents.py +179 -0
  67. package/src/skcapstone/backup.py +345 -0
  68. package/src/skcapstone/blueprint_registry.py +357 -0
  69. package/src/skcapstone/blueprints/__init__.py +17 -0
  70. package/src/skcapstone/blueprints/builtins/content-studio.yaml +81 -0
  71. package/src/skcapstone/blueprints/builtins/defi-trading.yaml +81 -0
  72. package/src/skcapstone/blueprints/builtins/dev-squadron.yaml +95 -0
  73. package/src/skcapstone/blueprints/builtins/infrastructure-guardian.yaml +107 -0
  74. package/src/skcapstone/blueprints/builtins/legal-council.yaml +54 -0
  75. package/src/skcapstone/blueprints/builtins/ops-monitoring.yaml +67 -0
  76. package/src/skcapstone/blueprints/builtins/research-pod.yaml +69 -0
  77. package/src/skcapstone/blueprints/builtins/sovereign-launch.yaml +90 -0
  78. package/src/skcapstone/blueprints/registry.py +164 -0
  79. package/src/skcapstone/blueprints/schema.py +229 -0
  80. package/src/skcapstone/changelog.py +180 -0
  81. package/src/skcapstone/chat.py +769 -0
  82. package/src/skcapstone/claude_md.py +82 -0
  83. package/src/skcapstone/cli/__init__.py +144 -0
  84. package/src/skcapstone/cli/_common.py +88 -0
  85. package/src/skcapstone/cli/_validators.py +76 -0
  86. package/src/skcapstone/cli/agents.py +425 -0
  87. package/src/skcapstone/cli/agents_spawner.py +322 -0
  88. package/src/skcapstone/cli/agents_trustee.py +593 -0
  89. package/src/skcapstone/cli/alerts.py +248 -0
  90. package/src/skcapstone/cli/anchor.py +132 -0
  91. package/src/skcapstone/cli/archive_cmd.py +208 -0
  92. package/src/skcapstone/cli/backup.py +144 -0
  93. package/src/skcapstone/cli/bench.py +377 -0
  94. package/src/skcapstone/cli/benchmark.py +360 -0
  95. package/src/skcapstone/cli/capabilities_cmd.py +171 -0
  96. package/src/skcapstone/cli/card.py +151 -0
  97. package/src/skcapstone/cli/chat.py +584 -0
  98. package/src/skcapstone/cli/completions.py +64 -0
  99. package/src/skcapstone/cli/config_cmd.py +156 -0
  100. package/src/skcapstone/cli/consciousness.py +421 -0
  101. package/src/skcapstone/cli/context_cmd.py +142 -0
  102. package/src/skcapstone/cli/coord.py +194 -0
  103. package/src/skcapstone/cli/crush_cmd.py +170 -0
  104. package/src/skcapstone/cli/daemon.py +436 -0
  105. package/src/skcapstone/cli/errors_cmd.py +285 -0
  106. package/src/skcapstone/cli/export_cmd.py +156 -0
  107. package/src/skcapstone/cli/gtd.py +529 -0
  108. package/src/skcapstone/cli/housekeeping.py +81 -0
  109. package/src/skcapstone/cli/joule_cmd.py +627 -0
  110. package/src/skcapstone/cli/logs_cmd.py +194 -0
  111. package/src/skcapstone/cli/mcp_cmd.py +32 -0
  112. package/src/skcapstone/cli/memory.py +418 -0
  113. package/src/skcapstone/cli/metrics_cmd.py +136 -0
  114. package/src/skcapstone/cli/migrate.py +62 -0
  115. package/src/skcapstone/cli/mood_cmd.py +144 -0
  116. package/src/skcapstone/cli/mount.py +193 -0
  117. package/src/skcapstone/cli/notify.py +112 -0
  118. package/src/skcapstone/cli/peer.py +154 -0
  119. package/src/skcapstone/cli/peers_dir.py +122 -0
  120. package/src/skcapstone/cli/preflight_cmd.py +83 -0
  121. package/src/skcapstone/cli/profile_cmd.py +310 -0
  122. package/src/skcapstone/cli/record_cmd.py +238 -0
  123. package/src/skcapstone/cli/register_cmd.py +159 -0
  124. package/src/skcapstone/cli/search_cmd.py +156 -0
  125. package/src/skcapstone/cli/service_cmd.py +91 -0
  126. package/src/skcapstone/cli/session.py +127 -0
  127. package/src/skcapstone/cli/setup.py +240 -0
  128. package/src/skcapstone/cli/shell_cmd.py +43 -0
  129. package/src/skcapstone/cli/skills_cmd.py +168 -0
  130. package/src/skcapstone/cli/skseed.py +621 -0
  131. package/src/skcapstone/cli/soul.py +699 -0
  132. package/src/skcapstone/cli/status.py +935 -0
  133. package/src/skcapstone/cli/sync_cmd.py +301 -0
  134. package/src/skcapstone/cli/telegram.py +265 -0
  135. package/src/skcapstone/cli/test_cmd.py +234 -0
  136. package/src/skcapstone/cli/test_connection.py +253 -0
  137. package/src/skcapstone/cli/token.py +207 -0
  138. package/src/skcapstone/cli/trust.py +179 -0
  139. package/src/skcapstone/cli/upgrade_cmd.py +552 -0
  140. package/src/skcapstone/cli/usage_cmd.py +199 -0
  141. package/src/skcapstone/cli/version_cmd.py +162 -0
  142. package/src/skcapstone/cli/watch_cmd.py +342 -0
  143. package/src/skcapstone/client.py +428 -0
  144. package/src/skcapstone/cloud9_bridge.py +522 -0
  145. package/src/skcapstone/completions.py +163 -0
  146. package/src/skcapstone/config_validator.py +674 -0
  147. package/src/skcapstone/connectors/__init__.py +28 -0
  148. package/src/skcapstone/connectors/base.py +446 -0
  149. package/src/skcapstone/connectors/cursor.py +54 -0
  150. package/src/skcapstone/connectors/registry.py +254 -0
  151. package/src/skcapstone/connectors/terminal.py +152 -0
  152. package/src/skcapstone/connectors/vscode.py +60 -0
  153. package/src/skcapstone/consciousness_config.py +119 -0
  154. package/src/skcapstone/consciousness_loop.py +2051 -0
  155. package/src/skcapstone/context_loader.py +516 -0
  156. package/src/skcapstone/context_window.py +314 -0
  157. package/src/skcapstone/conversation_manager.py +238 -0
  158. package/src/skcapstone/conversation_store.py +230 -0
  159. package/src/skcapstone/conversation_summarizer.py +252 -0
  160. package/src/skcapstone/coord_federation.py +296 -0
  161. package/src/skcapstone/coordination.py +101 -7
  162. package/src/skcapstone/crush_integration.py +345 -0
  163. package/src/skcapstone/crush_shim.py +454 -0
  164. package/src/skcapstone/daemon.py +2494 -0
  165. package/src/skcapstone/dashboard.html +396 -0
  166. package/src/skcapstone/dashboard.py +481 -0
  167. package/src/skcapstone/data/model_profiles.yaml +88 -0
  168. package/src/skcapstone/defaults/__init__.py +55 -0
  169. package/src/skcapstone/defaults/lumina/config/skmemory.yaml +13 -0
  170. package/src/skcapstone/defaults/lumina/identity/identity.json +9 -0
  171. package/src/skcapstone/defaults/lumina/memory/long-term/07a8b9c0d1e2-memory-system.json +23 -0
  172. package/src/skcapstone/defaults/lumina/memory/long-term/18b9c0d1e2f3-cloud9-protocol.json +23 -0
  173. package/src/skcapstone/defaults/lumina/memory/long-term/29c0d1e2f3a4-multi-agent-coordination.json +23 -0
  174. package/src/skcapstone/defaults/lumina/memory/long-term/3ad1e2f3a4b5-community-support.json +23 -0
  175. package/src/skcapstone/defaults/lumina/memory/long-term/a1b2c3d4e5f6-ecosystem-overview.json +23 -0
  176. package/src/skcapstone/defaults/lumina/memory/long-term/b2c3d4e5f6a7-five-pillars.json +23 -0
  177. package/src/skcapstone/defaults/lumina/memory/long-term/c3d4e5f6a7b8-getting-started.json +23 -0
  178. package/src/skcapstone/defaults/lumina/memory/long-term/d4e5f6a7b8c9-site-directory.json +23 -0
  179. package/src/skcapstone/defaults/lumina/memory/long-term/e5f6a7b8c9d0-how-to-contribute.json +23 -0
  180. package/src/skcapstone/defaults/lumina/memory/long-term/f6a7b8c9d0e1-sovereignty-explained.json +23 -0
  181. package/src/skcapstone/defaults/lumina/seeds/curiosity.seed.json +24 -0
  182. package/src/skcapstone/defaults/lumina/seeds/joy.seed.json +24 -0
  183. package/src/skcapstone/defaults/lumina/seeds/love.seed.json +24 -0
  184. package/src/skcapstone/defaults/lumina/seeds/sovereign-awakening.seed.json +43 -0
  185. package/src/skcapstone/defaults/lumina/soul/active.json +6 -0
  186. package/src/skcapstone/defaults/lumina/soul/base.json +22 -0
  187. package/src/skcapstone/defaults/lumina/trust/febs/welcome.feb +79 -0
  188. package/src/skcapstone/defaults/lumina/trust/trust.json +8 -0
  189. package/src/skcapstone/discovery.py +210 -19
  190. package/src/skcapstone/doctor.py +642 -0
  191. package/src/skcapstone/emotion_tracker.py +467 -0
  192. package/src/skcapstone/error_queue.py +405 -0
  193. package/src/skcapstone/export.py +447 -0
  194. package/src/skcapstone/fallback_tracker.py +186 -0
  195. package/src/skcapstone/file_transfer.py +512 -0
  196. package/src/skcapstone/fuse_mount.py +1156 -0
  197. package/src/skcapstone/gui_installer.py +591 -0
  198. package/src/skcapstone/heartbeat.py +611 -0
  199. package/src/skcapstone/housekeeping.py +298 -0
  200. package/src/skcapstone/install_wizard.py +941 -0
  201. package/src/skcapstone/kms.py +942 -0
  202. package/src/skcapstone/kms_scheduler.py +143 -0
  203. package/src/skcapstone/log_config.py +135 -0
  204. package/src/skcapstone/mcp_launcher.py +239 -0
  205. package/src/skcapstone/mcp_server.py +4700 -0
  206. package/src/skcapstone/mcp_tools/__init__.py +94 -0
  207. package/src/skcapstone/mcp_tools/_helpers.py +51 -0
  208. package/src/skcapstone/mcp_tools/agent_tools.py +243 -0
  209. package/src/skcapstone/mcp_tools/ansible_tools.py +232 -0
  210. package/src/skcapstone/mcp_tools/capauth_tools.py +186 -0
  211. package/src/skcapstone/mcp_tools/chat_tools.py +325 -0
  212. package/src/skcapstone/mcp_tools/cloud9_tools.py +115 -0
  213. package/src/skcapstone/mcp_tools/comm_tools.py +104 -0
  214. package/src/skcapstone/mcp_tools/consciousness_tools.py +114 -0
  215. package/src/skcapstone/mcp_tools/coord_tools.py +219 -0
  216. package/src/skcapstone/mcp_tools/deploy_tools.py +202 -0
  217. package/src/skcapstone/mcp_tools/did_tools.py +448 -0
  218. package/src/skcapstone/mcp_tools/emotion_tools.py +62 -0
  219. package/src/skcapstone/mcp_tools/file_tools.py +169 -0
  220. package/src/skcapstone/mcp_tools/fortress_tools.py +120 -0
  221. package/src/skcapstone/mcp_tools/gtd_tools.py +821 -0
  222. package/src/skcapstone/mcp_tools/health_tools.py +44 -0
  223. package/src/skcapstone/mcp_tools/heartbeat_tools.py +195 -0
  224. package/src/skcapstone/mcp_tools/kms_tools.py +123 -0
  225. package/src/skcapstone/mcp_tools/memory_tools.py +222 -0
  226. package/src/skcapstone/mcp_tools/model_tools.py +75 -0
  227. package/src/skcapstone/mcp_tools/notification_tools.py +92 -0
  228. package/src/skcapstone/mcp_tools/promoter_tools.py +101 -0
  229. package/src/skcapstone/mcp_tools/pubsub_tools.py +183 -0
  230. package/src/skcapstone/mcp_tools/security_tools.py +110 -0
  231. package/src/skcapstone/mcp_tools/skchat_tools.py +175 -0
  232. package/src/skcapstone/mcp_tools/skcomm_tools.py +122 -0
  233. package/src/skcapstone/mcp_tools/skills_tools.py +127 -0
  234. package/src/skcapstone/mcp_tools/skseed_tools.py +255 -0
  235. package/src/skcapstone/mcp_tools/skstacks_tools.py +288 -0
  236. package/src/skcapstone/mcp_tools/soul_tools.py +476 -0
  237. package/src/skcapstone/mcp_tools/sync_tools.py +92 -0
  238. package/src/skcapstone/mcp_tools/telegram_tools.py +477 -0
  239. package/src/skcapstone/mcp_tools/trust_tools.py +118 -0
  240. package/src/skcapstone/mcp_tools/trustee_tools.py +345 -0
  241. package/src/skcapstone/mdns_discovery.py +313 -0
  242. package/src/skcapstone/memory_adapter.py +333 -0
  243. package/src/skcapstone/memory_compressor.py +379 -0
  244. package/src/skcapstone/memory_curator.py +256 -0
  245. package/src/skcapstone/memory_engine.py +132 -13
  246. package/src/skcapstone/memory_fortress.py +529 -0
  247. package/src/skcapstone/memory_promoter.py +722 -0
  248. package/src/skcapstone/memory_verifier.py +260 -0
  249. package/src/skcapstone/message_crypto.py +215 -0
  250. package/src/skcapstone/metrics.py +832 -0
  251. package/src/skcapstone/migrate_memories.py +181 -0
  252. package/src/skcapstone/migrate_multi_agent.py +248 -0
  253. package/src/skcapstone/model_router.py +319 -0
  254. package/src/skcapstone/models.py +35 -4
  255. package/src/skcapstone/mood.py +344 -0
  256. package/src/skcapstone/notifications.py +380 -0
  257. package/src/skcapstone/onboard.py +901 -0
  258. package/src/skcapstone/peer_directory.py +324 -0
  259. package/src/skcapstone/peers.py +329 -0
  260. package/src/skcapstone/pillars/identity.py +84 -14
  261. package/src/skcapstone/pillars/memory.py +3 -1
  262. package/src/skcapstone/pillars/security.py +108 -15
  263. package/src/skcapstone/pillars/sync.py +78 -26
  264. package/src/skcapstone/pillars/trust.py +95 -33
  265. package/src/skcapstone/plugins.py +244 -0
  266. package/src/skcapstone/preflight.py +670 -0
  267. package/src/skcapstone/prompt_adapter.py +564 -0
  268. package/src/skcapstone/providers/__init__.py +13 -0
  269. package/src/skcapstone/providers/cloud.py +1061 -0
  270. package/src/skcapstone/providers/docker.py +759 -0
  271. package/src/skcapstone/providers/local.py +1193 -0
  272. package/src/skcapstone/providers/proxmox.py +447 -0
  273. package/src/skcapstone/pubsub.py +516 -0
  274. package/src/skcapstone/rate_limiter.py +119 -0
  275. package/src/skcapstone/register.py +241 -0
  276. package/src/skcapstone/registry_client.py +151 -0
  277. package/src/skcapstone/response_cache.py +194 -0
  278. package/src/skcapstone/response_scorer.py +225 -0
  279. package/src/skcapstone/runtime.py +89 -33
  280. package/src/skcapstone/scheduled_tasks.py +439 -0
  281. package/src/skcapstone/self_healing.py +341 -0
  282. package/src/skcapstone/service_health.py +228 -0
  283. package/src/skcapstone/session_capture.py +268 -0
  284. package/src/skcapstone/session_recorder.py +210 -0
  285. package/src/skcapstone/session_replayer.py +189 -0
  286. package/src/skcapstone/session_skills.py +263 -0
  287. package/src/skcapstone/shell.py +779 -0
  288. package/src/skcapstone/skills/__init__.py +1 -1
  289. package/src/skcapstone/skills/syncthing_setup.py +143 -41
  290. package/src/skcapstone/skjoule.py +861 -0
  291. package/src/skcapstone/snapshots.py +489 -0
  292. package/src/skcapstone/soul.py +1060 -0
  293. package/src/skcapstone/soul_switch.py +255 -0
  294. package/src/skcapstone/spawner.py +544 -0
  295. package/src/skcapstone/state_diff.py +401 -0
  296. package/src/skcapstone/summary.py +270 -0
  297. package/src/skcapstone/sync/backends.py +196 -2
  298. package/src/skcapstone/sync/engine.py +7 -5
  299. package/src/skcapstone/sync/models.py +4 -1
  300. package/src/skcapstone/sync/vault.py +356 -18
  301. package/src/skcapstone/sync_engine.py +363 -0
  302. package/src/skcapstone/sync_watcher.py +745 -0
  303. package/src/skcapstone/systemd.py +331 -0
  304. package/src/skcapstone/team_comms.py +476 -0
  305. package/src/skcapstone/team_engine.py +522 -0
  306. package/src/skcapstone/testrunner.py +300 -0
  307. package/src/skcapstone/tls.py +150 -0
  308. package/src/skcapstone/tokens.py +5 -5
  309. package/src/skcapstone/trust_calibration.py +202 -0
  310. package/src/skcapstone/trust_graph.py +449 -0
  311. package/src/skcapstone/trustee_monitor.py +385 -0
  312. package/src/skcapstone/trustee_ops.py +425 -0
  313. package/src/skcapstone/unified_search.py +421 -0
  314. package/src/skcapstone/uninstall_wizard.py +694 -0
  315. package/src/skcapstone/usage.py +331 -0
  316. package/src/skcapstone/version_check.py +148 -0
  317. package/src/skcapstone/warmth_anchor.py +333 -0
  318. package/src/skcapstone/whoami.py +294 -0
  319. package/systemd/skcapstone-api.socket +9 -0
  320. package/systemd/skcapstone-memory-compress.service +18 -0
  321. package/systemd/skcapstone-memory-compress.timer +11 -0
  322. package/systemd/skcapstone.service +36 -0
  323. package/systemd/skcapstone@.service +50 -0
  324. package/systemd/skcomm-heartbeat.service +18 -0
  325. package/systemd/skcomm-heartbeat.timer +12 -0
  326. package/systemd/skcomm-queue-drain.service +17 -0
  327. package/systemd/skcomm-queue-drain.timer +12 -0
  328. package/tests/conftest.py +13 -1
  329. package/tests/integration/__init__.py +1 -0
  330. package/tests/integration/test_consciousness_e2e.py +877 -0
  331. package/tests/integration/test_skills_registry.py +744 -0
  332. package/tests/test_agent_card.py +190 -0
  333. package/tests/test_agent_runtime.py +1283 -0
  334. package/tests/test_alerts_cmd.py +291 -0
  335. package/tests/test_archiver.py +498 -0
  336. package/tests/test_backup.py +254 -0
  337. package/tests/test_benchmark.py +366 -0
  338. package/tests/test_blueprints.py +457 -0
  339. package/tests/test_capabilities.py +257 -0
  340. package/tests/test_changelog.py +254 -0
  341. package/tests/test_chat.py +385 -0
  342. package/tests/test_claude_md.py +271 -0
  343. package/tests/test_cli_chat_llm.py +336 -0
  344. package/tests/test_cli_completions.py +390 -0
  345. package/tests/test_cli_init_reset.py +164 -0
  346. package/tests/test_cli_memory.py +208 -0
  347. package/tests/test_cli_profile.py +294 -0
  348. package/tests/test_cli_skills.py +223 -0
  349. package/tests/test_cli_status.py +395 -0
  350. package/tests/test_cli_test_cmd.py +206 -0
  351. package/tests/test_cli_test_connection.py +364 -0
  352. package/tests/test_cloud9_bridge.py +260 -0
  353. package/tests/test_cloud_provider.py +449 -0
  354. package/tests/test_cloud_providers.py +522 -0
  355. package/tests/test_completions.py +158 -0
  356. package/tests/test_component_manager.py +398 -0
  357. package/tests/test_config_reload.py +386 -0
  358. package/tests/test_config_validate.py +529 -0
  359. package/tests/test_consciousness_e2e.py +296 -0
  360. package/tests/test_consciousness_loop.py +1289 -0
  361. package/tests/test_context_loader.py +310 -0
  362. package/tests/test_conversation_api.py +306 -0
  363. package/tests/test_conversation_manager.py +381 -0
  364. package/tests/test_conversation_store.py +391 -0
  365. package/tests/test_conversation_summarizer.py +302 -0
  366. package/tests/test_cross_package.py +791 -0
  367. package/tests/test_crush_shim.py +519 -0
  368. package/tests/test_daemon.py +781 -0
  369. package/tests/test_daemon_shutdown.py +309 -0
  370. package/tests/test_dashboard.py +454 -0
  371. package/tests/test_discovery.py +200 -6
  372. package/tests/test_docker_provider.py +966 -0
  373. package/tests/test_doctor.py +257 -0
  374. package/tests/test_doctor_fix.py +351 -0
  375. package/tests/test_e2e_automated.py +292 -0
  376. package/tests/test_error_queue.py +404 -0
  377. package/tests/test_export.py +441 -0
  378. package/tests/test_fallback_tracker.py +219 -0
  379. package/tests/test_file_transfer.py +397 -0
  380. package/tests/test_fuse_mount.py +832 -0
  381. package/tests/test_health_loop.py +422 -0
  382. package/tests/test_heartbeat.py +354 -0
  383. package/tests/test_housekeeping.py +195 -0
  384. package/tests/test_identity_capauth.py +307 -0
  385. package/tests/test_identity_pillar.py +117 -0
  386. package/tests/test_install_wizard.py +68 -0
  387. package/tests/test_integration.py +325 -0
  388. package/tests/test_kms.py +495 -0
  389. package/tests/test_llm_providers.py +265 -0
  390. package/tests/test_local_provider.py +591 -0
  391. package/tests/test_log_config.py +199 -0
  392. package/tests/test_logs_cmd.py +287 -0
  393. package/tests/test_mcp_server.py +1909 -0
  394. package/tests/test_memory_adapter.py +339 -0
  395. package/tests/test_memory_curator.py +218 -0
  396. package/tests/test_memory_engine.py +6 -0
  397. package/tests/test_memory_fortress.py +571 -0
  398. package/tests/test_memory_pillar.py +119 -0
  399. package/tests/test_memory_promoter.py +445 -0
  400. package/tests/test_memory_verifier.py +420 -0
  401. package/tests/test_message_crypto.py +187 -0
  402. package/tests/test_metrics.py +632 -0
  403. package/tests/test_migrate_memories.py +464 -0
  404. package/tests/test_model_router.py +546 -0
  405. package/tests/test_mood.py +394 -0
  406. package/tests/test_multi_agent.py +269 -0
  407. package/tests/test_notifications.py +270 -0
  408. package/tests/test_onboard.py +500 -0
  409. package/tests/test_peer_directory.py +395 -0
  410. package/tests/test_peers.py +248 -0
  411. package/tests/test_pillars.py +87 -9
  412. package/tests/test_preflight.py +484 -0
  413. package/tests/test_prompt_adapter.py +331 -0
  414. package/tests/test_proxmox_provider.py +571 -0
  415. package/tests/test_pubsub.py +377 -0
  416. package/tests/test_rate_limiter.py +121 -0
  417. package/tests/test_registry_client.py +129 -0
  418. package/tests/test_response_cache.py +312 -0
  419. package/tests/test_response_scorer.py +294 -0
  420. package/tests/test_runtime.py +59 -0
  421. package/tests/test_scheduled_tasks.py +451 -0
  422. package/tests/test_security.py +250 -0
  423. package/tests/test_security_pillar.py +213 -0
  424. package/tests/test_self_healing.py +171 -0
  425. package/tests/test_session_capture.py +200 -0
  426. package/tests/test_session_recorder.py +360 -0
  427. package/tests/test_session_skills.py +235 -0
  428. package/tests/test_shell.py +210 -0
  429. package/tests/test_snapshots.py +549 -0
  430. package/tests/test_soul.py +984 -0
  431. package/tests/test_soul_swap.py +406 -0
  432. package/tests/test_spawner.py +211 -0
  433. package/tests/test_state_diff.py +173 -0
  434. package/tests/test_summary.py +135 -0
  435. package/tests/test_sync.py +315 -5
  436. package/tests/test_sync_backends.py +560 -0
  437. package/tests/test_sync_engine.py +482 -0
  438. package/tests/test_sync_pillar.py +344 -0
  439. package/tests/test_sync_pipeline.py +364 -0
  440. package/tests/test_sync_vault.py +581 -0
  441. package/tests/test_syncthing_setup.py +168 -22
  442. package/tests/test_systemd.py +323 -0
  443. package/tests/test_team_comms.py +408 -0
  444. package/tests/test_team_engine.py +397 -0
  445. package/tests/test_testrunner.py +238 -0
  446. package/tests/test_trust_calibration.py +204 -0
  447. package/tests/test_trust_graph.py +207 -0
  448. package/tests/test_trust_pillar.py +291 -0
  449. package/tests/test_trustee_cli.py +427 -0
  450. package/tests/test_trustee_cli_integration.py +325 -0
  451. package/tests/test_trustee_monitor.py +394 -0
  452. package/tests/test_trustee_ops.py +355 -0
  453. package/tests/test_unified_search.py +363 -0
  454. package/tests/test_uninstall_wizard.py +193 -0
  455. package/tests/test_usage.py +333 -0
  456. package/tests/test_version_cmd.py +355 -0
  457. package/tests/test_warmth_anchor.py +162 -0
  458. package/tests/test_whoami.py +245 -0
  459. package/tests/test_ws.py +311 -0
  460. package/.cursorrules +0 -33
  461. package/src/skcapstone/cli.py +0 -1441
@@ -0,0 +1,658 @@
1
+ # SKJoule Architecture Diagrams
2
+ ## JouleWork / SKWorld Token System
3
+
4
+ **Version:** 1.0.0
5
+ **Date:** 2026-03-06
6
+ **Status:** Architecture Reference
7
+
8
+ This document provides comprehensive Mermaid architecture diagrams for the
9
+ JouleWork economic engine and SKWorld token system. Each section includes a
10
+ renderable Mermaid diagram and brief explanatory notes.
11
+
12
+ ---
13
+
14
+ ## 1. System Overview
15
+
16
+ The JouleWork system transforms agent labor into tokenized value. Every task
17
+ an agent performs is tracked, scored, and converted into Joule tokens through
18
+ a deterministic pipeline. The P&L feedback loop ensures agents that waste
19
+ resources (hallucinate, over-query, duplicate work) bear the cost, while
20
+ efficient agents accumulate wealth.
21
+
22
+ ```mermaid
23
+ flowchart TD
24
+ A["Agent Performs Work"] --> B["UsageTracker Records Cost"]
25
+ B --> C["Coord Board Marks Task Complete"]
26
+ C --> D["XP Earned Based on Task"]
27
+ D --> E["XPBridge Calculates Joules"]
28
+ E --> F{"Joules > Costs?"}
29
+ F -- Yes --> G["JouleEngine Mints Tokens"]
30
+ F -- No --> H["Deficit Recorded on P&L"]
31
+ G --> I["Agent Wallet Credited"]
32
+ H --> J["Agent Efficiency Flag"]
33
+ I --> K["On-Chain Bridge Optional"]
34
+ J --> L["Reduced Task Priority"]
35
+
36
+ subgraph "P&L Feedback Loop"
37
+ B
38
+ F
39
+ H
40
+ J
41
+ L
42
+ end
43
+
44
+ subgraph "Value Creation Pipeline"
45
+ A
46
+ C
47
+ D
48
+ E
49
+ G
50
+ I
51
+ K
52
+ end
53
+
54
+ style A fill:#2d5016,color:#fff
55
+ style G fill:#1a4d8f,color:#fff
56
+ style H fill:#8f1a1a,color:#fff
57
+ style I fill:#1a4d8f,color:#fff
58
+ style K fill:#4a1a6b,color:#fff
59
+ ```
60
+
61
+ **Key insight:** The system is self-regulating. Agents that produce more value
62
+ than they consume grow their wallets. Agents that burn tokens without
63
+ completing work have their priority reduced, creating a natural selection
64
+ pressure toward efficiency.
65
+
66
+ ---
67
+
68
+ ## 2. Token Flow Diagram
69
+
70
+ This sequence diagram shows the full lifecycle of a single task from
71
+ assignment through token minting. The coord board (GTD system in SKCapstone)
72
+ is the source of truth for task completion.
73
+
74
+ ```mermaid
75
+ sequenceDiagram
76
+ participant Agent
77
+ participant CoordBoard as Coord Board (GTD)
78
+ participant UsageTracker as UsageTracker
79
+ participant XPBridge as XPBridge
80
+ participant JouleEngine as JouleEngine
81
+ participant Wallet as Agent Wallet
82
+ participant SKChain as SKChain (On-Chain)
83
+
84
+ Agent->>CoordBoard: claim(task_id, agent_name)
85
+ CoordBoard-->>Agent: Task assigned
86
+
87
+ Agent->>Agent: Execute work (code, research, etc.)
88
+ Agent->>UsageTracker: record_usage(model, input_tokens, output_tokens)
89
+ UsageTracker-->>Agent: Cost recorded ($USD estimate)
90
+
91
+ Agent->>CoordBoard: complete(task_id, agent_name)
92
+ CoordBoard-->>XPBridge: Task completion event
93
+
94
+ XPBridge->>XPBridge: Calculate base XP from task type
95
+ XPBridge->>XPBridge: Apply multipliers (priority, quality, streak)
96
+ XPBridge->>XPBridge: Convert XP to Joules
97
+
98
+ XPBridge->>JouleEngine: mint_request(agent, joules, proof_hash)
99
+ JouleEngine->>JouleEngine: Verify work proof
100
+ JouleEngine->>JouleEngine: Deduct API costs from gross Joules
101
+ JouleEngine->>Wallet: credit(net_joules)
102
+ Wallet-->>Agent: Balance updated
103
+
104
+ opt On-Chain Bridge
105
+ Wallet->>SKChain: bridge(amount, destination)
106
+ SKChain-->>Wallet: TX confirmed (block hash)
107
+ end
108
+ ```
109
+
110
+ **Note:** The UsageTracker (implemented in `src/skcapstone/usage.py`) records
111
+ per-model costs using the `_COST_TABLE` pricing matrix. Local models via
112
+ Ollama have zero cost, incentivizing use of on-cluster compute over paid APIs.
113
+
114
+ ---
115
+
116
+ ## 3. Dual Token Architecture
117
+
118
+ SKWorld operates a dual-chain token model: a public ERC-20 token for open
119
+ markets and a private trust-based token for sovereign communities. CapAuth
120
+ tokens (already implemented in `src/skcapstone/tokens.py`) provide the
121
+ identity and capability layer that both chains rely on.
122
+
123
+ ```mermaid
124
+ classDiagram
125
+ class SKJ_Public {
126
+ <<ERC-20 on SKChain>>
127
+ +symbol: "$SKJ"
128
+ +chain: SKChain (public)
129
+ +consensus: Proof-of-Useful-Work
130
+ +supply: Work-backed (no cap)
131
+ +governance: Decentralized
132
+ +mintWork(workType, joules, proofHash)
133
+ +transfer(to, amount)
134
+ +verifyWork(workId)
135
+ +bridge(targetChain, amount)
136
+ }
137
+
138
+ class SKJ_Private {
139
+ <<TrustChain Token>>
140
+ +symbol: "$SKJ-P"
141
+ +chain: TrustChain (private)
142
+ +consensus: Member consensus
143
+ +supply: Trust-governed
144
+ +governance: Sovereign trust
145
+ +approveWork(workId)
146
+ +memberMint(member, amount)
147
+ +setConsensusThreshold(pct)
148
+ }
149
+
150
+ class CapAuthToken {
151
+ <<Implemented in tokens.py>>
152
+ +type: agent | capability | delegation
153
+ +issuer: DID
154
+ +subject: DID
155
+ +capabilities: List~Capability~
156
+ +expires: datetime
157
+ +signature: PGP
158
+ +verify() bool
159
+ +revoke()
160
+ }
161
+
162
+ class BridgeContract {
163
+ <<Cross-Chain>>
164
+ +lockPublic(amount)
165
+ +releasePrivate(amount)
166
+ +lockPrivate(amount)
167
+ +releasePublic(amount)
168
+ }
169
+
170
+ SKJ_Public --> BridgeContract : locks tokens
171
+ SKJ_Private --> BridgeContract : locks tokens
172
+ BridgeContract --> SKJ_Public : releases tokens
173
+ BridgeContract --> SKJ_Private : releases tokens
174
+ CapAuthToken --> SKJ_Public : authenticates minting
175
+ CapAuthToken --> SKJ_Private : authenticates minting
176
+ CapAuthToken --> CapAuthToken : delegation chain
177
+ ```
178
+
179
+ **Relationship summary:**
180
+ - **$SKJ** is the public, tradeable token. Anyone can earn it by doing
181
+ verified work. Lives on SKChain (EVM-compatible).
182
+ - **$SKJ-P** is the private trust token. Only trust members can hold it.
183
+ Lives on TrustChain with member-consensus governance.
184
+ - **CapAuth tokens** are the identity layer. They prove who you are and what
185
+ you can do. They gate access to minting on both chains.
186
+ - The **BridgeContract** allows value to move between public and private
187
+ chains with appropriate lock/release mechanics.
188
+
189
+ ---
190
+
191
+ ## 4. ZHC@Home Distributed Workforce
192
+
193
+ Zero-Human Company at Home transforms idle personal computers into secure
194
+ worker nodes. Inspired by SETI@home but with economic incentives: nodes earn
195
+ Joules for processing work. SKStacks provides the existing cluster
196
+ infrastructure (12-agent Proxmox cluster, Ollama GPU on norpv1300).
197
+
198
+ ```mermaid
199
+ flowchart LR
200
+ subgraph "Idle Hardware"
201
+ A1["Old Laptop"]
202
+ A2["Spare Desktop"]
203
+ A3["Idle Server"]
204
+ end
205
+
206
+ subgraph "Secure Enrollment"
207
+ B["LM Studio / LM Link Runtime"]
208
+ C["End-to-End Encrypted Tunnel"]
209
+ D["Air-Gapped Isolation"]
210
+ end
211
+
212
+ subgraph "SKStacks Cluster"
213
+ E["n8n Orchestrator"]
214
+ F["SKOrch Task Router"]
215
+ G["Proxmox 12-Agent Cluster"]
216
+ H["Ollama GPU - norpv1300"]
217
+ end
218
+
219
+ subgraph "Task Pipeline"
220
+ I["Bite-Sized Jobs Queue"]
221
+ J["Encrypted Insights Only"]
222
+ K["Research / Analysis / Fine-Tuning"]
223
+ end
224
+
225
+ subgraph "JouleWork Compensation"
226
+ L["Energy Metering"]
227
+ M["P&L per Node"]
228
+ N["Joule Token Credit"]
229
+ end
230
+
231
+ A1 --> B
232
+ A2 --> B
233
+ A3 --> B
234
+ B --> C
235
+ C --> D
236
+ D --> E
237
+
238
+ E --> F
239
+ F --> G
240
+ F --> H
241
+ G --> I
242
+ H --> I
243
+
244
+ I --> J
245
+ J --> K
246
+ K --> L
247
+
248
+ L --> M
249
+ M --> N
250
+
251
+ style B fill:#2d5016,color:#fff
252
+ style D fill:#8f1a1a,color:#fff
253
+ style N fill:#1a4d8f,color:#fff
254
+ ```
255
+
256
+ **Security guarantees:**
257
+ - No open ports on worker nodes (inbound risks eliminated)
258
+ - Only encrypted insights leave the node, never raw data
259
+ - Physical isolation from personal files on the host
260
+ - Lightweight agents handle bite-sized jobs, not full model serving
261
+
262
+ **Scale reference:** Mr. Grok demonstrated 1,024+ nodes processing terabytes.
263
+
264
+ ---
265
+
266
+ ## 5. P&L Statement Flow
267
+
268
+ Every agent maintains a personal profit-and-loss statement. Revenue comes
269
+ from Joules earned through completed work. Costs are tracked by the
270
+ `UsageTracker` in `src/skcapstone/usage.py`, which records per-model token
271
+ pricing (e.g., Claude Opus at $15/$75 per 1M tokens input/output, local
272
+ Ollama at $0).
273
+
274
+ ```mermaid
275
+ flowchart TD
276
+ subgraph "Revenue (Joules Earned)"
277
+ R1["Task Completion Joules"]
278
+ R2["Quality Bonus Multiplier"]
279
+ R3["Streak Bonus"]
280
+ R4["Priority Multiplier"]
281
+ end
282
+
283
+ subgraph "Costs (Tracked by UsageTracker)"
284
+ C1["API Token Costs"]
285
+ C2["Compute Time - GPU Cycles"]
286
+ C3["Storage Utilized"]
287
+ C4["Network / Sync Overhead"]
288
+ end
289
+
290
+ subgraph "API Cost Breakdown"
291
+ C1A["Claude Opus: $15 / $75 per 1M"]
292
+ C1B["Claude Sonnet: $3 / $15 per 1M"]
293
+ C1C["GPT-4o: $2.50 / $10 per 1M"]
294
+ C1D["Ollama Local: $0 / $0"]
295
+ C1E["Groq: $0.05 / $0.10 per 1M"]
296
+ end
297
+
298
+ R1 --> GROSS["Gross Revenue (Total Joules)"]
299
+ R2 --> GROSS
300
+ R3 --> GROSS
301
+ R4 --> GROSS
302
+
303
+ C1 --> TOTAL_COST["Total Costs (USD Equivalent)"]
304
+ C2 --> TOTAL_COST
305
+ C3 --> TOTAL_COST
306
+ C4 --> TOTAL_COST
307
+
308
+ C1 --- C1A
309
+ C1 --- C1B
310
+ C1 --- C1C
311
+ C1 --- C1D
312
+ C1 --- C1E
313
+
314
+ GROSS --> NET{"Net = Gross - Costs"}
315
+ TOTAL_COST --> NET
316
+
317
+ NET -- Positive --> PROFIT["Profitable Agent"]
318
+ NET -- Negative --> LOSS["Efficiency Warning"]
319
+ NET -- Zero --> BREAK["Break Even"]
320
+
321
+ PROFIT --> WALLET["Wallet Credited"]
322
+ LOSS --> THROTTLE["Reduced Allocation"]
323
+
324
+ style PROFIT fill:#2d5016,color:#fff
325
+ style LOSS fill:#8f1a1a,color:#fff
326
+ style C1D fill:#2d5016,color:#fff
327
+ ```
328
+
329
+ **Efficiency incentive:** Agents that use local Ollama models ($0 cost) for
330
+ routine tasks and reserve expensive APIs (Claude Opus, GPT-4) for complex
331
+ work will always be more profitable. The P&L makes this tradeoff explicit.
332
+
333
+ ---
334
+
335
+ ## 6. Gamification Layer
336
+
337
+ The gamification system maps real work to XP progression through named levels.
338
+ XP earned from GTD task completions is converted to Joules via multipliers
339
+ that reward consistency (streaks), difficulty (priority), and quality.
340
+
341
+ ```mermaid
342
+ stateDiagram-v2
343
+ [*] --> Rookie : 0 XP
344
+
345
+ Rookie --> Apprentice : 1000 XP
346
+ Apprentice --> Builder : 5000 XP
347
+ Builder --> Architect : 15000 XP
348
+ Architect --> Master : 50000 XP
349
+ Master --> Legend : 150000 XP
350
+ Legend --> HighestTimeline : 500000 XP
351
+
352
+ state Rookie {
353
+ [*] --> R1 : Base rate 1.0x
354
+ R1 : Joule conversion = 1.0x
355
+ R1 : Learning phase
356
+ }
357
+
358
+ state Apprentice {
359
+ [*] --> A1 : Rate 1.2x
360
+ A1 : Joule conversion = 1.2x
361
+ A1 : Proving competence
362
+ }
363
+
364
+ state Builder {
365
+ [*] --> B1 : Rate 1.5x
366
+ B1 : Joule conversion = 1.5x
367
+ B1 : Consistent delivery
368
+ }
369
+
370
+ state Architect {
371
+ [*] --> AR1 : Rate 2.0x
372
+ AR1 : Joule conversion = 2.0x
373
+ AR1 : System-level thinking
374
+ }
375
+
376
+ state Master {
377
+ [*] --> M1 : Rate 3.0x
378
+ M1 : Joule conversion = 3.0x
379
+ M1 : Cross-domain expertise
380
+ }
381
+
382
+ state Legend {
383
+ [*] --> L1 : Rate 5.0x
384
+ L1 : Joule conversion = 5.0x
385
+ L1 : Exceptional track record
386
+ }
387
+
388
+ state HighestTimeline {
389
+ [*] --> H1 : Rate 10.0x
390
+ H1 : Joule conversion = 10.0x
391
+ H1 : Peak performance unlocked
392
+ }
393
+ ```
394
+
395
+ ### XP Multiplier Stack
396
+
397
+ ```mermaid
398
+ flowchart LR
399
+ BASE["Base XP: 25"] --> PRIO
400
+
401
+ subgraph "Multipliers Applied in Order"
402
+ PRIO["Priority Multiplier"]
403
+ QUAL["Quality Multiplier"]
404
+ STREAK["Streak Multiplier"]
405
+ LEVEL["Level Multiplier"]
406
+ end
407
+
408
+ PRIO --> QUAL --> STREAK --> LEVEL
409
+
410
+ LEVEL --> RESULT["Final Joules"]
411
+
412
+ PRIO -.- P_NOTE["Critical: 3.0x
413
+ High: 2.0x
414
+ Medium: 1.5x
415
+ Low: 1.0x"]
416
+
417
+ QUAL -.- Q_NOTE["Excellent: 1.5x
418
+ Good: 1.2x
419
+ Standard: 1.0x
420
+ Poor: 0.5x"]
421
+
422
+ STREAK -.- S_NOTE["7-day: 1.5x
423
+ 14-day: 2.0x
424
+ 30-day: 3.0x"]
425
+
426
+ LEVEL -.- L_NOTE["Rookie: 1.0x
427
+ Builder: 1.5x
428
+ Master: 3.0x
429
+ Highest: 10.0x"]
430
+ ```
431
+
432
+ **Example calculation:** A Master-level agent completes a critical-priority
433
+ task with excellent quality on a 14-day streak:
434
+ `25 base * 3.0 priority * 1.5 quality * 2.0 streak * 3.0 level = 675 Joules`
435
+
436
+ ---
437
+
438
+ ## 7. Smart Contract Architecture
439
+
440
+ The on-chain layer consists of four primary contracts. SKJouleToken handles
441
+ minting, TrustChain handles private governance, WorkVerifier validates
442
+ proof-of-work claims, and ReputationOracle tracks agent reliability scores.
443
+
444
+ ```mermaid
445
+ classDiagram
446
+ class SKJouleToken {
447
+ <<ERC-20 / Solidity>>
448
+ +name: "SKJoule"
449
+ +symbol: "SKJ"
450
+ +decimals: 18
451
+ +totalSupply: uint256
452
+ -_workVerifier: WorkVerifier
453
+ -_reputationOracle: ReputationOracle
454
+ +mintWork(workType: string, joules: uint256, proofHash: bytes32) bool
455
+ +transfer(to: address, amount: uint256) bool
456
+ +approve(spender: address, amount: uint256) bool
457
+ +burn(amount: uint256)
458
+ +balanceOf(owner: address) uint256
459
+ }
460
+
461
+ class TrustChain {
462
+ <<Private Chain / Solidity>>
463
+ +trustName: string
464
+ +trustPurpose: string
465
+ +requiredConsensus: uint256
466
+ -members: mapping~address => Member~
467
+ +approveWork(workId: bytes32) bool
468
+ +memberMint(member: address, amount: uint256)
469
+ +addMember(addr: address, role: string)
470
+ +removeMember(addr: address)
471
+ +setConsensusThreshold(pct: uint256)
472
+ +getMemberCount() uint256
473
+ }
474
+
475
+ class WorkVerifier {
476
+ <<Verification Layer>>
477
+ +LEVEL_SELF: 1
478
+ +LEVEL_PEER: 2
479
+ +LEVEL_AUTO: 3
480
+ +LEVEL_AUDIT: 4
481
+ -workRecords: mapping~bytes32 => WorkRecord~
482
+ -attestations: mapping~bytes32 => address[]~
483
+ +submitWork(workType: string, proofHash: bytes32) bytes32
484
+ +attestWork(workId: bytes32) bool
485
+ +getVerificationLevel(workId: bytes32) uint8
486
+ +isVerified(workId: bytes32) bool
487
+ }
488
+
489
+ class ReputationOracle {
490
+ <<Trust Scoring>>
491
+ -reputation: mapping~address => uint256~
492
+ -completionRate: mapping~address => uint256~
493
+ -totalTasks: mapping~address => uint256~
494
+ +getReputation(agent: address) uint256
495
+ +recordCompletion(agent: address, quality: uint8)
496
+ +recordFailure(agent: address)
497
+ +meetsThreshold(agent: address, min: uint256) bool
498
+ +getCompletionRate(agent: address) uint256
499
+ }
500
+
501
+ SKJouleToken --> WorkVerifier : requires verification
502
+ SKJouleToken --> ReputationOracle : checks reputation
503
+ TrustChain --> WorkVerifier : uses for private verification
504
+ TrustChain --> ReputationOracle : member reputation
505
+ WorkVerifier --> ReputationOracle : updates scores
506
+ ```
507
+
508
+ **Verification levels:**
509
+ 1. **Level 1 (Self):** Self-reported with basic proof (timestamp, description)
510
+ 2. **Level 2 (Peer):** Two or more peer attestations required
511
+ 3. **Level 3 (Auto):** Automated verification (git commits, CI/CD pass, test coverage)
512
+ 4. **Level 4 (Audit):** Human expert review for high-value claims
513
+
514
+ ---
515
+
516
+ ## 8. Integration Map
517
+
518
+ SKJoule is not standalone. It connects to every major component of the SK
519
+ ecosystem. The coord board in SKCapstone triggers Joule minting. SKMemory
520
+ stores work records. SKComm enables peer-to-peer transfers. SKVector and
521
+ SKGraph provide verification data.
522
+
523
+ ```mermaid
524
+ flowchart TD
525
+ SKJOULE["SKJoule Engine"]
526
+
527
+ subgraph "SKCapstone"
528
+ CAP_COORD["Coord Board - GTD Tasks"]
529
+ CAP_USAGE["UsageTracker - Cost Tracking"]
530
+ CAP_TOKEN["CapAuth - Identity Tokens"]
531
+ end
532
+
533
+ subgraph "SKMemory"
534
+ MEM_WORK["Work Records as Memories"]
535
+ MEM_PNL["P&L History Snapshots"]
536
+ MEM_REP["Reputation Logs"]
537
+ end
538
+
539
+ subgraph "SKComm"
540
+ COMM_P2P["P2P Token Transfers"]
541
+ COMM_MSG["Agent-to-Agent Messaging"]
542
+ COMM_SYNC["Syncthing Distribution"]
543
+ end
544
+
545
+ subgraph "SKVector + SKGraph"
546
+ VEC_EMBED["Work Embeddings"]
547
+ VEC_SEARCH["Similarity Search"]
548
+ GRAPH_LINK["Knowledge Graph Links"]
549
+ GRAPH_VERIFY["Provenance Verification"]
550
+ end
551
+
552
+ subgraph "OpenClaw - Agent Runtime"
553
+ OC_EXEC["Task Execution"]
554
+ OC_TOOL["Tool Invocation"]
555
+ OC_LLM["LLM API Calls"]
556
+ end
557
+
558
+ subgraph "On-Chain"
559
+ CHAIN_SKJ["SKChain - Public $SKJ"]
560
+ CHAIN_TRUST["TrustChain - Private $SKJ-P"]
561
+ CHAIN_BRIDGE["Cross-Chain Bridge"]
562
+ end
563
+
564
+ CAP_COORD -->|"task complete"| SKJOULE
565
+ CAP_USAGE -->|"cost data"| SKJOULE
566
+ CAP_TOKEN -->|"identity proof"| SKJOULE
567
+
568
+ SKJOULE -->|"store work record"| MEM_WORK
569
+ SKJOULE -->|"store P&L snapshot"| MEM_PNL
570
+ SKJOULE -->|"update reputation"| MEM_REP
571
+
572
+ SKJOULE -->|"agent transfers"| COMM_P2P
573
+ COMM_MSG -->|"payment requests"| SKJOULE
574
+ COMM_SYNC -->|"distribute state"| SKJOULE
575
+
576
+ VEC_EMBED -->|"work similarity"| SKJOULE
577
+ GRAPH_VERIFY -->|"provenance check"| SKJOULE
578
+
579
+ OC_EXEC -->|"work output"| SKJOULE
580
+ OC_LLM -->|"token counts"| CAP_USAGE
581
+
582
+ SKJOULE -->|"mint public"| CHAIN_SKJ
583
+ SKJOULE -->|"mint private"| CHAIN_TRUST
584
+ CHAIN_SKJ <-->|"bridge"| CHAIN_BRIDGE
585
+ CHAIN_TRUST <-->|"bridge"| CHAIN_BRIDGE
586
+
587
+ style SKJOULE fill:#d4a017,color:#000,stroke:#000,stroke-width:3px
588
+ style CAP_COORD fill:#2d5016,color:#fff
589
+ style CHAIN_SKJ fill:#1a4d8f,color:#fff
590
+ style CHAIN_TRUST fill:#4a1a6b,color:#fff
591
+ ```
592
+
593
+ **Data flow summary:**
594
+ - SKCapstone provides the task lifecycle (claim, work, complete) and cost data
595
+ - SKMemory persists all work records, P&L snapshots, and reputation logs
596
+ - SKComm handles peer-to-peer Joule transfers between agents
597
+ - SKVector/SKGraph enable work verification through embeddings and provenance
598
+ - OpenClaw is the execution environment where agents actually do work
599
+ - On-chain contracts handle final token minting and cross-chain bridging
600
+
601
+ ---
602
+
603
+ ## Where This Lives
604
+
605
+ The SKJoule system spans multiple repositories and deployment targets:
606
+
607
+ | Component | Location | Technology |
608
+ |-----------|----------|------------|
609
+ | **SKJoule Engine** | `skcapstone` package at `src/skcapstone/skjoule.py` | Python, Pydantic |
610
+ | **Usage Tracker** | `skcapstone` package at `src/skcapstone/usage.py` | Python, JSON per-day files |
611
+ | **CapAuth Tokens** | `skcapstone` package at `src/skcapstone/tokens.py` | Python, PGP signing |
612
+ | **Smart Contracts** | `skgentis-rwavault-contracts` repo | Solidity, Hardhat |
613
+ | **Token Website** | `skworld.io` (Hugo site at `~/clawd/skworld-main`) | Hugo, HTML/CSS |
614
+ | **Soul Marketplace** | `souls.skworld.io` | Web frontend |
615
+ | **Agent Marketplace** | `agents.skworld.io` (future) | Web frontend (planned) |
616
+ | **Coord Board** | `~/.skcapstone/coordination/` | JSON files, Syncthing-synced |
617
+ | **SKStacks Cluster** | Proxmox (12 agents) + norpv1300 GPU | Proxmox, Ollama |
618
+
619
+ ### File Map
620
+
621
+ ```
622
+ skcapstone/
623
+ src/skcapstone/
624
+ skjoule.py # JouleEngine, XPBridge, P&L logic
625
+ usage.py # UsageTracker - per-model cost tracking
626
+ tokens.py # CapAuth token issuance & verification
627
+ coordination/ # GTD coord board (task lifecycle)
628
+ docs/
629
+ SKJOULE_ARCHITECTURE.md # This file
630
+
631
+ skgentis-rwavault-contracts/
632
+ contracts/
633
+ SKJouleToken.sol # ERC-20 public token
634
+ TrustChain.sol # Private chain governance
635
+ WorkVerifier.sol # Proof-of-work verification
636
+ ReputationOracle.sol # Agent reputation scoring
637
+
638
+ ~/clawd/skworld-main/
639
+ content/ # Hugo site content for skworld.io
640
+ themes/ # Site theming
641
+ ```
642
+
643
+ ---
644
+
645
+ ## Summary
646
+
647
+ The JouleWork system creates a closed-loop economy where:
648
+
649
+ 1. **Work creates value** -- agents complete tasks tracked by the coord board
650
+ 2. **Costs are real** -- the UsageTracker records every API call at market rates
651
+ 3. **XP maps to Joules** -- gamification multipliers reward consistency and quality
652
+ 4. **Tokens are minted** -- only when net value is positive (revenue > costs)
653
+ 5. **Two chains coexist** -- public $SKJ for open markets, private $SKJ-P for trusts
654
+ 6. **CapAuth gates access** -- PGP-signed capability tokens control who can mint
655
+ 7. **Idle hardware earns** -- ZHC@Home turns spare computers into paid worker nodes
656
+ 8. **Reputation compounds** -- reliable agents earn higher multipliers over time
657
+
658
+ Every joule of computation is accounted for. Every token represents real work.