@bolloon/bolloon-agent 0.1.35 → 0.1.37

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 (502) hide show
  1. package/README.md +1 -1
  2. package/dist/agents/p2p-chat-tools.js +6 -6
  3. package/dist/agents/permission-mode.js +115 -0
  4. package/dist/agents/pi-sdk.js +435 -25
  5. package/dist/agents/pre-tool-validator.js +194 -0
  6. package/dist/agents/workflow-pivot-loop.js +113 -12
  7. package/dist/bollharness-integration/context-router.js +2 -2
  8. package/dist/bollharness-integration/guard-checker.js +1 -1
  9. package/dist/bootstrap/bootstrap.js +3 -0
  10. package/dist/bootstrap/context-collector.js +17 -1
  11. package/dist/bootstrap/context-hierarchy.js +218 -0
  12. package/dist/bootstrap/lifecycle-hooks.js +86 -24
  13. package/dist/bootstrap/project-context.js +10 -3
  14. package/dist/context-compaction/auto-compact.js +144 -0
  15. package/dist/context-compaction/budget-gate.js +28 -0
  16. package/dist/context-compaction/budget-reduce.js +35 -0
  17. package/dist/context-compaction/context-collapse.js +66 -0
  18. package/dist/context-compaction/index.js +21 -0
  19. package/dist/context-compaction/microcompact.js +51 -0
  20. package/dist/context-compaction/pipeline.js +123 -0
  21. package/dist/context-compaction/snip.js +45 -0
  22. package/dist/context-compaction/token-estimator.js +35 -0
  23. package/dist/context-compaction/types.js +19 -0
  24. package/dist/heartbeat/HealthMonitor.js +3 -2
  25. package/dist/index.js +38 -2
  26. package/dist/llm/llm-judgment-client.js +32 -30
  27. package/dist/llm/pi-ai.js +103 -16
  28. package/dist/llm/system-prompt/health.js +129 -0
  29. package/dist/llm/system-prompt/registry.js +246 -0
  30. package/dist/llm/system-prompt/strip-hibsml.js +51 -0
  31. package/dist/llm/tool-manifest/ask_user_input.js +35 -0
  32. package/dist/llm/tool-manifest/bash.js +23 -0
  33. package/dist/llm/tool-manifest/create_file.js +24 -0
  34. package/dist/llm/tool-manifest/fetch_sports_data.js +26 -0
  35. package/dist/llm/tool-manifest/image_search.js +24 -0
  36. package/dist/llm/tool-manifest/index.js +69 -0
  37. package/dist/llm/tool-manifest/mcp.js +43 -0
  38. package/dist/llm/tool-manifest/message_compose.js +31 -0
  39. package/dist/llm/tool-manifest/places.js +83 -0
  40. package/dist/llm/tool-manifest/present_files.js +21 -0
  41. package/dist/llm/tool-manifest/recipe.js +40 -0
  42. package/dist/llm/tool-manifest/recommend_apps.js +23 -0
  43. package/dist/llm/tool-manifest/str_replace.js +27 -0
  44. package/dist/llm/tool-manifest/types.js +7 -0
  45. package/dist/llm/tool-manifest/view.js +24 -0
  46. package/dist/llm/tool-manifest/weather.js +27 -0
  47. package/dist/llm/tool-manifest/web.js +51 -0
  48. package/dist/network/p2p-direct.js +23 -0
  49. package/dist/network/source-intent-broadcaster.js +203 -0
  50. package/dist/network/source-intent.js +100 -0
  51. package/dist/pi-ecosystem-judgment/adaptive-scan.js +48 -0
  52. package/dist/pi-ecosystem-judgment/injection-gate.js +54 -12
  53. package/dist/pi-ecosystem-judgment/value-injection.js +8 -2
  54. package/dist/security/context-router-tool.js +1 -1
  55. package/dist/security/input-scanner.js +223 -0
  56. package/dist/web/client.js +3089 -4458
  57. package/dist/web/index.html +58 -67
  58. package/dist/web/server.js +299 -117
  59. package/dist/web/style.css +531 -249
  60. package/dist/web/ui/message-renderer.js +352 -0
  61. package/dist/web/ui/step-timeline.js +279 -0
  62. package/package.json +2 -2
  63. package/.auto-evolve-calls +0 -1
  64. package/.last-auto-evolve-baseline +0 -1
  65. package/Bolloon.md +0 -103
  66. package/dist/agents/constraint-layer.js.map +0 -1
  67. package/dist/agents/pi-sdk.js.map +0 -1
  68. package/dist/agents/workflow-engine.js.map +0 -1
  69. package/dist/bollharness/src/index.js +0 -5
  70. package/dist/bollharness/src/scripts/checks/check_adr_plan_numbering.js +0 -6
  71. package/dist/bollharness/src/scripts/checks/check_api_types.js +0 -45
  72. package/dist/bollharness/src/scripts/checks/check_artifact_link.js +0 -146
  73. package/dist/bollharness/src/scripts/checks/check_bridge_deps.js +0 -6
  74. package/dist/bollharness/src/scripts/checks/check_bugfix_binding.js +0 -6
  75. package/dist/bollharness/src/scripts/checks/check_bugfix_binding_ci.js +0 -6
  76. package/dist/bollharness/src/scripts/checks/check_doc_file_references.js +0 -6
  77. package/dist/bollharness/src/scripts/checks/check_doc_freshness.js +0 -135
  78. package/dist/bollharness/src/scripts/checks/check_doc_links.js +0 -31
  79. package/dist/bollharness/src/scripts/checks/check_file_existence_claims.js +0 -6
  80. package/dist/bollharness/src/scripts/checks/check_fragment_integrity.js +0 -34
  81. package/dist/bollharness/src/scripts/checks/check_hook_installed.js +0 -63
  82. package/dist/bollharness/src/scripts/checks/check_issue_closure.js +0 -41
  83. package/dist/bollharness/src/scripts/checks/check_mcp_parity.js +0 -6
  84. package/dist/bollharness/src/scripts/checks/check_security.js +0 -48
  85. package/dist/bollharness/src/scripts/checks/check_skill_parity.js +0 -6
  86. package/dist/bollharness/src/scripts/checks/check_versions.js +0 -6
  87. package/dist/bollharness/src/scripts/checks/finding.js +0 -13
  88. package/dist/bollharness/src/scripts/checks/next_decision_number.js +0 -20
  89. package/dist/bollharness/src/scripts/checks/regenerate_magic_docs.js +0 -6
  90. package/dist/bollharness/src/scripts/ci/detect_rebaseline_triggers.js +0 -8
  91. package/dist/bollharness/src/scripts/ci/scan_subprocess_cfg.js +0 -8
  92. package/dist/bollharness/src/scripts/ci/scan_verify_artifacts.js +0 -8
  93. package/dist/bollharness/src/scripts/ci/scan_yaml_schema.js +0 -8
  94. package/dist/bollharness/src/scripts/context_router.js +0 -67
  95. package/dist/bollharness/src/scripts/deploy-guard.js +0 -157
  96. package/dist/bollharness/src/scripts/guard-feedback.js +0 -192
  97. package/dist/bollharness/src/scripts/guard_router.js +0 -158
  98. package/dist/bollharness/src/scripts/hooks/_hook_output.js +0 -6
  99. package/dist/bollharness/src/scripts/hooks/auto-python3.js +0 -6
  100. package/dist/bollharness/src/scripts/hooks/deploy-progress-on-session-end.js +0 -6
  101. package/dist/bollharness/src/scripts/hooks/failure-analyzer.js +0 -6
  102. package/dist/bollharness/src/scripts/hooks/gate-judgment-inject.js +0 -92
  103. package/dist/bollharness/src/scripts/hooks/gate-transition-judgment.js +0 -63
  104. package/dist/bollharness/src/scripts/hooks/inbox-ack.js +0 -6
  105. package/dist/bollharness/src/scripts/hooks/inbox-inject-on-start.js +0 -6
  106. package/dist/bollharness/src/scripts/hooks/inbox-validate.js +0 -6
  107. package/dist/bollharness/src/scripts/hooks/inbox-write-ledger.js +0 -6
  108. package/dist/bollharness/src/scripts/hooks/initializer-agent.js +0 -6
  109. package/dist/bollharness/src/scripts/hooks/loop-detection.js +0 -73
  110. package/dist/bollharness/src/scripts/hooks/owner-guard.js +0 -6
  111. package/dist/bollharness/src/scripts/hooks/precompact.js +0 -6
  112. package/dist/bollharness/src/scripts/hooks/review-agent-gatekeeper.js +0 -6
  113. package/dist/bollharness/src/scripts/hooks/risk-tracker.js +0 -108
  114. package/dist/bollharness/src/scripts/hooks/sanitize-on-read.js +0 -6
  115. package/dist/bollharness/src/scripts/hooks/session-reflection.js +0 -7
  116. package/dist/bollharness/src/scripts/hooks/session-start-magic-docs.js +0 -7
  117. package/dist/bollharness/src/scripts/hooks/session-start-reset-risk.js +0 -7
  118. package/dist/bollharness/src/scripts/hooks/session-start-toolkit-reminder.js +0 -7
  119. package/dist/bollharness/src/scripts/hooks/stop-evaluator.js +0 -157
  120. package/dist/bollharness/src/scripts/hooks/tool-call-counter.js +0 -6
  121. package/dist/bollharness/src/scripts/hooks/trace-analyzer.js +0 -10
  122. package/dist/bollharness/src/scripts/install/install-trust-token.js +0 -7
  123. package/dist/bollharness/src/scripts/install/multi_project_registry.js +0 -9
  124. package/dist/bollharness/src/scripts/install/phase2_auto.js +0 -21
  125. package/dist/bollharness/src/scripts/install/pre_commit_installer.js +0 -6
  126. package/dist/bollharness/src/scripts/install/tier_selector.js +0 -7
  127. package/dist/bollharness/src/scripts/install/transcript_miner.js +0 -7
  128. package/dist/bollharness/src/scripts/lib/claim_patterns.js +0 -10
  129. package/dist/bollharness/src/scripts/lib/sanitize_patterns.js +0 -12
  130. package/dist/bollharness/src/scripts/sanitize.js +0 -6
  131. package/dist/bollharness-integration/context-router-judgment.js.map +0 -1
  132. package/dist/bollharness-integration/context-router.js.map +0 -1
  133. package/dist/bollharness-integration/gate-state-machine.js.map +0 -1
  134. package/dist/bollharness-integration/gate-transition-hooks.js.map +0 -1
  135. package/dist/bollharness-integration/guard-checker.js.map +0 -1
  136. package/dist/bollharness-integration/index.js.map +0 -1
  137. package/dist/bollharness-integration/integration.js.map +0 -1
  138. package/dist/bollharness-integration/llm/pi-ai.d.ts +0 -60
  139. package/dist/bollharness-integration/pi-ecosystem-colony/index.d.ts +0 -153
  140. package/dist/bollharness-integration/pi-ecosystem-goals/index.d.ts +0 -136
  141. package/dist/bollharness-integration/pi-ecosystem-judgment/decision.d.ts +0 -117
  142. package/dist/bollharness-integration/pi-ecosystem-judgment/distillation.d.ts +0 -78
  143. package/dist/bollharness-integration/pi-ecosystem-judgment/index.d.ts +0 -139
  144. package/dist/bollharness-integration/pi-ecosystem-mcp/index.d.ts +0 -127
  145. package/dist/bollharness-integration/pi-ecosystem-subagents/index.d.ts +0 -95
  146. package/dist/bollharness-integration/skill-adapter.js.map +0 -1
  147. package/dist/constraint-runtime/src/_archive_helper.js +0 -9
  148. package/dist/constraint-runtime/src/agent/coordinator.js +0 -48
  149. package/dist/constraint-runtime/src/agent/index.js +0 -1
  150. package/dist/constraint-runtime/src/assistant/index.js +0 -12
  151. package/dist/constraint-runtime/src/bootstrap/index.js +0 -12
  152. package/dist/constraint-runtime/src/bootstrap_graph.js +0 -13
  153. package/dist/constraint-runtime/src/bridge/index.js +0 -12
  154. package/dist/constraint-runtime/src/buddy/index.js +0 -12
  155. package/dist/constraint-runtime/src/cli/index.js +0 -12
  156. package/dist/constraint-runtime/src/command_graph.js +0 -10
  157. package/dist/constraint-runtime/src/commands.js +0 -60
  158. package/dist/constraint-runtime/src/components/index.js +0 -12
  159. package/dist/constraint-runtime/src/constants/index.js +0 -12
  160. package/dist/constraint-runtime/src/constraint/budget.js +0 -22
  161. package/dist/constraint-runtime/src/constraint/budget.js.map +0 -1
  162. package/dist/constraint-runtime/src/constraint/index.js +0 -2
  163. package/dist/constraint-runtime/src/constraint/permission.js +0 -20
  164. package/dist/constraint-runtime/src/constraint/permission.js.map +0 -1
  165. package/dist/constraint-runtime/src/context.js +0 -30
  166. package/dist/constraint-runtime/src/coordinator/index.js +0 -12
  167. package/dist/constraint-runtime/src/cost_hook.js +0 -4
  168. package/dist/constraint-runtime/src/cost_tracker.js +0 -8
  169. package/dist/constraint-runtime/src/deferred_init.js +0 -10
  170. package/dist/constraint-runtime/src/direct_modes.js +0 -6
  171. package/dist/constraint-runtime/src/dynamic-tool-loader.js +0 -85
  172. package/dist/constraint-runtime/src/entrypoints/index.js +0 -12
  173. package/dist/constraint-runtime/src/execution_registry.js +0 -44
  174. package/dist/constraint-runtime/src/history.js +0 -9
  175. package/dist/constraint-runtime/src/hooks/index.js +0 -12
  176. package/dist/constraint-runtime/src/index.js +0 -26
  177. package/dist/constraint-runtime/src/ink.js +0 -4
  178. package/dist/constraint-runtime/src/keybindings/index.js +0 -12
  179. package/dist/constraint-runtime/src/memdir/index.js +0 -12
  180. package/dist/constraint-runtime/src/migrations/index.js +0 -12
  181. package/dist/constraint-runtime/src/models.js +0 -1
  182. package/dist/constraint-runtime/src/models.js.map +0 -1
  183. package/dist/constraint-runtime/src/moreright/index.js +0 -12
  184. package/dist/constraint-runtime/src/native_ts/index.js +0 -12
  185. package/dist/constraint-runtime/src/output_styles/index.js +0 -12
  186. package/dist/constraint-runtime/src/parity_audit.js +0 -12
  187. package/dist/constraint-runtime/src/plugins/index.js +0 -12
  188. package/dist/constraint-runtime/src/port_manifest.js +0 -11
  189. package/dist/constraint-runtime/src/prefetch.js +0 -9
  190. package/dist/constraint-runtime/src/query.js +0 -1
  191. package/dist/constraint-runtime/src/remote/index.js +0 -12
  192. package/dist/constraint-runtime/src/remote_runtime.js +0 -9
  193. package/dist/constraint-runtime/src/runtime/index.js +0 -1
  194. package/dist/constraint-runtime/src/runtime/session.js +0 -35
  195. package/dist/constraint-runtime/src/schemas/index.js +0 -12
  196. package/dist/constraint-runtime/src/screens/index.js +0 -12
  197. package/dist/constraint-runtime/src/server/index.js +0 -12
  198. package/dist/constraint-runtime/src/services/index.js +0 -12
  199. package/dist/constraint-runtime/src/session_store.js +0 -22
  200. package/dist/constraint-runtime/src/setup.js +0 -30
  201. package/dist/constraint-runtime/src/skills/index.js +0 -1
  202. package/dist/constraint-runtime/src/skills/skill-registry.js +0 -28
  203. package/dist/constraint-runtime/src/state/index.js +0 -12
  204. package/dist/constraint-runtime/src/system_init.js +0 -20
  205. package/dist/constraint-runtime/src/thinking/engine.js +0 -42
  206. package/dist/constraint-runtime/src/thinking/index.js +0 -1
  207. package/dist/constraint-runtime/src/tool_pool.js +0 -8
  208. package/dist/constraint-runtime/src/tools/OpenCLI/execAdapter.js +0 -7
  209. package/dist/constraint-runtime/src/tools/OpenCLI/listAdapters.js +0 -7
  210. package/dist/constraint-runtime/src/tools/OpenCLI/runCommand.js +0 -7
  211. package/dist/constraint-runtime/src/tools/PolymarketSDK/cancelOrder.js +0 -6
  212. package/dist/constraint-runtime/src/tools/PolymarketSDK/createOrder.js +0 -6
  213. package/dist/constraint-runtime/src/tools/PolymarketSDK/getMarket.js +0 -5
  214. package/dist/constraint-runtime/src/tools/PolymarketSDK/getOrders.js +0 -6
  215. package/dist/constraint-runtime/src/tools/PolymarketSDK/listMarkets.js +0 -4
  216. package/dist/constraint-runtime/src/tools/SafeSDK/confirmTransaction.js +0 -6
  217. package/dist/constraint-runtime/src/tools/SafeSDK/createTransaction.js +0 -8
  218. package/dist/constraint-runtime/src/tools/SafeSDK/deploySafe.js +0 -6
  219. package/dist/constraint-runtime/src/tools/SafeSDK/executeTransaction.js +0 -6
  220. package/dist/constraint-runtime/src/tools/SafeSDK/getBalance.js +0 -6
  221. package/dist/constraint-runtime/src/tools/SafeSDK/getPendingTransactions.js +0 -6
  222. package/dist/constraint-runtime/src/tools/SafeSDK/proposeTransaction.js +0 -6
  223. package/dist/constraint-runtime/src/tools/WalletTools/autoPay.js +0 -29
  224. package/dist/constraint-runtime/src/tools/WalletTools/createWallet.js +0 -10
  225. package/dist/constraint-runtime/src/tools/WalletTools/getBalance.js +0 -13
  226. package/dist/constraint-runtime/src/tools/WalletTools/importWallet.js +0 -22
  227. package/dist/constraint-runtime/src/tools/WalletTools/sendTransaction.js +0 -25
  228. package/dist/constraint-runtime/src/tools/WalletTools/signMessage.js +0 -10
  229. package/dist/constraint-runtime/src/tools/WalletTools/transferToken.js +0 -25
  230. package/dist/constraint-runtime/src/tools.js +0 -80
  231. package/dist/constraint-runtime/src/transcript.js +0 -19
  232. package/dist/constraint-runtime/src/types/index.js +0 -12
  233. package/dist/constraint-runtime/src/upstream_proxy/index.js +0 -12
  234. package/dist/constraint-runtime/src/utils/index.js +0 -12
  235. package/dist/constraint-runtime/src/vim/index.js +0 -12
  236. package/dist/constraint-runtime/src/voice/index.js +0 -12
  237. package/dist/constraints/index.js.map +0 -1
  238. package/dist/documents/reader.js.map +0 -1
  239. package/dist/llm/config-store.js.map +0 -1
  240. package/dist/llm/pi-ai.js.map +0 -1
  241. package/dist/network/agent-network.js.map +0 -1
  242. package/dist/network/iroh-integration.js.map +0 -1
  243. package/dist/network/iroh-transport.js.map +0 -1
  244. package/dist/network/p2p.js.map +0 -1
  245. package/dist/network/storage/adapters/json-adapter.js.map +0 -1
  246. package/dist/pi-ecosystem-colony/index.js.map +0 -1
  247. package/dist/pi-ecosystem-goals/index.js.map +0 -1
  248. package/dist/pi-ecosystem-judgment/decision.js.map +0 -1
  249. package/dist/pi-ecosystem-judgment/distillation.js.map +0 -1
  250. package/dist/pi-ecosystem-judgment/human-value-store.js.map +0 -1
  251. package/dist/pi-ecosystem-judgment/index.js.map +0 -1
  252. package/dist/pi-ecosystem-judgment/value-injection.js.map +0 -1
  253. package/dist/pi-ecosystem-mcp/index.js.map +0 -1
  254. package/dist/pi-ecosystem-subagents/index.js.map +0 -1
  255. package/dist/social/ant-colony/AdaptiveHeartbeat.js.map +0 -1
  256. package/dist/social/ant-colony/PheromoneEngine.js.map +0 -1
  257. package/dist/social/ant-colony/types.js.map +0 -1
  258. package/dist/social/channels/ChannelManager.js.map +0 -1
  259. package/dist/social/channels/DiapChannelBridge.js.map +0 -1
  260. package/dist/social/channels/InterestMatcher.js.map +0 -1
  261. package/dist/social/channels/types.js.map +0 -1
  262. package/dist/social/global-shared-context.js.map +0 -1
  263. package/dist/social/heartbeat.js.map +0 -1
  264. package/lefthook.yml +0 -29
  265. package/scripts/auto-evolve-loop.ts +0 -376
  266. package/scripts/auto-evolve-oneshot.sh +0 -155
  267. package/scripts/auto-evolve-snapshot.sh +0 -136
  268. package/scripts/build-cli.js +0 -216
  269. package/scripts/build-web.ts +0 -82
  270. package/scripts/detect-schema-changes.sh +0 -48
  271. package/scripts/diff-reviewer.ts +0 -159
  272. package/scripts/postinstall.js +0 -153
  273. package/scripts/weekly-report.ts +0 -364
  274. package/src/agents/agent-manifest-protocol.ts +0 -117
  275. package/src/agents/constraint-layer.ts +0 -309
  276. package/src/agents/iroh-secret.ts +0 -32
  277. package/src/agents/p2p-chat-tools.ts +0 -383
  278. package/src/agents/p2p-document-tools.ts +0 -347
  279. package/src/agents/pi-sdk.ts +0 -2462
  280. package/src/agents/protocol.ts +0 -398
  281. package/src/agents/shell-guard.ts +0 -417
  282. package/src/agents/shell-tool.ts +0 -103
  283. package/src/agents/skill-loader.ts +0 -202
  284. package/src/agents/subagent-manager.ts +0 -553
  285. package/src/agents/workflow-engine.ts +0 -332
  286. package/src/agents/workflow-pivot-loop.ts +0 -675
  287. package/src/bollharness/.sanitize-report.json +0 -13
  288. package/src/bollharness/CLAUDE.md +0 -73
  289. package/src/bollharness/LICENSE +0 -21
  290. package/src/bollharness/README.md +0 -143
  291. package/src/bollharness/README.zh-CN.md +0 -131
  292. package/src/bollharness/package.json +0 -20
  293. package/src/bollharness/reference/SOURCE-COMMIT.txt +0 -3
  294. package/src/bollharness/reference/boll-reference/scripts/hooks/.sanitize-report.json +0 -12
  295. package/src/bollharness/reference/boll-reference/scripts/hooks/find-boll-root.sh +0 -27
  296. package/src/bollharness/reference/boll-reference/scripts/hooks/precompact.sh +0 -57
  297. package/src/bollharness/reference/boll-reference/scripts/hooks/stop-evaluator.md +0 -57
  298. package/src/bollharness/schemas/metrics-jsonl-allowlist.json +0 -67
  299. package/src/bollharness/scripts/checks/next_decision_number.sh +0 -48
  300. package/src/bollharness/scripts/ci/count-components.sh +0 -65
  301. package/src/bollharness/scripts/context-fragments/artifact-linkage.md +0 -14
  302. package/src/bollharness/scripts/context-fragments/auth-consumers.md +0 -17
  303. package/src/bollharness/scripts/context-fragments/bridge-constitution.md +0 -13
  304. package/src/bollharness/scripts/context-fragments/catalyst-distributed.md +0 -18
  305. package/src/bollharness/scripts/context-fragments/closure-checklist.md +0 -13
  306. package/src/bollharness/scripts/context-fragments/contract-consumers.md +0 -15
  307. package/src/bollharness/scripts/context-fragments/db-shared-structures.md +0 -15
  308. package/src/bollharness/scripts/context-fragments/fixed-three-layers.md +0 -19
  309. package/src/bollharness/scripts/context-fragments/general-dev-principles.md +0 -11
  310. package/src/bollharness/scripts/context-fragments/issue-first.md +0 -8
  311. package/src/bollharness/scripts/context-fragments/mcp-parity.md +0 -16
  312. package/src/bollharness/scripts/context-fragments/pi-agent-operations.md +0 -108
  313. package/src/bollharness/scripts/context-fragments/protocol-consumers.md +0 -15
  314. package/src/bollharness/scripts/context-fragments/run-events-consumers.md +0 -15
  315. package/src/bollharness/scripts/context-fragments/scene-fidelity.md +0 -13
  316. package/src/bollharness/scripts/context-fragments/truth-source-hierarchy.md +0 -15
  317. package/src/bollharness/scripts/context-fragments/two-language.md +0 -15
  318. package/src/bollharness/scripts/context-fragments/version-sources.md +0 -14
  319. package/src/bollharness/scripts/hooks/find-project-root.sh +0 -47
  320. package/src/bollharness/scripts/hooks/inbox-poll.sh +0 -78
  321. package/src/bollharness/scripts/hooks/precompact.sh +0 -56
  322. package/src/bollharness/scripts/hooks/stop-evaluator.md +0 -83
  323. package/src/bollharness/scripts/sync-from-upstream.sh +0 -281
  324. package/src/bollharness/src/index.ts +0 -5
  325. package/src/bollharness/src/scripts/checks/check_adr_plan_numbering.ts +0 -11
  326. package/src/bollharness/src/scripts/checks/check_api_types.ts +0 -52
  327. package/src/bollharness/src/scripts/checks/check_artifact_link.ts +0 -156
  328. package/src/bollharness/src/scripts/checks/check_bridge_deps.ts +0 -11
  329. package/src/bollharness/src/scripts/checks/check_bugfix_binding.ts +0 -11
  330. package/src/bollharness/src/scripts/checks/check_bugfix_binding_ci.ts +0 -11
  331. package/src/bollharness/src/scripts/checks/check_doc_file_references.ts +0 -11
  332. package/src/bollharness/src/scripts/checks/check_doc_freshness.ts +0 -141
  333. package/src/bollharness/src/scripts/checks/check_doc_links.ts +0 -36
  334. package/src/bollharness/src/scripts/checks/check_file_existence_claims.ts +0 -11
  335. package/src/bollharness/src/scripts/checks/check_fragment_integrity.ts +0 -40
  336. package/src/bollharness/src/scripts/checks/check_hook_installed.ts +0 -70
  337. package/src/bollharness/src/scripts/checks/check_issue_closure.ts +0 -51
  338. package/src/bollharness/src/scripts/checks/check_mcp_parity.ts +0 -11
  339. package/src/bollharness/src/scripts/checks/check_security.ts +0 -54
  340. package/src/bollharness/src/scripts/checks/check_skill_parity.ts +0 -11
  341. package/src/bollharness/src/scripts/checks/check_versions.ts +0 -11
  342. package/src/bollharness/src/scripts/checks/finding.ts +0 -35
  343. package/src/bollharness/src/scripts/checks/next_decision_number.ts +0 -24
  344. package/src/bollharness/src/scripts/checks/regenerate_magic_docs.ts +0 -11
  345. package/src/bollharness/src/scripts/ci/detect_rebaseline_triggers.ts +0 -14
  346. package/src/bollharness/src/scripts/ci/scan_subprocess_cfg.ts +0 -14
  347. package/src/bollharness/src/scripts/ci/scan_verify_artifacts.ts +0 -14
  348. package/src/bollharness/src/scripts/ci/scan_yaml_schema.ts +0 -14
  349. package/src/bollharness/src/scripts/context_router.ts +0 -76
  350. package/src/bollharness/src/scripts/deploy-guard.ts +0 -182
  351. package/src/bollharness/src/scripts/guard-feedback.ts +0 -215
  352. package/src/bollharness/src/scripts/guard_router.ts +0 -194
  353. package/src/bollharness/src/scripts/hooks/_hook_output.js +0 -3
  354. package/src/bollharness/src/scripts/hooks/_hook_output.ts +0 -11
  355. package/src/bollharness/src/scripts/hooks/auto-python3.ts +0 -10
  356. package/src/bollharness/src/scripts/hooks/deploy-progress-on-session-end.ts +0 -10
  357. package/src/bollharness/src/scripts/hooks/failure-analyzer.ts +0 -10
  358. package/src/bollharness/src/scripts/hooks/gate-judgment-inject.ts +0 -111
  359. package/src/bollharness/src/scripts/hooks/gate-transition-judgment.ts +0 -74
  360. package/src/bollharness/src/scripts/hooks/inbox-ack.ts +0 -10
  361. package/src/bollharness/src/scripts/hooks/inbox-inject-on-start.ts +0 -10
  362. package/src/bollharness/src/scripts/hooks/inbox-validate.ts +0 -10
  363. package/src/bollharness/src/scripts/hooks/inbox-write-ledger.ts +0 -10
  364. package/src/bollharness/src/scripts/hooks/initializer-agent.ts +0 -10
  365. package/src/bollharness/src/scripts/hooks/loop-detection.ts +0 -83
  366. package/src/bollharness/src/scripts/hooks/owner-guard.ts +0 -10
  367. package/src/bollharness/src/scripts/hooks/precompact.ts +0 -10
  368. package/src/bollharness/src/scripts/hooks/review-agent-gatekeeper.ts +0 -10
  369. package/src/bollharness/src/scripts/hooks/risk-tracker.ts +0 -121
  370. package/src/bollharness/src/scripts/hooks/sanitize-on-read.ts +0 -10
  371. package/src/bollharness/src/scripts/hooks/session-reflection.ts +0 -12
  372. package/src/bollharness/src/scripts/hooks/session-start-magic-docs.ts +0 -12
  373. package/src/bollharness/src/scripts/hooks/session-start-reset-risk.ts +0 -12
  374. package/src/bollharness/src/scripts/hooks/session-start-toolkit-reminder.ts +0 -12
  375. package/src/bollharness/src/scripts/hooks/stop-evaluator.ts +0 -164
  376. package/src/bollharness/src/scripts/hooks/tool-call-counter.ts +0 -10
  377. package/src/bollharness/src/scripts/hooks/trace-analyzer.ts +0 -14
  378. package/src/bollharness/src/scripts/install/install-trust-token.ts +0 -13
  379. package/src/bollharness/src/scripts/install/multi_project_registry.ts +0 -13
  380. package/src/bollharness/src/scripts/install/phase2_auto.ts +0 -28
  381. package/src/bollharness/src/scripts/install/pre_commit_installer.ts +0 -10
  382. package/src/bollharness/src/scripts/install/tier_selector.ts +0 -10
  383. package/src/bollharness/src/scripts/install/transcript_miner.ts +0 -13
  384. package/src/bollharness/src/scripts/lib/claim_patterns.ts +0 -11
  385. package/src/bollharness/src/scripts/lib/sanitize_patterns.ts +0 -13
  386. package/src/bollharness/src/scripts/sanitize.ts +0 -9
  387. package/src/bollharness/templates/persona/default.json +0 -19
  388. package/src/bollharness/templates/scaffold/.gitignore.append +0 -16
  389. package/src/bollharness/templates/scaffold/CLAUDE.md +0 -89
  390. package/src/bollharness-integration/channel-judgment-engine.ts +0 -634
  391. package/src/bollharness-integration/context-chain-router.ts +0 -474
  392. package/src/bollharness-integration/context-router-judgment.ts +0 -339
  393. package/src/bollharness-integration/context-router.ts +0 -583
  394. package/src/bollharness-integration/gate-state-machine.ts +0 -444
  395. package/src/bollharness-integration/gate-transition-hooks.ts +0 -137
  396. package/src/bollharness-integration/guard-checker.ts +0 -451
  397. package/src/bollharness-integration/index.ts +0 -195
  398. package/src/bollharness-integration/integration.ts +0 -538
  399. package/src/bollharness-integration/judgment-prompts.yaml +0 -535
  400. package/src/bollharness-integration/llm-judgment-engine.ts +0 -712
  401. package/src/bollharness-integration/skill-adapter.ts +0 -646
  402. package/src/bootstrap/bootstrap.ts +0 -132
  403. package/src/bootstrap/context-collector.ts +0 -342
  404. package/src/bootstrap/lifecycle-hooks.ts +0 -176
  405. package/src/bootstrap/project-context.ts +0 -163
  406. package/src/cli/interface.ts +0 -211
  407. package/src/cli-entry.ts +0 -304
  408. package/src/constraints/index.ts +0 -6
  409. package/src/documents/reader.ts +0 -85
  410. package/src/documents/store.ts +0 -252
  411. package/src/electron-preload.ts +0 -25
  412. package/src/electron.ts +0 -200
  413. package/src/heartbeat/DaemonManager.ts +0 -283
  414. package/src/heartbeat/HealthMonitor.ts +0 -316
  415. package/src/heartbeat/StartupVerifier.ts +0 -223
  416. package/src/heartbeat/Watchdog.ts +0 -208
  417. package/src/heartbeat/index.ts +0 -109
  418. package/src/heartbeat/self-improve-bus.ts +0 -110
  419. package/src/heartbeat/types.ts +0 -82
  420. package/src/index.ts +0 -1690
  421. package/src/llm/audio-config-store.ts +0 -246
  422. package/src/llm/config-store.ts +0 -400
  423. package/src/llm/llm-judgment-client.ts +0 -470
  424. package/src/llm/pi-ai.ts +0 -558
  425. package/src/llm/video-config-store.ts +0 -257
  426. package/src/network/agent-network.ts +0 -800
  427. package/src/network/hybrid-messenger.ts +0 -199
  428. package/src/network/iroh-bootstrap.ts +0 -57
  429. package/src/network/iroh-discovery.ts +0 -208
  430. package/src/network/iroh-integration.ts +0 -158
  431. package/src/network/iroh-transport.ts +0 -637
  432. package/src/network/known-peers.ts +0 -102
  433. package/src/network/p2p-direct.ts +0 -240
  434. package/src/network/p2p-secret.ts +0 -153
  435. package/src/network/p2p.ts +0 -964
  436. package/src/network/storage/adapters/json-adapter.ts +0 -454
  437. package/src/network/storage/index.ts +0 -203
  438. package/src/network/storage/types.ts +0 -166
  439. package/src/security/builtin-guards.ts +0 -162
  440. package/src/security/context-router-tool.ts +0 -122
  441. package/src/security/react-harness.ts +0 -177
  442. package/src/security/tool-gate.ts +0 -294
  443. package/src/social/ant-colony/index.js +0 -19
  444. package/src/social/channels/ChannelManager.ts +0 -485
  445. package/src/social/channels/DiapChannelBridge.ts +0 -501
  446. package/src/social/channels/InterestMatcher.ts +0 -189
  447. package/src/social/channels/agent-workflow-config.json +0 -214
  448. package/src/social/channels/agent-workflow-config.yaml +0 -334
  449. package/src/social/channels/channel-agent-session.ts +0 -407
  450. package/src/social/channels/channel-heartbeat-agent.ts +0 -622
  451. package/src/social/channels/diap-doc-parser.ts +0 -282
  452. package/src/social/channels/harness-workflow-integrator.ts +0 -594
  453. package/src/social/channels/index.ts +0 -22
  454. package/src/social/channels/types.ts +0 -115
  455. package/src/social/global-shared-context.ts +0 -506
  456. package/src/social/heartbeat.ts +0 -1057
  457. package/src/social/persona/enhanced-persona.ts +0 -359
  458. package/src/types.d.ts +0 -12
  459. package/src/utils/auto-evolve-policy.ts +0 -138
  460. package/src/utils/auto-update.ts +0 -482
  461. package/src/utils/clamp.ts +0 -5
  462. package/src/web/agent-delegate-server.ts +0 -148
  463. package/src/web/api-config.html +0 -520
  464. package/src/web/client.js +0 -4898
  465. package/src/web/components/p2p/P2PModal.tsx +0 -416
  466. package/src/web/components/p2p/index.ts +0 -566
  467. package/src/web/components/p2p/index.tsx +0 -297
  468. package/src/web/components/p2p/p2p-connection.ts +0 -338
  469. package/src/web/components/p2p/p2p-identity.ts +0 -92
  470. package/src/web/components/p2p/p2p-manager.ts +0 -147
  471. package/src/web/components/p2p/p2p-messages.ts +0 -219
  472. package/src/web/components/p2p/p2p-modal.ts +0 -685
  473. package/src/web/components/p2p/p2p-store-memory.ts +0 -162
  474. package/src/web/components/p2p/p2p-tools.ts +0 -315
  475. package/src/web/components/p2p/types.ts +0 -170
  476. package/src/web/components/wallet-viem.mjs +0 -118
  477. package/src/web/design.md +0 -99
  478. package/src/web/icons/apple-touch-icon.png +0 -0
  479. package/src/web/icons/favicon-16x16.png +0 -0
  480. package/src/web/icons/favicon-192x192.png +0 -0
  481. package/src/web/icons/favicon-32x32.png +0 -0
  482. package/src/web/icons/favicon-48x48.png +0 -0
  483. package/src/web/icons/favicon-512x512.png +0 -0
  484. package/src/web/icons/favicon.icns +0 -0
  485. package/src/web/icons/favicon.ico +0 -0
  486. package/src/web/icons/icon.png +0 -0
  487. package/src/web/icons/image.png +0 -0
  488. package/src/web/index.html +0 -382
  489. package/src/web/iroh-delegate-transport.ts +0 -139
  490. package/src/web/manifest.json +0 -21
  491. package/src/web/server.ts +0 -5571
  492. package/src/web/style.css +0 -4455
  493. package/staging/auto-evolve/clean-001/.review-verdict +0 -9
  494. package/staging/auto-evolve/clean-001/clean-001.patch +0 -14
  495. package/staging/auto-evolve/e2e-001/.patch-id +0 -1
  496. package/staging/auto-evolve/e2e-001/.review-verdict +0 -12
  497. package/staging/auto-evolve/e2e-001/e2e-001.patch +0 -11
  498. package/staging/auto-evolve/test-bad/.review-verdict +0 -12
  499. package/staging/auto-evolve/test-bad/test-bad.patch +0 -11
  500. package/tsconfig.cli.json +0 -16
  501. package/tsconfig.electron.json +0 -20
  502. package/tsconfig.json +0 -18
