@supersuit/artifacts 0.57.2 → 0.58.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
@@ -3,6 +3,19 @@
3
3
  `@supersuit/artifacts`. One entry per version, newest first. Each entry says what changed, how a
4
4
  host can tell whether it is affected (DETECTOR), what a host does about it (REMEDY), and the tests.
5
5
 
6
+ ## 0.58.0 (2026-10-27)
7
+
8
+ **A link's provenance can name its reader by an opaque person id.** Superlinks step 6: a funnel
9
+ suggestion ("Ada read the proposal to the end: move her to proposed?") has to know whose opens these
10
+ are. A label is a name and cannot be trusted as an identity; the sender's opaque person id can.
11
+
12
+ - `provenance.subject`: a person id, `p_` and 8 characters from the sender's records. Anything else
13
+ (a name, a different shape) is refused 400 and nothing is added. Kept on the row and answered back
14
+ like the rest of the provenance.
15
+ - DETECTOR: a sender that posts `provenance.subject` and reads it back missing is on 0.57.x or older.
16
+ - REMEDY: update the host.
17
+ - Tests: recipients-api.test.tsx (subject kept; a name and malformed ids refused).
18
+
6
19
  ## 0.57.2 (2026-10-26)
7
20
 
8
21
  **0.57.1, published.** 0.57.1 was tagged but never reached npm: its publish run refused it, because
package/README.md CHANGED
@@ -1085,7 +1085,7 @@ mark is counted as before-send; senders mark as soon as delivery is confirmed.
1085
1085
  ### Who minted a link (0.53.0)
1086
1086
 
1087
1087
  Every link can say who made it, on whose authority, and when: `add: [{ label, provenance: { actor,
1088
- authority, at?, link?, funnel?, stage? } }]`. `actor` is a person acting by hand or "<person>'s
1088
+ authority, at?, link?, funnel?, stage?, subject? } }]`; `subject` (0.58.0) is the sender's opaque person id (`p_` and 8 characters), never a name. `actor` is a person acting by hand or "<person>'s
1089
1089
  Pluma"; `authority` names what they acted under ("approved by <person> on the send card", "on
1090
1090
  <person>'s explicit request", "under the recurrent <name>"), with `link` to the session or message
1091
1091
  where one exists (https only); `at` defaults to now. `funnel` (a slug) and `stage` (an id, only with
@@ -36,6 +36,7 @@ export type Provenance = {
36
36
  link?: string;
37
37
  funnel?: string;
38
38
  stage?: string;
39
+ subject?: string;
39
40
  };
40
41
  export type RecipientsRecord = {
41
42
  recipients: Record<string, Recipient>;
@@ -18,7 +18,7 @@ const SLUG = /^[a-z0-9][a-z0-9_-]{0,63}$/;
18
18
  * now), and the funnel step it serves. -> the clean record, or the reason it is refused. */
19
19
  export function readProvenance(v, now = new Date()) {
20
20
  if (!v || typeof v !== 'object' || Array.isArray(v))
21
- return { ok: false, why: 'provenance is { actor, authority, at?, link?, funnel?, stage? }' };
21
+ return { ok: false, why: 'provenance is { actor, authority, at?, link?, funnel?, stage?, subject? }' };
22
22
  const p = v;
23
23
  const text = (x, max) => (typeof x === 'string' && x.trim() ? x.trim().slice(0, max) : '');
24
24
  const actor = text(p.actor, 120), authority = text(p.authority, 300);
@@ -42,8 +42,12 @@ export function readProvenance(v, now = new Date()) {
42
42
  return { ok: false, why: 'provenance.funnel must be a funnel slug' };
43
43
  if (p.stage !== undefined && (typeof p.stage !== 'string' || !SLUG.test(p.stage) || p.funnel === undefined))
44
44
  return { ok: false, why: 'provenance.stage must be a stage id, with its funnel' };
45
+ // The reader by the sender's opaque person id (superlinks step 6), so a funnel can tell whose opens
46
+ // these are without a name ever reaching the host.
47
+ if (p.subject !== undefined && (typeof p.subject !== 'string' || !/^p_[0-9abcdefghjkmnpqrstvwxyz]{8}$/.test(p.subject)))
48
+ return { ok: false, why: 'provenance.subject must be an opaque person id (p_ and 8 characters), never a name' };
45
49
  const at = typeof p.at === 'string' ? new Date(p.at).toISOString() : now.toISOString();
46
- return { ok: true, value: { actor, authority, at, ...(link ? { link } : {}), ...(p.funnel ? { funnel: p.funnel } : {}), ...(p.stage ? { stage: p.stage } : {}) } };
50
+ return { ok: true, value: { actor, authority, at, ...(link ? { link } : {}), ...(p.funnel ? { funnel: p.funnel } : {}), ...(p.stage ? { stage: p.stage } : {}), ...(p.subject ? { subject: p.subject } : {}) } };
47
51
  }
48
52
  const none = () => new NextResponse(null, { status: 204, headers: { 'cache-control': 'no-store' } });
49
53
  const json = (b, status = 200) => NextResponse.json(b, { status, headers: { 'cache-control': 'no-store' } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supersuit/artifacts",
3
- "version": "0.57.2",
3
+ "version": "0.58.0",
4
4
  "description": "Publish markdown as branded, read-aloud pages from a Next.js app: the artifacts store, the route factory, the read-along reader, brand packs, password and confidential pages, and share cards.",
5
5
  "license": "MIT",
6
6
  "type": "module",