@caupulican/pi-adaptative 0.90.4 → 0.90.5

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 (49) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/core/autonomy/lane-tracker.d.ts +5 -0
  3. package/dist/core/autonomy/lane-tracker.d.ts.map +1 -1
  4. package/dist/core/autonomy/lane-tracker.js +8 -0
  5. package/dist/core/autonomy/lane-tracker.js.map +1 -1
  6. package/dist/core/delegation/worker-authority-resolver.d.ts +2 -0
  7. package/dist/core/delegation/worker-authority-resolver.d.ts.map +1 -1
  8. package/dist/core/delegation/worker-authority-resolver.js +23 -3
  9. package/dist/core/delegation/worker-authority-resolver.js.map +1 -1
  10. package/dist/core/delegation/worker-delegation-controller.d.ts +1 -1
  11. package/dist/core/delegation/worker-delegation-controller.d.ts.map +1 -1
  12. package/dist/core/delegation/worker-delegation-controller.js +48 -13
  13. package/dist/core/delegation/worker-delegation-controller.js.map +1 -1
  14. package/dist/core/delegation/worker-lane-projection.d.ts.map +1 -1
  15. package/dist/core/delegation/worker-lane-projection.js +6 -0
  16. package/dist/core/delegation/worker-lane-projection.js.map +1 -1
  17. package/dist/core/delegation/worker-profile-resolver.d.ts +28 -1
  18. package/dist/core/delegation/worker-profile-resolver.d.ts.map +1 -1
  19. package/dist/core/delegation/worker-profile-resolver.js +38 -9
  20. package/dist/core/delegation/worker-profile-resolver.js.map +1 -1
  21. package/dist/core/orchestration/worker-model-pins.d.ts +28 -0
  22. package/dist/core/orchestration/worker-model-pins.d.ts.map +1 -0
  23. package/dist/core/orchestration/worker-model-pins.js +141 -0
  24. package/dist/core/orchestration/worker-model-pins.js.map +1 -0
  25. package/dist/core/runtime-builder.d.ts.map +1 -1
  26. package/dist/core/runtime-builder.js +1 -0
  27. package/dist/core/runtime-builder.js.map +1 -1
  28. package/dist/core/settings-manager.d.ts +4 -1
  29. package/dist/core/settings-manager.d.ts.map +1 -1
  30. package/dist/core/settings-manager.js +24 -0
  31. package/dist/core/settings-manager.js.map +1 -1
  32. package/dist/core/tools/delegate-status.d.ts +2 -0
  33. package/dist/core/tools/delegate-status.d.ts.map +1 -1
  34. package/dist/core/tools/delegate-status.js +7 -0
  35. package/dist/core/tools/delegate-status.js.map +1 -1
  36. package/dist/core/tools/delegate.d.ts +6 -0
  37. package/dist/core/tools/delegate.d.ts.map +1 -1
  38. package/dist/core/tools/delegate.js +38 -6
  39. package/dist/core/tools/delegate.js.map +1 -1
  40. package/docs/settings.md +31 -0
  41. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  42. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  43. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  44. package/examples/extensions/sandbox/package-lock.json +2 -2
  45. package/examples/extensions/sandbox/package.json +1 -1
  46. package/examples/extensions/with-deps/package-lock.json +2 -2
  47. package/examples/extensions/with-deps/package.json +1 -1
  48. package/npm-shrinkwrap.json +12 -12
  49. package/package.json +4 -4
package/docs/settings.md CHANGED
@@ -152,6 +152,36 @@ Pi's native delegation runtime is a durable recursive agent tree. A profile is n
152
152
 
153
153
  An agent may set `authority` on `delegate` to choose its child's role label, authenticated model, supported reasoning level, semantic capabilities, tools, read/write paths, and budget. Omitted fields inherit from the parent or selected preset. The host validates the request, resolves the concrete model and tools, intersects execution authority with the immutable parent grant and live global switches, then persists the exact result before the child starts. A descendant can specialize or narrow authority but cannot add an execution capability, tool, path, or budget that the parent did not hold. Profile selection also cannot add context: every child resource pointer must fully match an ancestral pointer (ID alone is insufficient), soul text must match exactly, and a verifier stays within its previously admitted ancestral verifier or worker boundary. Roles are descriptive routing and audit labels; the built-in compiler does not impose hidden role ceilings, though an embedding may supply an explicit host ceiling.
154
154
 
