pi-muse-tether 0.1.1 → 0.2.1

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
@@ -1,5 +1,22 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.1
4
+
5
+ - Follow the official auto-updating Muse client; unknown builds run sequential Pi tools instead of refusing all turns. Parallel tools use qualification records, negotiated rawLog and runtime schema checks.
6
+ - Add per-feature typed degradation/refusal, private-prompt append fallback and actionable catalogue-disabled diagnostics.
7
+ - Add `/muse-doctor qualify [build] [--live]`, isolated conformance/explicit live suites and hash-bound qualification records.
8
+ - Isolate Vitest, node:test and native proofs from production client/state/ledger; stamp ledger origin and package version; guard full test/proof runs with before/after hashes, including qualification records.
9
+ - Wait for session-MCP readiness in official echo conformance before asserting request configuration. Run both test phases even if one fails, retaining per-test output; version-only diagnostic probes use temporary HOME/XDG roots.
10
+ - Ledger origin/version stamps distinguish isolated tests from production observations; historical fixture counts are not evidence of production failures.
11
+
12
+ ## 0.2.0
13
+
14
+ - Long or redacted tool results no longer kill the turn: complete `[REDACTED]` lines and Muse's 64 KiB view truncation (including one-line results) are reconciled against Pi's original result. Unsupported vendor transformations still stop safely.
15
+ - Support qualified Muse Code 1.4.15-R8339.1 alongside 1.4.14-R7309.1, including session MCP readiness and canonical private-workspace trust paths.
16
+ - Expose the full valid provider catalogue (Ember and Spark 1.2 appear); offer contributor picker routes only for verified model recipes (Spark 1.3/1.2, Wonder, Wonder Full), without guessing support for unknown models.
17
+ - Newer Muse Code clients warn instead of disappearing from `/model`; `PI_MUSE_TETHER_STRICT_VERSION=1` refuses them. Coding still requires a qualified client build.
18
+ - After switching an existing install to 1.4.15, run one Muse turn so the client rewrites its saved model list in the new format; until then the client serves only its built-in list.
19
+
3
20
  ## 0.1.1
4
21
 
5
22
  - Pi's provider hooks now fire.
