pi-harness-runtime 0.9.25 → 0.10.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 (321) hide show
  1. package/CHANGELOG.md +27 -7
  2. package/README.md +51 -51
  3. package/harness/auto-compact.ts +1 -1
  4. package/harness/autonomous-review.ts +88 -0
  5. package/harness/context-compact-orchestrator.ts +23 -23
  6. package/harness/context-window-manager.ts +5 -5
  7. package/harness/continue-prompt.ts +3 -3
  8. package/harness/e2e/minimax-quota-scraper.ts +1 -1
  9. package/harness/forked-summarizer.ts +4 -4
  10. package/harness/herdr-agents.ts +91 -0
  11. package/harness/index.ts +5 -5
  12. package/harness/loop-code-agent.ts +284 -0
  13. package/harness/loop-controller.ts +201 -0
  14. package/harness/loop-review-agent.ts +295 -0
  15. package/harness/loop-runtime.ts +10 -10
  16. package/harness/loop-types.ts +118 -0
  17. package/harness/notification-events.ts +3 -3
  18. package/harness/output-limit-handler.ts +1 -1
  19. package/harness/partial-recovery.ts +3 -3
  20. package/harness/session-memory.ts +5 -5
  21. package/index.ts +46 -32
  22. package/package.json +1 -1
  23. package/packages/a2a-adapter/package.json +1 -1
  24. package/packages/a2a-adapter/src/types.ts +5 -5
  25. package/packages/auth/package.json +1 -1
  26. package/packages/autonomous-refactor/package.json +1 -1
  27. package/packages/autonomous-runtime/dist/inbox.d.ts +3 -3
  28. package/packages/autonomous-runtime/dist/inbox.js +12 -12
  29. package/packages/autonomous-runtime/dist/lease.js +14 -14
  30. package/packages/autonomous-runtime/dist/types.js +1 -1
  31. package/packages/autonomous-runtime/package.json +1 -1
  32. package/packages/autonomous-runtime/src/inbox.ts +12 -12
  33. package/packages/autonomous-runtime/src/lease.ts +15 -15
  34. package/packages/autonomous-runtime/src/types.ts +13 -13
  35. package/packages/autonomous-runtime/tsconfig.tsbuildinfo +1 -1
  36. package/packages/cache-strategy/package.json +1 -1
  37. package/packages/capability-registry/dist/types.js +1 -1
  38. package/packages/capability-registry/package.json +1 -1
  39. package/packages/capability-registry/src/types.ts +5 -5
  40. package/packages/checkpoint/README.md +6 -6
  41. package/packages/checkpoint/dist/differ.js +2 -2
  42. package/packages/checkpoint/dist/engine.js +3 -3
  43. package/packages/checkpoint/dist/index.js +5 -5
  44. package/packages/checkpoint/dist/storage.js +3 -3
  45. package/packages/checkpoint/dist/types.js +1 -1
  46. package/packages/checkpoint/package.json +1 -1
  47. package/packages/checkpoint/src/differ.ts +2 -2
  48. package/packages/checkpoint/src/engine.ts +3 -3
  49. package/packages/checkpoint/src/index.ts +5 -5
  50. package/packages/checkpoint/src/storage.ts +3 -3
  51. package/packages/checkpoint/src/types.ts +10 -10
  52. package/packages/checkpoint/tsconfig.tsbuildinfo +1 -1
  53. package/packages/cli-plugin-sdk/package.json +1 -1
  54. package/packages/clipboard/dist/src/clipboard.d.ts.map +1 -1
  55. package/packages/clipboard/dist/src/clipboard.js +15 -7
  56. package/packages/clipboard/dist/src/clipboard.js.map +1 -1
  57. package/packages/clipboard/package.json +1 -1
  58. package/packages/clipboard/src/clipboard.ts +16 -9
  59. package/packages/code-generation/README.md +13 -13
  60. package/packages/code-generation/dist/faker.js +4 -4
  61. package/packages/code-generation/dist/generator.js +3 -3
  62. package/packages/code-generation/dist/index.js +3 -3
  63. package/packages/code-generation/dist/templates/registry.js +1 -1
  64. package/packages/code-generation/dist/types.js +1 -1
  65. package/packages/code-generation/package.json +1 -1
  66. package/packages/code-generation/src/faker.ts +5 -5
  67. package/packages/code-generation/src/generator.ts +4 -4
  68. package/packages/code-generation/src/index.ts +3 -3
  69. package/packages/code-generation/src/templates/registry.ts +1 -1
  70. package/packages/code-generation/src/types.ts +10 -10
  71. package/packages/code-generation/tsconfig.tsbuildinfo +1 -1
  72. package/packages/code-review/README.md +13 -13
  73. package/packages/code-review/dist/engine.js +3 -3
  74. package/packages/code-review/dist/index.js +3 -3
  75. package/packages/code-review/dist/types.js +1 -1
  76. package/packages/code-review/package.json +1 -1
  77. package/packages/code-review/src/engine.ts +3 -3
  78. package/packages/code-review/src/index.ts +3 -3
  79. package/packages/code-review/src/types.ts +10 -10
  80. package/packages/code-review/tsconfig.tsbuildinfo +1 -1
  81. package/packages/codex-adapter/package.json +1 -1
  82. package/packages/context-compiler/dist/compiler.js +1 -1
  83. package/packages/context-compiler/package.json +1 -1
  84. package/packages/context-compiler/src/compiler.ts +1 -1
  85. package/packages/context-compiler/src/types.ts +11 -11
  86. package/packages/context-compiler/test/context-compiler.test.ts +11 -11
  87. package/packages/context-discovery/package.json +1 -1
  88. package/packages/context-manager/package.json +1 -1
  89. package/packages/cookie-sanitizer/README.md +27 -27
  90. package/packages/cookie-sanitizer/package.json +1 -1
  91. package/packages/cost-optimizer/package.json +1 -1
  92. package/packages/cost-optimizer/src/types.ts +5 -5
  93. package/packages/dependency-analyzer/package.json +1 -1
  94. package/packages/django-plugin/dist/analyzer.js +7 -7
  95. package/packages/django-plugin/package.json +1 -1
  96. package/packages/django-plugin/src/analyzer.ts +7 -7
  97. package/packages/doc-generator/package.json +1 -1
  98. package/packages/evaluation-engine/dist/engine.js +9 -9
  99. package/packages/evaluation-engine/package.json +1 -1
  100. package/packages/evaluation-engine/src/engine.ts +9 -9
  101. package/packages/evaluation-engine/src/types.ts +3 -3
  102. package/packages/evaluation-runner/package.json +1 -1
  103. package/packages/event-bus/dist/src/herdr-bus.d.ts +121 -0
  104. package/packages/event-bus/dist/src/herdr-bus.d.ts.map +1 -0
  105. package/packages/event-bus/dist/src/herdr-bus.js +322 -0
  106. package/packages/event-bus/dist/src/herdr-bus.js.map +1 -0
  107. package/packages/event-bus/dist/src/index.d.ts +2 -0
  108. package/packages/event-bus/dist/src/index.d.ts.map +1 -1
  109. package/packages/event-bus/dist/src/index.js +1 -0
  110. package/packages/event-bus/dist/src/index.js.map +1 -1
  111. package/packages/event-bus/package.json +1 -1
  112. package/packages/event-bus/src/herdr-bus.ts +525 -0
  113. package/packages/event-bus/src/index.ts +29 -0
  114. package/packages/event-store/package.json +1 -1
  115. package/packages/experience-replay/dist/replay.js +7 -7
  116. package/packages/experience-replay/package.json +1 -1
  117. package/packages/experience-replay/src/replay.ts +7 -7
  118. package/packages/experience-replay/src/types.ts +5 -5
  119. package/packages/feedback-collector/package.json +1 -1
  120. package/packages/framework-detector/README.md +18 -18
  121. package/packages/framework-detector/dist/detector.js +3 -3
  122. package/packages/framework-detector/dist/index.js +3 -3
  123. package/packages/framework-detector/dist/signatures/registry.js +24 -24
  124. package/packages/framework-detector/dist/types.js +1 -1
  125. package/packages/framework-detector/package.json +1 -1
  126. package/packages/framework-detector/src/detector.ts +3 -3
  127. package/packages/framework-detector/src/index.ts +3 -3
  128. package/packages/framework-detector/src/signatures/registry.ts +24 -24
  129. package/packages/framework-detector/src/types.ts +7 -7
  130. package/packages/framework-detector/tsconfig.tsbuildinfo +1 -1
  131. package/packages/framework-plugin-sdk/README.md +23 -23
  132. package/packages/framework-plugin-sdk/dist/index.js +2 -2
  133. package/packages/framework-plugin-sdk/dist/manager.js +3 -3
  134. package/packages/framework-plugin-sdk/dist/types.js +2 -2
  135. package/packages/framework-plugin-sdk/package.json +1 -1
  136. package/packages/framework-plugin-sdk/src/index.ts +2 -2
  137. package/packages/framework-plugin-sdk/src/manager.ts +3 -3
  138. package/packages/framework-plugin-sdk/src/types.ts +10 -10
  139. package/packages/framework-plugin-sdk/tsconfig.tsbuildinfo +1 -1
  140. package/packages/frappe-plugin/dist/analyzer.js +8 -8
  141. package/packages/frappe-plugin/dist/types.js +1 -1
  142. package/packages/frappe-plugin/package.json +1 -1
  143. package/packages/frappe-plugin/src/analyzer.ts +8 -8
  144. package/packages/frappe-plugin/src/types.ts +10 -10
  145. package/packages/generic-web-plugin/dist/analyzer.js +5 -5
  146. package/packages/generic-web-plugin/package.json +1 -1
  147. package/packages/generic-web-plugin/src/analyzer.ts +5 -5
  148. package/packages/health-monitor/package.json +1 -1
  149. package/packages/health-monitor/src/monitor.ts +1 -1
  150. package/packages/intent-analyzer/package.json +1 -1
  151. package/packages/laravel-plugin/dist/analyzer.js +11 -11
  152. package/packages/laravel-plugin/package.json +1 -1
  153. package/packages/laravel-plugin/src/analyzer.ts +11 -11
  154. package/packages/learning-engine/dist/engine.js +5 -5
  155. package/packages/learning-engine/dist/types.js +1 -1
  156. package/packages/learning-engine/package.json +1 -1
  157. package/packages/learning-engine/src/engine.ts +5 -5
  158. package/packages/learning-engine/src/types.ts +6 -6
  159. package/packages/mcp-adapter/package.json +1 -1
  160. package/packages/memory-engine/dist/engine.js +8 -8
  161. package/packages/memory-engine/dist/types.js +2 -2
  162. package/packages/memory-engine/package.json +1 -1
  163. package/packages/memory-engine/src/engine.ts +8 -8
  164. package/packages/memory-engine/src/types.ts +9 -9
  165. package/packages/model-registry/package.json +1 -1
  166. package/packages/model-registry/src/types.ts +4 -4
  167. package/packages/nextjs-plugin/dist/analyzer.js +9 -9
  168. package/packages/nextjs-plugin/package.json +1 -1
  169. package/packages/nextjs-plugin/src/analyzer.ts +9 -9
  170. package/packages/notification/dist/notification-center.js +1 -1
  171. package/packages/notification/package.json +1 -1
  172. package/packages/notification/src/notification-center.ts +1 -1
  173. package/packages/observability/dist/alerts.js +2 -2
  174. package/packages/observability/dist/health.js +4 -4
  175. package/packages/observability/dist/index.js +6 -6
  176. package/packages/observability/dist/logger.js +7 -7
  177. package/packages/observability/dist/metrics.js +11 -11
  178. package/packages/observability/dist/tracer.js +3 -3
  179. package/packages/observability/dist/types.js +1 -1
  180. package/packages/observability/package.json +1 -1
  181. package/packages/observability/src/alerts.ts +2 -2
  182. package/packages/observability/src/health.ts +4 -4
  183. package/packages/observability/src/index.ts +6 -6
  184. package/packages/observability/src/logger.ts +7 -7
  185. package/packages/observability/src/metrics.ts +11 -11
  186. package/packages/observability/src/tracer.ts +3 -3
  187. package/packages/observability/src/types.ts +7 -7
  188. package/packages/observability/test/observability.test.ts +4 -4
  189. package/packages/observability/tsconfig.tsbuildinfo +1 -1
  190. package/packages/performance-optimizer/dist/optimizer.js +1 -1
  191. package/packages/performance-optimizer/package.json +1 -1
  192. package/packages/performance-optimizer/src/optimizer.ts +1 -1
  193. package/packages/performance-optimizer/src/types.ts +4 -4
  194. package/packages/privilege-broker/package.json +1 -1
  195. package/packages/project-analyzer/dist/analyzer.js +4 -4
  196. package/packages/project-analyzer/dist/index.js +8 -8
  197. package/packages/project-analyzer/dist/signals.js +3 -3
  198. package/packages/project-analyzer/dist/types.js +1 -1
  199. package/packages/project-analyzer/package.json +1 -1
  200. package/packages/project-analyzer/src/analyzer.ts +4 -4
  201. package/packages/project-analyzer/src/index.ts +9 -9
  202. package/packages/project-analyzer/src/signals.ts +4 -4
  203. package/packages/project-analyzer/src/types.ts +15 -15
  204. package/packages/project-analyzer/test/index.test.ts +17 -17
  205. package/packages/project-analyzer/tsconfig.tsbuildinfo +1 -1
  206. package/packages/projection-engine/package.json +1 -1
  207. package/packages/prompt-compiler/dist/section-builder.js +1 -1
  208. package/packages/prompt-compiler/dist/types.js +3 -3
  209. package/packages/prompt-compiler/package.json +1 -1
  210. package/packages/prompt-compiler/src/section-builder.ts +1 -1
  211. package/packages/prompt-compiler/src/types.ts +12 -12
  212. package/packages/prompt-compiler/test/prompt-compiler.test.ts +12 -12
  213. package/packages/prompt-versioning/package.json +1 -1
  214. package/packages/provider-adapter-sdk/dist/builder.js +1 -1
  215. package/packages/provider-adapter-sdk/dist/index.js +5 -5
  216. package/packages/provider-adapter-sdk/dist/registry.js +1 -1
  217. package/packages/provider-adapter-sdk/dist/tester.js +1 -1
  218. package/packages/provider-adapter-sdk/dist/types.js +1 -1
  219. package/packages/provider-adapter-sdk/package.json +1 -1
  220. package/packages/provider-adapter-sdk/src/builder.ts +1 -1
  221. package/packages/provider-adapter-sdk/src/index.ts +6 -6
  222. package/packages/provider-adapter-sdk/src/registry.ts +1 -1
  223. package/packages/provider-adapter-sdk/src/tester.ts +1 -1
  224. package/packages/provider-adapter-sdk/src/types.ts +5 -5
  225. package/packages/provider-adapter-sdk/tsconfig.tsbuildinfo +1 -1
  226. package/packages/provider-router/package.json +1 -1
  227. package/packages/provider-router/src/types.ts +4 -4
  228. package/packages/provider-selector/package.json +1 -1
  229. package/packages/providers/dist/deepagents-adapter.js +1 -1
  230. package/packages/providers/package.json +1 -1
  231. package/packages/providers/src/deepagents-adapter.ts +1 -1
  232. package/packages/quota-manager/package.json +1 -1
  233. package/packages/rate-limiter/package.json +1 -1
  234. package/packages/react-vite-plugin/dist/analyzer.js +7 -7
  235. package/packages/react-vite-plugin/package.json +1 -1
  236. package/packages/react-vite-plugin/src/analyzer.ts +7 -7
  237. package/packages/release-manager/package.json +1 -1
  238. package/packages/requirement-compiler/dist/compiler.js +17 -17
  239. package/packages/requirement-compiler/dist/types.js +2 -2
  240. package/packages/requirement-compiler/package.json +1 -1
  241. package/packages/requirement-compiler/src/compiler.ts +17 -17
  242. package/packages/requirement-compiler/src/types.ts +21 -21
  243. package/packages/requirement-compiler/test/requirement-compiler.test.ts +17 -17
  244. package/packages/runtime/dist/command-executor.js +1 -1
  245. package/packages/runtime/dist/local-runtime-agent.js +1 -1
  246. package/packages/runtime/dist/policy-engine.js +1 -1
  247. package/packages/runtime/dist/runtime-api.js +1 -1
  248. package/packages/runtime/dist/workspace-manager.js +1 -1
  249. package/packages/runtime/package.json +1 -1
  250. package/packages/runtime/src/command-executor.ts +1 -1
  251. package/packages/runtime/src/local-runtime-agent.ts +1 -1
  252. package/packages/runtime/src/policy-engine.ts +1 -1
  253. package/packages/runtime/src/runtime-api.ts +1 -1
  254. package/packages/runtime/src/workspace-manager.ts +1 -1
  255. package/packages/scheduler/package.json +1 -1
  256. package/packages/scheduler-adapter/package.json +1 -1
  257. package/packages/session/README.md +18 -18
  258. package/packages/session/dist/history.js +3 -3
  259. package/packages/session/dist/index.js +5 -5
  260. package/packages/session/dist/manager.js +3 -3
  261. package/packages/session/dist/policy.js +2 -2
  262. package/packages/session/dist/store.js +2 -2
  263. package/packages/session/dist/types.js +1 -1
  264. package/packages/session/package.json +1 -1
  265. package/packages/session/src/history.ts +3 -3
  266. package/packages/session/src/index.ts +5 -5
  267. package/packages/session/src/manager.ts +3 -3
  268. package/packages/session/src/policy.ts +4 -4
  269. package/packages/session/src/store.ts +3 -3
  270. package/packages/session/src/types.ts +10 -10
  271. package/packages/session/tsconfig.tsbuildinfo +1 -1
  272. package/packages/session-api/package.json +1 -1
  273. package/packages/session-export/package.json +1 -1
  274. package/packages/shared-context/package.json +1 -1
  275. package/packages/skill-registry/package.json +1 -1
  276. package/packages/skill-registry/src/types.ts +4 -4
  277. package/packages/sprint-planner/package.json +1 -1
  278. package/packages/subscription-engine/package.json +1 -1
  279. package/packages/task-compiler/dist/compiler.js +7 -7
  280. package/packages/task-compiler/dist/decompose.js +11 -11
  281. package/packages/task-compiler/dist/file-scope.js +6 -6
  282. package/packages/task-compiler/dist/graph.js +6 -6
  283. package/packages/task-compiler/dist/index.js +2 -2
  284. package/packages/task-compiler/dist/types.js +5 -5
  285. package/packages/task-compiler/dist/validate.js +2 -2
  286. package/packages/task-compiler/dist/verification.js +2 -2
  287. package/packages/task-compiler/package.json +1 -1
  288. package/packages/task-compiler/src/command-policy.ts +1 -1
  289. package/packages/task-compiler/src/compiler.ts +7 -7
  290. package/packages/task-compiler/src/decompose.ts +11 -11
  291. package/packages/task-compiler/src/file-scope.ts +6 -6
  292. package/packages/task-compiler/src/graph.ts +6 -6
  293. package/packages/task-compiler/src/index.ts +3 -3
  294. package/packages/task-compiler/src/types.ts +14 -14
  295. package/packages/task-compiler/src/validate.ts +2 -2
  296. package/packages/task-compiler/src/verification.ts +2 -2
  297. package/packages/task-compiler/test/task-compiler.test.ts +10 -10
  298. package/packages/test-data-generator/README.md +13 -13
  299. package/packages/test-data-generator/dist/faker-adapter.js +4 -4
  300. package/packages/test-data-generator/dist/generator.js +3 -3
  301. package/packages/test-data-generator/dist/index.js +3 -3
  302. package/packages/test-data-generator/dist/types.js +1 -1
  303. package/packages/test-data-generator/package.json +1 -1
  304. package/packages/test-data-generator/src/faker-adapter.ts +4 -4
  305. package/packages/test-data-generator/src/generator.ts +3 -3
  306. package/packages/test-data-generator/src/index.ts +3 -3
  307. package/packages/test-data-generator/src/types.ts +9 -9
  308. package/packages/test-data-generator/tsconfig.tsbuildinfo +1 -1
  309. package/packages/test-generator/package.json +1 -1
  310. package/packages/token-estimation/package.json +1 -1
  311. package/packages/token-optimizer/package.json +1 -1
  312. package/packages/tui/package.json +1 -1
  313. package/packages/types/package.json +1 -1
  314. package/packages/types/src/agent-worker-types.ts +5 -5
  315. package/packages/types/src/runtime-types.ts +12 -12
  316. package/packages/types/tsconfig.tsbuildinfo +1 -1
  317. package/packages/workflow-events/package.json +1 -1
  318. package/packages/workspace-scanner/package.json +1 -1
  319. package/packages/worktree/package.json +1 -1
  320. package/renderer.ts +7 -7
  321. package/skills/harness-runtime/SKILL.md +15 -15
