@forestrie/forestrie-cli 0.9.0 → 0.10.0

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.
@@ -10,6 +10,8 @@ import {
10
10
  } from "../lib/onboard-genesis-body.js";
11
11
  import type { OnboardGenesisOptions } from "../options/onboard-genesis.js";
12
12
 
13
+ import { responseProblemDetail } from "../lib/http-problem.js";
14
+
13
15
  /**
14
16
  * FOR-406 (plan-2607-27 W2): operator genesis onboarding — turn a
15
17
  * `forestrie deploy` into a usable forest. POSTs the five-label v2
@@ -138,7 +140,7 @@ export async function runOnboardGenesis(
138
140
  command: "onboard-genesis",
139
141
  message: `genesis POST rejected: HTTP ${res.status}`,
140
142
  httpStatus: res.status,
141
- detail: (await res.text()).slice(0, 512),
143
+ detail: await responseProblemDetail(res),
142
144
  });
143
145
  return;
144
146
  }
@@ -16,6 +16,8 @@ import { loadEs256SigningKey } from "../lib/sign-statement-key.js";
16
16
  import { signX402Payment } from "../lib/x402-payment.js";
17
17
  import type { OnboardRequestOptions } from "../options/onboard-request.js";
18
18
 
19
+ import { responseProblemDetail } from "../lib/http-problem.js";
20
+
19
21
  /**
20
22
  * Self-service onboarding (plan-2607-43 slice 06): create → (pay) → redeem.
21
23
  *
@@ -183,7 +185,7 @@ export async function runOnboardRequest(
183
185
  reportError(out, options, {
184
186
  error: "create_failed",
185
187
  command: "onboard-request",
186
- message: `request rejected: HTTP ${res.status}: ${(await res.text()).slice(0, 300)}`,
188
+ message: `request rejected: HTTP ${res.status}: ${await responseProblemDetail(res, 300)}`,
187
189
  httpStatus: res.status,
188
190
  });
189
191
  return;
@@ -271,7 +273,7 @@ export async function runOnboardRequest(
271
273
  reportError(out, options, {
272
274
  error: "redeem_failed",
273
275
  command: "onboard-request",
274
- message: `redeem rejected: HTTP ${res.status}: ${(await res.text()).slice(0, 300)}`,
276
+ message: `redeem rejected: HTTP ${res.status}: ${await responseProblemDetail(res, 300)}`,
275
277
  httpStatus: res.status,
276
278
  });
277
279
  return;
@@ -23,22 +23,28 @@ import {
23
23
  * Both add `--univocity --log-id --rpc-url` for the chain-anchored check (the
24
24
  * only networked path).
25
25
  *
26
- * Trust anchors (FOR-297 ladder; each rung needs strictly less trust):
27
- * 1. `--known-log-key` — caller-known log OWNER key: offline, no genesis;
28
- * the key↔log binding is asserted by the key's provenance, not proven;
29
- * no lifecycle visibility, no split-view protection.
30
- * 2. `--genesis` — genesis-derived roots (the grant-chain walk, approach A,
31
- * will derive per-log bindings from genesis + public tiles).
32
- * 3. `--known-accumulator` — cached, auditable chain read: contract-enforced
33
- * state (signature + grant chain + split-view for covered entries),
34
- * fully offline; `--massif` (tiles) or `--consistency-proof` (portable
35
- * top-up artifact) extends older receipts to a newer snapshot.
36
- * 4. `--checkpoint-chain` — retained `.sth` fold (FOR-368): authenticated
37
- * accumulator at every retained seal from the public log store alone;
38
- * signatures root in rung 1/2 trust.
39
- * 5. `--rpc-url` — live chain read: rung 3 plus freshness (the RPC provider
40
- * is itself a trusted chain reader); buried peaks resolve via the
41
- * CheckpointPublished history scan (public chain data only).
26
+ * Trust roots (protocol: spec/receipt-trust-model.md). They are alternatives,
27
+ * not an ordering — each answers a different subset of the four trust
28
+ * questions, and the report says which root was used:
29
+ * - `--known-log-key` — the known log key root: an owner key the caller holds
30
+ * out of band; offline, no genesis; the key↔log binding is asserted by the
31
+ * key's provenance, not proven; no split-view protection.
32
+ * - `--genesis` — the genesis root: the forest genesis document's bootstrap
33
+ * key, which roots the root log or a delegation directly under it. A deeper
34
+ * child log's authority needs the off-chain grant-chain walk, which no
35
+ * verifier implements (spec/implementation-status.md).
36
+ * - `--known-accumulator` — the known accumulator root, from a cached,
37
+ * auditable chain read: the contract-anchored state, fully offline;
38
+ * `--massif` (tiles) or `--consistency-proof` (portable top-up artifact)
39
+ * extends older receipts to a newer snapshot.
40
+ * - `--checkpoint-chain` — the checkpoint chain root: a retained fold of
41
+ * checkpoint objects, an authenticated accumulator at every retained seal
42
+ * from the public log store alone; signatures root in the genesis or known
43
+ * log key root.
44
+ * - `--rpc-url` — the known accumulator root from a live chain read, plus
45
+ * freshness (the RPC provider is itself a trusted chain reader); buried
46
+ * peaks resolve via the CheckpointPublished history scan (public chain
47
+ * data only).
42
48
  */
43
49
 
44
50
  type AnchorFields = {
@@ -75,8 +81,8 @@ type AnchorFields = {
75
81
  /**
76
82
  * Caller-known log OWNER key (the delegation-cert issuer), base64 `x||y`
77
83
  * (64 bytes, `KNOWN_LOG_KEY`) — FOR-297 D1. An offline trust anchor that
78
- * replaces the genesis-derived roots: the "known hosts" rung of the trust
79
- * ladder. It asserts (does not prove) the key↔log binding, and gives no
84
+ * replaces the genesis root: the known log key root of the trust model.
85
+ * It asserts (does not prove) the key↔log binding, and gives no
80
86
  * grant-lifecycle visibility or split-view protection — the grant-chain
81
87
  * walk (approach A) derives the binding; chain anchors add split-view.
82
88
  */