@pacspace-io/check 0.5.4 → 0.5.6
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 +16 -0
- package/README.md +2 -2
- package/dist/check.d.ts +6 -1
- package/dist/cli.js +521 -100
- package/dist/index.js +525 -98
- package/dist/inputs.txt +1 -0
- package/dist/release.d.ts +4 -0
- package/dist/report.d.ts +30 -1
- package/package.json +1 -1
package/dist/inputs.txt
CHANGED
package/dist/release.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { MirrorRefusalCode } from '@pacspace/shared';
|
|
1
2
|
import { type CheckOptions } from './check';
|
|
2
3
|
export declare const RELEASES_SCHEMA = "pacspace-releases/v1";
|
|
3
4
|
export declare const RELEASE_MANIFEST_FORMAT = "pacspace-release-manifest/v2";
|
|
@@ -30,6 +31,7 @@ export declare const releaseWords: {
|
|
|
30
31
|
readonly notProductionRecord: "The ledger record here is not the production release record.";
|
|
31
32
|
readonly inProgress: (served: string, latest: string) => string;
|
|
32
33
|
readonly unreachable: (origin: string) => string;
|
|
34
|
+
readonly refused: (code: MirrorRefusalCode) => string;
|
|
33
35
|
readonly total: (n: number) => string;
|
|
34
36
|
};
|
|
35
37
|
export interface ReleaseManifestFile {
|
|
@@ -113,6 +115,8 @@ export interface ReleaseReport {
|
|
|
113
115
|
stagingRecord?: string;
|
|
114
116
|
/** 0 everything matches; 1 any difference, or any staging run; 2 the host or the ledger could not be reached. */
|
|
115
117
|
exitCode: 0 | 1 | 2;
|
|
118
|
+
/** Present only with `unreachable` when the ledger's source answered and its answer was refused: which rule it broke. */
|
|
119
|
+
refused?: MirrorRefusalCode;
|
|
116
120
|
}
|
|
117
121
|
/** One answer as the host sent it: no decoding, every header. */
|
|
118
122
|
export interface RawAnswer {
|
package/dist/report.d.ts
CHANGED
|
@@ -8,7 +8,13 @@
|
|
|
8
8
|
* from the forbidden lists. A seal history's sentences are the Shared
|
|
9
9
|
* Record page's, verbatim.
|
|
10
10
|
*/
|
|
11
|
+
import type { MirrorRefusalCode } from '@pacspace/shared';
|
|
11
12
|
export declare const REPORT_SCHEMA: "pacspace-check-report/v1";
|
|
13
|
+
/**
|
|
14
|
+
* Why a source's answer was not read, by the reader's refusal code. Each command puts the reason in its own
|
|
15
|
+
* sentence; nothing the source sent is printed.
|
|
16
|
+
*/
|
|
17
|
+
export declare const SOURCE_REFUSAL_REASONS: Record<MirrorRefusalCode, string>;
|
|
12
18
|
export type SourceOutcome = {
|
|
13
19
|
compared: false;
|
|
14
20
|
reason: 'offline';
|
|
@@ -16,6 +22,8 @@ export type SourceOutcome = {
|
|
|
16
22
|
compared: false;
|
|
17
23
|
reason: 'unreachable';
|
|
18
24
|
detail: string;
|
|
25
|
+
/** Present only when the source answered and its answer was refused: which rule it broke. */
|
|
26
|
+
refused?: MirrorRefusalCode;
|
|
19
27
|
} | {
|
|
20
28
|
compared: true;
|
|
21
29
|
matches: boolean;
|
|
@@ -105,7 +113,11 @@ export interface CheckReport {
|
|
|
105
113
|
/** Entry numbers (1-based) that do not match what was committed. */
|
|
106
114
|
unmatched: number[];
|
|
107
115
|
};
|
|
108
|
-
/**
|
|
116
|
+
/**
|
|
117
|
+
* True only when this report's `exitCode` is 0: the check passed as asked. False when the proof layer was not
|
|
118
|
+
* read (exit code 3) and when anything asked for did not match (exit code 1): an entry, the proof layer, a
|
|
119
|
+
* daily statement under `--full`, the statement fingerprint given, or the file you hold.
|
|
120
|
+
*/
|
|
109
121
|
passed: boolean;
|
|
110
122
|
file: {
|
|
111
123
|
/** The history's fingerprint as the file carries it, or as recomputed when the file carries none. */
|
|
@@ -231,6 +243,8 @@ export declare function sealsVerdict(entries: number | null, v: SealsFacts, queu
|
|
|
231
243
|
sentence: string;
|
|
232
244
|
passed: boolean;
|
|
233
245
|
};
|
|
246
|
+
/** The refusal code of a source that answered and was refused; undefined for any other outcome. */
|
|
247
|
+
export declare function refusedOf(source: SourceOutcome): MirrorRefusalCode | undefined;
|
|
234
248
|
export declare function sourceSentence(source: SourceOutcome): string;
|
|
235
249
|
/**
|
|
236
250
|
* The report's line on the daily statement. `changed` is true when the file no longer produces the
|
|
@@ -242,7 +256,20 @@ export declare const FILE_CHANGED_SENTENCE = "This file has been changed since i
|
|
|
242
256
|
export declare function fingerprintSentence(intact: boolean, given: CheckReport['statementFingerprint']): string | null;
|
|
243
257
|
/** W-C4, W-C5 or W-C8, then W-C9 when the ledger was not read. */
|
|
244
258
|
export declare function heldFileSentences(held: HeldFileOutcome): string[];
|
|
259
|
+
/**
|
|
260
|
+
* A report with the narrower fact the checker's own commands read: whether every entry the record has is in the
|
|
261
|
+
* file and matches what was committed, and the proof layer, where it was compared, agrees. It says nothing of a
|
|
262
|
+
* daily statement, a statement fingerprint or a held file, and it is true beside a proof layer that was not read.
|
|
263
|
+
* Internal: `release`, `evidence` and the lookup of where entries were committed read `entriesMatch`; the
|
|
264
|
+
* package exports only the report, whose `passed` follows its exit code.
|
|
265
|
+
*/
|
|
266
|
+
export interface ReportWithFacts {
|
|
267
|
+
report: CheckReport;
|
|
268
|
+
entriesMatch: boolean;
|
|
269
|
+
}
|
|
245
270
|
export declare function buildReport(input: ReportInput): CheckReport;
|
|
271
|
+
/** Internal; see `ReportWithFacts`. */
|
|
272
|
+
export declare function buildReportWithFacts(input: ReportInput): ReportWithFacts;
|
|
246
273
|
export interface SealsReportInput {
|
|
247
274
|
checker: {
|
|
248
275
|
name: string;
|
|
@@ -264,6 +291,8 @@ export interface SealsReportInput {
|
|
|
264
291
|
}
|
|
265
292
|
/** A seal history's report, alone or in a kept copy, with any disclosure checked against it. */
|
|
266
293
|
export declare function buildSealsReport(input: SealsReportInput): CheckReport;
|
|
294
|
+
/** Internal; see `ReportWithFacts`. Here `entriesMatch` also needs any disclosure to have verified. */
|
|
295
|
+
export declare function buildSealsReportWithFacts(input: SealsReportInput): ReportWithFacts;
|
|
267
296
|
export declare const WRITES_HEADING = "Where each entry was committed on the proof layer:";
|
|
268
297
|
export declare const WRITES_NOT_READ_SENTENCE = "Where each entry was committed could not be read from the proof layer this time. The check above does not depend on it.";
|
|
269
298
|
/** The text report lists at most this many writes; `--json` lists all. */
|
package/package.json
CHANGED