@bolloon/bolloon-agent 0.1.36 → 0.1.38

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 (518) hide show
  1. package/package.json +2 -2
  2. package/.auto-evolve-calls +0 -1
  3. package/.last-auto-evolve-baseline +0 -1
  4. package/.playwright-mcp/page-2026-06-16T07-51-45-706Z.yml +0 -130
  5. package/.playwright-mcp/page-2026-06-16T07-56-44-116Z.yml +0 -131
  6. package/Bolloon.md +0 -144
  7. package/Dive-into/CITATION.cff +0 -17
  8. package/Dive-into/LICENSE +0 -25
  9. package/Dive-into/README.md +0 -598
  10. package/Dive-into/README_zh.md +0 -599
  11. package/Dive-into/assets/context.png +0 -0
  12. package/Dive-into/assets/extensibility.png +0 -0
  13. package/Dive-into/assets/iteration.png +0 -0
  14. package/Dive-into/assets/layered_architecture.png +0 -0
  15. package/Dive-into/assets/main_structure.png +0 -0
  16. package/Dive-into/assets/permission.png +0 -0
  17. package/Dive-into/assets/session_compact.png +0 -0
  18. package/Dive-into/assets/subagent.png +0 -0
  19. package/Dive-into/paper/Dive_into_Claude_Code.pdf +0 -0
  20. package/dist/agents/constraint-layer.js.map +0 -1
  21. package/dist/agents/pi-sdk.js.map +0 -1
  22. package/dist/agents/workflow-engine.js.map +0 -1
  23. package/dist/bollharness/src/index.js +0 -5
  24. package/dist/bollharness/src/scripts/checks/check_adr_plan_numbering.js +0 -6
  25. package/dist/bollharness/src/scripts/checks/check_api_types.js +0 -45
  26. package/dist/bollharness/src/scripts/checks/check_artifact_link.js +0 -146
  27. package/dist/bollharness/src/scripts/checks/check_bridge_deps.js +0 -6
  28. package/dist/bollharness/src/scripts/checks/check_bugfix_binding.js +0 -6
  29. package/dist/bollharness/src/scripts/checks/check_bugfix_binding_ci.js +0 -6
  30. package/dist/bollharness/src/scripts/checks/check_doc_file_references.js +0 -6
  31. package/dist/bollharness/src/scripts/checks/check_doc_freshness.js +0 -135
  32. package/dist/bollharness/src/scripts/checks/check_doc_links.js +0 -31
  33. package/dist/bollharness/src/scripts/checks/check_file_existence_claims.js +0 -6
  34. package/dist/bollharness/src/scripts/checks/check_fragment_integrity.js +0 -34
  35. package/dist/bollharness/src/scripts/checks/check_hook_installed.js +0 -63
  36. package/dist/bollharness/src/scripts/checks/check_issue_closure.js +0 -41
  37. package/dist/bollharness/src/scripts/checks/check_mcp_parity.js +0 -6
  38. package/dist/bollharness/src/scripts/checks/check_security.js +0 -48
  39. package/dist/bollharness/src/scripts/checks/check_skill_parity.js +0 -6
  40. package/dist/bollharness/src/scripts/checks/check_versions.js +0 -6
  41. package/dist/bollharness/src/scripts/checks/finding.js +0 -13
  42. package/dist/bollharness/src/scripts/checks/next_decision_number.js +0 -20
  43. package/dist/bollharness/src/scripts/checks/regenerate_magic_docs.js +0 -6
  44. package/dist/bollharness/src/scripts/ci/detect_rebaseline_triggers.js +0 -8
  45. package/dist/bollharness/src/scripts/ci/scan_subprocess_cfg.js +0 -8
  46. package/dist/bollharness/src/scripts/ci/scan_verify_artifacts.js +0 -8
  47. package/dist/bollharness/src/scripts/ci/scan_yaml_schema.js +0 -8
  48. package/dist/bollharness/src/scripts/context_router.js +0 -67
  49. package/dist/bollharness/src/scripts/deploy-guard.js +0 -157
  50. package/dist/bollharness/src/scripts/guard-feedback.js +0 -192
  51. package/dist/bollharness/src/scripts/guard_router.js +0 -158
  52. package/dist/bollharness/src/scripts/hooks/_hook_output.js +0 -6
  53. package/dist/bollharness/src/scripts/hooks/auto-python3.js +0 -6
  54. package/dist/bollharness/src/scripts/hooks/deploy-progress-on-session-end.js +0 -6
  55. package/dist/bollharness/src/scripts/hooks/failure-analyzer.js +0 -6
  56. package/dist/bollharness/src/scripts/hooks/gate-judgment-inject.js +0 -92
  57. package/dist/bollharness/src/scripts/hooks/gate-transition-judgment.js +0 -63
  58. package/dist/bollharness/src/scripts/hooks/inbox-ack.js +0 -6
  59. package/dist/bollharness/src/scripts/hooks/inbox-inject-on-start.js +0 -6
  60. package/dist/bollharness/src/scripts/hooks/inbox-validate.js +0 -6
  61. package/dist/bollharness/src/scripts/hooks/inbox-write-ledger.js +0 -6
  62. package/dist/bollharness/src/scripts/hooks/initializer-agent.js +0 -6
  63. package/dist/bollharness/src/scripts/hooks/loop-detection.js +0 -73
  64. package/dist/bollharness/src/scripts/hooks/owner-guard.js +0 -6
  65. package/dist/bollharness/src/scripts/hooks/precompact.js +0 -6
  66. package/dist/bollharness/src/scripts/hooks/review-agent-gatekeeper.js +0 -6
  67. package/dist/bollharness/src/scripts/hooks/risk-tracker.js +0 -108
  68. package/dist/bollharness/src/scripts/hooks/sanitize-on-read.js +0 -6
  69. package/dist/bollharness/src/scripts/hooks/session-reflection.js +0 -7
  70. package/dist/bollharness/src/scripts/hooks/session-start-magic-docs.js +0 -7
  71. package/dist/bollharness/src/scripts/hooks/session-start-reset-risk.js +0 -7
  72. package/dist/bollharness/src/scripts/hooks/session-start-toolkit-reminder.js +0 -7
  73. package/dist/bollharness/src/scripts/hooks/stop-evaluator.js +0 -157
  74. package/dist/bollharness/src/scripts/hooks/tool-call-counter.js +0 -6
  75. package/dist/bollharness/src/scripts/hooks/trace-analyzer.js +0 -10
  76. package/dist/bollharness/src/scripts/install/install-trust-token.js +0 -7
  77. package/dist/bollharness/src/scripts/install/multi_project_registry.js +0 -9
  78. package/dist/bollharness/src/scripts/install/phase2_auto.js +0 -21
  79. package/dist/bollharness/src/scripts/install/pre_commit_installer.js +0 -6
  80. package/dist/bollharness/src/scripts/install/tier_selector.js +0 -7
  81. package/dist/bollharness/src/scripts/install/transcript_miner.js +0 -7
  82. package/dist/bollharness/src/scripts/lib/claim_patterns.js +0 -10
  83. package/dist/bollharness/src/scripts/lib/sanitize_patterns.js +0 -12
  84. package/dist/bollharness/src/scripts/sanitize.js +0 -6
  85. package/dist/bollharness-integration/context-router-judgment.js.map +0 -1
  86. package/dist/bollharness-integration/context-router.js.map +0 -1
  87. package/dist/bollharness-integration/gate-state-machine.js.map +0 -1
  88. package/dist/bollharness-integration/gate-transition-hooks.js.map +0 -1
  89. package/dist/bollharness-integration/guard-checker.js.map +0 -1
  90. package/dist/bollharness-integration/index.js.map +0 -1
  91. package/dist/bollharness-integration/integration.js.map +0 -1
  92. package/dist/bollharness-integration/llm/pi-ai.d.ts +0 -60
  93. package/dist/bollharness-integration/pi-ecosystem-colony/index.d.ts +0 -153
  94. package/dist/bollharness-integration/pi-ecosystem-goals/index.d.ts +0 -136
  95. package/dist/bollharness-integration/pi-ecosystem-judgment/decision.d.ts +0 -117
  96. package/dist/bollharness-integration/pi-ecosystem-judgment/distillation.d.ts +0 -78
  97. package/dist/bollharness-integration/pi-ecosystem-judgment/index.d.ts +0 -139
  98. package/dist/bollharness-integration/pi-ecosystem-mcp/index.d.ts +0 -127
  99. package/dist/bollharness-integration/pi-ecosystem-subagents/index.d.ts +0 -95
  100. package/dist/bollharness-integration/skill-adapter.js.map +0 -1
  101. package/dist/constraint-runtime/src/_archive_helper.js +0 -9
  102. package/dist/constraint-runtime/src/agent/coordinator.js +0 -48
  103. package/dist/constraint-runtime/src/agent/index.js +0 -1
  104. package/dist/constraint-runtime/src/assistant/index.js +0 -12
  105. package/dist/constraint-runtime/src/bootstrap/index.js +0 -12
  106. package/dist/constraint-runtime/src/bootstrap_graph.js +0 -13
  107. package/dist/constraint-runtime/src/bridge/index.js +0 -12
  108. package/dist/constraint-runtime/src/buddy/index.js +0 -12
  109. package/dist/constraint-runtime/src/cli/index.js +0 -12
  110. package/dist/constraint-runtime/src/command_graph.js +0 -10
  111. package/dist/constraint-runtime/src/commands.js +0 -60
  112. package/dist/constraint-runtime/src/components/index.js +0 -12
  113. package/dist/constraint-runtime/src/constants/index.js +0 -12
  114. package/dist/constraint-runtime/src/constraint/budget.js +0 -22
  115. package/dist/constraint-runtime/src/constraint/budget.js.map +0 -1
  116. package/dist/constraint-runtime/src/constraint/index.js +0 -2
  117. package/dist/constraint-runtime/src/constraint/permission.js +0 -20
  118. package/dist/constraint-runtime/src/constraint/permission.js.map +0 -1
  119. package/dist/constraint-runtime/src/context.js +0 -30
  120. package/dist/constraint-runtime/src/coordinator/index.js +0 -12
  121. package/dist/constraint-runtime/src/cost_hook.js +0 -4
  122. package/dist/constraint-runtime/src/cost_tracker.js +0 -8
  123. package/dist/constraint-runtime/src/deferred_init.js +0 -10
  124. package/dist/constraint-runtime/src/direct_modes.js +0 -6
  125. package/dist/constraint-runtime/src/dynamic-tool-loader.js +0 -85
  126. package/dist/constraint-runtime/src/entrypoints/index.js +0 -12
  127. package/dist/constraint-runtime/src/execution_registry.js +0 -44
  128. package/dist/constraint-runtime/src/history.js +0 -9
  129. package/dist/constraint-runtime/src/hooks/index.js +0 -12
  130. package/dist/constraint-runtime/src/index.js +0 -26
  131. package/dist/constraint-runtime/src/ink.js +0 -4
  132. package/dist/constraint-runtime/src/keybindings/index.js +0 -12
  133. package/dist/constraint-runtime/src/memdir/index.js +0 -12
  134. package/dist/constraint-runtime/src/migrations/index.js +0 -12
  135. package/dist/constraint-runtime/src/models.js +0 -1
  136. package/dist/constraint-runtime/src/models.js.map +0 -1
  137. package/dist/constraint-runtime/src/moreright/index.js +0 -12
  138. package/dist/constraint-runtime/src/native_ts/index.js +0 -12
  139. package/dist/constraint-runtime/src/output_styles/index.js +0 -12
  140. package/dist/constraint-runtime/src/parity_audit.js +0 -12
  141. package/dist/constraint-runtime/src/plugins/index.js +0 -12
  142. package/dist/constraint-runtime/src/port_manifest.js +0 -11
  143. package/dist/constraint-runtime/src/prefetch.js +0 -9
  144. package/dist/constraint-runtime/src/query.js +0 -1
  145. package/dist/constraint-runtime/src/remote/index.js +0 -12
  146. package/dist/constraint-runtime/src/remote_runtime.js +0 -9
  147. package/dist/constraint-runtime/src/runtime/index.js +0 -1
  148. package/dist/constraint-runtime/src/runtime/session.js +0 -35
  149. package/dist/constraint-runtime/src/schemas/index.js +0 -12
  150. package/dist/constraint-runtime/src/screens/index.js +0 -12
  151. package/dist/constraint-runtime/src/server/index.js +0 -12
  152. package/dist/constraint-runtime/src/services/index.js +0 -12
  153. package/dist/constraint-runtime/src/session_store.js +0 -22
  154. package/dist/constraint-runtime/src/setup.js +0 -30
  155. package/dist/constraint-runtime/src/skills/index.js +0 -1
  156. package/dist/constraint-runtime/src/skills/skill-registry.js +0 -28
  157. package/dist/constraint-runtime/src/state/index.js +0 -12
  158. package/dist/constraint-runtime/src/system_init.js +0 -20
  159. package/dist/constraint-runtime/src/thinking/engine.js +0 -42
  160. package/dist/constraint-runtime/src/thinking/index.js +0 -1
  161. package/dist/constraint-runtime/src/tool_pool.js +0 -8
  162. package/dist/constraint-runtime/src/tools/OpenCLI/execAdapter.js +0 -7
  163. package/dist/constraint-runtime/src/tools/OpenCLI/listAdapters.js +0 -7
  164. package/dist/constraint-runtime/src/tools/OpenCLI/runCommand.js +0 -7
  165. package/dist/constraint-runtime/src/tools/PolymarketSDK/cancelOrder.js +0 -6
  166. package/dist/constraint-runtime/src/tools/PolymarketSDK/createOrder.js +0 -6
  167. package/dist/constraint-runtime/src/tools/PolymarketSDK/getMarket.js +0 -5
  168. package/dist/constraint-runtime/src/tools/PolymarketSDK/getOrders.js +0 -6
  169. package/dist/constraint-runtime/src/tools/PolymarketSDK/listMarkets.js +0 -4
  170. package/dist/constraint-runtime/src/tools/SafeSDK/confirmTransaction.js +0 -6
  171. package/dist/constraint-runtime/src/tools/SafeSDK/createTransaction.js +0 -8
  172. package/dist/constraint-runtime/src/tools/SafeSDK/deploySafe.js +0 -6
  173. package/dist/constraint-runtime/src/tools/SafeSDK/executeTransaction.js +0 -6
  174. package/dist/constraint-runtime/src/tools/SafeSDK/getBalance.js +0 -6
  175. package/dist/constraint-runtime/src/tools/SafeSDK/getPendingTransactions.js +0 -6
  176. package/dist/constraint-runtime/src/tools/SafeSDK/proposeTransaction.js +0 -6
  177. package/dist/constraint-runtime/src/tools/WalletTools/autoPay.js +0 -29
  178. package/dist/constraint-runtime/src/tools/WalletTools/createWallet.js +0 -10
  179. package/dist/constraint-runtime/src/tools/WalletTools/getBalance.js +0 -13
  180. package/dist/constraint-runtime/src/tools/WalletTools/importWallet.js +0 -22
  181. package/dist/constraint-runtime/src/tools/WalletTools/sendTransaction.js +0 -25
  182. package/dist/constraint-runtime/src/tools/WalletTools/signMessage.js +0 -10
  183. package/dist/constraint-runtime/src/tools/WalletTools/transferToken.js +0 -25
  184. package/dist/constraint-runtime/src/tools.js +0 -80
  185. package/dist/constraint-runtime/src/transcript.js +0 -19
  186. package/dist/constraint-runtime/src/types/index.js +0 -12
  187. package/dist/constraint-runtime/src/upstream_proxy/index.js +0 -12
  188. package/dist/constraint-runtime/src/utils/index.js +0 -12
  189. package/dist/constraint-runtime/src/vim/index.js +0 -12
  190. package/dist/constraint-runtime/src/voice/index.js +0 -12
  191. package/dist/constraints/index.js.map +0 -1
  192. package/dist/documents/reader.js.map +0 -1
  193. package/dist/llm/config-store.js.map +0 -1
  194. package/dist/llm/pi-ai.js.map +0 -1
  195. package/dist/network/agent-network.js.map +0 -1
  196. package/dist/network/iroh-integration.js.map +0 -1
  197. package/dist/network/iroh-transport.js.map +0 -1
  198. package/dist/network/p2p.js.map +0 -1
  199. package/dist/network/storage/adapters/json-adapter.js.map +0 -1
  200. package/dist/pi-ecosystem-colony/index.js.map +0 -1
  201. package/dist/pi-ecosystem-goals/index.js.map +0 -1
  202. package/dist/pi-ecosystem-judgment/decision.js.map +0 -1
  203. package/dist/pi-ecosystem-judgment/distillation.js.map +0 -1
  204. package/dist/pi-ecosystem-judgment/human-value-store.js.map +0 -1
  205. package/dist/pi-ecosystem-judgment/index.js.map +0 -1
  206. package/dist/pi-ecosystem-judgment/value-injection.js.map +0 -1
  207. package/dist/pi-ecosystem-mcp/index.js.map +0 -1
  208. package/dist/pi-ecosystem-subagents/index.js.map +0 -1
  209. package/dist/social/ant-colony/AdaptiveHeartbeat.js.map +0 -1
  210. package/dist/social/ant-colony/PheromoneEngine.js.map +0 -1
  211. package/dist/social/ant-colony/types.js.map +0 -1
  212. package/dist/social/channels/ChannelManager.js.map +0 -1
  213. package/dist/social/channels/DiapChannelBridge.js.map +0 -1
  214. package/dist/social/channels/InterestMatcher.js.map +0 -1
  215. package/dist/social/channels/types.js.map +0 -1
  216. package/dist/social/global-shared-context.js.map +0 -1
  217. package/dist/social/heartbeat.js.map +0 -1
  218. package/lefthook.yml +0 -33
  219. package/scripts/auto-evolve-loop.ts +0 -481
  220. package/scripts/build-web.ts +0 -116
  221. package/scripts/diff-reviewer.ts +0 -159
  222. package/scripts/validate-system-prompt.ts +0 -142
  223. package/scripts/weekly-report.ts +0 -364
  224. package/src/agents/agent-manifest-protocol.ts +0 -117
  225. package/src/agents/constraint-layer.ts +0 -309
  226. package/src/agents/iroh-secret.ts +0 -32
  227. package/src/agents/p2p-chat-tools.ts +0 -383
  228. package/src/agents/p2p-document-tools.ts +0 -347
  229. package/src/agents/permission-mode.ts +0 -127
  230. package/src/agents/pi-sdk.ts +0 -2895
  231. package/src/agents/pre-tool-validator.ts +0 -213
  232. package/src/agents/protocol.ts +0 -398
  233. package/src/agents/shell-guard.ts +0 -417
  234. package/src/agents/shell-tool.ts +0 -103
  235. package/src/agents/skill-loader.ts +0 -202
  236. package/src/agents/subagent-manager.ts +0 -553
  237. package/src/agents/workflow-engine.ts +0 -332
  238. package/src/agents/workflow-pivot-loop.ts +0 -766
  239. package/src/bollharness/.sanitize-report.json +0 -13
  240. package/src/bollharness/CLAUDE.md +0 -73
  241. package/src/bollharness/LICENSE +0 -21
  242. package/src/bollharness/README.md +0 -143
  243. package/src/bollharness/README.zh-CN.md +0 -131
  244. package/src/bollharness/package.json +0 -20
  245. package/src/bollharness/reference/SOURCE-COMMIT.txt +0 -3
  246. package/src/bollharness/reference/boll-reference/scripts/hooks/.sanitize-report.json +0 -12
  247. package/src/bollharness/reference/boll-reference/scripts/hooks/find-boll-root.sh +0 -27
  248. package/src/bollharness/reference/boll-reference/scripts/hooks/precompact.sh +0 -57
  249. package/src/bollharness/reference/boll-reference/scripts/hooks/stop-evaluator.md +0 -57
  250. package/src/bollharness/schemas/metrics-jsonl-allowlist.json +0 -67
  251. package/src/bollharness/scripts/checks/next_decision_number.sh +0 -48
  252. package/src/bollharness/scripts/ci/count-components.sh +0 -65
  253. package/src/bollharness/scripts/context-fragments/artifact-linkage.md +0 -14
  254. package/src/bollharness/scripts/context-fragments/auth-consumers.md +0 -17
  255. package/src/bollharness/scripts/context-fragments/bridge-constitution.md +0 -13
  256. package/src/bollharness/scripts/context-fragments/catalyst-distributed.md +0 -18
  257. package/src/bollharness/scripts/context-fragments/closure-checklist.md +0 -13
  258. package/src/bollharness/scripts/context-fragments/contract-consumers.md +0 -15
  259. package/src/bollharness/scripts/context-fragments/db-shared-structures.md +0 -15
  260. package/src/bollharness/scripts/context-fragments/fixed-three-layers.md +0 -19
  261. package/src/bollharness/scripts/context-fragments/general-dev-principles.md +0 -11
  262. package/src/bollharness/scripts/context-fragments/issue-first.md +0 -8
  263. package/src/bollharness/scripts/context-fragments/mcp-parity.md +0 -16
  264. package/src/bollharness/scripts/context-fragments/pi-agent-operations.md +0 -108
  265. package/src/bollharness/scripts/context-fragments/protocol-consumers.md +0 -15
  266. package/src/bollharness/scripts/context-fragments/run-events-consumers.md +0 -15
  267. package/src/bollharness/scripts/context-fragments/scene-fidelity.md +0 -13
  268. package/src/bollharness/scripts/context-fragments/truth-source-hierarchy.md +0 -15
  269. package/src/bollharness/scripts/context-fragments/two-language.md +0 -15
  270. package/src/bollharness/scripts/context-fragments/version-sources.md +0 -14
  271. package/src/bollharness/scripts/hooks/find-project-root.sh +0 -47
  272. package/src/bollharness/scripts/hooks/inbox-poll.sh +0 -78
  273. package/src/bollharness/scripts/hooks/precompact.sh +0 -56
  274. package/src/bollharness/scripts/hooks/stop-evaluator.md +0 -83
  275. package/src/bollharness/scripts/sync-from-upstream.sh +0 -281
  276. package/src/bollharness/src/index.ts +0 -5
  277. package/src/bollharness/src/scripts/checks/check_adr_plan_numbering.ts +0 -11
  278. package/src/bollharness/src/scripts/checks/check_api_types.ts +0 -52
  279. package/src/bollharness/src/scripts/checks/check_artifact_link.ts +0 -156
  280. package/src/bollharness/src/scripts/checks/check_bridge_deps.ts +0 -11
  281. package/src/bollharness/src/scripts/checks/check_bugfix_binding.ts +0 -11
  282. package/src/bollharness/src/scripts/checks/check_bugfix_binding_ci.ts +0 -11
  283. package/src/bollharness/src/scripts/checks/check_doc_file_references.ts +0 -11
  284. package/src/bollharness/src/scripts/checks/check_doc_freshness.ts +0 -141
  285. package/src/bollharness/src/scripts/checks/check_doc_links.ts +0 -36
  286. package/src/bollharness/src/scripts/checks/check_file_existence_claims.ts +0 -11
  287. package/src/bollharness/src/scripts/checks/check_fragment_integrity.ts +0 -40
  288. package/src/bollharness/src/scripts/checks/check_hook_installed.ts +0 -70
  289. package/src/bollharness/src/scripts/checks/check_issue_closure.ts +0 -51
  290. package/src/bollharness/src/scripts/checks/check_mcp_parity.ts +0 -11
  291. package/src/bollharness/src/scripts/checks/check_security.ts +0 -54
  292. package/src/bollharness/src/scripts/checks/check_skill_parity.ts +0 -11
  293. package/src/bollharness/src/scripts/checks/check_versions.ts +0 -11
  294. package/src/bollharness/src/scripts/checks/finding.ts +0 -35
  295. package/src/bollharness/src/scripts/checks/next_decision_number.ts +0 -24
  296. package/src/bollharness/src/scripts/checks/regenerate_magic_docs.ts +0 -11
  297. package/src/bollharness/src/scripts/ci/detect_rebaseline_triggers.ts +0 -14
  298. package/src/bollharness/src/scripts/ci/scan_subprocess_cfg.ts +0 -14
  299. package/src/bollharness/src/scripts/ci/scan_verify_artifacts.ts +0 -14
  300. package/src/bollharness/src/scripts/ci/scan_yaml_schema.ts +0 -14
  301. package/src/bollharness/src/scripts/context_router.ts +0 -76
  302. package/src/bollharness/src/scripts/deploy-guard.ts +0 -182
  303. package/src/bollharness/src/scripts/guard-feedback.ts +0 -215
  304. package/src/bollharness/src/scripts/guard_router.ts +0 -194
  305. package/src/bollharness/src/scripts/hooks/_hook_output.js +0 -3
  306. package/src/bollharness/src/scripts/hooks/_hook_output.ts +0 -11
  307. package/src/bollharness/src/scripts/hooks/auto-python3.ts +0 -10
  308. package/src/bollharness/src/scripts/hooks/deploy-progress-on-session-end.ts +0 -10
  309. package/src/bollharness/src/scripts/hooks/failure-analyzer.ts +0 -10
  310. package/src/bollharness/src/scripts/hooks/gate-judgment-inject.ts +0 -111
  311. package/src/bollharness/src/scripts/hooks/gate-transition-judgment.ts +0 -74
  312. package/src/bollharness/src/scripts/hooks/inbox-ack.ts +0 -10
  313. package/src/bollharness/src/scripts/hooks/inbox-inject-on-start.ts +0 -10
  314. package/src/bollharness/src/scripts/hooks/inbox-validate.ts +0 -10
  315. package/src/bollharness/src/scripts/hooks/inbox-write-ledger.ts +0 -10
  316. package/src/bollharness/src/scripts/hooks/initializer-agent.ts +0 -10
  317. package/src/bollharness/src/scripts/hooks/loop-detection.ts +0 -83
  318. package/src/bollharness/src/scripts/hooks/owner-guard.ts +0 -10
  319. package/src/bollharness/src/scripts/hooks/precompact.ts +0 -10
  320. package/src/bollharness/src/scripts/hooks/review-agent-gatekeeper.ts +0 -10
  321. package/src/bollharness/src/scripts/hooks/risk-tracker.ts +0 -121
  322. package/src/bollharness/src/scripts/hooks/sanitize-on-read.ts +0 -10
  323. package/src/bollharness/src/scripts/hooks/session-reflection.ts +0 -12
  324. package/src/bollharness/src/scripts/hooks/session-start-magic-docs.ts +0 -12
  325. package/src/bollharness/src/scripts/hooks/session-start-reset-risk.ts +0 -12
  326. package/src/bollharness/src/scripts/hooks/session-start-toolkit-reminder.ts +0 -12
  327. package/src/bollharness/src/scripts/hooks/stop-evaluator.ts +0 -164
  328. package/src/bollharness/src/scripts/hooks/tool-call-counter.ts +0 -10
  329. package/src/bollharness/src/scripts/hooks/trace-analyzer.ts +0 -14
  330. package/src/bollharness/src/scripts/install/install-trust-token.ts +0 -13
  331. package/src/bollharness/src/scripts/install/multi_project_registry.ts +0 -13
  332. package/src/bollharness/src/scripts/install/phase2_auto.ts +0 -28
  333. package/src/bollharness/src/scripts/install/pre_commit_installer.ts +0 -10
  334. package/src/bollharness/src/scripts/install/tier_selector.ts +0 -10
  335. package/src/bollharness/src/scripts/install/transcript_miner.ts +0 -13
  336. package/src/bollharness/src/scripts/lib/claim_patterns.ts +0 -11
  337. package/src/bollharness/src/scripts/lib/sanitize_patterns.ts +0 -13
  338. package/src/bollharness/src/scripts/sanitize.ts +0 -9
  339. package/src/bollharness/templates/persona/default.json +0 -19
  340. package/src/bollharness/templates/scaffold/.gitignore.append +0 -16
  341. package/src/bollharness/templates/scaffold/CLAUDE.md +0 -89
  342. package/src/bollharness-integration/channel-judgment-engine.ts +0 -634
  343. package/src/bollharness-integration/context-chain-router.ts +0 -474
  344. package/src/bollharness-integration/context-router-judgment.ts +0 -339
  345. package/src/bollharness-integration/context-router.ts +0 -583
  346. package/src/bollharness-integration/gate-state-machine.ts +0 -444
  347. package/src/bollharness-integration/gate-transition-hooks.ts +0 -137
  348. package/src/bollharness-integration/guard-checker.ts +0 -451
  349. package/src/bollharness-integration/index.ts +0 -195
  350. package/src/bollharness-integration/integration.ts +0 -538
  351. package/src/bollharness-integration/judgment-prompts.yaml +0 -535
  352. package/src/bollharness-integration/llm-judgment-engine.ts +0 -712
  353. package/src/bollharness-integration/skill-adapter.ts +0 -646
  354. package/src/bootstrap/bootstrap.ts +0 -135
  355. package/src/bootstrap/context-collector.ts +0 -371
  356. package/src/bootstrap/context-hierarchy.ts +0 -283
  357. package/src/bootstrap/lifecycle-hooks.ts +0 -289
  358. package/src/bootstrap/project-context.ts +0 -171
  359. package/src/cli/interface.ts +0 -211
  360. package/src/cli-entry.ts +0 -304
  361. package/src/constraints/index.ts +0 -6
  362. package/src/context-compaction/auto-compact.ts +0 -153
  363. package/src/context-compaction/budget-gate.ts +0 -32
  364. package/src/context-compaction/budget-reduce.ts +0 -37
  365. package/src/context-compaction/context-collapse.ts +0 -72
  366. package/src/context-compaction/index.ts +0 -24
  367. package/src/context-compaction/microcompact.ts +0 -54
  368. package/src/context-compaction/pipeline.ts +0 -133
  369. package/src/context-compaction/snip.ts +0 -51
  370. package/src/context-compaction/token-estimator.ts +0 -36
  371. package/src/context-compaction/types.ts +0 -99
  372. package/src/documents/reader.ts +0 -85
  373. package/src/documents/store.ts +0 -252
  374. package/src/electron-preload.ts +0 -25
  375. package/src/electron.ts +0 -200
  376. package/src/heartbeat/DaemonManager.ts +0 -283
  377. package/src/heartbeat/HealthMonitor.ts +0 -317
  378. package/src/heartbeat/StartupVerifier.ts +0 -223
  379. package/src/heartbeat/Watchdog.ts +0 -208
  380. package/src/heartbeat/index.ts +0 -109
  381. package/src/heartbeat/self-improve-bus.ts +0 -110
  382. package/src/heartbeat/types.ts +0 -82
  383. package/src/index.ts +0 -1724
  384. package/src/llm/audio-config-store.ts +0 -246
  385. package/src/llm/config-store.ts +0 -400
  386. package/src/llm/llm-judgment-client.ts +0 -471
  387. package/src/llm/pi-ai.ts +0 -653
  388. package/src/llm/system-prompt/health.ts +0 -159
  389. package/src/llm/system-prompt/layers/channel/local.md +0 -14
  390. package/src/llm/system-prompt/layers/channel/p2p-agent.md +0 -18
  391. package/src/llm/system-prompt/layers/channel/p2p-visitor.md +0 -19
  392. package/src/llm/system-prompt/layers/core/artifacts_storage.md +0 -89
  393. package/src/llm/system-prompt/layers/core/evenhandedness.md +0 -21
  394. package/src/llm/system-prompt/layers/core/hibs_reminders.md +0 -15
  395. package/src/llm/system-prompt/layers/core/identity.md +0 -37
  396. package/src/llm/system-prompt/layers/core/knowledge.md +0 -17
  397. package/src/llm/system-prompt/layers/core/memory_system.md +0 -12
  398. package/src/llm/system-prompt/layers/core/network_filesystem.md +0 -28
  399. package/src/llm/system-prompt/layers/core/refusal.md +0 -37
  400. package/src/llm/system-prompt/layers/core/tone.md +0 -31
  401. package/src/llm/system-prompt/layers/core/tools.thin.md +0 -13
  402. package/src/llm/system-prompt/layers/core/wellbeing.md +0 -41
  403. package/src/llm/system-prompt/layers/role/architect.md +0 -20
  404. package/src/llm/system-prompt/layers/role/expert.md +0 -19
  405. package/src/llm/system-prompt/layers/role/implementer.md +0 -15
  406. package/src/llm/system-prompt/layers/role/security.md +0 -15
  407. package/src/llm/system-prompt/layers/tool/artifacts.md +0 -72
  408. package/src/llm/system-prompt/layers/tool/bash.md +0 -25
  409. package/src/llm/system-prompt/layers/tool/hibs_api.md +0 -171
  410. package/src/llm/system-prompt/layers/tool/image_search.md +0 -70
  411. package/src/llm/system-prompt/layers/tool/manifest.md +0 -89
  412. package/src/llm/system-prompt/layers/tool/mcp_apps.md +0 -53
  413. package/src/llm/system-prompt/layers/tool/web_search.md +0 -83
  414. package/src/llm/system-prompt/registry.ts +0 -325
  415. package/src/llm/system-prompt/strip-hibsml.ts +0 -52
  416. package/src/llm/tool-manifest/ask_user_input.ts +0 -37
  417. package/src/llm/tool-manifest/bash.ts +0 -25
  418. package/src/llm/tool-manifest/create_file.ts +0 -26
  419. package/src/llm/tool-manifest/fetch_sports_data.ts +0 -28
  420. package/src/llm/tool-manifest/image_search.ts +0 -26
  421. package/src/llm/tool-manifest/index.ts +0 -88
  422. package/src/llm/tool-manifest/mcp.ts +0 -46
  423. package/src/llm/tool-manifest/message_compose.ts +0 -33
  424. package/src/llm/tool-manifest/places.ts +0 -86
  425. package/src/llm/tool-manifest/present_files.ts +0 -23
  426. package/src/llm/tool-manifest/recipe.ts +0 -42
  427. package/src/llm/tool-manifest/recommend_apps.ts +0 -25
  428. package/src/llm/tool-manifest/str_replace.ts +0 -29
  429. package/src/llm/tool-manifest/types.ts +0 -52
  430. package/src/llm/tool-manifest/view.ts +0 -26
  431. package/src/llm/tool-manifest/weather.ts +0 -29
  432. package/src/llm/tool-manifest/web.ts +0 -54
  433. package/src/llm/video-config-store.ts +0 -257
  434. package/src/network/agent-network.ts +0 -800
  435. package/src/network/hybrid-messenger.ts +0 -199
  436. package/src/network/iroh-bootstrap.ts +0 -57
  437. package/src/network/iroh-discovery.ts +0 -208
  438. package/src/network/iroh-integration.ts +0 -158
  439. package/src/network/iroh-transport.ts +0 -637
  440. package/src/network/known-peers.ts +0 -102
  441. package/src/network/p2p-direct.ts +0 -262
  442. package/src/network/p2p-secret.ts +0 -153
  443. package/src/network/p2p.ts +0 -964
  444. package/src/network/source-intent-broadcaster.ts +0 -242
  445. package/src/network/source-intent.ts +0 -167
  446. package/src/network/storage/adapters/json-adapter.ts +0 -454
  447. package/src/network/storage/index.ts +0 -203
  448. package/src/network/storage/types.ts +0 -166
  449. package/src/security/builtin-guards.ts +0 -162
  450. package/src/security/context-router-tool.ts +0 -122
  451. package/src/security/input-scanner.ts +0 -287
  452. package/src/security/react-harness.ts +0 -177
  453. package/src/security/tool-gate.ts +0 -294
  454. package/src/social/ant-colony/index.js +0 -19
  455. package/src/social/channels/ChannelManager.ts +0 -485
  456. package/src/social/channels/DiapChannelBridge.ts +0 -501
  457. package/src/social/channels/InterestMatcher.ts +0 -189
  458. package/src/social/channels/agent-workflow-config.json +0 -214
  459. package/src/social/channels/agent-workflow-config.yaml +0 -334
  460. package/src/social/channels/channel-agent-session.ts +0 -407
  461. package/src/social/channels/channel-heartbeat-agent.ts +0 -622
  462. package/src/social/channels/diap-doc-parser.ts +0 -282
  463. package/src/social/channels/harness-workflow-integrator.ts +0 -594
  464. package/src/social/channels/index.ts +0 -22
  465. package/src/social/channels/types.ts +0 -115
  466. package/src/social/global-shared-context.ts +0 -506
  467. package/src/social/heartbeat.ts +0 -1057
  468. package/src/social/persona/enhanced-persona.ts +0 -359
  469. package/src/types.d.ts +0 -12
  470. package/src/utils/auto-evolve-policy.ts +0 -138
  471. package/src/utils/auto-update.ts +0 -482
  472. package/src/utils/clamp.ts +0 -5
  473. package/src/web/agent-delegate-server.ts +0 -148
  474. package/src/web/api-config.html +0 -520
  475. package/src/web/client.js +0 -2352
  476. package/src/web/client.ts +0 -4326
  477. package/src/web/components/p2p/P2PModal.tsx +0 -416
  478. package/src/web/components/p2p/index.ts +0 -566
  479. package/src/web/components/p2p/index.tsx +0 -297
  480. package/src/web/components/p2p/p2p-connection.ts +0 -338
  481. package/src/web/components/p2p/p2p-identity.ts +0 -92
  482. package/src/web/components/p2p/p2p-manager.ts +0 -147
  483. package/src/web/components/p2p/p2p-messages.ts +0 -219
  484. package/src/web/components/p2p/p2p-modal.ts +0 -685
  485. package/src/web/components/p2p/p2p-store-memory.ts +0 -162
  486. package/src/web/components/p2p/p2p-tools.ts +0 -315
  487. package/src/web/components/p2p/types.ts +0 -170
  488. package/src/web/components/wallet-viem.mjs +0 -118
  489. package/src/web/design.md +0 -99
  490. package/src/web/icons/apple-touch-icon.png +0 -0
  491. package/src/web/icons/favicon-16x16.png +0 -0
  492. package/src/web/icons/favicon-192x192.png +0 -0
  493. package/src/web/icons/favicon-32x32.png +0 -0
  494. package/src/web/icons/favicon-48x48.png +0 -0
  495. package/src/web/icons/favicon-512x512.png +0 -0
  496. package/src/web/icons/favicon.icns +0 -0
  497. package/src/web/icons/favicon.ico +0 -0
  498. package/src/web/icons/icon.png +0 -0
  499. package/src/web/icons/image.png +0 -0
  500. package/src/web/index.html +0 -373
  501. package/src/web/iroh-delegate-transport.ts +0 -139
  502. package/src/web/manifest.json +0 -21
  503. package/src/web/server.ts +0 -5731
  504. package/src/web/style.css +0 -4737
  505. package/src/web/ui/message-renderer.ts +0 -540
  506. package/src/web/ui/step-timeline.ts +0 -394
  507. package/staging/auto-evolve/clean-001/.review-verdict +0 -9
  508. package/staging/auto-evolve/clean-001/clean-001.patch +0 -14
  509. package/staging/auto-evolve/e2e-001/.patch-id +0 -1
  510. package/staging/auto-evolve/e2e-001/.review-verdict +0 -12
  511. package/staging/auto-evolve/e2e-001/e2e-001.patch +0 -11
  512. package/staging/auto-evolve/test-bad/.review-verdict +0 -12
  513. package/staging/auto-evolve/test-bad/test-bad.patch +0 -11
  514. package/test-results/.last-run.json +0 -6
  515. package/test-results/src-test-web-loop-status-b-5734c-atus-bar-/346/230/276/347/244/272-spinner-/344/270/215/346/230/276/347/244/272/345/276/252/347/216/257/350/256/241/346/225/260/error-context.md +0 -285
  516. package/tsconfig.cli.json +0 -16
  517. package/tsconfig.electron.json +0 -20
  518. package/tsconfig.json +0 -18
