pi-braid 0.43.17 → 0.43.18

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 CHANGED
@@ -53,6 +53,19 @@ record; the tag scheme above applies unchanged.
53
53
 
54
54
  ---
55
55
 
56
+ ## Core — 0.43.18 (2026-11-03: braid follows the 1.5.0 harness, and its home link leaves the repository)
57
+
58
+ - **The harness pins move to 1.5.0 and the three surfaces it changed are handled where they live.** 1.5.0
59
+ validates tool schemas through `pi-schema`, and a `StringEnum` now loses its static type at its one read,
60
+ so the action union is named in the module that reads it; `pi-ai` no longer re-exports typebox's `Type`, so
61
+ the providers builder imports it from the package that owns it and declares the peer floor; and the
62
+ release's fatal-error vocabulary gains one token, mirrored in the two lists that already hold that class of
63
+ literal. Two fixtures pin the behaviour rather than the version: a JSON-Schema coercion case and a cost
64
+ reader that keeps `total` and `totalFromProvider` apart.
65
+ - **The package's home link points at the deck, not the repository.** npm metadata is read per version, so
66
+ this release carries the move: `homepage` is `https://kifirkin.github.io` while `repository` stays the
67
+ monorepo, which is why the package page showed the same destination twice.
68
+
56
69
  ## Core — 0.43.17 (2026-11-02: a worker session stops being able to message the owner)
57
70
 
58
71
  - **The telegram extension is a factory-level gate now, and the launch that sets it exists.** The worker
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  # pi-braid
4
4
 
