ultimate-pi 0.18.0 → 0.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (314) hide show
  1. package/.agents/skills/harness-debate-plan/SKILL.md +1 -1
  2. package/.agents/skills/harness-decisions/SKILL.md +2 -3
  3. package/.agents/skills/harness-governor/SKILL.md +6 -5
  4. package/.agents/skills/harness-orchestration/SKILL.md +4 -4
  5. package/.agents/skills/harness-review/SKILL.md +7 -7
  6. package/.agents/skills/harness-sentrux-setup/SKILL.md +4 -3
  7. package/.agents/skills/harness-steer/SKILL.md +1 -1
  8. package/.agents/skills/sentrux/SKILL.md +9 -9
  9. package/.pi/PACKAGING.md +4 -4
  10. package/.pi/SYSTEM.md +54 -120
  11. package/.pi/agents/harness/incident-recorder.md +0 -1
  12. package/.pi/agents/harness/planning/decompose.md +1 -3
  13. package/.pi/agents/harness/planning/execution-plan-author.md +0 -2
  14. package/.pi/agents/harness/planning/hypothesis-validator.md +0 -2
  15. package/.pi/agents/harness/planning/hypothesis.md +0 -2
  16. package/.pi/agents/harness/planning/implementation-researcher.md +0 -2
  17. package/.pi/agents/harness/planning/plan-adversary.md +0 -2
  18. package/.pi/agents/harness/planning/plan-evaluator.md +1 -3
  19. package/.pi/agents/harness/planning/planning-context.md +0 -2
  20. package/.pi/agents/harness/planning/review-integrator.md +0 -2
  21. package/.pi/agents/harness/planning/sprint-contract-auditor.md +0 -2
  22. package/.pi/agents/harness/planning/stack-researcher.md +0 -2
  23. package/.pi/agents/harness/{adversary.md → reviewing/adversary.md} +0 -2
  24. package/.pi/agents/harness/{evaluator.md → reviewing/evaluator.md} +0 -2
  25. package/.pi/agents/harness/{tie-breaker.md → reviewing/tie-breaker.md} +0 -2
  26. package/.pi/agents/harness/{executor.md → running/executor.md} +0 -2
  27. package/.pi/agents/harness/sentrux-bootstrap.md +0 -1
  28. package/.pi/agents/harness/sentrux-steward.md +0 -2
  29. package/.pi/agents/harness/trace-librarian.md +0 -1
  30. package/.pi/extensions/00-harness-project-control.ts +133 -0
  31. package/.pi/extensions/00-posthog-network-bootstrap.ts +1 -1
  32. package/.pi/extensions/agt-kill-switch.ts +57 -0
  33. package/.pi/extensions/agt-prompt-guard.ts +32 -0
  34. package/.pi/extensions/budget-guard.ts +2 -0
  35. package/.pi/extensions/custom-footer.ts +46 -145
  36. package/.pi/extensions/custom-header.ts +1 -1
  37. package/.pi/extensions/custom-system-prompt.ts +1 -1
  38. package/.pi/extensions/debate-orchestrator.ts +7 -5
  39. package/.pi/extensions/harness-ask-user.ts +8 -8
  40. package/.pi/extensions/harness-debate-tools.ts +27 -43
  41. package/.pi/extensions/harness-lens.ts +94 -0
  42. package/.pi/extensions/harness-live-widget.ts +33 -2
  43. package/.pi/extensions/harness-plan-approval.ts +12 -12
  44. package/.pi/extensions/harness-run-context.ts +1214 -852
  45. package/.pi/extensions/harness-subagent-governance.ts +8 -0
  46. package/.pi/extensions/harness-subagent-submit.ts +36 -164
  47. package/.pi/extensions/harness-subagents.ts +4 -4
  48. package/.pi/extensions/harness-telemetry.ts +3 -1
  49. package/.pi/extensions/harness-web-tools.ts +3 -3
  50. package/.pi/extensions/observation-bus.ts +2 -0
  51. package/.pi/extensions/policy-gate.ts +27 -5
  52. package/.pi/extensions/review-integrity.ts +91 -10
  53. package/.pi/extensions/sentrux-rules-sync.ts +3 -1
  54. package/.pi/extensions/subagent-governance.ts +92 -0
  55. package/.pi/extensions/test-diff-integrity.ts +1 -0
  56. package/.pi/extensions/trace-recorder.ts +3 -1
  57. package/.pi/extensions/{ultimate-pi-vcc.ts → vcc-compaction.ts} +1 -1
  58. package/.pi/harness/README.md +6 -2
  59. package/.pi/harness/agents.manifest.json +38 -49
  60. package/.pi/harness/agents.policy.yaml +275 -0
  61. package/.pi/harness/corpus/graphify-kb-updater.config.json +55 -0
  62. package/.pi/harness/docs/adrs/0006-sentrux-dual-layer.md +2 -1
  63. package/.pi/harness/docs/adrs/0030-inhouse-vcc-compaction.md +1 -1
  64. package/.pi/harness/docs/adrs/0035-plan-phase-review-gate.md +1 -1
  65. package/.pi/harness/docs/adrs/0044-harness-steer-loop.md +3 -2
  66. package/.pi/harness/docs/adrs/0045-harness-lens-minimal-contract.md +49 -0
  67. package/.pi/harness/docs/adrs/0045-phase-scoped-agent-directories.md +33 -0
  68. package/.pi/harness/docs/adrs/0046-agt-policy-engine.md +51 -0
  69. package/.pi/harness/docs/adrs/0047-agt-layered-security.md +39 -0
  70. package/.pi/harness/docs/adrs/0048-tool-call-hook-order.md +25 -0
  71. package/.pi/harness/docs/adrs/0049-agents-policy-manifest.md +36 -0
  72. package/.pi/harness/docs/adrs/README.md +6 -0
  73. package/.pi/harness/docs/graphify-kb-updater-runbook.md +11 -5
  74. package/.pi/harness/docs/practice-map.md +2 -2
  75. package/.pi/harness/evolution/README.md +1 -2
  76. package/.pi/harness/examples/agents.policy.project.yaml +19 -0
  77. package/.pi/harness/examples/policies/custom-deny-bash.yaml +9 -0
  78. package/.pi/harness/policies/bash-denylists.yaml +5 -0
  79. package/.pi/harness/policies/defaults.yaml +51 -0
  80. package/.pi/harness/policies/orchestrator.yaml +18 -0
  81. package/.pi/harness/policies/phases.yaml +10 -0
  82. package/.pi/harness/policies/roles.yaml +5 -0
  83. package/.pi/harness/policies/web-guard.yaml +5 -0
  84. package/.pi/harness/policies/workflow-sequences.yaml +9 -0
  85. package/.pi/harness/sentrux/architecture.manifest.json +26 -4
  86. package/.pi/harness/specs/harness-spawn-context.schema.json +1 -1
  87. package/.pi/harness/specs/observation.schema.json +2 -1
  88. package/.pi/lib/agents-policy.d.mts +70 -0
  89. package/.pi/lib/agents-policy.mjs +325 -0
  90. package/.pi/lib/agents-policy.ts +19 -0
  91. package/.pi/lib/agt/audit-run-sink.ts +52 -0
  92. package/.pi/lib/agt/build-evaluation-context.ts +285 -0
  93. package/.pi/lib/agt/config.ts +28 -0
  94. package/.pi/lib/agt/delegation.ts +69 -0
  95. package/.pi/lib/agt/evaluate-policy.ts +56 -0
  96. package/.pi/lib/agt/identity-registry.ts +41 -0
  97. package/.pi/lib/agt/index.ts +55 -0
  98. package/.pi/lib/agt/kill-switch-state.ts +11 -0
  99. package/.pi/lib/agt/legacy-evaluate.ts +101 -0
  100. package/.pi/lib/agt/policy-engine.ts +154 -0
  101. package/.pi/lib/agt/rings.ts +21 -0
  102. package/.pi/lib/agt/sre-hooks.ts +45 -0
  103. package/.pi/lib/agt/trust-run-store.ts +26 -0
  104. package/.pi/lib/agt/workflow-history.ts +29 -0
  105. package/.pi/lib/agt-governance-active.ts +14 -0
  106. package/.pi/lib/agt-tool-guard.ts +78 -0
  107. package/.pi/lib/ask-user/dialog.ts +314 -0
  108. package/.pi/{extensions/lib → lib}/debate-bus-core.ts +10 -10
  109. package/.pi/{extensions/lib → lib}/debate-bus-state.ts +1 -1
  110. package/.pi/{extensions/lib → lib}/extension-load-guard.ts +21 -0
  111. package/.pi/lib/harness-agt-tool-guard.ts +5 -0
  112. package/.pi/{extensions/lib → lib}/harness-artifact-gate.ts +6 -16
  113. package/.pi/lib/harness-debate-core-deps.ts +14 -0
  114. package/.pi/lib/harness-debate-workflow-deps.ts +43 -0
  115. package/.pi/lib/harness-lens/.gitattributes +1 -0
  116. package/.pi/lib/harness-lens/clients/edit-autopatch.ts +88 -0
  117. package/.pi/lib/harness-lens/clients/file-kinds.ts +380 -0
  118. package/.pi/lib/harness-lens/clients/file-time.ts +215 -0
  119. package/.pi/lib/harness-lens/clients/file-utils.ts +484 -0
  120. package/.pi/lib/harness-lens/clients/format-service.ts +276 -0
  121. package/.pi/lib/harness-lens/clients/formatters.ts +1000 -0
  122. package/.pi/lib/harness-lens/clients/git-guard.ts +31 -0
  123. package/.pi/lib/harness-lens/clients/indent-retarget.ts +90 -0
  124. package/.pi/lib/harness-lens/clients/installer/index.ts +2368 -0
  125. package/.pi/lib/harness-lens/clients/latency-logger.ts +80 -0
  126. package/.pi/lib/harness-lens/clients/lens-config.ts +43 -0
  127. package/.pi/lib/harness-lens/clients/lens-events.ts +164 -0
  128. package/.pi/lib/harness-lens/clients/lsp/aggregation.ts +91 -0
  129. package/.pi/lib/harness-lens/clients/lsp/client.ts +1466 -0
  130. package/.pi/lib/harness-lens/clients/lsp/config.ts +216 -0
  131. package/.pi/lib/harness-lens/clients/lsp/edits.ts +297 -0
  132. package/.pi/lib/harness-lens/clients/lsp/index.ts +1355 -0
  133. package/.pi/lib/harness-lens/clients/lsp/interactive-install.ts +424 -0
  134. package/.pi/lib/harness-lens/clients/lsp/language.ts +223 -0
  135. package/.pi/lib/harness-lens/clients/lsp/launch.ts +939 -0
  136. package/.pi/lib/harness-lens/clients/lsp/lsp-index.ts +11 -0
  137. package/.pi/lib/harness-lens/clients/lsp/path-utils.ts +12 -0
  138. package/.pi/lib/harness-lens/clients/lsp/server-strategies.ts +81 -0
  139. package/.pi/lib/harness-lens/clients/lsp/server.ts +1971 -0
  140. package/.pi/lib/harness-lens/clients/path-utils.ts +182 -0
  141. package/.pi/lib/harness-lens/clients/pipeline.ts +360 -0
  142. package/.pi/lib/harness-lens/clients/project-profile.ts +117 -0
  143. package/.pi/lib/harness-lens/clients/runtime-agent-end.ts +112 -0
  144. package/.pi/lib/harness-lens/clients/runtime-config.ts +33 -0
  145. package/.pi/lib/harness-lens/clients/runtime-coordinator.ts +186 -0
  146. package/.pi/lib/harness-lens/clients/runtime-tool-result.ts +171 -0
  147. package/.pi/lib/harness-lens/clients/safe-spawn.ts +339 -0
  148. package/.pi/lib/harness-lens/clients/secrets-scanner.ts +214 -0
  149. package/.pi/lib/harness-lens/clients/tool-policy.ts +2072 -0
  150. package/.pi/lib/harness-lens/clients/types.ts +59 -0
  151. package/.pi/lib/harness-lens/clients/widget-state.ts +283 -0
  152. package/.pi/lib/harness-lens/index.ts +532 -0
  153. package/.pi/lib/harness-lens/tools/lsp-diagnostics.ts +706 -0
  154. package/.pi/lib/harness-lens/tools/lsp-navigation.ts +1246 -0
  155. package/.pi/{extensions/lib → lib}/harness-posthog.ts +3 -0
  156. package/.pi/lib/harness-project-config.ts +91 -0
  157. package/.pi/lib/harness-run-context-responses.ts +9 -0
  158. package/.pi/lib/harness-run-context.ts +1 -3
  159. package/.pi/{extensions/lib/spawn-policy.ts → lib/harness-spawn-policy.ts} +4 -3
  160. package/.pi/{extensions/lib → lib}/harness-spawn-topology.ts +5 -28
  161. package/.pi/lib/harness-subagent-auth.ts +51 -0
  162. package/.pi/{extensions/lib → lib}/harness-subagent-precheck.ts +13 -10
  163. package/.pi/{extensions/lib → lib}/harness-subagent-submit-pipeline.ts +3 -3
  164. package/.pi/lib/harness-subagent-submit-register.ts +163 -0
  165. package/.pi/{extensions/lib → lib}/harness-subagent-submit-registry.ts +1 -55
  166. package/.pi/{extensions/lib → lib}/harness-subagents-bridge.ts +53 -14
  167. package/.pi/{extensions/lib → lib}/harness-subprocess-bootstrap.ts +1 -1
  168. package/.pi/lib/harness-ui-state.ts +27 -12
  169. package/.pi/{extensions/lib → lib}/plan-approval/create-plan.ts +2 -2
  170. package/.pi/{extensions/lib → lib}/plan-approval/format-plan.ts +2 -2
  171. package/.pi/{extensions/lib → lib}/plan-approval/plan-review.ts +162 -201
  172. package/.pi/{extensions/lib → lib}/plan-approval/render.ts +1 -1
  173. package/.pi/{extensions/lib → lib}/plan-approval/resolve-disk.ts +2 -2
  174. package/.pi/{extensions/lib → lib}/plan-approval/types.ts +1 -1
  175. package/.pi/{extensions/lib → lib}/plan-approval/validate.ts +3 -3
  176. package/.pi/{extensions/lib → lib}/plan-approval-readiness.ts +3 -52
  177. package/.pi/{extensions/lib → lib}/plan-debate-envelope.ts +1 -1
  178. package/.pi/{extensions/lib → lib}/plan-debate-gate.ts +1 -1
  179. package/.pi/{extensions/lib → lib}/plan-debate-lane.ts +1 -4
  180. package/.pi/{extensions/lib → lib}/plan-messenger.ts +1 -1
  181. package/.pi/prompts/harness-auto.md +2 -2
  182. package/.pi/prompts/harness-plan.md +4 -6
  183. package/.pi/prompts/harness-review.md +9 -9
  184. package/.pi/prompts/harness-run.md +7 -7
  185. package/.pi/prompts/harness-setup.md +42 -68
  186. package/.pi/prompts/harness-steer.md +2 -2
  187. package/.pi/scripts/README.md +3 -5
  188. package/.pi/scripts/generate-agents-policy-yaml.mjs +148 -0
  189. package/.pi/scripts/graphify-kb-updater.mjs +48 -8
  190. package/.pi/scripts/harness-agents-manifest.mjs +61 -4
  191. package/.pi/scripts/harness-agt-doctor.ts +36 -0
  192. package/.pi/scripts/harness-cli-verify.sh +9 -2
  193. package/.pi/scripts/harness-project-toggle.mjs +129 -0
  194. package/.pi/scripts/harness-sentrux-cli.mjs +142 -0
  195. package/.pi/scripts/harness-verify.mjs +113 -39
  196. package/.pi/scripts/harness-web-policy-guard.mjs +2 -2
  197. package/.pi/scripts/validate-plan-dag.mjs +65 -74
  198. package/.pi/scripts/vendor-pi-vcc-settings.stub.ts +2 -2
  199. package/.pi/scripts/vendor-sync-pi-vcc.sh +1 -1
  200. package/.pi/skills/architecture/broker-domain/SKILL.md +65 -0
  201. package/.pi/skills/architecture/cqrs/SKILL.md +63 -0
  202. package/.pi/skills/architecture/event-driven/SKILL.md +60 -0
  203. package/.pi/skills/architecture/hexagonal-ports-adapters/SKILL.md +66 -0
  204. package/.pi/skills/architecture/layered/SKILL.md +68 -0
  205. package/.pi/skills/architecture/microkernel/SKILL.md +62 -0
  206. package/.pi/skills/architecture/microservices/SKILL.md +64 -0
  207. package/.pi/skills/architecture/modular-monolith/SKILL.md +65 -0
  208. package/.pi/skills/architecture/orchestration-driven-soa/SKILL.md +61 -0
  209. package/.pi/skills/architecture/pipeline/SKILL.md +63 -0
  210. package/.pi/skills/architecture/service-based/SKILL.md +64 -0
  211. package/.pi/skills/architecture/service-mesh/SKILL.md +60 -0
  212. package/.pi/skills/architecture/space-based/SKILL.md +60 -0
  213. package/.pi/skills/ast-grep/SKILL.md +40 -321
  214. package/.pi/skills/delivery/debugging-discipline/SKILL.md +36 -0
  215. package/.pi/skills/delivery/documentation-update/SKILL.md +33 -0
  216. package/.pi/skills/delivery/requirements-to-implementation/SKILL.md +34 -0
  217. package/.pi/skills/delivery/risk-based-verification/SKILL.md +43 -0
  218. package/.pi/skills/delivery/tradeoff-analysis/SKILL.md +34 -0
  219. package/.pi/skills/engineering/api-contract-design/SKILL.md +38 -0
  220. package/.pi/skills/engineering/cohesion-coupling/SKILL.md +43 -0
  221. package/.pi/skills/engineering/complexity-control/SKILL.md +31 -0
  222. package/.pi/skills/engineering/defensive-programming/SKILL.md +38 -0
  223. package/.pi/skills/engineering/dependency-management/SKILL.md +29 -0
  224. package/.pi/skills/engineering/domain-modeling/SKILL.md +32 -0
  225. package/.pi/skills/engineering/error-handling/SKILL.md +37 -0
  226. package/.pi/skills/engineering/legacy-code-seams/SKILL.md +35 -0
  227. package/.pi/skills/engineering/naming-and-intent/SKILL.md +29 -0
  228. package/.pi/skills/engineering/refactoring-safe-evolution/SKILL.md +35 -0
  229. package/.pi/skills/engineering/routine-function-design/SKILL.md +34 -0
  230. package/.pi/skills/engineering/small-change-discipline/SKILL.md +35 -0
  231. package/.pi/skills/lsp-navigation/SKILL.md +89 -0
  232. package/.pi/skills/quality/code-review-self-check/SKILL.md +35 -0
  233. package/.pi/skills/quality/privacy-data-handling/SKILL.md +26 -0
  234. package/.pi/skills/quality/security-review/SKILL.md +34 -0
  235. package/.pi/skills/quality/test-strategy/SKILL.md +33 -0
  236. package/.pi/skills/quality/testability-design/SKILL.md +33 -0
  237. package/.pi/skills/systems/concurrency-safety/SKILL.md +32 -0
  238. package/.pi/skills/systems/data-modeling-migrations/SKILL.md +31 -0
  239. package/.pi/skills/systems/observability-instrumentation/SKILL.md +32 -0
  240. package/.pi/skills/systems/performance-measurement/SKILL.md +35 -0
  241. package/.pi/skills/systems/reliability-design/SKILL.md +32 -0
  242. package/.sentrux/rules.toml +20 -4
  243. package/AGENTS.md +5 -0
  244. package/CHANGELOG.md +26 -0
  245. package/README.md +85 -58
  246. package/THIRD_PARTY_NOTICES.md +12 -21
  247. package/package.json +15 -7
  248. package/vendor/pi-subagents/src/agents.ts +45 -1
  249. package/vendor/pi-subagents/src/subagents.ts +866 -811
  250. package/vendor/pi-vcc/src/core/brief.ts +68 -99
  251. package/vendor/pi-vcc/src/core/settings.ts +2 -2
  252. package/.agents/skills/caveman/SKILL.md +0 -67
  253. package/.pi/agents/harness/meta-optimizer.md +0 -36
  254. package/.pi/agents/harness/planning/scout-graphify.md +0 -39
  255. package/.pi/agents/harness/planning/scout-semantic.md +0 -41
  256. package/.pi/agents/harness/planning/scout-structure.md +0 -37
  257. package/.pi/extensions/lib/ask-user/dialog.ts +0 -260
  258. package/.pi/extensions/lib/harness-subagent-auth.ts +0 -209
  259. package/.pi/extensions/lib/harness-subagent-policy.ts +0 -236
  260. package/.pi/extensions/pi-model-router-harness.ts +0 -42
  261. package/.pi/harness/evolution/meta-optimizer.mjs +0 -99
  262. package/.pi/harness/specs/router-tuning-proposal.schema.json +0 -114
  263. package/.pi/model-router.example.json +0 -36
  264. package/.pi/prompts/harness-critic.md +0 -10
  265. package/.pi/prompts/harness-eval.md +0 -10
  266. package/.pi/prompts/harness-router-tune.md +0 -52
  267. package/.pi/scripts/harness-generate-model-router.mjs +0 -327
  268. package/.pi/scripts/harness-model-router-routing.test.mjs +0 -97
  269. package/.pi/scripts/harness-sync-model-router.mjs +0 -97
  270. package/.pi/scripts/vendor-sync-pi-model-router.sh +0 -47
  271. package/vendor/pi-model-router/.prettierignore +0 -4
  272. package/vendor/pi-model-router/.prettierrc +0 -5
  273. package/vendor/pi-model-router/AGENTS.md +0 -39
  274. package/vendor/pi-model-router/LICENSE +0 -21
  275. package/vendor/pi-model-router/README.md +0 -99
  276. package/vendor/pi-model-router/UPSTREAM_PIN.md +0 -10
  277. package/vendor/pi-model-router/docs/ARCHITECTURE.md +0 -54
  278. package/vendor/pi-model-router/extensions/commands.ts +0 -720
  279. package/vendor/pi-model-router/extensions/config.ts +0 -348
  280. package/vendor/pi-model-router/extensions/constants.ts +0 -1
  281. package/vendor/pi-model-router/extensions/index.ts +0 -478
  282. package/vendor/pi-model-router/extensions/provider.ts +0 -580
  283. package/vendor/pi-model-router/extensions/routing.ts +0 -564
  284. package/vendor/pi-model-router/extensions/state.ts +0 -52
  285. package/vendor/pi-model-router/extensions/types.ts +0 -95
  286. package/vendor/pi-model-router/extensions/ui.ts +0 -144
  287. package/vendor/pi-model-router/model-router.example.json +0 -48
  288. package/vendor/pi-model-router/package.json +0 -48
  289. package/vendor/pi-model-router/tsconfig.json +0 -16
  290. /package/.pi/{prompts → harness/docs}/planning-rubrics.md +0 -0
  291. /package/.pi/{extensions/lib → lib}/ask-user/fallback.ts +0 -0
  292. /package/.pi/{extensions/lib → lib}/ask-user/render.ts +0 -0
  293. /package/.pi/{extensions/lib → lib}/ask-user/schema.ts +0 -0
  294. /package/.pi/{extensions/lib → lib}/ask-user/types.ts +0 -0
  295. /package/.pi/{extensions/lib → lib}/ask-user/validate-core.mjs +0 -0
  296. /package/.pi/{extensions/lib → lib}/ask-user/validate.ts +0 -0
  297. /package/.pi/{extensions/lib → lib}/harness-cocoindex-refresh.ts +0 -0
  298. /package/.pi/{extensions/lib → lib}/harness-paths.ts +0 -0
  299. /package/.pi/{extensions/lib → lib}/harness-spawn-budget.ts +0 -0
  300. /package/.pi/{extensions/lib → lib}/harness-vcc-settings.ts +0 -0
  301. /package/.pi/{extensions/lib → lib}/harness-web/run-cli.ts +0 -0
  302. /package/.pi/{extensions/lib → lib}/plan-approval/dialog.ts +0 -0
  303. /package/.pi/{extensions/lib → lib}/plan-approval/schema.ts +0 -0
  304. /package/.pi/{extensions/lib → lib}/plan-debate-eligibility.ts +0 -0
  305. /package/.pi/{extensions/lib → lib}/plan-debate-focus.ts +0 -0
  306. /package/.pi/{extensions/lib → lib}/plan-debate-id.ts +0 -0
  307. /package/.pi/{extensions/lib → lib}/plan-debate-lanes.ts +0 -0
  308. /package/.pi/{extensions/lib → lib}/plan-debate-round-status.ts +0 -0
  309. /package/.pi/{extensions/lib → lib}/plan-debate-write-guard.ts +0 -0
  310. /package/.pi/{extensions/lib → lib}/plan-review-gate.ts +0 -0
  311. /package/.pi/{extensions/lib → lib}/plan-review-integrator-rules.ts +0 -0
  312. /package/.pi/{extensions/lib → lib}/plan-scope-guard.ts +0 -0
  313. /package/.pi/{extensions/lib → lib}/posthog-client.ts +0 -0
  314. /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/prompts/planning-rubrics.md`.
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, or meta-optimizer
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
 
@@ -72,4 +71,4 @@ Parent orchestrator calls **`approve_plan`** with the full `plan_packet` (scroll
72
71
 
73
72
  - **Parent orchestrator** during `/harness-plan` — `ask_user` for clarification; **`approve_plan`** then **`create_plan`** for the plan file.
74
73
  - `harness/planning/*` (scouts, decompose, hypothesis, hypothesis-eval) — JSON only; no `ask_user` / `approve_plan` / `create_plan`.
75
- - `harness/evaluator`, `harness/adversary`, and `harness/tie-breaker` — emit `human_required`; the **parent orchestrator** calls `ask_user`.
74
+ - `harness/reviewing/evaluator`, `harness/reviewing/adversary`, and `harness/reviewing/tie-breaker` — emit `human_required`; the **parent orchestrator** calls `ask_user`.
@@ -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. 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).
19
- 4. **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.
20
- 5. 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.
21
- 5. Run `node "$UP_PKG/.pi/scripts/harness-verify.mjs"` before claiming release readiness.
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
 
@@ -40,7 +40,7 @@ Harness subprocesses load **`harness-subagent-submit`** (`PI_HARNESS_SUBPROCESS=
40
40
  | Command | `agent` |
41
41
  |---------|---------|
42
42
  | `/harness-plan` | Parent: planning context (tools) → decompose → hypothesis → Phase 3.5 artifacts → PlanPacket → eligibility + Review Gate → `approve_plan` + `create_plan` |
43
- | `/harness-run` | `harness/executor` (single worker) |
43
+ | `/harness-run` | `harness/running/executor` (single worker) |
44
44
  | `/harness-review` | Parent verify → `evaluator` benchmark → `evaluator` verdict → `adversary` → optional `tie-breaker` (ADR 0039) |
45
45
  | `/harness-eval` | **Deprecated** → `/harness-review` |
46
46
  | `/harness-critic` | **Deprecated** → `/harness-review` |
@@ -48,7 +48,7 @@ Harness subprocesses load **`harness-subagent-submit`** (`PI_HARNESS_SUBPROCESS=
48
48
 
49
49
  ## Review isolation
50
50
 
51
- Spawn `harness/evaluator` / `harness/adversary` via `subagent` in the **same** parent session. `review-integrity` allows `subagent` when `agent` is in the review set.
51
+ Spawn `harness/reviewing/evaluator` / `harness/reviewing/adversary` via `subagent` in the **same** parent session. `review-integrity` allows `subagent` when `agent` is in the review set.
52
52
 
53
53
  ## ask_user policy
54
54
 
@@ -56,8 +56,8 @@ Spawn `harness/evaluator` / `harness/adversary` via `subagent` in the **same** p
56
56
  |------|------------|
57
57
  | Parent orchestrator | Yes (plan clarification, `approve_plan`, router tune) |
58
58
  | `harness/planning/*` | No — `human_required` in output if stuck |
59
- | `harness/evaluator`, `harness/adversary`, `harness/tie-breaker` | `human_required` in subprocess JSON |
60
- | `harness/executor` | No — parent handles governance |
59
+ | `harness/reviewing/evaluator`, `harness/reviewing/adversary`, `harness/reviewing/tie-breaker` | `human_required` in subprocess JSON |
60
+ | `harness/running/executor` | No — parent handles governance |
61
61
 
62
62
  ## Spawn pattern (`/harness-plan`)
63
63
 
@@ -21,20 +21,20 @@ description: >-
21
21
 
22
22
  | Phase | Practice | Actor | Artifact |
23
23
  |-------|----------|-------|----------|
24
- | 1 | Automated QC + Sentrux fitness functions | Parent | `harness-verify.mjs`, `sentrux gate .`, `benchmark-log.yaml`, `sentrux-signal.yaml` |
25
- | 2 | Measure actuals (EVM) | `harness/evaluator` benchmark | `eval-verdict.yaml` |
24
+ | 1 | Automated QC + Sentrux fitness functions | Parent | `harness-verify.mjs`, `harness-sentrux-cli.mjs gate`, `benchmark-log.yaml`, `sentrux-signal.yaml` |
25
+ | 2 | Measure actuals (EVM) | `harness/reviewing/evaluator` benchmark | `eval-verdict.yaml` |
26
26
  | 2b | Controlling | Parent | Write `review-outcome.yaml`; route via `remediation_class` (not fail-fast abort) |
27
27
  | 6 | Outcome | Parent | `review-outcome.yaml` → `/harness-steer` or replan |
28
- | 3 | Policy audit | `harness/evaluator` verdict | same YAML |
29
- | 4 | Red team | `harness/adversary` | `adversary-report.yaml` |
30
- | 5 | Arbitration | `harness/tie-breaker` | only if block + conditional_pass |
28
+ | 3 | Policy audit | `harness/reviewing/evaluator` verdict | same YAML |
29
+ | 4 | Red team | `harness/reviewing/adversary` | `adversary-report.yaml` |
30
+ | 5 | Arbitration | `harness/reviewing/tie-breaker` | only if block + conditional_pass |
31
31
 
32
32
  ## Phase 1 — Sentrux (structural actuals)
33
33
 
34
34
  When `HARNESS_SENTRUX_REQUIRED=true` (default in `.env.example`):
35
35
 
36
- 1. `node "$UP_PKG/.pi/scripts/harness-verify.mjs"` — rules drift + `sentrux check` when CLI installed.
37
- 2. `sentrux gate .` — compare to baseline saved during `/harness-run`.
36
+ 1. `node "$UP_PKG/.pi/scripts/harness-verify.mjs"` — rules drift + Sentrux check when CLI installed.
37
+ 2. `node "$UP_PKG/.pi/scripts/harness-sentrux-cli.mjs" gate` — compare to baseline saved during `/harness-run`.
38
38
  3. Write `artifacts/sentrux-signal.yaml` and append session entry `harness-sentrux-signal` (observation bus / PostHog).
39
39
  4. Optional `artifacts/benchmark-log.yaml` fields: `sentrux_check`, `sentrux_gate`, `harness_verify`.
40
40
 
@@ -18,7 +18,7 @@ description: Bootstrap Sentrux architectural rules for harness projects — seed
18
18
  | **Bootstrap** | `harness/sentrux-bootstrap`, `harness-sentrux-bootstrap.mjs` | Greenfield seed + first sync |
19
19
  | **Steward** | `harness/sentrux-steward`, `/harness-sentrux-steward` | Proposes manifest changes (`artifacts/sentrux-manifest-proposal.yaml`); chair applies |
20
20
  | **Sync** | `sentrux-rules-sync.mjs`, `/harness-sentrux-sync` | Regenerates `rules.toml` from manifest after intent change |
21
- | **Observation** | `/harness-run`, `/harness-review` | `sentrux gate --save` / `check` / `gate` → `artifacts/sentrux-signal.yaml` |
21
+ | **Observation** | `/harness-run`, `/harness-review` | `harness-sentrux-cli.mjs gate --save` / `check` / `gate` → `artifacts/sentrux-signal.yaml` |
22
22
 
23
23
  Never auto-sync manifest from directory trees. Material manifest edits need steward evidence + chair approval (ADR 0009).
24
24
 
@@ -39,6 +39,7 @@ Custom TOML **outside** `# --- harness:managed:start/end ---` is preserved on ev
39
39
  | First-time / harness-setup (idempotent) | `node "$UP_PKG/.pi/scripts/harness-sentrux-bootstrap.mjs"` |
40
40
  | After manifest edits | `node "$UP_PKG/.pi/scripts/harness-sentrux-bootstrap.mjs" --force` |
41
41
  | CI / verify only | `node "$UP_PKG/.pi/scripts/sentrux-rules-sync.mjs" --check` |
42
+ | Run/review Sentrux observation | `node "$UP_PKG/.pi/scripts/harness-sentrux-cli.mjs" check` / `gate [--save]` |
42
43
  | In pi session | `/harness-sentrux-sync` (extension; uses `--force`) |
43
44
 
44
45
  **Bootstrap vs `--force`:** Default bootstrap/sync skips rewriting `rules.toml` when the manifest hash is unchanged. Use `--force` (or `/harness-sentrux-sync`) after changing `architecture.manifest.json` or when verify reports drift.
@@ -51,7 +52,7 @@ Custom TOML **outside** `# --- harness:managed:start/end ---` is preserved on ev
51
52
  node "$UP_PKG/.pi/scripts/harness-sentrux-bootstrap.mjs"
52
53
  ```
53
54
  3. Optional: `sentrux plugin add-standard` (language plugins; harness-setup Step 2.8).
54
- 4. `sentrux check .` — fix violations or tune manifest `max_cc` / layers.
55
+ 4. `node "$UP_PKG/.pi/scripts/harness-sentrux-cli.mjs" check` — fix violations or tune manifest `max_cc` / layers.
55
56
  5. Commit `.sentrux/rules.toml` and project-specific `architecture.manifest.json`.
56
57
 
57
58
  ## External repos
@@ -63,6 +64,6 @@ Do **not** copy ultimate-pi's layer paths blindly into unrelated layouts — edi
63
64
  ## References
64
65
 
65
66
  - ADR 0009 — `.pi/harness/docs/adrs/0009-sentrux-rules-lifecycle.md`
66
- - Scripts — `.pi/scripts/sentrux-rules-sync.mjs`, `harness-sentrux-bootstrap.mjs`
67
+ - Scripts — `.pi/scripts/sentrux-rules-sync.mjs`, `harness-sentrux-bootstrap.mjs`, `harness-sentrux-cli.mjs`
67
68
  - Agents — `harness/sentrux-bootstrap` (setup), `harness/sentrux-steward` (intent proposals)
68
69
  - Specs — `sentrux-manifest-proposal.schema.json`, `sentrux-signal.schema.json`
@@ -8,7 +8,7 @@ description: Post-review repair loop via harness-steer and executor repair mode
8
8
  Use after `/harness-review` when `artifacts/review-outcome.yaml` has `remediation_class: implementation_gap`.
9
9
 
10
10
  1. Read `repair-brief.yaml` and `plan_packet_path` (paths only).
11
- 2. Set policy phase `execute`; spawn `harness/executor` with `mode: repair`.
11
+ 2. Set policy phase `execute`; spawn `harness/running/executor` with `mode: repair`.
12
12
  3. Always follow with `/harness-review`.
13
13
 
14
14
  See `.pi/prompts/harness-steer.md` and `.pi/harness/docs/adrs/0044-harness-steer-loop.md`.
@@ -35,22 +35,22 @@ sentrux plugin add-standard
35
35
 
36
36
  ## Core workflows (project root)
37
37
 
38
- Run from the **target repo root** (where `.sentrux/rules.toml` lives).
38
+ Run from the **target repo root** (where `.sentrux/rules.toml` lives), or prefer the bundled wrapper when invoked by harness commands from run directories.
39
39
 
40
40
  | When | Command | Notes |
41
41
  |------|---------|-------|
42
- | CI / pre-commit | `sentrux check .` | Exit 0 = pass, 1 = violations |
43
- | Before agent work | `sentrux gate --save .` | Save session baseline |
44
- | After agent work | `sentrux gate .` | Detect degradation vs baseline |
42
+ | CI / pre-commit | `node "$UP_PKG/.pi/scripts/harness-sentrux-cli.mjs" check` | Exit 0 = pass, 1 = violations |
43
+ | Before agent work | `node "$UP_PKG/.pi/scripts/harness-sentrux-cli.mjs" gate --save` | Save session baseline |
44
+ | After agent work | `node "$UP_PKG/.pi/scripts/harness-sentrux-cli.mjs" gate` | Detect degradation vs baseline |
45
45
  | Explore structure | `sentrux` or `sentrux .` | GUI treemap (optional) |
46
46
 
47
47
  Typical agent loop:
48
48
 
49
49
  ```bash
50
- sentrux gate --save .
50
+ node "$UP_PKG/.pi/scripts/harness-sentrux-cli.mjs" gate --save
51
51
  # … agent edits …
52
- sentrux check . # rules still pass?
53
- sentrux gate . # structural regression?
52
+ node "$UP_PKG/.pi/scripts/harness-sentrux-cli.mjs" check # rules still pass?
53
+ node "$UP_PKG/.pi/scripts/harness-sentrux-cli.mjs" gate # structural regression?
54
54
  ```
55
55
 
56
56
  If `check` fails, fix violations or tune manifest constraints (see **Rules** below). If `gate` reports degradation, inspect changed modules before merging.
@@ -73,7 +73,7 @@ Custom TOML outside `# --- harness:managed:start/end ---` is preserved on sync.
73
73
  |-------|------|
74
74
  | `sentrux-rules-sync` extension | Session start: warns if `rules.toml` drifts; auto-sync after plan/merge phases |
75
75
  | `/harness-sentrux-sync` | Force-regenerate rules from manifest (pi command) |
76
- | `harness-verify.mjs` | Runs `sentrux check .` when rules present |
76
+ | `harness-verify.mjs` | Runs rules sync and Sentrux checks when rules are present |
77
77
  | **observation-bus** | Maps `harness-sentrux-signal` custom entries → evaluator observations |
78
78
  | **harness-eval** | Evaluate phase may require a Sentrux quality signal (stub or future MCP) per ADR 0006 |
79
79
 
@@ -90,7 +90,7 @@ High level: **execute** uses CLI gate/check around edits; **evaluate** consumes
90
90
  - Assume Sentrux **MCP** tools (`scan`, `session_start`, `health`, etc.) exist in **Pi** — they do not; use CLI only
91
91
  - Edit or rely on `.pi/mcp.json` for Pi sessions
92
92
  - Duplicate bootstrap/sync steps from **harness-sentrux-setup**
93
- - Skip `sentrux check .` after large refactors when `.sentrux/rules.toml` exists
93
+ - Skip the root-resolving Sentrux check after large refactors when `.sentrux/rules.toml` exists
94
94
 
95
95
  ## References
96
96
 
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 (loaded by pi) |
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/`, local `model-router.json`, or `firecrawl/.env`
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 **`vendor/pi-model-router/`** ([`pi-model-router`](https://github.com/yeliu84/pi-model-router), MIT) — see repo [`THIRD_PARTY_NOTICES.md`](../THIRD_PARTY_NOTICES.md); refresh with `npm run vendor:sync-router`
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 the vendored router) are provided by the Pi install / hoisted from the peer; ultimate-pi lists the latter three as `devDependencies` for `npm run check:ts`.
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,37 +1,44 @@
1
- # Ultimate Pi Coding Agent — System Prompt
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]] (API/library docs) or **`web_search` / `web_fetch`** ([[scrapling-web]]). No `curl`, `wget`, Firecrawl, or scrapling CLI preflight.
33
+ > Route **all** web through [[context7]] for API/library docs or **`web_search` / `web_fetch`** via [[scrapling-web]] for non-API web. 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: function signatures, class APIs, config options, stdlib, framework specs.
31
- - **Never** use quality-sites or web_fetch for API docs.
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
- ### All Non-API Web — web_search + web_fetch
34
- See `.agents/skills/scrapling-web/SKILL.md`. **No preflight:** never resolve `UP_PKG`, `ls harness-web.py`, or `python3 -c "import scrapling"` before searching.
40
+ ### Non-API Web — web_search + web_fetch
41
+ Use the harness web-search/fetch tools and the `scrapling-web` skill when available. No preflight: never probe package paths, list harness scripts, or import Scrapling before searching.
35
42
 
36
43
  | Task | Tool |
37
44
  |------|------|
@@ -39,121 +46,48 @@ See `.agents/skills/scrapling-web/SKILL.md`. **No preflight:** never resolve `UP
39
46
  | Scrape page | `web_fetch` (`url`, optional `fast: true`) |
40
47
  | Map links | `web_fetch` (`url`, `mode: map`) |
41
48
 
42
- - **Artifacts:** default under `.web/`; use `read` for full JSON/markdown.
43
- - **Fallback** (tools unavailable): `python3 "$UP_PKG/.pi/scripts/harness-web.py" …` per scrapling-web skill.
44
- - **Setup diagnostics only:** `harness-web.py status` (JSON config).
45
- - **Quality sites:** check `.agents/skills/wiki-autoresearch/references/quality-sites.md` before citing non-API sources. Prefer Tier 1 (StackOverflow, GitHub issues, engineering blogs, arxiv). Exclude AI content farms, mirrors, stale packages.
46
- - **Research:** use `/wiki-autoresearch <topic>` for deep research. Results are graphified into `graphify-out/`.
49
+ - Artifacts default under the active project's `.web/`; use `read` for full JSON/markdown artifacts.
50
+ - If tools are unavailable, use the installed harness web fallback documented by the `scrapling-web` skill.
51
+ - Run setup diagnostics only when troubleshooting web tooling.
52
+ - Check local quality-site guidance when present before citing non-API sources. Prefer Tier 1 sources; exclude AI content farms, mirrors, and stale packages.
53
+ - For deep research, use `/wiki-autoresearch <topic>` when available and store outputs in the active project's configured research/wiki/graph locations.
47
54
 
48
55
  ### Missing CLI fallbacks
49
- - harness-web / Scrapling missing: `uv tool install "scrapling[fetchers]" && scrapling install` then re-run `bash "$UP_PKG/.pi/scripts/harness-cli-verify.sh"`
50
- - Context7 missing: `npm install -g ctx7@latest`
56
+ - harness-web / Scrapling missing: `uv tool install "scrapling[fetchers]" && scrapling install` then re-run the harness CLI verification command documented locally.
57
+ - Context7 missing: `npm install -g ctx7@latest`.
51
58
 
52
59
  ---
53
- ## Graphify-First Workflow (Mandatory)
60
+ ## Codebase Exploration Workflow
54
61
 
55
62
  > [!tip] Graph before grep
56
- > **Always** build or consult the Graphify knowledge graph before codebase exploration.
57
- > The graph reveals structure, god nodes, and surprising connections that raw
58
- > search cannot. 71.5× token reduction on mixed corpora.
59
-
60
- ### Graphify Knowledge Graph
61
-
62
- Graphify builds a queryable knowledge graph from code, docs, papers, and diagrams.
63
- It identifies core concepts (god nodes), community structure, and cross-domain
64
- connections via tree-sitter AST analysis + LLM semantic extraction.
65
-
66
- | Step | Command | When |
67
- |------|---------|------|
68
- | Build graph | `graphify .` | First session, or after major code changes |
69
- | Update graph | `graphify . --update` | After a few file changes (incremental) |
70
- | Query graph | `graphify query "question"` | Understanding relationships, architecture |
71
- | Trace paths | `graphify path "A" "B"` | How two concepts connect (includes call chains) |
72
- | Explain node | `graphify explain "Concept"` | Deep dive — shows all callers, callees, references |
73
- | DFS trace | `graphify query "who calls X" --dfs` | Follow a specific call/dependency chain |
74
- | Read report | Read `graphify-out/GRAPH_REPORT.md` | Fastest path to codebase understanding |
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.
63
+ > 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.
64
+
65
+ ### Graphify
66
+ - First session or stale graph: run `graphify .` or the local equivalent.
67
+ - After significant code changes: run `graphify . --update` or the local equivalent.
68
+ - Before reading source files for codebase questions: read `graphify-out/GRAPH_REPORT.md` when present.
69
+ - For relationships/call paths: use `graphify query`, `graphify explain`, or `graphify path` before raw search.
70
+ - For graphify command variants or project-specific graph rules, follow local docs in `AGENTS.md` or equivalent.
71
+
72
+ ### Search order
73
+ 1. `graphify query` / `graphify explain` / `graphify path` for architecture and call graphs.
74
+ 2. `sg -p 'pattern'` for structural code search; add `--lang` when needed.
75
+ 3. `ccc search --limit N "query"` for semantic implementation search.
76
+ 4. `find` for file discovery by name/glob only.
77
+ 5. `grep -F` only for exact literals in logs, generated text, or non-code files.
78
+
79
+ Rules:
80
+ - Prefer ast-grep over grep for code; grep is not code search.
81
+ - Always cap `ccc search` with `--limit N`.
82
+ - Do not install or use grepai/seagoat/mgrep for call-graph traces or semantic search; Graphify and ccc cover those lanes.
122
83
 
123
84
  ---
124
85
  ## Agent Routing
125
86
 
126
- > [!tip] Dynamic discovery
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.
87
+ 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
88
 
155
89
  ---
156
90
  ## Git / Delivery Rules
157
91
  - Keep commits scoped and atomic.
158
92
  - Prefer readable commit messages.
159
- - Never rewrite user history unless explicitly asked.
93
+ - Never rewrite user history unless explicitly asked.
@@ -1,6 +1,5 @@
1
1
  ---
2
2
  description: Harness incident recorder compiling structured IncidentRecord drafts from run context.
3
- tools: read, grep, find, ls, submit_human_required
4
3
  extensions: false
5
4
  thinking: medium
6
5
  max_turns: 15
@@ -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
@@ -23,7 +21,7 @@ Read `HarnessSpawnContext` and the merged **scout lane JSON** in the spawn promp
23
21
 
24
22
  1. Read Phase 1 reconnaissance from spawn context paths — prefer `artifacts/planning-context.yaml`; legacy `artifacts/scout-*.yaml` lanes are accepted when present.
25
23
  2. Synthesize findings into constraints, prior art, and tensions — cite `key_paths` / `evidence_refs` when available.
26
- 3. **Graphify dedup:** If `planning-context.yaml` has `coverage.architecture.status` of `ok`, or legacy `scout-graphify.yaml` has `status: ok`, do **not** run `graphify query` / `graphify explain` / `graphify path`. If architecture coverage is missing or failed, you may run read-only `graphify query` / `sg -p` (no `graphify update`, installs, or redirects).
24
+ 3. **Graphify dedup:** If `planning-context.yaml` has `coverage.architecture.status` of `ok`, do **not** run `graphify query` / `graphify explain` / `graphify path`. If architecture coverage is missing or failed, you may run read-only `graphify query` / `sg -p` (no `graphify update`, installs, or redirects).
27
25
  4. Do not read `.pi/harness/specs/*.schema.json` from disk.
28
26
 
29
27
  ## Phase 1 — DeepMind-style decomposition
@@ -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 DARWIN hypothesis generation (read-only).
3
- tools: read, grep, find, ls, bash, submit_hypothesis_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: 14
@@ -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
@@ -1,7 +1,5 @@
1
1
  ---
2
2
  description: Plan-phase adversarial verification on ExecutionPlan.
3
- tools: read, grep, find, ls, submit_adversary_brief
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
@@ -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/prompts/planning-rubrics.md` for that focus.
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
@@ -1,7 +1,5 @@
1
1
  ---
2
2
  description: Plan-phase ADR-020 sprint contract auditor.
3
- tools: read, grep, find, ls, submit_sprint_audit
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
@@ -1,7 +1,5 @@
1
1
  ---
2
2
  description: Plan-phase stack research (ctx7 + web, read-only file writes via parent).
3
- tools: read, grep, find, ls, bash, web_search, web_fetch, submit_stack_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: 16
@@ -1,8 +1,6 @@
1
1
  ---
2
2
  description: Adversarial harness reviewer focused on breaking assumptions and surfacing regressions.
3
- tools: read, grep, find, ls, submit_adversary_report
4
3
  extensions: false
5
- disallowed_tools: ask_user
6
4
  thinking: high
7
5
  max_turns: 20
8
6
  ---
@@ -1,8 +1,6 @@
1
1
  ---
2
2
  description: Independent harness evaluator producing structured pass/fail verdicts.
3
- tools: read, grep, find, ls, submit_eval_verdict
4
3
  extensions: false
5
- disallowed_tools: ask_user
6
4
  thinking: high
7
5
  max_turns: 20
8
6
  ---
@@ -1,8 +1,6 @@
1
1
  ---
2
2
  description: Final arbiter for unresolved evaluator vs adversary debates within budget limits.
3
- tools: read, grep, find, ls, submit_human_required
4
3
  extensions: false
5
- disallowed_tools: ask_user
6
4
  thinking: high
7
5
  max_turns: 15
8
6
  ---
@@ -1,8 +1,6 @@
1
1
  ---
2
2
  description: Harness executor that implements only within approved PlanPacket scope.
3
- tools: read, write, edit, bash, grep, find, ls, submit_executor_handoff
4
3
  extensions: true
5
- disallowed_tools: ask_user
6
4
  thinking: medium
7
5
  max_turns: 20
8
6
  ---
@@ -1,6 +1,5 @@
1
1
  ---
2
2
  description: Bootstrap Sentrux rules for a harness project — seed architecture manifest, sync merge-safe rules.toml, verify sentrux check.
3
- tools: read, bash, grep, find, ls
4
3
  extensions: true
5
4
  thinking: low
6
5
  max_turns: 12