ultimate-pi 0.18.1 → 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 (284) hide show
  1. package/.agents/skills/harness-debate-plan/SKILL.md +1 -1
  2. package/.agents/skills/harness-decisions/SKILL.md +1 -2
  3. package/.agents/skills/harness-governor/SKILL.md +6 -5
  4. package/.pi/PACKAGING.md +4 -4
  5. package/.pi/SYSTEM.md +54 -120
  6. package/.pi/agents/harness/incident-recorder.md +0 -1
  7. package/.pi/agents/harness/planning/decompose.md +0 -2
  8. package/.pi/agents/harness/planning/execution-plan-author.md +0 -2
  9. package/.pi/agents/harness/planning/hypothesis-validator.md +0 -2
  10. package/.pi/agents/harness/planning/hypothesis.md +0 -2
  11. package/.pi/agents/harness/planning/implementation-researcher.md +0 -2
  12. package/.pi/agents/harness/planning/plan-adversary.md +0 -2
  13. package/.pi/agents/harness/planning/plan-evaluator.md +1 -3
  14. package/.pi/agents/harness/planning/planning-context.md +0 -2
  15. package/.pi/agents/harness/planning/review-integrator.md +0 -2
  16. package/.pi/agents/harness/planning/sprint-contract-auditor.md +0 -2
  17. package/.pi/agents/harness/planning/stack-researcher.md +0 -2
  18. package/.pi/agents/harness/reviewing/adversary.md +0 -2
  19. package/.pi/agents/harness/reviewing/evaluator.md +0 -2
  20. package/.pi/agents/harness/reviewing/tie-breaker.md +0 -2
  21. package/.pi/agents/harness/running/executor.md +0 -2
  22. package/.pi/agents/harness/sentrux-bootstrap.md +0 -1
  23. package/.pi/agents/harness/sentrux-steward.md +0 -2
  24. package/.pi/agents/harness/trace-librarian.md +0 -1
  25. package/.pi/extensions/00-posthog-network-bootstrap.ts +1 -1
  26. package/.pi/extensions/agt-kill-switch.ts +57 -0
  27. package/.pi/extensions/agt-prompt-guard.ts +32 -0
  28. package/.pi/extensions/custom-footer.ts +46 -145
  29. package/.pi/extensions/custom-header.ts +1 -1
  30. package/.pi/extensions/custom-system-prompt.ts +1 -1
  31. package/.pi/extensions/debate-orchestrator.ts +6 -6
  32. package/.pi/extensions/harness-ask-user.ts +7 -7
  33. package/.pi/extensions/harness-debate-tools.ts +26 -42
  34. package/.pi/extensions/harness-lens.ts +94 -0
  35. package/.pi/extensions/harness-plan-approval.ts +11 -11
  36. package/.pi/extensions/harness-run-context.ts +1070 -876
  37. package/.pi/extensions/harness-subagent-governance.ts +8 -0
  38. package/.pi/extensions/harness-subagent-submit.ts +34 -163
  39. package/.pi/extensions/harness-subagents.ts +3 -3
  40. package/.pi/extensions/harness-telemetry.ts +2 -2
  41. package/.pi/extensions/harness-web-tools.ts +2 -2
  42. package/.pi/extensions/policy-gate.ts +25 -5
  43. package/.pi/extensions/sentrux-rules-sync.ts +1 -1
  44. package/.pi/extensions/subagent-governance.ts +92 -0
  45. package/.pi/extensions/trace-recorder.ts +1 -1
  46. package/.pi/extensions/{ultimate-pi-vcc.ts → vcc-compaction.ts} +1 -1
  47. package/.pi/harness/README.md +6 -2
  48. package/.pi/harness/agents.manifest.json +22 -25
  49. package/.pi/harness/agents.policy.yaml +275 -0
  50. package/.pi/harness/docs/adrs/0030-inhouse-vcc-compaction.md +1 -1
  51. package/.pi/harness/docs/adrs/0035-plan-phase-review-gate.md +1 -1
  52. package/.pi/harness/docs/adrs/0045-harness-lens-minimal-contract.md +49 -0
  53. package/.pi/harness/docs/adrs/0046-agt-policy-engine.md +51 -0
  54. package/.pi/harness/docs/adrs/0047-agt-layered-security.md +39 -0
  55. package/.pi/harness/docs/adrs/0048-tool-call-hook-order.md +25 -0
  56. package/.pi/harness/docs/adrs/0049-agents-policy-manifest.md +36 -0
  57. package/.pi/harness/docs/adrs/README.md +5 -0
  58. package/.pi/harness/evolution/README.md +1 -2
  59. package/.pi/harness/examples/agents.policy.project.yaml +19 -0
  60. package/.pi/harness/examples/policies/custom-deny-bash.yaml +9 -0
  61. package/.pi/harness/policies/bash-denylists.yaml +5 -0
  62. package/.pi/harness/policies/defaults.yaml +51 -0
  63. package/.pi/harness/policies/orchestrator.yaml +18 -0
  64. package/.pi/harness/policies/phases.yaml +10 -0
  65. package/.pi/harness/policies/roles.yaml +5 -0
  66. package/.pi/harness/policies/web-guard.yaml +5 -0
  67. package/.pi/harness/policies/workflow-sequences.yaml +9 -0
  68. package/.pi/harness/sentrux/architecture.manifest.json +26 -4
  69. package/.pi/harness/specs/observation.schema.json +2 -1
  70. package/.pi/lib/agents-policy.d.mts +70 -0
  71. package/.pi/lib/agents-policy.mjs +325 -0
  72. package/.pi/lib/agents-policy.ts +19 -0
  73. package/.pi/lib/agt/audit-run-sink.ts +52 -0
  74. package/.pi/lib/agt/build-evaluation-context.ts +285 -0
  75. package/.pi/lib/agt/config.ts +28 -0
  76. package/.pi/lib/agt/delegation.ts +69 -0
  77. package/.pi/lib/agt/evaluate-policy.ts +56 -0
  78. package/.pi/lib/agt/identity-registry.ts +41 -0
  79. package/.pi/lib/agt/index.ts +55 -0
  80. package/.pi/lib/agt/kill-switch-state.ts +11 -0
  81. package/.pi/lib/agt/legacy-evaluate.ts +101 -0
  82. package/.pi/lib/agt/policy-engine.ts +154 -0
  83. package/.pi/lib/agt/rings.ts +21 -0
  84. package/.pi/lib/agt/sre-hooks.ts +45 -0
  85. package/.pi/lib/agt/trust-run-store.ts +26 -0
  86. package/.pi/lib/agt/workflow-history.ts +29 -0
  87. package/.pi/lib/agt-governance-active.ts +14 -0
  88. package/.pi/lib/agt-tool-guard.ts +78 -0
  89. package/.pi/lib/ask-user/dialog.ts +314 -0
  90. package/.pi/{extensions/lib → lib}/debate-bus-core.ts +10 -10
  91. package/.pi/{extensions/lib → lib}/debate-bus-state.ts +1 -1
  92. package/.pi/{extensions/lib → lib}/extension-load-guard.ts +13 -2
  93. package/.pi/lib/harness-agt-tool-guard.ts +5 -0
  94. package/.pi/{extensions/lib → lib}/harness-artifact-gate.ts +1 -1
  95. package/.pi/lib/harness-debate-core-deps.ts +14 -0
  96. package/.pi/lib/harness-debate-workflow-deps.ts +43 -0
  97. package/.pi/lib/harness-lens/.gitattributes +1 -0
  98. package/.pi/lib/harness-lens/clients/edit-autopatch.ts +88 -0
  99. package/.pi/lib/harness-lens/clients/file-kinds.ts +380 -0
  100. package/.pi/lib/harness-lens/clients/file-time.ts +215 -0
  101. package/.pi/lib/harness-lens/clients/file-utils.ts +484 -0
  102. package/.pi/lib/harness-lens/clients/format-service.ts +276 -0
  103. package/.pi/lib/harness-lens/clients/formatters.ts +1000 -0
  104. package/.pi/lib/harness-lens/clients/git-guard.ts +31 -0
  105. package/.pi/lib/harness-lens/clients/indent-retarget.ts +90 -0
  106. package/.pi/lib/harness-lens/clients/installer/index.ts +2368 -0
  107. package/.pi/lib/harness-lens/clients/latency-logger.ts +80 -0
  108. package/.pi/lib/harness-lens/clients/lens-config.ts +43 -0
  109. package/.pi/lib/harness-lens/clients/lens-events.ts +164 -0
  110. package/.pi/lib/harness-lens/clients/lsp/aggregation.ts +91 -0
  111. package/.pi/lib/harness-lens/clients/lsp/client.ts +1466 -0
  112. package/.pi/lib/harness-lens/clients/lsp/config.ts +216 -0
  113. package/.pi/lib/harness-lens/clients/lsp/edits.ts +297 -0
  114. package/.pi/lib/harness-lens/clients/lsp/index.ts +1355 -0
  115. package/.pi/lib/harness-lens/clients/lsp/interactive-install.ts +424 -0
  116. package/.pi/lib/harness-lens/clients/lsp/language.ts +223 -0
  117. package/.pi/lib/harness-lens/clients/lsp/launch.ts +939 -0
  118. package/.pi/lib/harness-lens/clients/lsp/lsp-index.ts +11 -0
  119. package/.pi/lib/harness-lens/clients/lsp/path-utils.ts +12 -0
  120. package/.pi/lib/harness-lens/clients/lsp/server-strategies.ts +81 -0
  121. package/.pi/lib/harness-lens/clients/lsp/server.ts +1971 -0
  122. package/.pi/lib/harness-lens/clients/path-utils.ts +182 -0
  123. package/.pi/lib/harness-lens/clients/pipeline.ts +360 -0
  124. package/.pi/lib/harness-lens/clients/project-profile.ts +117 -0
  125. package/.pi/lib/harness-lens/clients/runtime-agent-end.ts +112 -0
  126. package/.pi/lib/harness-lens/clients/runtime-config.ts +33 -0
  127. package/.pi/lib/harness-lens/clients/runtime-coordinator.ts +186 -0
  128. package/.pi/lib/harness-lens/clients/runtime-tool-result.ts +171 -0
  129. package/.pi/lib/harness-lens/clients/safe-spawn.ts +339 -0
  130. package/.pi/lib/harness-lens/clients/secrets-scanner.ts +214 -0
  131. package/.pi/lib/harness-lens/clients/tool-policy.ts +2072 -0
  132. package/.pi/lib/harness-lens/clients/types.ts +59 -0
  133. package/.pi/lib/harness-lens/clients/widget-state.ts +283 -0
  134. package/.pi/lib/harness-lens/index.ts +532 -0
  135. package/.pi/lib/harness-lens/tools/lsp-diagnostics.ts +706 -0
  136. package/.pi/lib/harness-lens/tools/lsp-navigation.ts +1246 -0
  137. package/.pi/{extensions/lib → lib}/harness-posthog.ts +3 -0
  138. package/.pi/lib/harness-run-context-responses.ts +9 -0
  139. package/.pi/lib/harness-run-context.ts +0 -2
  140. package/.pi/{extensions/lib/spawn-policy.ts → lib/harness-spawn-policy.ts} +1 -0
  141. package/.pi/{extensions/lib → lib}/harness-spawn-topology.ts +1 -1
  142. package/.pi/lib/harness-subagent-auth.ts +51 -0
  143. package/.pi/{extensions/lib → lib}/harness-subagent-precheck.ts +10 -7
  144. package/.pi/{extensions/lib → lib}/harness-subagent-submit-pipeline.ts +3 -3
  145. package/.pi/lib/harness-subagent-submit-register.ts +163 -0
  146. package/.pi/{extensions/lib → lib}/harness-subagent-submit-registry.ts +1 -37
  147. package/.pi/{extensions/lib → lib}/harness-subagents-bridge.ts +53 -14
  148. package/.pi/{extensions/lib → lib}/harness-subprocess-bootstrap.ts +1 -1
  149. package/.pi/{extensions/lib → lib}/plan-approval/create-plan.ts +2 -2
  150. package/.pi/{extensions/lib → lib}/plan-approval/format-plan.ts +2 -2
  151. package/.pi/{extensions/lib → lib}/plan-approval/plan-review.ts +162 -201
  152. package/.pi/{extensions/lib → lib}/plan-approval/render.ts +1 -1
  153. package/.pi/{extensions/lib → lib}/plan-approval/resolve-disk.ts +2 -2
  154. package/.pi/{extensions/lib → lib}/plan-approval/types.ts +1 -1
  155. package/.pi/{extensions/lib → lib}/plan-approval/validate.ts +3 -3
  156. package/.pi/{extensions/lib → lib}/plan-debate-envelope.ts +1 -1
  157. package/.pi/{extensions/lib → lib}/plan-debate-gate.ts +1 -1
  158. package/.pi/{extensions/lib → lib}/plan-debate-lane.ts +1 -4
  159. package/.pi/{extensions/lib → lib}/plan-messenger.ts +1 -1
  160. package/.pi/prompts/harness-plan.md +1 -1
  161. package/.pi/prompts/harness-setup.md +37 -64
  162. package/.pi/scripts/README.md +2 -5
  163. package/.pi/scripts/generate-agents-policy-yaml.mjs +148 -0
  164. package/.pi/scripts/harness-agents-manifest.mjs +60 -3
  165. package/.pi/scripts/harness-agt-doctor.ts +36 -0
  166. package/.pi/scripts/harness-cli-verify.sh +9 -2
  167. package/.pi/scripts/harness-verify.mjs +113 -39
  168. package/.pi/scripts/harness-web-policy-guard.mjs +2 -2
  169. package/.pi/scripts/validate-plan-dag.mjs +65 -74
  170. package/.pi/scripts/vendor-pi-vcc-settings.stub.ts +2 -2
  171. package/.pi/scripts/vendor-sync-pi-vcc.sh +1 -1
  172. package/.pi/skills/architecture/broker-domain/SKILL.md +65 -0
  173. package/.pi/skills/architecture/cqrs/SKILL.md +63 -0
  174. package/.pi/skills/architecture/event-driven/SKILL.md +60 -0
  175. package/.pi/skills/architecture/hexagonal-ports-adapters/SKILL.md +66 -0
  176. package/.pi/skills/architecture/layered/SKILL.md +68 -0
  177. package/.pi/skills/architecture/microkernel/SKILL.md +62 -0
  178. package/.pi/skills/architecture/microservices/SKILL.md +64 -0
  179. package/.pi/skills/architecture/modular-monolith/SKILL.md +65 -0
  180. package/.pi/skills/architecture/orchestration-driven-soa/SKILL.md +61 -0
  181. package/.pi/skills/architecture/pipeline/SKILL.md +63 -0
  182. package/.pi/skills/architecture/service-based/SKILL.md +64 -0
  183. package/.pi/skills/architecture/service-mesh/SKILL.md +60 -0
  184. package/.pi/skills/architecture/space-based/SKILL.md +60 -0
  185. package/.pi/skills/ast-grep/SKILL.md +40 -321
  186. package/.pi/skills/delivery/debugging-discipline/SKILL.md +36 -0
  187. package/.pi/skills/delivery/documentation-update/SKILL.md +33 -0
  188. package/.pi/skills/delivery/requirements-to-implementation/SKILL.md +34 -0
  189. package/.pi/skills/delivery/risk-based-verification/SKILL.md +43 -0
  190. package/.pi/skills/delivery/tradeoff-analysis/SKILL.md +34 -0
  191. package/.pi/skills/engineering/api-contract-design/SKILL.md +38 -0
  192. package/.pi/skills/engineering/cohesion-coupling/SKILL.md +43 -0
  193. package/.pi/skills/engineering/complexity-control/SKILL.md +31 -0
  194. package/.pi/skills/engineering/defensive-programming/SKILL.md +38 -0
  195. package/.pi/skills/engineering/dependency-management/SKILL.md +29 -0
  196. package/.pi/skills/engineering/domain-modeling/SKILL.md +32 -0
  197. package/.pi/skills/engineering/error-handling/SKILL.md +37 -0
  198. package/.pi/skills/engineering/legacy-code-seams/SKILL.md +35 -0
  199. package/.pi/skills/engineering/naming-and-intent/SKILL.md +29 -0
  200. package/.pi/skills/engineering/refactoring-safe-evolution/SKILL.md +35 -0
  201. package/.pi/skills/engineering/routine-function-design/SKILL.md +34 -0
  202. package/.pi/skills/engineering/small-change-discipline/SKILL.md +35 -0
  203. package/.pi/skills/lsp-navigation/SKILL.md +89 -0
  204. package/.pi/skills/quality/code-review-self-check/SKILL.md +35 -0
  205. package/.pi/skills/quality/privacy-data-handling/SKILL.md +26 -0
  206. package/.pi/skills/quality/security-review/SKILL.md +34 -0
  207. package/.pi/skills/quality/test-strategy/SKILL.md +33 -0
  208. package/.pi/skills/quality/testability-design/SKILL.md +33 -0
  209. package/.pi/skills/systems/concurrency-safety/SKILL.md +32 -0
  210. package/.pi/skills/systems/data-modeling-migrations/SKILL.md +31 -0
  211. package/.pi/skills/systems/observability-instrumentation/SKILL.md +32 -0
  212. package/.pi/skills/systems/performance-measurement/SKILL.md +35 -0
  213. package/.pi/skills/systems/reliability-design/SKILL.md +32 -0
  214. package/.sentrux/rules.toml +20 -4
  215. package/AGENTS.md +5 -0
  216. package/CHANGELOG.md +14 -0
  217. package/README.md +3 -12
  218. package/THIRD_PARTY_NOTICES.md +12 -21
  219. package/package.json +15 -7
  220. package/vendor/pi-subagents/src/agents.ts +45 -1
  221. package/vendor/pi-subagents/src/subagents.ts +866 -811
  222. package/vendor/pi-vcc/src/core/brief.ts +68 -99
  223. package/vendor/pi-vcc/src/core/settings.ts +2 -2
  224. package/.agents/skills/caveman/SKILL.md +0 -67
  225. package/.pi/agents/harness/meta-optimizer.md +0 -36
  226. package/.pi/extensions/lib/ask-user/dialog.ts +0 -260
  227. package/.pi/extensions/lib/harness-subagent-auth.ts +0 -207
  228. package/.pi/extensions/lib/harness-subagent-policy.ts +0 -236
  229. package/.pi/extensions/pi-model-router-harness.ts +0 -42
  230. package/.pi/harness/evolution/meta-optimizer.mjs +0 -99
  231. package/.pi/harness/specs/router-tuning-proposal.schema.json +0 -114
  232. package/.pi/model-router.example.json +0 -36
  233. package/.pi/prompts/harness-critic.md +0 -10
  234. package/.pi/prompts/harness-eval.md +0 -10
  235. package/.pi/prompts/harness-router-tune.md +0 -52
  236. package/.pi/scripts/harness-generate-model-router.mjs +0 -327
  237. package/.pi/scripts/harness-model-router-routing.test.mjs +0 -97
  238. package/.pi/scripts/harness-sync-model-router.mjs +0 -97
  239. package/.pi/scripts/vendor-sync-pi-model-router.sh +0 -47
  240. package/vendor/pi-model-router/.prettierignore +0 -4
  241. package/vendor/pi-model-router/.prettierrc +0 -5
  242. package/vendor/pi-model-router/AGENTS.md +0 -39
  243. package/vendor/pi-model-router/LICENSE +0 -21
  244. package/vendor/pi-model-router/README.md +0 -99
  245. package/vendor/pi-model-router/UPSTREAM_PIN.md +0 -10
  246. package/vendor/pi-model-router/docs/ARCHITECTURE.md +0 -54
  247. package/vendor/pi-model-router/extensions/commands.ts +0 -720
  248. package/vendor/pi-model-router/extensions/config.ts +0 -348
  249. package/vendor/pi-model-router/extensions/constants.ts +0 -1
  250. package/vendor/pi-model-router/extensions/index.ts +0 -478
  251. package/vendor/pi-model-router/extensions/provider.ts +0 -580
  252. package/vendor/pi-model-router/extensions/routing.ts +0 -564
  253. package/vendor/pi-model-router/extensions/state.ts +0 -52
  254. package/vendor/pi-model-router/extensions/types.ts +0 -95
  255. package/vendor/pi-model-router/extensions/ui.ts +0 -144
  256. package/vendor/pi-model-router/model-router.example.json +0 -48
  257. package/vendor/pi-model-router/package.json +0 -48
  258. package/vendor/pi-model-router/tsconfig.json +0 -16
  259. /package/.pi/{prompts → harness/docs}/planning-rubrics.md +0 -0
  260. /package/.pi/{extensions/lib → lib}/ask-user/fallback.ts +0 -0
  261. /package/.pi/{extensions/lib → lib}/ask-user/render.ts +0 -0
  262. /package/.pi/{extensions/lib → lib}/ask-user/schema.ts +0 -0
  263. /package/.pi/{extensions/lib → lib}/ask-user/types.ts +0 -0
  264. /package/.pi/{extensions/lib → lib}/ask-user/validate-core.mjs +0 -0
  265. /package/.pi/{extensions/lib → lib}/ask-user/validate.ts +0 -0
  266. /package/.pi/{extensions/lib → lib}/harness-cocoindex-refresh.ts +0 -0
  267. /package/.pi/{extensions/lib → lib}/harness-paths.ts +0 -0
  268. /package/.pi/{extensions/lib → lib}/harness-spawn-budget.ts +0 -0
  269. /package/.pi/{extensions/lib → lib}/harness-vcc-settings.ts +0 -0
  270. /package/.pi/{extensions/lib → lib}/harness-web/run-cli.ts +0 -0
  271. /package/.pi/{extensions/lib → lib}/plan-approval/dialog.ts +0 -0
  272. /package/.pi/{extensions/lib → lib}/plan-approval/schema.ts +0 -0
  273. /package/.pi/{extensions/lib → lib}/plan-approval-readiness.ts +0 -0
  274. /package/.pi/{extensions/lib → lib}/plan-debate-eligibility.ts +0 -0
  275. /package/.pi/{extensions/lib → lib}/plan-debate-focus.ts +0 -0
  276. /package/.pi/{extensions/lib → lib}/plan-debate-id.ts +0 -0
  277. /package/.pi/{extensions/lib → lib}/plan-debate-lanes.ts +0 -0
  278. /package/.pi/{extensions/lib → lib}/plan-debate-round-status.ts +0 -0
  279. /package/.pi/{extensions/lib → lib}/plan-debate-write-guard.ts +0 -0
  280. /package/.pi/{extensions/lib → lib}/plan-review-gate.ts +0 -0
  281. /package/.pi/{extensions/lib → lib}/plan-review-integrator-rules.ts +0 -0
  282. /package/.pi/{extensions/lib → lib}/plan-scope-guard.ts +0 -0
  283. /package/.pi/{extensions/lib → lib}/posthog-client.ts +0 -0
  284. /package/.pi/{extensions/lib → lib}/posthog-node.d.ts +0 -0