5
5
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
6
- [![pi-coding-agent ^1.2.0](https://img.shields.io/badge/pi--coding--agent-%5E1.2.0-blueviolet)](https://github.com/earendil-works/pi)
6
+ [![pi-coding-agent ^1.5.0](https://img.shields.io/badge/pi--coding--agent-%5E1.5.0-blueviolet)](https://github.com/earendil-works/pi)
7
7
 
8
8
  <!-- braid:intro:start -->
9
9
 
package/build-info.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "pi-braid",
3
- "version": "0.43.17",
4
- "sha": "5363db1f32ef66d9ab33dcbea97a6e4b4c18dfe3",
5
- "shaShort": "5363db1f",
3
+ "version": "0.43.18",
4
+ "sha": "27dd175c0d7724dc9ec7dc570c25174a53a078e5",
5
+ "shaShort": "27dd175c",
6
6
  "branch": "detached",
7
7
  "dirty": false,
8
- "packedAt": "2026-11-02T19:37:07.011Z"
8
+ "packedAt": "2026-11-02T22:01:13.482Z"
9
9
  }
@@ -154,9 +154,11 @@ export const WAKE_RETRY_MAX_ATTEMPTS = MAX_WAKE_ATTEMPTS_DEFAULT;
154
154
  *
155
155
  * Pinned by test/runtime/lib/test-wake-retry-nonretryable-mirror.mjs, which
156
156
  * reads the token array out of the installed pi-ai module and requires each
157
- * one to be vetoed here. The retryable side below is NOT pinned: it is a
158
- * hand-written subset of pi-ai's retryable classes, so a failure pi-ai retries
159
- * but this mirror does not match settles with no hold. */
157
+ * entry to be vetoed here - including the one pi-ai declares as a pattern
158
+ * rather than a literal (Zhipu/Z.ai's plan-limit code, matched as a JSON body
159
+ * so the bare number does not veto the turn). The retryable side below is NOT
160
+ * pinned: it is a hand-written subset of pi-ai's retryable classes, so a
161
+ * failure pi-ai retries but this mirror does not match settles with no hold. */
160
162
  const WAKE_NON_RETRYABLE_ERROR_PATTERN = new RegExp([
161
163
  "GoUsageLimitError",
162
164
  "FreeUsageLimitError",
@@ -167,6 +169,10 @@ const WAKE_NON_RETRYABLE_ERROR_PATTERN = new RegExp([
167
169
  "quota exceeded",
168
170
  "billing",
169
171
  "subscription_sharing_usage_limit_exceeded",
172
+ "subscription_sharing_workplace_individual_usage_limit_exceeded",
173
+ // Zhipu/Z.ai plan-limit code, matched as the JSON body pi-ai matches; the
174
+ // digit guard keeps a longer number from matching a 1308 prefix.
175
+ '"code"\\s*:\\s*"?1308(?![0-9])',
170
176
  ].join("|"), "i");
171
177
  /** The retryable classes braid mirrors from pi-core's
172
178
  * RETRYABLE_PROVIDER_ERROR_PATTERN (pi-ai/dist/utils/retry.js): transport
package/docs/LOCAL_DEV.md CHANGED
@@ -138,7 +138,7 @@ before and after a full run. A non-zero delta is the leak this rule prevents.
138
138
  ### New fixtures: use `node:test`
139
139
 
140
140
  A new fixture is written on `node:test`. The runner does not care which style a
141
- file uses - 101 of the core suite's 336 fixtures already use `node:test` - so the
141
+ file uses - 103 of the core suite's 338 fixtures already use `node:test` - so the
142
142
  reason is the failure the other style produces. A hand-rolled helper that calls
143
143
  `fn()` without awaiting it discards the case's promise, so an `async` case runs
144
144
  detached and the file can print its green tally before that case settles, with
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-braid",
3
- "version": "0.43.17",
3
+ "version": "0.43.18",
4
4
  "description": "🥨 Braid - Metacognitive extension suite for pi coding agent: Adds memory, plan tracking, structured cognitive signals and completion checks on top of pi core loop, so long sessions keep their context and stop claiming unfinished work.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -35,7 +35,7 @@
35
35
  "bugs": {
36
36
  "url": "https://github.com/kifirkin/pi-braid/issues"
37
37
  },
38
- "homepage": "https://github.com/kifirkin/pi-braid#readme",
38
+ "homepage": "https://kifirkin.github.io",
39
39
  "pi": {
40
40
  "extensions": [
41
41
  "./src/index.ts"
@@ -81,10 +81,10 @@
81
81
  "typescript-eslint": "8.59.1"
82
82
  },
83
83
  "peerDependencies": {
84
- "@earendil-works/pi-agent-core": "^1.2.0",
85
- "@earendil-works/pi-ai": "^1.2.0",
86
- "@earendil-works/pi-coding-agent": "^1.2.0",
87
- "@earendil-works/pi-tui": "^1.2.0",
84
+ "@earendil-works/pi-agent-core": "^1.5.0",
85
+ "@earendil-works/pi-ai": "^1.5.0",
86
+ "@earendil-works/pi-coding-agent": "^1.5.0",
87
+ "@earendil-works/pi-tui": "^1.5.0",
88
88
  "typebox": "^1.1.38"
89
89
  },
90
90
  "keywords": [
@@ -225,9 +225,11 @@ export const WAKE_RETRY_MAX_ATTEMPTS = MAX_WAKE_ATTEMPTS_DEFAULT;
225
225
  *
226
226
  * Pinned by test/runtime/lib/test-wake-retry-nonretryable-mirror.mjs, which
227
227
  * reads the token array out of the installed pi-ai module and requires each
228
- * one to be vetoed here. The retryable side below is NOT pinned: it is a
229
- * hand-written subset of pi-ai's retryable classes, so a failure pi-ai retries
230
- * but this mirror does not match settles with no hold. */
228
+ * entry to be vetoed here - including the one pi-ai declares as a pattern
229
+ * rather than a literal (Zhipu/Z.ai's plan-limit code, matched as a JSON body
230
+ * so the bare number does not veto the turn). The retryable side below is NOT
231
+ * pinned: it is a hand-written subset of pi-ai's retryable classes, so a
232
+ * failure pi-ai retries but this mirror does not match settles with no hold. */
231
233
  const WAKE_NON_RETRYABLE_ERROR_PATTERN = new RegExp(
232
234
  [
233
235
  "GoUsageLimitError",
@@ -239,6 +241,10 @@ const WAKE_NON_RETRYABLE_ERROR_PATTERN = new RegExp(
239
241
  "quota exceeded",
240
242
  "billing",
241
243
  "subscription_sharing_usage_limit_exceeded",
244
+ "subscription_sharing_workplace_individual_usage_limit_exceeded",
245
+ // Zhipu/Z.ai plan-limit code, matched as the JSON body pi-ai matches; the
246
+ // digit guard keeps a longer number from matching a 1308 prefix.
247
+ '"code"\\s*:\\s*"?1308(?![0-9])',
242
248
  ].join("|"),
243
249
  "i",
244
250
  );
@@ -42,6 +42,16 @@ const EVOLVE_ACTIONS = [
42
42
  "benchmark",
43
43
  ] as const;
44
44
 
45
+ /**
46
+ * The action union the schema declares. `StringEnum` returns a pi-schema
47
+ * `Schema<T>`, which TypeBox's `Static` cannot read, so the framework infers
48
+ * `params.action` as `unknown` while every hand-written field beside it keeps
49
+ * its type. The alias restores the declared union at the one read that needs a
50
+ * string; it coerces nothing, so a value the schema would not accept still
51
+ * cannot reach this file.
52
+ */
53
+ type EvolveAction = (typeof EVOLVE_ACTIONS)[number];
54
+
45
55
  const healthMaintenanceSchema = Type.Object({
46
56
  action: StringEnum([...EVOLVE_ACTIONS], { description: "Action to perform" }),
47
57
  checkpoint: Type.Optional(Type.String({ description: "Checkpoint hash for rollback" })),
@@ -209,7 +219,7 @@ export default function healthMaintenanceExtension(pi: ExtensionAPI) {
209
219
  };
210
220
  } catch (error) {
211
221
  const errorResult: HealthMaintenanceResult = {
212
- action: params.action,
222
+ action: params.action as EvolveAction,
213
223
  success: false,
214
224
  error: error instanceof Error ? error.message : String(error),
215
225
  };