155
+ `workerDelegation.modelPins` optionally lets the owner fix the provider, model, and thinking level used by each fresh worker role. With no pins, delegation keeps the adaptive behavior above exactly. An applicable pin overrides model/thinking chosen by `authority` or a preset, while role, tools, resources, paths, and budgets still follow normal admission. This applies to fresh top-level workers, fresh nested workers, and mandatory verifiers. The admitted binding is persisted and reported by `delegate start`; queued work, retries, resumes, recovery, and later tasks on a reused `agentId` keep that immutable contract even if settings change.
156
+
157
+ Pin precedence is deliberately different from ordinary deep-merged settings: global role, global default, trusted local role, trusted local default, then adaptive routing. A global default therefore wins over every project role. Within trusted local settings, the user-level directory overlay wins over the project file at the same role/default tier. Untrusted project settings are ignored. Every binding must contain an exact `provider`, `modelId`, and supported `thinkingLevel`. Malformed pin configuration blocks fresh worker admission with `worker_model_pins_invalid`; an unavailable applicable pin blocks with `worker_model_pin_unavailable:<role>`. Neither condition falls back to another model. Configure pins directly in JSON; `/settings` does not edit them.
158
+
159
+ ```json
160
+ {
161
+ "workerDelegation": {
162
+ "modelPins": {
163
+ "default": {
164
+ "provider": "openai-codex",
165
+ "modelId": "gpt-5.6-luna",
166
+ "thinkingLevel": "high"
167
+ },
168
+ "roles": {
169
+ "explorer": {
170
+ "provider": "openai-codex",
171
+ "modelId": "gpt-5.6-terra",
172
+ "thinkingLevel": "medium"
173
+ },
174
+ "verifier": {
175
+ "provider": "openai-codex",
176
+ "modelId": "gpt-5.6-terra",
177
+ "thinkingLevel": "high"
178
+ }
179
+ }
180
+ }
181
+ }
182
+ }
183
+ ```
184
+
155
185
  For a new logical agent, `forkTurns` chooses immutable sanitized birth context: `"none"`, `"all"`, or a positive user-turn count encoded as a string, such as `"3"`. When omitted, an exact same-provider/model top-level worker defaults to `"all"`, while a nested worker defaults to `"none"` so the parent's global orchestration request cannot replace the child's self-contained task. A worker that changes provider or model also defaults to `"none"`, and explicitly requesting inherited turns across that boundary is rejected. Explicit nested `"all"` or count inheritance remains available inside the exact provider/model boundary. The bounded snapshot keeps whole text-only user/complete-assistant turns and a valid compaction checkpoint when needed. It excludes system/developer/custom context, reasoning/commentary, tool protocol and results, mailbox controls, attachments, and incomplete assistant output. A reused `agentId` continues its existing transcript and cannot replace its birth context.
156
186
 
