@caupulican/pi-adaptative 0.81.21 → 0.81.23
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.
- package/CHANGELOG.md +15 -0
- package/dist/core/agent-session.d.ts +3 -1
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +28 -21
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/failure-corpus.d.ts +10 -1
- package/dist/core/failure-corpus.d.ts.map +1 -1
- package/dist/core/failure-corpus.js +32 -26
- package/dist/core/failure-corpus.js.map +1 -1
- package/dist/core/model-router/intent-classifier.d.ts.map +1 -1
- package/dist/core/model-router/intent-classifier.js +1 -1
- package/dist/core/model-router/intent-classifier.js.map +1 -1
- package/dist/core/model-router/route-judge.d.ts.map +1 -1
- package/dist/core/model-router/route-judge.js +10 -6
- package/dist/core/model-router/route-judge.js.map +1 -1
- package/dist/core/model-router/tool-escalation.d.ts.map +1 -1
- package/dist/core/model-router/tool-escalation.js +2 -1
- package/dist/core/model-router/tool-escalation.js.map +1 -1
- package/dist/core/model-router-controller.d.ts.map +1 -1
- package/dist/core/model-router-controller.js +27 -2
- package/dist/core/model-router-controller.js.map +1 -1
- package/dist/core/session-analytics.d.ts +7 -1
- package/dist/core/session-analytics.d.ts.map +1 -1
- package/dist/core/session-analytics.js +42 -11
- package/dist/core/session-analytics.js.map +1 -1
- package/dist/core/settings-manager.d.ts +1 -1
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/tool-recovery-log-records.d.ts +24 -0
- package/dist/core/tool-recovery-log-records.d.ts.map +1 -0
- package/dist/core/tool-recovery-log-records.js +63 -0
- package/dist/core/tool-recovery-log-records.js.map +1 -0
- package/dist/core/tool-recovery-log-worker.d.ts +2 -0
- package/dist/core/tool-recovery-log-worker.d.ts.map +1 -0
- package/dist/core/tool-recovery-log-worker.js +44 -0
- package/dist/core/tool-recovery-log-worker.js.map +1 -0
- package/dist/core/tool-recovery-logger.d.ts +59 -0
- package/dist/core/tool-recovery-logger.d.ts.map +1 -0
- package/dist/core/tool-recovery-logger.js +197 -0
- package/dist/core/tool-recovery-logger.js.map +1 -0
- package/dist/core/tool-repair-health.d.ts +2 -1
- package/dist/core/tool-repair-health.d.ts.map +1 -1
- package/dist/core/tool-repair-health.js +13 -4
- package/dist/core/tool-repair-health.js.map +1 -1
- package/dist/core/tool-repair-settings.d.ts +1 -0
- package/dist/core/tool-repair-settings.d.ts.map +1 -1
- package/dist/core/tool-repair-settings.js +2 -1
- package/dist/core/tool-repair-settings.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +3 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +25 -1
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/docs/settings.md +6 -4
- package/docs/tool-repair.md +8 -7
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/npm-shrinkwrap.json +12 -12
- package/package.json +4 -4
package/docs/settings.md
CHANGED
|
@@ -150,20 +150,22 @@ Fitness applicability is intentionally split by autonomy level:
|
|
|
150
150
|
|
|
151
151
|
| Setting | Type | Default | Description |
|
|
152
152
|
|---------|------|---------|-------------|
|
|
153
|
-
| `toolRepair.repair` | boolean | `true` | Enable deterministic repair of invalid model-emitted tool arguments before execution |
|
|
154
153
|
| `toolRepair.teach` | boolean | `true` | Enable in-band repair teaching notes on repaired tool results |
|
|
155
154
|
| `toolRepair.textProtocol` | boolean | model-dependent | Emergency global override for text tool-call protocol calibration. Prefer per-model `textToolCallProtocol` in `models.json` for deterministic model setup. |
|
|
155
|
+
| `toolRepair.logging` | boolean | `true` | Enable background tool-recovery telemetry/failure-corpus logging. When `false`, repair still runs but Pi does not enqueue or write tool-recovery log records. |
|
|
156
|
+
|
|
157
|
+
Deterministic argument repair is built in and has no settings toggle; schema-valid calls still return unchanged without entering the repair layer. `PI_TOOL_REPAIR_DISABLED=1` remains only an emergency diagnostic kill switch.
|
|
156
158
|
|
|
157
159
|
Text protocol precedence is: `PI_TEXT_TOOL_CALL_PROTOCOL_DISABLED=1` kills it, then `toolRepair.textProtocol` force-enables or disables it globally, then per-model `textToolCallProtocol` applies, then a persisted `/toolprobe` text-protocol verdict applies to that exact model. Native provider tool calls still take precedence when the model emits them; the text protocol is the fallback lane for pure-text models. Failed calibration is stored per host/model and can be cleared with `/toolprotocol-reset <provider/model>`.
|
|
158
160
|
|
|
159
|
-
Environment kill switches override
|
|
161
|
+
Environment kill switches override their diagnostic layers: `PI_TOOL_REPAIR_DISABLED=1`, `PI_TOOL_REPAIR_TEACH_DISABLED=1`, and `PI_TEXT_TOOL_CALL_PROTOCOL_DISABLED=1`. See [Tool repair](tool-repair.md) for diagnostics, reset controls, and replay.
|
|
160
162
|
|
|
161
163
|
```json
|
|
162
164
|
{
|
|
163
165
|
"toolRepair": {
|
|
164
|
-
"repair": true,
|
|
165
166
|
"teach": true,
|
|
166
|
-
"textProtocol": true
|
|
167
|
+
"textProtocol": true,
|
|
168
|
+
"logging": true
|
|
167
169
|
}
|
|
168
170
|
}
|
|
169
171
|
```
|
package/docs/tool-repair.md
CHANGED
|
@@ -6,8 +6,9 @@ Pi validates every model-emitted tool call against its TypeBox schema before exe
|
|
|
6
6
|
|
|
7
7
|
- The shared validation choke point is `validateToolArguments` in `packages/ai/src/utils/validation.ts`.
|
|
8
8
|
- Repair is validate-then-repair: schema-valid arguments are returned unchanged; only invalid arguments enter the repair layer.
|
|
9
|
-
- Repair
|
|
9
|
+
- Repair is built-in and has no settings toggle. `PI_TOOL_REPAIR_DISABLED=1` is only an emergency diagnostic kill switch; normal configuration should leave repair on.
|
|
10
10
|
- Teaching can be disabled independently with `toolRepair.teach: false` or `PI_TOOL_REPAIR_TEACH_DISABLED=1`. Repairs can still execute; the in-band "Tool argument repair note" is suppressed.
|
|
11
|
+
- Tool-recovery logging can be disabled with `toolRepair.logging: false`. Repairs still run, but Pi does not enqueue recovery records or spawn the background recovery-log worker.
|
|
11
12
|
- Text tool-call protocol calibration can be enabled per model with `textToolCallProtocol: true` in `models.json`. `/toolprobe [provider/model]` can also persist a host-local text-protocol verdict for one model after a live probe. Use `toolRepair.textProtocol` only as a global emergency force/kill switch; `PI_TEXT_TOOL_CALL_PROTOCOL_DISABLED=1` always disables it.
|
|
12
13
|
|
|
13
14
|
Example project settings:
|
|
@@ -15,9 +16,9 @@ Example project settings:
|
|
|
15
16
|
```json
|
|
16
17
|
{
|
|
17
18
|
"toolRepair": {
|
|
18
|
-
"repair": true,
|
|
19
19
|
"teach": true,
|
|
20
|
-
"textProtocol": true
|
|
20
|
+
"textProtocol": true,
|
|
21
|
+
"logging": true
|
|
21
22
|
}
|
|
22
23
|
}
|
|
23
24
|
```
|
|
@@ -26,7 +27,7 @@ Example project settings:
|
|
|
26
27
|
|
|
27
28
|
- Interactive tool panels show `[repaired arguments]` when execution used repaired arguments.
|
|
28
29
|
- RPC `tool_execution_start`, `tool_execution_update`, and `tool_execution_end` events include a `repair` object when arguments were repaired.
|
|
29
|
-
- `/toolhealth` prints model adaptation records for this host: tool-probe verdicts, calibrated or failed text protocol, learned standing rules, and
|
|
30
|
+
- `/toolhealth` prints model adaptation records for this host: tool-probe verdicts, calibrated or failed text protocol, learned standing rules, teach statistics, and recovery-log worker counters.
|
|
30
31
|
- `/toolrule-remove <provider/model> <mode>` removes one learned standing rule from the host-local adaptation store.
|
|
31
32
|
- `/toolprotocol-reset <provider/model>` removes a stored text protocol calibration or failed-calibration record so the next turn can calibrate again.
|
|
32
33
|
- `/toolprobe [provider/model]` probes the current fleet or one explicit model for native tool calls first, then text-protocol fallback, persists the verdict in the host-local adaptation store, and prints a report table.
|
|
@@ -42,7 +43,7 @@ node scripts/tool-repair-replay.mjs ~/.pi/agent/state/failure-corpus.jsonl --jso
|
|
|
42
43
|
node scripts/tool-repair-replay.mjs ~/.pi/agent/sessions/<session>.jsonl --fixtures /tmp/tool-repair-fixtures.json
|
|
43
44
|
```
|
|
44
45
|
|
|
45
|
-
The replay helper reads `tool_validation` corpus records and bounced `tool_argument_validation` session entries. Records contain shape metadata, failure modes, and error keywords; they do not store full tool arguments.
|
|
46
|
+
The replay helper reads `tool_validation` corpus records and legacy bounced `tool_argument_validation` session entries. Current recovery telemetry is written by a dedicated `node:worker_threads` worker to `state/tool-recovery-events.jsonl`; bounced records also append sanitized `tool_validation` corpus rows. Records contain shape metadata, failure modes, and error keywords; they do not store full tool arguments.
|
|
46
47
|
|
|
47
48
|
## Repair modes
|
|
48
49
|
|
|
@@ -76,10 +77,10 @@ For a previously calibrated model, repeated live parse failures invalidate the s
|
|
|
76
77
|
|
|
77
78
|
Confirmed against current source:
|
|
78
79
|
|
|
79
|
-
- Shared validation and repair
|
|
80
|
+
- Shared validation and repair choke point: `packages/ai/src/utils/validation.ts`.
|
|
80
81
|
- Repair mode names and standing-rule text: `packages/ai/src/utils/tool-repair/registry.ts`.
|
|
81
82
|
- Agent repair event metadata and teach-note gate: `packages/agent/src/types.ts`, `packages/agent/src/agent-loop.ts`.
|
|
82
83
|
- Interactive marker: `packages/coding-agent/src/modes/interactive/components/tool-execution.ts`.
|
|
83
84
|
- Settings/env kill switches: `packages/coding-agent/src/core/settings-manager.ts`, `packages/coding-agent/src/core/tool-repair-settings.ts`.
|
|
84
85
|
- Health, tool probing, rule removal, and protocol reset: `packages/coding-agent/src/core/tool-repair-health.ts`, `packages/coding-agent/src/core/models/adaptation-store.ts`, `packages/coding-agent/src/core/slash-commands.ts`, `packages/coding-agent/src/modes/interactive/interactive-mode.ts`, `packages/coding-agent/src/modes/rpc/rpc-mode.ts`.
|
|
85
|
-
-
|
|
86
|
+
- Recovery logging, failure corpus, and replay: `packages/coding-agent/src/core/tool-recovery-logger.ts`, `packages/coding-agent/src/core/tool-recovery-log-worker.ts`, `packages/coding-agent/src/core/failure-corpus.ts`, `scripts/tool-repair-replay.mjs`.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-custom-provider",
|
|
3
|
-
"version": "0.81.
|
|
3
|
+
"version": "0.81.23",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-custom-provider",
|
|
9
|
-
"version": "0.81.
|
|
9
|
+
"version": "0.81.23",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@anthropic-ai/sdk": "^0.52.0"
|
|
12
12
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-sandbox",
|
|
3
|
-
"version": "0.81.
|
|
3
|
+
"version": "0.81.23",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-sandbox",
|
|
9
|
-
"version": "0.81.
|
|
9
|
+
"version": "0.81.23",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@anthropic-ai/sandbox-runtime": "^0.0.26"
|
|
12
12
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-with-deps",
|
|
3
|
-
"version": "0.81.
|
|
3
|
+
"version": "0.81.23",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-with-deps",
|
|
9
|
-
"version": "0.81.
|
|
9
|
+
"version": "0.81.23",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"ms": "^2.1.3"
|
|
12
12
|
},
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@caupulican/pi-adaptative",
|
|
3
|
-
"version": "0.81.
|
|
3
|
+
"version": "0.81.23",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@caupulican/pi-adaptative",
|
|
9
|
-
"version": "0.81.
|
|
9
|
+
"version": "0.81.23",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@caupulican/pi-agent-core": "^0.81.
|
|
13
|
-
"@caupulican/pi-ai": "^0.81.
|
|
14
|
-
"@caupulican/pi-tui": "^0.81.
|
|
12
|
+
"@caupulican/pi-agent-core": "^0.81.23",
|
|
13
|
+
"@caupulican/pi-ai": "^0.81.23",
|
|
14
|
+
"@caupulican/pi-tui": "^0.81.23",
|
|
15
15
|
"@ff-labs/fff-node": "0.9.6",
|
|
16
16
|
"@silvia-odwyer/photon-node": "0.3.4",
|
|
17
17
|
"chalk": "5.6.2",
|
|
@@ -475,11 +475,11 @@
|
|
|
475
475
|
}
|
|
476
476
|
},
|
|
477
477
|
"node_modules/@caupulican/pi-agent-core": {
|
|
478
|
-
"version": "0.81.
|
|
479
|
-
"resolved": "https://registry.npmjs.org/@caupulican/pi-agent-core/-/pi-agent-core-0.81.
|
|
478
|
+
"version": "0.81.23",
|
|
479
|
+
"resolved": "https://registry.npmjs.org/@caupulican/pi-agent-core/-/pi-agent-core-0.81.23.tgz",
|
|
480
480
|
"license": "MIT",
|
|
481
481
|
"dependencies": {
|
|
482
|
-
"@caupulican/pi-ai": "^0.81.
|
|
482
|
+
"@caupulican/pi-ai": "^0.81.23",
|
|
483
483
|
"ignore": "7.0.5",
|
|
484
484
|
"typebox": "1.1.38",
|
|
485
485
|
"yaml": "2.9.0"
|
|
@@ -489,8 +489,8 @@
|
|
|
489
489
|
}
|
|
490
490
|
},
|
|
491
491
|
"node_modules/@caupulican/pi-ai": {
|
|
492
|
-
"version": "0.81.
|
|
493
|
-
"resolved": "https://registry.npmjs.org/@caupulican/pi-ai/-/pi-ai-0.81.
|
|
492
|
+
"version": "0.81.23",
|
|
493
|
+
"resolved": "https://registry.npmjs.org/@caupulican/pi-ai/-/pi-ai-0.81.23.tgz",
|
|
494
494
|
"license": "MIT",
|
|
495
495
|
"dependencies": {
|
|
496
496
|
"@anthropic-ai/sdk": "0.91.1",
|
|
@@ -512,8 +512,8 @@
|
|
|
512
512
|
}
|
|
513
513
|
},
|
|
514
514
|
"node_modules/@caupulican/pi-tui": {
|
|
515
|
-
"version": "0.81.
|
|
516
|
-
"resolved": "https://registry.npmjs.org/@caupulican/pi-tui/-/pi-tui-0.81.
|
|
515
|
+
"version": "0.81.23",
|
|
516
|
+
"resolved": "https://registry.npmjs.org/@caupulican/pi-tui/-/pi-tui-0.81.23.tgz",
|
|
517
517
|
"license": "MIT",
|
|
518
518
|
"dependencies": {
|
|
519
519
|
"get-east-asian-width": "1.6.0",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@caupulican/pi-adaptative",
|
|
3
|
-
"version": "0.81.
|
|
3
|
+
"version": "0.81.23",
|
|
4
4
|
"description": "Adaptive fork of Pi coding agent for self-evolving agent harness experiments",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"piConfig": {
|
|
@@ -73,9 +73,9 @@
|
|
|
73
73
|
"prepublishOnly": "npm run clean && npm run build && npm run shrinkwrap"
|
|
74
74
|
},
|
|
75
75
|
"dependencies": {
|
|
76
|
-
"@caupulican/pi-agent-core": "^0.81.
|
|
77
|
-
"@caupulican/pi-ai": "^0.81.
|
|
78
|
-
"@caupulican/pi-tui": "^0.81.
|
|
76
|
+
"@caupulican/pi-agent-core": "^0.81.23",
|
|
77
|
+
"@caupulican/pi-ai": "^0.81.23",
|
|
78
|
+
"@caupulican/pi-tui": "^0.81.23",
|
|
79
79
|
"@ff-labs/fff-node": "0.9.6",
|
|
80
80
|
"@silvia-odwyer/photon-node": "0.3.4",
|
|
81
81
|
"chalk": "5.6.2",
|