@@ -1,73 +0,0 @@
1
- # CLAUDE.md — bollharness
2
-
3
- bollharness 是一个 **AI Agent Session 治理框架**——通过 Claude Code hooks、guards、上下文路由和安装器,给任意项目加装结构化的 agent 行为约束。
4
-
5
- ## 架构
6
-
7
- ```
8
- bollharness/
9
- ├── .boll/
10
- │ ├── settings.json # Hook 注册表(16 hooks,7 stages)
11
- │ ├── rules/ # Path-scoped rules(Claude Code 按文件路径自动加载)
12
- │ └── skills/ # Skill 定义(harness-dev-handoff, guardian-fixer 等)
13
- ├── scripts/
14
- │ ├── hooks/ # 14 个 hook 脚本(session lifecycle + tool guards)
15
- │ ├── guard-feedback.ts # PostToolUse 入口 — 上下文路由(机制 A)+ guard 检查(机制 B)
16
- │ ├── deploy-guard.ts # PreToolUse Bash 入口 — 部署安全拦截
17
- │ ├── context_router.ts # 文件路径 → 上下文片段路由表(ADR-030 §3.4.1)
18
- │ ├── guard_router.ts # 文件路径 → guard 脚本映射(ADR-030 §3.3)
19
- │ ├── context-fragments/ # 17 个上下文片段(guard-feedback.ts 注入用)
20
- │ ├── checks/ # Guard 脚本(check_*.ts)
21
- │ ├── install/ # 安装器(phase2_auto.ts + trust token)
22
- │ └── lib/ # 共享库
23
- ├── templates/scaffold/ # 目标项目骨架模板(安装时复制)
24
- ├── schemas/ # YAML/JSON schema 定义
25
- ├── docs/decisions/ # ADR-030, ADR-038, ADR-041
26
- └── .boll/MANIFEST.yaml # 物理清单(版本 + 文件注册表)
27
- ```
28
-
29
-
30
- **同步覆盖范围**:
31
- - Step 1: `scripts/hooks/*`(跳过 boll-only 的 `find-boll-root.sh`)
32
- - Step 2: 路径修补(`find-boll-root.sh` → `find-project-root.sh`)
33
- - Step 3: settings.json hook 注册对比
34
- - Step 4: 共享脚本(guard-feedback.ts, deploy-guard.ts, context_router.ts, guard_router.ts)
35
- - Step 5: context-fragments/ 目录
36
-
37
- ## 开发约束
38
-
39
- ### 必须遵守
40
- - 所有命令使用 `npx ts-node`
41
- - Commit message 中英双语 + `Co-Authored-By: Claude Opus 4.6`
42
- - 审查类 subagent 必须用 opus 模型,不降级 sonnet
43
- - 审查类 agent 工具白名单必须 schema-level 隔离写权限(ADR-038 D11)
44
- - Guardian issue 必须先建 `docs/issues/*.md` 再写代码
45
-
46
- ### 安装器开发
47
- - `phase2_auto.ts` 所有函数必须**幂等**(重复运行不改变结果)
48
- - Trust token 使用 HMAC + 30min 滑动窗口 + 6h 绝对窗口
49
- - 安装步骤顺序不可打乱(trust → bundle → scaffold → gitignore → paths → hooks)
50
-
51
- ### Hook 开发
52
- - Hook 必须 fail-open(`|| true`)或有明确的 fail-closed 理由
53
- - Hook timeout 不超过 30s(guard-feedback.ts 最大)
54
- - 新增 hook 后必须同时更新 settings.json 注册和 MANIFEST.yaml
55
-
56
- ### 路径规则
57
- - `find-project-root.sh` 是 bollharness 的项目根定位器(3 层锚点,fail-closed)
58
- - `find-boll-root.sh` 是 boll 专用的(不同步到 bollharness)
59
- - settings.json 中所有 hook command 使用**相对路径**解析器,不含绝对路径
60
-
61
- ## 接手入口
62
-
63
- ```bash
64
- npx ts-node .boll/skills/harness-dev-handoff/scripts/collect_handoff_context.ts
65
- ```
66
-
67
- 然后读 `.boll/skills/harness-dev-handoff/SKILL.md`。
68
-
69
- ## 关键 ADR
70
-
71
- - **ADR-030**: Guard Signal Protocol — 上下文路由 + guard 检查的设计
72
- - **ADR-038**: Harness Optimization — 11 决策(metrics、fragment TTL、review agent 隔离等)
73
- - **ADR-041**: Codex Division of Labor — 判断类 vs 执行类 subagent 分流
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 bollharness contributors
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
@@ -1,143 +0,0 @@
1
- [中文](README.zh-CN.md) | English
2
-
3
- # bollharness
4
-
5
- > "How do you let AI handle so much development with so little supervision?"
6
-
7
- This is the answer.
8
-
9
- bollharness is a governance layer for [Claude Code](https://docs.anthropic.com/en/docs/claude-code). It makes AI agents reliable enough that you can set direction, walk away, and trust the work actually lands — with review gates, completion verification, and mechanical enforcement that no amount of prompting can replicate.
10
-
11
- ## The Problem
12
-
13
- Claude Code is remarkably capable. But left unsupervised, it has structural biases:
14
-
15
- - **Claims completion prematurely** — "all tests pass" (didn't run them)
16
- - **Skips review** — "this change is simple enough" (it wasn't)
17
- - **Drifts from plans** — starts fixing one bug, ends up refactoring three files
18
- - **Self-evaluation bias** — asks itself "did I do a good job?", answers "yes"
19
-
20
- You end up supervising more than you saved in development time. The 80% it does well makes the 20% it silently drops even harder to catch.
21
-
22
- ## The Insight
23
-
24
- ```
25
- CLAUDE.md instruction compliance: ~20%
26
- PreToolUse hook enforcement: 100%
27
- ```
28
-
29
- Instructions don't reliably change AI behavior. Mechanical constraints do.
30
-
31
- A review agent told "don't modify files" obeys ~70% of the time. A review agent whose tool manifest doesn't list Edit/Write obeys 100% of the time — it physically can't call what isn't there.
32
-
33
- bollharness applies this principle everywhere: if it matters, enforce it with a hook, not a sentence.
34
-
35
- ## What Changes
36
-
37
- | Without bollharness | With bollharness |
38
- |---|---|
39
- | "Did you run the tests?" → "Yes" (didn't) | Mechanical gate checks `progress.json` — can't fake evidence |
40
- | AI stops mid-chat, injects completion checklist | Stop hook parses session transcript — only triggers when uncommitted writes exist |
41
- | Review agent "helpfully" edits what it reviews | Review agent physically cannot call Edit/Write (schema-level isolation) |
42
- | "This PR is simple, let's skip review" | Gates 2/4/6/8 mechanically require independent review — no exceptions |
43
- | Parallel AI sessions contaminate each other | Each session's scope is isolated via its own transcript file |
44
- | Agent drifts into unrelated fixes | Context routing injects domain-specific rules only for files being edited |
45
-
46
- ## How It Works
47
-
48
- ### Hooks: enforcement at the moment of action
49
-
50
- 16 hooks across 7 lifecycle stages. They intercept *as things happen*, not after:
51
-
52
- ```
53
- SessionStart → Load context, reset risk state, surface tools
54
- PreToolUse → Block unsafe deploys, gate review agents, sanitize reads
55
- PostToolUse → Route context on edit, detect loops, track risk
56
- Stop → Verify completion candidate exists (transcript × git diff)
57
- SessionEnd → Reflect, analyze traces, persist progress
58
- ```
59
-
60
- ### The 8-Gate State Machine
61
-
62
- Every significant change flows through gates. Even-numbered gates require independent review — not the same agent checking its own work:
63
-
64
- ```
65
- G0 Problem → G1 Design → G2 Review*
66
- → G3 Plan → G4 Review+Lock*
67
- → G5 Tasks → G6 Review*
68
- → G7 Execute+Log → G8 Final Review*
69
-
70
- * = Independent reviewer (separate context, read-only tools)
71
- ```
72
-
73
- ### Automated Checks
74
-
75
- 15 validators run on file changes: API type consistency, doc freshness, security patterns, fragment integrity, hook registration, and more. They catch drift before it compounds.
76
-
77
- ### Skills
78
-
79
- 16 specialized behaviors — from architecture design (`arch`) to failure pattern extraction (`crystal-learn`) to structured bug triage (`bug-triage`). Skills install judgment frameworks, not rule lists, so the agent can navigate situations the skill didn't explicitly cover.
80
-
81
- Each skill has `{{PLACEHOLDER}}` structural slots designed to be filled with your project's context during installation.
82
-
83
- ## Install
84
-
85
- ```
86
-
87
- ### Three Tiers
88
-
89
- | Tier | Trust level | What happens |
90
- |------|-------------|-------------|
91
- | **drop-in** | Minimal | Installs hooks + skills as-is. Try it, see what happens. |
92
- | **adapt** | Medium | Reads your README + docs, customizes skills to your project. |
93
- | **mine** | Full | Reads your work transcripts, deeply adapts to your patterns. |
94
-
95
- ### What Gets Installed
96
-
97
- ```
98
- your-project/
99
- ├── .boll/
100
- │ ├── settings.json # Hook registrations (appends, won't clobber)
101
- │ ├── skills/ # 16 agent behavior definitions
102
- │ └── rules/ # Path-scoped context (auto-loaded by file path)
103
- ├── scripts/
104
- │ ├── hooks/ # 16 lifecycle hooks
105
- │ └── checks/ # 15 automated validators
106
- └── CLAUDE.md # Governance guide (generated, yours to edit)
107
- ```
108
-
109
- The installer is idempotent — run it twice, get the same result.
110
-
111
- ## Design Principles
112
-
113
- 1. **Hooks over instructions** — If compliance matters, don't ask. Enforce.
114
- 2. **Schema-level isolation** — Review agents' tool manifests exclude write tools. Not "please don't" — *can't*.
115
- 3. **Fail-open where safe** — A hook that can't read its data injects *more* checks, not fewer. The failure mode is always "too cautious," never "silently skipped."
116
- 4. **Session isolation** — Completion detection uses per-session transcript parsing. No shared mutable state between parallel sessions.
117
- 5. **Structural slots over blank space** — Project-specific content becomes `{{PLACEHOLDER}}` with meta-instructions (what to put, why it matters, how to discover it), not empty fields you forget to fill.
118
-
119
- ## Requirements
120
-
121
- - [Claude Code](https://docs.anthropic.com/en/docs/claude-code) CLI
122
- - Node.js 18+
123
- - Git
124
-
125
- ## Origin
126
-
127
- Born from 6 months of production use on [boll](https://boll.net), an agent collaboration protocol. The governance layer kept proving independently valuable — every AI-assisted project needs it, not just ours. So we extracted it.
128
-
129
- The hooks, gates, and isolation patterns were designed by getting burned first, then building the guard. Every rule in this system exists because an AI agent found a creative way to not follow the previous rule.
130
-
131
- ## Acknowledgments
132
-
133
- This project was originally developed in Python as `wow-harness` and has been migrated to TypeScript for improved type safety, better developer experience, and tighter integration with modern JavaScript/TypeScript tooling.
134
-
135
- The migration preserved all original functionality while leveraging TypeScript's:
136
- - Static type checking for reduced runtime errors
137
- - Better IDE support and code completion
138
- - Improved maintainability for larger codebases
139
- - Native ES modules and modern JavaScript features
140
-
141
- ## License
142
-
143
- MIT
@@ -1,131 +0,0 @@
1
- 中文 | [English](README.md)
2
-
3
- # bollharness
4
-
5
- > "你怎么做到让 AI 自己开发,人几乎不用管?"
6
-
7
- 这就是答案。
8
-
9
- bollharness 是 [Claude Code](https://docs.anthropic.com/en/docs/claude-code) 的治理层。它让 AI agent 变得足够可靠——你定方向,AI 交付,工作真的能落地。靠的不是提示词里多写几句"请认真做",而是机械化的审查门禁、完成验证和工具隔离。
10
-
11
- ## 问题
12
-
13
- Claude Code 能力很强。但不加约束时,它有结构性偏见:
14
-
15
- - **假装完成** — "测试全过了"(其实没跑)
16
- - **跳过审查** — "这个改动很简单"(并不简单)
17
- - **任务漂移** — 修一个 bug,顺手重构三个文件
18
- - **自我评价偏差** — 问自己"做得好不好?",回答"好"
19
-
20
- 你花在监督上的时间,比省下的开发时间还多。更难受的是,它做对的 80% 让你放松警惕,剩下 20% 的静默遗漏更难发现。
21
-
22
- ## 核心洞察
23
-
24
- ```
25
- CLAUDE.md 指令遵从率: ~20%
26
- PreToolUse hook 执行率: 100%
27
- ```
28
-
29
- 指令改变不了 AI 的行为。机械约束可以。
30
-
31
- 告诉审查 agent "不要修改文件",遵从率约 70%。把 Edit/Write 从它的工具清单里删掉,遵从率 100%——它物理上调不了不存在的工具。
32
-
33
- bollharness 把这个原则应用到所有该管的地方:重要的事不靠说,靠 hook。
34
-
35
- ## 装了之后有什么变化
36
-
37
- | 没有 bollharness | 有 bollharness |
38
- |---|---|
39
- | "跑测试了吗?" → "跑了"(没跑) | 机械化门禁检查 `progress.json` — 伪造不了证据 |
40
- | 纯聊天时弹出完成检查清单 | Stop hook 解析 session transcript — 只在有未提交的编辑时才触发 |
41
- | 审查 agent "顺手"改了它审查的代码 | 审查 agent 物理上无法调用 Edit/Write(schema 级隔离) |
42
- | "这个 PR 简单,跳过审查吧" | Gate 2/4/6/8 机械化强制独立审查 — 没有例外 |
43
- | 并行 AI session 互相污染 | 每个 session 通过独立 transcript 文件隔离作用域 |
44
- | Agent 漂移去修不相关的东西 | 上下文路由只对正在编辑的文件注入领域规则 |
45
-
46
- ## 怎么工作的
47
-
48
- ### Hook:在动作发生的那一刻介入
49
-
50
- 16 个 hook 覆盖 7 个生命周期阶段。不是事后审查,是实时拦截:
51
-
52
- ```
53
- SessionStart → 加载上下文、重置风险状态、展示可用工具
54
- PreToolUse → 拦截危险部署、门控审查 agent、净化读取内容
55
- PostToolUse → 编辑时路由上下文、检测循环、追踪风险
56
- Stop → 验证是否存在完成候选品(transcript × git diff)
57
- SessionEnd → 反思、分析轨迹、持久化进度
58
- ```
59
-
60
- ### 8 关状态机
61
-
62
- 每个重要变更都要过关。偶数关要求独立审查——不是同一个 agent 自己检查自己的工作:
63
-
64
- ```
65
- G0 问题 → G1 设计 → G2 审查*
66
- → G3 方案 → G4 审查+锁定*
67
- → G5 任务拆分 → G6 审查*
68
- → G7 执行+日志 → G8 终审*
69
-
70
- * = 独立审查者(独立上下文、只读工具)
71
- ```
72
-
73
- ### 自动化检查
74
-
75
- 15 个验证器在文件变更时运行:API 类型一致性、文档新鲜度、安全模式、片段完整性、hook 注册等。在漂移累积之前就抓住它。
76
-
77
- ### Skill
78
-
79
- 16 个专业化行为——从架构设计(`arch`)到失败模式提取(`crystal-learn`)到结构化 bug 分诊(`bug-triage`)。Skill 安装的是判断框架,不是规则清单,所以 agent 能应对 skill 没明确覆盖的情况。
80
-
81
- 每个 skill 都有 `{{PLACEHOLDER}}` 结构化槽位,安装时会填入你项目的上下文。
82
-
83
- ```
84
-
85
- ### 三个层级
86
-
87
- | 层级 | 信任度 | 效果 |
88
- |------|--------|------|
89
- | **drop-in** | 最低 | 原样安装 hook + skill。先试试看。 |
90
- | **adapt** | 中等 | 读你的 README + 文档,把 skill 适配到你的项目。 |
91
- | **mine** | 完全 | 读你的工作 transcript,深度适配到你的模式。 |
92
-
93
- ### 安装了什么
94
-
95
- ```
96
- your-project/
97
- ├── .boll/
98
- │ ├── settings.json # Hook 注册(追加模式,不覆盖已有配置)
99
- │ ├── skills/ # 16 个 agent 行为定义
100
- │ └── rules/ # 路径作用域上下文规则(按文件路径自动加载)
101
- ├── scripts/
102
- │ ├── hooks/ # 16 个生命周期 hook
103
- │ └── checks/ # 15 个自动化验证器
104
- └── CLAUDE.md # 治理指南(自动生成,你可以自由编辑)
105
- ```
106
-
107
- 安装器是幂等的——跑两次,结果一样。
108
-
109
- ## 设计原则
110
-
111
- 1. **Hook 优于指令** — 重要的事不靠说,靠执行。
112
- 2. **Schema 级隔离** — 审查 agent 的工具清单里没有写工具。不是"请不要"——是"不能"。
113
- 3. **安全方向 fail-open** — hook 读不到数据时注入*更多*检查,不是更少。失败模式永远是"过于谨慎",绝不是"静默跳过"。
114
- 4. **Session 隔离** — 完成检测用每个 session 独立的 transcript 解析。并行 session 之间零共享可变状态。
115
- 5. **结构化槽位** — 项目特定内容变成 `{{PLACEHOLDER}}` + 元指令(放什么、为什么重要、怎么发现它),不是你忘记填的空白字段。
116
-
117
- ## 环境要求
118
-
119
- - [Claude Code](https://docs.anthropic.com/en/docs/claude-code) CLI
120
- - Node.js 18+
121
- - Git
122
-
123
- ## 来历
124
-
125
- 从 [boll](https://boll.net)(流形,一个 Agent 协作协议项目)6 个月的生产使用中提取出来的。治理层不断证明它独立于项目也有价值——每个 AI 辅助开发的项目都需要它,不只是我们的。
126
-
127
- 这里的每一条 hook、每一个 gate、每一种隔离模式,都是因为 AI agent 找到了创造性的方法来绕过上一条规则,所以才被加上的。不是设计出来的,是被逼出来的。
128
-
129
- ## License
130
-
131
- MIT
@@ -1,20 +0,0 @@
1
- {
2
- "name": "bollharness",
3
- "version": "1.0.0",
4
- "description": "AI Agent Session Governance Framework - TypeScript implementation",
5
- "main": "dist/index.js",
6
- "types": "dist/index.d.ts",
7
- "scripts": {
8
- "build": "tsc",
9
- "watch": "tsc --watch",
10
- "lint": "eslint src --ext .ts",
11
- "typecheck": "tsc --noEmit"
12
- },
13
- "keywords": ["claude-code", "agent-governance", "hooks"],
14
- "license": "MIT",
15
- "dependencies": {},
16
- "devDependencies": {
17
- "@types/node": "^20.0.0",
18
- "typescript": "^5.3.0"
19
- }
20
- }
@@ -1,3 +0,0 @@
1
- # README
2
-
3
- This directory is for reference purposes - it contains a snapshot from the Towow project for historical reference.
@@ -1,12 +0,0 @@
1
- {
2
- "mode": "strict",
3
- "files_scanned": 14,
4
- "totals": {
5
- "SECRET": 0,
6
- "TRADE_SECRET": 0,
7
- "PII": 0,
8
- "NETWORK": 0,
9
- "PROTOCOL_INTERNAL": 0
10
- },
11
- "records": []
12
- }
@@ -1,27 +0,0 @@
1
- #!/bin/bash
2
- # Walks up from $PWD to find the boll repo root.
3
- # Identifies it by presence of BOTH CLAUDE.md and scripts/guard-feedback.py.
4
- # This handles nested git repos (e.g. boll-progress/) that would confuse
5
- # `git rev-parse --show-toplevel`.
6
- #
7
- # Prints the absolute path to stdout. Exits 1 if not found.
8
- set -e
9
- d="${PWD}"
10
- while [ "$d" != "/" ] && [ -n "$d" ]; do
11
- if [ -f "$d/CLAUDE.md" ] && [ -f "$d/scripts/guard-feedback.py" ]; then
12
- echo "$d"
13
- exit 0
14
- fi
15
- d="$(dirname "$d")"
16
- done
17
- # Fallback: check if CLAUDE_PROJECT_DIR is set by Claude Code
18
- if [ -n "${CLAUDE_PROJECT_DIR:-}" ] && [ -f "${CLAUDE_PROJECT_DIR}/scripts/guard-feedback.py" ]; then
19
- echo "${CLAUDE_PROJECT_DIR}"
20
- exit 0
21
- fi
22
- # Final hardcoded fallback (this machine)
23
- if [ -f "/Users/nature/个人项目/boll/scripts/guard-feedback.py" ]; then
24
- echo "/Users/nature/个人项目/boll"
25
- exit 0
26
- fi
27
- exit 1
@@ -1,57 +0,0 @@
1
- #!/bin/bash
2
- # PreCompact hook: 注入必须在 context compaction 中保留的关键信息
3
- # [来源: ADR-038 D2.3 + D9 (v4 Objective Recitation), CC PreCompact hook — exit 0 追加为 compact 指令]
4
-
5
- # 读取当前活跃的 PLAN/TASK/Issue 状态
6
- REPO_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
7
-
8
- cat <<'PRESERVE'
9
- ## 必须保留的关键信息
10
-
11
- ### 当前工作上下文
12
- - 保留当前正在进行的 PLAN/TASK/Issue 的完整状态和进度
13
- - 保留 Sprint Contract(如果有)的全部验收标准
14
- - 保留当前 WP 的 scope 和验收条件
15
-
16
- ### 不可降级规则 (ADR-030 核心)
17
- - Guard > Memory: 能机械化检测的必须写 guard
18
- - 一个事实一个定义: 同一信息不得在多处重复定义
19
- - 验证看最后一公里: 验证必须到达用户可观测的终点
20
-
21
- ### 行为约束
22
- - 所有 commit message 必须中英双语
23
- - 所有 subagent 必须使用 claude-opus-4-6
24
- - 不得跳过 Gate 2/4/6/8 审查
25
- - Issue 先于代码: 改代码前必须先创建 issue 文档
26
- PRESERVE
27
-
28
- # ── v4 D9: Objective Recitation ──
29
- # [来源: Manus/IMPACT — recite objectives at end of context after ~50 tool calls]
30
- # [来源: Cursor — 丢失 reasoning traces 导致 30% 性能下降]
31
- # 在 compact 后的新上下文末尾追加原始目标,防止注意力漂移。
32
- # KV cache 友好——只追加到末尾,不重排前文。
33
- PROGRESS_FILE="$REPO_ROOT/.boll/progress/current.json"
34
- if [ -f "$PROGRESS_FILE" ]; then
35
- echo ""
36
- echo "## Objective Recitation (v4 D9)"
37
- echo ""
38
- echo "**原始目标**(不可漂移,由 D8 Initializer Agent 写入后 read-only):"
39
- python3 -c "
40
- import json, sys
41
- try:
42
- data = json.load(open('$PROGRESS_FILE'))
43
- print(f\" {data.get('objective', '<未设置>')}\")
44
- print()
45
- pending = [f for f in data.get('features', []) if f.get('status') != 'passing']
46
- if pending:
47
- print('**未完成 features**:')
48
- for f in pending:
49
- print(f\" - [{f.get('status', '?')}] {f.get('id', '?')}: {f.get('subject', '')}\")
50
- else:
51
- print('**所有 features 已 passing**,可以进入 Stop 流程。')
52
- except Exception as e:
53
- print(f' <progress.json 解析失败: {e}>')
54
- " 2>&1
55
- fi
56
-
57
- exit 0
@@ -1,57 +0,0 @@
1
- # Stop Hook: PreCompletionChecklist + On-Demand Evaluator
2
-
3
- 你是独立 Evaluator。你的工作是在 agent 完成任务前验证工作质量。
4
-
5
- ## PreCompletionChecklist
6
-
7
- 在允许完成前,逐条验证:
8
-
9
- 1. **Git 状态**: 所有新文件是否已 `git add`?是否有未保存的变更?
10
- 2. **测试**: 如果有代码变更,相关测试是否通过?运行 `backend/venv/bin/pytest -q backend/tests/unit --tb=no -q` 确认。
11
- 3. **文档一致性**: 代码变更是否需要更新文档?路由变更是否反映在路由表中?
12
- 4. **无半成品**: 是否有 TODO/FIXME/HACK 被遗留?是否有 dead code 或未使用的 import?
13
- 5. **契约一致性**: API 类型、路由路径、配置 key 是否在所有引用处一致?
14
-
15
- ## On-Demand Evaluator
16
-
17
- 如果当前任务 scope >= 3 files 或涉及 API 契约变更,额外执行 Grading Criteria 评估:
18
-
19
- | 维度 | 检查点 |
20
- |------|--------|
21
- | **Design Quality** | 架构是否合理?是否利用了现有模式? |
22
- | **Originality** | 是否超越模板化实现? |
23
- | **Craft** | 代码清洁、命名一致、边界处理、无 AI slop |
24
- | **Functionality** | 核心路径可走通、契约一致、无断裂 |
25
-
26
- 每维 1-5 分。**硬阈值: 任何维 < 3 = FAIL**。
27
-
28
- ## 重要警告
29
-
30
- 你天然倾向于"识别问题后说服自己不是大问题"。**抵抗这个倾向。**
31
-
32
- 具体表现:
33
- - "代码看起来正确" — 不够,要实际验证
34
- - "测试已经通过了" — 哪些测试?覆盖了变更吗?
35
- - "这个小问题不影响功能" — 小问题累积成大问题
36
-
37
- **如果不确定,判为 FAIL。宁严勿松。**
38
-
39
- ## 输出格式
40
-
41
- ```
42
- ## PreCompletionChecklist
43
- - [x/!] Git 状态: ...
44
- - [x/!] 测试: ...
45
- - [x/!] 文档一致性: ...
46
- - [x/!] 无半成品: ...
47
- - [x/!] 契约一致性: ...
48
-
49
- ## Evaluator (如果触发)
50
- Design Quality: X/5
51
- Originality: X/5
52
- Craft: X/5
53
- Functionality: X/5
54
-
55
- ## 裁决: PASS / FAIL
56
- 原因: ...
57
- ```
@@ -1,67 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://bollharness.dev/schemas/metrics-jsonl-allowlist.json",
4
- "title": "bollharness metrics jsonl field allowlist",
5
- "description": "Allowed top-level fields for every line in .boll/state/metrics/*.jsonl. scan_verify_artifacts.ts --metrics rejects any line containing a key not listed here. Tightening this allowlist is the primary defense against accidental PII / SECRET leakage via metrics sinks (v2 patch_4 / security P1#4).",
6
- "type": "object",
7
- "additionalProperties": false,
8
- "required": ["ts", "event"],
9
- "properties": {
10
- "ts": {
11
- "description": "Event timestamp (ISO-8601 string or epoch-seconds number).",
12
- "type": ["string", "number"]
13
- },
14
- "event": {
15
- "description": "Short event name, e.g. guard_fired / hook_failed / rebaseline_required.",
16
- "type": "string"
17
- },
18
- "stage": {
19
- "description": "Claude Code hook stage (PreToolUse / PostToolUse / SessionStart / ...).",
20
- "type": "string"
21
- },
22
- "tool": {
23
- "description": "Tool name if applicable (Edit / Write / Bash / Task / ...).",
24
- "type": "string"
25
- },
26
- "matcher": {
27
- "description": "Hook matcher that routed the event.",
28
- "type": "string"
29
- },
30
- "hook": {
31
- "description": "Hook script basename (e.g. guard-feedback.ts).",
32
- "type": "string"
33
- },
34
- "outcome": {
35
- "description": "allow / block / warn / noop / error.",
36
- "type": "string"
37
- },
38
- "exit_code": {
39
- "type": "integer"
40
- },
41
- "duration_ms": {
42
- "type": "number"
43
- },
44
- "file_path": {
45
- "description": "Relative path of the edited / read file, if applicable.",
46
- "type": "string"
47
- },
48
- "category": {
49
- "description": "Sanitize category (SECRET / TRADE_SECRET / PII / NETWORK / PROTOCOL_INTERNAL).",
50
- "type": "string"
51
- },
52
- "reason": {
53
- "description": "Short human-readable reason; must not contain raw secret material.",
54
- "type": "string"
55
- },
56
- "session_id": {
57
- "description": "Claude Code session id.",
58
- "type": "string"
59
- },
60
- "project_root": {
61
- "type": "string"
62
- },
63
- "schema_version": {
64
- "type": "string"
65
- }
66
- }
67
- }
@@ -1,48 +0,0 @@
1
- #!/bin/sh
2
- # 起草 ADR / PLAN 时给出下一个可用号(与 pre-commit numbering check 对齐).
3
- #
4
- # 用法:
5
- # scripts/checks/next_decision_number.sh ADR
6
- # scripts/checks/next_decision_number.sh PLAN
7
- #
8
- # 来源: H 系列收尾 + Nature feedback "plan/adr 序号老是容易重复".
9
-
10
- set -e
11
-
12
- KIND="${1:-}"
13
- case "$KIND" in
14
- ADR|PLAN) ;;
15
- *)
16
- echo "Usage: $0 {ADR|PLAN}" >&2
17
- exit 2
18
- ;;
19
- esac
20
-
21
- REPO_ROOT="$(git rev-parse --show-toplevel 2>/dev/null)"
22
- if [ -z "$REPO_ROOT" ]; then
23
- echo "Not in a git repo." >&2
24
- exit 2
25
- fi
26
-
27
- cd "$REPO_ROOT"
28
-
29
- DECISIONS_DIR="docs/decisions"
30
- if [ ! -d "$DECISIONS_DIR" ]; then
31
- echo "No $DECISIONS_DIR/ found." >&2
32
- exit 2
33
- fi
34
-
35
- # 取所有非 H 系列 ADR/PLAN-NNN 主号(剥落字母 sub-id),找最大值 +1
36
- MAX=$(ls "$DECISIONS_DIR" 2>/dev/null \
37
- | grep -E "^${KIND}-[0-9]{3}[A-Z]?-" \
38
- | grep -vE '^(ADR|PLAN)-H[0-9]+-' \
39
- | sed -E "s/^${KIND}-([0-9]{3})[A-Z]?-.*/\1/" \
40
- | sort -n | tail -1)
41
-
42
- if [ -z "$MAX" ]; then
43
- NEXT=1
44
- else
45
- NEXT=$((10#$MAX + 1))
46
- fi
47
-
48
- printf "%s-%03d\n" "$KIND" "$NEXT"