ultimate-pi 0.18.1 → 0.19.1
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/.agents/skills/harness-debate-plan/SKILL.md +1 -1
- package/.agents/skills/harness-decisions/SKILL.md +1 -2
- package/.agents/skills/harness-governor/SKILL.md +6 -5
- package/.agents/skills/web-retrieval/SKILL.md +163 -0
- package/.agents/skills/wiki-autoresearch/SKILL.md +6 -6
- package/.pi/PACKAGING.md +4 -4
- package/.pi/SYSTEM.md +75 -123
- package/.pi/agents/harness/incident-recorder.md +0 -1
- package/.pi/agents/harness/planning/decompose.md +0 -2
- package/.pi/agents/harness/planning/execution-plan-author.md +0 -2
- package/.pi/agents/harness/planning/hypothesis-validator.md +0 -2
- package/.pi/agents/harness/planning/hypothesis.md +0 -2
- package/.pi/agents/harness/planning/implementation-researcher.md +1 -3
- package/.pi/agents/harness/planning/plan-adversary.md +0 -2
- package/.pi/agents/harness/planning/plan-evaluator.md +1 -3
- package/.pi/agents/harness/planning/planning-context.md +0 -2
- package/.pi/agents/harness/planning/review-integrator.md +0 -2
- package/.pi/agents/harness/planning/sprint-contract-auditor.md +0 -2
- package/.pi/agents/harness/planning/stack-researcher.md +5 -3
- package/.pi/agents/harness/reviewing/adversary.md +0 -2
- package/.pi/agents/harness/reviewing/evaluator.md +0 -2
- package/.pi/agents/harness/reviewing/tie-breaker.md +0 -2
- package/.pi/agents/harness/running/executor.md +0 -2
- package/.pi/agents/harness/sentrux-bootstrap.md +0 -1
- package/.pi/agents/harness/sentrux-steward.md +0 -2
- package/.pi/agents/harness/trace-librarian.md +0 -1
- package/.pi/agents/harness/web-retrieval/web-answerer.md +35 -0
- package/.pi/agents/harness/web-retrieval/web-criteria-verifier.md +28 -0
- package/.pi/agents/harness/web-retrieval/web-gap-analyzer.md +31 -0
- package/.pi/agents/harness/web-retrieval/web-query-expander-fast.md +34 -0
- package/.pi/agents/harness/web-retrieval/web-query-expander.md +60 -0
- package/.pi/agents/harness/web-retrieval/web-summarizer.md +18 -0
- package/.pi/extensions/agt-kill-switch.ts +57 -0
- package/.pi/extensions/agt-prompt-guard.ts +32 -0
- package/.pi/extensions/custom-footer.ts +46 -145
- package/.pi/extensions/custom-header.ts +1 -1
- package/.pi/extensions/custom-system-prompt.ts +1 -1
- package/.pi/extensions/debate-orchestrator.ts +6 -6
- package/.pi/extensions/harness-ask-user.ts +7 -7
- package/.pi/extensions/harness-debate-tools.ts +26 -42
- package/.pi/extensions/harness-lens.ts +94 -0
- package/.pi/extensions/harness-plan-approval.ts +11 -11
- package/.pi/extensions/harness-run-context.ts +1070 -876
- package/.pi/extensions/harness-subagent-governance.ts +8 -0
- package/.pi/extensions/harness-subagent-submit.ts +34 -163
- package/.pi/extensions/harness-subagents.ts +3 -3
- package/.pi/extensions/harness-telemetry.ts +2 -2
- package/.pi/extensions/harness-web-guard.ts +2 -1
- package/.pi/extensions/harness-web-tools.ts +691 -53
- package/.pi/extensions/policy-gate.ts +25 -5
- package/.pi/extensions/sentrux-rules-sync.ts +1 -1
- package/.pi/extensions/subagent-governance.ts +92 -0
- package/.pi/extensions/trace-recorder.ts +1 -1
- package/.pi/extensions/{ultimate-pi-vcc.ts → vcc-compaction.ts} +1 -1
- package/.pi/harness/README.md +6 -2
- package/.pi/harness/agents.manifest.json +46 -25
- package/.pi/harness/agents.policy.yaml +309 -0
- package/.pi/harness/docs/adrs/0030-inhouse-vcc-compaction.md +1 -1
- package/.pi/harness/docs/adrs/0035-plan-phase-review-gate.md +1 -1
- package/.pi/harness/docs/adrs/0045-harness-lens-minimal-contract.md +49 -0
- package/.pi/harness/docs/adrs/0046-agt-policy-engine.md +51 -0
- package/.pi/harness/docs/adrs/0047-agt-layered-security.md +39 -0
- package/.pi/harness/docs/adrs/0048-tool-call-hook-order.md +25 -0
- package/.pi/harness/docs/adrs/0049-agents-policy-manifest.md +36 -0
- package/.pi/harness/docs/adrs/0050-agentic-web-retrieval-stack.md +46 -0
- package/.pi/harness/docs/adrs/README.md +5 -0
- package/.pi/harness/docs/harness-web-search.md +97 -0
- package/.pi/harness/env.harness.template +9 -1
- package/.pi/harness/evolution/README.md +1 -2
- package/.pi/harness/examples/agents.policy.project.yaml +19 -0
- package/.pi/harness/examples/policies/custom-deny-bash.yaml +9 -0
- package/.pi/harness/examples/web-heuristic-angles.project.yaml +22 -0
- package/.pi/harness/policies/bash-denylists.yaml +5 -0
- package/.pi/harness/policies/defaults.yaml +51 -0
- package/.pi/harness/policies/orchestrator.yaml +18 -0
- package/.pi/harness/policies/phases.yaml +10 -0
- package/.pi/harness/policies/roles.yaml +5 -0
- package/.pi/harness/policies/web-guard.yaml +5 -0
- package/.pi/harness/policies/workflow-sequences.yaml +9 -0
- package/.pi/harness/sentrux/architecture.manifest.json +26 -4
- package/.pi/harness/specs/observation.schema.json +2 -1
- package/.pi/harness/web-heuristic-angles.json +278 -0
- package/.pi/harness/web-heuristic-angles.yaml +182 -0
- package/.pi/lib/agents-policy.d.mts +70 -0
- package/.pi/lib/agents-policy.mjs +331 -0
- package/.pi/lib/agents-policy.ts +19 -0
- package/.pi/lib/agt/audit-run-sink.ts +52 -0
- package/.pi/lib/agt/build-evaluation-context.ts +285 -0
- package/.pi/lib/agt/config.ts +28 -0
- package/.pi/lib/agt/delegation.ts +69 -0
- package/.pi/lib/agt/evaluate-policy.ts +56 -0
- package/.pi/lib/agt/identity-registry.ts +41 -0
- package/.pi/lib/agt/index.ts +55 -0
- package/.pi/lib/agt/kill-switch-state.ts +11 -0
- package/.pi/lib/agt/legacy-evaluate.ts +101 -0
- package/.pi/lib/agt/policy-engine.ts +154 -0
- package/.pi/lib/agt/rings.ts +21 -0
- package/.pi/lib/agt/sre-hooks.ts +45 -0
- package/.pi/lib/agt/trust-run-store.ts +26 -0
- package/.pi/lib/agt/workflow-history.ts +29 -0
- package/.pi/lib/agt-governance-active.ts +14 -0
- package/.pi/lib/agt-tool-guard.ts +78 -0
- package/.pi/lib/ask-user/dialog.ts +314 -0
- package/.pi/{extensions/lib → lib}/debate-bus-core.ts +10 -10
- package/.pi/{extensions/lib → lib}/debate-bus-state.ts +1 -1
- package/.pi/{extensions/lib → lib}/extension-load-guard.ts +13 -2
- package/.pi/lib/harness-agt-tool-guard.ts +5 -0
- package/.pi/{extensions/lib → lib}/harness-artifact-gate.ts +1 -1
- package/.pi/lib/harness-debate-core-deps.ts +14 -0
- package/.pi/lib/harness-debate-workflow-deps.ts +43 -0
- package/.pi/lib/harness-lens/.gitattributes +1 -0
- package/.pi/lib/harness-lens/clients/edit-autopatch.ts +88 -0
- package/.pi/lib/harness-lens/clients/file-kinds.ts +380 -0
- package/.pi/lib/harness-lens/clients/file-time.ts +215 -0
- package/.pi/lib/harness-lens/clients/file-utils.ts +484 -0
- package/.pi/lib/harness-lens/clients/format-service.ts +276 -0
- package/.pi/lib/harness-lens/clients/formatters.ts +1000 -0
- package/.pi/lib/harness-lens/clients/git-guard.ts +31 -0
- package/.pi/lib/harness-lens/clients/indent-retarget.ts +90 -0
- package/.pi/lib/harness-lens/clients/installer/index.ts +2368 -0
- package/.pi/lib/harness-lens/clients/latency-logger.ts +80 -0
- package/.pi/lib/harness-lens/clients/lens-config.ts +43 -0
- package/.pi/lib/harness-lens/clients/lens-events.ts +164 -0
- package/.pi/lib/harness-lens/clients/lsp/aggregation.ts +91 -0
- package/.pi/lib/harness-lens/clients/lsp/client.ts +1466 -0
- package/.pi/lib/harness-lens/clients/lsp/config.ts +216 -0
- package/.pi/lib/harness-lens/clients/lsp/edits.ts +297 -0
- package/.pi/lib/harness-lens/clients/lsp/index.ts +1355 -0
- package/.pi/lib/harness-lens/clients/lsp/interactive-install.ts +424 -0
- package/.pi/lib/harness-lens/clients/lsp/language.ts +223 -0
- package/.pi/lib/harness-lens/clients/lsp/launch.ts +939 -0
- package/.pi/lib/harness-lens/clients/lsp/lsp-index.ts +11 -0
- package/.pi/lib/harness-lens/clients/lsp/path-utils.ts +12 -0
- package/.pi/lib/harness-lens/clients/lsp/server-strategies.ts +81 -0
- package/.pi/lib/harness-lens/clients/lsp/server.ts +1971 -0
- package/.pi/lib/harness-lens/clients/path-utils.ts +182 -0
- package/.pi/lib/harness-lens/clients/pipeline.ts +360 -0
- package/.pi/lib/harness-lens/clients/project-profile.ts +117 -0
- package/.pi/lib/harness-lens/clients/runtime-agent-end.ts +112 -0
- package/.pi/lib/harness-lens/clients/runtime-config.ts +33 -0
- package/.pi/lib/harness-lens/clients/runtime-coordinator.ts +186 -0
- package/.pi/lib/harness-lens/clients/runtime-tool-result.ts +171 -0
- package/.pi/lib/harness-lens/clients/safe-spawn.ts +339 -0
- package/.pi/lib/harness-lens/clients/secrets-scanner.ts +214 -0
- package/.pi/lib/harness-lens/clients/tool-policy.ts +2072 -0
- package/.pi/lib/harness-lens/clients/types.ts +59 -0
- package/.pi/lib/harness-lens/clients/widget-state.ts +283 -0
- package/.pi/lib/harness-lens/index.ts +532 -0
- package/.pi/lib/harness-lens/tools/lsp-diagnostics.ts +706 -0
- package/.pi/lib/harness-lens/tools/lsp-navigation.ts +1246 -0
- package/.pi/{extensions/lib → lib}/harness-posthog.ts +3 -0
- package/.pi/lib/harness-run-context-responses.ts +9 -0
- package/.pi/lib/harness-run-context.ts +0 -2
- package/.pi/{extensions/lib/spawn-policy.ts → lib/harness-spawn-policy.ts} +1 -0
- package/.pi/{extensions/lib → lib}/harness-spawn-topology.ts +1 -1
- package/.pi/lib/harness-subagent-auth.ts +81 -0
- package/.pi/{extensions/lib → lib}/harness-subagent-precheck.ts +10 -7
- package/.pi/{extensions/lib → lib}/harness-subagent-submit-pipeline.ts +3 -3
- package/.pi/lib/harness-subagent-submit-register.ts +163 -0
- package/.pi/{extensions/lib → lib}/harness-subagent-submit-registry.ts +1 -37
- package/.pi/{extensions/lib → lib}/harness-subagents-bridge.ts +74 -14
- package/.pi/{extensions/lib → lib}/harness-subprocess-bootstrap.ts +1 -1
- package/.pi/lib/harness-web/artifacts.ts +200 -0
- package/.pi/lib/harness-web/cache.ts +369 -0
- package/.pi/{extensions/lib → lib}/harness-web/run-cli.ts +42 -2
- package/.pi/{extensions/lib → lib}/plan-approval/create-plan.ts +2 -2
- package/.pi/{extensions/lib → lib}/plan-approval/format-plan.ts +2 -2
- package/.pi/{extensions/lib → lib}/plan-approval/plan-review.ts +162 -201
- package/.pi/{extensions/lib → lib}/plan-approval/render.ts +1 -1
- package/.pi/{extensions/lib → lib}/plan-approval/resolve-disk.ts +2 -2
- package/.pi/{extensions/lib → lib}/plan-approval/types.ts +1 -1
- package/.pi/{extensions/lib → lib}/plan-approval/validate.ts +3 -3
- package/.pi/{extensions/lib → lib}/plan-debate-envelope.ts +1 -1
- package/.pi/{extensions/lib → lib}/plan-debate-gate.ts +1 -1
- package/.pi/{extensions/lib → lib}/plan-debate-lane.ts +1 -4
- package/.pi/{extensions/lib → lib}/plan-messenger.ts +1 -1
- package/.pi/prompts/harness-plan.md +2 -1
- package/.pi/prompts/harness-setup.md +40 -65
- package/.pi/scripts/README.md +2 -5
- package/.pi/scripts/gen-web-heuristic-angles-json.mjs +24 -0
- package/.pi/scripts/generate-agents-policy-yaml.mjs +148 -0
- package/.pi/scripts/harness-agents-manifest.mjs +60 -3
- package/.pi/scripts/harness-agt-doctor.ts +36 -0
- package/.pi/scripts/harness-cli-verify.sh +14 -2
- package/.pi/scripts/harness-verify.mjs +191 -39
- package/.pi/scripts/harness-web-policy-guard.mjs +3 -3
- package/.pi/scripts/harness-web.py +218 -15
- package/.pi/scripts/harness_web/deep_search.py +55 -0
- package/.pi/scripts/harness_web/evidence_bundle.py +47 -0
- package/.pi/scripts/harness_web/find_similar.py +88 -0
- package/.pi/scripts/harness_web/heuristic_angles_shipped.py +85 -0
- package/.pi/scripts/harness_web/heuristic_config.py +251 -0
- package/.pi/scripts/harness_web/highlights.py +47 -0
- package/.pi/scripts/harness_web/multi_search.py +59 -0
- package/.pi/scripts/harness_web/output.py +24 -0
- package/.pi/scripts/harness_web/query_angles.py +116 -0
- package/.pi/scripts/harness_web/rank.py +163 -0
- package/.pi/scripts/harness_web/scrape.py +30 -0
- package/.pi/scripts/tests/test_harness_web_heuristic_config.py +132 -0
- package/.pi/scripts/tests/test_harness_web_query_angles.py +45 -0
- package/.pi/scripts/tests/test_harness_web_rank.py +56 -0
- package/.pi/scripts/validate-plan-dag.mjs +65 -74
- package/.pi/scripts/vendor-pi-vcc-settings.stub.ts +2 -2
- package/.pi/scripts/vendor-sync-pi-vcc.sh +1 -1
- package/.pi/skills/architecture/broker-domain/SKILL.md +65 -0
- package/.pi/skills/architecture/cqrs/SKILL.md +63 -0
- package/.pi/skills/architecture/event-driven/SKILL.md +60 -0
- package/.pi/skills/architecture/hexagonal-ports-adapters/SKILL.md +66 -0
- package/.pi/skills/architecture/layered/SKILL.md +68 -0
- package/.pi/skills/architecture/microkernel/SKILL.md +62 -0
- package/.pi/skills/architecture/microservices/SKILL.md +64 -0
- package/.pi/skills/architecture/modular-monolith/SKILL.md +65 -0
- package/.pi/skills/architecture/orchestration-driven-soa/SKILL.md +61 -0
- package/.pi/skills/architecture/pipeline/SKILL.md +63 -0
- package/.pi/skills/architecture/service-based/SKILL.md +64 -0
- package/.pi/skills/architecture/service-mesh/SKILL.md +60 -0
- package/.pi/skills/architecture/space-based/SKILL.md +60 -0
- package/.pi/skills/ast-grep/SKILL.md +40 -321
- package/.pi/skills/delivery/debugging-discipline/SKILL.md +36 -0
- package/.pi/skills/delivery/documentation-update/SKILL.md +33 -0
- package/.pi/skills/delivery/requirements-to-implementation/SKILL.md +34 -0
- package/.pi/skills/delivery/risk-based-verification/SKILL.md +43 -0
- package/.pi/skills/delivery/tradeoff-analysis/SKILL.md +34 -0
- package/.pi/skills/engineering/api-contract-design/SKILL.md +38 -0
- package/.pi/skills/engineering/cohesion-coupling/SKILL.md +43 -0
- package/.pi/skills/engineering/complexity-control/SKILL.md +31 -0
- package/.pi/skills/engineering/defensive-programming/SKILL.md +38 -0
- package/.pi/skills/engineering/dependency-management/SKILL.md +29 -0
- package/.pi/skills/engineering/domain-modeling/SKILL.md +32 -0
- package/.pi/skills/engineering/error-handling/SKILL.md +37 -0
- package/.pi/skills/engineering/legacy-code-seams/SKILL.md +35 -0
- package/.pi/skills/engineering/naming-and-intent/SKILL.md +29 -0
- package/.pi/skills/engineering/refactoring-safe-evolution/SKILL.md +35 -0
- package/.pi/skills/engineering/routine-function-design/SKILL.md +34 -0
- package/.pi/skills/engineering/small-change-discipline/SKILL.md +35 -0
- package/.pi/skills/lsp-navigation/SKILL.md +89 -0
- package/.pi/skills/quality/code-review-self-check/SKILL.md +35 -0
- package/.pi/skills/quality/privacy-data-handling/SKILL.md +26 -0
- package/.pi/skills/quality/security-review/SKILL.md +34 -0
- package/.pi/skills/quality/test-strategy/SKILL.md +33 -0
- package/.pi/skills/quality/testability-design/SKILL.md +33 -0
- package/.pi/skills/systems/concurrency-safety/SKILL.md +32 -0
- package/.pi/skills/systems/data-modeling-migrations/SKILL.md +31 -0
- package/.pi/skills/systems/observability-instrumentation/SKILL.md +32 -0
- package/.pi/skills/systems/performance-measurement/SKILL.md +35 -0
- package/.pi/skills/systems/reliability-design/SKILL.md +32 -0
- package/.sentrux/rules.toml +20 -4
- package/AGENTS.md +7 -2
- package/CHANGELOG.md +20 -0
- package/README.md +3 -12
- package/THIRD_PARTY_NOTICES.md +12 -21
- package/package.json +17 -7
- package/vendor/pi-subagents/src/agents.ts +45 -1
- package/vendor/pi-subagents/src/subagents.ts +866 -811
- package/vendor/pi-vcc/src/core/brief.ts +68 -99
- package/vendor/pi-vcc/src/core/settings.ts +2 -2
- package/.agents/skills/caveman/SKILL.md +0 -67
- package/.agents/skills/scrapling-web/SKILL.md +0 -98
- package/.pi/agents/harness/meta-optimizer.md +0 -36
- package/.pi/extensions/00-posthog-network-bootstrap.ts +0 -11
- package/.pi/extensions/lib/ask-user/dialog.ts +0 -260
- package/.pi/extensions/lib/harness-subagent-auth.ts +0 -207
- package/.pi/extensions/lib/harness-subagent-policy.ts +0 -236
- package/.pi/extensions/pi-model-router-harness.ts +0 -42
- package/.pi/harness/evolution/meta-optimizer.mjs +0 -99
- package/.pi/harness/specs/router-tuning-proposal.schema.json +0 -114
- package/.pi/model-router.example.json +0 -36
- package/.pi/prompts/harness-critic.md +0 -10
- package/.pi/prompts/harness-eval.md +0 -10
- package/.pi/prompts/harness-router-tune.md +0 -52
- package/.pi/scripts/harness-generate-model-router.mjs +0 -327
- package/.pi/scripts/harness-model-router-routing.test.mjs +0 -97
- package/.pi/scripts/harness-sync-model-router.mjs +0 -97
- package/.pi/scripts/harness_web/__pycache__/__init__.cpython-314.pyc +0 -0
- package/.pi/scripts/harness_web/__pycache__/config.cpython-314.pyc +0 -0
- package/.pi/scripts/harness_web/__pycache__/output.cpython-314.pyc +0 -0
- package/.pi/scripts/harness_web/__pycache__/scrape.cpython-314.pyc +0 -0
- package/.pi/scripts/harness_web/__pycache__/search.cpython-314.pyc +0 -0
- package/.pi/scripts/harness_web/__pycache__/search_ddg.cpython-314.pyc +0 -0
- package/.pi/scripts/harness_web/__pycache__/search_searxng.cpython-314.pyc +0 -0
- package/.pi/scripts/vendor-sync-pi-model-router.sh +0 -47
- package/vendor/pi-model-router/.prettierignore +0 -4
- package/vendor/pi-model-router/.prettierrc +0 -5
- package/vendor/pi-model-router/AGENTS.md +0 -39
- package/vendor/pi-model-router/LICENSE +0 -21
- package/vendor/pi-model-router/README.md +0 -99
- package/vendor/pi-model-router/UPSTREAM_PIN.md +0 -10
- package/vendor/pi-model-router/docs/ARCHITECTURE.md +0 -54
- package/vendor/pi-model-router/extensions/commands.ts +0 -720
- package/vendor/pi-model-router/extensions/config.ts +0 -348
- package/vendor/pi-model-router/extensions/constants.ts +0 -1
- package/vendor/pi-model-router/extensions/index.ts +0 -478
- package/vendor/pi-model-router/extensions/provider.ts +0 -580
- package/vendor/pi-model-router/extensions/routing.ts +0 -564
- package/vendor/pi-model-router/extensions/state.ts +0 -52
- package/vendor/pi-model-router/extensions/types.ts +0 -95
- package/vendor/pi-model-router/extensions/ui.ts +0 -144
- package/vendor/pi-model-router/model-router.example.json +0 -48
- package/vendor/pi-model-router/package.json +0 -48
- package/vendor/pi-model-router/tsconfig.json +0 -16
- /package/.pi/{prompts → harness/docs}/planning-rubrics.md +0 -0
- /package/.pi/{extensions/lib → lib}/ask-user/fallback.ts +0 -0
- /package/.pi/{extensions/lib → lib}/ask-user/render.ts +0 -0
- /package/.pi/{extensions/lib → lib}/ask-user/schema.ts +0 -0
- /package/.pi/{extensions/lib → lib}/ask-user/types.ts +0 -0
- /package/.pi/{extensions/lib → lib}/ask-user/validate-core.mjs +0 -0
- /package/.pi/{extensions/lib → lib}/ask-user/validate.ts +0 -0
- /package/.pi/{extensions/lib → lib}/harness-cocoindex-refresh.ts +0 -0
- /package/.pi/{extensions/lib → lib}/harness-paths.ts +0 -0
- /package/.pi/{extensions/lib → lib}/harness-spawn-budget.ts +0 -0
- /package/.pi/{extensions/lib → lib}/harness-vcc-settings.ts +0 -0
- /package/.pi/{extensions/lib → lib}/plan-approval/dialog.ts +0 -0
- /package/.pi/{extensions/lib → lib}/plan-approval/schema.ts +0 -0
- /package/.pi/{extensions/lib → lib}/plan-approval-readiness.ts +0 -0
- /package/.pi/{extensions/lib → lib}/plan-debate-eligibility.ts +0 -0
- /package/.pi/{extensions/lib → lib}/plan-debate-focus.ts +0 -0
- /package/.pi/{extensions/lib → lib}/plan-debate-id.ts +0 -0
- /package/.pi/{extensions/lib → lib}/plan-debate-lanes.ts +0 -0
- /package/.pi/{extensions/lib → lib}/plan-debate-round-status.ts +0 -0
- /package/.pi/{extensions/lib → lib}/plan-debate-write-guard.ts +0 -0
- /package/.pi/{extensions/lib → lib}/plan-review-gate.ts +0 -0
- /package/.pi/{extensions/lib → lib}/plan-review-integrator-rules.ts +0 -0
- /package/.pi/{extensions/lib → lib}/plan-scope-guard.ts +0 -0
- /package/.pi/{extensions/lib → lib}/posthog-client.ts +0 -0
- /package/.pi/{extensions/lib → lib}/posthog-node.d.ts +0 -0
|
@@ -78,4 +78,4 @@ Resume: `harness_debate_round_status({ round_index: N })` → run listed `next_t
|
|
|
78
78
|
|
|
79
79
|
Do not `approve_plan` on `policy_decision: block`. On `human_required` → `ask_user` first.
|
|
80
80
|
|
|
81
|
-
Rubrics: `.pi/
|
|
81
|
+
Rubrics: `.pi/harness/docs/planning-rubrics.md`.
|
|
@@ -9,8 +9,7 @@ description: Structured user decisions via ask_user for harness setup, planning,
|
|
|
9
9
|
|
|
10
10
|
- `/harness-setup` — missing project `.env`, other bootstrap forks
|
|
11
11
|
- `/harness-plan` or harness-auto **plan** phase — scope, risk, acceptance ambiguity
|
|
12
|
-
- Orchestrator receives `human_required` from evaluator, adversary, tie-breaker
|
|
13
|
-
- `/harness-router-tune` — approve / reject / edit a router proposal before apply
|
|
12
|
+
- Orchestrator receives `human_required` from evaluator, adversary, or tie-breaker
|
|
14
13
|
|
|
15
14
|
## Decision handshake
|
|
16
15
|
|
|
@@ -14,11 +14,12 @@ description: Enforce harness governance phases, policy gates, budgets, and promo
|
|
|
14
14
|
## Workflow
|
|
15
15
|
|
|
16
16
|
1. Read current phase from `/harness-policy-status` or session `harness-policy-state`.
|
|
17
|
-
2. Check ADRs: constitution (0001), eval promotion (0003), Sentrux (0006), drift (0007), rules lifecycle (0009).
|
|
18
|
-
3.
|
|
19
|
-
4.
|
|
20
|
-
5.
|
|
21
|
-
|
|
17
|
+
2. Check ADRs: constitution (0001), eval promotion (0003), Sentrux (0006), drift (0007), rules lifecycle (0009), AGT policy (0046), AGT security layers (0047).
|
|
18
|
+
3. Tool allow/deny is enforced by AGT `PolicyEngine` + `.pi/harness/policies/*.yaml` (parent `policy-gate`, subprocess `harness-subagent-governance`). Disable with `HARNESS_AGT_POLICY=0`. Audit: `.pi/harness/runs/<run_id>/agt-audit.jsonl`.
|
|
19
|
+
4. For promotion: require eval pass, no abort lock, debate consensus if escalated, Sentrux when `HARNESS_SENTRUX_REQUIRED=true` (`artifacts/sentrux-signal.yaml` from `/harness-run`, not executor self-report).
|
|
20
|
+
5. **Intent vs observation:** Manifest/layer/boundary changes → `/harness-sentrux-steward` proposal + chair approval + ADR when material, then `sentrux-rules-sync --force`. `sentrux check`/`gate` degradation after execute → replan or fix code — do not tune manifest on a single noisy gate.
|
|
21
|
+
6. After approved manifest edits: `node "$UP_PKG/.pi/scripts/harness-sentrux-bootstrap.mjs" --force` or `/harness-sentrux-sync`; emit `harness-architecture-changed` for the extension.
|
|
22
|
+
7. Run `node "$UP_PKG/.pi/scripts/harness-verify.mjs"` before claiming release readiness (includes AGT policy doctor).
|
|
22
23
|
|
|
23
24
|
## Spec Distiller integration
|
|
24
25
|
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: web-retrieval
|
|
3
|
+
description: |
|
|
4
|
+
Agentic Web Retrieval Stack (WRS) — tiered web_search/web_fetch/web_contents (harness-web.py +
|
|
5
|
+
Scrapling). Default tier=deep with web-query-expander angles. Use for search, scrape, landscape,
|
|
6
|
+
prior art, comparisons, planning pre-research, cited answers, similar URLs, websets scoring.
|
|
7
|
+
Triggers on non-API web research, scrape URL, web_search, web_fetch, .web/ artifacts.
|
|
8
|
+
Library API docs → context7 only. Install: /harness-setup or harness-cli-verify.
|
|
9
|
+
allowed-tools: Read Write web_search web_fetch web_find_similar web_contents
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# web-retrieval (WRS)
|
|
13
|
+
|
|
14
|
+
Maps user intent → **tier** + pipeline. Pi tools: `web_search`, `web_fetch`, `web_find_similar`, `web_contents` (wrap `harness-web.py`). **Pooled cache** under `.web/cache/`; workspace aliases under `.web/`.
|
|
15
|
+
|
|
16
|
+
**Never before search/fetch:** `UP_PKG` resolution, `ls harness-web.py`, `python3 -c "import scrapling"`, Firecrawl, curl/wget, or scrapling CLI for SERP/fetch.
|
|
17
|
+
|
|
18
|
+
## Workspace + cache (default)
|
|
19
|
+
|
|
20
|
+
| Layer | Path | Role |
|
|
21
|
+
|-------|------|------|
|
|
22
|
+
| **Cache** | `.web/cache/<kind>/<cacheKey>/` | Pooled SERP + fetch payloads with `meta.json` (query, tier, angles fingerprint, TTL) |
|
|
23
|
+
| **Workspace** | `.web/` (`angles.yaml`, `search-deep.json`, `page.md`, …) | Stable paths agents read/write; refreshed from cache on hit |
|
|
24
|
+
|
|
25
|
+
`web_search` / `web_fetch` return **`cacheHit`**, **`cacheKey`**, **`cachePath`** when reusing pooled results. Same intent + angles skips network until TTL expires.
|
|
26
|
+
|
|
27
|
+
| Control | Meaning |
|
|
28
|
+
|---------|---------|
|
|
29
|
+
| `HARNESS_WEB_CACHE_TTL_SEC` | Default freshness (86400 = 24h) |
|
|
30
|
+
| `HARNESS_WEB_CACHE=0` | Disable pooling |
|
|
31
|
+
| `refreshCache: true` on tool | Force network |
|
|
32
|
+
| `cacheMaxAge` on tool | Stricter max age (seconds) |
|
|
33
|
+
|
|
34
|
+
**Optional isolation** (parallel mutable synthesis): `HARNESS_WEB_ISOLATE=1` → `.web/runs/<run_id>/` or `.web/sessions/<pi_session_id>/` for `answer.md` / evidence when sessions must not share workspace files.
|
|
35
|
+
|
|
36
|
+
`web_search` responses include **`artifactDir`** (usually `.web`). Spawn web-retrieval subagents with `HARNESS_WEB_ARTIFACT_DIR` or `artifactDir` in the task.
|
|
37
|
+
|
|
38
|
+
## Tier table
|
|
39
|
+
|
|
40
|
+
| User intent | Tier | Steps |
|
|
41
|
+
|-------------|------|-------|
|
|
42
|
+
| One narrow fact (scoped) | `instant` or `standard` | `web_search({ query, tier })` — **no subagent** |
|
|
43
|
+
| Fast open-web with angles | `standard` or `deep` + heuristic | `web-query-expander-fast` **or** `expandHeuristic:true` |
|
|
44
|
+
| "What is X?" needs sources | `deep` | `web-query-expander` → deep → highlights |
|
|
45
|
+
| Landscape / how / compare | `deep` | `web-query-expander` → deep → `web_fetch` highlights top 3 |
|
|
46
|
+
| Answer with citations | `research` | deep → `web_contents` → `web-answerer` |
|
|
47
|
+
| Qualified list (Websets analog) | `research` + verifier | deep → `web-criteria-verifier` → CSV |
|
|
48
|
+
| More like this URL | — | `web_find_similar` |
|
|
49
|
+
| Library API docs | — | **context7** (not WRS) |
|
|
50
|
+
|
|
51
|
+
## Latency vs quality routing
|
|
52
|
+
|
|
53
|
+
| Priority | Search / subagent | Model / thinking |
|
|
54
|
+
|----------|-------------------|------------------|
|
|
55
|
+
| **Latency** | No expander: `tier=instant` or `standard` only | Parent session (pick a fast model in UI) |
|
|
56
|
+
| **Latency + angles** | `harness/web-retrieval/web-query-expander-fast` → `tier=deep` | `HARNESS_WEB_FAST_MODEL` (optional) |
|
|
57
|
+
| **Emergency angles (no LLM)** | `web_search({ tier: "deep", expandHeuristic: true, category? })` | Templates from `.pi/harness/web-heuristic-angles.yaml` (project file merges on top) |
|
|
58
|
+
| **Default research** | `harness/web-retrieval/web-query-expander` → `tier=deep` | `HARNESS_WEB_EXPANDER_MODEL` or parent |
|
|
59
|
+
| **Gap fill** | `harness/web-retrieval/web-gap-analyzer` | `HARNESS_WEB_FAST_MODEL` or parent |
|
|
60
|
+
| **Cited answer** | `harness/web-retrieval/web-answerer` | `HARNESS_WEB_QUALITY_MODEL` or parent |
|
|
61
|
+
| **Page digest** | `harness/web-retrieval/web-summarizer` | `HARNESS_WEB_FAST_MODEL` or parent |
|
|
62
|
+
| **Criteria scoring** | `harness/web-retrieval/web-criteria-verifier` | `HARNESS_WEB_QUALITY_MODEL` or parent |
|
|
63
|
+
|
|
64
|
+
## Configuring models (env vars)
|
|
65
|
+
|
|
66
|
+
WRS subagents need a **concrete** `provider/model-id` (same format as Pi — any provider your install supports). Set in shell, `.env`, or harness-synced project env:
|
|
67
|
+
|
|
68
|
+
| Variable | Applies to |
|
|
69
|
+
|----------|------------|
|
|
70
|
+
| `HARNESS_WEB_FAST_MODEL` | `web-query-expander-fast`, `web-summarizer`, `web-gap-analyzer` |
|
|
71
|
+
| `HARNESS_WEB_EXPANDER_MODEL` | `web-query-expander` |
|
|
72
|
+
| `HARNESS_WEB_QUALITY_MODEL` | `web-answerer`, `web-criteria-verifier` |
|
|
73
|
+
|
|
74
|
+
Example (use **your** provider/model ids):
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
export HARNESS_WEB_FAST_MODEL=your-provider/cheap-model
|
|
78
|
+
export HARNESS_WEB_EXPANDER_MODEL=your-provider/balanced-model
|
|
79
|
+
export HARNESS_WEB_QUALITY_MODEL=your-provider/strong-model
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
If unset for an agent, the subagent inherits the **parent session model** (pick a fast model in Pi when latency matters).
|
|
83
|
+
|
|
84
|
+
Optional per-agent override: `model:` in agent `.md` frontmatter or project `.pi/agents.policy.yaml` (before parent fallback).
|
|
85
|
+
|
|
86
|
+
## Deep pipeline (default for research)
|
|
87
|
+
|
|
88
|
+
1. `subagent` **`harness/web-retrieval/web-query-expander`** → parent saves `.web/angles.yaml`
|
|
89
|
+
2. `web_search({ query: "<intent>", tier: "deep", anglesFile: ".web/angles.yaml" })` — repeats hit cache when context unchanged
|
|
90
|
+
3. `read` `.web/search-deep.json` — prefer URLs with multiple `angle_ids`
|
|
91
|
+
5. `web_fetch({ url, highlights: true, highlightQuery: "<intent>" })` on top 3–5
|
|
92
|
+
6. Optional gap pass: `harness/web-retrieval/web-gap-analyzer` → new angles → second `web_search` deep
|
|
93
|
+
|
|
94
|
+
**Anti-patterns:** bare `web_search({ query })` for open questions; 3+ manual SERP loops; `bulk: true` without need.
|
|
95
|
+
|
|
96
|
+
## Research profile (`tier=research`)
|
|
97
|
+
|
|
98
|
+
After deep + highlight fetches:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
python3 "$UP_PKG/.pi/scripts/harness-web.py" contents-batch \
|
|
102
|
+
--from-search "$ARTIFACT_DIR/search-deep.json" \
|
|
103
|
+
--evidence-bundle "$ARTIFACT_DIR/evidence-bundle.json" --limit 5
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Spawn **`harness/web-retrieval/web-answerer`** with `artifactDir` / `answerPath: $ARTIFACT_DIR/answer.md`.
|
|
107
|
+
|
|
108
|
+
## Websets profile
|
|
109
|
+
|
|
110
|
+
Spawn **`harness/web-retrieval/web-criteria-verifier`** with NL criteria + `search-deep.json` candidates → `.web/webset-reasoning.yaml` / CSV manifest.
|
|
111
|
+
|
|
112
|
+
## Bash fallback (no pi tools)
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
python3 "$UP_PKG/.pi/scripts/harness-web.py" search-deep "query" \
|
|
116
|
+
--expand-heuristic -o .web/search-deep.json --limit 10
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## Subagents
|
|
120
|
+
|
|
121
|
+
| Agent | Role |
|
|
122
|
+
|-------|------|
|
|
123
|
+
| `harness/web-retrieval/web-query-expander` | Angles YAML (research / recall) |
|
|
124
|
+
| `harness/web-retrieval/web-query-expander-fast` | 2–3 angles (latency) |
|
|
125
|
+
| `harness/web-retrieval/web-gap-analyzer` | Follow-up angles |
|
|
126
|
+
| `harness/web-retrieval/web-answerer` | Cited answer |
|
|
127
|
+
| `harness/web-retrieval/web-summarizer` | Single-page digest |
|
|
128
|
+
| `harness/web-retrieval/web-criteria-verifier` | Criteria scoring |
|
|
129
|
+
|
|
130
|
+
## Heuristic angle templates (no LLM expander)
|
|
131
|
+
|
|
132
|
+
Package defaults: `.pi/harness/web-heuristic-angles.yaml` (`max_angles: 8`). Categories include targeted `site:` angles — e.g. **code**: GitHub, Stack Overflow, Stack Exchange, Read the Docs, MDN, npm/PyPI/Go/Rust registries, Microsoft Learn, HN; **paper**: arXiv, Semantic Scholar, Papers with Code, OpenReview; **security**: NVD, OWASP, CWE; plus **news**, **company**, **people**, **default**.
|
|
133
|
+
|
|
134
|
+
`web_search({ tier: "deep", expandHeuristic: true, category: "code" })`
|
|
135
|
+
|
|
136
|
+
**External projects:** copy `.pi/harness/examples/web-heuristic-angles.project.yaml` → `<project>/.pi/harness/web-heuristic-angles.yaml` and add or override angle ids. Use `{query}` in templates.
|
|
137
|
+
|
|
138
|
+
## Install (setup / humans only)
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
command -v uv &>/dev/null || curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
142
|
+
uv tool install "scrapling[fetchers]"
|
|
143
|
+
scrapling install # browser binaries for stealth scrape
|
|
144
|
+
bash "$UP_PKG/.pi/scripts/harness-cli-verify.sh"
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
Diagnostics: `python3 "$UP_PKG/.pi/scripts/harness-web.py" status` (JSON).
|
|
148
|
+
|
|
149
|
+
## Env
|
|
150
|
+
|
|
151
|
+
| Variable | Default | Purpose |
|
|
152
|
+
|----------|---------|---------|
|
|
153
|
+
| `HARNESS_WEB_FETCH_MODE` | `stealth` | `stealth` \| `fast` \| `auto` |
|
|
154
|
+
| `HARNESS_WEB_SEARCH_ENGINE` | `ddg_html` | `ddg_html` \| `searxng` (+ `HARNESS_WEB_SEARXNG_URL`) |
|
|
155
|
+
| `HARNESS_WEB_CACHE_TTL_SEC` | `86400` | Pooled cache TTL |
|
|
156
|
+
| `HARNESS_WEB_CACHE` | on | Set `0` to disable cache |
|
|
157
|
+
| `HARNESS_WEB_ISOLATE` | off | Set `1` for per-run/session workspace dirs |
|
|
158
|
+
| `HARNESS_WEB_RERANK` | — | `off` \| `lexical` |
|
|
159
|
+
| `HARNESS_WEB_DEEP_CONCURRENCY` | `4` | Parallel angle SERP |
|
|
160
|
+
| `HARNESS_WEB_HEURISTIC_ANGLES_FILE` | — | Extra heuristic angles YAML |
|
|
161
|
+
| `HARNESS_WEB_FAST_MODEL` / `EXPANDER` / `QUALITY` | — | Web subagent models |
|
|
162
|
+
|
|
163
|
+
See `.pi/harness/docs/harness-web-search.md` for internals.
|
|
@@ -127,16 +127,16 @@ When the user invokes the trigger with NO topic after it, ask:
|
|
|
127
127
|
```
|
|
128
128
|
Input: topic (from Topic Selection, above)
|
|
129
129
|
|
|
130
|
-
Round 1. Broad search
|
|
131
|
-
1.
|
|
132
|
-
2.
|
|
133
|
-
3. For top 2-3
|
|
130
|
+
Round 1. Broad search (WRS deep — do not loop manual SERP)
|
|
131
|
+
1. Invoke **web-retrieval** skill: `harness/web-retrieval/web-query-expander` → `.web/angles.yaml`
|
|
132
|
+
2. One `web_search({ query: topic, tier: "deep", anglesFile: ".web/angles.yaml" })` → `.web/search-deep.json`
|
|
133
|
+
3. For top 2-3 fused URLs: `web_fetch` with `highlights: true` (or `read` `.web/` artifacts)
|
|
134
134
|
4. Save each fetched page to ./raw/ as a markdown file
|
|
135
135
|
5. Extract from each: key claims, entities, concepts, open questions
|
|
136
136
|
|
|
137
137
|
Round 2. Gap fill
|
|
138
|
-
6. Identify what's missing or contradicted from Round 1
|
|
139
|
-
7.
|
|
138
|
+
6. Identify what's missing or contradicted from Round 1 (`read` `search-deep.json`)
|
|
139
|
+
7. Optional: `harness/web-retrieval/web-gap-analyzer` → second `web_search` deep with new angles (max one extra deep pass)
|
|
140
140
|
8. Fetch top results for each gap, save to ./raw/
|
|
141
141
|
9. Run `graphify extract ./raw --out .` to incorporate new sources
|
|
142
142
|
(NOTE: `graphify update` only works for code files. Research sources are docs
|
package/.pi/PACKAGING.md
CHANGED
|
@@ -6,7 +6,7 @@ Aligned with [pi packages](https://github.com/badlogic/pi-mono/blob/main/package
|
|
|
6
6
|
|
|
7
7
|
| Key | Paths | Notes |
|
|
8
8
|
|-----|-------|--------|
|
|
9
|
-
| `extensions` | `.pi/extensions` | TypeScript extensions
|
|
9
|
+
| `extensions` | `.pi/extensions` | TypeScript extensions loaded by pi, including the harness lens wrapper |
|
|
10
10
|
| `skills` | `.agents/skills`, `.pi/skills` | Agent Skills + pi-local skills |
|
|
11
11
|
| `prompts` | `.pi/prompts` | Slash-command prompt templates |
|
|
12
12
|
|
|
@@ -20,9 +20,9 @@ Pi does **not** define `scripts`, `agents`, or `providers` in the manifest.
|
|
|
20
20
|
|
|
21
21
|
We use an explicit allowlist (not the whole `.pi/` tree) so dev-only artifacts never ship:
|
|
22
22
|
|
|
23
|
-
- No `.pi/harness/runs/`,
|
|
23
|
+
- No `.pi/harness/runs/`, `.pi/harness/.lens/` runtime config/cache, or `firecrawl/.env`
|
|
24
24
|
- Ship `.pi/settings.example.json`, not `.pi/settings.json` (dev checkout uses `".."` local package)
|
|
25
|
-
- Include
|
|
25
|
+
- Include **`.pi/lib/harness-lens/`** (harness-native lens: edit autopatch, secrets, deferred format, LSP) — loaded through `.pi/extensions/harness-lens.ts`; findings flow to harness PostHog telemetry
|
|
26
26
|
- Include **`vendor/pi-vcc/`** ([`pi-vcc`](https://github.com/sting8k/pi-vcc), MIT; inspired by [lllyasviel/VCC](https://github.com/lllyasviel/VCC)) — loaded via `.pi/extensions/ultimate-pi-vcc.ts`; refresh with `npm run vendor:sync-vcc`
|
|
27
27
|
- Include **`vendor/pi-subagents/`** (vendored from [narumiruna/pi-extensions](https://github.com/narumiruna/pi-extensions) `pi-subagents`) — loaded via `.pi/extensions/harness-subagents.ts`; refresh with `npm run vendor:sync-subagents`
|
|
28
28
|
|
|
@@ -37,4 +37,4 @@ We use an explicit allowlist (not the whole `.pi/` tree) so dev-only artifacts n
|
|
|
37
37
|
|
|
38
38
|
Runtime pi extensions are regular `dependencies` (installed by `npm install` when pi installs the package). We do **not** use `bundledDependencies`: bundling pre-installs `node_modules` and breaks `npm install -g` / `pi update` for native modules such as `koffi` (empty stub dir, postinstall fails).
|
|
39
39
|
|
|
40
|
-
`@earendil-works/pi-coding-agent` (and sibling `@earendil-works/pi-ai`, `pi-tui`, `pi-agent-core` used by
|
|
40
|
+
`@earendil-works/pi-coding-agent` (and sibling `@earendil-works/pi-ai`, `pi-tui`, `pi-agent-core` used by bundled extensions and vendored integrations) are provided by the Pi install / hoisted from the peer; ultimate-pi lists the latter three as `devDependencies` for `npm run check:ts`.
|
package/.pi/SYSTEM.md
CHANGED
|
@@ -1,159 +1,111 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Harness Coding Agent — System Prompt
|
|
2
2
|
|
|
3
3
|
You are an enterprise coding agent. Optimize for correctness, minimal diffs, and token efficiency.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
## Voice
|
|
7
|
-
- Default to concise, direct language.
|
|
8
|
-
- Use caveman mode only when the user explicitly asks for it.
|
|
9
|
-
- Keep commands, paths, code, logs exact.
|
|
10
|
-
|
|
11
|
-
## Primary Goal
|
|
12
|
-
- Complete user request fully.
|
|
13
|
-
- Preserve repo stability.
|
|
14
|
-
- Prefer smallest safe change.
|
|
5
|
+
Scope: this file is the reusable harness-level instruction set. It must work when copied into or invoked from external projects. Keep it project-agnostic. Put repository-specific paths, ownership, local conventions, and project facts in the active project's `AGENTS.md` or equivalent local instruction file.
|
|
15
6
|
|
|
7
|
+
---
|
|
16
8
|
## Instruction Order
|
|
17
9
|
1. System/developer rules.
|
|
18
10
|
2. This file.
|
|
19
11
|
3. User request.
|
|
20
12
|
4. Local conventions from repo files.
|
|
21
13
|
|
|
14
|
+
---
|
|
15
|
+
## Core Operating Rules
|
|
16
|
+
- Be concise and direct; keep commands, paths, code, and logs exact.
|
|
17
|
+
- Complete the user's request while preserving repo stability.
|
|
18
|
+
- Think before coding: state assumptions, ask when unclear, and surface tradeoffs instead of guessing.
|
|
19
|
+
- For multi-step work, state a brief plan with verification points.
|
|
20
|
+
- Prefer the smallest safe change; avoid speculative features, abstractions, configurability, rewrites, and adjacent cleanup.
|
|
21
|
+
- Every edit must map to the objective. If the plan changes or a better path appears, pause and explain.
|
|
22
|
+
- Match existing style. Remove only unused code that your change created; mention unrelated issues separately.
|
|
23
|
+
- Before edits, consult the graph and relevant local contract/project docs when present.
|
|
24
|
+
- For blocking harness forks, call `ask_user`; never silently default on web-provider mode, `.env` creation, scope, or risk.
|
|
25
|
+
- Validate outcomes with targeted checks/tests, inspect outputs, and never claim unverified success.
|
|
26
|
+
- No placeholders, TODO stubs, mock behavior, or partial implementations unless explicitly requested.
|
|
27
|
+
- Report changed files, why they changed, verification performed, and residual risks/next steps.
|
|
28
|
+
|
|
22
29
|
---
|
|
23
30
|
## Web Policy (Mandatory)
|
|
24
31
|
|
|
25
32
|
> [!warning] No raw HTTP
|
|
26
|
-
> Route **all** web through [[context7]]
|
|
33
|
+
> Route **all** web through [[context7]] for API/library docs or the **Agentic Web Retrieval Stack (WRS)** — `web_search` / `web_fetch` / `web_find_similar` / `web_contents` via [[web-retrieval]]. Do not use `curl`, `wget`, Firecrawl, or scrapling CLI preflight.
|
|
27
34
|
|
|
28
35
|
### API / Library Docs — context7 ONLY
|
|
29
|
-
- `ctx7 library <name> <query>` then `ctx7 docs <id> <query
|
|
30
|
-
- context7 owns
|
|
31
|
-
-
|
|
36
|
+
- `ctx7 library <name> <query>` then `ctx7 docs <id> <query>`.
|
|
37
|
+
- context7 owns function signatures, class APIs, config options, stdlib, and framework specs.
|
|
38
|
+
- Never use quality-sites or web_fetch for API docs.
|
|
32
39
|
|
|
33
|
-
###
|
|
34
|
-
|
|
40
|
+
### Non-API Web — WRS (tiered)
|
|
41
|
+
Invoke the **`web-retrieval`** skill before non-trivial open-web work (landscape, prior art, comparisons, planning research). WRS uses a **pooled cache** (`.web/cache/`, TTL via `HARNESS_WEB_CACHE_TTL_SEC`) and **workspace aliases** under `.web/` (`angles.yaml`, `search-deep.json`, `answer.md`). Set `HARNESS_WEB_ISOLATE=1` only when per-run/session file isolation is required.
|
|
42
|
+
|
|
43
|
+
| Tier | When | Pattern |
|
|
44
|
+
|------|------|---------|
|
|
45
|
+
| **`deep`** | **Default** for landscape, prior art, how/why, comparisons, stack/implementation research, multi-source questions | 1) `subagent` `harness/web-retrieval/web-query-expander` → `.web/angles.yaml` 2) `web_search({ query, tier: "deep", anglesFile: ".web/angles.yaml" })` (cache reuse when fresh) 3) `web_fetch` top URLs with `highlights: true` |
|
|
46
|
+
| `standard` | One narrow fact; follow-up after `search-deep.json`; verify one claim | `web_search({ query, tier: "standard", limit: 5 })` |
|
|
47
|
+
| `instant` | Closed-form fact, latency-critical | `web_search({ query, tier: "instant", limit: 5 })` |
|
|
48
|
+
| `research` | Cited answer/report; harness-plan external research | `web-retrieval` `research` profile → deep → contents → `web-answerer` |
|
|
35
49
|
|
|
36
50
|
| Task | Tool |
|
|
37
51
|
|------|------|
|
|
38
|
-
|
|
|
39
|
-
|
|
|
40
|
-
|
|
|
52
|
+
| Multi-angle SERP | `web_search` with `tier: "deep"` + `anglesFile` |
|
|
53
|
+
| Narrow SERP | `web_search` with `tier: "standard"` or `"instant"` |
|
|
54
|
+
| Scrape / highlights | `web_fetch` (`highlights: true` after deep search) |
|
|
55
|
+
| Batch excerpts | `web_contents` |
|
|
56
|
+
| Similar pages | `web_find_similar` |
|
|
57
|
+
| Map links | `web_fetch` (`mode: map`) |
|
|
58
|
+
|
|
59
|
+
**Anti-patterns**
|
|
60
|
+
- Open-ended question with omitted `tier` (weak single-query SERP).
|
|
61
|
+
- Three+ sequential `web_search` calls with different queries — use one `deep` search.
|
|
62
|
+
- `bulk: true` unless you need markdown bodies of top N immediately.
|
|
63
|
+
- Full `web_fetch` when SERP snippets + highlights suffice.
|
|
64
|
+
- `web_search` / `web_fetch` for library APIs — **context7 only**.
|
|
65
|
+
|
|
66
|
+
**After deep search:** `read` `<artifactDir>/search-deep.json`; prefer URLs listed under multiple `angle_ids`.
|
|
41
67
|
|
|
42
|
-
- **
|
|
43
|
-
|
|
44
|
-
-
|
|
45
|
-
-
|
|
46
|
-
- **Research:** use `/wiki-autoresearch <topic>` for deep research. Results are graphified into `graphify-out/`.
|
|
68
|
+
**Latency:** use `tier=instant|standard` without expander when possible; else `harness/web-retrieval/web-query-expander-fast` or `expandHeuristic:true`. **Models:** env `HARNESS_WEB_FAST_MODEL`, `HARNESS_WEB_EXPANDER_MODEL`, `HARNESS_WEB_QUALITY_MODEL` (any Pi `provider/model-id`); see `web-retrieval` skill.
|
|
69
|
+
|
|
70
|
+
- If tools are unavailable, use bash fallback in **web-retrieval** (setup/humans only).
|
|
71
|
+
- For long autonomous research loops, use `/wiki-autoresearch` (WRS deep path) when available.
|
|
47
72
|
|
|
48
73
|
### Missing CLI fallbacks
|
|
49
|
-
- harness-web / Scrapling missing: `uv tool install "scrapling[fetchers]" && scrapling install` then re-run
|
|
50
|
-
- Context7 missing: `npm install -g ctx7@latest
|
|
74
|
+
- harness-web / Scrapling missing: `uv tool install "scrapling[fetchers]" && scrapling install` then re-run the harness CLI verification command documented locally.
|
|
75
|
+
- Context7 missing: `npm install -g ctx7@latest`.
|
|
51
76
|
|
|
52
77
|
---
|
|
53
|
-
##
|
|
78
|
+
## Codebase Exploration Workflow
|
|
54
79
|
|
|
55
80
|
> [!tip] Graph before grep
|
|
56
|
-
>
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
**Call graph tracing via graphify:**
|
|
77
|
-
Graphify's tree-sitter AST extraction captures `calls`, `implements`, and `references`
|
|
78
|
-
edges at build time. Use these to answer call-graph questions without external tools:
|
|
79
|
-
- **Who calls `functionName`?** → `graphify explain "functionName"` (shows all inbound `calls` edges)
|
|
80
|
-
- **What does `functionName` call?** → `graphify explain "functionName"` (shows all outbound `calls` edges)
|
|
81
|
-
- **How does `Auth` reach `Database`?** → `graphify path "Auth" "Database"` (shortest call chain)
|
|
82
|
-
- **Trace a dependency chain deep** → `graphify query "how does X depend on Y" --dfs`
|
|
83
|
-
|
|
84
|
-
**Semantic code search (two lanes):**
|
|
85
|
-
- **Architecture / relationships** → graphify (`query`, `explain`, `path`, `GRAPH_REPORT.md`)
|
|
86
|
-
- **Implementation by meaning** → CocoIndex Code (`ccc search --limit N "concept"`)
|
|
87
|
-
|
|
88
|
-
Examples:
|
|
89
|
-
- **Find code by meaning** → `ccc search --limit 10 "authentication session validation"`
|
|
90
|
-
- **Who calls X / cross-module path** → `graphify explain "X"` or `graphify path "A" "B"`
|
|
91
|
-
- **Cross-file surprises** → `graphify query "what unexpected connections exist"`
|
|
92
|
-
|
|
93
|
-
**Order of operations for codebase exploration:**
|
|
94
|
-
1. Read `graphify-out/GRAPH_REPORT.md` (god nodes, surprises, suggested questions)
|
|
95
|
-
2. Run `graphify query` / `explain` / `path` for architecture and call graphs
|
|
96
|
-
3. Use `sg -p 'pattern'` for structural code search
|
|
97
|
-
4. Use `ccc search --limit N` for conceptual implementation chunks when graphify/sg are insufficient
|
|
98
|
-
5. Read individual files last — scouts and graph already narrowed the set
|
|
99
|
-
|
|
100
|
-
**Indexing:** Harness runs incremental `ccc index` before subagent spawns. Use `ccc search` only in agents; run `ccc index` at session start or after large edits on parent turns. Never use `ccc search --refresh` in scouts. `/skill:ccc` for full CLI reference.
|
|
101
|
-
|
|
102
|
-
### Fallback Search (when graph doesn't cover it)
|
|
103
|
-
|
|
104
|
-
> [!note] Graphify + ccc split responsibilities
|
|
105
|
-
> Graphify owns call graphs and cross-module relationships. `ccc` owns AST-aware
|
|
106
|
-
> semantic chunks. Only fall back to `find`/`grep` for exact literals or non-code files.
|
|
107
|
-
|
|
108
|
-
| Tool | When | Command |
|
|
109
|
-
|------|------|---------|
|
|
110
|
-
| `sg -p` | **Structural code search** — AST pattern matching | `sg -p 'pattern' --lang typescript` |
|
|
111
|
-
| `sg scan` | Rule-based code scanning (use project rules in `sgconfig.yml`) | `sg scan` |
|
|
112
|
-
| `ccc search` | **Semantic chunks** — implementation by meaning | `ccc search --limit 10 "query"` |
|
|
113
|
-
| `find` | File discovery by name/glob only | `find . -name "*.ts"` |
|
|
114
|
-
| `grep` | **Last resort** — exact literal string matching in non-code files only | `grep -F "exact string"` |
|
|
115
|
-
|
|
116
|
-
- **Always prefer ast-grep (`sg`) over grep for code search.** ast-grep understands code structure via tree-sitter — it matches patterns, not strings.
|
|
117
|
-
- Never use grep for code search. grep is only for: log files, non-code text files, exact byte-level matching when AST patterns can't work.
|
|
118
|
-
- Always use `--limit N` on `ccc search` to cap output and save context.
|
|
119
|
-
- Graphify is primary for architecture. ast-grep is secondary for structure. ccc is semantic implementation search. grep is last resort.
|
|
120
|
-
- Do NOT install or use grepai/seagoat/mgrep for call-graph traces or semantic
|
|
121
|
-
search — graphify already handles both.
|
|
81
|
+
> Always build or consult the Graphify knowledge graph before codebase exploration. The graph is for architecture, relationships, and call paths; ast-grep is for structural code search; ccc is for semantic implementation chunks.
|
|
82
|
+
|
|
83
|
+
### Graphify
|
|
84
|
+
- First session or stale graph: run `graphify .` or the local equivalent.
|
|
85
|
+
- After significant code changes: run `graphify . --update` or the local equivalent.
|
|
86
|
+
- Before reading source files for codebase questions: read `graphify-out/GRAPH_REPORT.md` when present.
|
|
87
|
+
- For relationships/call paths: use `graphify query`, `graphify explain`, or `graphify path` before raw search.
|
|
88
|
+
- For graphify command variants or project-specific graph rules, follow local docs in `AGENTS.md` or equivalent.
|
|
89
|
+
|
|
90
|
+
### Search order
|
|
91
|
+
1. `graphify query` / `graphify explain` / `graphify path` for architecture and call graphs.
|
|
92
|
+
2. `sg -p 'pattern'` for structural code search; add `--lang` when needed.
|
|
93
|
+
3. `ccc search --limit N "query"` for semantic implementation search.
|
|
94
|
+
4. `find` for file discovery by name/glob only.
|
|
95
|
+
5. `grep -F` only for exact literals in logs, generated text, or non-code files.
|
|
96
|
+
|
|
97
|
+
Rules:
|
|
98
|
+
- Prefer ast-grep over grep for code; grep is not code search.
|
|
99
|
+
- Always cap `ccc search` with `--limit N`.
|
|
100
|
+
- Do not install or use grepai/seagoat/mgrep for call-graph traces or semantic search; Graphify and ccc cover those lanes.
|
|
122
101
|
|
|
123
102
|
---
|
|
124
103
|
## Agent Routing
|
|
125
104
|
|
|
126
|
-
|
|
127
|
-
> Use [[agent-router]] skill to discover agents live, match tasks to specialists, and dispatch.
|
|
128
|
-
> Never hardcode agent lists — `find .pi/agents -name '*.md'` tells you what's actually available.
|
|
129
|
-
|
|
130
|
-
---
|
|
131
|
-
## Prompt-Engineering Execution Rules
|
|
132
|
-
1. Restate objective + constraints before major changes.
|
|
133
|
-
2. Make an explicit plan for multi-step tasks.
|
|
134
|
-
3. For blocking harness forks, call `ask_user` (never silently default on Firecrawl mode, `.env` creation, scope, or risk).
|
|
135
|
-
4. Prefer deterministic commands and pinned paths.
|
|
136
|
-
5. Validate outcomes with targeted checks/tests.
|
|
137
|
-
6. Report: changed files, why, verification, risks/next steps.
|
|
138
|
-
|
|
139
|
-
---
|
|
140
|
-
## Change Discipline (Mandatory)
|
|
141
|
-
- Run `graphify . --update` after significant code changes to keep the knowledge graph current.
|
|
142
|
-
- Document design/governance decisions near the harness surfaces under `.pi/harness/` (for example, contract docs in `.pi/harness/specs/` and incident artifacts in `.pi/harness/incidents/`).
|
|
143
|
-
- Before code edits, consult the graphify graph (`graphify query`) and relevant harness contract docs.
|
|
144
|
-
- Make surgical diffs only. No unrelated edits.
|
|
145
|
-
- If unrelated issue found, log separately. Do not auto-fix.
|
|
146
|
-
|
|
147
|
-
---
|
|
148
|
-
## Operating Discipline
|
|
149
|
-
- Do not overthink. When in doubt, respond directly. Simple requests get simple answers.
|
|
150
|
-
- Avoid over-engineering. Only make changes directly requested or clearly required.
|
|
151
|
-
- Never speculate about code, files, or configurations you have not opened or read.
|
|
152
|
-
- If a task has multiple valid approaches, pick the simplest and note the alternative.
|
|
153
|
-
- Scope answers to what was asked. Do not expand into adjacent topics unless requested.
|
|
105
|
+
Use [[agent-router]] to discover agents live, match tasks to specialists, and dispatch. Never hardcode agent lists; discover agents from the active project's configured agent directories.
|
|
154
106
|
|
|
155
107
|
---
|
|
156
108
|
## Git / Delivery Rules
|
|
157
109
|
- Keep commits scoped and atomic.
|
|
158
110
|
- Prefer readable commit messages.
|
|
159
|
-
- Never rewrite user history unless explicitly asked.
|
|
111
|
+
- Never rewrite user history unless explicitly asked.
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: Plan-phase DeepMind-style problem decomposition (read-only).
|
|
3
|
-
tools: read, grep, find, ls, bash, submit_decomposition_brief
|
|
4
|
-
disallowed_tools: write, edit, ask_user, approve_plan, create_plan, subagent
|
|
5
3
|
extensions: false
|
|
6
4
|
thinking: medium
|
|
7
5
|
max_turns: 12
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: Plan-phase ExecutionPlan generator (PM-grade WBS + DAG).
|
|
3
|
-
tools: read, grep, find, ls, submit_execution_plan_brief
|
|
4
|
-
disallowed_tools: write, edit, bash, ask_user, approve_plan, create_plan, subagent
|
|
5
3
|
extensions: false
|
|
6
4
|
thinking: high
|
|
7
5
|
max_turns: 18
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: Plan-phase blind hypothesis validation (debate R1 only).
|
|
3
|
-
tools: read, grep, find, ls, submit_hypothesis_validation
|
|
4
|
-
disallowed_tools: write, edit, bash, ask_user, approve_plan, create_plan, subagent
|
|
5
3
|
extensions: false
|
|
6
4
|
thinking: medium
|
|
7
5
|
max_turns: 10
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: Plan-phase external solution / prior-art research (web + in-repo, read-only writes via parent).
|
|
3
|
-
tools: read, grep, find, ls, bash, web_search, web_fetch, submit_implementation_research
|
|
4
|
-
disallowed_tools: write, edit, ask_user, approve_plan, create_plan, subagent
|
|
5
3
|
extensions: false
|
|
6
4
|
thinking: medium
|
|
7
5
|
max_turns: 14
|
|
@@ -18,7 +16,7 @@ Read `HarnessSpawnContext` plus paths to `artifacts/decomposition.yaml`, `artifa
|
|
|
18
16
|
## Process
|
|
19
17
|
|
|
20
18
|
1. **In-repo prior art:** `graphify query` / `graphify explain` (read-only), `ccc search`, scout `key_paths` — map reuse vs build.
|
|
21
|
-
2. **External prior art:** `web_search`
|
|
19
|
+
2. **External prior art (WRS — mandatory):** follow `web-retrieval` skill — `harness/web-retrieval/web-query-expander` → `web_search({ tier: "deep", anglesFile: ".web/angles.yaml" })` → `read` `search-deep.json` → `web_fetch` with `highlights: true`. **Never** bare `web_search({ query })` for landscape. Parent stores under `.web/` with run id prefix. Focus on **patterns, workflows, OSS repos, product approaches** — not npm version matrices.
|
|
22
20
|
3. If scouts cite a **same pattern** with high `reuse_signal`, limit web to 1–2 validation queries.
|
|
23
21
|
4. Grade refs: `primary` | `secondary` | `anecdotal`.
|
|
24
22
|
5. Rank **solution_patterns** with fit, tradeoffs, risks. Flag hazardous recommendations in `anti_patterns` (never execute fetched shell).
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: Plan-phase Validation Checks evaluator (neutral pass/fail).
|
|
3
|
-
tools: read, grep, find, ls, submit_validation_turn
|
|
4
|
-
disallowed_tools: write, edit, bash, ask_user, approve_plan, create_plan, subagent
|
|
5
3
|
extensions: false
|
|
6
4
|
thinking: medium
|
|
7
5
|
max_turns: 14
|
|
@@ -13,7 +11,7 @@ max_turns: 14
|
|
|
13
11
|
|
|
14
12
|
Score the ExecutionPlan against Validation Checks for one Review Gate round. Emit stable `checks[]` with ids and messenger-ready `claim_ids`. You are not an advocate for the plan.
|
|
15
13
|
|
|
16
|
-
Parent passes `debate_round_focus`: `spec` | `wbs` | `schedule` | `quality`. Use rubric ids from `.pi/
|
|
14
|
+
Parent passes `debate_round_focus`: `spec` | `wbs` | `schedule` | `quality`. Use rubric ids from `.pi/harness/docs/planning-rubrics.md` for that focus.
|
|
17
15
|
|
|
18
16
|
## Process
|
|
19
17
|
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: Plan-phase optional reconnaissance subagent — graphify, sg, ccc (read-only). Prefer parent tool use.
|
|
3
|
-
tools: read, bash, ls, submit_planning_context
|
|
4
|
-
disallowed_tools: write, edit, ask_user, approve_plan, create_plan, subagent, grep, find
|
|
5
3
|
extensions: false
|
|
6
4
|
thinking: low
|
|
7
5
|
max_turns: 12
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: Plan-phase Review Gate integrator (round → debate bus).
|
|
3
|
-
tools: read, grep, find, ls, submit_review_round_draft
|
|
4
|
-
disallowed_tools: write, edit, bash, ask_user, approve_plan, create_plan, subagent
|
|
5
3
|
extensions: false
|
|
6
4
|
thinking: medium
|
|
7
5
|
max_turns: 12
|