@@ -5,7 +5,7 @@
5
5
  * Every selected item has a source reference; every omitted item has a reason.
6
6
  */
7
7
 
8
- // ─── Context candidate kinds ───────────────────────────────────────────
8
+ // --- Context candidate kinds -------------------------------------------
9
9
 
10
10
  /**
11
11
  * Kinds of context that can be collected.
@@ -24,7 +24,7 @@ export type ContextKind =
24
24
  */
25
25
  export type ContextTrust = "authoritative" | "generated" | "unverified";
26
26
 
27
- // ─── Candidate ────────────────────────────────────────────────────────
27
+ // --- Candidate --------------------------------------------------------
28
28
 
29
29
  /**
30
30
  * A raw context candidate from a source collector.
@@ -49,7 +49,7 @@ export interface ContextCandidate {
49
49
  symbols?: string[];
50
50
  }
51
51
 
52
- // ─── Omission ─────────────────────────────────────────────────────────
52
+ // --- Omission ---------------------------------------------------------
53
53
 
54
54
  /**
55
55
  * Reasons why a candidate was omitted.
@@ -76,7 +76,7 @@ export interface OmittedItem {
76
76
  deniedBy?: string;
77
77
  }
78
78
 
79
- // ─── Compiled item ────────────────────────────────────────────────────
79
+ // --- Compiled item ----------------------------------------------------
80
80
 
81
81
  /**
82
82
  * An item that made it into the final compiled context.
@@ -97,7 +97,7 @@ export interface CompiledContextItem {
97
97
  symbols?: string[];
98
98
  }
99
99
 
100
- // ─── Source graph ─────────────────────────────────────────────────────
100
+ // --- Source graph -----------------------------------------------------
101
101
 
102
102
  /**
103
103
  * An edge in the context source graph.
@@ -109,7 +109,7 @@ export interface ContextSourceEdge {
109
109
  weight: number;
110
110
  }
111
111
 
112
- // ─── Compiled context ──────────────────────────────────────────────────
112
+ // --- Compiled context --------------------------------------------------
113
113
 
114
114
  /**
115
115
  * The final compiled context output.
@@ -125,7 +125,7 @@ export interface CompiledContext {
125
125
  mapping: Record<string, string>;
126
126
  }
127
127
 
128
- // ─── Scoring ─────────────────────────────────────────────────────────
128
+ // --- Scoring ---------------------------------------------------------
129
129
 
130
130
  /**
131
131
  * Scoring weights for context candidates.
@@ -151,7 +151,7 @@ export const DEFAULT_SCORING_WEIGHTS: ScoringWeights = {
151
151
  duplicationPenalty: 8,
152
152
  };
153
153
 
154
- // ─── Policy ─────────────────────────────────────────────────────────
154
+ // --- Policy ---------------------------------------------------------
155
155
 
156
156
  /**
157
157
  * Policy rules for context selection.
@@ -183,7 +183,7 @@ export const DEFAULT_POLICY: ContextPolicy = {
183
183
  maxFileBytes: 200_000,
184
184
  };
185
185
 
186
- // ─── Compile request ────────────────────────────────────────────────
186
+ // --- Compile request ------------------------------------------------
187
187
 
188
188
  /**
189
189
  * Input to the context compiler.
@@ -199,7 +199,7 @@ export interface ContextCompileRequest {
199
199
  policy?: Partial<ContextPolicy>;
200
200
  }
201
201
 
202
- // ─── Invalidation ───────────────────────────────────────────────────
202
+ // --- Invalidation ---------------------------------------------------
203
203
 
204
204
  /**
205
205
  * Reasons for context invalidation.
@@ -218,7 +218,7 @@ export interface ContextInvalidation {
218
218
  details?: Record<string, unknown>;
219
219
  }
220
220
 
221
- // ─── Error codes ────────────────────────────────────────────────────
221
+ // --- Error codes ----------------------------------------------------
222
222
 
223
223
  export type ContextCompileErrorCode =
224
224
  | "MISSING_REQUIRED_SOURCE"
@@ -33,7 +33,7 @@ import type {
33
33
  ContextPolicy,
34
34
  } from "../src/types.js";
35
35
 
36
- // ─── Test fixtures ───────────────────────────────────────────────────────
36
+ // --- Test fixtures -------------------------------------------------------
37
37
 
38
38
  function makeCandidate(
39
39
  overrides?: Partial<ContextCandidate>,
@@ -64,7 +64,7 @@ function makeRequest(
64
64
  };
65
65
  }
66
66
 
67
- // ─── AC-1: Required project rules always included ────────────────────────
67
+ // --- AC-1: Required project rules always included ------------------------
68
68
 
69
69
  describe("AC-1: Required project rules always included", () => {
70
70
  it("includes required project_rule even when budget is tiny", async () => {
@@ -111,7 +111,7 @@ describe("AC-1: Required project rules always included", () => {
111
111
  });
112
112
  });
113
113
 
114
- // ─── AC-2: .env content denied ──────────────────────────────────────────
114
+ // --- AC-2: .env content denied ------------------------------------------
115
115
 
116
116
  describe("AC-2: .env content denied by policy", () => {
117
117
  it("denies .env file content", () => {
@@ -161,7 +161,7 @@ describe("AC-2: .env content denied by policy", () => {
161
161
  });
162
162
  });
163
163
 
164
- // ─── AC-3: Broken optional OKF link does not fail compilation ─────────────
164
+ // --- AC-3: Broken optional OKF link does not fail compilation -------------
165
165
 
166
166
  describe("AC-3: Broken optional OKF link does not fail compilation", () => {
167
167
  it("does not throw when optional OKF has no content", async () => {
@@ -189,7 +189,7 @@ describe("AC-3: Broken optional OKF link does not fail compilation", () => {
189
189
  });
190
190
  });
191
191
 
192
- // ─── AC-4: Broken required source fails compilation ──────────────────────
192
+ // --- AC-4: Broken required source fails compilation ----------------------
193
193
 
194
194
  describe("AC-4: Broken required source fails compilation", () => {
195
195
  it("throws MISSING_REQUIRED_SOURCE when required source has no content", async () => {
@@ -227,7 +227,7 @@ describe("AC-4: Broken required source fails compilation", () => {
227
227
  });
228
228
  });
229
229
 
230
- // ─── AC-5: Duplicate source slices merged ───────────────────────────────
230
+ // --- AC-5: Duplicate source slices merged -------------------------------
231
231
 
232
232
  describe("AC-5: Duplicate source slices merged", () => {
233
233
  it("merges slices from the same file", () => {
@@ -319,7 +319,7 @@ describe("AC-5: Duplicate source slices merged", () => {
319
319
  });
320
320
  });
321
321
 
322
- // ─── AC-6: Context under token budget ───────────────────────────────────
322
+ // --- AC-6: Context under token budget -----------------------------------
323
323
 
324
324
  describe("AC-6: Context remains under requested token budget", () => {
325
325
  it("fits within budget when content is small enough", async () => {
@@ -380,7 +380,7 @@ describe("AC-6: Context remains under requested token budget", () => {
380
380
  });
381
381
  });
382
382
 
383
- // ─── AC-7: Changed file hash invalidates cache ───────────────────────────
383
+ // --- AC-7: Changed file hash invalidates cache ---------------------------
384
384
 
385
385
  describe("AC-7: Changed file hash invalidates cache", () => {
386
386
  it("source_hash_changed invalidates when hash differs", () => {
@@ -478,7 +478,7 @@ describe("AC-7: Changed file hash invalidates cache", () => {
478
478
  });
479
479
  });
480
480
 
481
- // ─── AC-8: Identical repo state → identical compiled context ─────────────
481
+ // --- AC-8: Identical repo state → identical compiled context -------------
482
482
 
483
483
  describe("AC-8: Identical repository state produces identical compiled context", () => {
484
484
  it("same candidates produce same cache key", () => {
@@ -550,7 +550,7 @@ describe("AC-8: Identical repository state produces identical compiled context",
550
550
  });
551
551
  });
552
552
 
553
- // ─── AC-9: Omitted items include explicit reasons ──────────────────────
553
+ // --- AC-9: Omitted items include explicit reasons ----------------------
554
554
 
555
555
  describe("AC-9: Omitted items include explicit reasons", () => {
556
556
  it("policy denied items have reason=policy_denied", async () => {
@@ -619,7 +619,7 @@ describe("AC-9: Omitted items include explicit reasons", () => {
619
619
  });
620
620
  });
621
621
 
622
- // ─── Additional coverage ─────────────────────────────────────────────────
622
+ // --- Additional coverage -------------------------------------------------
623
623
 
624
624
  describe("mergePolicy", () => {
625
625
  it("merges user policy with defaults", () => {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/context-discovery",
3
- "version": "0.9.24",
3
+ "version": "0.9.25",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/context-manager",
3
- "version": "0.9.24",
3
+ "version": "0.9.25",
4
4
  "description": "Context Window Manager — prevents model context overflow via compaction and resume prompts (RFC-0010)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,20 +1,20 @@
1
1
  # @pi-harness/cookie-sanitizer
2
2
 
3
- > Forgiving input → strict canonical cache for provider-quota mirroring.
3
+ > Forgiving input -> strict canonical cache for provider-quota mirroring.
4
4
 
5
5
  A normalization boundary that lets users drop **any** cookie file (any name, any format) into a known folder, and turns it into a single standard Netscape file the rest of the runtime can rely on.
6
6
 
7
7
  ```
8
- ~/.pi-harness-runtime/cookies/ ← user drops anything here
9
- │
8
+ ~/.pi-harness-runtime/cookies/ <- user drops anything here
9
+ |
10
10
  ▼
11
- Cookie Sanitizer ← THIS PACKAGE
12
- │
11
+ Cookie Sanitizer <- THIS PACKAGE
12
+ |
13
13
  ▼
14
- ~/.config/<provider>-cookies.txt ← canonical, runtime-owned
15
- │
14
+ ~/.config/<provider>-cookies.txt <- canonical, runtime-owned
15
+ |
16
16
  ▼
17
- MiniMaxQuotaScraper (unchanged) ← reads only the canonical
17
+ MiniMaxQuotaScraper (unchanged) <- reads only the canonical
18
18
  ```
19
19
 
20
20
  ## Why
@@ -30,8 +30,8 @@ The previous design expected users to know the exact path (`~/.config/minimax-co
30
30
 
31
31
  **File names** — any name in the drop folder. Inference prefers:
32
32
 
33
- 1. Filename hint (`minimax-*.txt`, `*claude*`, etc.) → provider
34
- 2. Dominant cookie domain (≥ 80% match) → provider
33
+ 1. Filename hint (`minimax-*.txt`, `*claude*`, etc.) -> provider
34
+ 2. Dominant cookie domain (≥ 80% match) -> provider
35
35
  3. `providerHint` option overrides all of the above
36
36
 
37
37
  **Provider scope** — currently shipping with: `minimax`, `anthropic`, `openai`, `glm`, `openrouter`. The registry is open and inference by domain works for any provider whose cookies are in the drop folder.
@@ -46,7 +46,7 @@ import { sync } from "@pi-harness/cookie-sanitizer";
46
46
  const result = sync();
47
47
 
48
48
  if (result.wrote) {
49
- console.log(`Synced ${result.totalCookies} cookies for ${result.provider} → ${result.cachePath}`);
49
+ console.log(`Synced ${result.totalCookies} cookies for ${result.provider} -> ${result.cachePath}`);
50
50
  } else {
51
51
  console.log(`No-op: ${result.errors[0]?.message ?? "nothing to sync"}`);
52
52
  }
@@ -60,7 +60,7 @@ import { CookieWatcher } from "@pi-harness/cookie-sanitizer";
60
60
  const watcher = new CookieWatcher({
61
61
  dropDir: "~/.pi-harness-runtime/cookies",
62
62
  onEvent: (e) => {
63
- if (e.kind === "sync-ok") console.log(`Synced ${e.cookies} cookies → ${e.cachePath}`);
63
+ if (e.kind === "sync-ok") console.log(`Synced ${e.cookies} cookies -> ${e.cachePath}`);
64
64
  if (e.kind === "sync-error") console.error(`Sync error: ${e.message}`);
65
65
  },
66
66
  });
@@ -115,23 +115,23 @@ bun test test/sync.test.ts
115
115
 
116
116
  ```
117
117
  src/
118
- ├── index.ts # public API surface
119
- ├── types.ts # canonical types
120
- ├── detect-format.ts # Netscape vs JSON detection
121
- ├── parse-netscape.ts # Netscape parser + serializer
122
- ├── parse-json.ts # EditThisCookie JSON parser
123
- ├── normalize.ts # dedupe, expire, domain-match
124
- ├── infer-provider.ts # filename + domain inference
125
- ├── atomic-write.ts # POSIX atomic write
126
- ├── sync.ts # orchestrator
127
- └── watcher.ts # chokidar v5 wrapper
118
+ +-- index.ts # public API surface
119
+ +-- types.ts # canonical types
120
+ +-- detect-format.ts # Netscape vs JSON detection
121
+ +-- parse-netscape.ts # Netscape parser + serializer
122
+ +-- parse-json.ts # EditThisCookie JSON parser
123
+ +-- normalize.ts # dedupe, expire, domain-match
124
+ +-- infer-provider.ts # filename + domain inference
125
+ +-- atomic-write.ts # POSIX atomic write
126
+ +-- sync.ts # orchestrator
127
+ +-- watcher.ts # chokidar v5 wrapper
128
128
 
129
129
  test/
130
- ├── parse.test.ts # 14 cases — Netscape + JSON
131
- ├── normalize.test.ts # 12 cases — dedupe/expire/domain
132
- ├── infer.test.ts # 13 cases — filename + domain + combined
133
- ├── sync.test.ts # 12 cases — end-to-end
134
- └── watcher.test.ts # 2 cases — config sanity (chokidar is exercised live)
130
+ +-- parse.test.ts # 14 cases — Netscape + JSON
131
+ +-- normalize.test.ts # 12 cases — dedupe/expire/domain
132
+ +-- infer.test.ts # 13 cases — filename + domain + combined
133
+ +-- sync.test.ts # 12 cases — end-to-end
134
+ +-- watcher.test.ts # 2 cases — config sanity (chokidar is exercised live)
135
135
  ```
136
136
 
137
137
  ## Limitations
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/cookie-sanitizer",
3
- "version": "0.9.24",
3
+ "version": "0.9.25",
4
4
  "description": "pi-harness-runtime — cookie sanitizer (provider-quota cookie file normaliser)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/cost-optimizer",
3
- "version": "0.9.24",
3
+ "version": "0.9.25",
4
4
  "description": "Cost Optimizer for pi-harness-runtime — budget tracking, forecasting, and model selection optimization",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -5,7 +5,7 @@
5
5
  // Re-export Currency type
6
6
  export type Currency = "USD" | "THB";
7
7
 
8
- // ─── Cost Entry Types ─────────────────────────────────────────────────
8
+ // --- Cost Entry Types -------------------------------------------------
9
9
 
10
10
  export interface CostEntry {
11
11
  id: string;
@@ -20,7 +20,7 @@ export interface CostEntry {
20
20
  timestamp: string;
21
21
  }
22
22
 
23
- // ─── Budget Types ─────────────────────────────────────────────────────
23
+ // --- Budget Types -----------------------------------------------------
24
24
 
25
25
  export interface CostBudget {
26
26
  daily?: number;
@@ -53,7 +53,7 @@ export interface CostPeriod {
53
53
  type: "day" | "week" | "month" | "custom";
54
54
  }
55
55
 
56
- // ─── Optimization Types ────────────────────────────────────────────────
56
+ // --- Optimization Types ------------------------------------------------
57
57
 
58
58
  export interface CostOptimizerConfig {
59
59
  defaultBudget: CostBudget;
@@ -99,7 +99,7 @@ export interface OptimizedSelection {
99
99
  tradeoffs: string[];
100
100
  }
101
101
 
102
- // ─── Optimizer Interface ─────────────────────────────────────────────
102
+ // --- Optimizer Interface ---------------------------------------------
103
103
 
104
104
  export interface CostOptimizer {
105
105
  trackCost(entry: Omit<CostEntry, "id" | "timestamp">): CostEntry;
@@ -118,7 +118,7 @@ export interface CostOptimizer {
118
118
  ): OptimizedSelection[];
119
119
  }
120
120
 
121
- // ─── Event Types ─────────────────────────────────────────────────────
121
+ // --- Event Types -----------------------------------------------------
122
122
 
123
123
  export type CostOptimizerEvent =
124
124
  | { type: "cost.tracked"; entryId: string; cost: number; total: number }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/dependency-analyzer",
3
- "version": "0.9.24",
3
+ "version": "0.9.25",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "exports": {
@@ -6,7 +6,7 @@
6
6
  import { existsSync } from "node:fs";
7
7
  import { readdir, readFile } from "node:fs/promises";
8
8
  import { join } from "node:path";
9
- // ─── Detection ───────────────────────────────────────────────────────────────
9
+ // --- Detection ---------------------------------------------------------------
10
10
  function isDjangoWorkspace(root) {
11
11
  return (existsSync(join(root, "manage.py")) ||
12
12
  (existsSync(join(root, "settings.py")) &&
@@ -14,7 +14,7 @@ function isDjangoWorkspace(root) {
14
14
  (existsSync(join(root, "requirements.txt")) &&
15
15
  existsSync(join(root, "manage.py"))));
16
16
  }
17
- // ─── Version ────────────────────────────────────────────────────────────────
17
+ // --- Version ----------------------------------------------------------------
18
18
  async function detectVersion(root) {
19
19
  try {
20
20
  const content = await readFile(join(root, "requirements.txt"), "utf-8");
@@ -42,7 +42,7 @@ async function detectVersion(root) {
42
42
  }
43
43
  return undefined;
44
44
  }
45
- // ─── Settings Parser ─────────────────────────────────────────────────────────
45
+ // --- Settings Parser ---------------------------------------------------------
46
46
  async function parseSettings(root) {
47
47
  const installedApps = [];
48
48
  const middleware = [];
@@ -90,7 +90,7 @@ async function parseSettings(root) {
90
90
  }
91
91
  return { installedApps, middleware };
92
92
  }
93
- // ─── Django App Scanner ─────────────────────────────────────────────────────
93
+ // --- Django App Scanner -----------------------------------------------------
94
94
  async function scanDjangoApps(root) {
95
95
  const apps = [];
96
96
  // Django project apps can be:
@@ -153,7 +153,7 @@ async function scanDjangoApps(root) {
153
153
  }
154
154
  return apps;
155
155
  }
156
- // ─── Management Commands ────────────────────────────────────────────────────
156
+ // --- Management Commands ----------------------------------------------------
157
157
  async function findManagementCommands(root) {
158
158
  const commands = [];
159
159
  // Simple recursive scan for management/commands directories
@@ -191,7 +191,7 @@ async function findManagementCommands(root) {
191
191
  }
192
192
  return [...new Set(commands)];
193
193
  }
194
- // ─── Requirements ───────────────────────────────────────────────────────────
194
+ // --- Requirements -----------------------------------------------------------
195
195
  async function parseRequirements(root) {
196
196
  const reqPath = join(root, "requirements.txt");
197
197
  if (!existsSync(reqPath))
@@ -208,7 +208,7 @@ async function parseRequirements(root) {
208
208
  return [];
209
209
  }
210
210
  }
211
- // ─── Main Analyzer ─────────────────────────────────────────────────────────
211
+ // --- Main Analyzer ---------------------------------------------------------
212
212
  export async function analyzeDjango(root) {
213
213
  if (!isDjangoWorkspace(root))
214
214
  return null;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/django-plugin",
3
- "version": "0.9.24",
3
+ "version": "0.9.25",
4
4
  "description": "Django framework analysis — models, management commands, settings",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -9,7 +9,7 @@ import { readdir, readFile } from "node:fs/promises";
9
9
  import { join } from "node:path";
10
10
  import type { DjangoAnalysis, DjangoApp, ConfigFile } from "./types.js";
11
11
 
12
- // ─── Detection ───────────────────────────────────────────────────────────────
12
+ // --- Detection ---------------------------------------------------------------
13
13
 
14
14
  function isDjangoWorkspace(root: string): boolean {
15
15
  return (
@@ -21,7 +21,7 @@ function isDjangoWorkspace(root: string): boolean {
21
21
  );
22
22
  }
23
23
 
24
- // ─── Version ────────────────────────────────────────────────────────────────
24
+ // --- Version ----------------------------------------------------------------
25
25
 
26
26
  async function detectVersion(root: string): Promise<string | undefined> {
27
27
  try {
@@ -48,7 +48,7 @@ async function detectVersion(root: string): Promise<string | undefined> {
48
48
  return undefined;
49
49
  }
50
50
 
51
- // ─── Settings Parser ─────────────────────────────────────────────────────────
51
+ // --- Settings Parser ---------------------------------------------------------
52
52
 
53
53
  async function parseSettings(root: string): Promise<{
54
54
  installedApps: string[];
@@ -110,7 +110,7 @@ async function parseSettings(root: string): Promise<{
110
110
  return { installedApps, middleware };
111
111
  }
112
112
 
113
- // ─── Django App Scanner ─────────────────────────────────────────────────────
113
+ // --- Django App Scanner -----------------------------------------------------
114
114
 
115
115
  async function scanDjangoApps(root: string): Promise<DjangoApp[]> {
116
116
  const apps: DjangoApp[] = [];
@@ -180,7 +180,7 @@ async function scanDjangoApps(root: string): Promise<DjangoApp[]> {
180
180
  return apps;
181
181
  }
182
182
 
183
- // ─── Management Commands ────────────────────────────────────────────────────
183
+ // --- Management Commands ----------------------------------------------------
184
184
 
185
185
  async function findManagementCommands(root: string): Promise<string[]> {
186
186
  const commands: string[] = [];
@@ -219,7 +219,7 @@ async function findManagementCommands(root: string): Promise<string[]> {
219
219
  return [...new Set(commands)];
220
220
  }
221
221
 
222
- // ─── Requirements ───────────────────────────────────────────────────────────
222
+ // --- Requirements -----------------------------------------------------------
223
223
 
224
224
  async function parseRequirements(root: string): Promise<string[]> {
225
225
  const reqPath = join(root, "requirements.txt");
@@ -237,7 +237,7 @@ async function parseRequirements(root: string): Promise<string[]> {
237
237
  }
238
238
  }
239
239
 
240
- // ─── Main Analyzer ─────────────────────────────────────────────────────────
240
+ // --- Main Analyzer ---------------------------------------------------------
241
241
 
242
242
  export async function analyzeDjango(
243
243
  root: string,
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/doc-generator",
3
- "version": "0.9.24",
3
+ "version": "0.9.25",
4
4
  "description": "Auto-Doc Generator — generate documentation from source code (RFC-0014)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -5,7 +5,7 @@
5
5
  */
