@pacspace-io/check 0.5.5 → 0.6.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 +27 -1
- package/README.md +36 -2
- package/dist/check.d.ts +6 -1
- package/dist/cli.d.ts +5 -1
- package/dist/cli.js +2496 -380
- package/dist/index.js +518 -91
- package/dist/inputs.txt +12 -0
- package/dist/open-io.d.ts +38 -0
- package/dist/open.d.ts +16 -15
- package/dist/records-crypto-types/records/flag-threads-v1.d.ts +53 -0
- package/dist/records-crypto-types/records/labels.d.ts +37 -0
- package/dist/records-crypto-types/records/link-handle-v1.d.ts +16 -0
- package/dist/records-crypto-types/records/reader-crypto-v1.d.ts +198 -0
- package/dist/records-crypto-types/records/reader-link-v1.d.ts +164 -0
- package/dist/records-crypto-types/records/shared-record-ack-v2.d.ts +72 -0
- package/dist/records-crypto-types/records/trail-index-v1.d.ts +89 -0
- package/dist/records-crypto-types/records/trail-rule.d.ts +54 -0
- package/dist/records-crypto-types/records-crypto/asymmetric/ack-flag-notes-v1.d.ts +57 -0
- package/dist/records-crypto-types/records-crypto/asymmetric/flag-notes-v1.d.ts +55 -0
- package/dist/records-crypto-types/records-crypto/asymmetric/index.d.ts +3 -0
- package/dist/records-crypto-types/records-crypto/asymmetric/reader-wraps-v1.d.ts +83 -0
- package/dist/records-crypto-types/records-crypto/disclosure-envelope-v1.d.ts +1 -1
- package/dist/records-crypto-types/records-crypto/index.d.ts +1 -1
- package/dist/records-crypto-types/records-crypto/records-encryption-v1.d.ts +1 -0
- package/dist/records-crypto.js +547 -66
- package/dist/report.d.ts +20 -1
- package/dist/shared-record-link.d.ts +121 -0
- package/dist/shared-record-words.d.ts +97 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,36 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.6.0 - 2026-12-01
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- `pacspace-check open` reads a Shared Record link to a list of records. It asks for the link's code, reads the list and each record's seal history, and checks every record against the proof layer. The link's address names the list, so a list that was changed, a record left out of it and a record served that is not on it all fail. The report says how many records match, names each one that does not match or was not checked, lists when each entry was committed, and shows the fields the link reveals. It never says every record matches while one was not checked. A record written to since the link served it is reported, and is not a failure.
|
|
8
|
+
- `--full` with such a link reads each contract's whole log once and holds every record to it. It also shows a record that was set back to empty and written again before the first write the link serves, which the default read does not show. It reads from a mirror, not `--rpc`.
|
|
9
|
+
- `open --copy <path>` keeps a copy of such a link (`shared-record-copy/v1`) in a new file only its owner can read. `pacspace-check <copy.json>` checks it again: every record against the proof layer, and the list against the link's address when `--link-file <path>` gives the link again. Neither asks anything of the link's host. The copy holds the revealed fields in clear, and never the part of the link after `#`, the code or the link's handle.
|
|
10
|
+
- `open` names the address it reads a link from before it asks anything of it. A link on `records.pacspace.io` is read from `https://app.pacspace.io`. A link on any other address is read from that address, and is named as not a PacSpace address before a code is asked for and again beside the result. `--json` carries the same in a new `link` field.
|
|
11
|
+
- Exit codes for a list of records, or a copy of one: 0 every record matches; 1 the list or a record does not match; 3 the link or a record was not checked and none failed.
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
|
|
15
|
+
- The code of a link to a list is sent once. A code the host refuses is not sent again, because five wrong codes stop the link's code for everyone. When the host is limiting how often the link can be opened, the checker says so, with the wait the host names.
|
|
16
|
+
- Reads of such a link's host are paced under its limits and wait out a `Retry-After`, three times at most and never longer than a minute. An answer larger than 16 MiB is not read, and no redirect is followed. A read that does not happen leaves its record "not checked", never "matches".
|
|
17
|
+
- A Shared Record link made before links carried a list of their records is reported as not checked, with exit code 3, and no code is asked for.
|
|
18
|
+
|
|
19
|
+
## 0.5.6 - 2026-11-18
|
|
20
|
+
|
|
21
|
+
### Security
|
|
22
|
+
|
|
23
|
+
- `--rpc` holds its endpoint to its own address: a redirect is not followed. An answer larger than 1 MiB is not read; a log range that large is asked again in smaller ranges. A 429 is retried three times at most, and never waited on longer than the timeout. Reading a contract's whole log now ends after sixty times the timeout in all (ten minutes by default), and pages must move forward. With any of these the report says the proof layer was not read, and why, with the exit code for a proof layer that could not be reached. An `--rpc` address given as `http://` that redirects to `https://` must now be given as `https://`.
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
|
|
27
|
+
- `passed`, in `--json` and in the result `checkHistory()` returns, is true only when the report's `exitCode` is 0. Before, it could be true beside exit code 3 (the proof layer was not read) and beside exit code 1 (the file you hold was not matched, or a statement or its fingerprint does not match).
|
|
28
|
+
|
|
3
29
|
## 0.5.5 - 2026-11-17
|
|
4
30
|
|
|
5
31
|
### Security
|
|
6
32
|
|
|
7
|
-
- Reads from a mirror (the default source or `--source <url>`) hold the source to its own address: a redirect is not followed, and a next page is read only from the same source and the same contract's log. A page with more logs than were asked for is not read. A page larger than 1 MiB is asked for again in smaller pages, and a single answer larger than 1 MiB is not read. With a source that does any of these the report says the proof layer was not read, and why, and the exit code is the one for a proof layer that could not be reached. A source given as `http://` that redirects to `https://`
|
|
33
|
+
- Reads from a mirror (the default source or `--source <url>`) hold the source to its own address: a redirect is not followed, and a next page is read only from the same source and the same contract's log. A page with more logs than were asked for is not read. A page larger than 1 MiB is asked for again in smaller pages, and a single answer larger than 1 MiB is not read. With a source that does any of these the report says the proof layer was not read, and why, and the exit code is the one for a proof layer that could not be reached. A source given as `http://` that redirects to `https://` is refused, and the report says why; give it as `https://`. With 0.5.4 such a source on the public mirrors already ended with exit code 3, without a reason. The list of where each entry was committed reads its pages under the same limits.
|
|
8
34
|
|
|
9
35
|
## 0.5.4 - 2026-11-16
|
|
10
36
|
|
package/README.md
CHANGED
|
@@ -84,6 +84,35 @@ A seal history, saved from a Shared Record link, and a kept copy from its Keep a
|
|
|
84
84
|
|
|
85
85
|
npx @pacspace-io/check open asks for a Shared Record link, reads the record from the link's host, checks it against the proof layer and shows the fields the link reveals. If the link has an access code, it asks for that too. --copy saves a kept copy and --html saves the report as a page.
|
|
86
86
|
|
|
87
|
+
open names the address it reads the link from before it asks anything of it. A link on records.pacspace.io is read from https://app.pacspace.io. A link on any other address is read from that address, and open says it is not a PacSpace address before it asks for a code and again beside the result. The part of the link after # is never sent anywhere.
|
|
88
|
+
|
|
89
|
+
## A link to a list of records
|
|
90
|
+
|
|
91
|
+
A Shared Record link can show a list of records. The link's address names the list: a list that was changed, a record left out of it and a record served that is not on it all fail the check.
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
npx @pacspace-io/check open
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
For each record on the list, open checks every entry the link serves against what was committed, and the record's writes on the proof layer against those entries, back to the record's first write. The result says how many records match and names each one that does not match or was not checked. It never says every record matches while one was not checked. A record written to since the link served it is reported, and is not a failure.
|
|
98
|
+
|
|
99
|
+
The code is sent to the address open named, once. A code it refuses is not sent again, because five wrong codes stop the link's code for everyone.
|
|
100
|
+
|
|
101
|
+
`--full` reads each contract's whole log once and holds every record to it. It also shows a record that was set back to empty and written again before the first write the link serves, which the default read does not show. `--full` reads from a mirror, not `--rpc`.
|
|
102
|
+
|
|
103
|
+
`--copy <path>` keeps a copy of the link in a new file only you can read. It holds the fields the link reveals, in clear, and never the part of the link after #, the code or the link's handle. Check it again at any time:
|
|
104
|
+
|
|
105
|
+
```
|
|
106
|
+
npx @pacspace-io/check copy.json
|
|
107
|
+
npx @pacspace-io/check copy.json --link-file link.txt
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
The first checks every record against the proof layer. The second also holds the copy's list to the address of the link in link.txt, as open did. Neither asks anything of the link's host.
|
|
111
|
+
|
|
112
|
+
Exit codes for a list of records, or a copy of one: 0 every record matches; 1 the list or a record does not match; 3 the link or a record was not checked and none failed.
|
|
113
|
+
|
|
114
|
+
## An encrypted record, and a release
|
|
115
|
+
|
|
87
116
|
An encrypted record's history is checked with its record key: npx @pacspace-io/check history.json --key record-key.txt. A copy made with keepCopy carries its key and is checked like any history file.
|
|
88
117
|
|
|
89
118
|
npx @pacspace-io/check release checks the key pages a host serves against the release record PacSpace committed to the proof layer.
|
|
@@ -101,6 +130,7 @@ release reads each file three ways, as the host sends it, and checks each answer
|
|
|
101
130
|
--history <path> the seal history or kept copy a disclosure is checked against
|
|
102
131
|
--key <path> the record key for an encrypted history, read from this file (- for stdin)
|
|
103
132
|
--link-file <path> open: read the link from this file instead of asking
|
|
133
|
+
copy of a link: compare its list with the address of the link in this file
|
|
104
134
|
--access-code-file <path> open: read the access code from this file instead of asking
|
|
105
135
|
--copy <path> open: save a kept copy of what the link shows to a new file
|
|
106
136
|
--html <path> open: save the report as a page that opens without a network connection
|
|
@@ -109,13 +139,17 @@ release reads each file three ways, as the host sends it, and checks each answer
|
|
|
109
139
|
--source <url> read the proof layer from this mirror
|
|
110
140
|
--rpc <url> read the proof layer over JSON-RPC at this URL
|
|
111
141
|
--full also read every daily statement
|
|
142
|
+
list of records, or a copy of one: read each contract's whole log
|
|
112
143
|
--no-lookup do not look up where each entry was committed
|
|
113
144
|
--timeout <ms> network timeout per read (default 10000)
|
|
145
|
+
list of records: a read of the link's host (default 30000)
|
|
114
146
|
--json print the report as JSON
|
|
115
147
|
```
|
|
116
148
|
|
|
117
149
|
Exit codes: 0 the check passed as asked; 1 it did not, or the file you hold is not in it; 2 the history file, the link, a key, the file you hold, its blinding file or the arguments could not be used; 3 the proof layer or the link's host could not be reached. When more than one applies, 2 comes before 3, and 3 before 1.
|
|
118
150
|
|
|
151
|
+
For a list of records, or a copy of one: 3 also when a record was not checked, and 1 comes before 3, so a record that does not match is reported even when another was not checked.
|
|
152
|
+
|
|
119
153
|
## From code
|
|
120
154
|
|
|
121
155
|
```ts
|
|
@@ -131,13 +165,13 @@ if (report.exitCode !== 0) process.exitCode = report.exitCode;
|
|
|
131
165
|
`report` is a `pacspace-check-report/v1` document: the record's count and
|
|
132
166
|
the entries that matched, were missing, or did not match; whether the file
|
|
133
167
|
is intact; what the proof layer said; the daily statement's outcome; the
|
|
134
|
-
fingerprint comparison; and the sentences printed above.
|
|
168
|
+
fingerprint comparison; and the sentences printed above. `passed` is true only when the report's `exitCode` is 0.
|
|
135
169
|
|
|
136
170
|
## What it needs
|
|
137
171
|
|
|
138
172
|
Node.js 20.19 or later, and the network, for the proof layer. open reads the record from the link's host, and release reads the key pages from the host it checks. Checking a file sends nothing to PacSpace. Where a record was committed is named inside the history
|
|
139
173
|
file; `--source` and `--rpc` point the checker at a mirror or endpoint of
|
|
140
|
-
your own. A redirect from a source is not followed. Pass the address it leads to; a source given as `http://` usually needs `https://`. When a report says the proof layer was not read because of its source, name another source, or read without a mirror with `--rpc <url>`.
|
|
174
|
+
your own. A redirect from a source is not followed. Pass the address it leads to; a source given as `http://` usually needs `https://`. When a report says the proof layer was not read because of its source, name another source, or read without a mirror with `--rpc <url>`. The same holds for `--rpc`: a redirect is not followed, and an answer larger than 1 MiB is not read. Reading a contract's whole log, as `--full` does, is given sixty times the timeout in all, ten minutes by default; a report that says its source did not finish in the time allowed can be run again with a larger `--timeout`. Over `--rpc` such a read goes through the chain from its first block, which on a public network takes far longer than that.
|
|
141
175
|
|
|
142
176
|
## License
|
|
143
177
|
|
package/dist/check.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type HeldFile } from '@pacspace/shared';
|
|
2
|
-
import { type CheckReport, type DailyStatementOutcome } from './report';
|
|
2
|
+
import { type CheckReport, type ReportWithFacts, type DailyStatementOutcome } from './report';
|
|
3
3
|
export declare const CHECKER_NAME = "@pacspace-io/check";
|
|
4
4
|
export declare const CHECKER_VERSION: string;
|
|
5
5
|
/** The eight forms a history file names. */
|
|
@@ -120,3 +120,8 @@ export declare function needsLedgerRoots(file: HistoryFile): boolean;
|
|
|
120
120
|
* Nothing is sent to PacSpace.
|
|
121
121
|
*/
|
|
122
122
|
export declare function checkHistory(file: HistoryFile, options?: CheckOptions): Promise<CheckReport>;
|
|
123
|
+
/**
|
|
124
|
+
* `checkHistory`, with the narrower fact beside the report (`ReportWithFacts`). Internal: the package's entry
|
|
125
|
+
* point does not export it. `release` and `evidence` read `entriesMatch` where they once read `passed`.
|
|
126
|
+
*/
|
|
127
|
+
export declare function checkHistoryWithFacts(file: HistoryFile, options?: CheckOptions): Promise<ReportWithFacts>;
|
package/dist/cli.d.ts
CHANGED
|
@@ -16,8 +16,10 @@ export interface CliArgs {
|
|
|
16
16
|
key: string | null;
|
|
17
17
|
/** `--no-lookup`: do not look up where each entry was committed. */
|
|
18
18
|
noLookup: boolean;
|
|
19
|
+
/** With a kept copy of a link: the file holding the link's address, to compare the copy's list with. */
|
|
20
|
+
linkFile: string | null;
|
|
19
21
|
}
|
|
20
|
-
export declare const USAGE = "Usage: pacspace-check <history.json> [options]\n pacspace-check <history.json> --key <path>\n pacspace-check open [--link-file <path>] [--access-code-file <path>] [--copy <path>] [--html <path>] [--source <url> | --rpc <url>] [--timeout <ms>] [--json]\n pacspace-check release [--origin <url>] [--source <url> | --rpc <url>] [--timeout <ms>] [--json]\n pacspace-check release --origin <url> --release-record <record key>,<network id>,<contract>\n\nChecks a PacSpace record history file: every entry against what was\ncommitted, the file against its own fingerprint, and the record against\nthe proof layer. open reads the record from the link's host, and release reads the key pages from the host it checks. Checking a file sends nothing to PacSpace.\n\nOptions:\n --fingerprint <0x...> the fingerprint printed on a statement; the checker\n says whether it names this file\n --held-file <path> check whether a verified entry names a file you hold\n --blinding <path> the blinding file for the file you hold, when its entry is blinded\n --history <path> the seal history or kept copy a disclosure is checked against\n --key <path> the record key for an encrypted history, read from this file (- for stdin)\n --link-file <path> open: read the link from this file instead of asking\n --access-code-file <path> open: read the access code from this file instead of asking\n --copy <path> open: save a kept copy of what the link shows to a new file\n --html <path> open: save the report as a page that opens without a network connection\n --offline check the file alone; do not read the proof layer\n --source <url> read the proof layer from this mirror instead of\n the one known for the record's network\n --rpc <url> read the proof layer over JSON-RPC at this URL\n --full also read every daily statement\n --no-lookup do not look up where each entry was committed\n --timeout <ms> network timeout per read (default 10000)\n --json print the report as JSON\n --version print the checker's version\n --help print this text\n\nExit codes: 0 the check passed as asked; 1 it did not, or the file you hold is not in it; 2 the history file, the link, a key, the file you hold, its blinding file or the arguments could not be used; 3 the proof layer or the link's host could not be reached. When more than one applies, 2 comes before 3, and 3 before 1.\n";
|
|
22
|
+
export declare const USAGE = "Usage: pacspace-check <history.json> [options]\n pacspace-check <history.json> --key <path>\n pacspace-check <link-copy.json> [--link-file <path>] [--full] [--source <url> | --rpc <url>] [--timeout <ms>] [--json]\n pacspace-check open [--link-file <path>] [--access-code-file <path>] [--copy <path>] [--html <path>] [--full] [--source <url> | --rpc <url>] [--timeout <ms>] [--json]\n pacspace-check release [--origin <url>] [--source <url> | --rpc <url>] [--timeout <ms>] [--json]\n pacspace-check release --origin <url> --release-record <record key>,<network id>,<contract>\n\nChecks a PacSpace record history file: every entry against what was\ncommitted, the file against its own fingerprint, and the record against\nthe proof layer. open reads the record from the link's host, and release reads the key pages from the host it checks. Checking a file sends nothing to PacSpace.\n\nA link may show one record or a list of records. open checks every record\nof a list against the proof layer, and --copy keeps a copy of the list that\ncan be checked again as a file.\n\nOptions:\n --fingerprint <0x...> the fingerprint printed on a statement; the checker\n says whether it names this file\n --held-file <path> check whether a verified entry names a file you hold\n --blinding <path> the blinding file for the file you hold, when its entry is blinded\n --history <path> the seal history or kept copy a disclosure is checked against\n --key <path> the record key for an encrypted history, read from this file (- for stdin)\n --link-file <path> open: read the link from this file instead of asking\n copy of a link: compare its list with the address of the link in this file\n --access-code-file <path> open: read the access code from this file instead of asking\n --copy <path> open: save a kept copy of what the link shows to a new file\n --html <path> open: save the report as a page that opens without a network connection\n --offline check the file alone; do not read the proof layer\n --source <url> read the proof layer from this mirror instead of\n the one known for the record's network\n --rpc <url> read the proof layer over JSON-RPC at this URL\n --full also read every daily statement\n list of records, or a copy of one: read each contract's whole log\n --no-lookup do not look up where each entry was committed\n --timeout <ms> network timeout per read (default 10000)\n list of records: a read of the link's host (default 30000)\n --json print the report as JSON\n --version print the checker's version\n --help print this text\n\nExit codes: 0 the check passed as asked; 1 it did not, or the file you hold is not in it; 2 the history file, the link, a key, the file you hold, its blinding file or the arguments could not be used; 3 the proof layer or the link's host could not be reached. When more than one applies, 2 comes before 3, and 3 before 1.\nFor a list of records, or a copy of one: 3 also when a record was not checked, and 1 comes before 3, so a record that does not match is reported even when another was not checked.\n";
|
|
21
23
|
export declare const BLINDING_FILE_INVALID_SENTENCE = "This is not a valid blinding file.";
|
|
22
24
|
export declare const BLINDING_NEEDS_HELD_FILE_SENTENCE = "--blinding needs --held-file.";
|
|
23
25
|
export declare const HISTORY_ONLY_FOR_DISCLOSURE_SENTENCE = "--history is used only with a disclosure file.";
|
|
@@ -46,6 +48,8 @@ export interface CliIo {
|
|
|
46
48
|
fetchImpl?: typeof fetch;
|
|
47
49
|
/** `release` reads files as the host sent them; Node's https client unless given. */
|
|
48
50
|
rawGet?: RawGet;
|
|
51
|
+
/** A wait between requests to a link's host or to a proof layer source, or for a limit to pass; a timer unless given. */
|
|
52
|
+
sleep?: (ms: number) => Promise<void>;
|
|
49
53
|
}
|
|
50
54
|
/** Node's https (or http, for a local host) with no decoding, so a compressed body is read as sent. */
|
|
51
55
|
/** No key-page file comes near this; a larger answer is not read to the end. */
|