pi-harness-runtime 1.1.508 → 1.1.509

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 (61) hide show
  1. package/CHANGELOG.md +87 -0
  2. package/harness/auto-resume-marker.ts +55 -13
  3. package/harness/scope-expansion-runtime.ts +142 -15
  4. package/harness/scope-expansion.ts +150 -35
  5. package/index.ts +130 -42
  6. package/package.json +1 -1
  7. package/packages/agent-policy/package.json +1 -1
  8. package/packages/auth/package.json +1 -1
  9. package/packages/autonomous-runtime/package.json +1 -1
  10. package/packages/checkpoint/package.json +1 -1
  11. package/packages/clipboard/package.json +1 -1
  12. package/packages/codex-watcher/package.json +1 -1
  13. package/packages/config-capture/package.json +1 -1
  14. package/packages/contracts/package.json +1 -1
  15. package/packages/cookie-sanitizer/package.json +1 -1
  16. package/packages/evaluation-engine/package.json +1 -1
  17. package/packages/event-bus/package.json +1 -1
  18. package/packages/event-store/package.json +1 -1
  19. package/packages/experience-replay/package.json +1 -1
  20. package/packages/file-copy-helper/package.json +1 -1
  21. package/packages/intent-analyzer/package.json +1 -1
  22. package/packages/jev-judge/package.json +1 -1
  23. package/packages/knowledge-retrieval/package.json +1 -1
  24. package/packages/learning-engine/package.json +1 -1
  25. package/packages/logging/package.json +1 -1
  26. package/packages/memory-engine/package.json +1 -1
  27. package/packages/notification/dist/notification-center.d.ts +8 -4
  28. package/packages/notification/dist/notification-center.d.ts.map +1 -1
  29. package/packages/notification/dist/notification-center.js +18 -9
  30. package/packages/notification/dist/notification-center.js.map +1 -1
  31. package/packages/notification/dist/notification-policy.d.ts.map +1 -1
  32. package/packages/notification/dist/notification-policy.js +3 -0
  33. package/packages/notification/dist/notification-policy.js.map +1 -1
  34. package/packages/notification/dist/pending-question.d.ts +20 -1
  35. package/packages/notification/dist/pending-question.d.ts.map +1 -1
  36. package/packages/notification/dist/pending-question.js +9 -3
  37. package/packages/notification/dist/pending-question.js.map +1 -1
  38. package/packages/notification/package.json +1 -1
  39. package/packages/notification/src/notification-center.ts +18 -9
  40. package/packages/notification/src/notification-policy.ts +3 -0
  41. package/packages/notification/src/pending-question.ts +28 -2
  42. package/packages/paperclip-integration/package.json +1 -1
  43. package/packages/performance-optimizer/package.json +1 -1
  44. package/packages/privilege-broker/package.json +1 -1
  45. package/packages/prompt-compiler/package.json +1 -1
  46. package/packages/providers/package.json +1 -1
  47. package/packages/qdrant-skills/package.json +1 -1
  48. package/packages/quota-manager/package.json +1 -1
  49. package/packages/relay/package.json +1 -1
  50. package/packages/skill-mcp-client/package.json +1 -1
  51. package/packages/skills/package.json +1 -1
  52. package/packages/todo-bd-sync/package.json +1 -1
  53. package/packages/token-estimation/package.json +1 -1
  54. package/packages/tooling-preference/package.json +1 -1
  55. package/packages/trajectory/package.json +1 -1
  56. package/packages/tui/package.json +1 -1
  57. package/packages/two-phase-review/package.json +1 -1
  58. package/packages/types/package.json +1 -1
  59. package/packages/webmcp-tester/package.json +1 -1
  60. package/packages/wiki/package.json +1 -1
  61. package/packages/write-review/package.json +1 -1