package/README.md CHANGED
@@ -6,8 +6,8 @@ Use your Muse Code subscription in [Pi](https://github.com/earendil-works/pi), t
6
6
  Hi, I do most of my work in Pi and I also pay for Muse Code. While Meta has not been magnanimous enough to let us use our subscription directly in third-party harnesses, it still offers an [official SDK](https://github.com/meta-models/muse-code-sdk) for building clients around its installed coding agent. Pi is my main harness and I don't want to be swapping coding agents, and most importantly I don't want to juggle identities and system prompts. The goal of this tether is to unlock the high limits a subscription allows while using your own Pi custom prompt as much as possible, staying lighter on the system prompt than the less-than-optimal vendor harnesses, and not having to go through the API. I wrote it with a coding agent.
7
7
 
8
8
  <picture>
9
- <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/kyraneth/pi-muse-tether/main/assets/flow-dark.svg">
10
- <img alt="Pi sends the prompt, tools and history through the tether and the official Muse client to the model. A tool call comes back the same way to Pi, which runs the tool and saves the result. The result then goes back to the model." width="700" src="https://raw.githubusercontent.com/kyraneth/pi-muse-tether/main/assets/flow-light.svg">
9
+ <source media="(prefers-color-scheme: dark)" srcset="assets/flow-dark.svg">
10
+ <img alt="Pi sends the prompt, tools and history through the tether and the official Muse client to the model. A tool call comes back the same way to Pi, which runs the tool and saves the result. The result then goes back to the model." width="700" src="assets/flow-light.svg">
11
11
  </picture>
12
12
 
13
13
  ## Who it's for
@@ -16,14 +16,30 @@ This is for you if you've built your workflow around Pi, with your own system pr
16
16
 
17
17
  ## Install
18
18
 
19
- Sign in with the official Muse Code client first. You need Node 24 or newer. I tested this with Pi 1.5.0 and Muse Code 1.4.14, and other versions may be refused.
19
+ Sign in with the official Muse Code client first. You need Node 24 or newer. I tested this with Pi 1.5.0 and Muse Code 1.4.14 and 1.4.15; see the version policy below.
20
20
 
21
21
  ```sh
22
22
  pi install npm:pi-muse-tether
23
23
  PI_MUSE_TETHER_LIVE=1 pi --provider pi-muse-tether --model muse-spark-1.3
24
24
  ```
25
25
 
26
- Keep `PI_MUSE_TETHER_LIVE=1` set whenever you want to use Muse. Without it you only get an offline test model. If it worked, the Muse models your account can use appear under `pi-muse-tether` in `/model`, and `/muse-doctor` shows the local versions it found.
26
+ Keep `PI_MUSE_TETHER_LIVE=1` set whenever you want to use Muse. Without it you only get an offline test model and a typed catalogue-disabled notice. If it worked, the Muse models your account can use appear under `pi-muse-tether` in `/model`, and `/muse-doctor` shows the local versions it found.
27
+
28
+ ## Muse Code version policy
29
+
30
+ The minimum client is **1.4.14**, the oldest version qualified for the tether’s private-XDG prompt/isolation recipe. The tested ceiling is **1.4.15**. Older or unparseable clients are refused. Newer clients warn once per version per Pi process and continue, **not yet qualified**, including private-settings prompt delivery. Set `PI_MUSE_TETHER_STRICT_VERSION=1` to refuse clients above the tested ceiling instead. `/muse-doctor` reports the range and whether the installed client exceeds it. Meta’s official launcher owns updates; production leaves its default update behaviour enabled. Tests, proofs and qualification disable updates in isolated homes.
31
+
32
+ The SDK remains independently pinned to **`@muse-code/sdk` 1.4.14**; it need not equal the client version. Unknown builds run **sequential Pi tools**, with one typed notice, rather than refusing a turn. Parallel tools require qualification evidence matching the executable and schema, a granted `rawLog` capability, and runtime validation of each committed batch. Historical 1.4.14/1.4.15 evidence is retained as data. `/muse-doctor qualify [build]` writes offline results; explicit `--live` plus confirmation runs the live suite. Only complete qualification enables parallel tools. No code change or client store is needed. Missing private replacement degrades to appended developer instructions with a notice; missing session MCP refuses with the build and cause because Pi must own tools. See [client lifecycle](docs/CLIENT-LIFECYCLE.md) and [qualification](docs/CLIENT-QUALIFICATION.md).
33
+
34
+ Muse 1.4.15 changed two things the tether now handles. It starts session tool servers after `session/start` returns, so the tether waits (via `mcpServer/readInventory`) until its tool server is connected with every Pi tool before the first turn; a withheld or failed server stops before any model request. It also starts session tool servers only in a trusted workspace. The tether names an empty, private, tether-owned workspace and trusts only that one; it never trusts your project, because a trusted project also loads its rules files (for example `AGENTS.md`) into the model. Pi still owns the working directory and every tool path.
35
+
36
+ ## Models in the picker
37
+
38
+ With live mode enabled, the tether reads the official client’s `model/list`. Every valid Muse catalogue row appears with its own context/output limits and supported thinking levels; there is no model allowlist. New client models do not need a tether code change. The catalogue is read again after each agent run, and the provider is re-registered only when the exposed models or their metadata change. Discovery failure removes live entries, keeps the offline `echo` model, and is reported by `/muse-doctor`.
39
+
40
+ Each catalogue `<id>` offers its normal route (contributor mode off). Only models with verified contributor support also offer `<id>-contributor` (Contributor, mode on): currently Spark 1.3, Spark 1.2, Wonder 1.0 and Wonder Full 1.0. **Ember 1.0 has only a Normal route**: the client ignores contributor mode for Ember and the API has no Ember contributor model. Future models appear normally without a tether update; contributor routes require verifying the client's on/off wire model and the contributor model's API support, then adding the native ID to the documented `VERIFIED_CONTRIBUTOR_MODEL_IDS` constant in `src/model-route.ts`. For backward compatibility, **`muse-spark-1.3` stays contributor-on**, labelled Contributor; `muse-spark-1.3-contributor` is an explicit alias for that same native model and mode. Existing Wonder names and modes are unchanged. Contributor suffixes select CLI recipes, not native catalogue IDs. The `-contributor` suffix is reserved for these local routes: a native catalogue row using it is skipped with a named `/muse-doctor` diagnostic, without hiding other models.
41
+
42
+ Only thinking levels present in that model’s catalogue are offered; unsupported levels are refused before submission (for example, Spark 1.2 `max`). Unknown prices remain `null`, labelled **pricing unknown**; no model borrows another’s rates. Assistant messages report `responseModel` from the selected recipe: the native ID for Normal, or `<id>-contributor` for Contributor. Its source is marked derived, not response-attested; catalogue availability alone does not prove physical response identity or contributor support.
27
43
 
28
44
  ## How it works
29
45
 
@@ -31,7 +47,7 @@ The tether starts the official Muse client in the background and passes it Pi's
31
47
 
32
48
  ## How close it is to the direct API
33
49
 
34
- I ran two real coding tasks through each route, once per route, on a build from just before this release. These are single runs, so read them as a rough comparison. [How I measured](https://github.com/kyraneth/pi-muse-tether/blob/main/docs/DETAILS.md#how-i-measured).
50
+ I ran two real coding tasks through each route, once per route, on a build from just before this release. These are single runs, so read them as a rough comparison. [How I measured](docs/DETAILS.md#how-i-measured).
35
51
 
36
52
  | | Tether | Direct API |
37
53
  |---|---|---|
@@ -55,11 +71,11 @@ The last row is the difference you will notice most.
55
71
 
56
72
  - You restart Pi often in long sessions. A restart starts a new Muse client, so the next turn begins with a cold cache and processes the whole history again.
57
73
  - You need control over retries. Muse retries some server errors by itself, and I found no way to turn that off.
58
- - Your tool results must reach the model unchanged. Muse sometimes replaces secret-looking text with `[REDACTED]`, so I can't tell exactly what the model saw.
59
- - You need the model to see every image your tools return. Images no longer kill the turn, but I can't prove what the model saw. It read PNG and JPEG correctly in small tests, but with six images at once it got the last JPEG wrong and said it couldn't see the GIF and WebP. Images attached to a tool error never reach it, because the official client drops them. See [details](https://github.com/kyraneth/pi-muse-tether/blob/main/docs/DETAILS.md).
74
+ - Your tool results must reach the model unchanged. Muse sometimes replaces secret-looking text with `[REDACTED]`, even in harmless prose. Declared loss continues with source/position evidence in the ledger, including uncertain alignments; it does not prove the model saw the original. Literal markers may already be source text.
75
+ - You need the model to see every image your tools return. Images no longer kill the turn, but I can't prove what the model saw. It read PNG and JPEG correctly in small tests, but with six images at once it got the last JPEG wrong and said it couldn't see the GIF and WebP. Images attached to a tool error never reach it, because the official client drops them. See [details](docs/DETAILS.md).
60
76
  - Your tools run for a very long time. I tested one that ran for 5 minutes, and I don't know how much longer one can run.
61
77
  - You're on a datacenter network with IPv6. On some of these, Muse returned an empty model list while the same account worked over IPv4. The tether stops and tells you when this happens.
62
78
 
63
79
  ## More
64
80
 
65
- This is an independent project, and neither Muse nor Meta made it. The technical details are in [docs/DETAILS.md](https://github.com/kyraneth/pi-muse-tether/blob/main/docs/DETAILS.md). Please report problems in the [issues](https://github.com/kyraneth/pi-muse-tether/issues). [MIT license](https://github.com/kyraneth/pi-muse-tether/blob/main/LICENSE).
81
+ This is an independent project, and neither Muse nor Meta made it. The technical details are in [docs/DETAILS.md](docs/DETAILS.md). Please report problems in the [issues](https://github.com/kyraneth/pi-muse-tether/issues). [MIT license](LICENSE).
@@ -0,0 +1,202 @@
1
+ {
2
+ "sources": [
3
+ {
4
+ "build": "v1414",
5
+ "sha256": "a9368639efe1dbd3a52d1816b99a36b7fd151088cdfbb2b5f0c4e2a3e7e9c50d"
6
+ },
7
+ {
8
+ "build": "v1415",
9
+ "sha256": "087aa69cf3f8b709ee97ba19f8583532400cbfe9013128a2da8d209359442172"
10
+ }
11
+ ],
12
+ "schemas": [
13
+ {
14
+ "$defs": {
15
+ "LogRecordParams": {
16
+ "properties": {
17
+ "record": {
18
+ "properties": {},
19
+ "type": "object"
20
+ },
21
+ "subscriptionId": {
22
+ "type": "integer"
23
+ }
24
+ },
25
+ "required": [
26
+ "record",
27
+ "subscriptionId"
28
+ ],
29
+ "type": "object",
30
+ "x-msp-descriptor": "log/record",
31
+ "x-msp-stability": "experimental"
32
+ },
33
+ "RawLogRecordEnvelope": {
34
+ "properties": {
35
+ "causation_id": {
36
+ "type": [
37
+ "string",
38
+ "null"
39
+ ]
40
+ },
41
+ "durability": {
42
+ "type": "string"
43
+ },
44
+ "id": {
45
+ "type": "string"
46
+ },
47
+ "payload": {
48
+ "properties": {},
49
+ "type": "object"
50
+ },
51
+ "payload_schema_version": {
52
+ "type": "integer"
53
+ },
54
+ "payload_type": {
55
+ "type": "string"
56
+ },
57
+ "record_type": {
58
+ "type": "string"
59
+ },
60
+ "recorded_at": {
61
+ "type": "integer"
62
+ },
63
+ "schema_version": {
64
+ "type": "integer"
65
+ },
66
+ "sequence": {
67
+ "type": "integer"
68
+ },
69
+ "stream": {
70
+ "$ref": "#/$defs/StreamRef"
71
+ }
72
+ },
73
+ "required": [
74
+ "causation_id",
75
+ "durability",
76
+ "id",
77
+ "payload",
78
+ "payload_schema_version",
79
+ "payload_type",
80
+ "record_type",
81
+ "recorded_at",
82
+ "schema_version",
83
+ "sequence",
84
+ "stream"
85
+ ],
86
+ "type": "object",
87
+ "x-msp-descriptor": "log/page",
88
+ "x-msp-stability": "experimental"
89
+ },
90
+ "StreamRef": {
91
+ "properties": {
92
+ "id": {
93
+ "type": "string"
94
+ },
95
+ "kind": {
96
+ "type": "string"
97
+ }
98
+ },
99
+ "required": [
100
+ "id",
101
+ "kind"
102
+ ],
103
+ "type": "object"
104
+ }
105
+ }
106
+ },
107
+ {
108
+ "$defs": {
109
+ "LogRecordParams": {
110
+ "properties": {
111
+ "record": {
112
+ "properties": {},
113
+ "type": "object"
114
+ },
115
+ "subscriptionId": {
116
+ "type": "integer"
117
+ }
118
+ },
119
+ "required": [
120
+ "record",
121
+ "subscriptionId"
122
+ ],
123
+ "type": "object",
124
+ "x-msp-descriptor": "log/record",
125
+ "x-msp-stability": "experimental"
126
+ },
127
+ "RawLogRecordEnvelope": {
128
+ "properties": {
129
+ "causation_id": {
130
+ "type": [
131
+ "string",
132
+ "null"
133
+ ]
134
+ },
135
+ "durability": {
136
+ "type": "string"
137
+ },
138
+ "id": {
139
+ "type": "string"
140
+ },
141
+ "payload": {
142
+ "properties": {},
143
+ "type": "object"
144
+ },
145
+ "payload_schema_version": {
146
+ "type": "integer"
147
+ },
148
+ "payload_type": {
149
+ "type": "string"
150
+ },
151
+ "record_type": {
152
+ "type": "string"
153
+ },
154
+ "recorded_at": {
155
+ "type": "integer"
156
+ },
157
+ "schema_version": {
158
+ "type": "integer"
159
+ },
160
+ "sequence": {
161
+ "type": "integer"
162
+ },
163
+ "stream": {
164
+ "$ref": "#/$defs/StreamRef"
165
+ }
166
+ },
167
+ "required": [
168
+ "causation_id",
169
+ "durability",
170
+ "id",
171
+ "payload",
172
+ "payload_schema_version",
173
+ "payload_type",
174
+ "record_type",
175
+ "recorded_at",
176
+ "schema_version",
177
+ "sequence",
178
+ "stream"
179
+ ],
180
+ "type": "object",
181
+ "x-msp-descriptor": "log/page",
182
+ "x-msp-stability": "experimental"
183
+ },
184
+ "StreamRef": {
185
+ "properties": {
186
+ "id": {
187
+ "type": "string"
188
+ },
189
+ "kind": {
190
+ "type": "string"
191
+ }
192
+ },
193
+ "required": [
194
+ "id",
195
+ "kind"
196
+ ],
197
+ "type": "object"
198
+ }
199
+ }
200
+ }
201
+ ]
202
+ }
@@ -0,0 +1,24 @@
1
+ [
2
+ {
3
+ "build": "1.4.14-R7309.1",
4
+ "sha256": "0809aac7cb58d18f5022b6d05e02aa1974683c0ec430e5f04d25b60ed17de2da",
5
+ "schemaHash": "a9368639efe1dbd3a52d1816b99a36b7fd151088cdfbb2b5f0c4e2a3e7e9c50d",
6
+ "qualified": true,
7
+ "results": {
8
+ "legacy": true,
9
+ "source": "pre-existing live qualification, 2026-11-10 and original 1.4.14",
10
+ "sha256Coverage": "retained official bytes; matches retained offline-client manifest"
11
+ }
12
+ },
13
+ {
14
+ "build": "1.4.15-R8339.1",
15
+ "sha256": "abe0a72878c62b570c6eed6c17c5fc3c520a990ecf040511741c00092312a3d5",
16
+ "schemaHash": "087aa69cf3f8b709ee97ba19f8583532400cbfe9013128a2da8d209359442172",
17
+ "qualified": true,
18
+ "results": {
19
+ "legacy": true,
20
+ "source": "pre-existing live qualification, 2026-11-10 and original 1.4.14",
21
+ "sha256Coverage": "retained official bytes"
22
+ }
23
+ }
24
+ ]
@@ -0,0 +1,107 @@
1
+ # Official client lifecycle and qualification
2
+
3
+ ## Decision implemented
4
+
5
+ The revised delivery follows the user's official Muse launcher, like the Claude
6
+ Code tether. Meta owns updates; the tether owns capability negotiation and
7
+ runtime validation. `PI_MUSE_TETHER_BINARY` remains an explicit absolute-path
8
+ override. Production does not force `MUSE_NO_AUTO_UPDATE`; development, tests,
9
+ qualification and proofs set it to `1`. `PI_MUSE_TETHER_STRICT_VERSION=1` remains
10
+ an explicit refusal above the tested range. Otherwise newer builds warn and run.
11
+
12
+ The originally proposed pinned-client store was rejected and is not shipped.
13
+ The emergency binary override is not an alternate automatic installation route.
14
+
15
+ ## What the launcher actually does
16
+
17
+ Read on 2026-11-16: launcher version 3 from the existing installation. It resolves
18
+ its own directory, supports `muse-stable`/`muse-canary` channel heads only, and
19
+ has **no historical-build selector**. `MUSE_LAUNCHER_INSTALL=1` installs beside
20
+ the copied launcher, checking the channel manifest, release version, artifact
21
+ size and SHA-256. After a successful installation it deletes **all sibling
22
+ `muse-bin-*` builds except the selected one**. A pinned store therefore
23
+ would have needed separate staging to avoid pruning retained builds. No such
24
+ store or installer is managed by the tether.
25
+
26
+ A plain launcher invocation may update even for `--version`. Tests and proofs
27
+ must therefore never invoke it without `MUSE_NO_AUTO_UPDATE=1`. Version cache
28
+ entries bind launcher/selector/executable metadata and are invalidated by any
29
+ observed identity change; unknown override launchers are probed each time.
30
+
31
+ ## Identity and login (unchanged)
32
+
33
+ The existing official launcher resolves login to `MUSE_AUTH_PATH`, else
34
+ `$XDG_CONFIG_HOME/muse/auth.json`, else `$HOME/.config/muse/auth.json`.
35
+ On this node, metadata-only inspection found the existing login at
36
+ `~/.config/muse/auth.json` (regular file, mode 0600); no token contents were
37
+ read, copied or printed. The official binary installed by the copied launcher
38
+ has SHA-256 `3685b023d45a1a07c8c559da00088bdf59564920b13a85adad11e13ad6f4d181`
39
+ for build `1.4.20-R8619.1`. Installation did not sign in again.
40
+
41
+ `settings.ts:linkHostLogin` is unchanged: each private-prompt host writes its
42
+ own isolated settings/trust files and symlinks only `config/muse/auth.json` to
43
+ the existing login. It stats the real file before/after, verifies that the
44
+ symlink still points to the same destination, and stops if the client replaces
45
+ that symlink. Legitimate rotation of the real destination is recorded as
46
+ metadata, not copied or repaired. Explicit `MUSE_AUTH_PATH` is inherited by the
47
+ official client. There is no impersonation, second credential store, or API-key
48
+ fallback; `META_API_KEY` is excluded from the model host environment.
49
+
50
+ ## Batching is a capability, not a build string
51
+
52
+ A new build is not denied for lacking qualification evidence: it runs sequential
53
+ tools. Batch eligibility comes from records matching executable/schema identity,
54
+ plus the two historical seed records, rather than a hand-edited admission
55
+ constant. Explicit live qualification can certify a new build without editing
56
+ code. The host additionally requests `rawLog`, requires the ordinary session-MCP
57
+ protocol, and validates
58
+ committed batch frames against retained v1.4.14/v1.4.15 envelope definitions in
59
+ `assets/batch-boundary-schemas.json`. Their original whole-schema SHA-256s are
60
+ retained in that file. **Those upstream schemas explicitly declare the payload
61
+ unstable and free-form**. The tether additionally checks every consumed event
62
+ and tool-call field; it does not claim the upstream envelope schema attests the
63
+ payload vocabulary.
64
+
65
+ Absent grant/stream/boundary, log gaps or a shape mismatch disable batching for
66
+ that host with one visible notice. Approved MCP calls are then surfaced and
67
+ verified one at a time; concurrent native calls queue rather than being rejected
68
+ or replayed. Foreign turn identities, conflicting duplicate calls, failed
69
+ authentication and incompatible base protocols still refuse. A server-required
70
+ upgrade is surfaced as `MUSE_UPGRADE_REQUIRED`, never silently retried on a
71
+ different client.
72
+
73
+ ## Offline conformance and isolation evidence
74
+
75
+ The official echo probe waits for `mcpServer/readInventory` to report its fixture
76
+ server connected with the exact supplied tools before starting the turn. On
77
+ current clients, starting a turn earlier can expose an empty toolset or fail
78
+ before a `model_request_configured` event exists. The test still requires that
79
+ real event, exact named tools, absence of false read-only policy, the negative
80
+ policy control, and rejection of a missing tool. It uses no version-specific
81
+ waiver and does not treat a missing event as success.
82
+
83
+ `npm test` runs both Vitest and node:test even when either phase fails; the
84
+ combined result fails if either does. Both phases print individual test names.
85
+ The guard snapshots the launcher, installed binaries, selector, qualification
86
+ homes and request ledger before and after, including newly added/removed files.
87
+ Version-only diagnostic probes also use fresh HOME/XDG roots, never the user's
88
+ ordinary configuration home. There is no client-store environment or pin state.
89
+
90
+ ## Shared tether-core contract (proposed for adoption)
91
+
92
+ A vendor tether must separate: (1) official executable identity/update ownership,
93
+ (2) protocol capability negotiation, (3) schema-checked optional accelerations,
94
+ and (4) qualification evidence. A version warning is not evidence that optional
95
+ capabilities work, and an unknown optional capability must not deny a basic turn.
96
+ No vendor tether may silently switch identities, create another login, replay an
97
+ unknown request, or write test/proof telemetry to the user's live ledger.
98
+ Qualification records bind exact executable SHA-256 and schema hash, with named
99
+ check results; they enable optional accelerations, not whole-turn admission.
100
+ The private replacement requires experimental negotiation; if withheld, the
101
+ isolated host is reopened before any model request with supported
102
+ `run.developer_prompt` instructions appended to Muse's own prompt. A typed
103
+ notice names that reduced guarantee. Missing session MCP refuses with build and
104
+ cause; there is no fallback to vendor-owned tools.
105
+
106
+ This document specifies the shared contract; it does not claim the separate
107
+ `pi-tether-core` or Claude/agy repositories were changed in this PR.
@@ -0,0 +1,97 @@
1
+ # Client qualification
2
+
3
+ The official Muse launcher owns updates. The tether does **not** install, pin,
4
+ retain or promote vendor clients. Qualification is evidence about particular
5
+ executable bytes, not a build-string permission to run ordinary turns.
6
+ `PI_MUSE_TETHER_BINARY` remains an emergency explicit official-binary override.
7
+
8
+ ## Command and integration
9
+
10
+ ```text
11
+ /muse-doctor qualify [build] # offline only; no model request
12
+ /muse-doctor qualify [build] --live # explicit gate AND interactive confirmation
13
+ ```
14
+
15
+ The doctor calls `await qualifyClient(build?, live = false)` from
16
+ `src/qualification.ts`. Before passing `true`, it must obtain UI confirmation.
17
+ The function additionally requires `PI_MUSE_TETHER_LIVE=1`; setting that variable
18
+ alone does not run the live suite. A requested build must equal the selected
19
+ client's reported build. The official launcher cannot install historical builds;
20
+ qualification never tries to do so.
21
+
22
+ Qualification uses the owning `src/qualification-records.ts` helpers, not a
23
+ client store. It writes `{build, sha256, schemaHash, results, qualified}` under
24
+ `qualificationHome()` (override: `PI_MUSE_TETHER_QUALIFICATION_HOME`).
25
+ `results.offline` is a boolean. `results.live` contains individual status/detail
26
+ objects for `batchBoundary`, `privatePrompt`, `sessionMcp`, `resume`, and `image`.
27
+ `qualified` is true **only when offline conformance and all five live checks
28
+ pass**. Offline success alone never enables full qualification. An offline recheck preserves existing live evidence only when both executable
29
+ SHA-256 and schema hash match exactly; it does not rerun or renew that live
30
+ proof. A changed identity gets fresh incomplete results. Successful/failed live
31
+ runs retain their isolated result location in `results.liveEvidence`. A complete
32
+ matching record enables optional batching on subsequent hosts, still subject to
33
+ negotiation and runtime validation. No installation or client update is implicit.
34
+
35
+ ## Offline conformance
36
+
37
+ 1. Resolve the selected official executable and hash its bytes, not the launcher.
38
+ 2. Inspect `schema --help` and `schema generate-json-schema --help`.
39
+ 3. Run the advertised `schema generate-json-schema --experimental --out <temp>`
40
+ and hash the actual `msp.schema.json` bytes.
41
+ 4. Compare the reachable `LogRecordParams` and `RawLogRecordEnvelope` contracts
42
+ against the retained v1414/v1415 schema fixtures in
43
+ `assets/batch-boundary-schemas.json`. Their original source hashes are retained
44
+ in that asset. Descriptions/titles/comments do not affect compatibility;
45
+ changed wire shapes or unresolved references fail conservatively for review.
46
+ 5. Recheck the executable hash before writing the record. An identity race refuses
47
+ the write rather than attaching evidence to different bytes.
48
+
49
+ Every qualification CLI invocation has `MUSE_NO_AUTO_UPDATE=1`. Schema operations
50
+ use a fresh HOME/XDG workspace and are cleaned up. No token is read or copied.
51
+ The free-form committed event payload is **not** proven by schema equality:
52
+ `committedCalls` runtime validation and an actual live batch event remain needed.
53
+ Offline checks do not certify exhaustive private-prompt isolation or session MCP.
54
+
55
+ ## Explicit live suite (never part of ordinary tests)
56
+
57
+ Select a Muse model in Pi, then authorize the doctor command above. Outside a
58
+ Muse picker context, set `PI_MUSE_TETHER_QUALIFICATION_MODEL` to an explicit
59
+ official `model/list` ID. The runner does not guess a model.
60
+ It verifies its catalogue limits and `none` effort before submitting any turn.
61
+ Each scenario runs once; failure stops subsequent scenarios, without replay.
62
+
63
+ A subprocess owns a unique HOME, all four XDG roots, ledger and Pi session
64
+ journal. It resolves Jiti through the installed Pi package to load the TypeScript
65
+ module. It links the existing login by metadata-only `linkHostLogin`, never copies
66
+ or reads credentials, and verifies the symlink metadata after cleanup. The
67
+ original login is the only deliberately shared account state; normal official
68
+ login refresh may still change its metadata. The worker home and synthetic
69
+ journal are retained under `qualificationHome()/live-*` for review, including
70
+ failed/unknown outcomes. Do not blindly re-run an interrupted worker.
71
+
72
+ The worker uses the real provider, Agent, MCP broker and official host:
73
+
74
+ | Check | Required observation |
75
+ | --- | --- |
76
+ | Private prompt | Exact randomized token supplied only in the private system prompt is returned. This tests prompt delivery, not exhaustive suppression of every foreign rule. |
77
+ | Session MCP | Pi actually executes both synthetic `qualification_read` invocations and the final answer contains both randomized outputs. |
78
+ | Batch boundary | One actual `tool-batch` host event contains both fixture keys. Timing overlap or two separate calls does not count. |
79
+ | Resume | Retire the real ephemeral host, restore messages from the Pi journal, and recall the earlier randomized tool output without tools. This is Pi history replay, **not native Muse session resume**. |
80
+ | Image | Submit real PNG bytes for a randomized red/blue swatch through Pi image input and check the answer. This is not proof of tool-result image receipt parity. |
81
+
82
+ The worker passes `qualificationProbe:true` to the host under its isolated-worker
83
+ marker so a new candidate can exercise batches before it has a successful record.
84
+ This bypasses only the prior-record gate: rawLog negotiation and runtime frame
85
+ validation still apply. Ordinary runtime must not use this probe option.
86
+
87
+ No missing check is treated as a pass. Exceptions, failed assertions, incomplete
88
+ workers and login verification failures leave `qualified:false`. This module
89
+ never auto-promotes or auto-updates anything, and its live runner is not a
90
+ substitute for the root-owned single authorized end-to-end production proof.
91
+
92
+ ## Verification performed during implementation
93
+
94
+ `tests/qualification.test.ts` exercises fake read-only executable commands,
95
+ retained schema compatibility, hash-bound records, explicit live gates, build
96
+ mismatch refusal and failure records. It does not call a model. The live suite
97
+ is implemented but **was not run** during this implementation.
package/docs/DETAILS.md CHANGED
@@ -4,7 +4,7 @@ Use Muse Code models in [Pi](https://github.com/earendil-works/pi) through the o
4
4
 
5
5
  ## Install and first use
6
6
 
7
- Requires Node.js 24+, Pi 1.5.0, the official Muse Code 1.4.14 client (qualified build R7309.1), and an account entitled to the selected model. The adapter pins `@muse-code/sdk` 1.4.14. Other versions are not qualified and may be refused.
7
+ Requires Node.js 24+, Pi 1.5.0, the official Muse Code client, and an account entitled to the selected model. Qualified builds are 1.4.14-R7309.1 and 1.4.15-R8339.1 for private prompt settings, session MCP and experimental rawLog committed tool batches. The 1.4.15 qualification includes asynchronous MCP readiness and an Ember tool-batch workload; it does not establish equal workload coverage for every model. The adapter independently pins `@muse-code/sdk` 1.4.14. Newer clients warn (strict mode refuses only when explicitly enabled). Unqualified builds run sequential tools; parallel-tool qualification is hash-bound data plus capability negotiation and runtime schema validation, not a whole-turn exact-build gate.
8
8
 
9
9
  ```sh
10
10
  pi install npm:pi-muse-tether
@@ -39,7 +39,7 @@ Contributor mode is a **model choice**, not an integration caveat. Select it in
39
39
  | `PI_MUSE_TETHER_SYSTEM_PROMPT=none` | Legacy no-Pi-prompt mode; disables raw summaries |
40
40
  | `XDG_STATE_HOME` | Base directory for best-effort metadata ledger diagnostics |
41
41
 
42
- Append prompt mode is unsupported. Prompt replacement uses a version-qualified private settings route with explicit workspaceRoot, not a public per-turn prompt API. Only the current Pi MCP toolset is enabled; inventory-derived skills, named reminders and workflow triggers are disabled. Configuration failures never fall back to vendor defaults. Developer workspace, permissions and memory context remain: this is **not a vendor-free prompt**. Universal reminder suppression lacks an enabled-reminder positive control.
42
+ Prompt replacement uses private settings with explicit workspaceRoot, not a public per-turn prompt API. If experimental replacement is not negotiated, the host reopens before submitting a turn with the supported `run.developer_prompt` mechanism: Pi’s instructions are appended to Muse’s, not replacing them, with a typed notice. Only the current Pi MCP toolset is enabled; inventory-derived skills, named reminders and workflow triggers are disabled. Missing session MCP refuses with build and cause; there is no vendor-tool fallback. Developer workspace, permissions and memory context remain: this is **not a vendor-free prompt**. Universal reminder suppression lacks an enabled-reminder positive control.
43
43
 
44
44
  Muse sees names such as `mcp__pi__read`; Pi's actual names, schemas and execution remain unchanged. The private configuration requests Ask-me permissions and verifies human-reviewer readback, avoiding an extra automatic approval-judge request. This does not make Pi tools read-only.
45
45
 
@@ -57,7 +57,7 @@ For a desired 450,000-token compaction boundary, calculate `reserveTokens = actu
57
57
 
58
58
  ### Parallel tools, long tools, abort and steering
59
59
 
60
- Coding requires the pinned experimental `rawLog` capability, `session.live` subscription and complete `assistant_tool_calls_committed` boundary. Missing support fails before inference, without timers or single-call fallbacks. One Pi assistant contains the ordered tool batch; Pi validates/coerces its original arguments and journals validation errors or execution results before native approvals are released for exact receipt retrieval. Invalid arguments therefore produce the normal Pi validation message, not an opaque native approval denial. Native/MCP identity still binds the unchanged original arguments, including when Pi coerces them for execution. Raw records are consumed in memory, not logged wholesale.
60
+ Parallel coding requires matching qualification evidence, the experimental `rawLog` grant, a `session.live` subscription and schema-checked `assistant_tool_calls_committed` boundaries. Unknown builds, missing support, gaps or shape mismatches degrade to sequential tools with one notice, without timers, replay or client substitution. Concurrent native MCP calls queue and are verified one at a time. A degradation also releases approvals waiting on a lost boundary, so fallback cannot strand the turn. One Pi assistant contains the ordered tool batch; Pi validates/coerces its original arguments and journals validation errors or execution results before native approvals are released for exact receipt retrieval. Invalid arguments therefore produce the normal Pi validation message, not an opaque native approval denial. Native/MCP identity still binds the unchanged original arguments, including when Pi coerces them for execution. Raw records are consumed in memory, not logged wholesale.
61
61
 
62
62
  **Long-tool limit:** a historical native MCP task timed out around 300 seconds while Pi was still running. Approval holding now avoids opening that native call during Pi execution. One synthetic 301-second live tool passed with the native MCP call open only briefly. That establishes the measured interval, **not unlimited approval patience or arbitrary long-build support**. No vendor no-deadline control is qualified. A late denial, timeout or host death can leave a real Pi side effect without a verified native receipt. Fencing cannot undo it or silently kill Pi's executor. Inspect uncertain effects before a new request; unknown work is never automatically replayed.
63
63
 
@@ -73,7 +73,7 @@ No pinned SDK per-turn disable-retry control is qualified. Startup retry setting
73
73
 
74
74
  Muse receipts can replace secret-like text, including source-code token prefixes, with `[REDACTED]`. **What the model actually consumed is unknown.** No supported disable-redaction control was found in the inspected pinned surfaces, and no encoding/reflow bypass is used.
75
75
 
76
- Accepted redaction needs nonempty single-line removed text and one unambiguous positional alignment. Line-start, line-end and whole-line loss continue as declared-lossy; adjacent vendor markers are one combined nonempty loss region, without claiming an internal split. If a marker run mixes a literal Pi marker and a new redaction, only a uniquely aligned individual-token parse may accept it. Literal markers remain literal. Ambiguous alignment, newline removal or any other changed text still stops. Surrounding bytes are verified, not bytes inside holes or whether those bytes were secrets. Metadata diagnostics retain offsets, lengths and hashes, never removed text. `exactModelConsumption:false` means absence of proof, not proof that input was altered.
76
+ Declared redaction needs at least one positional alignment with nonempty single-line holes. Line-start, line-end and whole-line loss continue as declared-lossy; adjacent markers form one combined region, without claiming an internal split. Ambiguous alignments also continue: evidence records all viable start/end boundaries and the covering source range, explicitly marked ambiguous rather than inventing an exact removal. If that region swallows literal source markers their identity is likewise uncertain; unchanged literal markers alone never declare loss. The pinned client also canonicalizes a case-insensitive `bearer ` prefix to `Bearer ` immediately before a redaction. That narrowly located codec transformation is separately hashed and declared, not treated as permission to normalize arbitrary text. Newline removal, impossible alignment, changed text outside the declared regions, status changes and image metadata changes still fence. Surrounding bytes are verified, not bytes inside holes or whether they were secrets. Ledger rows link native/Pi call IDs, journal entry, tool/source path and original part byte ranges; ambiguous ranges retain candidate boundaries. Diagnostics contain offsets, lengths and hashes, never removed text. `exactModelConsumption:false` never attests consumption of the original bytes.
77
77
 
78
78
  **Native empty-part projection:** successful results fold chunks with LF only after accumulated nonempty output, so leading empty parts add no separator while later empty parts do. An entirely empty success has the exact native display sentinel `[MCP tool returned no content]`. Failed results instead LF-join all text parts (including leading empty text), omit images, and use `MCP tool returned an error` if their joined text is empty. These are pinned-client receipt codecs, not global text cleanup.
79
79