@@ -0,0 +1,275 @@
1
+ # Generated/maintained SSOT for harness agent tools (see ADR 0049).
2
+ # Regenerate hints: node .pi/scripts/generate-agents-policy-yaml.mjs
3
+
4
+ apiVersion: harness.toolkit/v1
5
+ kinds:
6
+ planner:
7
+ tools:
8
+ - read
9
+ - grep
10
+ - find
11
+ - ls
12
+ - ctx_read
13
+ - ctx_search
14
+ - ctx_execute
15
+ - ctx_batch_execute
16
+ - ctx_tree
17
+ extensions: false
18
+ read_only: true
19
+ executor:
20
+ tools:
21
+ - read
22
+ - write
23
+ - edit
24
+ - bash
25
+ - grep
26
+ - find
27
+ - ls
28
+ extensions: true
29
+ read_only: false
30
+ evaluator:
31
+ tools:
32
+ - read
33
+ - grep
34
+ - find
35
+ - ls
36
+ - ctx_read
37
+ - ctx_search
38
+ - ctx_execute
39
+ - ctx_batch_execute
40
+ - ctx_tree
41
+ extensions: false
42
+ read_only: true
43
+ adversary:
44
+ tools:
45
+ - read
46
+ - grep
47
+ - find
48
+ - ls
49
+ - ctx_read
50
+ - ctx_search
51
+ - ctx_execute
52
+ - ctx_batch_execute
53
+ - ctx_tree
54
+ extensions: false
55
+ read_only: true
56
+ tie_breaker:
57
+ tools:
58
+ - read
59
+ - grep
60
+ - find
61
+ - ls
62
+ - ctx_read
63
+ - ctx_search
64
+ - ctx_execute
65
+ - ctx_batch_execute
66
+ - ctx_tree
67
+ extensions: false
68
+ read_only: true
69
+ trace:
70
+ tools:
71
+ - read
72
+ - grep
73
+ - find
74
+ - ls
75
+ - ctx_read
76
+ - ctx_search
77
+ - ctx_execute
78
+ - ctx_batch_execute
79
+ - ctx_tree
80
+ extensions: false
81
+ read_only: true
82
+ incident:
83
+ tools:
84
+ - read
85
+ - grep
86
+ - find
87
+ - ls
88
+ - ctx_read
89
+ - ctx_search
90
+ - ctx_execute
91
+ - ctx_batch_execute
92
+ - ctx_tree
93
+ extensions: false
94
+ read_only: true
95
+ other:
96
+ tools:
97
+ - read
98
+ - grep
99
+ - find
100
+ - ls
101
+ - ctx_read
102
+ - ctx_search
103
+ - ctx_execute
104
+ - ctx_tree
105
+ extensions: false
106
+ read_only: true
107
+ agents:
108
+ harness/incident-recorder:
109
+ kind: incident
110
+ tools_add:
111
+ - submit_human_required
112
+ extensions: false
113
+ max_turns: 15
114
+ thinking: medium
115
+ submit_tool: submit_human_required
116
+ harness/sentrux-bootstrap:
117
+ kind: planner
118
+ tools_add:
119
+ - bash
120
+ extensions: true
121
+ max_turns: 12
122
+ thinking: low
123
+ harness/sentrux-steward:
124
+ kind: planner
125
+ tools_add:
126
+ - bash
127
+ - submit_sentrux_manifest_proposal
128
+ extensions: false
129
+ max_turns: 16
130
+ thinking: high
131
+ submit_tool: submit_sentrux_manifest_proposal
132
+ harness/trace-librarian:
133
+ kind: trace
134
+ tools_add:
135
+ - submit_human_required
136
+ extensions: false
137
+ max_turns: 20
138
+ thinking: medium
139
+ submit_tool: submit_human_required
140
+ harness/running/executor:
141
+ kind: executor
142
+ tools_add:
143
+ - submit_executor_handoff
144
+ extensions: true
145
+ max_turns: 20
146
+ thinking: medium
147
+ submit_tool: submit_executor_handoff
148
+ harness/reviewing/adversary:
149
+ kind: adversary
150
+ tools_add:
151
+ - submit_adversary_report
152
+ extensions: false
153
+ max_turns: 20
154
+ thinking: high
155
+ submit_tool: submit_adversary_report
156
+ harness/reviewing/evaluator:
157
+ kind: evaluator
158
+ tools_add:
159
+ - submit_eval_verdict
160
+ extensions: false
161
+ max_turns: 20
162
+ thinking: high
163
+ submit_tool: submit_eval_verdict
164
+ harness/reviewing/tie-breaker:
165
+ kind: tie_breaker
166
+ tools_add:
167
+ - submit_human_required
168
+ extensions: false
169
+ max_turns: 15
170
+ thinking: high
171
+ submit_tool: submit_human_required
172
+ harness/planning/decompose:
173
+ kind: planner
174
+ tools_add:
175
+ - bash
176
+ - submit_decomposition_brief
177
+ - submit_human_required
178
+ extensions: false
179
+ max_turns: 12
180
+ thinking: medium
181
+ harness/planning/execution-plan-author:
182
+ kind: planner
183
+ tools_add:
184
+ - submit_execution_plan_brief
185
+ extensions: false
186
+ max_turns: 18
187
+ thinking: high
188
+ submit_tool: submit_execution_plan_brief
189
+ harness/planning/hypothesis-validator:
190
+ kind: planner
191
+ tools_add:
192
+ - submit_hypothesis_validation
193
+ extensions: false
194
+ max_turns: 10
195
+ thinking: medium
196
+ submit_tool: submit_hypothesis_validation
197
+ harness/planning/hypothesis:
198
+ kind: planner
199
+ tools_add:
200
+ - bash
201
+ - submit_hypothesis_brief
202
+ extensions: false
203
+ max_turns: 14
204
+ thinking: medium
205
+ submit_tool: submit_hypothesis_brief
206
+ harness/planning/implementation-researcher:
207
+ kind: planner
208
+ tools_add:
209
+ - bash
210
+ - web_search
211
+ - web_fetch
212
+ - submit_implementation_research
213
+ extensions: false
214
+ max_turns: 14
215
+ thinking: medium
216
+ submit_tool: submit_implementation_research
217
+ harness/planning/plan-adversary:
218
+ kind: planner
219
+ tools_add:
220
+ - submit_adversary_brief
221
+ extensions: false
222
+ max_turns: 14
223
+ thinking: medium
224
+ submit_tool: submit_adversary_brief
225
+ harness/planning/plan-evaluator:
226
+ kind: planner
227
+ tools_add:
228
+ - submit_validation_turn
229
+ extensions: false
230
+ max_turns: 14
231
+ thinking: medium
232
+ submit_tool: submit_validation_turn
233
+ harness/planning/plan-synthesizer:
234
+ kind: planner
235
+ tools_add:
236
+ - submit_decomposition_brief
237
+ - submit_hypothesis_brief
238
+ - submit_execution_plan_brief
239
+ extensions: false
240
+ harness/planning/planning-context:
241
+ kind: planner
242
+ tools_add:
243
+ - bash
244
+ - submit_planning_context
245
+ extensions: false
246
+ max_turns: 12
247
+ thinking: low
248
+ submit_tool: submit_planning_context
249
+ harness/planning/review-integrator:
250
+ kind: planner
251
+ tools_add:
252
+ - submit_review_round_draft
253
+ extensions: false
254
+ max_turns: 12
255
+ thinking: medium
256
+ submit_tool: submit_review_round_draft
257
+ harness/planning/sprint-contract-auditor:
258
+ kind: planner
259
+ tools_add:
260
+ - submit_sprint_audit
261
+ extensions: false
262
+ max_turns: 12
263
+ thinking: medium
264
+ submit_tool: submit_sprint_audit
265
+ harness/planning/stack-researcher:
266
+ kind: planner
267
+ tools_add:
268
+ - bash
269
+ - web_search
270
+ - web_fetch
271
+ - submit_stack_brief
272
+ extensions: false
273
+ max_turns: 16
274
+ thinking: medium
275
+ submit_tool: submit_stack_brief
@@ -10,7 +10,7 @@ ultimate-pi depended on the npm package `@sting8k/pi-vcc` for deterministic, vie
10
10
 
