nostr-veil 0.21.0 → 0.23.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/README.md CHANGED
@@ -162,7 +162,7 @@ The resulting `assertion` is a plain `EventTemplate` you sign and publish like a
162
162
 
163
163
  | Export | Description |
164
164
  |--------|-------------|
165
- | `USE_CASE_PROFILES` | Built-in machine-readable profiles for the documented use cases |
165
+ | `USE_CASE_PROFILES` | Built-in machine-readable profiles for the documented use cases, including proof claims, limitations, required controls, and recommended actions |
166
166
  | `USE_CASE_PROFILE_BY_ID` | Lookup table keyed by use-case slug |
167
167
  | `verifyUseCaseProfile(events, profile, options)` | Verify NIP-85 syntax, proof v2, subject binding, threshold, freshness, accepted circles, and federation policy |
168
168
  | `createCircleManifest(options)` | Build a machine-readable circle manifest with member list, allowed profiles, expiry, revocation, and supersession metadata |
@@ -172,11 +172,17 @@ The resulting `assertion` is a plain `EventTemplate` you sign and publish like a
172
172
  | `createSignedDeploymentBundle(policy, options)` | Sign a deployment policy and its manifests as trusted operator configuration |
173
173
  | `verifyDeploymentBundle(events, bundle, options?)` | Verify a signed bundle from trusted publishers, then verify the bundled deployment policy |
174
174
  | `verifyProductionDeployment(events, bundle, options?)` | One-call production gate that also requires an expiring bundle and signed relay-fetched events by default |
175
+ | `createProductionDecisionReport(result)`, `verifyProductionDeploymentReport(events, bundle, options?)` | Produce an audit/UI-ready decision report with recommended action, issue remediation, and control status |
175
176
  | `VerificationIssue`, `VerificationIssueCode` | Stable machine-readable issue codes returned alongside human-readable errors |
176
177
  | `explainVerificationIssue(issueOrCode)`, `remediationForIssue(issueOrCode)` | Turn stable issue codes into concrete operator or verifier remediation guidance |
177
178
  | `canonicalRelaySubject`, `canonicalServiceSubject`, `canonicalNip05Subject`, `canonicalDomainSubject`, `canonicalLnurlpSubject`, `canonicalNip96Subject`, `canonicalNpmPackageSubject`, `canonicalGitRepositorySubject`, `canonicalGithubRepositorySubject`, `canonicalMaintainerSubject` | Canonical subject helpers for common real-world identifiers |
178
179
  | `canonicalPubkeySubject`, `canonicalEventSubject`, `canonicalAddressSubject` | Canonical subject helpers for Nostr-native subjects |
179
180
 
181
+ The built-in profiles include safety metadata for production UX and agentic
182
+ integrations: `proofClaims`, `proofLimitations`, `requiredControls`, and
183
+ `recommendedActions`. Use those fields to show what the proof actually supports
184
+ and which real-world checks must still happen outside nostr-veil.
185
+
180
186
  ### Signing utility (root export)
181
187
 
182
188
  | Export | Description |
@@ -270,7 +276,10 @@ composing lower-level checks. It returns the existing human-readable `errors`
270
276
  plus stable `issues[].code` values such as `bundle.signer_untrusted`,
271
277
  `event.signature_invalid`, `circle.unaccepted`, and `metric.below_min`. Use
272
278
  `explainVerificationIssue()` or `remediationForIssue()` to show the exact
273
- operator action for each failure.
279
+ operator action for each failure. For application UI, audit logs, and support
280
+ runbooks, `verifyProductionDeploymentReport()` returns the same decision with a
281
+ recommended action, expanded issue remediations, and pass/fail/not-checked
282
+ status for the production controls.
274
283
 
275
284
  ---
276
285
 
@@ -7,4 +7,5 @@ export * from './manifest.js';
7
7
  export * from './bundle.js';
8
8
  export * from './issues.js';
9
9
  export * from './production.js';
10
+ export * from './report.js';
10
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/profiles/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,eAAe,CAAA;AAC7B,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA;AAC7B,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,iBAAiB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/profiles/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,eAAe,CAAA;AAC7B,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA;AAC7B,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,aAAa,CAAA"}
@@ -7,4 +7,5 @@ export * from './manifest.js';
7
7
  export * from './bundle.js';
8
8
  export * from './issues.js';
9
9
  export * from './production.js';
10
+ export * from './report.js';
10
11
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/profiles/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,eAAe,CAAA;AAC7B,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA;AAC7B,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,iBAAiB,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/profiles/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,eAAe,CAAA;AAC7B,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA;AAC7B,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,aAAa,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"profiles.d.ts","sourceRoot":"","sources":["../../src/profiles/profiles.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAiB,cAAc,EAAE,MAAM,YAAY,CAAA;AA+B/D,eAAO,MAAM,uCAAuC,gBAalD,CAAA;AAEF,eAAO,MAAM,qCAAqC,gBAahD,CAAA;AAEF,eAAO,MAAM,4BAA4B,gBAcvC,CAAA;AAEF,eA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AAO,MAAM,4BAA4B,gBAyCvC,CAAA;AAEF,eAAO,MAAM,qCAAqC,gBA8BhD,CAAA;AAEF,eAAO,MAAM,kDAAkD,gBAiC7D,CAAA;AAEF,eAAO,MAAM,iCAAiC,gBAiC5C,CAAA;AAEF,eAAO,MAAM,iBAAiB,2OAegB,CAAA;AAE9C,eAAO,MAAM,sBAAsB,EAE9B,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,cAAc,GAAG,SAAS,CAAC,CAAC,CAAA;AAEzD,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAExE"}
@@ -23,6 +23,44 @@ const commonFailurePolicy = [
23
23
  'Reject assertions from circles that are not accepted by the deployment policy.',
24
24
  'Treat the score as a threshold signal, not as proof that the underlying real-world claim is true.',
25
25
  ];
