@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.
- package/package.json +2 -2
- package/.auto-evolve-calls +0 -1
- package/.last-auto-evolve-baseline +0 -1
- package/.playwright-mcp/page-2026-06-16T07-51-45-706Z.yml +0 -130
- package/.playwright-mcp/page-2026-06-16T07-56-44-116Z.yml +0 -131
- package/Bolloon.md +0 -144
- package/Dive-into/CITATION.cff +0 -17
- package/Dive-into/LICENSE +0 -25
- package/Dive-into/README.md +0 -598
- package/Dive-into/README_zh.md +0 -599
- package/Dive-into/assets/context.png +0 -0
- package/Dive-into/assets/extensibility.png +0 -0
- package/Dive-into/assets/iteration.png +0 -0
- package/Dive-into/assets/layered_architecture.png +0 -0
- package/Dive-into/assets/main_structure.png +0 -0
- package/Dive-into/assets/permission.png +0 -0
- package/Dive-into/assets/session_compact.png +0 -0
- package/Dive-into/assets/subagent.png +0 -0
- package/Dive-into/paper/Dive_into_Claude_Code.pdf +0 -0
- 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 -33
- package/scripts/auto-evolve-loop.ts +0 -481
- package/scripts/build-web.ts +0 -116
- package/scripts/diff-reviewer.ts +0 -159
- package/scripts/validate-system-prompt.ts +0 -142
- 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/permission-mode.ts +0 -127
- package/src/agents/pi-sdk.ts +0 -2895
- package/src/agents/pre-tool-validator.ts +0 -213
- 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 -766
- 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 -135
- package/src/bootstrap/context-collector.ts +0 -371
- package/src/bootstrap/context-hierarchy.ts +0 -283
- package/src/bootstrap/lifecycle-hooks.ts +0 -289
- package/src/bootstrap/project-context.ts +0 -171
- package/src/cli/interface.ts +0 -211
- package/src/cli-entry.ts +0 -304
- package/src/constraints/index.ts +0 -6
- package/src/context-compaction/auto-compact.ts +0 -153
- package/src/context-compaction/budget-gate.ts +0 -32
- package/src/context-compaction/budget-reduce.ts +0 -37
- package/src/context-compaction/context-collapse.ts +0 -72
- package/src/context-compaction/index.ts +0 -24
- package/src/context-compaction/microcompact.ts +0 -54
- package/src/context-compaction/pipeline.ts +0 -133
- package/src/context-compaction/snip.ts +0 -51
- package/src/context-compaction/token-estimator.ts +0 -36
- package/src/context-compaction/types.ts +0 -99
- 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 -317
- 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 -1724
- 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 -471
- package/src/llm/pi-ai.ts +0 -653
- package/src/llm/system-prompt/health.ts +0 -159
- package/src/llm/system-prompt/layers/channel/local.md +0 -14
- package/src/llm/system-prompt/layers/channel/p2p-agent.md +0 -18
- package/src/llm/system-prompt/layers/channel/p2p-visitor.md +0 -19
- package/src/llm/system-prompt/layers/core/artifacts_storage.md +0 -89
- package/src/llm/system-prompt/layers/core/evenhandedness.md +0 -21
- package/src/llm/system-prompt/layers/core/hibs_reminders.md +0 -15
- package/src/llm/system-prompt/layers/core/identity.md +0 -37
- package/src/llm/system-prompt/layers/core/knowledge.md +0 -17
- package/src/llm/system-prompt/layers/core/memory_system.md +0 -12
- package/src/llm/system-prompt/layers/core/network_filesystem.md +0 -28
- package/src/llm/system-prompt/layers/core/refusal.md +0 -37
- package/src/llm/system-prompt/layers/core/tone.md +0 -31
- package/src/llm/system-prompt/layers/core/tools.thin.md +0 -13
- package/src/llm/system-prompt/layers/core/wellbeing.md +0 -41
- package/src/llm/system-prompt/layers/role/architect.md +0 -20
- package/src/llm/system-prompt/layers/role/expert.md +0 -19
- package/src/llm/system-prompt/layers/role/implementer.md +0 -15
- package/src/llm/system-prompt/layers/role/security.md +0 -15
- package/src/llm/system-prompt/layers/tool/artifacts.md +0 -72
- package/src/llm/system-prompt/layers/tool/bash.md +0 -25
- package/src/llm/system-prompt/layers/tool/hibs_api.md +0 -171
- package/src/llm/system-prompt/layers/tool/image_search.md +0 -70
- package/src/llm/system-prompt/layers/tool/manifest.md +0 -89
- package/src/llm/system-prompt/layers/tool/mcp_apps.md +0 -53
- package/src/llm/system-prompt/layers/tool/web_search.md +0 -83
- package/src/llm/system-prompt/registry.ts +0 -325
- package/src/llm/system-prompt/strip-hibsml.ts +0 -52
- package/src/llm/tool-manifest/ask_user_input.ts +0 -37
- package/src/llm/tool-manifest/bash.ts +0 -25
- package/src/llm/tool-manifest/create_file.ts +0 -26
- package/src/llm/tool-manifest/fetch_sports_data.ts +0 -28
- package/src/llm/tool-manifest/image_search.ts +0 -26
- package/src/llm/tool-manifest/index.ts +0 -88
- package/src/llm/tool-manifest/mcp.ts +0 -46
- package/src/llm/tool-manifest/message_compose.ts +0 -33
- package/src/llm/tool-manifest/places.ts +0 -86
- package/src/llm/tool-manifest/present_files.ts +0 -23
- package/src/llm/tool-manifest/recipe.ts +0 -42
- package/src/llm/tool-manifest/recommend_apps.ts +0 -25
- package/src/llm/tool-manifest/str_replace.ts +0 -29
- package/src/llm/tool-manifest/types.ts +0 -52
- package/src/llm/tool-manifest/view.ts +0 -26
- package/src/llm/tool-manifest/weather.ts +0 -29
- package/src/llm/tool-manifest/web.ts +0 -54
- 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 -262
- package/src/network/p2p-secret.ts +0 -153
- package/src/network/p2p.ts +0 -964
- package/src/network/source-intent-broadcaster.ts +0 -242
- package/src/network/source-intent.ts +0 -167
- 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/input-scanner.ts +0 -287
- 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 -2352
- package/src/web/client.ts +0 -4326
- 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 -373
- package/src/web/iroh-delegate-transport.ts +0 -139
- package/src/web/manifest.json +0 -21
- package/src/web/server.ts +0 -5731
- package/src/web/style.css +0 -4737
- package/src/web/ui/message-renderer.ts +0 -540
- package/src/web/ui/step-timeline.ts +0 -394
- 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/test-results/.last-run.json +0 -6
- 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
- package/tsconfig.cli.json +0 -16
- package/tsconfig.electron.json +0 -20
- package/tsconfig.json +0 -18
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import * as fs from "fs";
|
|
2
|
-
import * as path from "path";
|
|
3
|
-
export function run(repoRoot, mode = "full") {
|
|
4
|
-
const findings = [];
|
|
5
|
-
const hookFiles = [
|
|
6
|
-
"src/scripts/hooks/loop-detection.ts",
|
|
7
|
-
"src/scripts/hooks/risk-tracker.ts",
|
|
8
|
-
"src/scripts/hooks/stop-evaluator.ts",
|
|
9
|
-
"src/scripts/hooks/guard-feedback.ts",
|
|
10
|
-
"src/scripts/hooks/deploy-guard.ts",
|
|
11
|
-
];
|
|
12
|
-
const settingsFile = path.join(repoRoot, ".boll", "settings.json");
|
|
13
|
-
if (!fs.existsSync(settingsFile)) {
|
|
14
|
-
findings.push({
|
|
15
|
-
severity: "P1",
|
|
16
|
-
message: ".boll/settings.json does not exist",
|
|
17
|
-
file: ".boll/settings.json",
|
|
18
|
-
blocking: false,
|
|
19
|
-
category: "general",
|
|
20
|
-
problem_class: "unknown",
|
|
21
|
-
required_skills: [],
|
|
22
|
-
required_reads: [],
|
|
23
|
-
});
|
|
24
|
-
return findings;
|
|
25
|
-
}
|
|
26
|
-
try {
|
|
27
|
-
const settings = JSON.parse(fs.readFileSync(settingsFile, "utf-8"));
|
|
28
|
-
const registeredHooks = settings.hooks || {};
|
|
29
|
-
for (const [stage, hooks] of Object.entries(registeredHooks)) {
|
|
30
|
-
const hookList = hooks;
|
|
31
|
-
for (const hookGroup of hookList) {
|
|
32
|
-
for (const hook of hookGroup.hooks || []) {
|
|
33
|
-
const cmd = hook.command || "";
|
|
34
|
-
if (cmd.includes("python3") && cmd.includes(".py")) {
|
|
35
|
-
findings.push({
|
|
36
|
-
severity: "P1",
|
|
37
|
-
message: `Hook in ${stage} still references Python script: ${cmd}`,
|
|
38
|
-
file: ".boll/settings.json",
|
|
39
|
-
blocking: false,
|
|
40
|
-
category: "governance_bootstrap",
|
|
41
|
-
problem_class: "unknown",
|
|
42
|
-
required_skills: [],
|
|
43
|
-
required_reads: [],
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
catch (exc) {
|
|
51
|
-
findings.push({
|
|
52
|
-
severity: "P1",
|
|
53
|
-
message: `Failed to parse settings.json: ${exc}`,
|
|
54
|
-
file: ".boll/settings.json",
|
|
55
|
-
blocking: false,
|
|
56
|
-
category: "governance_bootstrap",
|
|
57
|
-
problem_class: "unknown",
|
|
58
|
-
required_skills: [],
|
|
59
|
-
required_reads: [],
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
return findings;
|
|
63
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import * as fs from "fs";
|
|
2
|
-
import * as path from "path";
|
|
3
|
-
export function run(repoRoot, mode = "full") {
|
|
4
|
-
const findings = [];
|
|
5
|
-
const docsIssuesDir = path.join(repoRoot, "docs", "issues");
|
|
6
|
-
if (!fs.existsSync(docsIssuesDir)) {
|
|
7
|
-
return findings;
|
|
8
|
-
}
|
|
9
|
-
const issueFiles = fs.readdirSync(docsIssuesDir).filter(f => f.endsWith(".md"));
|
|
10
|
-
for (const issueFile of issueFiles) {
|
|
11
|
-
const issuePath = path.join(docsIssuesDir, issueFile);
|
|
12
|
-
const content = fs.readFileSync(issuePath, "utf-8");
|
|
13
|
-
const hasStatus = /^(status|State):\s*/im.test(content);
|
|
14
|
-
const hasResolution = /^(resolution|Closed):\s*/im.test(content);
|
|
15
|
-
if (!hasStatus) {
|
|
16
|
-
findings.push({
|
|
17
|
-
severity: "P2",
|
|
18
|
-
message: `Issue ${issueFile} missing status field`,
|
|
19
|
-
file: `docs/issues/${issueFile}`,
|
|
20
|
-
blocking: false,
|
|
21
|
-
category: "doc_integrity",
|
|
22
|
-
problem_class: "unknown",
|
|
23
|
-
required_skills: [],
|
|
24
|
-
required_reads: [],
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
if (!hasResolution) {
|
|
28
|
-
findings.push({
|
|
29
|
-
severity: "P2",
|
|
30
|
-
message: `Issue ${issueFile} missing resolution/closed field`,
|
|
31
|
-
file: `docs/issues/${issueFile}`,
|
|
32
|
-
blocking: false,
|
|
33
|
-
category: "doc_integrity",
|
|
34
|
-
problem_class: "unknown",
|
|
35
|
-
required_skills: [],
|
|
36
|
-
required_reads: [],
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
return findings;
|
|
41
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import * as fs from "fs";
|
|
2
|
-
import * as path from "path";
|
|
3
|
-
const SENSITIVE_PATTERNS = [
|
|
4
|
-
{ pattern: /api[_-]?key["\s:=]+["'][a-zA-Z0-9]{20,}["']/gi, severity: "P0" },
|
|
5
|
-
{ pattern: /password["\s:=]+["'][^"']{8,}["']/gi, severity: "P0" },
|
|
6
|
-
{ pattern: /secret["\s:=]+["'][a-zA-Z0-9]{16,}["']/gi, severity: "P0" },
|
|
7
|
-
{ pattern: /token["\s:=]+["'][a-zA-Z0-9]{20,}["']/gi, severity: "P1" },
|
|
8
|
-
{ pattern: /bearer\s+[a-zA-Z0-9]{20,}/gi, severity: "P1" },
|
|
9
|
-
];
|
|
10
|
-
export function run(repoRoot, mode = "full") {
|
|
11
|
-
const findings = [];
|
|
12
|
-
if (mode !== "full" && mode !== "ci")
|
|
13
|
-
return findings;
|
|
14
|
-
const extensions = [".ts", ".tsx", ".js", ".jsx", ".py", ".json", ".yaml", ".yml"];
|
|
15
|
-
function scanDir(dir) {
|
|
16
|
-
if (!fs.existsSync(dir))
|
|
17
|
-
return;
|
|
18
|
-
const entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
19
|
-
for (const entry of entries) {
|
|
20
|
-
const fullPath = path.join(dir, entry.name);
|
|
21
|
-
if (entry.isDirectory()) {
|
|
22
|
-
if (!entry.name.startsWith(".") && entry.name !== "node_modules") {
|
|
23
|
-
scanDir(fullPath);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
else if (extensions.includes(path.extname(entry.name))) {
|
|
27
|
-
const content = fs.readFileSync(fullPath, "utf-8");
|
|
28
|
-
for (const { pattern, severity } of SENSITIVE_PATTERNS) {
|
|
29
|
-
const matches = content.match(pattern);
|
|
30
|
-
if (matches) {
|
|
31
|
-
findings.push({
|
|
32
|
-
severity,
|
|
33
|
-
message: `Potential secret detected: ${matches[0].slice(0, 30)}...`,
|
|
34
|
-
file: path.relative(repoRoot, fullPath),
|
|
35
|
-
blocking: severity === "P0",
|
|
36
|
-
category: "security",
|
|
37
|
-
problem_class: "secret_exposure",
|
|
38
|
-
required_skills: [],
|
|
39
|
-
required_reads: [],
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
scanDir(repoRoot);
|
|
47
|
-
return findings;
|
|
48
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export function createFinding(params) {
|
|
2
|
-
return {
|
|
3
|
-
severity: params.severity,
|
|
4
|
-
message: params.message,
|
|
5
|
-
file: params.file,
|
|
6
|
-
line: params.line,
|
|
7
|
-
blocking: params.blocking ?? false,
|
|
8
|
-
category: params.category ?? "general",
|
|
9
|
-
problem_class: params.problem_class ?? "unknown",
|
|
10
|
-
required_skills: params.required_skills ?? [],
|
|
11
|
-
required_reads: params.required_reads ?? [],
|
|
12
|
-
};
|
|
13
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { execSync } from "child_process";
|
|
2
|
-
const REPO_ROOT = process.cwd();
|
|
3
|
-
export function main() {
|
|
4
|
-
const args = process.argv.slice(2);
|
|
5
|
-
if (args[0] === "next") {
|
|
6
|
-
try {
|
|
7
|
-
const result = execSync("git log --oneline -1", { cwd: REPO_ROOT, encoding: "utf-8" });
|
|
8
|
-
const match = result.match(/ADR-(\d+)/);
|
|
9
|
-
if (match) {
|
|
10
|
-
const nextNum = parseInt(match[1], 10) + 1;
|
|
11
|
-
console.log(`ADR-${nextNum}`);
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
catch { }
|
|
15
|
-
}
|
|
16
|
-
process.exit(0);
|
|
17
|
-
}
|
|
18
|
-
if (require.main === module) {
|
|
19
|
-
main();
|
|
20
|
-
}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import * as fs from "fs";
|
|
2
|
-
import * as path from "path";
|
|
3
|
-
export const FRAGMENTS_DIR = path.join(__dirname, "..", "context-fragments");
|
|
4
|
-
export const CONTEXT_MAP = {
|
|
5
|
-
"bridge_agent/": ["bridge-constitution"],
|
|
6
|
-
"backend/product/bridge/": ["bridge-constitution"],
|
|
7
|
-
"mcp-server/": ["mcp-parity"],
|
|
8
|
-
"mcp-server-node/": ["mcp-parity"],
|
|
9
|
-
"backend/product/routes/protocol.py": ["protocol-consumers", "contract-consumers"],
|
|
10
|
-
"backend/product/protocol/": ["protocol-consumers"],
|
|
11
|
-
"backend/product/routes/": ["contract-consumers"],
|
|
12
|
-
"backend/product/db/crud_events.py": ["run-events-consumers"],
|
|
13
|
-
"backend/product/auth/": ["auth-consumers"],
|
|
14
|
-
"backend/product/db/": ["db-shared-structures"],
|
|
15
|
-
"backend/product/catalyst/": ["catalyst-distributed"],
|
|
16
|
-
"docs/issues/": ["fixed-three-layers", "closure-checklist"],
|
|
17
|
-
"scenes/": ["scene-fidelity", "two-language"],
|
|
18
|
-
"website/app/[scene]/": ["scene-fidelity", "two-language"],
|
|
19
|
-
"website/components/scene/": ["scene-fidelity", "two-language"],
|
|
20
|
-
"Bolloon.md": ["truth-source-hierarchy"],
|
|
21
|
-
"MEMORY.md": ["truth-source-hierarchy"],
|
|
22
|
-
"docs/INDEX.md": ["truth-source-hierarchy"],
|
|
23
|
-
"mcp-server/pyproject.toml": ["version-sources"],
|
|
24
|
-
"mcp-server-node/package.json": ["version-sources"],
|
|
25
|
-
"website/": ["two-language"],
|
|
26
|
-
"docs/decisions/": ["artifact-linkage"],
|
|
27
|
-
"backend/product/": ["issue-first"],
|
|
28
|
-
"backend/server.py": ["issue-first"],
|
|
29
|
-
"mcp-server/boll_mcp/": ["issue-first"],
|
|
30
|
-
"mcp-server-node/src/": ["issue-first"],
|
|
31
|
-
"website/app/": ["issue-first"],
|
|
32
|
-
};
|
|
33
|
-
export const FALLBACK_FRAGMENTS = ["general-dev-principles"];
|
|
34
|
-
export function match(filePath) {
|
|
35
|
-
if (!filePath)
|
|
36
|
-
return [];
|
|
37
|
-
if (path.isAbsolute(filePath))
|
|
38
|
-
return [];
|
|
39
|
-
const normalized = path.normalize(filePath).replace(/\\/g, "/");
|
|
40
|
-
if (normalized.startsWith("../") || normalized === ".." || normalized.includes("/../")) {
|
|
41
|
-
return [];
|
|
42
|
-
}
|
|
43
|
-
const matched = [];
|
|
44
|
-
const sortedPatterns = Object.keys(CONTEXT_MAP).sort((a, b) => b.length - a.length);
|
|
45
|
-
for (const pattern of sortedPatterns) {
|
|
46
|
-
if (normalized.startsWith(pattern) || normalized.endsWith(pattern)) {
|
|
47
|
-
matched.push(...CONTEXT_MAP[pattern]);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
return [...new Set(matched)];
|
|
51
|
-
}
|
|
52
|
-
export function loadFragment(name) {
|
|
53
|
-
if (!name)
|
|
54
|
-
return "";
|
|
55
|
-
const candidate = path.join(FRAGMENTS_DIR, `${name}.md`);
|
|
56
|
-
try {
|
|
57
|
-
const resolved = path.resolve(candidate);
|
|
58
|
-
const fragmentsDirResolved = path.resolve(FRAGMENTS_DIR);
|
|
59
|
-
if (!resolved.startsWith(fragmentsDirResolved))
|
|
60
|
-
return "";
|
|
61
|
-
if (fs.existsSync(resolved) && fs.statSync(resolved).isFile()) {
|
|
62
|
-
return fs.readFileSync(resolved, "utf-8").trim();
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
catch { }
|
|
66
|
-
return "";
|
|
67
|
-
}
|
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
import * as fs from "fs";
|
|
2
|
-
const PROD_IP = "47.118.31.230";
|
|
3
|
-
const BRIDGE_VPS_HOSTS = ["46.250.229.84"];
|
|
4
|
-
const GUARDED_HOSTS = [PROD_IP, ...BRIDGE_VPS_HOSTS];
|
|
5
|
-
const DEPLOY_SH_PATTERN = /^bash\s+scripts\/deploy\.sh(\s+--(dry-run|yes))*\s*$/;
|
|
6
|
-
const SSH_READONLY_CMDS = new Set([
|
|
7
|
-
"journalctl", "cat", "ls", "head", "tail", "grep",
|
|
8
|
-
"ss", "curl", "dig", "status", "git", "file", "stat",
|
|
9
|
-
]);
|
|
10
|
-
const SYSTEMCTL_WRITE_OPS = new Set(["restart", "stop", "start"]);
|
|
11
|
-
function getCommand() {
|
|
12
|
-
try {
|
|
13
|
-
const input = JSON.parse(fs.readFileSync(0, "utf-8"));
|
|
14
|
-
return input.tool_input?.command ?? null;
|
|
15
|
-
}
|
|
16
|
-
catch {
|
|
17
|
-
return null;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
function isDeploySh(cmd) {
|
|
21
|
-
return DEPLOY_SH_PATTERN.test(cmd.trim());
|
|
22
|
-
}
|
|
23
|
-
function hasGuardedHost(cmd) {
|
|
24
|
-
return GUARDED_HOSTS.some(host => cmd.includes(host));
|
|
25
|
-
}
|
|
26
|
-
function whichGuardedHost(cmd) {
|
|
27
|
-
for (const host of GUARDED_HOSTS) {
|
|
28
|
-
if (cmd.includes(host))
|
|
29
|
-
return host;
|
|
30
|
-
}
|
|
31
|
-
return null;
|
|
32
|
-
}
|
|
33
|
-
function isCompoundCommand(cmd) {
|
|
34
|
-
let stripped = cmd.replace(/"[^"]*"/g, "");
|
|
35
|
-
stripped = stripped.replace(/'[^']*'/g, "");
|
|
36
|
-
return /[;&|]{1,2}/.test(stripped);
|
|
37
|
-
}
|
|
38
|
-
function checkScpDirection(cmd) {
|
|
39
|
-
const parts = cmd.split(/\s+/);
|
|
40
|
-
if (!parts.length || parts[0] !== "scp")
|
|
41
|
-
return "none";
|
|
42
|
-
const args = parts.slice(1).filter(p => !p.startsWith("-"));
|
|
43
|
-
if (args.length < 2)
|
|
44
|
-
return "none";
|
|
45
|
-
const lastArg = args[args.length - 1];
|
|
46
|
-
if (GUARDED_HOSTS.some(host => lastArg.includes(host))) {
|
|
47
|
-
return "upload";
|
|
48
|
-
}
|
|
49
|
-
for (const arg of args.slice(0, -1)) {
|
|
50
|
-
if (GUARDED_HOSTS.some(host => arg.includes(host))) {
|
|
51
|
-
return "download";
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
return "none";
|
|
55
|
-
}
|
|
56
|
-
function checkSshCommand(cmd) {
|
|
57
|
-
if (!cmd.includes("ssh") || !hasGuardedHost(cmd))
|
|
58
|
-
return "none";
|
|
59
|
-
const quoted = cmd.match(/"([^"]*)"/)?.[1] ?? cmd.match(/'([^']*)'/)?.[1];
|
|
60
|
-
if (!quoted)
|
|
61
|
-
return "none";
|
|
62
|
-
const remoteCmd = quoted.trim();
|
|
63
|
-
const parts = remoteCmd.split(/\s+/);
|
|
64
|
-
if (!parts.length)
|
|
65
|
-
return "none";
|
|
66
|
-
let idx = 0;
|
|
67
|
-
if (parts[0] === "sudo") {
|
|
68
|
-
idx = 1;
|
|
69
|
-
while (idx < parts.length && parts[idx].startsWith("-")) {
|
|
70
|
-
if (parts[idx] === "-u" && idx + 1 < parts.length) {
|
|
71
|
-
idx += 2;
|
|
72
|
-
}
|
|
73
|
-
else {
|
|
74
|
-
idx += 1;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
const firstWord = parts[idx] ?? "";
|
|
79
|
-
if (firstWord === "systemctl") {
|
|
80
|
-
if (idx + 1 < parts.length && SYSTEMCTL_WRITE_OPS.has(parts[idx + 1])) {
|
|
81
|
-
return "write";
|
|
82
|
-
}
|
|
83
|
-
return "readonly";
|
|
84
|
-
}
|
|
85
|
-
if (SSH_READONLY_CMDS.has(firstWord)) {
|
|
86
|
-
return "readonly";
|
|
87
|
-
}
|
|
88
|
-
return "write";
|
|
89
|
-
}
|
|
90
|
-
function checkRsync(cmd) {
|
|
91
|
-
if (!cmd.includes("rsync") || !hasGuardedHost(cmd))
|
|
92
|
-
return "none";
|
|
93
|
-
const parts = cmd.split(/\s+/);
|
|
94
|
-
if (parts.includes("-n") || cmd.includes("--dry-run")) {
|
|
95
|
-
return "dryrun";
|
|
96
|
-
}
|
|
97
|
-
for (const p of parts) {
|
|
98
|
-
if (p.startsWith("-") && !p.startsWith("--") && p.includes("n")) {
|
|
99
|
-
return "dryrun";
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
return "write";
|
|
103
|
-
}
|
|
104
|
-
function block(reason, host = null) {
|
|
105
|
-
let guidance;
|
|
106
|
-
if (host === PROD_IP) {
|
|
107
|
-
guidance = `请使用标准部署流程:
|
|
108
|
-
后端: bash scripts/deploy.sh --yes
|
|
109
|
-
Demo 正式: bash scripts/deploy-demo.sh <name> --channel prod --yes
|
|
110
|
-
Demo 内测: bash scripts/deploy-demo.sh <name> --channel preview --yes
|
|
111
|
-
Edge/Nginx: bash scripts/deploy-edge.sh --yes
|
|
112
|
-
详见 Bolloon.md Development Commands。`;
|
|
113
|
-
}
|
|
114
|
-
else if (BRIDGE_VPS_HOSTS.includes(host ?? "")) {
|
|
115
|
-
guidance = `Bridge VPS 必须走 git pull 更新路径:
|
|
116
|
-
ssh root@${host} 'sudo -u boll git -C /opt/boll pull --ff-only'
|
|
117
|
-
scp/rsync 直传会重新制造 orphan worktree。
|
|
118
|
-
详见 docs/issues/guard-20260408-0445-bridge-vps-orphan-worktree.md。`;
|
|
119
|
-
}
|
|
120
|
-
else {
|
|
121
|
-
guidance = "未识别的受保护服务器目标,请确认 deploy 路径。";
|
|
122
|
-
}
|
|
123
|
-
process.stderr.write(`BLOCKED: ${reason}\n${guidance}\n`);
|
|
124
|
-
process.exit(1);
|
|
125
|
-
}
|
|
126
|
-
export function main() {
|
|
127
|
-
const cmd = getCommand();
|
|
128
|
-
if (!cmd)
|
|
129
|
-
process.exit(0);
|
|
130
|
-
if (!hasGuardedHost(cmd))
|
|
131
|
-
process.exit(0);
|
|
132
|
-
const host = whichGuardedHost(cmd);
|
|
133
|
-
if (isCompoundCommand(cmd)) {
|
|
134
|
-
block("检测到复合命令中包含受保护服务器操作,禁止绕过标准部署路径", host);
|
|
135
|
-
}
|
|
136
|
-
if (isDeploySh(cmd))
|
|
137
|
-
process.exit(0);
|
|
138
|
-
const scpDir = checkScpDirection(cmd);
|
|
139
|
-
if (scpDir === "upload")
|
|
140
|
-
block("禁止手动 scp 上传到受保护服务器", host);
|
|
141
|
-
if (scpDir === "download")
|
|
142
|
-
process.exit(0);
|
|
143
|
-
const sshType = checkSshCommand(cmd);
|
|
144
|
-
if (sshType === "write")
|
|
145
|
-
block("禁止手动对受保护服务器执行写操作", host);
|
|
146
|
-
if (sshType === "readonly")
|
|
147
|
-
process.exit(0);
|
|
148
|
-
const rsyncType = checkRsync(cmd);
|
|
149
|
-
if (rsyncType === "write")
|
|
150
|
-
block("禁止手动 rsync 写入受保护服务器", host);
|
|
151
|
-
if (rsyncType === "dryrun")
|
|
152
|
-
process.exit(0);
|
|
153
|
-
block("检测到未识别的受保护服务器操作", host);
|
|
154
|
-
}
|
|
155
|
-
if (require.main === module) {
|
|
156
|
-
main();
|
|
157
|
-
}
|
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
import * as fs from "fs";
|
|
2
|
-
import * as path from "path";
|
|
3
|
-
import { match, loadFragment, FALLBACK_FRAGMENTS } from "./context_router";
|
|
4
|
-
import { readAllSignals, runGuards, writeSessionSignal } from "./guard_router";
|
|
5
|
-
const INJECTED_TTL = 3600;
|
|
6
|
-
const INJECTED_FILE = path.join(process.cwd(), ".boll", "guard", "injected.json");
|
|
7
|
-
const METRICS_DIR = path.join(process.cwd(), ".boll", "metrics");
|
|
8
|
-
const METRICS_FILE = path.join(METRICS_DIR, "guard-events.jsonl");
|
|
9
|
-
function emitMetric(event, data = {}) {
|
|
10
|
-
try {
|
|
11
|
-
if (!fs.existsSync(METRICS_DIR)) {
|
|
12
|
-
fs.mkdirSync(METRICS_DIR, { recursive: true });
|
|
13
|
-
}
|
|
14
|
-
const record = {
|
|
15
|
-
ts: new Date().toISOString(),
|
|
16
|
-
session_pid: process.ppid,
|
|
17
|
-
event,
|
|
18
|
-
...data,
|
|
19
|
-
};
|
|
20
|
-
fs.appendFileSync(METRICS_FILE, JSON.stringify(record) + "\n", "utf-8");
|
|
21
|
-
}
|
|
22
|
-
catch { }
|
|
23
|
-
}
|
|
24
|
-
function readInjected() {
|
|
25
|
-
if (!fs.existsSync(INJECTED_FILE))
|
|
26
|
-
return new Set();
|
|
27
|
-
try {
|
|
28
|
-
const data = JSON.parse(fs.readFileSync(INJECTED_FILE, "utf-8"));
|
|
29
|
-
if (Date.now() / 1000 - data.timestamp > INJECTED_TTL)
|
|
30
|
-
return new Set();
|
|
31
|
-
return new Set(data.fragments || []);
|
|
32
|
-
}
|
|
33
|
-
catch {
|
|
34
|
-
return new Set();
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
function writeInjected(fragments) {
|
|
38
|
-
const guardDir = path.join(process.cwd(), ".boll", "guard");
|
|
39
|
-
if (!fs.existsSync(guardDir)) {
|
|
40
|
-
fs.mkdirSync(guardDir, { recursive: true });
|
|
41
|
-
}
|
|
42
|
-
const data = { timestamp: Date.now() / 1000, fragments: Array.from(fragments).sort() };
|
|
43
|
-
fs.writeFileSync(INJECTED_FILE, JSON.stringify(data, null, 2), "utf-8");
|
|
44
|
-
}
|
|
45
|
-
function getFilePath() {
|
|
46
|
-
if (process.argv.includes("--dry-run")) {
|
|
47
|
-
const idx = process.argv.indexOf("--dry-run");
|
|
48
|
-
if (idx + 1 < process.argv.length) {
|
|
49
|
-
return process.argv[idx + 1];
|
|
50
|
-
}
|
|
51
|
-
return null;
|
|
52
|
-
}
|
|
53
|
-
try {
|
|
54
|
-
const input = JSON.parse(fs.readFileSync(0, "utf-8"));
|
|
55
|
-
return input.tool_input?.file_path ?? input.tool_input?.path ?? null;
|
|
56
|
-
}
|
|
57
|
-
catch {
|
|
58
|
-
return null;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
function makeRelative(filePath, repoRoot) {
|
|
62
|
-
try {
|
|
63
|
-
const resolved = path.resolve(filePath);
|
|
64
|
-
return path.relative(repoRoot, resolved);
|
|
65
|
-
}
|
|
66
|
-
catch {
|
|
67
|
-
return null;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
function appendFindings(outputParts, findings) {
|
|
71
|
-
outputParts.push("\n\n## Guard Findings\n");
|
|
72
|
-
for (const raw of findings) {
|
|
73
|
-
const f = raw;
|
|
74
|
-
const blockingTag = f.blocking ? " [blocking]" : "";
|
|
75
|
-
const skills = f.required_skills.join(", ");
|
|
76
|
-
const skillsLine = skills ? `\n required_skills: ${skills}` : "";
|
|
77
|
-
outputParts.push(`- ${f.severity}${blockingTag} ${f.category}: ${f.message}${skillsLine}`);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
const REPO_ROOT = process.cwd();
|
|
81
|
-
const checksDir = path.join(REPO_ROOT, "src", "scripts", "checks");
|
|
82
|
-
export async function main() {
|
|
83
|
-
const startMs = Date.now();
|
|
84
|
-
const checkOnly = process.argv.includes("--check-only");
|
|
85
|
-
const once = process.argv.includes("--once");
|
|
86
|
-
const dryRun = process.argv.includes("--dry-run");
|
|
87
|
-
emitMetric("hook_trigger", {
|
|
88
|
-
mode: checkOnly ? "check_only" : "post_tool_use",
|
|
89
|
-
once,
|
|
90
|
-
dry_run: dryRun,
|
|
91
|
-
});
|
|
92
|
-
if (once) {
|
|
93
|
-
const guardDir = path.join(process.cwd(), ".boll", "guard");
|
|
94
|
-
const sessionFile = path.join(guardDir, `once-${process.pid}.flag`);
|
|
95
|
-
if (fs.existsSync(sessionFile)) {
|
|
96
|
-
try {
|
|
97
|
-
const ts = parseFloat(fs.readFileSync(sessionFile, "utf-8").trim());
|
|
98
|
-
if (Date.now() / 1000 - ts < 3600) {
|
|
99
|
-
process.exit(0);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
catch { }
|
|
103
|
-
}
|
|
104
|
-
if (!fs.existsSync(guardDir)) {
|
|
105
|
-
fs.mkdirSync(guardDir, { recursive: true });
|
|
106
|
-
}
|
|
107
|
-
fs.writeFileSync(sessionFile, String(Date.now() / 1000), "utf-8");
|
|
108
|
-
}
|
|
109
|
-
const outputParts = [];
|
|
110
|
-
if (checkOnly) {
|
|
111
|
-
const signal = readAllSignals(process.pid);
|
|
112
|
-
const findings = signal.findings;
|
|
113
|
-
if (findings.length) {
|
|
114
|
-
appendFindings(outputParts, findings);
|
|
115
|
-
process.stderr.write(outputParts.join("\n") + "\n");
|
|
116
|
-
emitMetric("check_only_findings", {
|
|
117
|
-
findings_count: findings.length,
|
|
118
|
-
elapsed_ms: Date.now() - startMs,
|
|
119
|
-
});
|
|
120
|
-
process.exit(0);
|
|
121
|
-
}
|
|
122
|
-
process.exit(0);
|
|
123
|
-
}
|
|
124
|
-
let filePath = getFilePath();
|
|
125
|
-
if (!filePath)
|
|
126
|
-
process.exit(0);
|
|
127
|
-
filePath = makeRelative(filePath, REPO_ROOT);
|
|
128
|
-
if (!filePath) {
|
|
129
|
-
emitMetric("path_rejected", { reason: "outside_repo_or_unresolvable" });
|
|
130
|
-
process.exit(0);
|
|
131
|
-
}
|
|
132
|
-
const alreadyInjected = readInjected();
|
|
133
|
-
let fragments = match(filePath);
|
|
134
|
-
if (!fragments.length) {
|
|
135
|
-
fragments = Array.isArray(FALLBACK_FRAGMENTS) ? FALLBACK_FRAGMENTS : [FALLBACK_FRAGMENTS];
|
|
136
|
-
}
|
|
137
|
-
const newFragments = fragments.filter(f => !alreadyInjected.has(f));
|
|
138
|
-
const contentParts = [];
|
|
139
|
-
for (const name of newFragments) {
|
|
140
|
-
const text = loadFragment(name);
|
|
141
|
-
if (text)
|
|
142
|
-
contentParts.push(text);
|
|
143
|
-
}
|
|
144
|
-
if (newFragments.length) {
|
|
145
|
-
const totalBytes = contentParts.reduce((sum, p) => sum + Buffer.byteLength(p, "utf-8"), 0);
|
|
146
|
-
emitMetric("fragment_inject", {
|
|
147
|
-
file_path: filePath,
|
|
148
|
-
fragments: newFragments,
|
|
149
|
-
count: newFragments.length,
|
|
150
|
-
bytes: totalBytes,
|
|
151
|
-
est_tokens: Math.ceil(totalBytes / 4),
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
if (contentParts.length) {
|
|
155
|
-
outputParts.push("## Context\n");
|
|
156
|
-
outputParts.push(contentParts.join("\n\n---\n\n"));
|
|
157
|
-
newFragments.forEach(f => alreadyInjected.add(f));
|
|
158
|
-
writeInjected(alreadyInjected);
|
|
159
|
-
}
|
|
160
|
-
const findings = await runGuards(filePath, checksDir);
|
|
161
|
-
if (findings.length) {
|
|
162
|
-
const blockingCount = findings.filter(f => f.blocking).length;
|
|
163
|
-
const categories = {};
|
|
164
|
-
const severities = {};
|
|
165
|
-
for (const f of findings) {
|
|
166
|
-
categories[f.category] = (categories[f.category] || 0) + 1;
|
|
167
|
-
severities[f.severity] = (severities[f.severity] || 0) + 1;
|
|
168
|
-
}
|
|
169
|
-
emitMetric("guard_findings", {
|
|
170
|
-
file_path: filePath,
|
|
171
|
-
findings_count: findings.length,
|
|
172
|
-
blocking_count: blockingCount,
|
|
173
|
-
categories,
|
|
174
|
-
severities,
|
|
175
|
-
});
|
|
176
|
-
writeSessionSignal(findings);
|
|
177
|
-
appendFindings(outputParts, findings);
|
|
178
|
-
}
|
|
179
|
-
emitMetric("hook_done", {
|
|
180
|
-
file_path: filePath,
|
|
181
|
-
had_output: outputParts.length > 0,
|
|
182
|
-
elapsed_ms: Date.now() - startMs,
|
|
183
|
-
});
|
|
184
|
-
if (outputParts.length) {
|
|
185
|
-
process.stderr.write(outputParts.join("\n") + "\n");
|
|
186
|
-
process.exit(2);
|
|
187
|
-
}
|
|
188
|
-
process.exit(0);
|
|
189
|
-
}
|
|
190
|
-
if (require.main === module) {
|
|
191
|
-
main();
|
|
192
|
-
}
|