@kya-os/checkpoint-nextjs 1.0.1 → 1.1.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,75 @@
1
1
  # @kya-os/checkpoint-nextjs
2
2
 
3
+ ## 1.1.0 — 2026-05-17
4
+
5
+ Closes [SDK-Envelope-Plumbing-1 (#2594)](https://github.com/Know-That-Ai/agent-shield/issues/2594).
6
+ Wires MCP-I envelope verification through Next.js middleware — Bench-Before-After-1's
7
+ `verified_mcp_i` traffic case was provably blocked by SDK glue (not engine
8
+ capability — the engine verifies at 47µs Criterion local p50). All three transports
9
+ the orchestrator supports now work from a Next.js consumer.
10
+
11
+ ### New config (additive — no breaking changes)
12
+
13
+ - `CheckpointConfig.legacyEnvelopeFallback?: boolean` (default `false`) — accept
14
+ envelopes via the legacy `KYA-Delegation` HTTP header alongside the canonical
15
+ body form. Use for agents that pre-date Envelope-1 (#2537).
16
+ - `CheckpointConfig.drainJsonBody?: boolean` (default `true`) — read the request
17
+ body when `content-type` is `application/json` so the orchestrator can extract
18
+ `_meta.proof.jws`. The translator uses `req.clone()` to preserve the original
19
+ stream for downstream handlers. Set `false` for streaming-sensitive routes
20
+ that can't tolerate the clone overhead; in that case route envelopes through
21
+ the `KYA-Delegation` header transport instead.
22
+
23
+ ### New supported transports
24
+
25
+ | Transport | Form | Config required |
26
+ | ------------------------------------- | ------------------------------------------------- | ----------------------------------------- |
27
+ | Canonical body (spec form) | `_meta.proof.jws` field in a JSON request body | none — `drainJsonBody` defaults to `true` |
28
+ | Legacy header (Envelope-1 transition) | `KYA-Delegation` HTTP header carrying compact JWS | `legacyEnvelopeFallback: true` |
29
+
30
+ Both transports work end-to-end against the Rust `kya-os-engine` via WASM,
31
+ including DID resolution (did:web + did:key), Ed25519 signature verification,
32
+ JCS canonicalization, policy + reputation checks. See the engine's Criterion
33
+ suite at `rust/crates/kya-os-engine/benches/bouncer_verify.rs` for the per-stage
34
+ cost breakdown.
35
+
36
+ ### Factory clarity
37
+
38
+ `createCheckpointWasmMiddleware` JSDoc updated to clearly document it as
39
+ **pattern-detection only** (no envelope verification). Customers needing
40
+ verification are pointed to `withCheckpoint` (the orchestrator-capable factory)
41
+ in the JSDoc + example block.
42
+
43
+ ### Bench-Before-After-1 follow-up
44
+
45
+ This release unblocks the verified_mcp_i measurement deferred in
46
+ `docs/benchmarks/bench-before-after-1.md` §3.7. After upgrading
47
+ `sites/nextjs-checkpoint/` to 1.1.0 and redeploying bench-new, sub-phase 3 will
48
+ be re-run with the actual verify-success path exercised. The §3.8 "Verify-success
49
+ measurement" section will then be appended to the report.
50
+
51
+ ### Migration
52
+
53
+ No code changes required for existing 1.0.x consumers — both new fields are
54
+ optional with safe defaults. Consumers wanting envelope verification should:
55
+
56
+ ```diff
57
+ export default withCheckpoint({
58
+ tenantHost: 'acme.checkpoint.example',
59
+ + // Accept legacy KYA-Delegation-header envelopes (Envelope-1 transition)
60
+ + legacyEnvelopeFallback: true,
61
+ // drainJsonBody defaults to true; canonical _meta.proof.jws body works out of the box
62
+ });
63
+ ```
64
+
65
+ The body-drain default of `true` is a meaningful behavior change for streaming
66
+ middlewares — those should explicitly set `drainJsonBody: false`. Reason for
67
+ defaulting on: the alternative (silent fall-through to PlainHttp for every JSON
68
+ request) is the bug `#2594` was filed to fix; a config default that preserves
69
+ the bug isn't a fix.
70
+
71
+ ---
72
+
3
73
  ## 1.0.1 — 2026-05-17
4
74
 
5
75
  Security + rename-completeness patch on top of 1.0.0. **All 1.0.0 users