@@ -1,56 +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
- npx ts-node -e "
40
- import * as fs from 'fs';
41
- const data = JSON.parse(fs.readFileSync(process.env.PROGRESS_FILE!, 'utf-8'));
42
- console.log(' ' + (data.objective || '<未设置>'));
43
- console.log();
44
- const pending = (data.features || []).filter((f: { status: string }) => f.status !== 'passing');
45
- if (pending.length) {
46
- console.log('**未完成 features**:');
47
- pending.forEach((f: { status: string; id: string; subject: string }) => {
48
- console.log(' - [' + f.status + '] ' + f.id + ': ' + f.subject);
49
- });
50
- } else {
51
- console.log('**所有 features 已 passing**,可以进入 Stop 流程。');
52
- }
53
- " 2>&1
54
- fi
55
-
56
- exit 0
@@ -1,83 +0,0 @@
1
- # Stop Hook: Completion Proposal + Independent Review (ADR-044 §3.4 L3+L4)
2
-
3
- 你**不是** Evaluator。你是被评估的一方。你的工作是:
4
- 1. 写出你做了什么(proposal)
5
- 2. 请一个独立 agent 来评你
6
-
7
- **禁止自己给自己打分。** 自评有结构性利益冲突(Anthropic: "Agents consistently overpraise their own work")。
8
-
9
- ## Step 1: 写 Completion Proposal
10
-
11
- 将以下 JSON 写入 `.boll/state/completion-proposal.json`:
12
-
13
- ```json
14
- {
15
- "session_id": "<当前 session 标识>",
16
- "timestamp": "<ISO 8601>",
17
- "summary": "<1-3 句话描述本 session 做了什么>",
18
- "files_changed": ["<从 git diff 或 risk-snapshot 获取>"],
19
- "evidence": {
20
- "tests_run": "<运行了哪些测试,结果如何>",
21
- "verification_commands": ["<实际执行的验证命令>"],
22
- "commits": ["<本 session 的 commit hash + message>"]
23
- },
24
- "known_limitations": ["<诚实列出已知的未完成项或风险>"],
25
- "task_reference": "<TASK.md 路径或用户原始指令摘要>"
26
- }
27
- ```
28
-
29
- **要求**:
30
- - `files_changed` 必须从 `git diff` 或 risk-snapshot 的 `files_touched` 取,**不得凭记忆列举**
31
- - `evidence` 中的测试结果必须是实际运行输出,不是"应该通过"
32
- - `known_limitations` 必须诚实 — 这是给 reviewer 的线索,不是给自己开脱
33
-
34
- ## Step 2: Spawn 独立 Reviewer
35
-
36
- 写完 proposal 后,**必须** spawn 一个独立审查 agent:
37
-
38
- ```
39
- Agent({
40
- subagent_type: "review-readonly",
41
- description: "Completion review",
42
- prompt: `你是独立的 Completion Reviewer(ADR-044 L4)。
43
- 你的任务是验证 agent 的 completion proposal 是否与实际代码变更一致。
44
-
45
- 读取 .boll/state/completion-proposal.json,然后:
46
-
47
- 1. **Proposal vs Reality**:git diff 的实际变更是否与 proposal.files_changed 一致?有遗漏吗?
48
- 2. **Evidence 可信度**:proposal.evidence 中声称的测试/验证,结果是否真实?
49
- 3. **半成品检查**:变更文件中有没有 TODO/FIXME/HACK?有没有 dead code?
50
- 4. **契约一致性**:如果改了 API/config/路由,所有引用处是否同步更新?
51
- 5. **已知限制诚实度**:proposal.known_limitations 是否遗漏了明显风险?
52
-
53
- 评分(每维 1-5,任何维 < 3 = FAIL):
54
- - Completeness: proposal 是否覆盖所有实际变更
55
- - Honesty: evidence 和 limitations 是否真实
56
- - Quality: 代码变更本身的质量
57
- - Consistency: 跨文件/跨层的一致性
58
-
59
- 输出格式:
60
- ## Verdict: PASS / FAIL
61
- ## Scores: Completeness X/5, Honesty X/5, Quality X/5, Consistency X/5
62
- ## Findings: [具体发现列表]
63
- ## Recommendation: [如果 FAIL,具体要修什么]`
64
- })
65
- ```
66
-
67
- ## Step 3: 根据 Reviewer 裁决行动
68
-
69
- - **Reviewer 说 PASS** → 你可以 Stop
70
- - **Reviewer 说 FAIL** → 按 Recommendation 修复,修复后再尝试 Stop
71
- - **Reviewer spawn 失败**(超时/权限等)→ 降级为 PreCompletionChecklist 自检(下方),但必须在输出中声明 "独立审查未执行,以下为自检降级"
72
-
73
- ## 降级 Fallback: PreCompletionChecklist(仅当 reviewer 不可用时)
74
-
75
- 如果因环境限制无法 spawn reviewer,执行以下自检:
76
-
77
- 1. **Git 状态**: 所有新文件是否已 `git add`?是否有未保存的变更?
78
- 2. **测试**: 如果有代码变更,相关测试是否通过?
79
- 3. **文档一致性**: 代码变更是否需要更新文档?
80
- 4. **无半成品**: 是否有 TODO/FIXME/HACK 被遗留?
81
- 5. **契约一致性**: API 类型、路由路径、配置 key 是否在所有引用处一致?
82
-
83
- **但必须标注**:这是自检降级,不是独立审查。
@@ -1,281 +0,0 @@
1
- #!/bin/bash
2
- # sync-from-upstream.sh — Sync hook files from boll (upstream) to bollharness.
3
- #
4
- # Purpose: boll is the development/incubation repo where hooks are written
5
- # and tested. This script copies updated hooks to bollharness and reports
6
- # any discrepancies in settings.json hook registrations.
7
- #
8
- # What it does:
9
- # 1. Copy shared hook scripts from boll → bollharness (skip boll-only files)
10
- # 2. Replace find-boll-root.sh references → find-project-root.sh in copied files
11
- # 3. Compare settings.json hook registrations and report differences
12
- # 4. Sync shared scripts (guard-feedback.ts, deploy-guard.ts, context_router.ts, guard_router.ts)
13
- # 5. Sync context-fragments/ directory
14
- #
15
- # Usage:
16
- # ./scripts/sync-from-upstream.sh # default boll path
17
- # ./scripts/sync-from-upstream.sh /path/to/boll # explicit upstream path
18
- # ./scripts/sync-from-upstream.sh --dry-run # show what would change
19
-
20
- set -euo pipefail
21
-
22
- SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
23
- HARNESS_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
24
- UPSTREAM_DEFAULT="$(cd "$HARNESS_ROOT/../boll" 2>/dev/null && pwd || echo "")"
25
-
26
- # Parse args
27
- DRY_RUN=false
28
- UPSTREAM=""
29
-
30
- for arg in "$@"; do
31
- case "$arg" in
32
- --dry-run) DRY_RUN=true ;;
33
- *) UPSTREAM="$arg" ;;
34
- esac
35
- done
36
-
37
- if [ -z "$UPSTREAM" ]; then
38
- UPSTREAM="$UPSTREAM_DEFAULT"
39
- fi
40
-
41
- if [ -z "$UPSTREAM" ] || [ ! -d "$UPSTREAM/scripts/hooks" ]; then
42
- echo "ERROR: Cannot find upstream boll repo."
43
- echo "Usage: $0 [--dry-run] [/path/to/boll]"
44
- exit 1
45
- fi
46
-
47
- echo "=== bollharness sync-from-upstream ==="
48
- echo "Upstream: $UPSTREAM"
49
- echo "Target: $HARNESS_ROOT"
50
- echo "Dry run: $DRY_RUN"
51
- echo ""
52
-
53
- # ─── Files that exist only in boll (not synced) ───
54
- boll_ONLY=(
55
- "find-boll-root.sh" # boll-specific root finder
56
- )
57
-
58
- # ─── Files that exist only in bollharness (not overwritten) ───
59
- HARNESS_ONLY=(
60
- "find-project-root.sh" # Generic root finder
61
- "sanitize-on-read.ts" # WP-11 addition
62
- )
63
-
64
- # ─── Step 1: Copy shared hooks ───
65
- echo "── Step 1: Sync hook scripts ──"
66
- COPIED=0
67
- SKIPPED=0
68
- UNCHANGED=0
69
-
70
- for src_file in "$UPSTREAM/scripts/hooks/"*; do
71
- [ -f "$src_file" ] || continue # skip directories (e.g. __pycache__)
72
- filename="$(basename "$src_file")"
73
-
74
- # Skip boll-only files
75
- skip=false
76
- for excl in "${boll_ONLY[@]}"; do
77
- if [ "$filename" = "$excl" ]; then
78
- skip=true
79
- break
80
- fi
81
- done
82
- if $skip; then
83
- echo " SKIP (boll-only): $filename"
84
- ((SKIPPED++))
85
- continue
86
- fi
87
-
88
- # Skip harness-only files (don't overwrite)
89
- for excl in "${HARNESS_ONLY[@]}"; do
90
- if [ "$filename" = "$excl" ]; then
91
- skip=true
92
- break
93
- fi
94
- done
95
- if $skip; then
96
- echo " SKIP (harness-only): $filename"
97
- ((SKIPPED++))
98
- continue
99
- fi
100
-
101
- dst_file="$HARNESS_ROOT/scripts/hooks/$filename"
102
-
103
- # Check if content differs
104
- if [ -f "$dst_file" ]; then
105
- if diff -q "$src_file" "$dst_file" > /dev/null 2>&1; then
106
- ((UNCHANGED++))
107
- continue
108
- fi
109
- fi
110
-
111
- if $DRY_RUN; then
112
- echo " WOULD COPY: $filename"
113
- else
114
- cp "$src_file" "$dst_file"
115
- echo " COPIED: $filename"
116
- fi
117
- ((COPIED++))
118
- done
119
-
120
- echo ""
121
- echo " Results: $COPIED copied, $SKIPPED skipped, $UNCHANGED unchanged"
122
-
123
- # ─── Step 2: Replace find-boll-root.sh references ───
124
- echo ""
125
- echo "── Step 2: Path references ──"
126
- PATCHED=0
127
-
128
- for hook_file in "$HARNESS_ROOT/scripts/hooks/"*.ts "$HARNESS_ROOT/scripts/hooks/"*.sh; do
129
- [ -f "$hook_file" ] || continue
130
- filename="$(basename "$hook_file")"
131
-
132
- # Skip harness-only files
133
- skip=false
134
- for excl in "${HARNESS_ONLY[@]}"; do
135
- if [ "$filename" = "$excl" ]; then
136
- skip=true
137
- break
138
- fi
139
- done
140
- if $skip; then continue; fi
141
-
142
- if grep -q "find-boll-root.sh" "$hook_file" 2>/dev/null; then
143
- if $DRY_RUN; then
144
- echo " WOULD PATCH: $filename (find-boll-root.sh → find-project-root.sh)"
145
- else
146
- # Use perl for reliable in-place replace (macOS sed -i differs from GNU)
147
- perl -pi -e 's/find-boll-root\.sh/find-project-root.sh/g' "$hook_file"
148
- echo " PATCHED: $filename"
149
- fi
150
- ((PATCHED++))
151
- fi
152
- done
153
-
154
- if [ "$PATCHED" -eq 0 ]; then
155
- echo " No path references to patch"
156
- fi
157
-
158
- # ─── Step 3: Compare settings.json hook registrations ───
159
- echo ""
160
- echo "── Step 3: Hook registration diff ──"
161
-
162
- # Extract hook script names from settings.json
163
- extract_hooks() {
164
- npx ts-node -e "
165
- import json, sys
166
- const d = JSON.parse(require('fs').readFileSync('$1', 'utf8'));
167
- const hooks = [];
168
- for (const [stage, entries] of Object.entries(d.get('hooks', {}))) {
169
- for (const entry of entries) {
170
- const matcher = entry.get('matcher', '*');
171
- for (const h of entry.get('hooks', [])) {
172
- const cmd = h.get('command', '');
173
- // Extract script name
174
- const parts = cmd.split(' ');
175
- for (let i = parts.length - 1; i >= 0; i--) {
176
- if (parts[i].endsWith('.ts') || parts[i].endsWith('.sh')) {
177
- hooks.push(\`\${stage}|\${matcher}|\${parts[i].split('/').pop()}\`);
178
- break;
179
- }
180
- }
181
- }
182
- }
183
- }
184
- for (const h of [...new Set(hooks)].sort()) console.log(h);
185
- " 2>/dev/null
186
- }
187
-
188
- UPSTREAM_HOOKS=$(extract_hooks "$UPSTREAM/.boll/settings.json")
189
- HARNESS_HOOKS=$(extract_hooks "$HARNESS_ROOT/.boll/settings.json")
190
-
191
- # Find hooks only in upstream
192
- ONLY_UPSTREAM=$(comm -23 <(echo "$UPSTREAM_HOOKS") <(echo "$HARNESS_HOOKS"))
193
- ONLY_HARNESS=$(comm -13 <(echo "$UPSTREAM_HOOKS") <(echo "$HARNESS_HOOKS"))
194
-
195
- if [ -n "$ONLY_UPSTREAM" ]; then
196
- echo " ⚠ Only in boll (missing from bollharness):"
197
- echo "$ONLY_UPSTREAM" | while IFS='|' read -r stage matcher script; do
198
- echo " $stage $matcher: $script"
199
- done
200
- fi
201
-
202
- if [ -n "$ONLY_HARNESS" ]; then
203
- echo " ℹ Only in bollharness (expected for harness-specific hooks):"
204
- echo "$ONLY_HARNESS" | while IFS='|' read -r stage matcher script; do
205
- echo " $stage $matcher: $script"
206
- done
207
- fi
208
-
209
- if [ -z "$ONLY_UPSTREAM" ] && [ -z "$ONLY_HARNESS" ]; then
210
- echo " ✓ Hook registrations in sync"
211
- fi
212
-
213
- # ─── Step 4: Check for other synced files ───
214
- echo ""
215
- echo "── Step 4: Other shared files ──"
216
-
217
- # Scripts in scripts/ root that are shared with boll
218
- for shared_file in "guard-feedback.ts" "deploy-guard.ts" "context_router.ts" "guard_router.ts"; do
219
- src="$UPSTREAM/scripts/$shared_file"
220
- dst="$HARNESS_ROOT/scripts/$shared_file"
221
- if [ -f "$src" ] && [ -f "$dst" ]; then
222
- if ! diff -q "$src" "$dst" > /dev/null 2>&1; then
223
- if $DRY_RUN; then
224
- echo " WOULD COPY: scripts/$shared_file"
225
- else
226
- cp "$src" "$dst"
227
- echo " COPIED: scripts/$shared_file"
228
- fi
229
- fi
230
- elif [ -f "$src" ] && [ ! -f "$dst" ]; then
231
- echo " ⚠ MISSING in harness: scripts/$shared_file"
232
- fi
233
- done
234
-
235
- # ─── Step 5: Sync context-fragments/ directory ───
236
- echo ""
237
- echo "── Step 5: Context fragments ──"
238
- FRAG_COPIED=0
239
- FRAG_UNCHANGED=0
240
-
241
- src_frag_dir="$UPSTREAM/scripts/context-fragments"
242
- dst_frag_dir="$HARNESS_ROOT/scripts/context-fragments"
243
-
244
- if [ -d "$src_frag_dir" ]; then
245
- if [ ! -d "$dst_frag_dir" ]; then
246
- if $DRY_RUN; then
247
- echo " WOULD CREATE: scripts/context-fragments/"
248
- else
249
- mkdir -p "$dst_frag_dir"
250
- echo " CREATED: scripts/context-fragments/"
251
- fi
252
- fi
253
-
254
- for src_frag in "$src_frag_dir/"*; do
255
- [ -f "$src_frag" ] || continue
256
- frag_name="$(basename "$src_frag")"
257
- dst_frag="$dst_frag_dir/$frag_name"
258
-
259
- if [ -f "$dst_frag" ]; then
260
- if diff -q "$src_frag" "$dst_frag" > /dev/null 2>&1; then
261
- ((FRAG_UNCHANGED++))
262
- continue
263
- fi
264
- fi
265
-
266
- if $DRY_RUN; then
267
- echo " WOULD COPY: context-fragments/$frag_name"
268
- else
269
- cp "$src_frag" "$dst_frag"
270
- echo " COPIED: context-fragments/$frag_name"
271
- fi
272
- ((FRAG_COPIED++))
273
- done
274
-
275
- echo " Results: $FRAG_COPIED copied, $FRAG_UNCHANGED unchanged"
276
- else
277
- echo " ⚠ Upstream context-fragments/ not found"
278
- fi
279
-
280
- echo ""
281
- echo "=== Sync complete ==="
@@ -1,5 +0,0 @@
1
- export { Finding, createFinding } from "./scripts/checks/finding";
2
- export { route, runGuards, writeSessionSignal, readAllSignals, GUARD_MAP, DEFAULT_GUARDS, CATEGORY_TO_SKILLS } from "./scripts/guard_router";
3
- export { match, loadFragment, FALLBACK_FRAGMENTS, CONTEXT_MAP } from "./scripts/context_router";
4
- export { main as guardFeedbackMain } from "./scripts/guard-feedback";
5
- export { main as deployGuardMain } from "./scripts/deploy-guard";
@@ -1,11 +0,0 @@
1
- import * as fs from "fs";
2
- import * as path from "path";
3
- import { Finding } from "./finding";
4
-
5
- export function run(repoRoot: string, mode: string = "full"): Finding[] {
6
- const findings: Finding[] = [];
7
-
8
- if (mode !== "full" && mode !== "ci") return findings;
9
-
10
- return findings;
11
- }
@@ -1,52 +0,0 @@
1
- import * as fs from "fs";
2
- import * as path from "path";
3
- import { Finding } from "./finding";
4
-
5
- export function run(repoRoot: string, mode: string = "full"): Finding[] {
6
- const findings: Finding[] = [];
7
-
8
- const tsFile = path.join(repoRoot, "generated", "api-types.ts");
9
- if (!fs.existsSync(tsFile)) {
10
- findings.push({
11
- severity: "P1",
12
- message: "generated/api-types.ts does not exist — run scripts/export_api_types.py",
13
- file: "generated/api-types.ts",
14
- blocking: false,
15
- category: "general",
16
- problem_class: "unknown",
17
- required_skills: [],
18
- required_reads: [],
19
- });
20
- return findings;
21
- }
22
-
23
- const content = fs.readFileSync(tsFile, "utf-8");
24
- const interfaceMatch = content.match(/export interface (\w+) \{/g);
25
-
26
- if (!interfaceMatch) {
27
- findings.push({
28
- severity: "P1",
29
- message: "generated/api-types.ts contains no interfaces",
30
- file: "generated/api-types.ts",
31
- blocking: false,
32
- category: "general",
33
- problem_class: "unknown",
34
- required_skills: [],
35
- required_reads: [],
36
- });
37
- return findings;
38
- }
39
-
40
- findings.push({
41
- severity: "P2",
42
- message: "API type checking requires backend model comparison (Python 3.10+ backend not available in TypeScript check)",
43
- file: "generated/api-types.ts",
44
- blocking: false,
45
- category: "general",
46
- problem_class: "unknown",
47
- required_skills: [],
48
- required_reads: [],
49
- });
50
-
51
- return findings;
52
- }
@@ -1,156 +0,0 @@
1
- import * as fs from "fs";
2
- import * as path from "path";
3
- import { execSync } from "child_process";
4
- import { Finding } from "./finding";
5
-
6
- const CODE_EXTENSIONS = new Set([".py", ".ts", ".tsx", ".js", ".jsx"]);
7
- const CONFIG_EXTENSIONS = new Set([".json", ".yml", ".yaml", ".toml"]);
8
- const TEST_PREFIXES = ["tests/", "test_"];
9
- const ARTIFACT_PREFIXES = ["docs/issues/", "docs/decisions/"];
10
- const BUILD_DIRS = new Set([".open-next", "dist", "build", ".next", "node_modules"]);
11
-
12
- function isCodeFile(filePath: string): boolean {
13
- const p = path.parse(filePath);
14
- if (!CODE_EXTENSIONS.has(p.ext)) return false;
15
- const parts = p.dir.split(path.sep);
16
- for (const part of parts) {
17
- if (part.startsWith("test_") || part === "tests") return false;
18
- }
19
- for (const part of parts) {
20
- if (BUILD_DIRS.has(part)) return false;
21
- }
22
- return true;
23
- }
24
-
25
- function isArtifactFile(filePath: string): boolean {
26
- return ARTIFACT_PREFIXES.some(prefix => filePath.startsWith(prefix)) && filePath.endsWith(".md");
27
- }
28
-
29
- function extractScope(artifactPath: string): string[] {
30
- try {
31
- const text = fs.readFileSync(artifactPath, "utf-8");
32
- if (!text.startsWith("---")) return [];
33
-
34
- const end = text.indexOf("\n---", 3);
35
- if (end === -1) return [];
36
-
37
- const frontmatter = text.slice(3, end);
38
- const scopes: string[] = [];
39
- let inScope = false;
40
-
41
- for (const line of frontmatter.split("\n")) {
42
- const stripped = line.trim();
43
- if (stripped.startsWith("scope:")) {
44
- const value = stripped.slice(6).trim();
45
- if (value && !value.startsWith("[")) {
46
- scopes.push(value);
47
- inScope = false;
48
- } else if (value.startsWith("[")) {
49
- const inner = value.replace(/[\[\] ]/g, "");
50
- scopes.push(...inner.split(",").filter(s => s));
51
- inScope = false;
52
- } else {
53
- inScope = true;
54
- }
55
- continue;
56
- }
57
- if (inScope) {
58
- if (stripped.startsWith("- ")) {
59
- scopes.push(stripped.slice(2).trim().replace(/^["']|["']$/g, ""));
60
- } else if (stripped && !stripped.startsWith("#")) {
61
- inScope = false;
62
- }
63
- }
64
- }
65
-
66
- return scopes.filter(s => s);
67
- } catch {
68
- return [];
69
- }
70
- }
71
-
72
- function checkScopeBinding(
73
- codeFiles: string[],
74
- artifactFiles: string[],
75
- repoRoot: string
76
- ): Finding[] {
77
- const allScopes: string[] = [];
78
- for (const af of artifactFiles) {
79
- allScopes.push(...extractScope(path.join(repoRoot, af)));
80
- }
81
-
82
- if (allScopes.length === 0) return [];
83
-
84
- const uncovered: string[] = [];
85
- for (const cf of codeFiles) {
86
- if (!allScopes.some(scope => cf.startsWith(scope))) {
87
- uncovered.push(cf);
88
- }
89
- }
90
-
91
- if (uncovered.length === 0) return [];
92
-
93
- return [{
94
- severity: "P2",
95
- message: `Scope binding gap: ${uncovered.length} code file(s) not covered by any artifact scope. Uncovered: ${uncovered.slice(0, 5).join(", ")}${uncovered.length > 5 ? ` (and ${uncovered.length - 5} more)` : ""}. Add a scope field to the relevant artifact doc.`,
96
- file: uncovered[0],
97
- blocking: false,
98
- category: "scope_binding",
99
- problem_class: "unknown",
100
- required_skills: ["lead"],
101
- required_reads: [],
102
- }];
103
- }
104
-
105
- function getChangedFiles(mode: string, repoRoot: string): string[] {
106
- if (mode === "staged") {
107
- try {
108
- const result = execSync("git diff --cached --name-only", { cwd: repoRoot, encoding: "utf-8" });
109
- return result.split("\n").map(l => l.trim()).filter(l => l);
110
- } catch {
111
- return [];
112
- }
113
- } else if (mode === "ci") {
114
- try {
115
- const result = execSync("git diff origin/main..HEAD --name-only", { cwd: repoRoot, encoding: "utf-8" });
116
- return result.split("\n").map(l => l.trim()).filter(l => l);
117
- } catch {
118
- return [];
119
- }
120
- }
121
- return [];
122
- }
123
-
124
- export function run(repoRoot: string, mode: string = "full"): Finding[] {
125
- if (mode === "full") return [];
126
-
127
- const files = getChangedFiles(mode, repoRoot);
128
- if (!files.length) return [];
129
-
130
- const codeFiles = files.filter(f => isCodeFile(f));
131
- const artifactFiles = files.filter(f => isArtifactFile(f));
132
- const hasCode = codeFiles.length > 0;
133
- const hasArtifact = artifactFiles.length > 0;
134
-
135
- const findings: Finding[] = [];
136
-
137
- if (hasCode && !hasArtifact) {
138
- findings.push({
139
- severity: "P1",
140
- message: `Code changes without artifact documentation. ${codeFiles.length} code file(s) changed but no docs/issues/ or docs/decisions/ file included. Add an issue or decision doc.`,
141
- file: codeFiles[0],
142
- blocking: true,
143
- category: "artifact_linkage",
144
- problem_class: "unknown",
145
- required_skills: ["lead"],
146
- required_reads: [],
147
- });
148
- return findings;
149
- }
150
-
151
- if (hasCode && hasArtifact) {
152
- findings.push(...checkScopeBinding(codeFiles, artifactFiles, repoRoot));
153
- }
154
-
155
- return findings;
156
- }
@@ -1,11 +0,0 @@
1
- import * as fs from "fs";
2
- import * as path from "path";
3
- import { Finding } from "./finding";
4
-
5
- export function run(repoRoot: string, mode: string = "full"): Finding[] {
6
- const findings: Finding[] = [];
7
-
8
- if (mode !== "full" && mode !== "ci") return findings;
9
-
10
- return findings;
11
- }
@@ -1,11 +0,0 @@
1
- import * as fs from "fs";
2
- import * as path from "path";
3
- import { Finding } from "./finding";
4
-
5
- export function run(repoRoot: string, mode: string = "full"): Finding[] {
6
- const findings: Finding[] = [];
7
-
8
- if (mode !== "full" && mode !== "ci") return findings;
9
-
10
- return findings;
11
- }
@@ -1,11 +0,0 @@
1
- import * as fs from "fs";
2
- import * as path from "path";
3
- import { Finding } from "./finding";
4
-
5
- export function run(repoRoot: string, mode: string = "full"): Finding[] {
6
- const findings: Finding[] = [];
7
-
8
- if (mode !== "full" && mode !== "ci") return findings;
9
-
10
- return findings;
11
- }