6
6
  import { randomUUID } from "node:crypto";
7
7
  import { DEFAULT_SCORING_WEIGHTS } from "./types.js";
8
- // ─── Evidence Collection ───────────────────────────────────────────────────────
8
+ // --- Evidence Collection -------------------------------------------------------
9
9
  function collectEvidence(outputs, testResults, policyFindings) {
10
10
  const evidence = [];
11
11
  // Add test results as evidence
@@ -38,7 +38,7 @@ function collectEvidence(outputs, testResults, policyFindings) {
38
38
  }
39
39
  return evidence;
40
40
  }
41
- // ─── Missing Output Detection ──────────────────────────────────────────────────
41
+ // --- Missing Output Detection --------------------------------------------------
42
42
  function findMissingOutputs(requiredArtifacts, outputs) {
43
43
  const findings = [];
44
44
  const outputPaths = new Set(outputs.filter((o) => o.path).map((o) => o.path));
@@ -57,7 +57,7 @@ function findMissingOutputs(requiredArtifacts, outputs) {
57
57
  }
58
58
  return findings;
59
59
  }
60
- // ─── Test Analysis ────────────────────────────────────────────────────────────
60
+ // --- Test Analysis ------------------------------------------------------------
61
61
  function analyzeTests(testResults) {
62
62
  const findings = [];
63
63
  let passedCount = 0;
@@ -87,7 +87,7 @@ function analyzeTests(testResults) {
87
87
  }
88
88
  return { findings, passedCount, totalCount, hasFailures };
89
89
  }
