@melra/receipt-schema 0.3.0-alpha.3 → 0.3.0-alpha.5
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 +32 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# @melra/receipt-schema
|
|
2
|
+
|
|
3
|
+
Action receipts, execution certificates, canonical JSON, and redaction for
|
|
4
|
+
[MELRA](https://github.com/XAGI-Lab/melra). This is the evidence layer: what
|
|
5
|
+
happened, what was checked, and what it hashes to.
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @melra/receipt-schema
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import { createCertificate, redactStructuredValue, sha256 } from "@melra/receipt-schema";
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
A receipt records one action: the operation, the policy decision, the evidence
|
|
16
|
+
items and their outcomes, and timing. A certificate summarises a task's receipts
|
|
17
|
+
and carries a digest over their canonical form, so a transcript can be checked
|
|
18
|
+
rather than trusted.
|
|
19
|
+
|
|
20
|
+
`canonicalJson` sorts keys and normalises formatting before hashing, so the same
|
|
21
|
+
logical value always produces the same digest across processes and platforms.
|
|
22
|
+
|
|
23
|
+
`redactStructuredValue` strips credential-shaped values — tokens, keys, auth
|
|
24
|
+
headers, connection strings — from anything before it is persisted. Raw output
|
|
25
|
+
goes to the live caller only; the durable copy is the redacted one. A new field
|
|
26
|
+
that can carry a secret must pass through this, or through the memory package's
|
|
27
|
+
equivalent, before it reaches storage.
|
|
28
|
+
|
|
29
|
+
Requires Node.js 22 or newer. Full documentation:
|
|
30
|
+
[github.com/XAGI-Lab/melra](https://github.com/XAGI-Lab/melra)
|
|
31
|
+
|
|
32
|
+
Apache-2.0
|