@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.
- package/README.md +1 -1
- package/dist/agents/p2p-chat-tools.js +6 -6
- package/dist/agents/permission-mode.js +115 -0
- package/dist/agents/pi-sdk.js +435 -25
- package/dist/agents/pre-tool-validator.js +194 -0
- package/dist/agents/workflow-pivot-loop.js +113 -12
- package/dist/bollharness-integration/context-router.js +2 -2
- package/dist/bollharness-integration/guard-checker.js +1 -1
- package/dist/bootstrap/bootstrap.js +3 -0
- package/dist/bootstrap/context-collector.js +17 -1
- package/dist/bootstrap/context-hierarchy.js +218 -0
- package/dist/bootstrap/lifecycle-hooks.js +86 -24
- package/dist/bootstrap/project-context.js +10 -3
- package/dist/context-compaction/auto-compact.js +144 -0
- package/dist/context-compaction/budget-gate.js +28 -0
- package/dist/context-compaction/budget-reduce.js +35 -0
- package/dist/context-compaction/context-collapse.js +66 -0
- package/dist/context-compaction/index.js +21 -0
- package/dist/context-compaction/microcompact.js +51 -0
- package/dist/context-compaction/pipeline.js +123 -0
- package/dist/context-compaction/snip.js +45 -0
- package/dist/context-compaction/token-estimator.js +35 -0
- package/dist/context-compaction/types.js +19 -0
- package/dist/heartbeat/HealthMonitor.js +3 -2
- package/dist/index.js +38 -2
- package/dist/llm/llm-judgment-client.js +32 -30
- package/dist/llm/pi-ai.js +103 -16
- package/dist/llm/system-prompt/health.js +129 -0
- package/dist/llm/system-prompt/registry.js +246 -0
- package/dist/llm/system-prompt/strip-hibsml.js +51 -0
- package/dist/llm/tool-manifest/ask_user_input.js +35 -0
- package/dist/llm/tool-manifest/bash.js +23 -0
- package/dist/llm/tool-manifest/create_file.js +24 -0
- package/dist/llm/tool-manifest/fetch_sports_data.js +26 -0
- package/dist/llm/tool-manifest/image_search.js +24 -0
- package/dist/llm/tool-manifest/index.js +69 -0
- package/dist/llm/tool-manifest/mcp.js +43 -0
- package/dist/llm/tool-manifest/message_compose.js +31 -0
- package/dist/llm/tool-manifest/places.js +83 -0
- package/dist/llm/tool-manifest/present_files.js +21 -0
- package/dist/llm/tool-manifest/recipe.js +40 -0
- package/dist/llm/tool-manifest/recommend_apps.js +23 -0
- package/dist/llm/tool-manifest/str_replace.js +27 -0
- package/dist/llm/tool-manifest/types.js +7 -0
- package/dist/llm/tool-manifest/view.js +24 -0
- package/dist/llm/tool-manifest/weather.js +27 -0
- package/dist/llm/tool-manifest/web.js +51 -0
- package/dist/network/p2p-direct.js +23 -0
- package/dist/network/source-intent-broadcaster.js +203 -0
- package/dist/network/source-intent.js +100 -0
- package/dist/pi-ecosystem-judgment/adaptive-scan.js +48 -0
- package/dist/pi-ecosystem-judgment/injection-gate.js +54 -12
- package/dist/pi-ecosystem-judgment/value-injection.js +8 -2
- package/dist/security/context-router-tool.js +1 -1
- package/dist/security/input-scanner.js +223 -0
- package/dist/web/client.js +3089 -4458
- package/dist/web/index.html +58 -67
- package/dist/web/server.js +299 -117
- package/dist/web/style.css +531 -249
- package/dist/web/ui/message-renderer.js +352 -0
- package/dist/web/ui/step-timeline.js +279 -0
- package/package.json +2 -2
- package/.auto-evolve-calls +0 -1
- package/.last-auto-evolve-baseline +0 -1
- package/Bolloon.md +0 -103
- package/dist/agents/constraint-layer.js.map +0 -1
- package/dist/agents/pi-sdk.js.map +0 -1
- package/dist/agents/workflow-engine.js.map +0 -1
- package/dist/bollharness/src/index.js +0 -5
- package/dist/bollharness/src/scripts/checks/check_adr_plan_numbering.js +0 -6
- package/dist/bollharness/src/scripts/checks/check_api_types.js +0 -45
- package/dist/bollharness/src/scripts/checks/check_artifact_link.js +0 -146
- package/dist/bollharness/src/scripts/checks/check_bridge_deps.js +0 -6
- package/dist/bollharness/src/scripts/checks/check_bugfix_binding.js +0 -6
- package/dist/bollharness/src/scripts/checks/check_bugfix_binding_ci.js +0 -6
- package/dist/bollharness/src/scripts/checks/check_doc_file_references.js +0 -6
- package/dist/bollharness/src/scripts/checks/check_doc_freshness.js +0 -135
- package/dist/bollharness/src/scripts/checks/check_doc_links.js +0 -31
- package/dist/bollharness/src/scripts/checks/check_file_existence_claims.js +0 -6
- package/dist/bollharness/src/scripts/checks/check_fragment_integrity.js +0 -34
- package/dist/bollharness/src/scripts/checks/check_hook_installed.js +0 -63
- package/dist/bollharness/src/scripts/checks/check_issue_closure.js +0 -41
- package/dist/bollharness/src/scripts/checks/check_mcp_parity.js +0 -6
- package/dist/bollharness/src/scripts/checks/check_security.js +0 -48
- package/dist/bollharness/src/scripts/checks/check_skill_parity.js +0 -6
- package/dist/bollharness/src/scripts/checks/check_versions.js +0 -6
- package/dist/bollharness/src/scripts/checks/finding.js +0 -13
- package/dist/bollharness/src/scripts/checks/next_decision_number.js +0 -20
- package/dist/bollharness/src/scripts/checks/regenerate_magic_docs.js +0 -6
- package/dist/bollharness/src/scripts/ci/detect_rebaseline_triggers.js +0 -8
- package/dist/bollharness/src/scripts/ci/scan_subprocess_cfg.js +0 -8
- package/dist/bollharness/src/scripts/ci/scan_verify_artifacts.js +0 -8
- package/dist/bollharness/src/scripts/ci/scan_yaml_schema.js +0 -8
- package/dist/bollharness/src/scripts/context_router.js +0 -67
- package/dist/bollharness/src/scripts/deploy-guard.js +0 -157
- package/dist/bollharness/src/scripts/guard-feedback.js +0 -192
- package/dist/bollharness/src/scripts/guard_router.js +0 -158
- package/dist/bollharness/src/scripts/hooks/_hook_output.js +0 -6
- package/dist/bollharness/src/scripts/hooks/auto-python3.js +0 -6
- package/dist/bollharness/src/scripts/hooks/deploy-progress-on-session-end.js +0 -6
- package/dist/bollharness/src/scripts/hooks/failure-analyzer.js +0 -6
- package/dist/bollharness/src/scripts/hooks/gate-judgment-inject.js +0 -92
- package/dist/bollharness/src/scripts/hooks/gate-transition-judgment.js +0 -63
- package/dist/bollharness/src/scripts/hooks/inbox-ack.js +0 -6
- package/dist/bollharness/src/scripts/hooks/inbox-inject-on-start.js +0 -6
- package/dist/bollharness/src/scripts/hooks/inbox-validate.js +0 -6
- package/dist/bollharness/src/scripts/hooks/inbox-write-ledger.js +0 -6
- package/dist/bollharness/src/scripts/hooks/initializer-agent.js +0 -6
- package/dist/bollharness/src/scripts/hooks/loop-detection.js +0 -73
- package/dist/bollharness/src/scripts/hooks/owner-guard.js +0 -6
- package/dist/bollharness/src/scripts/hooks/precompact.js +0 -6
- package/dist/bollharness/src/scripts/hooks/review-agent-gatekeeper.js +0 -6
- package/dist/bollharness/src/scripts/hooks/risk-tracker.js +0 -108
- package/dist/bollharness/src/scripts/hooks/sanitize-on-read.js +0 -6
- package/dist/bollharness/src/scripts/hooks/session-reflection.js +0 -7
- package/dist/bollharness/src/scripts/hooks/session-start-magic-docs.js +0 -7
- package/dist/bollharness/src/scripts/hooks/session-start-reset-risk.js +0 -7
- package/dist/bollharness/src/scripts/hooks/session-start-toolkit-reminder.js +0 -7
- package/dist/bollharness/src/scripts/hooks/stop-evaluator.js +0 -157
- package/dist/bollharness/src/scripts/hooks/tool-call-counter.js +0 -6
- package/dist/bollharness/src/scripts/hooks/trace-analyzer.js +0 -10
- package/dist/bollharness/src/scripts/install/install-trust-token.js +0 -7
- package/dist/bollharness/src/scripts/install/multi_project_registry.js +0 -9
- package/dist/bollharness/src/scripts/install/phase2_auto.js +0 -21
- package/dist/bollharness/src/scripts/install/pre_commit_installer.js +0 -6
- package/dist/bollharness/src/scripts/install/tier_selector.js +0 -7
- package/dist/bollharness/src/scripts/install/transcript_miner.js +0 -7
- package/dist/bollharness/src/scripts/lib/claim_patterns.js +0 -10
- package/dist/bollharness/src/scripts/lib/sanitize_patterns.js +0 -12
- package/dist/bollharness/src/scripts/sanitize.js +0 -6
- package/dist/bollharness-integration/context-router-judgment.js.map +0 -1
- package/dist/bollharness-integration/context-router.js.map +0 -1
- package/dist/bollharness-integration/gate-state-machine.js.map +0 -1
- package/dist/bollharness-integration/gate-transition-hooks.js.map +0 -1
- package/dist/bollharness-integration/guard-checker.js.map +0 -1
- package/dist/bollharness-integration/index.js.map +0 -1
- package/dist/bollharness-integration/integration.js.map +0 -1
- package/dist/bollharness-integration/llm/pi-ai.d.ts +0 -60
- package/dist/bollharness-integration/pi-ecosystem-colony/index.d.ts +0 -153
- package/dist/bollharness-integration/pi-ecosystem-goals/index.d.ts +0 -136
- package/dist/bollharness-integration/pi-ecosystem-judgment/decision.d.ts +0 -117
- package/dist/bollharness-integration/pi-ecosystem-judgment/distillation.d.ts +0 -78
- package/dist/bollharness-integration/pi-ecosystem-judgment/index.d.ts +0 -139
- package/dist/bollharness-integration/pi-ecosystem-mcp/index.d.ts +0 -127
- package/dist/bollharness-integration/pi-ecosystem-subagents/index.d.ts +0 -95
- package/dist/bollharness-integration/skill-adapter.js.map +0 -1
- package/dist/constraint-runtime/src/_archive_helper.js +0 -9
- package/dist/constraint-runtime/src/agent/coordinator.js +0 -48
- package/dist/constraint-runtime/src/agent/index.js +0 -1
- package/dist/constraint-runtime/src/assistant/index.js +0 -12
- package/dist/constraint-runtime/src/bootstrap/index.js +0 -12
- package/dist/constraint-runtime/src/bootstrap_graph.js +0 -13
- package/dist/constraint-runtime/src/bridge/index.js +0 -12
- package/dist/constraint-runtime/src/buddy/index.js +0 -12
- package/dist/constraint-runtime/src/cli/index.js +0 -12
- package/dist/constraint-runtime/src/command_graph.js +0 -10
- package/dist/constraint-runtime/src/commands.js +0 -60
- package/dist/constraint-runtime/src/components/index.js +0 -12
- package/dist/constraint-runtime/src/constants/index.js +0 -12
- package/dist/constraint-runtime/src/constraint/budget.js +0 -22
- package/dist/constraint-runtime/src/constraint/budget.js.map +0 -1
- package/dist/constraint-runtime/src/constraint/index.js +0 -2
- package/dist/constraint-runtime/src/constraint/permission.js +0 -20
- package/dist/constraint-runtime/src/constraint/permission.js.map +0 -1
- package/dist/constraint-runtime/src/context.js +0 -30
- package/dist/constraint-runtime/src/coordinator/index.js +0 -12
- package/dist/constraint-runtime/src/cost_hook.js +0 -4
- package/dist/constraint-runtime/src/cost_tracker.js +0 -8
- package/dist/constraint-runtime/src/deferred_init.js +0 -10
- package/dist/constraint-runtime/src/direct_modes.js +0 -6
- package/dist/constraint-runtime/src/dynamic-tool-loader.js +0 -85
- package/dist/constraint-runtime/src/entrypoints/index.js +0 -12
- package/dist/constraint-runtime/src/execution_registry.js +0 -44
- package/dist/constraint-runtime/src/history.js +0 -9
- package/dist/constraint-runtime/src/hooks/index.js +0 -12
- package/dist/constraint-runtime/src/index.js +0 -26
- package/dist/constraint-runtime/src/ink.js +0 -4
- package/dist/constraint-runtime/src/keybindings/index.js +0 -12
- package/dist/constraint-runtime/src/memdir/index.js +0 -12
- package/dist/constraint-runtime/src/migrations/index.js +0 -12
- package/dist/constraint-runtime/src/models.js +0 -1
- package/dist/constraint-runtime/src/models.js.map +0 -1
- package/dist/constraint-runtime/src/moreright/index.js +0 -12
- package/dist/constraint-runtime/src/native_ts/index.js +0 -12
- package/dist/constraint-runtime/src/output_styles/index.js +0 -12
- package/dist/constraint-runtime/src/parity_audit.js +0 -12
- package/dist/constraint-runtime/src/plugins/index.js +0 -12
- package/dist/constraint-runtime/src/port_manifest.js +0 -11
- package/dist/constraint-runtime/src/prefetch.js +0 -9
- package/dist/constraint-runtime/src/query.js +0 -1
- package/dist/constraint-runtime/src/remote/index.js +0 -12
- package/dist/constraint-runtime/src/remote_runtime.js +0 -9
- package/dist/constraint-runtime/src/runtime/index.js +0 -1
- package/dist/constraint-runtime/src/runtime/session.js +0 -35
- package/dist/constraint-runtime/src/schemas/index.js +0 -12
- package/dist/constraint-runtime/src/screens/index.js +0 -12
- package/dist/constraint-runtime/src/server/index.js +0 -12
- package/dist/constraint-runtime/src/services/index.js +0 -12
- package/dist/constraint-runtime/src/session_store.js +0 -22
- package/dist/constraint-runtime/src/setup.js +0 -30
- package/dist/constraint-runtime/src/skills/index.js +0 -1
- package/dist/constraint-runtime/src/skills/skill-registry.js +0 -28
- package/dist/constraint-runtime/src/state/index.js +0 -12
- package/dist/constraint-runtime/src/system_init.js +0 -20
- package/dist/constraint-runtime/src/thinking/engine.js +0 -42
- package/dist/constraint-runtime/src/thinking/index.js +0 -1
- package/dist/constraint-runtime/src/tool_pool.js +0 -8
- package/dist/constraint-runtime/src/tools/OpenCLI/execAdapter.js +0 -7
- package/dist/constraint-runtime/src/tools/OpenCLI/listAdapters.js +0 -7
- package/dist/constraint-runtime/src/tools/OpenCLI/runCommand.js +0 -7
- package/dist/constraint-runtime/src/tools/PolymarketSDK/cancelOrder.js +0 -6
- package/dist/constraint-runtime/src/tools/PolymarketSDK/createOrder.js +0 -6
- package/dist/constraint-runtime/src/tools/PolymarketSDK/getMarket.js +0 -5
- package/dist/constraint-runtime/src/tools/PolymarketSDK/getOrders.js +0 -6
- package/dist/constraint-runtime/src/tools/PolymarketSDK/listMarkets.js +0 -4
- package/dist/constraint-runtime/src/tools/SafeSDK/confirmTransaction.js +0 -6
- package/dist/constraint-runtime/src/tools/SafeSDK/createTransaction.js +0 -8
- package/dist/constraint-runtime/src/tools/SafeSDK/deploySafe.js +0 -6
- package/dist/constraint-runtime/src/tools/SafeSDK/executeTransaction.js +0 -6
- package/dist/constraint-runtime/src/tools/SafeSDK/getBalance.js +0 -6
- package/dist/constraint-runtime/src/tools/SafeSDK/getPendingTransactions.js +0 -6
- package/dist/constraint-runtime/src/tools/SafeSDK/proposeTransaction.js +0 -6
- package/dist/constraint-runtime/src/tools/WalletTools/autoPay.js +0 -29
- package/dist/constraint-runtime/src/tools/WalletTools/createWallet.js +0 -10
- package/dist/constraint-runtime/src/tools/WalletTools/getBalance.js +0 -13
- package/dist/constraint-runtime/src/tools/WalletTools/importWallet.js +0 -22
- package/dist/constraint-runtime/src/tools/WalletTools/sendTransaction.js +0 -25
- package/dist/constraint-runtime/src/tools/WalletTools/signMessage.js +0 -10
- package/dist/constraint-runtime/src/tools/WalletTools/transferToken.js +0 -25
- package/dist/constraint-runtime/src/tools.js +0 -80
- package/dist/constraint-runtime/src/transcript.js +0 -19
- package/dist/constraint-runtime/src/types/index.js +0 -12
- package/dist/constraint-runtime/src/upstream_proxy/index.js +0 -12
- package/dist/constraint-runtime/src/utils/index.js +0 -12
- package/dist/constraint-runtime/src/vim/index.js +0 -12
- package/dist/constraint-runtime/src/voice/index.js +0 -12
- package/dist/constraints/index.js.map +0 -1
- package/dist/documents/reader.js.map +0 -1
- package/dist/llm/config-store.js.map +0 -1
- package/dist/llm/pi-ai.js.map +0 -1
- package/dist/network/agent-network.js.map +0 -1
- package/dist/network/iroh-integration.js.map +0 -1
- package/dist/network/iroh-transport.js.map +0 -1
- package/dist/network/p2p.js.map +0 -1
- package/dist/network/storage/adapters/json-adapter.js.map +0 -1
- package/dist/pi-ecosystem-colony/index.js.map +0 -1
- package/dist/pi-ecosystem-goals/index.js.map +0 -1
- package/dist/pi-ecosystem-judgment/decision.js.map +0 -1
- package/dist/pi-ecosystem-judgment/distillation.js.map +0 -1
- package/dist/pi-ecosystem-judgment/human-value-store.js.map +0 -1
- package/dist/pi-ecosystem-judgment/index.js.map +0 -1
- package/dist/pi-ecosystem-judgment/value-injection.js.map +0 -1
- package/dist/pi-ecosystem-mcp/index.js.map +0 -1
- package/dist/pi-ecosystem-subagents/index.js.map +0 -1
- package/dist/social/ant-colony/AdaptiveHeartbeat.js.map +0 -1
- package/dist/social/ant-colony/PheromoneEngine.js.map +0 -1
- package/dist/social/ant-colony/types.js.map +0 -1
- package/dist/social/channels/ChannelManager.js.map +0 -1
- package/dist/social/channels/DiapChannelBridge.js.map +0 -1
- package/dist/social/channels/InterestMatcher.js.map +0 -1
- package/dist/social/channels/types.js.map +0 -1
- package/dist/social/global-shared-context.js.map +0 -1
- package/dist/social/heartbeat.js.map +0 -1
- package/lefthook.yml +0 -29
- package/scripts/auto-evolve-loop.ts +0 -376
- package/scripts/auto-evolve-oneshot.sh +0 -155
- package/scripts/auto-evolve-snapshot.sh +0 -136
- package/scripts/build-cli.js +0 -216
- package/scripts/build-web.ts +0 -82
- package/scripts/detect-schema-changes.sh +0 -48
- package/scripts/diff-reviewer.ts +0 -159
- package/scripts/postinstall.js +0 -153
- package/scripts/weekly-report.ts +0 -364
- package/src/agents/agent-manifest-protocol.ts +0 -117
- package/src/agents/constraint-layer.ts +0 -309
- package/src/agents/iroh-secret.ts +0 -32
- package/src/agents/p2p-chat-tools.ts +0 -383
- package/src/agents/p2p-document-tools.ts +0 -347
- package/src/agents/pi-sdk.ts +0 -2462
- package/src/agents/protocol.ts +0 -398
- package/src/agents/shell-guard.ts +0 -417
- package/src/agents/shell-tool.ts +0 -103
- package/src/agents/skill-loader.ts +0 -202
- package/src/agents/subagent-manager.ts +0 -553
- package/src/agents/workflow-engine.ts +0 -332
- package/src/agents/workflow-pivot-loop.ts +0 -675
- package/src/bollharness/.sanitize-report.json +0 -13
- package/src/bollharness/CLAUDE.md +0 -73
- package/src/bollharness/LICENSE +0 -21
- package/src/bollharness/README.md +0 -143
- package/src/bollharness/README.zh-CN.md +0 -131
- package/src/bollharness/package.json +0 -20
- package/src/bollharness/reference/SOURCE-COMMIT.txt +0 -3
- package/src/bollharness/reference/boll-reference/scripts/hooks/.sanitize-report.json +0 -12
- package/src/bollharness/reference/boll-reference/scripts/hooks/find-boll-root.sh +0 -27
- package/src/bollharness/reference/boll-reference/scripts/hooks/precompact.sh +0 -57
- package/src/bollharness/reference/boll-reference/scripts/hooks/stop-evaluator.md +0 -57
- package/src/bollharness/schemas/metrics-jsonl-allowlist.json +0 -67
- package/src/bollharness/scripts/checks/next_decision_number.sh +0 -48
- package/src/bollharness/scripts/ci/count-components.sh +0 -65
- package/src/bollharness/scripts/context-fragments/artifact-linkage.md +0 -14
- package/src/bollharness/scripts/context-fragments/auth-consumers.md +0 -17
- package/src/bollharness/scripts/context-fragments/bridge-constitution.md +0 -13
- package/src/bollharness/scripts/context-fragments/catalyst-distributed.md +0 -18
- package/src/bollharness/scripts/context-fragments/closure-checklist.md +0 -13
- package/src/bollharness/scripts/context-fragments/contract-consumers.md +0 -15
- package/src/bollharness/scripts/context-fragments/db-shared-structures.md +0 -15
- package/src/bollharness/scripts/context-fragments/fixed-three-layers.md +0 -19
- package/src/bollharness/scripts/context-fragments/general-dev-principles.md +0 -11
- package/src/bollharness/scripts/context-fragments/issue-first.md +0 -8
- package/src/bollharness/scripts/context-fragments/mcp-parity.md +0 -16
- package/src/bollharness/scripts/context-fragments/pi-agent-operations.md +0 -108
- package/src/bollharness/scripts/context-fragments/protocol-consumers.md +0 -15
- package/src/bollharness/scripts/context-fragments/run-events-consumers.md +0 -15
- package/src/bollharness/scripts/context-fragments/scene-fidelity.md +0 -13
- package/src/bollharness/scripts/context-fragments/truth-source-hierarchy.md +0 -15
- package/src/bollharness/scripts/context-fragments/two-language.md +0 -15
- package/src/bollharness/scripts/context-fragments/version-sources.md +0 -14
- package/src/bollharness/scripts/hooks/find-project-root.sh +0 -47
- package/src/bollharness/scripts/hooks/inbox-poll.sh +0 -78
- package/src/bollharness/scripts/hooks/precompact.sh +0 -56
- package/src/bollharness/scripts/hooks/stop-evaluator.md +0 -83
- package/src/bollharness/scripts/sync-from-upstream.sh +0 -281
- package/src/bollharness/src/index.ts +0 -5
- package/src/bollharness/src/scripts/checks/check_adr_plan_numbering.ts +0 -11
- package/src/bollharness/src/scripts/checks/check_api_types.ts +0 -52
- package/src/bollharness/src/scripts/checks/check_artifact_link.ts +0 -156
- package/src/bollharness/src/scripts/checks/check_bridge_deps.ts +0 -11
- package/src/bollharness/src/scripts/checks/check_bugfix_binding.ts +0 -11
- package/src/bollharness/src/scripts/checks/check_bugfix_binding_ci.ts +0 -11
- package/src/bollharness/src/scripts/checks/check_doc_file_references.ts +0 -11
- package/src/bollharness/src/scripts/checks/check_doc_freshness.ts +0 -141
- package/src/bollharness/src/scripts/checks/check_doc_links.ts +0 -36
- package/src/bollharness/src/scripts/checks/check_file_existence_claims.ts +0 -11
- package/src/bollharness/src/scripts/checks/check_fragment_integrity.ts +0 -40
- package/src/bollharness/src/scripts/checks/check_hook_installed.ts +0 -70
- package/src/bollharness/src/scripts/checks/check_issue_closure.ts +0 -51
- package/src/bollharness/src/scripts/checks/check_mcp_parity.ts +0 -11
- package/src/bollharness/src/scripts/checks/check_security.ts +0 -54
- package/src/bollharness/src/scripts/checks/check_skill_parity.ts +0 -11
- package/src/bollharness/src/scripts/checks/check_versions.ts +0 -11
- package/src/bollharness/src/scripts/checks/finding.ts +0 -35
- package/src/bollharness/src/scripts/checks/next_decision_number.ts +0 -24
- package/src/bollharness/src/scripts/checks/regenerate_magic_docs.ts +0 -11
- package/src/bollharness/src/scripts/ci/detect_rebaseline_triggers.ts +0 -14
- package/src/bollharness/src/scripts/ci/scan_subprocess_cfg.ts +0 -14
- package/src/bollharness/src/scripts/ci/scan_verify_artifacts.ts +0 -14
- package/src/bollharness/src/scripts/ci/scan_yaml_schema.ts +0 -14
- package/src/bollharness/src/scripts/context_router.ts +0 -76
- package/src/bollharness/src/scripts/deploy-guard.ts +0 -182
- package/src/bollharness/src/scripts/guard-feedback.ts +0 -215
- package/src/bollharness/src/scripts/guard_router.ts +0 -194
- package/src/bollharness/src/scripts/hooks/_hook_output.js +0 -3
- package/src/bollharness/src/scripts/hooks/_hook_output.ts +0 -11
- package/src/bollharness/src/scripts/hooks/auto-python3.ts +0 -10
- package/src/bollharness/src/scripts/hooks/deploy-progress-on-session-end.ts +0 -10
- package/src/bollharness/src/scripts/hooks/failure-analyzer.ts +0 -10
- package/src/bollharness/src/scripts/hooks/gate-judgment-inject.ts +0 -111
- package/src/bollharness/src/scripts/hooks/gate-transition-judgment.ts +0 -74
- package/src/bollharness/src/scripts/hooks/inbox-ack.ts +0 -10
- package/src/bollharness/src/scripts/hooks/inbox-inject-on-start.ts +0 -10
- package/src/bollharness/src/scripts/hooks/inbox-validate.ts +0 -10
- package/src/bollharness/src/scripts/hooks/inbox-write-ledger.ts +0 -10
- package/src/bollharness/src/scripts/hooks/initializer-agent.ts +0 -10
- package/src/bollharness/src/scripts/hooks/loop-detection.ts +0 -83
- package/src/bollharness/src/scripts/hooks/owner-guard.ts +0 -10
- package/src/bollharness/src/scripts/hooks/precompact.ts +0 -10
- package/src/bollharness/src/scripts/hooks/review-agent-gatekeeper.ts +0 -10
- package/src/bollharness/src/scripts/hooks/risk-tracker.ts +0 -121
- package/src/bollharness/src/scripts/hooks/sanitize-on-read.ts +0 -10
- package/src/bollharness/src/scripts/hooks/session-reflection.ts +0 -12
- package/src/bollharness/src/scripts/hooks/session-start-magic-docs.ts +0 -12
- package/src/bollharness/src/scripts/hooks/session-start-reset-risk.ts +0 -12
- package/src/bollharness/src/scripts/hooks/session-start-toolkit-reminder.ts +0 -12
- package/src/bollharness/src/scripts/hooks/stop-evaluator.ts +0 -164
- package/src/bollharness/src/scripts/hooks/tool-call-counter.ts +0 -10
- package/src/bollharness/src/scripts/hooks/trace-analyzer.ts +0 -14
- package/src/bollharness/src/scripts/install/install-trust-token.ts +0 -13
- package/src/bollharness/src/scripts/install/multi_project_registry.ts +0 -13
- package/src/bollharness/src/scripts/install/phase2_auto.ts +0 -28
- package/src/bollharness/src/scripts/install/pre_commit_installer.ts +0 -10
- package/src/bollharness/src/scripts/install/tier_selector.ts +0 -10
- package/src/bollharness/src/scripts/install/transcript_miner.ts +0 -13
- package/src/bollharness/src/scripts/lib/claim_patterns.ts +0 -11
- package/src/bollharness/src/scripts/lib/sanitize_patterns.ts +0 -13
- package/src/bollharness/src/scripts/sanitize.ts +0 -9
- package/src/bollharness/templates/persona/default.json +0 -19
- package/src/bollharness/templates/scaffold/.gitignore.append +0 -16
- package/src/bollharness/templates/scaffold/CLAUDE.md +0 -89
- package/src/bollharness-integration/channel-judgment-engine.ts +0 -634
- package/src/bollharness-integration/context-chain-router.ts +0 -474
- package/src/bollharness-integration/context-router-judgment.ts +0 -339
- package/src/bollharness-integration/context-router.ts +0 -583
- package/src/bollharness-integration/gate-state-machine.ts +0 -444
- package/src/bollharness-integration/gate-transition-hooks.ts +0 -137
- package/src/bollharness-integration/guard-checker.ts +0 -451
- package/src/bollharness-integration/index.ts +0 -195
- package/src/bollharness-integration/integration.ts +0 -538
- package/src/bollharness-integration/judgment-prompts.yaml +0 -535
- package/src/bollharness-integration/llm-judgment-engine.ts +0 -712
- package/src/bollharness-integration/skill-adapter.ts +0 -646
- package/src/bootstrap/bootstrap.ts +0 -132
- package/src/bootstrap/context-collector.ts +0 -342
- package/src/bootstrap/lifecycle-hooks.ts +0 -176
- package/src/bootstrap/project-context.ts +0 -163
- package/src/cli/interface.ts +0 -211
- package/src/cli-entry.ts +0 -304
- package/src/constraints/index.ts +0 -6
- package/src/documents/reader.ts +0 -85
- package/src/documents/store.ts +0 -252
- package/src/electron-preload.ts +0 -25
- package/src/electron.ts +0 -200
- package/src/heartbeat/DaemonManager.ts +0 -283
- package/src/heartbeat/HealthMonitor.ts +0 -316
- package/src/heartbeat/StartupVerifier.ts +0 -223
- package/src/heartbeat/Watchdog.ts +0 -208
- package/src/heartbeat/index.ts +0 -109
- package/src/heartbeat/self-improve-bus.ts +0 -110
- package/src/heartbeat/types.ts +0 -82
- package/src/index.ts +0 -1690
- package/src/llm/audio-config-store.ts +0 -246
- package/src/llm/config-store.ts +0 -400
- package/src/llm/llm-judgment-client.ts +0 -470
- package/src/llm/pi-ai.ts +0 -558
- package/src/llm/video-config-store.ts +0 -257
- package/src/network/agent-network.ts +0 -800
- package/src/network/hybrid-messenger.ts +0 -199
- package/src/network/iroh-bootstrap.ts +0 -57
- package/src/network/iroh-discovery.ts +0 -208
- package/src/network/iroh-integration.ts +0 -158
- package/src/network/iroh-transport.ts +0 -637
- package/src/network/known-peers.ts +0 -102
- package/src/network/p2p-direct.ts +0 -240
- package/src/network/p2p-secret.ts +0 -153
- package/src/network/p2p.ts +0 -964
- package/src/network/storage/adapters/json-adapter.ts +0 -454
- package/src/network/storage/index.ts +0 -203
- package/src/network/storage/types.ts +0 -166
- package/src/security/builtin-guards.ts +0 -162
- package/src/security/context-router-tool.ts +0 -122
- package/src/security/react-harness.ts +0 -177
- package/src/security/tool-gate.ts +0 -294
- package/src/social/ant-colony/index.js +0 -19
- package/src/social/channels/ChannelManager.ts +0 -485
- package/src/social/channels/DiapChannelBridge.ts +0 -501
- package/src/social/channels/InterestMatcher.ts +0 -189
- package/src/social/channels/agent-workflow-config.json +0 -214
- package/src/social/channels/agent-workflow-config.yaml +0 -334
- package/src/social/channels/channel-agent-session.ts +0 -407
- package/src/social/channels/channel-heartbeat-agent.ts +0 -622
- package/src/social/channels/diap-doc-parser.ts +0 -282
- package/src/social/channels/harness-workflow-integrator.ts +0 -594
- package/src/social/channels/index.ts +0 -22
- package/src/social/channels/types.ts +0 -115
- package/src/social/global-shared-context.ts +0 -506
- package/src/social/heartbeat.ts +0 -1057
- package/src/social/persona/enhanced-persona.ts +0 -359
- package/src/types.d.ts +0 -12
- package/src/utils/auto-evolve-policy.ts +0 -138
- package/src/utils/auto-update.ts +0 -482
- package/src/utils/clamp.ts +0 -5
- package/src/web/agent-delegate-server.ts +0 -148
- package/src/web/api-config.html +0 -520
- package/src/web/client.js +0 -4898
- package/src/web/components/p2p/P2PModal.tsx +0 -416
- package/src/web/components/p2p/index.ts +0 -566
- package/src/web/components/p2p/index.tsx +0 -297
- package/src/web/components/p2p/p2p-connection.ts +0 -338
- package/src/web/components/p2p/p2p-identity.ts +0 -92
- package/src/web/components/p2p/p2p-manager.ts +0 -147
- package/src/web/components/p2p/p2p-messages.ts +0 -219
- package/src/web/components/p2p/p2p-modal.ts +0 -685
- package/src/web/components/p2p/p2p-store-memory.ts +0 -162
- package/src/web/components/p2p/p2p-tools.ts +0 -315
- package/src/web/components/p2p/types.ts +0 -170
- package/src/web/components/wallet-viem.mjs +0 -118
- package/src/web/design.md +0 -99
- package/src/web/icons/apple-touch-icon.png +0 -0
- package/src/web/icons/favicon-16x16.png +0 -0
- package/src/web/icons/favicon-192x192.png +0 -0
- package/src/web/icons/favicon-32x32.png +0 -0
- package/src/web/icons/favicon-48x48.png +0 -0
- package/src/web/icons/favicon-512x512.png +0 -0
- package/src/web/icons/favicon.icns +0 -0
- package/src/web/icons/favicon.ico +0 -0
- package/src/web/icons/icon.png +0 -0
- package/src/web/icons/image.png +0 -0
- package/src/web/index.html +0 -382
- package/src/web/iroh-delegate-transport.ts +0 -139
- package/src/web/manifest.json +0 -21
- package/src/web/server.ts +0 -5571
- package/src/web/style.css +0 -4455
- package/staging/auto-evolve/clean-001/.review-verdict +0 -9
- package/staging/auto-evolve/clean-001/clean-001.patch +0 -14
- package/staging/auto-evolve/e2e-001/.patch-id +0 -1
- package/staging/auto-evolve/e2e-001/.review-verdict +0 -12
- package/staging/auto-evolve/e2e-001/e2e-001.patch +0 -11
- package/staging/auto-evolve/test-bad/.review-verdict +0 -12
- package/staging/auto-evolve/test-bad/test-bad.patch +0 -11
- package/tsconfig.cli.json +0 -16
- package/tsconfig.electron.json +0 -20
- package/tsconfig.json +0 -18
|
@@ -1,451 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Guard Checker - Port of Bollharness checks to Bolloon guardrails
|
|
3
|
-
*
|
|
4
|
-
* Transforms bollharness's 15+ check functions into Bolloon's guardrail system.
|
|
5
|
-
*
|
|
6
|
-
* Key concepts:
|
|
7
|
-
* - Finding: bollharness's issue report structure
|
|
8
|
-
* - Guardrail: Bolloon's pre/post execution check interface
|
|
9
|
-
* - Guard Map: Path → Check[] routing
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
import * as fs from 'fs';
|
|
13
|
-
import * as path from 'path';
|
|
14
|
-
|
|
15
|
-
export type Severity = 'P0' | 'P1' | 'P2';
|
|
16
|
-
|
|
17
|
-
export interface Finding {
|
|
18
|
-
severity: Severity;
|
|
19
|
-
message: string;
|
|
20
|
-
file: string;
|
|
21
|
-
line?: number;
|
|
22
|
-
blocking: boolean;
|
|
23
|
-
category: string;
|
|
24
|
-
problem_class: string;
|
|
25
|
-
required_skills: string[];
|
|
26
|
-
required_reads: string[];
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export interface GuardFinding extends Finding {
|
|
30
|
-
checkName: string;
|
|
31
|
-
checkPath: string;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export interface GuardResult {
|
|
35
|
-
passed: boolean;
|
|
36
|
-
findings: GuardFinding[];
|
|
37
|
-
blockingCount: number;
|
|
38
|
-
highestSeverity: Severity | null;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export interface GuardConfig {
|
|
42
|
-
name: string;
|
|
43
|
-
description: string;
|
|
44
|
-
run: (repoRoot: string, mode?: string) => Finding[];
|
|
45
|
-
category?: string;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export interface GuardCheck {
|
|
49
|
-
name: string;
|
|
50
|
-
description: string;
|
|
51
|
-
paths: string[] | RegExp[];
|
|
52
|
-
run: (filePath: string, content?: string) => GuardFinding[];
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Port of bollharness's Finding interface
|
|
57
|
-
*/
|
|
58
|
-
export function createFinding(params: {
|
|
59
|
-
severity: Severity;
|
|
60
|
-
message: string;
|
|
61
|
-
file: string;
|
|
62
|
-
line?: number;
|
|
63
|
-
blocking?: boolean;
|
|
64
|
-
category?: string;
|
|
65
|
-
problem_class?: string;
|
|
66
|
-
required_skills?: string[];
|
|
67
|
-
required_reads?: string[];
|
|
68
|
-
}): Finding {
|
|
69
|
-
return {
|
|
70
|
-
severity: params.severity,
|
|
71
|
-
message: params.message,
|
|
72
|
-
file: params.file,
|
|
73
|
-
line: params.line,
|
|
74
|
-
blocking: params.blocking ?? false,
|
|
75
|
-
category: params.category ?? 'general',
|
|
76
|
-
problem_class: params.problem_class ?? 'unknown',
|
|
77
|
-
required_skills: params.required_skills ?? [],
|
|
78
|
-
required_reads: params.required_reads ?? [],
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Guard Map - Maps file paths to relevant checks
|
|
84
|
-
* Adapted from bollharness's guard_router.ts
|
|
85
|
-
*/
|
|
86
|
-
export const GUARD_MAP: Record<string, string[]> = {
|
|
87
|
-
'src/agents/': ['check_api_types', 'check_skill_parity'],
|
|
88
|
-
'src/documents/': ['check_doc_freshness', 'check_api_types'],
|
|
89
|
-
'src/network/': ['check_api_types', 'check_versions'],
|
|
90
|
-
'src/constraints/': ['check_api_types', 'check_versions'],
|
|
91
|
-
'src/social/': ['check_api_types', 'check_versions'],
|
|
92
|
-
'docs/': ['check_doc_freshness', 'check_doc_links'],
|
|
93
|
-
'CLAUDE.md': ['check_doc_freshness', 'check_artifact_link'],
|
|
94
|
-
'README.md': ['check_doc_freshness'],
|
|
95
|
-
'docs/decisions/': ['check_artifact_link', 'check_versions'],
|
|
96
|
-
'.boll/': ['check_hook_installed'],
|
|
97
|
-
'src/test/': ['check_api_types', 'check_versions'],
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* Default guards that run for all files
|
|
102
|
-
*/
|
|
103
|
-
export const DEFAULT_GUARDS: string[] = [];
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Category to Skills mapping
|
|
107
|
-
* Maps guard categories to required bollharness skills
|
|
108
|
-
*/
|
|
109
|
-
export const CATEGORY_TO_SKILLS: Record<string, string[]> = {
|
|
110
|
-
closure_semantics: ['lead', 'harness-ops'],
|
|
111
|
-
contract_drift: ['harness-eng', 'harness-eng-test'],
|
|
112
|
-
bridge_boundary: ['harness-bridge', 'harness-ops'],
|
|
113
|
-
policy_freeze: ['lead', 'arch', 'plan-lock'],
|
|
114
|
-
doc_integrity: ['harness-ops'],
|
|
115
|
-
version_drift: ['harness-ops'],
|
|
116
|
-
artifact_linkage: ['lead'],
|
|
117
|
-
governance_bootstrap: ['harness-ops'],
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* Check implementations - Ported from bollharness checks
|
|
122
|
-
*/
|
|
123
|
-
|
|
124
|
-
// Check: API Types
|
|
125
|
-
export function checkApiTypes(filePath: string): GuardFinding[] {
|
|
126
|
-
const findings: GuardFinding[] = [];
|
|
127
|
-
|
|
128
|
-
// Check if API types are consistent
|
|
129
|
-
if (filePath.endsWith('.ts')) {
|
|
130
|
-
const content = fs.readFileSync(filePath, 'utf-8');
|
|
131
|
-
|
|
132
|
-
// Check for TODO/FIXME that might indicate type issues
|
|
133
|
-
const todoMatches = content.match(/\/\/\s*(TODO|FIXME|HACK|XXX):/g);
|
|
134
|
-
if (todoMatches) {
|
|
135
|
-
findings.push(createFinding({
|
|
136
|
-
severity: 'P2',
|
|
137
|
-
message: `Found ${todoMatches.length} development markers in code`,
|
|
138
|
-
file: filePath,
|
|
139
|
-
blocking: false,
|
|
140
|
-
category: 'doc_integrity',
|
|
141
|
-
problem_class: 'technical_debt',
|
|
142
|
-
required_skills: ['harness-eng'],
|
|
143
|
-
}) as GuardFinding);
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
return findings;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
// Check: Document Freshness
|
|
151
|
-
export function checkDocFreshness(filePath: string): GuardFinding[] {
|
|
152
|
-
const findings: GuardFinding[] = [];
|
|
153
|
-
|
|
154
|
-
if (filePath.endsWith('.md')) {
|
|
155
|
-
const content = fs.readFileSync(filePath, 'utf-8');
|
|
156
|
-
|
|
157
|
-
// Check for outdated markers
|
|
158
|
-
const outdatedMatches = content.match(/\[OUTDATED\]|\[DEPRECATED\]/gi);
|
|
159
|
-
if (outdatedMatches) {
|
|
160
|
-
findings.push(createFinding({
|
|
161
|
-
severity: 'P1',
|
|
162
|
-
message: 'Document contains outdated/deprecated markers',
|
|
163
|
-
file: filePath,
|
|
164
|
-
blocking: false,
|
|
165
|
-
category: 'doc_integrity',
|
|
166
|
-
problem_class: 'stale_content',
|
|
167
|
-
required_skills: ['harness-ops'],
|
|
168
|
-
}) as GuardFinding);
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
// Check for broken links (simplified)
|
|
172
|
-
const linkMatches = content.match(/\[([^\]]+)\]\(([^)]+)\)/g);
|
|
173
|
-
if (linkMatches) {
|
|
174
|
-
for (const link of linkMatches) {
|
|
175
|
-
const urlMatch = link.match(/\(([^)]+)\)/);
|
|
176
|
-
if (urlMatch && urlMatch[1].startsWith('http')) {
|
|
177
|
-
// External links need verification
|
|
178
|
-
findings.push(createFinding({
|
|
179
|
-
severity: 'P2',
|
|
180
|
-
message: `External link needs verification: ${urlMatch[1]}`,
|
|
181
|
-
file: filePath,
|
|
182
|
-
blocking: false,
|
|
183
|
-
category: 'doc_integrity',
|
|
184
|
-
problem_class: 'link_verification',
|
|
185
|
-
required_skills: [],
|
|
186
|
-
}) as GuardFinding);
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
return findings;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
// Check: Skill Parity
|
|
196
|
-
export function checkSkillParity(filePath: string): GuardFinding[] {
|
|
197
|
-
const findings: GuardFinding[] = [];
|
|
198
|
-
|
|
199
|
-
// Check if skills are properly exported
|
|
200
|
-
if (filePath.includes('skills')) {
|
|
201
|
-
const content = fs.readFileSync(filePath, 'utf-8');
|
|
202
|
-
|
|
203
|
-
// Check for missing exports
|
|
204
|
-
if (!content.includes('export')) {
|
|
205
|
-
findings.push(createFinding({
|
|
206
|
-
severity: 'P2',
|
|
207
|
-
message: 'Skill file should export functions',
|
|
208
|
-
file: filePath,
|
|
209
|
-
blocking: false,
|
|
210
|
-
category: 'contract_drift',
|
|
211
|
-
problem_class: 'missing_export',
|
|
212
|
-
required_skills: ['harness-eng'],
|
|
213
|
-
}) as GuardFinding);
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
return findings;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
// Check: Versions
|
|
221
|
-
export function checkVersions(filePath: string): GuardFinding[] {
|
|
222
|
-
const findings: GuardFinding[] = [];
|
|
223
|
-
|
|
224
|
-
if (filePath === 'package.json') {
|
|
225
|
-
const content = fs.readFileSync(filePath, 'utf-8');
|
|
226
|
-
|
|
227
|
-
try {
|
|
228
|
-
const pkg = JSON.parse(content);
|
|
229
|
-
|
|
230
|
-
// Check for version consistency
|
|
231
|
-
if (!pkg.version) {
|
|
232
|
-
findings.push(createFinding({
|
|
233
|
-
severity: 'P1',
|
|
234
|
-
message: 'package.json missing version field',
|
|
235
|
-
file: filePath,
|
|
236
|
-
blocking: true,
|
|
237
|
-
category: 'version_drift',
|
|
238
|
-
problem_class: 'missing_version',
|
|
239
|
-
required_skills: ['harness-ops'],
|
|
240
|
-
}) as GuardFinding);
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
// Check for missing dependencies
|
|
244
|
-
if (!pkg.dependencies || Object.keys(pkg.dependencies).length === 0) {
|
|
245
|
-
findings.push(createFinding({
|
|
246
|
-
severity: 'P2',
|
|
247
|
-
message: 'package.json has no dependencies',
|
|
248
|
-
file: filePath,
|
|
249
|
-
blocking: false,
|
|
250
|
-
category: 'version_drift',
|
|
251
|
-
problem_class: 'missing_deps',
|
|
252
|
-
required_skills: [],
|
|
253
|
-
}) as GuardFinding);
|
|
254
|
-
}
|
|
255
|
-
} catch {
|
|
256
|
-
findings.push(createFinding({
|
|
257
|
-
severity: 'P0',
|
|
258
|
-
message: 'package.json is invalid JSON',
|
|
259
|
-
file: filePath,
|
|
260
|
-
blocking: true,
|
|
261
|
-
category: 'governance_bootstrap',
|
|
262
|
-
problem_class: 'parse_error',
|
|
263
|
-
required_skills: ['harness-ops'],
|
|
264
|
-
}) as GuardFinding);
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
return findings;
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
// Check: Hook Installed
|
|
272
|
-
export function checkHookInstalled(filePath: string): GuardFinding[] {
|
|
273
|
-
const findings: GuardFinding[] = [];
|
|
274
|
-
|
|
275
|
-
if (filePath.includes('.boll/settings')) {
|
|
276
|
-
const content = fs.readFileSync(filePath, 'utf-8');
|
|
277
|
-
|
|
278
|
-
// Check for required hooks
|
|
279
|
-
const requiredHooks = ['PostToolUse', 'PreToolUse', 'Stop', 'SessionEnd'];
|
|
280
|
-
for (const hook of requiredHooks) {
|
|
281
|
-
if (!content.includes(hook)) {
|
|
282
|
-
findings.push(createFinding({
|
|
283
|
-
severity: 'P1',
|
|
284
|
-
message: `Required hook ${hook} not found in settings`,
|
|
285
|
-
file: filePath,
|
|
286
|
-
blocking: false,
|
|
287
|
-
category: 'governance_bootstrap',
|
|
288
|
-
problem_class: 'missing_hook',
|
|
289
|
-
required_skills: ['harness-ops'],
|
|
290
|
-
}) as GuardFinding);
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
return findings;
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
// Check: Artifact Linkage
|
|
299
|
-
export function checkArtifactLink(filePath: string): GuardFinding[] {
|
|
300
|
-
const findings: GuardFinding[] = [];
|
|
301
|
-
|
|
302
|
-
if (filePath.endsWith('.md') || filePath.includes('decisions')) {
|
|
303
|
-
const content = fs.readFileSync(filePath, 'utf-8');
|
|
304
|
-
|
|
305
|
-
// Check for ADR references
|
|
306
|
-
const adrMatches = content.match(/ADR-\d+/gi);
|
|
307
|
-
if (adrMatches && adrMatches.length > 5) {
|
|
308
|
-
findings.push(createFinding({
|
|
309
|
-
severity: 'P2',
|
|
310
|
-
message: `Found ${adrMatches.length} ADR references - verify all are linked`,
|
|
311
|
-
file: filePath,
|
|
312
|
-
blocking: false,
|
|
313
|
-
category: 'artifact_linkage',
|
|
314
|
-
problem_class: 'link_verification',
|
|
315
|
-
required_skills: ['lead'],
|
|
316
|
-
}) as GuardFinding);
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
return findings;
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
/**
|
|
324
|
-
* All available checks
|
|
325
|
-
*/
|
|
326
|
-
export const ALL_CHECKS: Record<string, (filePath: string) => GuardFinding[]> = {
|
|
327
|
-
check_api_types: checkApiTypes,
|
|
328
|
-
check_doc_freshness: checkDocFreshness,
|
|
329
|
-
check_skill_parity: checkSkillParity,
|
|
330
|
-
check_versions: checkVersions,
|
|
331
|
-
check_hook_installed: checkHookInstalled,
|
|
332
|
-
check_artifact_link: checkArtifactLink,
|
|
333
|
-
};
|
|
334
|
-
|
|
335
|
-
/**
|
|
336
|
-
* Route file path to relevant checks
|
|
337
|
-
* Adapted from bollharness's route() function
|
|
338
|
-
*/
|
|
339
|
-
export function route(filePath: string): string[] {
|
|
340
|
-
const matched: string[] = [];
|
|
341
|
-
const sortedPatterns = Object.keys(GUARD_MAP).sort((a, b) => b.length - a.length);
|
|
342
|
-
|
|
343
|
-
for (const pattern of sortedPatterns) {
|
|
344
|
-
if (filePath.startsWith(pattern) || filePath === pattern.replace(/\/$/, '')) {
|
|
345
|
-
matched.push(...GUARD_MAP[pattern]);
|
|
346
|
-
}
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
if (matched.length === 0) {
|
|
350
|
-
return [...DEFAULT_GUARDS];
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
return [...new Set(matched)];
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
/**
|
|
357
|
-
* Run guards for a file
|
|
358
|
-
*/
|
|
359
|
-
export async function runGuards(filePath: string): Promise<GuardResult> {
|
|
360
|
-
const guardNames = route(filePath);
|
|
361
|
-
const findings: GuardFinding[] = [];
|
|
362
|
-
|
|
363
|
-
for (const name of guardNames) {
|
|
364
|
-
const checkFn = ALL_CHECKS[name];
|
|
365
|
-
if (checkFn) {
|
|
366
|
-
try {
|
|
367
|
-
const result = checkFn(filePath);
|
|
368
|
-
for (const finding of result) {
|
|
369
|
-
findings.push({
|
|
370
|
-
...finding,
|
|
371
|
-
checkName: name,
|
|
372
|
-
checkPath: filePath,
|
|
373
|
-
});
|
|
374
|
-
}
|
|
375
|
-
} catch (error) {
|
|
376
|
-
findings.push({
|
|
377
|
-
severity: 'P0',
|
|
378
|
-
message: `Guard ${name} failed: ${error}`,
|
|
379
|
-
file: filePath,
|
|
380
|
-
blocking: true,
|
|
381
|
-
category: 'governance_bootstrap',
|
|
382
|
-
problem_class: 'guard_error',
|
|
383
|
-
required_skills: ['harness-ops'],
|
|
384
|
-
required_reads: [],
|
|
385
|
-
checkName: name,
|
|
386
|
-
checkPath: filePath,
|
|
387
|
-
});
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
const blockingCount = findings.filter(f => f.blocking).length;
|
|
393
|
-
const severities = findings.map(f => f.severity);
|
|
394
|
-
const severityOrder: Record<string, number> = { P0: 0, P1: 1, P2: 2 };
|
|
395
|
-
const highestSeverity = severities.length > 0
|
|
396
|
-
? severities.sort((a, b) => severityOrder[a] - severityOrder[b])[0] as Severity
|
|
397
|
-
: null;
|
|
398
|
-
|
|
399
|
-
return {
|
|
400
|
-
passed: blockingCount === 0,
|
|
401
|
-
findings,
|
|
402
|
-
blockingCount,
|
|
403
|
-
highestSeverity,
|
|
404
|
-
};
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
/**
|
|
408
|
-
* GuardChecker class for integration with Bolloon's constraint system
|
|
409
|
-
*/
|
|
410
|
-
export class GuardChecker {
|
|
411
|
-
private checksDir: string;
|
|
412
|
-
private enabledChecks: Set<string>;
|
|
413
|
-
|
|
414
|
-
constructor(checksDir?: string) {
|
|
415
|
-
this.checksDir = checksDir || process.cwd();
|
|
416
|
-
this.enabledChecks = new Set(Object.keys(ALL_CHECKS));
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
enableCheck(name: string): void {
|
|
420
|
-
this.enabledChecks.add(name);
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
disableCheck(name: string): void {
|
|
424
|
-
this.enabledChecks.delete(name);
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
async check(filePath: string): Promise<GuardResult> {
|
|
428
|
-
const guardNames = route(filePath).filter(name => this.enabledChecks.has(name));
|
|
429
|
-
const findings: GuardFinding[] = [];
|
|
430
|
-
|
|
431
|
-
for (const name of guardNames) {
|
|
432
|
-
const checkFn = ALL_CHECKS[name];
|
|
433
|
-
if (checkFn) {
|
|
434
|
-
const result = checkFn(filePath);
|
|
435
|
-
findings.push(...result.map(f => ({
|
|
436
|
-
...f,
|
|
437
|
-
checkName: name,
|
|
438
|
-
checkPath: filePath,
|
|
439
|
-
})));
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
const blockingCount = findings.filter(f => f.blocking).length;
|
|
444
|
-
return {
|
|
445
|
-
passed: blockingCount === 0,
|
|
446
|
-
findings,
|
|
447
|
-
blockingCount,
|
|
448
|
-
highestSeverity: findings.length > 0 ? 'P1' : null,
|
|
449
|
-
};
|
|
450
|
-
}
|
|
451
|
-
}
|
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Bollharness Integration for Bolloon - Enhanced with Pi Ecosystem
|
|
3
|
-
*
|
|
4
|
-
* This module provides compatibility between Bolloon's multi-agent system
|
|
5
|
-
* and Bollharness's governance framework, now with deep Pi ecosystem integration.
|
|
6
|
-
*
|
|
7
|
-
* Pi Ecosystem Integration:
|
|
8
|
-
* - MCP tools via pi-ecosystem-mcp (white-box tool calling)
|
|
9
|
-
* - Goal tracking via pi-ecosystem-goals (persistent workflow)
|
|
10
|
-
* - Subagents via pi-ecosystem-subagents (tmux-based light agents)
|
|
11
|
-
* - Ant Colony via pi-ecosystem-colony (multi-agent signal protocol)
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
export { BollharnessIntegration, createBollharnessIntegration, BollharnessHooks } from './integration.js';
|
|
15
|
-
export { GateStateMachine, type Gate } from './gate-state-machine.js';
|
|
16
|
-
export { GuardChecker, type GuardFinding, type GuardResult } from './guard-checker.js';
|
|
17
|
-
export { ContextRouter } from './context-router.js';
|
|
18
|
-
export { SkillAdapter, type AdaptedSkill, type SkillTriggers, type HarnessSkillMetadata } from './skill-adapter.js';
|
|
19
|
-
|
|
20
|
-
// Gate transition hooks
|
|
21
|
-
export {
|
|
22
|
-
initializeGateHooks,
|
|
23
|
-
onGateTransition,
|
|
24
|
-
offGateTransition,
|
|
25
|
-
executeGateTransitionHooks,
|
|
26
|
-
addGateHook,
|
|
27
|
-
clearGateHooks,
|
|
28
|
-
listGateHooks,
|
|
29
|
-
type GateHookConfig,
|
|
30
|
-
type GateTransitionEvent,
|
|
31
|
-
} from './gate-transition-hooks.js';
|
|
32
|
-
|
|
33
|
-
// Judgment-aware context router exports
|
|
34
|
-
export {
|
|
35
|
-
getJudgmentsForPath,
|
|
36
|
-
getJudgmentsForFragment,
|
|
37
|
-
getJudgmentsForContextRequest,
|
|
38
|
-
getCoreJudgmentsForSession,
|
|
39
|
-
generateJudgmentInjection,
|
|
40
|
-
type JudgmentInjectOptions,
|
|
41
|
-
type JudgmentContextResult,
|
|
42
|
-
} from './context-router-judgment.js';
|
|
43
|
-
|
|
44
|
-
// Pi Ecosystem re-exports for convenience
|
|
45
|
-
export {
|
|
46
|
-
initializeMcpAdapter,
|
|
47
|
-
discoverMcpServers,
|
|
48
|
-
registerServer,
|
|
49
|
-
registerTool,
|
|
50
|
-
listTools,
|
|
51
|
-
hasTool,
|
|
52
|
-
getTool,
|
|
53
|
-
executeTool,
|
|
54
|
-
getToolCallLog,
|
|
55
|
-
getAdapterStatus,
|
|
56
|
-
type McpTool,
|
|
57
|
-
type McpServerConfig,
|
|
58
|
-
} from '../pi-ecosystem-mcp/index.js';
|
|
59
|
-
|
|
60
|
-
export {
|
|
61
|
-
createGoal,
|
|
62
|
-
createGoalQueue,
|
|
63
|
-
getCurrentGoal,
|
|
64
|
-
startCurrentGoal,
|
|
65
|
-
completeCurrentGoal,
|
|
66
|
-
failCurrentGoal,
|
|
67
|
-
cutoffCurrentGoal,
|
|
68
|
-
pauseCurrentGoal,
|
|
69
|
-
checkBudget,
|
|
70
|
-
getGoalStats,
|
|
71
|
-
getQueueSummary,
|
|
72
|
-
loadGoals,
|
|
73
|
-
clearGoals,
|
|
74
|
-
compactQueue,
|
|
75
|
-
loadTemplates,
|
|
76
|
-
createFromTemplate,
|
|
77
|
-
nudgeCurrentGoal,
|
|
78
|
-
type Goal,
|
|
79
|
-
type GoalBudget,
|
|
80
|
-
type GoalQueue,
|
|
81
|
-
type WorkflowTemplate,
|
|
82
|
-
} from '../pi-ecosystem-goals/index.js';
|
|
83
|
-
|
|
84
|
-
export {
|
|
85
|
-
createSubagent,
|
|
86
|
-
startSubagent,
|
|
87
|
-
delegateTask,
|
|
88
|
-
getSubagent,
|
|
89
|
-
listSubagents,
|
|
90
|
-
listRunningSubagents,
|
|
91
|
-
terminateSubagent,
|
|
92
|
-
getStats as getSubagentStats,
|
|
93
|
-
parallelDelegate,
|
|
94
|
-
splitTask,
|
|
95
|
-
type Subagent,
|
|
96
|
-
type SubagentResult,
|
|
97
|
-
} from '../pi-ecosystem-subagents/index.js';
|
|
98
|
-
|
|
99
|
-
// 2026-06-11: 蚁群模块 (pi-ecosystem-colony) 已被用户删除, 移除对应 re-export 防止启动失败
|
|
100
|
-
// export {
|
|
101
|
-
// registerAnt, antScouting, antWorking, antReviewing, antComplete, antFail, antAbort, antTick,
|
|
102
|
-
// createTask, dispatchTask, recordResult, getAnt, listAnts, listAntsByRole, listAntsBySignal,
|
|
103
|
-
// getActiveAnts, getTask, listTasks, getSignalHistory, getColonyStatus, getColonyDump,
|
|
104
|
-
// persistColony, loadColony, onColonyEvent, offColonyEvent,
|
|
105
|
-
// type Ant, type ColonyTask, type ColonySignalEvent, type ColonySignal, type AntRole,
|
|
106
|
-
// } from '../pi-ecosystem-colony/index.js';
|
|
107
|
-
|
|
108
|
-
// Judgment exports
|
|
109
|
-
export {
|
|
110
|
-
createJudgment,
|
|
111
|
-
getAllJudgments,
|
|
112
|
-
getJudgmentsByType,
|
|
113
|
-
getJudgmentsForContext,
|
|
114
|
-
getCombinedJudgments,
|
|
115
|
-
calculateConfidence,
|
|
116
|
-
buildValueFunction,
|
|
117
|
-
getValueFunction,
|
|
118
|
-
getJudgmentStats,
|
|
119
|
-
loadFragmentJudgments,
|
|
120
|
-
} from '../pi-ecosystem-judgment/index.js';
|
|
121
|
-
|
|
122
|
-
export type {
|
|
123
|
-
Judgment,
|
|
124
|
-
JudgmentEvidence,
|
|
125
|
-
DistillationRequest,
|
|
126
|
-
ValueFunction,
|
|
127
|
-
} from '../pi-ecosystem-judgment/index.js';
|
|
128
|
-
|
|
129
|
-
// Distillation exports
|
|
130
|
-
export {
|
|
131
|
-
initializeDistillation,
|
|
132
|
-
detectTrigger,
|
|
133
|
-
isJudgmentSignal,
|
|
134
|
-
distillInput,
|
|
135
|
-
processFeedback,
|
|
136
|
-
} from '../pi-ecosystem-judgment/distillation.js';
|
|
137
|
-
|
|
138
|
-
// Decision exports
|
|
139
|
-
export {
|
|
140
|
-
setConfidenceThreshold,
|
|
141
|
-
evaluateDecision,
|
|
142
|
-
submitDecisionResponse,
|
|
143
|
-
parseDecisionResponse,
|
|
144
|
-
queryInternalAgents,
|
|
145
|
-
processHumanFeedback,
|
|
146
|
-
getPendingDecisions,
|
|
147
|
-
getDecisionRequest,
|
|
148
|
-
} from '../pi-ecosystem-judgment/decision.js';
|
|
149
|
-
|
|
150
|
-
export type {
|
|
151
|
-
DecisionLevel,
|
|
152
|
-
DecisionRequest,
|
|
153
|
-
DecisionResponse,
|
|
154
|
-
AgentConsultationResult,
|
|
155
|
-
} from '../pi-ecosystem-judgment/decision.js';
|
|
156
|
-
|
|
157
|
-
/**
|
|
158
|
-
* Pi Ecosystem Configuration
|
|
159
|
-
*/
|
|
160
|
-
export interface PiEcosystemConfig {
|
|
161
|
-
mcpEnabled: boolean;
|
|
162
|
-
goalsEnabled: boolean;
|
|
163
|
-
subagentsEnabled: boolean;
|
|
164
|
-
colonyEnabled: boolean;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
* Combined Pi Ecosystem status
|
|
169
|
-
*/
|
|
170
|
-
export interface PiEcosystemStatus {
|
|
171
|
-
initialized: boolean;
|
|
172
|
-
mcp: {
|
|
173
|
-
serverCount: number;
|
|
174
|
-
toolCount: number;
|
|
175
|
-
runningServers: string[];
|
|
176
|
-
};
|
|
177
|
-
goals: {
|
|
178
|
-
total: number;
|
|
179
|
-
pending: number;
|
|
180
|
-
inProgress: number;
|
|
181
|
-
completed: number;
|
|
182
|
-
};
|
|
183
|
-
subagents: {
|
|
184
|
-
total: number;
|
|
185
|
-
running: number;
|
|
186
|
-
completed: number;
|
|
187
|
-
failed: number;
|
|
188
|
-
};
|
|
189
|
-
colony: {
|
|
190
|
-
antCount: number;
|
|
191
|
-
activeAnts: number;
|
|
192
|
-
taskCount: number;
|
|
193
|
-
activeTasks: number;
|
|
194
|
-
};
|
|
195
|
-
}
|