pi-braid 0.43.20 → 0.43.22

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,50 @@ record; the tag scheme above applies unchanged.
53
53
 
54
54
  ---
55
55
 
56
+ ## Contrib — 0.1.3 (2026-11-03: the health check rehearses a machine that has no state)
57
+
58
+ - **A `coldstart` category answers the question the other categories cannot.** Every existing probe
59
+ tests the machine the agent runs on, which is the machine least likely to be broken. The new category
60
+ copies the config manifest into a throwaway home, points `BRAID_HOME` at an empty directory inside it,
61
+ and runs one real process that asks memory, scratchpad, orchestration and bash to answer from nothing.
62
+ It is opt-in, because it spawns a process and a health check nobody runs is worse than none.
63
+ - **A rehearsal that writes where it measures fails.** The live braid home is fingerprinted before and
64
+ after, so a probe cannot report a sandbox it did not keep. A boot that fetched pinned packages is a
65
+ warning rather than a pass, because that is what makes a first start slow and network-dependent.
66
+ - **The probe reports its own blind spot.** Empty state and a broken path produce the same empty answer,
67
+ so the probe is asked to say which empties it could not tell apart, and the report carries that
68
+ sentence instead of a page of greens.
69
+
70
+ ## Telegram — 0.1.7 (2026-11-03: the poller lock judges liveness by instance and heartbeat, not by a pid)
71
+
72
+ - **A pid is not evidence across boots.** The lock now records the instance it belongs to (hostname plus
73
+ boot identity) and a heartbeat the holder refreshes on an interval, and the acquisition rule decides on
74
+ those: same instance with a current heartbeat refuses, a heartbeat past the window is taken over, and a
75
+ holder from another boot is judged by its heartbeat alone because its pid says nothing here.
76
+ - **A refusal an operator can act on.** The verdict carries a machine-readable reason, and the rendered
77
+ refusal names the holder's identity, pid, start time, role and heartbeat age, so a live holder, a stuck
78
+ holder, a dead container and a garbled file are tellable apart from the message.
79
+ - **The upgrade step is a manual one, and named as such.** A lock file written before the identity existed
80
+ carries no heartbeat, so it refuses rather than guesses, and an operator removes it. That refusal is
81
+ deliberate: a record with no evidence cannot distinguish a crashed predecessor from a live container,
82
+ and a silent second poller splits the owner's messages.
83
+
84
+ ## Core — 0.43.22 (2026-11-03: a cold start can be measured before the new machine exists)
85
+
86
+ - **The health check documents its cold-start half.** `healthcheck`'s skill now carries the reading order
87
+ for the new category: isolation before verdict, verdict before the subsystem rows, and a hang as the
88
+ answer no retry fixes. It also names what a clean machine will not have at all, which no state handling
89
+ can supply: the orchestrator workspace with its briefs, userland skills, and the pane multiplexer.
90
+
91
+ ## Core — 0.43.21 (2026-11-03: a failed synthesizer falls back to text, not to a worse voice)
92
+
93
+ - **The voice skill stops offering the offline voices as a substitute for a reply.** When the primary
94
+ synthesizer fails, the reply goes out as text with the outage named in one clause, and voice is
95
+ retried on the next turn. The rule is the owner's judgement measured the hard way: a fallback voice
96
+ note was rejected by ear ("не работает так"), while the outage it was covering had already cleared
97
+ on its own. The offline paths stay documented for audio that is not the reply to a message, which is
98
+ what they were always good for.
99
+
56
100
  ## Core — 0.43.20 (2026-11-03: the gates learn to see what is being written)
57
101
 
58
102
  - **The doc gates see the file being written.** `trackedMarkdown` enumerates untracked, non-ignored
package/build-info.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "pi-braid",
3
- "version": "0.43.20",
4
- "sha": "b798e2c75a33ca00f83818784d8552b4ee35531f",
5
- "shaShort": "b798e2c7",
3
+ "version": "0.43.22",
4
+ "sha": "55abdd57dac34879f6b39b357e31283ad6c3e974",
5
+ "shaShort": "55abdd57",
6
6
  "branch": "detached",
7
7
  "dirty": false,
8
- "packedAt": "2026-11-03T14:31:32.266Z"
8
+ "packedAt": "2026-11-03T21:26:38.545Z"
9
9
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-braid",
3
- "version": "0.43.20",
3
+ "version": "0.43.22",
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",
@@ -2,7 +2,7 @@
2
2
  name: healthcheck
3
3
  description: "Run a structured self-diagnostic of the agent environment: verify read/write/edit/bash/grep/find/ls, cognitive and memory tools, extension and skill availability, and ~/.pi writability; interpret pass/warn/fail results and clean up stale agent processes. Use when a tool misbehaves or fails, right after setup or a config change, before starting work in a fresh environment, or when many agent instances accumulated and the machine slows down. Triggers: health check, tool diagnostic, environment readiness, stale processes, post-setup validation."
4
4
  trigger: "troubleshooting tool failures, verifying environment readiness, post-setup validation, stale process cleanup, tool diagnostics"
5
- validated: 2026-09-09
5
+ validated: 2026-11-03
6
6
  verdict: IMPROVE