157
187
  ```json
@@ -211,6 +241,7 @@ Direct `write`/`edit` calls use review-after-apply semantics. The compiled grant
211
241
  | `workerDelegation.maxConcurrent` | number | `20` | Global running-agent concurrency inside the fixed fleet and queue bounds |
212
242
  | `workerDelegation.writeEnabled` | boolean | `true` | Expose direct `write`/`edit`; explicit `false` revokes them for newly admitted work and narrows resumed grants |
213
243
  | `workerDelegation.writePaths` | string[] | `["."]` | Global envelope for direct child writes; an explicit empty array revokes direct `write`/`edit` |
244
+ | `workerDelegation.modelPins` | object | - | Optional exact `default` and per-role provider/model/thinking bindings for fresh workers; malformed or unavailable applicable pins fail closed |
214
245
 
215
246
  ### Tool Repair
216
247
 
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pi-extension-custom-provider",
3
- "version": "0.90.4",
3
+ "version": "0.90.5",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pi-extension-custom-provider",
9
- "version": "0.90.4",
9
+ "version": "0.90.5",
10
10
  "dependencies": {
11
11
  "@anthropic-ai/sdk": "^0.52.0"
12
12
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pi-extension-custom-provider-anthropic",
3
3
  "private": true,
4
- "version": "0.90.4",
4
+ "version": "0.90.5",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "echo 'nothing to clean'",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pi-extension-custom-provider-gitlab-duo",
3
3
  "private": true,
4
- "version": "0.90.4",
4
+ "version": "0.90.5",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "echo 'nothing to clean'",
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pi-extension-sandbox",
3
- "version": "0.90.4",
3
+ "version": "0.90.5",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pi-extension-sandbox",
9
- "version": "0.90.4",
9
+ "version": "0.90.5",
10
10
  "dependencies": {
11
11
  "@anthropic-ai/sandbox-runtime": "^0.0.26"
12
12
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pi-extension-sandbox",
3
3
  "private": true,
4
- "version": "0.90.4",
4
+ "version": "0.90.5",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "echo 'nothing to clean'",
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pi-extension-with-deps",
3
- "version": "0.90.4",
3
+ "version": "0.90.5",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pi-extension-with-deps",
9
- "version": "0.90.4",
9
+ "version": "0.90.5",
10
10
  "dependencies": {
11
11
  "ms": "^2.1.3"
12
12
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pi-extension-with-deps",
3
3
  "private": true,
4
- "version": "0.90.4",
4
+ "version": "0.90.5",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "echo 'nothing to clean'",
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "@caupulican/pi-adaptative",
3
- "version": "0.90.4",
3
+ "version": "0.90.5",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@caupulican/pi-adaptative",
9
- "version": "0.90.4",
9
+ "version": "0.90.5",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
- "@caupulican/pi-agent-core": "^0.90.4",
13
- "@caupulican/pi-ai": "^0.90.4",
14
- "@caupulican/pi-tui": "^0.90.4",
12
+ "@caupulican/pi-agent-core": "^0.90.5",
13
+ "@caupulican/pi-ai": "^0.90.5",
14
+ "@caupulican/pi-tui": "^0.90.5",
15
15
  "@silvia-odwyer/photon-node": "0.3.4",
16
16
  "chalk": "5.6.2",
17
17
  "cross-spawn": "7.0.6",
@@ -547,11 +547,11 @@
547
547
  }
548
548
  },
549
549
  "node_modules/@caupulican/pi-agent-core": {
550
- "version": "0.90.4",
551
- "resolved": "https://registry.npmjs.org/@caupulican/pi-agent-core/-/pi-agent-core-0.90.4.tgz",
550
+ "version": "0.90.5",
551
+ "resolved": "https://registry.npmjs.org/@caupulican/pi-agent-core/-/pi-agent-core-0.90.5.tgz",
552
552
  "license": "MIT",
553
553
  "dependencies": {
554
- "@caupulican/pi-ai": "^0.90.4",
554
+ "@caupulican/pi-ai": "^0.90.5",
555
555
  "ignore": "7.0.5",
556
556
  "typebox": "1.1.38",
557
557
  "yaml": "2.9.0"
@@ -561,8 +561,8 @@
561
561
  }
562
562
  },
563
563
  "node_modules/@caupulican/pi-ai": {
564
- "version": "0.90.4",
565
- "resolved": "https://registry.npmjs.org/@caupulican/pi-ai/-/pi-ai-0.90.4.tgz",
564
+ "version": "0.90.5",
565
+ "resolved": "https://registry.npmjs.org/@caupulican/pi-ai/-/pi-ai-0.90.5.tgz",
566
566
  "license": "MIT",
567
567
  "dependencies": {
568
568
  "@anthropic-ai/sdk": "0.91.1",
@@ -616,8 +616,8 @@
616
616
  }
617
617
  },
618
618
  "node_modules/@caupulican/pi-tui": {
619
- "version": "0.90.4",
620
- "resolved": "https://registry.npmjs.org/@caupulican/pi-tui/-/pi-tui-0.90.4.tgz",
619
+ "version": "0.90.5",
620
+ "resolved": "https://registry.npmjs.org/@caupulican/pi-tui/-/pi-tui-0.90.5.tgz",
621
621
  "license": "MIT",
622
622
  "dependencies": {
623
623
  "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.90.4",
3
+ "version": "0.90.5",
4
4
  "description": "Adaptive fork of Pi coding agent for self-evolving agent harness experiments",
5
5
  "type": "module",
6
6
  "piConfig": {
@@ -84,9 +84,9 @@
84
84
  "postinstall": "node scripts/postinstall-python-runtime.mjs"
85
85
  },
86
86
  "dependencies": {
87
- "@caupulican/pi-agent-core": "^0.90.4",
88
- "@caupulican/pi-ai": "^0.90.4",
89
- "@caupulican/pi-tui": "^0.90.4",
87
+ "@caupulican/pi-agent-core": "^0.90.5",
88
+ "@caupulican/pi-ai": "^0.90.5",
89
+ "@caupulican/pi-tui": "^0.90.5",
90
90
  "@silvia-odwyer/photon-node": "0.3.4",
91
91
  "chalk": "5.6.2",
92
92
  "cross-spawn": "7.0.6",