26
+ const commonProofClaims = [
27
+ 'Distinct members of the accepted circle contributed to the same canonical subject.',
28
+ 'The published aggregate metrics match the signed anonymous contributions.',
29
+ 'Proof v2 binds the contribution to the NIP-85 kind and subject hint used by the profile.',
30
+ ];
31
+ const commonProofLimitations = [
32
+ 'It does not prove the underlying real-world claim is true.',
33
+ 'It does not prove the circle is socially legitimate or Sybil-resistant.',
34
+ 'It does not replace deployment policy, freshness, revocation, or evidence handling.',
35
+ ];
36
+ const commonRequiredControls = [
37
+ {
38
+ risk: 'Untrusted or stale circle membership.',
39
+ control: 'Use accepted circle manifests with admission, rotation, revocation, expiry, and conflict rules.',
40
+ },
41
+ {
42
+ risk: 'Ambiguous or replayed subjects.',
43
+ control: 'Canonicalise the subject before signing and verify the exact expected subject, kind, and subject hint.',
44
+ },
45
+ {
46
+ risk: 'Unsafe automatic action from a score alone.',
47
+ control: 'Gate application decisions with metric bounds, freshness, thresholds, audit logs, and manual-review fallbacks.',
48
+ },
49
+ ];
50
+ function safety(options) {
51
+ return {
52
+ proofClaims: [...commonProofClaims, ...options.proofClaims],
53
+ proofLimitations: [...commonProofLimitations, ...options.proofLimitations],
54
+ recommendedActions: options.recommendedActions,
55
+ requiredControls: [...commonRequiredControls, ...options.requiredControls],
56
+ };
57
+ }
58
+ const peopleControls = [
59
+ {
60
+ risk: 'The score could be used as an unappealable judgement about a person.',
61
+ control: 'Publish appeal, evidence-retention, reviewer-conflict, and moderation-escalation rules before acting on the score.',
62
+ },
63
+ ];
26
64
  export const USER_REPUTATION_ABUSE_REPORTING_PROFILE = profile({
27
65
  id: 'user-reputation-abuse-reporting',
28
66
  title: 'User reputation and abuse reporting',
@@ -36,6 +74,18 @@ export const USER_REPUTATION_ABUSE_REPORTING_PROFILE = profile({
36
74
  maxAgeSeconds: 300,
37
75
  metrics: [rankMetric, reportMetric],
38
76
  failurePolicy: commonFailurePolicy,
77
+ ...safety({
78
+ proofClaims: [
79
+ 'The accepted reviewers produced an anonymous threshold signal about the target pubkey.',
80
+ ],
81
+ proofLimitations: [
82
+ 'It does not prove abuse occurred or that a user should be punished automatically.',
83
+ ],
84
+ recommendedActions: [
85
+ 'Show reputation context, queue moderation review, or apply proportionate friction according to the community policy.',
86
+ ],
87
+ requiredControls: peopleControls,
88
+ }),
39
89
  });
40
90
  export const PRIVACY_PRESERVING_ONBOARDING_PROFILE = profile({
41
91
  id: 'privacy-preserving-onboarding',
@@ -50,6 +100,24 @@ export const PRIVACY_PRESERVING_ONBOARDING_PROFILE = profile({
50
100
  maxAgeSeconds: 300,
51
101
  metrics: [rankMetric],
52
102
  failurePolicy: commonFailurePolicy,
103
+ ...safety({
104
+ proofClaims: [
105
+ 'The accepted onboarding circle vouched for the target pubkey without revealing which members contributed.',
106
+ ],
107
+ proofLimitations: [
108
+ 'It does not prove the person is safe, unique, non-Sybil, or entitled to unlimited access.',
109
+ ],
110
+ recommendedActions: [
111
+ 'Use the signal to reduce onboarding friction, then keep normal rate limits, abuse monitoring, and recovery paths.',
112
+ ],
113
+ requiredControls: [
114
+ ...peopleControls,
115
+ {
116
+ risk: 'Onboarding can become a Sybil shortcut.',
117
+ control: 'Combine the score with rate limits, staged permissions, abuse monitoring, and circle accountability.',
118
+ },
119
+ ],
120
+ }),
53
121
  });
54
122
  export const SOURCE_CORROBORATION_PROFILE = profile({
55
123
  id: 'source-corroboration',
@@ -65,6 +133,23 @@ export const SOURCE_CORROBORATION_PROFILE = profile({
65
133
  maxAgeSeconds: 300,
66
134
  metrics: [rankMetric],
67
135
  failurePolicy: commonFailurePolicy,
136
+ ...safety({
137
+ proofClaims: [
138
+ 'The accepted editorial or review circle anonymously corroborated the same source identifier.',
139
+ ],
140
+ proofLimitations: [
141
+ 'It does not prove the source is truthful, safe to expose, or safe to contact.',
142
+ ],
143
+ recommendedActions: [
144
+ 'Use the signal to route editorial attention while preserving separate fact-checking and source-protection workflows.',
145
+ ],
146
+ requiredControls: [
147
+ {
148
+ risk: 'Corroboration can expose source relationships or operational timing.',
149
+ control: 'Use secure collection, batching, minimised logs, source-protection rules, and separate evidence review.',
150
+ },
151
+ ],
152
+ }),
68
153
  });
69
154
  export const EVENT_CLAIM_VERIFICATION_PROFILE = profile({
70
155
  id: 'event-claim-verification',
@@ -79,6 +164,23 @@ export const EVENT_CLAIM_VERIFICATION_PROFILE = profile({
79
164
  maxAgeSeconds: 300,
80
165
  metrics: [rankMetric, reactionMetric],
81
166
  failurePolicy: commonFailurePolicy,
167
+ ...safety({
168
+ proofClaims: [
169
+ 'The accepted fact-checking or moderation circle anonymously scored the exact event id.',
170
+ ],
171
+ proofLimitations: [
172
+ 'It does not prove the event is objectively true or false.',
173
+ ],
174
+ recommendedActions: [
175
+ 'Display context, confidence, or review status beside the event, with correction and dispute paths.',
176
+ ],
177
+ requiredControls: [
178
+ {
179
+ risk: 'A claim score can be mistaken for a final truth judgement.',
180
+ control: 'Maintain methodology, evidence, correction, dispute, and reviewer-conflict policies outside the proof.',
181
+ },
182
+ ],
183
+ }),
82
184
  });
83
185
  export const ARTICLE_RESEARCH_REVIEW_PROFILE = profile({
84
186
  id: 'article-research-review',
@@ -93,6 +195,23 @@ export const ARTICLE_RESEARCH_REVIEW_PROFILE = profile({
93
195
  maxAgeSeconds: 300,
94
196
  metrics: [rankMetric, reactionMetric],
95
197
  failurePolicy: commonFailurePolicy,
198
+ ...safety({
199
+ proofClaims: [
200
+ 'The accepted reviewers anonymously scored the exact addressable article, research note, or long-form record.',
201
+ ],
202
+ proofLimitations: [
203
+ 'It does not prove the research is correct, reproducible, or free of conflicts.',
204
+ ],
205
+ recommendedActions: [
206
+ 'Show review confidence, request further review, or gate publication features according to the editorial policy.',
207
+ ],
208
+ requiredControls: [
209
+ {
210
+ risk: 'A review score can hide methodology or conflicts.',
211
+ control: 'Keep separate methods, evidence, conflict-of-interest, correction, reproducibility, and reviewer-selection policies.',
212
+ },
213
+ ],
214
+ }),
96
215
  });
97
216
  export const RELAY_SERVICE_REPUTATION_PROFILE = profile({
98
217
  id: 'relay-service-reputation',
@@ -108,6 +227,27 @@ export const RELAY_SERVICE_REPUTATION_PROFILE = profile({
108
227
  maxAgeSeconds: 300,
109
228
  metrics: [rankMetric, reactionMetric],
110
229
  failurePolicy: commonFailurePolicy,
230
+ ...safety({
231
+ proofClaims: [
232
+ 'The accepted service-review circle anonymously scored the same relay or service endpoint.',
233
+ ],
234
+ proofLimitations: [
235
+ 'It does not prove live uptime, honest operation, censorship resistance, or absence of malware.',
236
+ ],
237
+ recommendedActions: [
238
+ 'Use the signal for relay or service preference, warnings, or routing hints alongside live telemetry.',
239
+ ],
240
+ requiredControls: [
241
+ {
242
+ risk: 'Service behaviour changes faster than reputation.',
243
+ control: 'Pair the score with uptime probes, latency checks, incident reports, expiry, and downgrade assertions.',
244
+ },
245
+ {
246
+ risk: 'Different service classes on one domain can be confused.',
247
+ control: 'Use separate canonical subjects and namespaces for relays, upload services, moderation APIs, bots, and other services.',
248
+ },
249
+ ],
250
+ }),
111
251
  });
112
252
  export const NIP05_DOMAIN_SERVICE_PROVIDER_TRUST_PROFILE = profile({
113
253
  id: 'nip05-domain-service-provider-trust',
@@ -123,6 +263,27 @@ export const NIP05_DOMAIN_SERVICE_PROVIDER_TRUST_PROFILE = profile({
123
263
  maxAgeSeconds: 300,
124
264
  metrics: [rankMetric],
125
265
  failurePolicy: commonFailurePolicy,
266
+ ...safety({
267
+ proofClaims: [
268
+ 'The accepted provider-review circle anonymously scored the same NIP-05, domain, LNURLp, NIP-96, or service-provider subject.',
269
+ ],
270
+ proofLimitations: [
271
+ 'It does not prove DNS, HTTPS, NIP-05, LNURLp, or NIP-96 verification succeeded.',
272
+ ],
273
+ recommendedActions: [
274
+ 'Show provider trust context or warnings only after the underlying protocol verification still passes.',
275
+ ],
276
+ requiredControls: [
277
+ {
278
+ risk: 'Provider reputation can be confused with protocol verification.',
279
+ control: 'Continue to verify DNS, HTTPS, NIP-05, LNURLp, NIP-96, and service metadata directly.',
280
+ },
281
+ {
282
+ risk: 'Domains and service endpoints can be taken over or delegated.',
283
+ control: 'Use expiry, ownership-change monitoring, incident response, and separate subjects for delegated services.',
284
+ },
285
+ ],
286
+ }),
126
287
  });
127
288
  export const LIST_LABELER_MODERATION_LIST_REPUTATION_PROFILE = profile({
128
289
  id: 'list-labeler-moderation-list-reputation',
@@ -137,6 +298,23 @@ export const LIST_LABELER_MODERATION_LIST_REPUTATION_PROFILE = profile({
137
298
  maxAgeSeconds: 300,
138
299
  metrics: [rankMetric],
139
300
  failurePolicy: commonFailurePolicy,
301
+ ...safety({
302
+ proofClaims: [
303
+ 'The accepted reviewers anonymously scored the exact addressable list, labeler, or moderation-list event.',
304
+ ],
305
+ proofLimitations: [
306
+ 'It does not prove the list is fair, complete, or suitable for every community.',
307
+ ],
308
+ recommendedActions: [
309
+ 'Use the signal to choose, warn about, or review lists while preserving local moderation policy.',
310
+ ],
311
+ requiredControls: [
312
+ {
313
+ risk: 'List reputation can become outsourced moderation without accountability.',
314
+ control: 'Publish reviewer criteria, appeal paths, list-change review, community override rules, and conflict policies.',
315
+ },
316
+ ],
317
+ }),
140
318
  });
141
319
  export const RELEASE_PACKAGE_MAINTAINER_REPUTATION_PROFILE = profile({
142
320
  id: 'release-package-maintainer-reputation',
@@ -155,6 +333,27 @@ export const RELEASE_PACKAGE_MAINTAINER_REPUTATION_PROFILE = profile({
155
333
  ...commonFailurePolicy,
156
334
  'Do not treat the score as a package scan, SBOM, provenance, or reproducible-build proof.',
157
335
  ],
336
+ ...safety({
337
+ proofClaims: [
338
+ 'The accepted security-review circle anonymously scored the exact package, release, repository, or maintainer subject.',
339
+ ],
340
+ proofLimitations: [
341
+ 'It does not prove the package is safe, scanned, reproducibly built, or backed by valid provenance.',
342
+ ],
343
+ recommendedActions: [
344
+ 'Surface reviewed-release confidence, queue manual review, or block high-risk automation until external artefact checks pass.',
345
+ ],
346
+ requiredControls: [
347
+ {
348
+ risk: 'A reputation score can be mistaken for a software supply-chain proof.',
349
+ control: 'Combine it with signatures, provenance, SBOMs, reproducible builds, vulnerability scans, CI, malware checks, and human audit.',
350
+ },
351
+ {
352
+ risk: 'Package, release, repository, and maintainer risk are different.',
353
+ control: 'Use separate canonical subjects for packages, versions, artefact digests, repositories, commits, and maintainer identities.',
354
+ },
355
+ ],
356
+ }),
158
357
  });
159
358
  export const VENDOR_MARKETPLACE_SIGNALS_PROFILE = profile({
160
359
  id: 'vendor-marketplace-signals',
@@ -170,6 +369,23 @@ export const VENDOR_MARKETPLACE_SIGNALS_PROFILE = profile({
170
369
  maxAgeSeconds: 300,
171
370
  metrics: [rankMetric, reactionMetric],
172
371
  failurePolicy: commonFailurePolicy,
372
+ ...safety({
373
+ proofClaims: [
374
+ 'The accepted marketplace or buyer-review circle anonymously scored the same vendor identifier.',
375
+ ],
376
+ proofLimitations: [
377
+ 'It does not prove fulfilment, legality, solvency, product quality, or absence of fraud.',
378
+ ],
379
+ recommendedActions: [
380
+ 'Use the score for warnings, review queues, escrow friction, or search ranking under the marketplace policy.',
381
+ ],
382
+ requiredControls: [
383
+ {
384
+ risk: 'Vendor scores can be gamed or misapplied across contexts.',
385
+ control: 'Use purchase evidence, dispute handling, escrow rules, category-specific policy, and review-fraud monitoring.',
386
+ },
387
+ ],
388
+ }),
173
389
  });
174
390
  export const FEDERATED_MODERATION_PROFILE = profile({
175
391
  id: 'federated-moderation',
@@ -191,6 +407,27 @@ export const FEDERATED_MODERATION_PROFILE = profile({
191
407
  ...commonFailurePolicy,
192
408
  'Reject federations that mix subjects, scopes, or unscoped events.',
193
409
  ],
410
+ ...safety({
411
+ proofClaims: [
412
+ 'Accepted scoped circles contributed enough distinct anonymous reviewers across the federation.',
413
+ ],
414
+ proofLimitations: [
415
+ 'It does not prove a moderation action is fair, lawful, or appropriate without human review.',
416
+ ],
417
+ recommendedActions: [
418
+ 'Queue human moderation review, add friction, or display federation context rather than auto-banning from the proof alone.',
419
+ ],
420
+ requiredControls: [
421
+ {
422
+ risk: 'Cross-circle overlap can inflate or deanonymise moderation evidence if scoped incorrectly.',
423
+ control: 'Require shared federation scope, verify distinct signers across circles, and document when overlap disclosure is acceptable.',
424
+ },
425
+ {
426
+ risk: 'Federated signals can bypass local governance.',
427
+ control: 'Keep local appeal, evidence, reviewer-conflict, escalation, and community override processes.',
428
+ },
429
+ ],
430
+ }),
194
431
  });
195
432
  export const GRANT_FUNDING_PROPOSAL_REVIEW_PROFILE = profile({
196
433
  id: 'grant-funding-proposal-review',
@@ -205,6 +442,23 @@ export const GRANT_FUNDING_PROPOSAL_REVIEW_PROFILE = profile({
205
442
  maxAgeSeconds: 300,
206
443
  metrics: [rankMetric],
207
444
  failurePolicy: commonFailurePolicy,
445
+ ...safety({
446
+ proofClaims: [
447
+ 'The accepted reviewers anonymously scored the exact proposal or grant address.',
448
+ ],
449
+ proofLimitations: [
450
+ 'It does not prove the applicant can deliver, that funding is lawful, or that conflicts are absent.',
451
+ ],
452
+ recommendedActions: [
453
+ 'Use the score for triage, shortlisting, additional review, or disclosure prompts under the funding policy.',
454
+ ],
455
+ requiredControls: [
456
+ {
457
+ risk: 'Funding scores can hide conflicts or replace due diligence.',
458
+ control: 'Maintain eligibility checks, conflict disclosures, budget review, milestone policy, appeals, and public accountability.',
459
+ },
460
+ ],
461
+ }),
208
462
  });
209
463
  export const ANONYMOUS_CREDENTIAL_ATTESTATION_COSIGNING_PROFILE = profile({
210
464
  id: 'anonymous-credential-attestation-cosigning',
@@ -222,6 +476,23 @@ export const ANONYMOUS_CREDENTIAL_ATTESTATION_COSIGNING_PROFILE = profile({
222
476
  ...commonFailurePolicy,
223
477
  'Treat this as today\'s proof building block until the credential endorsement profile is final.',
224
478
  ],
479
+ ...safety({
480
+ proofClaims: [
481
+ 'The accepted circle can provide an anonymous threshold signal about a credential or attestation event.',
482
+ ],
483
+ proofLimitations: [
484
+ 'It is not yet a complete credential issuance, disclosure, revocation, or holder-binding protocol.',
485
+ ],
486
+ recommendedActions: [
487
+ 'Use this only as a building block until the credential endorsement profile, holder flow, and revocation model are defined.',
488
+ ],
489
+ requiredControls: [
490
+ {
491
+ risk: 'A threshold signal can be mistaken for a complete anonymous credential.',
492
+ control: 'Define issuer trust, holder binding, selective disclosure, expiry, revocation, replay protection, and verifier challenge flow.',
493
+ },
494
+ ],
495
+ }),
225
496
  });
226
497
  export const RELAY_COMMUNITY_ADMISSION_PROFILE = profile({
227
498
  id: 'relay-community-admission',
@@ -239,6 +510,23 @@ export const RELAY_COMMUNITY_ADMISSION_PROFILE = profile({
239
510
  ...commonFailurePolicy,
240
511
  'Treat this as an admission signal, not as the complete access-control protocol.',
241
512
  ],
513
+ ...safety({
514
+ proofClaims: [
515
+ 'The accepted admission circle anonymously vouched for the target pubkey.',
516
+ ],
517
+ proofLimitations: [
518
+ 'It is not a complete authentication, authorisation, rate-limit, payment, or abuse-response protocol.',
519
+ ],
520
+ recommendedActions: [
521
+ 'Use the signal as one admission input alongside account creation, rate limits, monitoring, and appeal handling.',
522
+ ],
523
+ requiredControls: [
524
+ {
525
+ risk: 'Admission can become permanent unchecked access.',
526
+ control: 'Pair the score with explicit admission policy, staged permissions, rate limits, revocation, expiry, and abuse response.',
527
+ },
528
+ ],
529
+ }),
242
530
  });
243
531
  export const USE_CASE_PROFILES = [
244
532
  USER_REPUTATION_ABUSE_REPORTING_PROFILE,
@@ -1 +1 @@
1
- {"version":3,"file":"profiles.js","sourceRoot":"","sources":["../../src/profiles/profiles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAG/C,MAAM,UAAU,GAAkB;IAChC,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,qDAAqD;IAC9D,SAAS,EAAE,kBAAkB;CAC9B,CAAA;AAED,MAAM,cAAc,GAAkB;IACpC,IAAI,EAAE,cAAc;IACpB,OAAO,EAAE,8CAA8C;IACvD,SAAS,EAAE,OAAO;CACnB,CAAA;AAED,MAAM,YAAY,GAAkB;IAClC,IAAI,EAAE,kBAAkB;IACxB,OAAO,EAAE,mEAAmE;IAC5E,SAAS,EAAE,OAAO;CACnB,CAAA;AAED,SAAS,OAAO,CAAC,OAAuB;IACtC,OAAO,OAAO,CAAA;AAChB,CAAC;AAED,MAAM,mBAAmB,GAAG;IAC1B,+DAA+D;IAC/D,mEAAmE;IACnE,gFAAgF;IAChF,mGAAmG;CACpG,CAAA;AAED,MAAM,CAAC,MAAM,uCAAuC,GAAG,OAAO,CAAC;IAC7D,EAAE,EAAE,iCAAiC;IACrC,KAAK,EAAE,qCAAqC;IAC5C,KAAK,EAAE,QAAQ;IACf,MAAM,EAAE,WAAW;IACnB,IAAI,EAAE,WAAW,CAAC,IAAI;IACtB,UAAU,EAAE,GAAG;IACf,cAAc,EAAE,CAAC,QAAQ,CAAC;IAC1B,YAAY,EAAE,IAAI;IAClB,kBAAkB,EAAE,CAAC;IACrB,aAAa,EAAE,GAAG;IAClB,OAAO,EAAE,CAAC,UAAU,EAAE,YAAY,CAAC;IACnC,aAAa,EAAE,mBAAmB;CACnC,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,qCAAqC,GAAG,OAAO,CAAC;IAC3D,EAAE,EAAE,+BAA+B;IACnC,KAAK,EAAE,+BAA+B;IACtC,KAAK,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G;QACD,kBAAkB,EAAE;YAClB,iHAAiH;SAClH;QACD,gBAAgB,EAAE;YAChB;gBACE,IAAI,EAAE,kDAAkD;gBACxD,OAAO,EAAE,yHAAyH;aACnI;SACF;KACF,CAAC;CACH,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,uCAAuC;IACvC,qCAAqC;IACrC,4BAA4B;IAC5B,gCAAgC;IAChC,+BAA+B;IAC/B,gCAAgC;IAChC,2CAA2C;IAC3C,+CAA+C;IAC/C,6CAA6C;IAC7C,kCAAkC;IAClC,4BAA4B;IAC5B,qCAAqC;IACrC,kDAAkD;IAClD,iCAAiC;CACW,CAAA;AAE9C,MAAM,CAAC,MAAM,sBAAsB,GAAG,MAAM,CAAC,MAAM,CACjD,MAAM,CAAC,WAAW,CAAC,iBAAiB,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC,CAAC,CACpB,CAAA;AAEzD,MAAM,UAAU,iBAAiB,CAAC,EAAU;IAC1C,OAAO,sBAAsB,CAAC,EAAE,CAAC,CAAA;AACnC,CAAC"}
@@ -0,0 +1,67 @@
1
+ import type { EventTemplate } from '../nip85/types.js';
2
+ import type { SignedDeploymentBundle } from './bundle.js';
3
+ import type { VerificationIssue, VerificationIssueAction, VerificationIssueExplanation } from './issues.js';
4
+ import type { ProductionDeploymentVerification, VerifyProductionDeploymentOptions } from './production.js';
5
+ import type { UseCaseProfile } from './types.js';
6
+ export type ProductionDecisionRecommendedAction = VerificationIssueAction | 'accept';
7
+ export type ProductionControlStatus = 'pass' | 'fail' | 'not-checked';
8
+ export type ProductionControlId = 'bundle-publisher' | 'bundle-signature' | 'bundle-freshness' | 'event-signatures' | 'circle-policy' | 'profile-subject' | 'proof-threshold' | 'metric-policy';
9
+ export interface ProductionDecisionIssue extends VerificationIssue, VerificationIssueExplanation {
10
+ }
11
+ export interface ProductionControlReport {
12
+ id: ProductionControlId;
13
+ label: string;
14
+ status: ProductionControlStatus;
15
+ summary: string;
16
+ }
17
+ export interface ProductionDecisionProfileSummary {
18
+ id: string;
19
+ title: string;
20
+ status: UseCaseProfile['status'];
21
+ kind: number;
22
+ subjectTag: UseCaseProfile['subjectTag'];
23
+ subjectTagValue?: string;
24
+ subjectFormats: readonly UseCaseProfile['subjectFormats'][number][];
25
+ proofVersion: UseCaseProfile['proofVersion'];
26
+ proofClaims: readonly string[];
27
+ proofLimitations: readonly string[];
28
+ recommendedActions: readonly string[];
29
+ requiredControls: readonly {
30
+ risk: string;
31
+ control: string;
32
+ }[];
33
+ }
34
+ export interface ProductionDecisionBundleSummary {
35
+ id: string;
36
+ signer: string;
37
+ issuedAt: number;
38
+ expiresAt?: number;
39
+ publisherTrusted: boolean;
40
+ signatureValid: boolean;
41
+ }
42
+ export interface ProductionDecisionReport {
43
+ decision: ProductionDeploymentVerification['decision'];
44
+ valid: boolean;
45
+ recommendedAction: ProductionDecisionRecommendedAction;
46
+ bundle: ProductionDecisionBundleSummary;
47
+ profile: ProductionDecisionProfileSummary;
48
+ policyId: string;
49
+ subject: string;
50
+ metrics: Readonly<Record<string, readonly number[]>>;
51
+ controls: readonly ProductionControlReport[];
52
+ issues: readonly ProductionDecisionIssue[];
53
+ remediations: readonly string[];
54
+ }
55
+ /**
56
+ * Convert a production verification result into an audit- and UI-ready report.
57
+ *
58
+ * The report preserves the verifier decision, adds stable remediation guidance,
59
+ * and names the production controls that passed, failed, or were explicitly
60
+ * relaxed. It does not change the underlying verification semantics.
61
+ */
62
+ export declare function createProductionDecisionReport(result: ProductionDeploymentVerification): ProductionDecisionReport;
63
+ /**
64
+ * Verify a production deployment and return the decision report directly.
65
+ */
66
+ export declare function verifyProductionDeploymentReport(events: EventTemplate | readonly EventTemplate[], bundle: SignedDeploymentBundle, options?: VerifyProductionDeploymentOptions): ProductionDecisionReport;
67
+ //# sourceMappingURL=report.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report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"}
@@ -0,0 +1,165 @@
1
+ import { explainVerificationIssue } from './issues.js';
2
+ import { verifyProductionDeployment } from './production.js';
3
+ const ACTION_PRIORITY = {
4
+ accept: 0,
5
+ reject: 1,
6
+ 'manual-review': 2,
7
+ 'refresh-and-retry': 3,
8
+ 'operator-action': 4,
9
+ };
10
+ function decisionIssue(issue) {
11
+ const explanation = explainVerificationIssue(issue);
12
+ return Object.freeze({
13
+ ...issue,
14
+ summary: explanation.summary,
15
+ remediation: explanation.remediation,
16
+ action: explanation.action,
17
+ });
18
+ }
19
+ function recommendedAction(valid, issues) {
20
+ if (valid && issues.length === 0)
21
+ return 'accept';
22
+ if (issues.length === 0)
23
+ return 'reject';
24
+ return issues.reduce((strongest, issue) => {
25
+ return ACTION_PRIORITY[issue.action] > ACTION_PRIORITY[strongest] ? issue.action : strongest;
26
+ }, 'reject');
27
+ }
28
+ function uniqueRemediations(issues) {
29
+ return Object.freeze([...new Set(issues.map(issue => issue.remediation))]);
30
+ }
31
+ function issueCodeSet(issues) {
32
+ return new Set(issues.map(issue => issue.code));
33
+ }
34
+ function hasPrefix(codes, prefix) {
35
+ return [...codes].some(code => code.startsWith(prefix));
36
+ }
37
+ function hasAny(codes, candidates) {
38
+ return candidates.some(code => codes.has(code));
39
+ }
40
+ function control(id, label, status, summary) {
41
+ return Object.freeze({ id, label, status, summary });
42
+ }
43
+ function statusFromIssues(codes, candidates) {
44
+ return hasAny(codes, candidates) ? 'fail' : 'pass';
45
+ }
46
+ function productionControls(result, issues) {
47
+ const codes = issueCodeSet(issues);
48
+ const signatureChecked = result.deployment.nostrSignatures.checked;
49
+ const bundleHasExpiry = result.bundle.bundle.expiresAt !== undefined;
50
+ const bundleFreshnessFailed = hasAny(codes, [
51
+ 'bundle.expired',
52
+ 'bundle.expires_at_invalid',
53
+ 'bundle.expiry_required',
54
+ 'bundle.issued_at_future',
55
+ 'bundle.issued_at_invalid',
56
+ ]);
57
+ const eventSignatureStatus = signatureChecked
58
+ ? (result.deployment.nostrSignatures.valid ? 'pass' : 'fail')
59
+ : (codes.has('policy.nostr_signature_not_required') ? 'fail' : 'not-checked');
60
+ const bundleFreshnessStatus = bundleFreshnessFailed
61
+ ? 'fail'
62
+ : (bundleHasExpiry ? 'pass' : 'not-checked');
63
+ return Object.freeze([
64
+ control('bundle-publisher', 'Trusted bundle publisher', result.bundle.publisherTrusted ? 'pass' : 'fail', result.bundle.publisherTrusted
65
+ ? 'The signed deployment bundle came from a configured trusted publisher key.'
66
+ : 'The verifier cannot tie this bundle to a configured trusted publisher key.'),
67
+ control('bundle-signature', 'Bundle signature', result.bundle.signatureValid ? 'pass' : 'fail', result.bundle.signatureValid
68
+ ? 'The deployment bundle signature verifies against the bundle signer.'
69
+ : 'The deployment bundle signature is malformed, invalid, or does not match the payload.'),
70
+ control('bundle-freshness', 'Bundle freshness', bundleFreshnessStatus, bundleFreshnessStatus === 'pass'
71
+ ? 'The deployment bundle is time-bounded and valid for this verification time.'
72
+ : bundleFreshnessStatus === 'not-checked'
73
+ ? 'Bundle expiry was explicitly relaxed, so this report cannot prove the bundle is time-bounded.'
74
+ : 'The deployment bundle is missing required expiry metadata, expired, or outside its valid time window.'),
75
+ control('event-signatures', 'Relay event signatures', eventSignatureStatus, eventSignatureStatus === 'pass'
76
+ ? 'Every checked relay-fetched assertion has a valid Nostr event id and signature.'
77
+ : eventSignatureStatus === 'not-checked'
78
+ ? 'Relay event signature verification was explicitly relaxed for this deployment.'
79
+ : 'At least one relay-fetched assertion is unsigned, mutated, or the policy does not require signed events.'),
80
+ control('circle-policy', 'Accepted circle policy', hasPrefix(codes, 'circle.') ? 'fail' : 'pass', hasPrefix(codes, 'circle.')
81
+ ? 'The assertion used a circle that is missing, malformed, expired, revoked, superseded, unaccepted, or not allowed for this profile.'
82
+ : 'The assertion was produced by a circle accepted by the deployment policy.'),
83
+ control('profile-subject', 'Profile and subject binding', statusFromIssues(codes, [
84
+ 'profile.event_count_invalid',
85
+ 'profile.kind_mismatch',
86
+ 'profile.subject_format_invalid',
87
+ 'profile.subject_hint_mismatch',
88
+ 'profile.subject_mismatch',
89
+ 'nip85.syntax_invalid',
90
+ ]), hasAny(codes, [
91
+ 'profile.event_count_invalid',
92
+ 'profile.kind_mismatch',
93
+ 'profile.subject_format_invalid',
94
+ 'profile.subject_hint_mismatch',
95
+ 'profile.subject_mismatch',
96
+ 'nip85.syntax_invalid',
97
+ ])
98
+ ? 'The assertion does not match the expected profile shape, subject, subject hint, or NIP-85 syntax.'
99
+ : 'The assertion matches the profile kind, canonical subject, subject hint, and NIP-85 syntax policy.'),
100
+ control('proof-threshold', 'Proof and threshold', hasPrefix(codes, 'proof.') || hasPrefix(codes, 'federation.') || hasPrefix(codes, 'assertion.')
101
+ ? 'fail'
102
+ : 'pass', hasPrefix(codes, 'proof.') || hasPrefix(codes, 'federation.') || hasPrefix(codes, 'assertion.')
103
+ ? 'The proof, federation, threshold, or assertion freshness check failed.'
104
+ : 'The nostr-veil proof, signer threshold, federation policy, and assertion freshness checks passed.'),
105
+ control('metric-policy', 'Metric policy', hasPrefix(codes, 'metric.') ? 'fail' : 'pass', hasPrefix(codes, 'metric.')
106
+ ? 'At least one metric is missing, unexpected, non-numeric, non-integer, or outside the deployment bounds.'
107
+ : 'The published metrics satisfy the deployment metric policy.'),
108
+ ]);
109
+ }
110
+ function profileSummary(profile) {
111
+ return Object.freeze({
112
+ id: profile.id,
113
+ title: profile.title,
114
+ status: profile.status,
115
+ kind: profile.kind,
116
+ subjectTag: profile.subjectTag,
117
+ ...(profile.subjectTagValue === undefined ? {} : { subjectTagValue: profile.subjectTagValue }),
118
+ subjectFormats: Object.freeze([...profile.subjectFormats]),
119
+ proofVersion: profile.proofVersion,
120
+ proofClaims: Object.freeze([...(profile.proofClaims ?? [])]),
121
+ proofLimitations: Object.freeze([...(profile.proofLimitations ?? [])]),
122
+ recommendedActions: Object.freeze([...(profile.recommendedActions ?? [])]),
123
+ requiredControls: Object.freeze((profile.requiredControls ?? []).map(control => Object.freeze({ ...control }))),
124
+ });
125
+ }
126
+ function bundleSummary(result) {
127
+ return Object.freeze({
128
+ id: result.bundle.bundle.id,
129
+ signer: result.bundle.bundle.signer,
130
+ issuedAt: result.bundle.bundle.issuedAt,
131
+ ...(result.bundle.bundle.expiresAt === undefined ? {} : { expiresAt: result.bundle.bundle.expiresAt }),
132
+ publisherTrusted: result.bundle.publisherTrusted,
133
+ signatureValid: result.bundle.signatureValid,
134
+ });
135
+ }
136
+ /**
137
+ * Convert a production verification result into an audit- and UI-ready report.
138
+ *
139
+ * The report preserves the verifier decision, adds stable remediation guidance,
140
+ * and names the production controls that passed, failed, or were explicitly
141
+ * relaxed. It does not change the underlying verification semantics.
142
+ */
143
+ export function createProductionDecisionReport(result) {
144
+ const issues = Object.freeze(result.issues.map(decisionIssue));
145
+ return Object.freeze({
146
+ decision: result.decision,
147
+ valid: result.valid,
148
+ recommendedAction: recommendedAction(result.valid, issues),
149
+ bundle: bundleSummary(result),
150
+ profile: profileSummary(result.deployment.policy.profile),
151
+ policyId: result.deployment.policy.id,
152
+ subject: result.deployment.policy.expectedSubject,
153
+ metrics: result.deployment.metrics,
154
+ controls: productionControls(result, issues),
155
+ issues,
156
+ remediations: uniqueRemediations(issues),
157
+ });
158
+ }
159
+ /**
160
+ * Verify a production deployment and return the decision report directly.
161
+ */
162
+ export function verifyProductionDeploymentReport(events, bundle, options = {}) {
163
+ return createProductionDecisionReport(verifyProductionDeployment(events, bundle, options));
164
+ }
165
+ //# sourceMappingURL=report.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"report.js","sourceRoot":"","sources":["../../src/profiles/report.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAA;AACtD,OAAO,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAA;AA8E5D,MAAM,eAAe,GAAwD;IAC3E,MAAM,EAAE,CAAC;IACT,MAAM,EAAE,CAAC;IACT,eAAe,EAAE,CAAC;IAClB,mBAAmB,EA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AE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;AAC5F,CAAC"}
@@ -12,6 +12,10 @@ export interface FederationProfile {
12
12
  minCircles: number;
13
13
  requireScope: boolean;
14
14
  }
15
+ export interface UseCaseRequiredControl {
16
+ risk: string;
17
+ control: string;
18
+ }
15
19
  export interface UseCaseProfile {
16
20
  id: string;
17
21
  title: string;
@@ -27,6 +31,10 @@ export interface UseCaseProfile {
27
31
  metrics: MetricProfile[];
28
32
  federation?: FederationProfile;
29
33
  failurePolicy: string[];
34
+ proofClaims?: string[];
35
+ proofLimitations?: string[];
36
+ recommendedActions?: string[];
37
+ requiredControls?: UseCaseRequiredControl[];
30
38
  }
31
39
  export interface VerifyUseCaseProfileOptions {
32
40
  acceptedCircleIds?: Iterable<string>;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/profiles/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AACxE,OAAO,KAAK,EACV,WAAW,EACX,sBAAsB,EACtB,iBAAiB,EACjB,YAAY,EACZ,UAAU,EACX,MAAM,mBAAmB,CAAA;AAC1B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAEpD,MAAM,MAAM,oBAAoB,GAAG,WAAW,GAAG,gBAAgB,CAAA;AAEjE,MAAM,MAAM,aAAa,GACrB,QAAQ,GACR,OAAO,GACP,SAAS,GACT,YAAY,GACZ,OAAO,GACP,OAAO,GACP,QAAQ,GACR,KAAK,GACL,QAAQ,GACR,YAAY,GACZ,OAAO,GACP,SAAS,GACT,SAAS,GACT,QAAQ,GACR,QAAQ,CAAA;AAEZ,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,kBAAkB,GAAG,iBAAiB,GAAG,OAAO,GAAG,qBAAqB,CAAA;CACpF;AAED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,EAAE,oBAAoB,EAAE,CAAA;IAC9B,UAAU,CAAC,EAAE,sBAAsB,CAAA;IACnC,OAAO,EAAE,cAAc,CAAA;CACxB"}
package/llms-full.txt CHANGED
@@ -106,6 +106,9 @@ verifier action, proof boundary, and the operational controls needed beyond
106
106
  nostr-veil. Caveats should be paired with a concrete control such as evidence
107
107
  workflow, canonicalisation, expiry, revocation, transport privacy, Sybil policy,
108
108
  or a companion protocol.
109
+ Built-in `USE_CASE_PROFILES` also expose `proofClaims`, `proofLimitations`,
110
+ `requiredControls`, and `recommendedActions` so applications and agents can
111
+ present the safety boundary without inventing their own copy.
109
112
 
110
113
  ## Type Definitions
111
114
 
@@ -163,7 +166,10 @@ Deployment/profile verifiers keep human-readable `errors` for compatibility and
163
166
  also return stable `issues[].code` values for application policy, logging, and
164
167
  alerts. Use `explainVerificationIssue(issueOrCode)` or
165
168
  `remediationForIssue(issueOrCode)` to turn a stable code into the concrete next
166
- operator or verifier action.
169
+ operator or verifier action. For production UI and audit logs,
170
+ `verifyProductionDeploymentReport()` returns the verifier decision with expanded
171
+ issue remediations, a recommended action, and pass/fail/not-checked status for
172
+ the controls.
167
173
 
168
174
  ### `EventTemplate`
169
175
 
@@ -619,7 +625,9 @@ Produce the deterministic proof-v2 message. The context must include `kind`,
619
625
 
620
626
  Use this layer when an application wants to act on a score. It adds profile
621
627
  checks, deployment policy, circle manifests, and signed policy bundles on top of
622
- the low-level proof verifier.
628
+ the low-level proof verifier. Built-in profiles carry machine-readable safety
629
+ metadata: `proofClaims`, `proofLimitations`, `requiredControls`, and
630
+ `recommendedActions`.
623
631
 
624
632
  #### `verifyUseCaseProfile(events, profile, options) → UseCaseProfileVerification`
625
633
 
@@ -683,6 +691,18 @@ For example, `bundle.trusted_publishers_missing` means the verifier has no
683
691
  pinned publisher keys, while `event.signature_invalid` means the fetched event
684
692
  must be rejected and can optionally be retried from another relay.
685
693
 
694
+ #### `createProductionDecisionReport(result) → ProductionDecisionReport`
695
+
696
+ Convert a `verifyProductionDeployment()` result into an audit- and UI-ready
697
+ report. The report keeps the accept/reject decision, adds `recommendedAction`,
698
+ expands every issue with summary and remediation text, lists unique
699
+ remediations, and reports whether production controls passed, failed, or were
700
+ explicitly relaxed.
701
+
702
+ #### `verifyProductionDeploymentReport(events, bundle, options) → ProductionDecisionReport`
703
+
704
+ Verify a production deployment and return the decision report directly.
705
+
686
706
  Canonical subject helpers cover Nostr-native subjects plus relays, service
687
707
  endpoints, NIP-05, domains, LNURLp, NIP-96, npm packages, git repositories,
688
708
  GitHub repositories, maintainers, vendors, and sources. Prefer them before
package/llms.txt CHANGED
@@ -62,13 +62,17 @@ Two subpath exports, plus a root that re-exports everything:
62
62
  `USE_CASE_PROFILES`, `USE_CASE_PROFILE_BY_ID`, `verifyUseCaseProfile`,
63
63
  `createCircleManifest`, `verifyCircleManifest`, `createDeploymentPolicy`,
64
64
  `verifyDeploymentPolicy`, `createSignedDeploymentBundle`,
65
- `verifyDeploymentBundle`, `verifyProductionDeployment`, `VerificationIssue`,
66
- `VerificationIssueCode`, `explainVerificationIssue`, `remediationForIssue`, and
67
- canonical subject helpers. Use `verifyProductionDeployment` with pinned trusted
68
- publisher pubkeys for production relay-fetched assertions; it also requires
69
- expiring bundles and signed events by default. Use issue explanations to turn
65
+ `verifyDeploymentBundle`, `verifyProductionDeployment`,
66
+ `createProductionDecisionReport`, `verifyProductionDeploymentReport`,
67
+ `VerificationIssue`, `VerificationIssueCode`, `explainVerificationIssue`,
68
+ `remediationForIssue`, and canonical subject helpers. Use
69
+ `verifyProductionDeployment` with pinned trusted publisher pubkeys for
70
+ production relay-fetched assertions; it also requires expiring bundles and
71
+ signed events by default. Use decision reports and issue explanations to turn
70
72
  failures into concrete operator actions instead of only showing negative
71
- results.
73
+ results. Built-in profiles expose `proofClaims`, `proofLimitations`,
74
+ `requiredControls`, and `recommendedActions`; use those fields when explaining
75
+ what nostr-veil proves and what the application must still verify.
72
76
  Canonical subject helpers cover Nostr-native subjects plus relays, service
73
77
  endpoints, NIP-05, domains, LNURLp, NIP-96, npm packages, git repositories,
74
78
  GitHub repositories, maintainers, vendors, and sources. Prefer those helpers
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nostr-veil",
3
- "version": "0.21.0",
3
+ "version": "0.23.0",
4
4
  "description": "Privacy layer for Nostr reputation systems. Groups collectively score trustworthiness using ring signatures -- scores are verifiable but contributors are unidentifiable.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",