@@ -140,14 +140,18 @@ export class NotificationCenter {
140
140
 
141
141
  /**
142
142
  * Track a new pending approval request
143
+ *
144
+ * The key is the canonical question id: the buttons of the notification
145
+ * carry it, and it is what a callback looks the approval up with. A
146
+ * notification without a question id is keyed by its job id.
143
147
  */
144
148
  trackPendingApproval(
145
- jobId: string,
149
+ questionId: string,
146
150
  event: NotificationEvent,
147
151
  context: NotificationContext,
148
152
  ): void {
149
- this.pendingApprovals.set(jobId, {
150
- jobId,
153
+ this.pendingApprovals.set(questionId, {
154
+ jobId: context.jobId,
151
155
  event,
152
156
  context,
153
157
  createdAt: new Date(),
@@ -160,10 +164,10 @@ export class NotificationCenter {
160
164
  * @returns true if the request was found and resolved, false otherwise
161
165
  */
162
166
  resolvePendingApproval(
163
- jobId: string,
167
+ questionId: string,
164
168
  result: "approved" | "rejected",
165
169
  ): boolean {
166
- const pending = this.pendingApprovals.get(jobId);
170
+ const pending = this.pendingApprovals.get(questionId);
167
171
  if (!pending || pending.resolved) {
168
172
  return false;
169
173
  }
@@ -175,15 +179,15 @@ export class NotificationCenter {
175
179
  /**
176
180
  * Get a pending approval request
177
181
  */
178
- getPendingApproval(jobId: string): PendingApproval | undefined {
179
- return this.pendingApprovals.get(jobId);
182
+ getPendingApproval(questionId: string): PendingApproval | undefined {
183
+ return this.pendingApprovals.get(questionId);
180
184
  }
181
185
 
182
186
  /**
183
187
  * Check if a pending approval exists and is unresolved
184
188
  */
185
- isPendingApproval(jobId: string): boolean {
186
- const pending = this.pendingApprovals.get(jobId);
189
+ isPendingApproval(questionId: string): boolean {
190
+ const pending = this.pendingApprovals.get(questionId);
187
191
  return !!pending && !pending.resolved;
188
192
  }
189
193
 
@@ -605,6 +609,11 @@ export class NotificationCenter {
605
609
  jobId: context.jobId,
606
610
  ...(context.questionId && { questionId: context.questionId }),
607
611
  ...(context.questionKind && { questionKind: context.questionKind }),
612
+ // The shared detail format renders the named issues
613
+ // and the deadline of a scope proposal: LINE shows the
614
+ // same facts as every other channel.
615
+ ...(context.scopeIds && { scopeIds: context.scopeIds }),
616
+ ...(context.scopeDeadline && { scopeDeadline: context.scopeDeadline }),
608
617
  _actionButtons: buttons,
609
618
  ...options?.additionalDetails,
610
619
  },
@@ -74,6 +74,9 @@ const HIGH_PRIORITY_EVENTS = new Set([
74
74
  "WaitingForUserInput",
75
75
  "JobFailed",
76
76
  "SystemAlert",
77
+ // A proposal of a new scope is a question that waits for an answer: the
78
+ // policy of the package may not drop it.
79
+ "ScopeProposal",
77
80
  ]);
78
81
 
79
82
  /**
@@ -844,6 +844,15 @@ export class PendingQuestionController {
844
844
  requestId?: string;
845
845
  /** The channel a human answer came from. */
846
846
  channel?: ResolutionChannel;
847
+ /**
848
+ * Notify the callback of the user answer.
849
+ *
850
+ * A question that is not a question of the work - a proposal of the
851
+ * backlog, for example - is answered by the human without becoming an
852
+ * answer of the request: the callback would clear the wait of the
853
+ * request and steer an answer into the conversation.
854
+ */
855
+ notifyUser?: boolean;
847
856
  }): boolean {
848
857
  if (!this.currentQuestion) {
849
858
  logWarn("[PendingQuestion]", "No question to resolve - no pending question");
@@ -896,7 +905,7 @@ export class PendingQuestionController {
896
905
  eligible: true,
897
906
  });
898
907
  }
899
- } else if (this.userAnswerCallback) {
908
+ } else if (this.userAnswerCallback && params.notifyUser !== false) {
900
909
  this.userAnswerCallback(this.currentQuestion, params.resolution);
901
910
  }
902
911
 
@@ -1049,13 +1058,30 @@ export class PendingQuestionController {
1049
1058
  action: string,
1050
1059
  requestId: string,
1051
1060
  channel: ResolutionChannel,
1061
+ options?: {
1062
+ /**
1063
+ * Notify the callback of the user answer.
1064
+ *
1065
+ * A question that is not a question of the work of the request - a
1066
+ * proposal of the backlog - is answered without an answer of the
1067
+ * request: the callback would clear the wait of the request and steer
1068
+ * an answer into the conversation.
1069
+ */
1070
+ notifyUser?: boolean;
1071
+ },
1052
1072
  ): { applied: boolean; resolution?: "yes" | "no"; reason?: string } {
1053
1073
  if (action !== "approve" && action !== "reject") {
1054
1074
  return { applied: false, reason: `unknown action '${action}'` };
1055
1075
  }
1056
1076
 
1057
1077
  const resolution = action === "approve" ? "yes" : "no";
1058
- const applied = this.resolve({ resolution, by: "user", requestId, channel });
1078
+ const applied = this.resolve({
1079
+ resolution,
1080
+ by: "user",
1081
+ requestId,
1082
+ channel,
1083
+ ...(options?.notifyUser === false && { notifyUser: false }),
1084
+ });
1059
1085
 
1060
1086
  return applied
1061
1087
  ? { applied: true, resolution }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/paperclip-integration",
3
- "version": "1.1.508",
3
+ "version": "1.1.509",
4
4
  "description": "Paperclip API integration: poll agent inbox, route tasks to pi.dev, Telegram alerts",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/performance-optimizer",
3
- "version": "1.1.508",
3
+ "version": "1.1.509",
4
4
  "description": "Performance optimization analyzer for pi-harness runtime (RFC-0056)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/privilege-broker",
3
- "version": "1.1.508",
3
+ "version": "1.1.509",
4
4
  "description": "Privilege Broker — capability registry and command executor for autonomous runtime (RFC-0101 §7)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/prompt-compiler",
3
- "version": "1.1.508",
3
+ "version": "1.1.509",
4
4
  "description": "Deterministic prompt compiler for pi-harness-runtime",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/providers",
3
- "version": "1.1.508",
3
+ "version": "1.1.509",
4
4
  "description": "pi-harness-runtime — providers",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/qdrant-skills",
3
- "version": "1.1.508",
3
+ "version": "1.1.509",
4
4
  "description": "Qdrant vector search integration for Hermes-style skill system",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/quota-manager",
3
- "version": "1.1.508",
3
+ "version": "1.1.509",
4
4
  "description": "pi-harness-runtime — quota-manager",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/relay",
3
- "version": "1.1.508",
3
+ "version": "1.1.509",
4
4
  "type": "module",
5
5
  "description": "Cloud relay for remote access - T3 Connect style for pi-harness",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi/skill-mcp-client",
3
- "version": "1.1.508",
3
+ "version": "1.1.509",
4
4
  "description": "MCP client for Skills SaaS backend",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/skills",
3
- "version": "1.1.508",
3
+ "version": "1.1.509",
4
4
  "description": "File-based skill system with pi.dev compatibility and Hermes self-improvement",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moocoding/todo-bd-sync",
3
- "version": "1.1.508",
3
+ "version": "1.1.509",
4
4
  "description": "Two-way sync between rpiv-todo overlay and bd issue tracker",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/token-estimation",
3
- "version": "1.1.508",
3
+ "version": "1.1.509",
4
4
  "description": "pi-harness-runtime — token-estimation",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/tooling-preference",
3
- "version": "1.1.508",
3
+ "version": "1.1.509",
4
4
  "description": "pi-harness-runtime — JS/TS tooling preference (Biome vs ESLint/Prettier) proposal",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/trajectory",
3
- "version": "1.1.508",
3
+ "version": "1.1.509",
4
4
  "description": "Trajectory capture for the write-review loop — persists cycle records for learning",
5
5
  "type": "module",
6
6
  "main": "./dist/src/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/tui",
3
- "version": "1.1.508",
3
+ "version": "1.1.509",
4
4
  "description": "pi-harness-runtime — tui",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/two-phase-review",
3
- "version": "1.1.508",
3
+ "version": "1.1.509",
4
4
  "description": "pi-harness-runtime — two-phase implementation and review workflow (queue review signals, gate the phase, scope the diff)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/types",
3
- "version": "1.1.508",
3
+ "version": "1.1.509",
4
4
  "description": "Shared TypeScript types for pi-harness-runtime packages",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/webmcp-tester",
3
- "version": "1.1.508",
3
+ "version": "1.1.509",
4
4
  "description": "WebMCP-powered E2E testing for pi-harness - natural language test scenarios",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-harness/wiki",
3
- "version": "1.1.508",
3
+ "version": "1.1.509",
4
4
  "description": "LLM Wiki integration for pi-harness-runtime",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moocoding/write-review",
3
- "version": "1.1.508",
3
+ "version": "1.1.509",
4
4
  "description": "Two-agent write-review loop with blackboard coordination",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",