@byollm/relay 0.1.5-beta.2 → 0.1.6

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,11 +1,16 @@
1
- <!-- release-note 0.1.1 -->
2
- > **`0.1.5-beta.2` is documentation only — nothing to upgrade.** `PROTOCOL_VERSION`
3
- > is still `2`, so a 0.1.0 party and a 0.1.1 party talk to each other in both
4
- > directions. No dependency, schema, wire field or on-disk shape moved.
1
+ <!-- release-note 0.1.6 -->
2
+ > **`0.1.6`: no change to what the relay does.** A new section, "A limit:
3
+ > keep the ledger with the leases", names what an operator who splits the
4
+ > blob ledger from the routing store gives up (#9522), and the suite now runs
5
+ > the published `byollm@0.1.4` daemon against this relay with the 0.1.5
6
+ > kinds queued (#9552). `PROTOCOL_VERSION` is still `2`. Coming from 0.1.4,
7
+ > update the relay before any daemon or site that turns on a 0.1.5 kind, and
8
+ > give it a `BlobStore`: `docs/release-notes/0.1.5.md`. Full note:
9
+ > `docs/release-notes/0.1.6.md`.
5
10
  >
6
11
  > This README used to open with a stack of release notes instead of with the
7
12
  > package. The history moved to `docs/release-notes/` and `CHANGELOG.md`,
8
- > where none of it was lost. Full note: `docs/release-notes/0.1.1.md`.
13
+ > where none of it was lost.
9
14
 
10
15
  # `@byollm/relay`
11
16
 
@@ -136,7 +141,7 @@ What the package decides, whatever the store:
136
141
  - **Sizes are read, not trusted.** A slot's size is in the blob id the relay
137
142
  mints. A job is queued only if every input it was issued a slot for is
138
143
  stored at that size, and an `ok` result is accepted only if its outputs
139
- are.
144
+ are, with the one limit below.
140
145
  - **Blobs go with the job.** Inputs when the result is accepted; outputs when
141
146
  the site says it holds them, or an hour after it collected the result; and
142
147
  whatever is left a day after the job's deadline. `Relay.sweep()` runs the
@@ -147,6 +152,28 @@ What the package decides, whatever the store:
147
152
  result and an hour after collection, need the record: keep the ledger
148
153
  somewhere that survives a restart if you want them kept across one.
149
154
 
155
+ ### A limit: keep the ledger with the leases
156
+
157
+ `RelayBlobs.outputFault` checks the output slots it finds in the ledger under
158
+ the job's lease. Unlike `inputFault`, it does not rebuild lost slots from the
159
+ store. So if the ledger loses its records while the lease survives, an `ok`
160
+ `llm.image` result is accepted without its outputs' sizes being checked. That
161
+ happens with a `MemoryBlobLedger` behind a durable or shared `RoutingStore`,
162
+ or with a ledger and a routing store in different Valkeys.
163
+
164
+ What still protects the site:
165
+
166
+ - `downloadUrl` refuses any object whose stored size is not the size in its
167
+ id, so the site gets a 404, not a wrong image.
168
+ - A store that enforces the signed length, such as GCS, cannot hold a
169
+ wrong-size object at all.
170
+
171
+ What to do about it: keep the `BlobLedger` and the leases in the same store,
172
+ as the hosted hub does. Then whatever loses the ledger loses the lease too,
173
+ and the result is refused before `outputFault` runs. The fix is to put the
174
+ lease in the object name the next time the blob path changes (byollm_021,
175
+ decision #8559).
176
+
150
177
  ## Breaking before `0.1.0`: `RelayState` is async
151
178
 
152
179
  Every method on `RelayState` now returns a `Promise`, and `Relay.sweep()` and
package/dist/index.js CHANGED
@@ -1248,6 +1248,15 @@ var RelayBlobs = class {
1248
1248
  /**
1249
1249
  * Why an `ok` result may not be accepted, or `null` when it may — the
1250
1250
  * same check an input gets, on the outputs issued under this lease.
1251
+ *
1252
+ * Unlike `inputFault`, a lost record is not rebuilt from the store,
1253
+ * so a ledger that forgot this job while its lease survived accepts the
1254
+ * result unchecked. That is a documented limit (README, "A limit: keep the
1255
+ * ledger with the leases"; decision #8559). Copying `inputFault`'s rebuild
1256
+ * here would not close it: the object name carries no lease, so the
1257
+ * rebuilt slots have none, and the loop below skips every slot whose lease
1258
+ * is not this job's. The fix is the lease in the object name, at the next
1259
+ * change to the blob path (byollm_021).
1251
1260
  */
1252
1261
  async outputFault(job) {
1253
1262
  const record = await this.#ledger.record(job.siteId, job.jobId);