@byollm/protocol 0.1.0-alpha.6 → 0.1.0-alpha.61

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/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  > [!WARNING]
2
- > **Alpha (`0.1.0-alpha.6`) — under active development. Don't use this yet.**
2
+ > **Alpha (`0.1.0-alpha.61`) — under active development. Don't use this yet.**
3
3
  >
4
4
  > Install it deliberately: `npm install @byollm/protocol@alpha`.
5
5
  >
@@ -11,12 +11,114 @@
11
11
  > npm assigns `latest` on a first publish and won't let it be removed, so a
12
12
  > bare install resolves here too. This notice is the only guard — deliberately
13
13
  > not an npm deprecation, which would read as *abandoned* rather than *early*.
14
- > Ask for `@alpha` explicitly so your lockfile records that you meant to.
14
+ > Ask for `@alpha` explicitly so your lockfile records that you meant to.>
15
+ > **`alpha.15` is a breaking wire change, and it breaks daemons and relays —
16
+ > not app authors.** If you call `app.enqueue(...)` and read results, nothing
17
+ > in your code changes. If you run a daemon or an upstream, every package must
18
+ > move together: a mixed pair refuses on both sides, because both ends parse
19
+ > `.strict()`.
20
+ >
21
+ > What moved, all of it reconciling the frozen `byollm_009` with its code:
22
+ > `JobStub` gains `site` (the site's identity key id) and loses
23
+ > `audienceAllow`; `ResultRequest` gains `leaseId`; `HeartbeatResponse` loses
24
+ > `leases`, which nothing read; `WireErrorCode` gains `not-ready`,
25
+ > `clock-skew` and `forbidden`, and `403` is `forbidden` rather than
26
+ > `unauthorized`. `RESULT_PROVENANCE` is superseded by
27
+ > `PROVENANCE_NAMES_DEVICE`. See `byollm_009` Amendment A.>
28
+ > **`alpha.16` is a breaking wire change — daemons and relays again, not app
29
+ > authors.** `app.enqueue(...)` and reading results are unchanged. All five
30
+ > packages move together: both ends parse `.strict()`, so a mixed pair
31
+ > refuses.
32
+ >
33
+ > What moved, all of it Tier 2 of `cloud_008`: `model`, `backendClass` and
34
+ > `durationMs` come off `ResultRequest` and are sealed **inside** the result
35
+ > envelope as `SealedOutcome = { outcome, ran }` — so a daemon can no longer
36
+ > declare a model it did not sign, and a relay carries neither.
37
+ > `HeartbeatResponse` loses `leases` (nothing read it) and now reports real
38
+ > cancellations instead of an empty list. `WireErrorCode` gains `forbidden`
39
+ > for 403, leaving `unauthorized` at exactly 401. The relay gained a
40
+ > site-plane `cancel` endpoint, honours `stub.deadlineAt`, honours
41
+ > `stub.audience`, and remembers a refusal.>
42
+ > **`alpha.17` is additive** — no wire change. It exports `ReleaseReason`,
43
+ > which `RoutingStore.releaseLeases` names and the package did not export, so
44
+ > the interface was unimplementable outside this repo.>
45
+ > **`alpha.18` is a breaking wire change — daemons and relays, not app
46
+ > authors.** `app.enqueue(...)` and reading results are unchanged. All five
47
+ > packages move together.
48
+ >
49
+ > The **bearer token is gone**: off `PairPollResponse`, off the runner row,
50
+ > off the daemon's pairings file, out of the adapter's schema. It was minted,
51
+ > hashed and stored on two disks and never sent, looked up or compared —
52
+ > `REQUESTS_SIGNED_NOT_BEARER` was enforced by signatures the whole time. If
53
+ > you run the Supabase adapter, apply
54
+ > `20260819000000_drop_runner_token.sql`; `byollm_approve_pairing` now takes
55
+ > one argument. A pairings file written by an older daemon still loads.
56
+ >
57
+ > `model`, `backendClass` and `durationMs` moved **inside** the sealed result
58
+ > (`SealedOutcome = { outcome, ran }`), so a daemon cannot declare a model it
59
+ > did not sign and a relay carries none of them. Writing a `RoutingStore`?
60
+ > `releaseLeases` takes an optional `reason` and `complete` requires
61
+ > `leaseId`, and **an implementation that ignores either still typechecks** —
62
+ > run the store contract tests.>
63
+ > **`alpha.19` is additive on the wire and a behaviour change in every
64
+ > store.** `ResultResponse` gains an optional `duplicate`. Nothing is removed,
65
+ > so an older daemon keeps working — but the *order* two rules are checked in
66
+ > has changed, and a `RoutingStore` implementation must change with it.
67
+ >
68
+ > `complete` now checks **terminal state before holder**, scoped to the device
69
+ > that finished the job: a replay from that device is answered `duplicate:
70
+ > true` with a 2xx, and anyone else gets exactly the refusal they would get
71
+ > for a job that is not terminal. Previously `RESULT_IDEMPOTENT` held only
72
+ > because the lease is nulled on success, so the holder check tripped first —
73
+ > deleting the idempotency branch failed no test. Run the store contract
74
+ > tests; the compiler cannot see this.
15
75
  >
16
76
  > **`alpha.3` is a breaking change.** `BackendDescriptor.account` is gone —
17
77
  > read `cost` (`free` / `metered` / `subscription`) instead. Four new MUSTs
18
78
  > come with it; see `byollm_007`.
19
79
 
80
+ <!-- release-note 0.1.0-alpha.21 -->
81
+ > [!NOTE]
82
+ > **`0.1.0-alpha.20` is not a complete release — do not pin it.** Four
83
+ > packages published and `@byollm/server` did not: a Sigstore
84
+ > transparency-log 409 on its provenance attestation. The workflow's
85
+ > "already published" guard correctly refuses to resume a partial publish,
86
+ > so `0.1.0-alpha.61` is that release, whole.
87
+ >
88
+ > If you run the Supabase adapter, `alpha.21` needs
89
+ > `20260819010000_completed_by_lease_id.sql`: alpha.19 shipped §3.6's
90
+ > ordering without the column it stores the grant in.
91
+
92
+ <!-- release-note 0.1.0-alpha.40 -->
93
+ **`byollm install` — stop keeping a terminal open.** The daemon can now run
94
+ under your computer's own supervisor and restart itself if it stops: a launchd
95
+ agent on macOS, a `systemd --user` unit on Linux, a logon task on Windows. All
96
+ user-level — no root, no system directories, and `byollm uninstall` takes it
97
+ away. `byollm status` gained a line saying whether it is actually supervised
98
+ right now, including the state that matters most: installed but not running,
99
+ which looks fine from an app's dashboard and serves nothing.
100
+
101
+ If you are running via `npx`, install properly first (`npm install -g
102
+ byollm@alpha`) — `install` refuses to supervise a copy in npx's cache, because
103
+ npm deletes that directory and the service would fail at some later boot.
104
+
105
+ <!-- release-note 0.1.0-alpha.41 -->
106
+ **`onNoRunner` takes a string.** Your fallback answer is your own value, not
107
+ wire data, and handing back a whole result record for it was ceremony — the
108
+ README's own example got the shape wrong, which is how this was found.
109
+
110
+ ```ts
111
+ const { outcome, fallback } = await job.result({
112
+ onNoRunner: () => runOnHostedModel(transcript),
113
+ });
114
+ ```
115
+
116
+ Whatever you return, `result()` labels it `fallback: true` — the stamp is
117
+ applied by the wait, not taken from you, so an answer that did not run on
118
+ somebody's device cannot be reported as though it did (`FALLBACK_LABELED`).
119
+ Both delivery channels do it, polling and Supabase Realtime. Records still
120
+ work; they just get labelled too.
121
+
20
122
  # `@byollm/protocol`
21
123
 
22
124
  The BYOLLM wire contract: TypeScript types, zod schemas, and the pure rules
@@ -64,10 +166,10 @@ job's owner.
64
166
  import { matchAudience } from "@byollm/protocol";
65
167
 
66
168
  matchAudience(
67
- { owner: "alice", audience: "named" },
169
+ { owner: "alice", audience: "team" },
68
170
  {
69
171
  owner: "bob",
70
- offerScope: "named",
172
+ offerScope: "team",
71
173
  account: "open",
72
174
  // The daemon's OWN allowlist decides — never the server's assertion.
73
175
  locallyAllows: (owner) => owner === "alice",