7
7
  ---
8
8
 
@@ -34,6 +34,24 @@ Extensions loaded (check tool list) · Skills available · ~/.pi directory acces
34
34
  - **Some warns** → degraded but functional
35
35
  - **Any fails** → capability compromised
36
36
 
37
+ ## Cold start
38
+
39
+ The `coldstart` category answers a different question from every other category here: not "do the tools work on this machine", which is the machine least likely to be broken, but "does braid work where nothing has happened yet". It copies `settings.json`, `auth.json`, `models-store.json` and `mcp.json` into a throwaway home, points `BRAID_HOME` at an empty directory inside it, and runs one real process that asks memory, scratchpad, orchestration and bash to answer from nothing.
40
+
41
+ ```
42
+ healthcheck { "categories": ["coldstart"] }
43
+ ```
44
+
45
+ It is opt-in and never part of the default sweep, because it spawns a process and can take minutes. Read it in this order:
46
+
47
+ - `isolation` fail: the rehearsal wrote into the live braid home. Treat the whole report as untrusted, not just that row.
48
+ - `verdict` warn: the probe never reported, so the subsystem rows mean nothing. Everything else in this category is downstream of this line.
49
+ - `boot` fail with a duration: a hang. This is the answer no retry fixes, and it names the subsystem that waits instead of failing.
50
+ - `subsystem-*` fail: that subsystem assumes state exists. A clean-machine blocker, not a warning.
51
+ - `first-boot-installs` warn: the first start on a new machine needs network and is slow; a second start is not.
52
+
53
+ What the category cannot see, and a clean machine will not have: the orchestrator workspace with its briefs and handoffs, userland skills, and `herdr`. None of the three ships in a package, so they are absent before any state question begins.
54
+
37
55
  ## Failure Recovery
38
56
 
39
57
  Permission denied on write → check ~/.pi permissions
@@ -2,7 +2,7 @@
2
2
  name: voice-replies
3
3
  description: "Reply to Telegram voice messages with synthesized speech: edge-tts (RU/EN/HE voices) → ffmpeg ogg/opus → Bot API sendVoice, matching the incoming message's language. Use when a voice message arrived and the reply should be a voice note in the same language, or when asked to send a Telegram voice reply. Triggers: voice reply, voice message, sendVoice, TTS, text-to-speech, edge-tts, Telegram audio reply. Includes offline fallbacks (piper, macOS say)."
4
4
  trigger: "voice replies, voice message reply, sendVoice, TTS, text-to-speech, edge-tts, piper, Telegram audio reply, responding in voice"
5
- validated: 2026-09-09
5
+ validated: 2026-11-03
6
6
  verdict: UNVALIDATED
7
7
  ---
8
8
 
@@ -17,6 +17,14 @@ Reply in the same modality **and language** as received:
17
17
  voice message in → voice reply in the same language. Text received → text reply.
18
18
  RU voiced in → Dmitry (RU). EN voiced in → Guy (EN). HE voiced in → Avri (HE).
19
19
 
20
+ **A failed primary synthesizer falls back to TEXT, not to a worse voice.** The owner rejects the
21
+ offline voices by ear: piper's output drew "у тебя чё-то с голосом не то, не работает так" the one
22
+ time it was sent, while edge-tts failures are transient: `NoAudioReceived` on six consecutive attempts
23
+ across the in-process and manual paths, then the first attempt succeeded minutes later with no
24
+ intervention. So a synthesizer outage is a delay, not an occasion to trade quality: send the reply as
25
+ text, name the outage in one clause, and retry voice on the next turn. A degraded voice note costs the
26
+ reader more than the delay does.
27
+
20
28
  ## Install
21
29
 
22
30
  Primary: `uvx edge-tts` (ephemeral, zero install) - OR a persistent venv you
@@ -95,7 +103,9 @@ uvx edge-tts --list-voices | grep -i <lang> # voice exists
95
103
 
96
104
  ## Offline Alternatives (lower priority)
97
105
 
98
- edge-tts is the primary zero-key path for RU/EN/HE. Offline fallbacks:
106
+ edge-tts is the primary zero-key path for RU/EN/HE. These fallbacks are for audio you are not sending
107
+ as the reply to a message (drafts, local artifacts, a transcript you want to hear), or for an owner who
108
+ explicitly asks for voice during an outage. They are not the substitute for a reply (see Modality Rule).
99
109
 
100
110
  **piper** (offline, RU only):
101
111
 
@@ -113,8 +123,8 @@ say -v Milena -o out.aiff "<text>" # Milena = ru-female
113
123
  ffmpeg -y -v error -i out.aiff -c:a libopus -b:a 40k -ar 48000 -ac 1 out.ogg
114
124
  ```
115
125
 
116
- In code, `say` is emergency-only (the owner dislikes its quality) and stays
117
- behind an explicit config choice (`source: "say"` or `"edge-tts+say"`).
126
+ In code, `say` is emergency-only and both offline voices stay behind an explicit config choice
127
+ (`source: "say"` or `"edge-tts+say"`); neither is a suitable default for an owner-facing reply.
118
128
 
119
129
  ## Dependency Note
120
130