11
11
  ## Decision
12
12
 
13
- 1. Vendor [sting8k/pi-vcc](https://github.com/sting8k/pi-vcc) under `vendor/pi-vcc/` (refresh via `npm run vendor:sync-vcc`), following the same pattern as `vendor/pi-model-router`.
13
+ 1. Vendor [sting8k/pi-vcc](https://github.com/sting8k/pi-vcc) under `vendor/pi-vcc/` (refresh via `npm run vendor:sync-vcc`), following the pinned-vendor pattern documented in `THIRD_PARTY_NOTICES.md`.
14
14
  2. Load compaction through [`.pi/extensions/ultimate-pi-vcc.ts`](../../../extensions/ultimate-pi-vcc.ts).
15
15
  3. Remove `@sting8k/pi-vcc` from `package.json` dependencies and from `.pi/settings*.json` `packages` arrays.
16
16
  4. **Configuration is env-only** — no JSON config files (`PI_VCC_CONFIG_PATH` and `.pi/pi-vcc-config.json` are not used).
@@ -32,4 +32,4 @@ Early implementation treated debate as a fixed four-round checklist with single
32
32
 
33
33
  - [ADR-0033](0033-parent-orchestrated-planning.md), [ADR-0034](0034-darwin-plan-research-pipeline.md)
34
34
  - `raw/decisions/adr-020.md`, `raw/modules/structured-planning.md`
35
- - `.pi/prompts/planning-rubrics.md`, `.pi/prompts/harness-plan.md` Phase 5
35
+ - `.pi/harness/docs/planning-rubrics.md`, `.pi/prompts/harness-plan.md` Phase 5
@@ -0,0 +1,49 @@
1
+ # ADR 0045: Harness-lens minimal contract
2
+
3
+ ## Status
4
+
5
+ Accepted — 2026-05-24
6
+
7
+ ## Context
8
+
9
+ ultimate-pi previously shipped a trimmed fork of pi-lens with bundled YAML rules, ast-grep pi tools, and JS/TS-centric session scans. That overlapped Sentrux (architecture gate), shell `sg` (structural search), and graphify/ccc (recon). Target projects can be any stack (Go, Python, Rust, polyglot monorepos).
10
+
11
+ ## Decision
12
+
13
+ Replace the fork with a **harness-native** extension at `.pi/extensions/lib/harness-lens/`:
14
+
15
+ | Concern | Owner |
16
+ |---------|--------|
17
+ | Recon | graphify, ccc |
18
+ | Structural search | shell `sg` only |
19
+ | Architecture gate | Sentrux |
20
+ | Edit autopatch, secrets block, deferred format, LSP | harness-lens |
21
+
22
+ ### Runtime contract
23
+
24
+ - **Edit autopatch** — indentation-only oldText correction on `tool_call` (edit).
25
+ - **Secrets** — regex scanner blocks writes with credentials (stack-agnostic).
26
+ - **Deferred format** — queue on `tool_result`, run at `agent_end` (default). `--immediate-format` and `--no-autoformat` unchanged.
27
+ - **Formatters** — PATH binaries only when the **target project** declares config (`biome.json`, `ruff` in `pyproject.toml`, `.prettierrc`, `go.mod` + gofmt, `Cargo.toml` + rustfmt, etc.). No bundled biome/ruff config in lens; no lazy gem/rustup installs.
28
+ - **LSP** — `lsp_diagnostics`, `lsp_navigation`; auto-touch on read/write/edit; installer catalog is **LSP servers only** (no shadow-install of biome/ruff/sg).
29
+ - **Session bootstrap** — `project-profile.ts` detects FileKinds from tree + markers; pre-install at most 2–3 LSP defaults for detected kinds only.
30
+
31
+ ### External projects
32
+
33
+ - **Detect, don't assume** — no JS/TS export guard, no default biome for Go-only repos.
34
+ - **Harness setup tools ≠ lens stack** — `/harness-setup` may install global `sg` and optional `biome` on the machine; lens does not require them for unrelated stacks.
35
+ - **Graceful degradation** — missing LSP or formatter on PATH → skip with debug log.
36
+
37
+ ### Flags
38
+
39
+ `--no-lens`, `--no-lsp`, `--no-autoformat`, `--immediate-format`, `--lens-guard` (interactive commit block when blockers present).
40
+
41
+ ### Removed
42
+
43
+ - Bundled `rules/` YAML corpus, ast-grep pi tools, upstream `UPSTREAM_PIN.md` sync, duplicate export guard, AgentBehaviorClient, rules-scanner injection, cosmetic todo/go/rust scans.
44
+
45
+ ## Consequences
46
+
47
+ - Smaller npm payload and one quality story per concern.
48
+ - Agents on external repos get stack-appropriate LSP/format behavior without harness JS defaults.
49
+ - `harness-verify.mjs` asserts no `lib/lens`, no bundled rules, no `ast_grep_search` in index.
@@ -0,0 +1,51 @@
1
+ # ADR 0046: AGT policy engine and subagent identity
2
+
3
+ - **Status:** Accepted
4
+ - **Date:** 2026-05-24
5
+ - **Deciders:** ultimate-pi harness team
6
+
7
+ ## Context
8
+
9
+ Harness tool-call governance was split across `policy-gate.ts`, `harness-run-context.ts` (`guardToolCall`), `harness-subagent-policy.ts`, and subprocess-only `harness-subagent-submit.ts`. Subagents spawn with `--no-extensions -e <single-bundle>` and did not load parent `policy-gate.ts`, creating a governance bypass. We need a single declarative engine, npm-shipped policies, subprocess parity, and tamper-evident audit without MCP gateways.
10
+
11
+ ## Decision
12
+
13
+ 1. Adopt `@microsoft/agent-governance-sdk` (pinned in root `package.json`, Public Preview) as the **PolicyEngine** for allow/deny on every `tool_call` when AGT is enabled.
14
+ 2. Store policies under `.pi/harness/policies/*.yaml` and ship them via npm `files[]`.
15
+ 3. Implement `.pi/lib/agt/` for policy loading, evaluation-context precomputation (async FS/plan-scope logic stays in harness helpers), per-run identity/delegation/trust/audit.
16
+ 4. Rewrite `policy-gate.ts` `tool_call` to delegate to AGT when `HARNESS_AGT_POLICY` is not `0`/`false` (default **on**).
17
+ 5. Replace subprocess extension path with `harness-subagent-governance.ts` (AGT + submit tools in one bundle).
18
+ 6. Mint parent/subagent identities at spawn; persist under `.pi/harness/runs/<run_id>/agents/<agent_id>/` (gitignored).
19
+ 7. Fail closed: policy load errors and evaluation throws → deny.
20
+
21
+ Migration: `HARNESS_AGT_POLICY=0` restores legacy TS paths for one release window; parity tests (`test/harness-agt-policy-parity.test.mjs`) must show zero mismatches before deleting legacy branches.
22
+
23
+ ## Consequences
24
+
25
+ ### Positive
26
+
27
+ - One enforcement engine and audit trail (`agt-audit.jsonl` per run).
28
+ - Subprocess agents governed identically to parent orchestrator.
29
+ - Policies versioned in-repo and lintable (`agt lint-policy` optional in CI).
30
+
31
+ ### Negative / trade-offs
32
+
33
+ - Public Preview SDK may break; pinned version + golden matrix required on upgrade.
34
+ - Dual path during flag window increases maintenance until legacy removal.
35
+ - Identity material on disk requires run-dir hygiene (already gitignored).
36
+
37
+ ## Test contract surface
38
+
39
+ - `test/harness-agt-policy-matrix.test.mjs`
40
+ - `test/harness-agt-policy-parity.test.mjs`
41
+ - `test/harness-agt-policy-load.test.mjs`
42
+ - `test/harness-agt-packaging.test.mjs`
43
+ - `test/harness-tool-call-hook-chain.test.mjs`
44
+ - Extended `node .pi/scripts/harness-verify.mjs` AGT doctor
45
+
46
+ ## References
47
+
48
+ - [Microsoft Agent Governance Toolkit](https://github.com/microsoft/agent-governance-toolkit)
49
+ - [ADR 0001](0001-harness-constitution.md)
50
+ - [ADR 0037](0037-subagent-submit-tools.md)
51
+ - Plan: AGT policy-gate rewrite (2026-05)
@@ -0,0 +1,39 @@
1
+ # ADR 0047: AGT layered security (rings, prompt defense, workflow, CI)
2
+
3
+ - **Status:** Accepted
4
+ - **Date:** 2026-05-24
5
+ - **Deciders:** ultimate-pi harness team
6
+
7
+ ## Context
8
+
9
+ ADR 0046 covers PolicyEngine rewrite and subprocess identity. AGT also provides execution rings, kill switch, PromptDefense heuristics, workflow sequence rules, SRE circuit breakers, ShadowDiscovery, and GovernanceVerifier — complementary to Sentrux (architecture) and harness eval/review gates (outcomes).
10
+
11
+ ## Decision
12
+
13
+ 1. **Execution rings:** Map harness agent kinds to AGT `ExecutionRing` in `.pi/lib/agt/rings.ts`; enforce on spawn via `RingEnforcer` (planner/evaluator = inner, executor = middle, adversary = restricted).
14
+ 2. **Kill switch:** `.pi/extensions/agt-kill-switch.ts` arms on `/harness-abort` and repeated policy denies; blocks new spawns and tool calls until reset.
15
+ 3. **Prompt defense:** `.pi/extensions/agt-prompt-guard.ts` runs `PromptDefenseEvaluator` on `before_agent_start` for slash commands and subprocess task snippets (heuristic, no LLM).
16
+ 4. **Workflow rules:** `.pi/harness/policies/workflow-sequences.yaml` + `.pi/lib/agt/workflow-history.ts` read observation-bus flags for multi-step gates (mitigate per-action-only policy gap).
17
+ 5. **SRE hooks:** `.pi/lib/agt/sre-hooks.ts` ties `CircuitBreaker` to `harness-spawn-budget` counters (telemetry + optional hard stop when `HARNESS_AGT_SRE_ENFORCE=1`).
18
+ 6. **CI attestation:** `harness-verify.mjs` runs policy doctor, golden matrix, optional `agt lint-policy`; promotion may attach `agt-evidence.json` when `HARNESS_AGT_STRICT=1` (see ADR 0003 amendment note in harness README).
19
+
20
+ AGT does **not** replace Sentrux, review-integrity, budget-guard telemetry default, or `/harness-review` eval/adversary.
21
+
22
+ ## Consequences
23
+
24
+ ### Positive
25
+
26
+ - Defense-in-depth aligned with OWASP Agentic Top 10 mapping (documented in harness README).
27
+ - Deterministic CI (no LLM) for policy, prompt scan, and verify steps.
28
+
29
+ ### Negative / trade-offs
30
+
31
+ - Kill switch does not terminate already-running subprocesses (documented limitation).
32
+ - Workflow history depends on observation-bus completeness.
33
+
34
+ ## References
35
+
36
+ - [ADR 0046](0046-agt-policy-engine.md)
37
+ - [ADR 0003](0003-eval-promotion-gates.md)
38
+ - [ADR 0038](0038-budget-telemetry-only.md)
39
+ - AGT THREAT_MODEL and LIMITATIONS docs
@@ -0,0 +1,25 @@
1
+ # ADR 0048: tool_call hook interaction matrix
2
+
3
+ - **Status:** Accepted
4
+ - **Date:** 2026-05-24
5
+ - **Deciders:** ultimate-pi harness team
6
+
7
+ ## Context
8
+
9
+ Multiple Pi extensions register `tool_call` hooks: `policy-gate` (AGT), `harness-run-context` (coercion + legacy guards), `review-integrity`, `budget-guard`, `test-diff-integrity`, `harness-web-guard`, `harness-lens`, subprocess `harness-subagent-governance`, and `agt-kill-switch`. Block-first semantics must not be overridden by later hooks.
10
+
11
+ ## Decision
12
+
13
+ 1. **Primary deny:** `policy-gate` / subprocess `harness-subagent-governance` via AGT `PolicyEngine` (deny-overrides).
14
+ 2. **Secondary deny:** `agt-kill-switch` when session armed after abort or repeated denies.
15
+ 3. **Role separation:** `review-integrity` blocks executor tools during review phases (orthogonal to AGT).
16
+ 4. **Telemetry-only default:** `budget-guard` does not block (ADR 0038).
17
+ 5. **Coercion (not security):** `harness-run-context` scoped YAML coercion remains when AGT enabled; policy denies moved to YAML.
18
+ 6. **Subprocess:** Only `harness-subagent-governance.ts` is loaded (`-e` bundle); parent `policy-gate` does not run in child.
19
+
20
+ Pi invokes hooks in extension load order; any hook returning `{ block: true }` stops the tool. Tests in `test/harness-tool-call-hook-chain.test.mjs` document paths.
21
+
22
+ ## References
23
+
24
+ - [ADR 0046](0046-agt-policy-engine.md)
25
+ - [ADR 0038](0038-budget-telemetry-only.md)
@@ -0,0 +1,36 @@
1
+ # ADR 0049: agents.policy.yaml and native AGT integration
2
+
3
+ - **Status:** Accepted
4
+ - **Date:** 2026-05-24
5
+ - **Deciders:** ultimate-pi harness team
6
+
7
+ ## Context
8
+
9
+ Per-agent tool policy was split across agent `.md` frontmatter, [`harness-subagent-policy.ts`](../../../extensions/lib/harness-subagent-policy.ts), submit registry allowlists, and AGT precompute (`subagent_policy_block`). End users need custom agents under `.pi/agents/` and custom AGT rules under `.pi/policies/` without maintaining three copies. [`agents.manifest.json`](../agents.manifest.json) already pins package agent `.md` integrity (sha256); it must remain separate from runtime tool policy.
10
+
11
+ ## Decision
12
+
13
+ 1. **`agents.policy.yaml` SSOT** — package [`.pi/harness/agents.policy.yaml`](../agents.policy.yaml); project `.pi/agents.policy.yaml`. Defines `kinds` and per-agent `tools` / spawn fields. No `tools` / `disallowed_tools` in harness agent frontmatter.
14
+ 2. **Native discovery** — vendored [`parseMarkdownAgent`](../../../../vendor/pi-subagents/src/agents.ts) applies policy via [`.pi/lib/agents-policy`](../../../lib/agents-policy.ts) (same loader as AGT and verify).
15
+ 3. **AGT** — `createAgtPolicyEngine({ packageRoot, projectRoot })` loads package `.pi/harness/policies/` then project `.pi/policies/`. `tool_allowed` comes only from agents-policy; remove `subagent_policy_block` / delete `harness-subagent-policy.ts`.
16
+ 4. **Subprocess scope** — `subprocessGovernanceExtensionPath` loads governance for **all** subagents when `isAgtGovernanceActive(projectRoot)`; parent `policy-gate` AGT only during harness sessions (`isHarnessProjectEnabled()` + harness flow).
17
+ 5. **Submit registry** — implementation only (schema + artifact paths); allowlists live in `agents.policy.yaml`.
18
+ 6. **Verify** — extend [`harness-agents-manifest.mjs`](../../../scripts/harness-agents-manifest.mjs) for policy↔manifest alignment.
19
+
20
+ ## Consequences
21
+
22
+ ### Positive
23
+
24
+ - One edit surface per agent capability; project extensions without forking harness.
25
+ - Integrity manifest unchanged; supply-chain and policy concerns separated.
26
+
27
+ ### Negative / trade-offs
28
+
29
+ - Vendored pi-subagents delta must be preserved on `npm run vendor:sync-subagents`.
30
+ - Agents without policy entry fail closed in subprocess (doctor requires entries for spawnable project agents).
31
+
32
+ ## References
33
+
34
+ - [ADR 0046](0046-agt-policy-engine.md)
35
+ - [ADR 0048](0048-tool-call-hook-order.md)
36
+ - [ADR 0037](0037-subagent-submit-tools.md)
@@ -26,11 +26,16 @@ Team-shared ADRs for the ultimate-pi harness live under `.pi/harness/docs/adrs/`
26
26
  | [0038](0038-budget-telemetry-only.md) | Budget caps telemetry-only by default | Accepted |
27
27
  | [0039](0039-harness-post-run-review-gate.md) | `/harness-review` master post-run gate | Accepted |
28
28
  | [0040](0040-practice-grounded-orchestration.md) | Practice-grounded orchestration & team topology | Accepted |
29
+ | [0045](0045-harness-lens-minimal-contract.md) | Harness-lens minimal contract (edit safety, LSP, deferred format) | Accepted |
29
30
  | [0041](0041-intelligent-planning-reconnaissance.md) | Intelligent planning reconnaissance (tools over tool-scouts) | Accepted |
30
31
  | [0042](0042-agent-native-orchestration.md) | Agent-native orchestration (lakes, plan-verify probes, synthesizer) | Accepted |
31
32
  | [0043](0043-path-first-harness-tools.md) | Path-first harness tool contracts | Accepted |
32
33
  | [0044](0044-harness-steer-loop.md) | Post-run steer loop (repair vs plan revise) | Accepted |
33
34
  | [0045](0045-phase-scoped-agent-directories.md) | Phase-scoped harness agent directories | Accepted |
35
+ | [0046](0046-agt-policy-engine.md) | AGT policy engine + subagent identity | Accepted |
36
+ | [0047](0047-agt-layered-security.md) | AGT layered security (rings, prompt defense, CI) | Accepted |
37
+ | [0048](0048-tool-call-hook-order.md) | tool_call hook interaction matrix | Accepted |
38
+ | [0049](0049-agents-policy-manifest.md) | agents.policy.yaml SSOT + native discovery | Accepted |
34
39
 
35
40
  ## Practice map
36
41
 
@@ -1,11 +1,10 @@
1
1
  # Harness evolution (Phase 3)
2
2
 
3
- Self-healing and meta-optimization read **JSONL first** (`.pi/harness/runs/*/events.jsonl`), not PostHog.
3
+ Self-healing reads **JSONL first** (`.pi/harness/runs/*/events.jsonl`), not PostHog.
4
4
 
5
5
  ## Components
6
6
 
7
7
  - `self-healing-rules.json` — pattern → suggested remediation
8
- - `meta-optimizer.mjs` — scans run index, proposes router/tuning deltas; run `node "$UP_PKG/.pi/harness/evolution/meta-optimizer.mjs"` (see `.pi/scripts/README.md`).
9
8
  - `chaos-drill.md` — manual chaos / failure injection checklist
10
9
 
11
10
  PostHog `harness_*` events are for dashboards; JSONL is the optimization source of truth per ADR 0008.
@@ -0,0 +1,19 @@
1
+ # Example project override — copy to <project>/.pi/agents.policy.yaml
2
+ # Merges on top of package .pi/harness/agents.policy.yaml (same agent ids win on project keys).
3
+
4
+ apiVersion: harness.toolkit/v1
5
+
6
+ agents:
7
+ my-custom-scout:
8
+ kind: planner
9
+ tools_add:
10
+ - web_search
11
+ - web_fetch
12
+ extensions: false
13
+ max_turns: 12
14
+
15
+ my-custom-runner:
16
+ kind: executor
17
+ tools_add:
18
+ - submit_executor_handoff
19
+ extensions: true
@@ -0,0 +1,9 @@
1
+ # Example project AGT rule — copy to <project>/.pi/policies/custom-deny-bash.yaml
2
+ # Loaded after package .pi/harness/policies/*.yaml when createAgtPolicyEngine runs.
3
+
4
+ policies:
5
+ - name: deny-rm-rf-in-subagents
6
+ description: Block recursive rm -rf in subprocess tool calls
7
+ effect: deny
8
+ priority: 200
9
+ condition: is_subprocess == true && tool_name == "bash" && contains(tool_input.command, "rm -rf")
@@ -0,0 +1,5 @@
1
+ apiVersion: governance.toolkit/v1
2
+ name: harness-bash-denylists
3
+ description: Planning scout bash patterns (precomputed in context).
4
+ default_action: allow
5
+ rules: []
@@ -0,0 +1,51 @@
1
+ apiVersion: governance.toolkit/v1
2
+ name: harness-defaults
3
+ description: Fail-closed default; explicit allow when no harness blocks fire.
4
+ default_action: deny
5
+ rules:
6
+ - name: deny-abort-mutation
7
+ priority: 2000
8
+ ruleAction: deny
9
+ condition: abort_mutating_block == true
10
+ description: harness-abort lock blocks mutating tools
11
+ - name: deny-plan-mutation
12
+ priority: 1900
13
+ ruleAction: deny
14
+ condition: plan_mutation_block == true
15
+ - name: deny-context-mode
16
+ priority: 1800
17
+ ruleAction: deny
18
+ condition: context_mode_block == true
19
+ - name: deny-tool-not-in-manifest
20
+ priority: 1700
21
+ ruleAction: deny
22
+ condition: tool_allowed == false
23
+ description: tool not allowed by agents.policy.yaml for this agent
24
+ - name: deny-spawn-policy
25
+ priority: 1650
26
+ ruleAction: deny
27
+ condition: spawn_policy_block == true
28
+ - name: deny-mutating-bash-phase
29
+ priority: 1600
30
+ ruleAction: deny
31
+ condition: mutating_bash_phase_block == true
32
+ - name: deny-eval-plan-packet-write
33
+ priority: 1550
34
+ ruleAction: deny
35
+ condition: eval_plan_packet_write_block == true
36
+ - name: deny-bash-web-bypass
37
+ priority: 1500
38
+ ruleAction: deny
39
+ condition: bash_web_block == true
40
+ - name: deny-bash-planning-heavy
41
+ priority: 1450
42
+ ruleAction: deny
43
+ condition: bash_planning_deny == true
44
+ - name: deny-bash-planning-json-artifact
45
+ priority: 1440
46
+ ruleAction: deny
47
+ condition: bash_planning_json_block == true
48
+ - name: allow-no-blocks
49
+ priority: 100
50
+ ruleAction: allow
51
+ condition: abort_mutating_block == false and plan_mutation_block == false and context_mode_block == false and tool_allowed == true and spawn_policy_block == false and mutating_bash_phase_block == false and eval_plan_packet_write_block == false and bash_web_block == false and bash_planning_deny == false and bash_planning_json_block == false
@@ -0,0 +1,18 @@
1
+ apiVersion: governance.toolkit/v1
2
+ name: harness-orchestrator
3
+ description: Parent orchestrator submit_* and plan tools.
4
+ default_action: allow
5
+ rules:
6
+ - name: deny-parent-submit
7
+ priority: 2100
8
+ ruleAction: deny
9
+ condition: is_parent_orchestrator == true and is_submit_tool == true
10
+ description: submit_* is subprocess-only
11
+ - name: deny-subprocess-create-plan
12
+ priority: 2050
13
+ ruleAction: deny
14
+ condition: is_subprocess == true and tool_name == 'create_plan'
15
+ - name: deny-subprocess-approve-plan
16
+ priority: 2050
17
+ ruleAction: deny
18
+ condition: is_subprocess == true and tool_name == 'approve_plan'
@@ -0,0 +1,10 @@
1
+ apiVersion: governance.toolkit/v1
2
+ name: harness-phases
3
+ description: Phase hints for workflow (enforced via precomputed flags in defaults).
4
+ default_action: allow
5
+ rules:
6
+ - name: phase-metadata-plan
7
+ priority: 1
8
+ ruleAction: log
9
+ condition: harness_phase == 'plan'
10
+ description: informational only
@@ -0,0 +1,5 @@
1
+ apiVersion: governance.toolkit/v1
2
+ name: harness-roles
3
+ description: Role matrix enforced via subagent_policy_block precompute.
4
+ default_action: allow
5
+ rules: []
@@ -0,0 +1,5 @@
1
+ apiVersion: governance.toolkit/v1
2
+ name: harness-web-guard
3
+ description: Web fetch bypass blocks (precomputed bash_web_block).
4
+ default_action: allow
5
+ rules: []
@@ -0,0 +1,9 @@
1
+ apiVersion: governance.toolkit/v1
2
+ name: harness-workflow-sequences
3
+ description: Multi-step workflow gates (observation-bus flags); extend as needed.
4
+ default_action: allow
5
+ rules:
6
+ - name: log-execute-phase
7
+ priority: 1
8
+ ruleAction: log
9
+ condition: harness_phase == 'execute'