90
- // ─── Policy Analysis ──────────────────────────────────────────────────────────
90
+ // --- Policy Analysis ----------------------------------------------------------
91
91
  function analyzePolicies(policyFindings) {
92
92
  const findings = [];
93
93
  const criticalFindings = [];
@@ -106,7 +106,7 @@ function analyzePolicies(policyFindings) {
106
106
  }
107
107
  return { findings, criticalFindings };
108
108
  }
109
- // ─── Acceptance Criteria Coverage ─────────────────────────────────────────────
109
+ // --- Acceptance Criteria Coverage ---------------------------------------------
110
110
  function analyzeAcceptanceCoverage(acceptanceCriteria, outputs, testResults) {
111
111
  const findings = [];
112
112
  const coveredCriteria = [];
@@ -148,7 +148,7 @@ function analyzeAcceptanceCoverage(acceptanceCriteria, outputs, testResults) {
148
148
  : 100;
149
149
  return { findings, coverage, unmetCriteria };
150
150
  }
151
- // ─── Scoring ─────────────────────────────────────────────────────────────────
151
+ // --- Scoring -----------------------------------------------------------------
152
152
  function calculateScore(weights, testAnalysis, acceptanceCoverage, criticalPolicies, securityFindings, regressionFindings) {
153
153
  const breakdown = {};
154
154
  // Correctness (30%) - based on missing outputs
@@ -188,7 +188,7 @@ function calculateScore(weights, testAnalysis, acceptanceCoverage, criticalPolic
188
188
  regressionPenalty));
189
189
  return { score: Math.round(totalScore), breakdown };
190
190
  }
191
- // ─── Failure Classification ───────────────────────────────────────────────────
191
+ // --- Failure Classification ---------------------------------------------------
192
192
  function classifyFailure(findings) {
193
193
  const classes = [];
194
194
  for (const finding of findings) {
@@ -226,7 +226,7 @@ function classifyFailure(findings) {
226
226
  }
227
227
  return classes;
228
228
  }
229
- // ─── Main Engine ───────────────────────────────────────────────────────────────
229
+ // --- Main Engine ---------------------------------------------------------------
230
230
  export class EvaluationEngine {
231
231
  weights;
232
232
  state = "pending";
@@ -337,7 +337,7 @@ export class EvaluationEngine {
337
337
  this.state = "pending";
338
338
  }
339
339
  }
340
- // ─── Factory ─────────────────────────────────────────────────────────────────
340
+ // --- Factory -----------------------------------------------------------------
341
341
  export function createEvaluationEngine(weights) {
342
342
  return new EvaluationEngine(weights);
343
343
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/evaluation-engine",
3
- "version": "0.9.24",
3
+ "version": "0.9.25",
4
4
  "description": "Evaluation engine for pi-harness runtime (RFC-0057)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",