principles-disciple 1.112.0 → 1.113.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.
@@ -2,7 +2,7 @@
2
2
  "id": "principles-disciple",
3
3
  "name": "Principles Disciple",
4
4
  "description": "Evolutionary programming agent framework with strategic guardrails and reflection loops.",
5
- "version": "1.112.0",
5
+ "version": "1.113.0",
6
6
  "activation": {
7
7
  "onCapabilities": [
8
8
  "hook"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "principles-disciple",
3
- "version": "1.112.0",
3
+ "version": "1.113.0",
4
4
  "description": "Native OpenClaw plugin for Principles Disciple",
5
5
  "type": "module",
6
6
  "main": "./dist/bundle.js",
@@ -45,6 +45,28 @@ function formatRunOnceCommand(workspaceDir: string): string {
45
45
  return `pd runtime internalization run-once --workspace "${workspaceDir}" --runner dreamer --runtime config --json`;
46
46
  }
47
47
 
48
+ function getNextActionForError(category?: string): string {
49
+ if (category === 'lease_conflict') {
50
+ return 'Retry later or check for concurrent worker processes.';
51
+ }
52
+ if (category === 'timeout') {
53
+ return 'Check model provider service status/latency, or increase timeout settings in workflows.yaml.';
54
+ }
55
+ if (category === 'cancelled') {
56
+ return 'Re-enqueue or restart the task if it was cancelled by mistake.';
57
+ }
58
+ if (category === 'output_invalid') {
59
+ return 'Verify if model outputs conform to expected schema and adjust prompt or validation templates if needed.';
60
+ }
61
+ if (category === 'input_invalid') {
62
+ return 'Check predecessor task outputs and database integrity for malformed input references.';
63
+ }
64
+ if (category === 'max_attempts_exceeded') {
65
+ return 'Investigate persistent failures, correct the root issue, and clear last_error or reset attempt count.';
66
+ }
67
+ return 'Run: pd runtime internalization run-once --runner dreamer --runtime config --json to isolate the failure.';
68
+ }
69
+
48
70
  async function runConsumerCycle(
49
71
  workspaceDir: string,
50
72
  logger: PluginLogger,
@@ -105,6 +127,10 @@ async function runConsumerCycle(
105
127
  });
106
128
  const snapshot = await readModel.getSnapshot();
107
129
 
130
+ if (snapshot.readyTasks.length > 5) {
131
+ logger.warn(`[PD:AutoConsumer] Backlog detected: ${snapshot.readyTasks.length} tasks ready. Processing only one task.`);
132
+ }
133
+
108
134
  const decision = computeConsumerDecision({
109
135
  autoConsumerEnabled: true,
110
136
  readyTaskCount: snapshot.readyTasks.length,
@@ -120,12 +146,12 @@ async function runConsumerCycle(
120
146
 
121
147
  const orchestrator = new InternalizationOrchestrator(
122
148
  { stateManager },
123
- { owner: 'auto-consumer', runtimeKind: 'config', dryRun: false },
149
+ { owner: 'auto-consumer', runtimeKind: 'config', dryRun: true },
124
150
  );
125
151
 
126
152
  const wakeResult = await orchestrator.wakeOnce('dreamer');
127
153
 
128
- if (wakeResult.decision !== 'leased') {
154
+ if (wakeResult.decision !== 'would_lease') {
129
155
  const skipPayload: Record<string, unknown> = {
130
156
  decision: wakeResult.decision,
131
157
  };
@@ -182,11 +208,19 @@ async function runConsumerCycle(
182
208
  `[PD:AutoConsumer] Task ${taskId} succeeded. Successor: ${commitResult.decision}`,
183
209
  );
184
210
  } else {
211
+ const errorCategory = runResult.errorCategory;
212
+ const failureReason = runResult.failureReason;
213
+ const nextAction = getNextActionForError(errorCategory);
185
214
  SystemLogger.log(workspaceDir, 'INTERNALIZATION_CONSUMER_TASK_FAILED', JSON.stringify({
186
215
  taskId,
187
216
  status: runResult.status,
217
+ errorCategory,
218
+ failureReason,
219
+ nextAction,
188
220
  }));
189
- logger.warn(`[PD:AutoConsumer] Task ${taskId} status: ${runResult.status}`);
221
+ logger.warn(
222
+ `[PD:AutoConsumer] Task ${taskId} status: ${runResult.status}. Category: ${errorCategory}. Reason: ${failureReason}. Next Action: ${nextAction}`
223
+ );
190
224
  }
191
225
  } catch (err) {
192
226
  SystemLogger.log(workspaceDir, 'INTERNALIZATION_CONSUMER_ERROR', String(err));