@intentius/chant 0.87.0 → 0.89.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/dist/cli/handlers/misc.d.ts.map +1 -1
- package/dist/cli/handlers/serve.d.ts.map +1 -1
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/mcp/server.d.ts +10 -1
- package/dist/cli/mcp/server.d.ts.map +1 -1
- package/dist/cli/mcp/workspace-plugins.d.ts +40 -0
- package/dist/cli/mcp/workspace-plugins.d.ts.map +1 -0
- package/dist/cli/registry.d.ts +6 -1
- package/dist/cli/registry.d.ts.map +1 -1
- package/dist/cli/version.d.ts +8 -0
- package/dist/cli/version.d.ts.map +1 -0
- package/dist/workspace/__fixtures__/sessions.d.ts +9 -0
- package/dist/workspace/__fixtures__/sessions.d.ts.map +1 -1
- package/dist/workspace/composites.d.ts +13 -0
- package/dist/workspace/composites.d.ts.map +1 -1
- package/dist/workspace/environments.d.ts +80 -0
- package/dist/workspace/environments.d.ts.map +1 -0
- package/dist/workspace/reason-codes.d.ts +14 -5
- package/dist/workspace/reason-codes.d.ts.map +1 -1
- package/dist/workspace/records-cli.d.ts +6 -2
- package/dist/workspace/records-cli.d.ts.map +1 -1
- package/dist/workspace/records-close.d.ts +41 -0
- package/dist/workspace/records-close.d.ts.map +1 -0
- package/dist/workspace/records-since.d.ts +40 -1
- package/dist/workspace/records-since.d.ts.map +1 -1
- package/dist/workspace/records-write.d.ts +109 -11
- package/dist/workspace/records-write.d.ts.map +1 -1
- package/dist/workspace/records.d.ts +40 -12
- package/dist/workspace/records.d.ts.map +1 -1
- package/dist/workspace/runtimes.d.ts +6 -0
- package/dist/workspace/runtimes.d.ts.map +1 -1
- package/dist/workspace/session-kinds.d.ts +28 -0
- package/dist/workspace/session-kinds.d.ts.map +1 -0
- package/dist/workspace/status.d.ts +2 -0
- package/dist/workspace/status.d.ts.map +1 -1
- package/dist/workspace/trust/seal.d.ts +42 -0
- package/dist/workspace/trust/seal.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/cli/handlers/misc.ts +1 -9
- package/src/cli/handlers/serve.ts +10 -1
- package/src/cli/main.test.ts +7 -0
- package/src/cli/main.ts +60 -9
- package/src/cli/mcp/server.test.ts +14 -1
- package/src/cli/mcp/server.ts +13 -2
- package/src/cli/mcp/workspace-plugins.ts +123 -0
- package/src/cli/registry.ts +6 -1
- package/src/cli/serve-mcp-workspace.test.ts +142 -0
- package/src/cli/version.ts +15 -0
- package/src/workspace/__fixtures__/sessions.ts +41 -0
- package/src/workspace/composites.schema.json +68 -3
- package/src/workspace/composites.test.ts +119 -5
- package/src/workspace/composites.ts +26 -7
- package/src/workspace/conformance/__fixture__/decisions/decision.schema.json +11 -0
- package/src/workspace/environments.ts +165 -0
- package/src/workspace/read-contract.test.ts +3 -0
- package/src/workspace/reason-codes.test.ts +8 -3
- package/src/workspace/reason-codes.ts +18 -6
- package/src/workspace/record-assets.test.ts +4 -3
- package/src/workspace/records-amend.schema.json +30 -1
- package/src/workspace/records-cli.ts +44 -7
- package/src/workspace/records-close.schema.json +192 -0
- package/src/workspace/records-close.ts +129 -0
- package/src/workspace/records-contract.test.ts +4 -3
- package/src/workspace/records-new.schema.json +25 -0
- package/src/workspace/records-review.schema.json +55 -2
- package/src/workspace/records-sessions-write.test.ts +274 -0
- package/src/workspace/records-since.schema.json +27 -2
- package/src/workspace/records-since.ts +120 -6
- package/src/workspace/records-write-contract.test.ts +5 -1
- package/src/workspace/records-write.test.ts +4 -2
- package/src/workspace/records-write.ts +307 -43
- package/src/workspace/records.schema.json +22 -3
- package/src/workspace/records.ts +73 -22
- package/src/workspace/runtimes.ts +12 -3
- package/src/workspace/session-kinds.ts +79 -0
- package/src/workspace/status.ts +1 -1
- package/src/workspace/trust/record-seal.test.ts +315 -0
- package/src/workspace/trust/seal.test.ts +4 -14
- package/src/workspace/trust/seal.ts +119 -25
|
@@ -14,33 +14,47 @@
|
|
|
14
14
|
*
|
|
15
15
|
* Every command writes one file or none, never commits, and prints one JSON
|
|
16
16
|
* document with a closed error code on refusal. `--dry-run` prints the
|
|
17
|
-
* document and the text it would write, and writes nothing.
|
|
17
|
+
* document and the text it would write, and writes nothing. The exception is
|
|
18
|
+
* `review --session` (#2693), which appends the verdict to the open session
|
|
19
|
+
* as well, after checking both files, so the two lists never differ.
|
|
20
|
+
* `records close` is in `records-close.ts`.
|
|
21
|
+
*
|
|
22
|
+
* `new --sign` and `amend --sign` seal the record's author (#2688), and
|
|
23
|
+
* `review --sign` seals a verdict (#2687): see `trust/seal.ts`.
|
|
18
24
|
*/
|
|
19
25
|
import type { CommandContext } from "../cli/registry.js";
|
|
20
|
-
import { type
|
|
26
|
+
import { type RecordSource } from "./record-source.js";
|
|
27
|
+
import { type LoadedRecordKind, type RecordEntry, type RecordWarning } from "./records.js";
|
|
21
28
|
/** The version of the write documents this chant prints. */
|
|
22
29
|
export declare const RECORDS_WRITE_CONTRACT_VERSION = 1;
|
|
23
30
|
export declare const RECORDS_NEW_SCHEMA_ID = "https://intentius.io/chant/schemas/workspace/records-new/v1/records-new.schema.json";
|
|
24
31
|
export declare const RECORDS_AMEND_SCHEMA_ID = "https://intentius.io/chant/schemas/workspace/records-amend/v1/records-amend.schema.json";
|
|
25
32
|
export declare const RECORDS_REVIEW_SCHEMA_ID = "https://intentius.io/chant/schemas/workspace/records-review/v1/records-review.schema.json";
|
|
33
|
+
/** Loading the kind and reading its records, as `records` reads them. */
|
|
34
|
+
export declare const LOAD_ERROR_CODES: readonly ["kind-unreadable", "kind-invalid", "schema-unreadable", "schema-id-mismatch", "schema-invalid", "location-missing"];
|
|
26
35
|
/** Why `records new` wrote nothing. Closed: a reader may switch on it. */
|
|
27
|
-
export declare const NEW_ERROR_CODES: readonly ["kind-unreadable", "kind-invalid", "schema-unreadable", "schema-id-mismatch", "schema-invalid", "location-missing", "write-usage-invalid", "write-input-invalid", "record-id-taken", "record-id-unallocatable", "record-path-unmatched", "record-unparseable", "record-schema-invalid", "record-id-duplicate", "record-supersedes-unknown", "record-supersedes-conflict", "session-seal-mismatch", "session-verdict-unknown-record"];
|
|
36
|
+
export declare const NEW_ERROR_CODES: readonly ["kind-unreadable", "kind-invalid", "schema-unreadable", "schema-id-mismatch", "schema-invalid", "location-missing", "write-usage-invalid", "write-input-invalid", "record-id-taken", "record-id-unallocatable", "record-path-unmatched", "record-sign-failed", "record-unparseable", "record-schema-invalid", "record-id-duplicate", "record-supersedes-unknown", "record-supersedes-conflict", "session-seal-mismatch", "session-verdict-unknown-record"];
|
|
28
37
|
/** Why `records amend` wrote nothing. */
|
|
29
|
-
export declare const AMEND_ERROR_CODES: readonly ["kind-unreadable", "kind-invalid", "schema-unreadable", "schema-id-mismatch", "schema-invalid", "location-missing", "write-usage-invalid", "write-input-invalid", "record-not-found", "amend-id-immutable", "record-closed", "amend-supersede-instead", "record-unparseable", "record-schema-invalid", "record-id-duplicate", "record-supersedes-unknown", "record-supersedes-conflict", "session-seal-mismatch", "session-verdict-unknown-record"];
|
|
38
|
+
export declare const AMEND_ERROR_CODES: readonly ["kind-unreadable", "kind-invalid", "schema-unreadable", "schema-id-mismatch", "schema-invalid", "location-missing", "write-usage-invalid", "write-input-invalid", "record-not-found", "amend-id-immutable", "record-closed", "amend-supersede-instead", "record-sign-failed", "record-unparseable", "record-schema-invalid", "record-id-duplicate", "record-supersedes-unknown", "record-supersedes-conflict", "session-seal-mismatch", "session-verdict-unknown-record"];
|
|
30
39
|
/** Why `records review` wrote nothing. */
|
|
31
|
-
export declare const REVIEW_ERROR_CODES: readonly ["kind-unreadable", "kind-invalid", "schema-unreadable", "schema-id-mismatch", "schema-invalid", "location-missing", "write-usage-invalid", "record-not-found", "review-unsupported", "record-closed", "review-note-required", "review-sign-failed", "record-unparseable", "record-schema-invalid", "record-id-duplicate", "record-supersedes-unknown", "record-supersedes-conflict", "session-seal-mismatch", "session-verdict-unknown-record"];
|
|
40
|
+
export declare const REVIEW_ERROR_CODES: readonly ["kind-unreadable", "kind-invalid", "schema-unreadable", "schema-id-mismatch", "schema-invalid", "location-missing", "write-usage-invalid", "record-not-found", "review-unsupported", "record-closed", "review-note-required", "review-sign-failed", "session-unknown", "session-not-open", "record-unparseable", "record-schema-invalid", "record-id-duplicate", "record-supersedes-unknown", "record-supersedes-conflict", "session-seal-mismatch", "session-verdict-unknown-record"];
|
|
32
41
|
export type NewErrorCode = (typeof NEW_ERROR_CODES)[number];
|
|
33
42
|
export type AmendErrorCode = (typeof AMEND_ERROR_CODES)[number];
|
|
34
43
|
export type ReviewErrorCode = (typeof REVIEW_ERROR_CODES)[number];
|
|
44
|
+
type WriteErrorCode = NewErrorCode | AmendErrorCode | ReviewErrorCode | import("./records-close.js").CloseErrorCode;
|
|
35
45
|
export declare const VERDICTS: readonly ["agree", "dissent", "abstain"];
|
|
36
46
|
export type Verdict = (typeof VERDICTS)[number];
|
|
37
|
-
|
|
47
|
+
export declare class RecordWriteError extends Error {
|
|
48
|
+
readonly code: WriteErrorCode;
|
|
49
|
+
constructor(code: WriteErrorCode, message: string);
|
|
50
|
+
}
|
|
51
|
+
export interface KindView {
|
|
38
52
|
name: string;
|
|
39
53
|
schema: string;
|
|
40
54
|
file: string;
|
|
41
55
|
}
|
|
42
56
|
/** What every write result carries. */
|
|
43
|
-
interface WriteResult {
|
|
57
|
+
export interface WriteResult {
|
|
44
58
|
$schema: string;
|
|
45
59
|
contract: number;
|
|
46
60
|
kind: KindView;
|
|
@@ -54,7 +68,7 @@ interface WriteResult {
|
|
|
54
68
|
/** With --dry-run, the whole text the command would write. */
|
|
55
69
|
text?: string;
|
|
56
70
|
}
|
|
57
|
-
interface WriteFailure<C> {
|
|
71
|
+
export interface WriteFailure<C> {
|
|
58
72
|
$schema: string;
|
|
59
73
|
contract: number;
|
|
60
74
|
error: {
|
|
@@ -62,12 +76,32 @@ interface WriteFailure<C> {
|
|
|
62
76
|
message: string;
|
|
63
77
|
};
|
|
64
78
|
}
|
|
65
|
-
|
|
79
|
+
/** A record's author seal as `new` and `amend` write it with `--sign` (#2688). */
|
|
80
|
+
export interface AuthorSeal {
|
|
81
|
+
signer: string;
|
|
82
|
+
key: string;
|
|
83
|
+
signature: string;
|
|
84
|
+
}
|
|
85
|
+
export type NewDocument = (WriteResult & {
|
|
86
|
+
seal?: AuthorSeal;
|
|
87
|
+
}) | WriteFailure<NewErrorCode>;
|
|
66
88
|
export type AmendDocument = (WriteResult & {
|
|
67
89
|
changed: string[];
|
|
90
|
+
seal?: AuthorSeal;
|
|
91
|
+
sealDropped?: string;
|
|
68
92
|
}) | WriteFailure<AmendErrorCode>;
|
|
93
|
+
/** With --session (#2693): the session the verdict was also appended to. */
|
|
94
|
+
export interface ReviewSession {
|
|
95
|
+
id: string;
|
|
96
|
+
path: string;
|
|
97
|
+
/** The entry appended to the session's verdicts list. */
|
|
98
|
+
verdict: Record<string, unknown>;
|
|
99
|
+
/** With --dry-run, the whole text the session file would hold. */
|
|
100
|
+
text?: string;
|
|
101
|
+
}
|
|
69
102
|
export type ReviewDocument = (WriteResult & {
|
|
70
103
|
review: Record<string, unknown>;
|
|
104
|
+
session?: ReviewSession;
|
|
71
105
|
}) | WriteFailure<ReviewErrorCode>;
|
|
72
106
|
/**
|
|
73
107
|
* YAML limited to what JSON can say, laid out as the decision README writes a
|
|
@@ -78,6 +112,8 @@ export type ReviewDocument = (WriteResult & {
|
|
|
78
112
|
export declare function toYaml(value: unknown, indent?: number): string;
|
|
79
113
|
/** A record file: the front matter, then `body` as it is. */
|
|
80
114
|
export declare function renderRecord(data: Record<string, unknown>, body: string): string;
|
|
115
|
+
/** JSON with object keys sorted, for comparing two values whatever their key order. */
|
|
116
|
+
export declare function stableJson(value: unknown): string;
|
|
81
117
|
/**
|
|
82
118
|
* `text` with the top-level fields in `set` replaced in place, and every
|
|
83
119
|
* other byte kept. A field's block is its key line at column 0 and the lines
|
|
@@ -89,8 +125,55 @@ export declare function renderRecord(data: Record<string, unknown>, body: string
|
|
|
89
125
|
* as `expected`, so a caller never writes a file it did not mean to.
|
|
90
126
|
*/
|
|
91
127
|
export declare function replaceFields(text: string, set: Record<string, unknown>, expected: Record<string, unknown>): string | undefined;
|
|
128
|
+
/**
|
|
129
|
+
* `text` with the top-level field `key` removed: its key line and the lines
|
|
130
|
+
* after it that {@link replaceFields} counts as its block, less the blank
|
|
131
|
+
* lines ending it, which stay. Returns undefined when the result does not
|
|
132
|
+
* read back as `expected`.
|
|
133
|
+
*/
|
|
134
|
+
export declare function removeField(text: string, key: string, expected: Record<string, unknown>): string | undefined;
|
|
92
135
|
/** A file-name slug from a title, as `scripts/import-decisions.mjs` makes one. */
|
|
93
136
|
export declare function slug(title: string): string;
|
|
137
|
+
export interface Opened {
|
|
138
|
+
loaded: LoadedRecordKind;
|
|
139
|
+
root: string;
|
|
140
|
+
/** Where pinned paths resolve, from `root`. */
|
|
141
|
+
workspaceRoot: string;
|
|
142
|
+
source: RecordSource;
|
|
143
|
+
view: KindView;
|
|
144
|
+
/** The records directory, from `root`. */
|
|
145
|
+
dirRel: string;
|
|
146
|
+
}
|
|
147
|
+
export declare function open(kind: string, cwd: string): Promise<Opened>;
|
|
148
|
+
/**
|
|
149
|
+
* The kind's records as `records` reads them from `source`. A session kind's
|
|
150
|
+
* subject records are read from the same source (#2693), so a write is
|
|
151
|
+
* refused for a verdict naming a record that does not exist.
|
|
152
|
+
*/
|
|
153
|
+
export declare function readAll(o: Opened, source: RecordSource): Promise<RecordEntry[]>;
|
|
154
|
+
/** `base` with the file at `path` holding `text`, added to its directory when new. */
|
|
155
|
+
export declare function overlay(base: RecordSource, path: string, text: string): RecordSource;
|
|
156
|
+
/**
|
|
157
|
+
* Read the records again with `text` at `path`, over `base` (the working
|
|
158
|
+
* tree unless another write goes with this one). The written record must come
|
|
159
|
+
* back with no reason, and no other record may gain one. Returns the written
|
|
160
|
+
* record's warnings.
|
|
161
|
+
*/
|
|
162
|
+
export declare function validateWrite(o: Opened, before: RecordEntry[], path: string, text: string, base?: RecordSource): Promise<RecordWarning[]>;
|
|
163
|
+
export declare function findRecord(entries: RecordEntry[], id: string, kind: string): RecordEntry & {
|
|
164
|
+
data: Record<string, unknown>;
|
|
165
|
+
};
|
|
166
|
+
/**
|
|
167
|
+
* The opening revision a session lacks (#2693): when the kind names one and
|
|
168
|
+
* the record holds null there, HEAD, once the repository has a commit.
|
|
169
|
+
* Every write to the session fills it.
|
|
170
|
+
*/
|
|
171
|
+
export declare function openedRevFill(kind: LoadedRecordKind["kind"], data: Record<string, unknown>, root: string): Record<string, unknown>;
|
|
172
|
+
/** Keys in the schema's `required` order, then its `properties` order, then the rest as given. */
|
|
173
|
+
export declare function schemaOrder(data: Record<string, unknown>, schema: Record<string, unknown>): string[];
|
|
174
|
+
export declare function pick(data: Record<string, unknown>, keys: string[]): Record<string, unknown>;
|
|
175
|
+
export declare function abs(o: Opened, path: string): string;
|
|
176
|
+
export declare function failure<C>(schema: string, err: unknown): WriteFailure<C>;
|
|
94
177
|
/**
|
|
95
178
|
* The next id: `<prefix>-<n>`, one above the highest number any record in the
|
|
96
179
|
* directory has with that prefix, padded to at least three digits, or to the
|
|
@@ -111,8 +194,14 @@ export interface NewRecordOptions {
|
|
|
111
194
|
prefix?: string;
|
|
112
195
|
dryRun?: boolean;
|
|
113
196
|
cwd: string;
|
|
197
|
+
/**
|
|
198
|
+
* Seal the record's author (#2688): a key file, resolved against `cwd`, or
|
|
199
|
+
* true for git's `user.signingkey`. The author is the kind's
|
|
200
|
+
* `reviews.decider` field, which the fields must set.
|
|
201
|
+
*/
|
|
202
|
+
sign?: string | true;
|
|
114
203
|
}
|
|
115
|
-
/** `records new`: write one new record from validated fields
|
|
204
|
+
/** `records new`: write one new record from validated fields, sealed by its author with `sign`. */
|
|
116
205
|
export declare function newRecord(opts: NewRecordOptions): Promise<NewDocument>;
|
|
117
206
|
export interface AmendRecordOptions {
|
|
118
207
|
kind: string;
|
|
@@ -121,6 +210,8 @@ export interface AmendRecordOptions {
|
|
|
121
210
|
fields: string;
|
|
122
211
|
dryRun?: boolean;
|
|
123
212
|
cwd: string;
|
|
213
|
+
/** Seal the amended record's author, as `records new` does (#2688). */
|
|
214
|
+
sign?: string | true;
|
|
124
215
|
}
|
|
125
216
|
/**
|
|
126
217
|
* `records amend`: set top-level fields of one record. A record in a closed
|
|
@@ -128,6 +219,13 @@ export interface AmendRecordOptions {
|
|
|
128
219
|
* a decided decision) changes in place only in its state, to one ranked at
|
|
129
220
|
* least as high, its pins field and its reviews: anything else is a new
|
|
130
221
|
* decision, written as a record that supersedes it (#2524 D4).
|
|
222
|
+
*
|
|
223
|
+
* An amendment moves the record's digest, so an author seal no longer holds
|
|
224
|
+
* (#2688). With `sign` the record is sealed again over the new text; without
|
|
225
|
+
* it, an amendment that moves the digest removes the seal and says so in
|
|
226
|
+
* `sealDropped`, so a record never carries a seal that fails. One that
|
|
227
|
+
* changes only the reviews leaves the digest, and the seal, as they were.
|
|
228
|
+
* `--sign` with nothing to change seals the record as it is.
|
|
131
229
|
*/
|
|
132
230
|
export declare function amendRecord(opts: AmendRecordOptions): Promise<AmendDocument>;
|
|
133
231
|
export interface ReviewRecordOptions {
|
|
@@ -165,7 +263,7 @@ export declare const WRITE_USAGE: string;
|
|
|
165
263
|
* fails with kind-unreadable.
|
|
166
264
|
*/
|
|
167
265
|
export declare function resolveWriteKind(arg: string, cwd: string): string;
|
|
168
|
-
/** `chant workspace records new|amend|review`. Prints one JSON document; exits 0 when it wrote, or would have with --dry-run. */
|
|
266
|
+
/** `chant workspace records new|amend|review|close`. Prints one JSON document; exits 0 when it wrote, or would have with --dry-run. */
|
|
169
267
|
export declare function runRecordsWrite(ctx: CommandContext): Promise<number>;
|
|
170
268
|
export {};
|
|
171
269
|
//# sourceMappingURL=records-write.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"records-write.d.ts","sourceRoot":"","sources":["../../src/workspace/records-write.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"records-write.d.ts","sourceRoot":"","sources":["../../src/workspace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AAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,aAAa,CAAC,CA+ElF;AAID,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,4GAA4G;IAC5G,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,mDAAmD;IACnD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,uEAAuE;IACvE,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED;;;;;GAKG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,cAAc,CAAC,CAyErF;AA+CD,eAAO,MAAM,WAAW,QAKZ,CAAC;AA2Bb;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAcjE;AA2BD,uIAAuI;AACvI,wBAAsB,eAAe,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAwC1E"}
|
|
@@ -42,12 +42,31 @@ export type RecordWarningCode = (typeof RECORD_WARNING_CODES)[number];
|
|
|
42
42
|
export declare const REVIEW_REASON_CODES: readonly ["review-decider", "review-agent", "review-duplicate", "review-older-digest", "review-unattested"];
|
|
43
43
|
export type ReviewReasonCode = (typeof REVIEW_REASON_CODES)[number];
|
|
44
44
|
/**
|
|
45
|
-
* Why a
|
|
46
|
-
* codes. Every verdict in the quorum
|
|
47
|
-
*
|
|
45
|
+
* Why a seal is not attested: a verdict's (#2687), or a record's author seal
|
|
46
|
+
* (#2688). Closed, like the reason codes. Every verdict in the quorum, and
|
|
47
|
+
* every parsed record of a kind with a reviews list, carries one of these in
|
|
48
|
+
* its `attestation`, unless its seal verified.
|
|
48
49
|
*/
|
|
49
50
|
export declare const SEAL_REASON_CODES: readonly ["seal-missing", "seal-signer-unlisted", "seal-signature-invalid", "seal-unverifiable"];
|
|
50
51
|
export type SealCode = (typeof SEAL_REASON_CODES)[number];
|
|
52
|
+
/**
|
|
53
|
+
* A warning about a record's own seal (#2688), raised by `records` with the
|
|
54
|
+
* policy at base, never by a write. Closed, like the reason codes.
|
|
55
|
+
*/
|
|
56
|
+
export declare const SEAL_WARNING_CODES: readonly ["record-unattested"];
|
|
57
|
+
export type SealWarningCode = (typeof SEAL_WARNING_CODES)[number];
|
|
58
|
+
/**
|
|
59
|
+
* The top-level field that holds a record's author seal (#2688), on a kind
|
|
60
|
+
* with a reviews list. Like the reviews block, the record's digest leaves it
|
|
61
|
+
* out, so sealing a record never moves its digest.
|
|
62
|
+
*/
|
|
63
|
+
export declare const RECORD_SEAL_FIELD = "seal";
|
|
64
|
+
/**
|
|
65
|
+
* The top-level fields {@link recordTextDigest} leaves out for a kind: its
|
|
66
|
+
* reviews list and {@link RECORD_SEAL_FIELD} when it has a reviews list, and
|
|
67
|
+
* nothing when it has none (#2672, #2688).
|
|
68
|
+
*/
|
|
69
|
+
export declare function digestFields(kind: Pick<RecordKind, "reviews">): string[] | null;
|
|
51
70
|
/** What a verdict's seal establishes (#2687). See `trust/seal.ts`. */
|
|
52
71
|
export interface VerdictAttestation {
|
|
53
72
|
/** Why the verdict is not attested. Absent when its seal verified. */
|
|
@@ -57,8 +76,8 @@ export interface VerdictAttestation {
|
|
|
57
76
|
key?: string;
|
|
58
77
|
}
|
|
59
78
|
export interface RecordWarning {
|
|
60
|
-
/** A work kind's records also carry the codes of `WORK_WARNING_CODES` (#2683). */
|
|
61
|
-
code: RecordWarningCode | WorkWarningCode;
|
|
79
|
+
/** A work kind's records also carry the codes of `WORK_WARNING_CODES` (#2683), and `records` adds `SEAL_WARNING_CODES` (#2688). */
|
|
80
|
+
code: RecordWarningCode | WorkWarningCode | SealWarningCode;
|
|
62
81
|
message: string;
|
|
63
82
|
}
|
|
64
83
|
/**
|
|
@@ -119,6 +138,9 @@ export declare const recordKindSchema: z.ZodObject<{
|
|
|
119
138
|
subjects: z.ZodObject<{
|
|
120
139
|
kind: z.ZodString;
|
|
121
140
|
}, z.core.$strict>;
|
|
141
|
+
openedRev: z.ZodOptional<z.ZodString>;
|
|
142
|
+
closedRev: z.ZodOptional<z.ZodString>;
|
|
143
|
+
closedOn: z.ZodOptional<z.ZodString>;
|
|
122
144
|
}, z.core.$strict>>;
|
|
123
145
|
work: z.ZodOptional<z.ZodObject<{
|
|
124
146
|
needs: z.ZodString;
|
|
@@ -182,26 +204,32 @@ export declare function parseRecord(format: RecordFormat, text: string): FrontMa
|
|
|
182
204
|
* to the file changes it, so a verdict given before an amendment stops
|
|
183
205
|
* counting.
|
|
184
206
|
*
|
|
207
|
+
* `field` names the top-level fields left out: one name, or a list. For a
|
|
208
|
+
* kind with a reviews list the list is the reviews field and `seal`, the
|
|
209
|
+
* record's author seal (#2688; {@link digestFields}), so sealing a record
|
|
210
|
+
* leaves its digest where it was too. A record with no `seal` hashes exactly
|
|
211
|
+
* as it did before author seals existed.
|
|
212
|
+
*
|
|
185
213
|
* The rule, which a hand-editor can follow with a text editor and
|
|
186
214
|
* `sha256sum`:
|
|
187
215
|
*
|
|
188
216
|
* 1. Line endings become LF (CRLF and a lone CR each become one LF).
|
|
189
217
|
* 2. When the text starts with a `---` line and a later line is exactly
|
|
190
|
-
* `---`, the lines between them are the front matter. In it,
|
|
191
|
-
* that starts, at column 0, with the
|
|
218
|
+
* `---`, the lines between them are the front matter. In it, each line
|
|
219
|
+
* that starts, at column 0, with one of the keys (bare, or in single or
|
|
192
220
|
* double quotes), optional spaces or tabs and a `:`, is removed, and so
|
|
193
221
|
* is every line after it, up to the closing `---`, that is empty or
|
|
194
222
|
* starts with a space, a tab, `#` or `-`. Removal stops at the first
|
|
195
223
|
* other line. Everything else, the `---` lines and the body included, is
|
|
196
|
-
* kept byte for byte.
|
|
224
|
+
* kept byte for byte. Which key is removed first makes no difference.
|
|
197
225
|
* 3. The digest is the SHA-256 of the result's UTF-8 bytes.
|
|
198
226
|
*
|
|
199
|
-
* Text with no front matter, or
|
|
200
|
-
* A writer that adds a verdict must change only the reviews block: a
|
|
227
|
+
* Text with no front matter, or none of the keys, is hashed after step 1
|
|
228
|
+
* alone. A writer that adds a verdict must change only the reviews block: a
|
|
201
229
|
* reformatted front matter is a new digest, and every earlier verdict stops
|
|
202
230
|
* counting.
|
|
203
231
|
*/
|
|
204
|
-
export declare function recordTextDigest(text: string, field?: string | null, format?: RecordFormat): string;
|
|
232
|
+
export declare function recordTextDigest(text: string, field?: string | readonly string[] | null, format?: RecordFormat): string;
|
|
205
233
|
/** The quorum a workspace sets when its declaration names none: two verdicts besides the decider's (#2555). */
|
|
206
234
|
export declare const DEFAULT_QUORUM = 2;
|
|
207
235
|
/** A principal as the quorum compares it: NFKC, trimmed and lower-cased, so `alice` and `Alice ` are one reviewer (#2671). */
|
|
@@ -321,7 +349,7 @@ export interface RecordEntry {
|
|
|
321
349
|
assets: AssetPin[];
|
|
322
350
|
/** Findings that leave the record valid, such as a pinned file that changed (#2549). */
|
|
323
351
|
warnings: RecordWarning[];
|
|
324
|
-
/** {@link recordTextDigest} of the file's text, without the kind's reviews list when it has
|
|
352
|
+
/** {@link recordTextDigest} of the file's text, without the kind's reviews list and author seal when it has a reviews list (#2672, #2688). */
|
|
325
353
|
digest: string;
|
|
326
354
|
/** For a session kind only: the subject records' review entries that name this session (#2673). */
|
|
327
355
|
citedBy?: SessionCitation[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"records.d.ts","sourceRoot":"","sources":["../../src/workspace/records.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAOH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAyB,KA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ACH,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB;;;;OAIG;IACH,QAAQ,CAAC,EAAE;QAAE,OAAO,EAAE,WAAW,EAAE,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IACvD;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,+DAA+D;AAC/D,MAAM,WAAW,aAAa;IAC5B,2FAA2F;IAC3F,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IACzC,+GAA+G;IAC/G,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;CACvC;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,OAAO,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC;IAC/E,8GAA8G;IAC9G,SAAS,CAAC,EAAE,YAAY,EAAE,CAAC;CAC5B;AA0DD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,IAAI,CAAC,UAAU,EAAE,YAAY,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GAAG,MAAM,EAAE,CAQtH;AAWD,oEAAoE;AACpE,wBAAsB,WAAW,CAAC,MAAM,EAAE,gBAAgB,EAAE,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAyKnH"}
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* directory, in the working tree or in the tree `--at` exported. Reading it
|
|
14
14
|
* runs the member's `chant.config.ts` and imports the lexicons it lists.
|
|
15
15
|
*/
|
|
16
|
+
import type { EnvironmentDeclaration } from "../config.js";
|
|
16
17
|
/** The runtime core provides, which `chant run` uses without `--on`. */
|
|
17
18
|
export declare const LOCAL_RUNTIME = "local";
|
|
18
19
|
/** Why a member's runtimes list only part of what its config names. Closed: part of the read contract. */
|
|
@@ -40,6 +41,11 @@ export interface MemberRuntimes {
|
|
|
40
41
|
/** The default runtime's name. */
|
|
41
42
|
default: string;
|
|
42
43
|
reasons: RuntimeReason[];
|
|
44
|
+
/**
|
|
45
|
+
* The config's `environments`, read in the same load (#2695): `[]` when it
|
|
46
|
+
* declares none, null when the config couldn't be read.
|
|
47
|
+
*/
|
|
48
|
+
environments: EnvironmentDeclaration[] | null;
|
|
43
49
|
}
|
|
44
50
|
/** Loads a lexicon plugin by name; `loadPlugin` from the CLI unless a test swaps it. */
|
|
45
51
|
export type PluginLoader = (name: string) => Promise<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtimes.d.ts","sourceRoot":"","sources":["../../src/workspace/runtimes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;
|
|
1
|
+
{"version":3,"file":"runtimes.d.ts","sourceRoot":"","sources":["../../src/workspace/runtimes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAIxD,wEAAwE;AACxE,eAAO,MAAM,aAAa,UAAU,CAAC;AAErC,0GAA0G;AAC1G,eAAO,MAAM,oBAAoB,wEAKS,CAAC;AAC3C,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtE,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,iBAAiB,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,6CAA6C;AAC7C,MAAM,WAAW,gBAAgB;IAC/B,yDAAyD;IACzD,IAAI,EAAE,MAAM,CAAC;IACb,sDAAsD;IACtD,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,yEAAyE;IACzE,OAAO,EAAE,OAAO,CAAC;IACjB,mFAAmF;IACnF,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,oDAAoD;AACpD,MAAM,WAAW,cAAc;IAC7B,mFAAmF;IACnF,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,kCAAkC;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,aAAa,EAAE,CAAC;IACzB;;;OAGG;IACH,YAAY,EAAE,sBAAsB,EAAE,GAAG,IAAI,CAAC;CAC/C;AAED,wFAAwF;AACxF,MAAM,MAAM,YAAY,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;IAAE,SAAS,CAAC,EAAE;QAAE,aAAa,CAAC,EAAE,OAAO,CAAA;KAAE,CAAA;CAAE,CAAC,CAAC;AAIlG,2FAA2F;AAC3F,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,cAAc,CAAC,CAuBlG;AAED,2FAA2F;AAC3F,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,GAAG,SAAS,GAAG,gBAAgB,EAAE,CAS3G;AAED,+EAA+E;AAC/E,wBAAsB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EAAE,EAAE,IAAI,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,CAO7K"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Finding review-session kinds and the commits a session names (#2693), for
|
|
3
|
+
* the commands that act on a session by its id: `records review --session`,
|
|
4
|
+
* `records close` and `records --since <session id>`.
|
|
5
|
+
*
|
|
6
|
+
* A session kind is found through the workspace declaration nearest above
|
|
7
|
+
* the working directory, or named directly. Nothing here writes.
|
|
8
|
+
*/
|
|
9
|
+
import { type LoadedRecordKind } from "./records.js";
|
|
10
|
+
/** The shape of an id `records --since` looks up as a session before reading it as a revision: `S-0002`, `ws-052`. */
|
|
11
|
+
export declare const SESSION_ID: RegExp;
|
|
12
|
+
/**
|
|
13
|
+
* Every session kind among `extra` (kind files, resolved against `cwd`) and
|
|
14
|
+
* the kinds the declaration nearest above `cwd` names, each once, in that
|
|
15
|
+
* order. A kind that can't be loaded, or a declaration that can't be read,
|
|
16
|
+
* adds nothing: the read of that kind reports it.
|
|
17
|
+
*/
|
|
18
|
+
export declare function findSessionKinds(cwd: string, extra?: string[]): Promise<LoadedRecordKind[]>;
|
|
19
|
+
/** The session kinds whose `session.subjects.kind` is the kind file `subjectFile`. */
|
|
20
|
+
export declare function sessionKindsFor(subjectFile: string, cwd: string): Promise<LoadedRecordKind[]>;
|
|
21
|
+
/** The full commit id HEAD names in the repository holding `dir`, or null outside git or before the first commit. */
|
|
22
|
+
export declare function headCommit(dir: string): string | null;
|
|
23
|
+
/**
|
|
24
|
+
* Commit ids from `git log <args> --format=%H -- <path>` in the repository at
|
|
25
|
+
* `top`, newest first; empty when git knows nothing of the path.
|
|
26
|
+
*/
|
|
27
|
+
export declare function commitsTouching(top: string, path: string, args: string[]): string[];
|
|
28
|
+
//# sourceMappingURL=session-kinds.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-kinds.d.ts","sourceRoot":"","sources":["../../src/workspace/session-kinds.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,OAAO,EAAmC,KAAK,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAGnF,sHAAsH;AACtH,eAAO,MAAM,UAAU,QAAkC,CAAC;AAE1D;;;;;GAKG;AACH,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,GAAE,MAAM,EAAO,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAqBrG;AAED,sFAAsF;AACtF,wBAAsB,eAAe,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAGnG;AAED,qHAAqH;AACrH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CASrD;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAQnF"}
|
|
@@ -52,6 +52,8 @@ export declare const STATUS_GATE_REASON_CODES: readonly ["gates-no-ledger", "gat
|
|
|
52
52
|
*/
|
|
53
53
|
export declare const STATUS_ERROR_CODES: readonly ["declaration-missing", "declaration-ambiguous", "declaration-unparseable", "declaration-invalid", "placement-invalid", "reader-too-old", "root-chant-required", "not-a-git-repository", "environment-invalid"];
|
|
54
54
|
export type StatusErrorCode = (typeof STATUS_ERROR_CODES)[number];
|
|
55
|
+
/** Environment names a ledger directory can have: no `/`, no leading `_` or `.` (those are chant's own directories). */
|
|
56
|
+
export declare const ENV_PATTERN: RegExp;
|
|
55
57
|
export interface StatusRelease {
|
|
56
58
|
component: string;
|
|
57
59
|
digest: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/workspace/status.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAMH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGtD,OAAO,EAAyC,KAAK,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAExG,OAAO,EAAsD,KAAK,aAAa,EAAe,MAAM,eAAe,CAAC;AAEpH,OAAO,EAAsC,KAAK,gBAAgB,EAAE,KAAK,UAAU,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAInI,4DAA4D;AAC5D,eA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AK,EAAE;QAAE,IAAI,EAAE,eAAe,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,aAAa,GAAG,IAAI,CAAA;KAAE,CAAC;CACnF,CAAC;AAEN,KAAK,YAAY,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;IAAE,OAAO,EAAE,aAAa,EAAE,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAE5G,MAAM,WAAW,WAAW;IAC1B,mDAAmD;IACnD,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qEAAqE;IACrE,UAAU,CAAC,EAAE,YAAY,CAAC;IAC1B,4EAA4E;IAC5E,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAC7B,uEAAuE;IACvE,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAuFD,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,iBAAiB,EAAE,CAAC,EAAE,iBAAiB,GAAG,aAAa,CAW7F;AAED,6FAA6F;AAC7F,wBAAsB,eAAe,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,cAAc,CAAC,CAqEjF;AAED,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAuC7E;AAeD,wBAAgB,YAAY,CAAC,GAAG,EAAE,OAAO,CAAC,cAAc,EAAE;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,GAAG,MAAM,CAqCvF"}
|
|
@@ -14,11 +14,19 @@
|
|
|
14
14
|
* digest is the record's text digest (`recordTextDigest`), so the seal binds
|
|
15
15
|
* the verdict to the text it judged. The seal lives inside the reviews block,
|
|
16
16
|
* which the digest leaves out, so sealing a verdict never moves the digest.
|
|
17
|
+
*
|
|
18
|
+
* A record's author seal (#2688) works the same way, in its own namespace,
|
|
19
|
+
* `chant-record`. It sits in the record's top-level `seal` field, which the
|
|
20
|
+
* digest also leaves out, and signs the record id, the digest, the author
|
|
21
|
+
* (the kind's `reviews.decider` field, `decided_by` for decisions) and the
|
|
22
|
+
* state. An amendment moves the digest, so it has to be signed again.
|
|
17
23
|
*/
|
|
18
24
|
import type { SealCode } from "../records.js";
|
|
19
25
|
import { type TrustPolicy } from "./policy.js";
|
|
20
26
|
/** The ssh signature namespace of a verdict seal. */
|
|
21
27
|
export declare const REVIEW_SEAL_NAMESPACE = "chant-review";
|
|
28
|
+
/** The ssh signature namespace of a record's author seal (#2688). */
|
|
29
|
+
export declare const RECORD_SEAL_NAMESPACE = "chant-record";
|
|
22
30
|
/** A seal as a review entry holds it. */
|
|
23
31
|
export interface VerdictSeal {
|
|
24
32
|
/** The principal who signed: the reviewer, as the signers file names them. */
|
|
@@ -49,6 +57,23 @@ export interface SealedVerdict {
|
|
|
49
57
|
}
|
|
50
58
|
/** The bytes a verdict seal signs. */
|
|
51
59
|
export declare function reviewSealPayload(record: string, digest: string, verdict: string, reviewer: string, on: string): Buffer;
|
|
60
|
+
/**
|
|
61
|
+
* The bytes a record's author seal signs (#2688): the id, the digest, the
|
|
62
|
+
* author and the state, joined by LF with no final newline. A kind without
|
|
63
|
+
* states signs an empty last line.
|
|
64
|
+
*/
|
|
65
|
+
export declare function recordSealPayload(record: string, digest: string, author: string, state: string | null): Buffer;
|
|
66
|
+
/** The record an author seal covers (#2688). */
|
|
67
|
+
export interface SealedRecord {
|
|
68
|
+
record: string | null;
|
|
69
|
+
digest: string;
|
|
70
|
+
/** The author as the record names them, or null when it names none. */
|
|
71
|
+
author: string | null;
|
|
72
|
+
/** The kind's field that names the author, for messages. */
|
|
73
|
+
authorField: string;
|
|
74
|
+
state: string | null;
|
|
75
|
+
seal: unknown;
|
|
76
|
+
}
|
|
52
77
|
/**
|
|
53
78
|
* Check a verdict's seal. With a signers file active at base, it verifies
|
|
54
79
|
* against the keys listed there for the reviewer. With none, a seal present
|
|
@@ -56,6 +81,13 @@ export declare function reviewSealPayload(record: string, digest: string, verdic
|
|
|
56
81
|
* says whose key it is.
|
|
57
82
|
*/
|
|
58
83
|
export declare function checkVerdictSeal(policy: TrustPolicy, v: SealedVerdict): SealCheck;
|
|
84
|
+
/**
|
|
85
|
+
* Check a record's author seal (#2688), as a verdict's is checked, over
|
|
86
|
+
* {@link recordSealPayload} in the `chant-record` namespace. A record that
|
|
87
|
+
* names no author and carries no seal is `seal-missing` with `attested`
|
|
88
|
+
* null even under an active policy: it claims no author to attest.
|
|
89
|
+
*/
|
|
90
|
+
export declare function checkRecordSeal(policy: TrustPolicy, r: SealedRecord): SealCheck;
|
|
59
91
|
/** Why a seal could not be made. */
|
|
60
92
|
export declare class SealError extends Error {
|
|
61
93
|
constructor(message: string);
|
|
@@ -82,4 +114,14 @@ export declare function sealVerdict(keyFile: string, v: {
|
|
|
82
114
|
reviewer: string;
|
|
83
115
|
on: string;
|
|
84
116
|
}): VerdictSeal;
|
|
117
|
+
/**
|
|
118
|
+
* Seal a record's author (#2688) with the key in `keyFile`, over
|
|
119
|
+
* {@link recordSealPayload}. Throws a {@link SealError}.
|
|
120
|
+
*/
|
|
121
|
+
export declare function sealRecord(keyFile: string, r: {
|
|
122
|
+
record: string;
|
|
123
|
+
digest: string;
|
|
124
|
+
author: string;
|
|
125
|
+
state: string | null;
|
|
126
|
+
}): VerdictSeal;
|
|
85
127
|
//# sourceMappingURL=seal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seal.d.ts","sourceRoot":"","sources":["../../../src/workspace/trust/seal.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"seal.d.ts","sourceRoot":"","sources":["../../../src/workspace/trust/seal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAMH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,KAAK,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@ import { homedir } from "os";
|
|
|
11
11
|
import type { ResourceSelector } from "../../lexicon";
|
|
12
12
|
import { formatError, formatSuccess, formatWarning, formatBold } from "../format";
|
|
13
13
|
import type { CommandContext } from "../registry";
|
|
14
|
-
import { createRequire } from "module";
|
|
15
14
|
import { listComponents, describeComponent } from "../../components/cli-support";
|
|
16
|
-
|
|
17
|
-
const CHANT_VERSION: string = (() => {
|
|
18
|
-
try {
|
|
19
|
-
return createRequire(import.meta.url)("../../../package.json").version ?? "0.0.0";
|
|
20
|
-
} catch {
|
|
21
|
-
return "0.0.0";
|
|
22
|
-
}
|
|
23
|
-
})();
|
|
15
|
+
import { CHANT_VERSION } from "../version";
|
|
24
16
|
|
|
25
17
|
const AUDIT_FORMATS: AuditFormat[] = ["stylish", "json", "sarif", "markdown", "html"];
|
|
26
18
|
const AUDIT_TIERS: AuditTier[] = ["merge-worthy", "all"];
|
|
@@ -11,7 +11,16 @@ export async function runServeLsp(ctx: CommandContext): Promise<number> {
|
|
|
11
11
|
|
|
12
12
|
export async function runServeMcp(ctx: CommandContext): Promise<number> {
|
|
13
13
|
const { McpServer } = await import("../mcp/server");
|
|
14
|
-
|
|
14
|
+
// #2700 — main() hands over no plugins only at a workspace root with no
|
|
15
|
+
// lexicon of its own (anywhere else it refuses first). There the lexicons
|
|
16
|
+
// are the chant members', and the server says which loaded.
|
|
17
|
+
let plugins = ctx.plugins;
|
|
18
|
+
let instructions: string | undefined;
|
|
19
|
+
if (plugins.length === 0) {
|
|
20
|
+
const { loadWorkspacePlugins } = await import("../mcp/workspace-plugins");
|
|
21
|
+
({ plugins, instructions } = await loadWorkspacePlugins(process.cwd()));
|
|
22
|
+
}
|
|
23
|
+
const server = new McpServer(plugins, { instructions });
|
|
15
24
|
await server.start();
|
|
16
25
|
await new Promise(() => {});
|
|
17
26
|
return 0; // unreachable
|
package/src/cli/main.test.ts
CHANGED
|
@@ -71,6 +71,13 @@ describe("parseArgs", () => {
|
|
|
71
71
|
expect(result.help).toBe(true);
|
|
72
72
|
});
|
|
73
73
|
|
|
74
|
+
test("parses --version and -V (#2701)", () => {
|
|
75
|
+
expect(parseArgs(["--version"]).version).toBe(true);
|
|
76
|
+
expect(parseArgs(["-V"]).version).toBe(true);
|
|
77
|
+
expect(parseArgs(["build"]).version).toBeUndefined();
|
|
78
|
+
expect(() => parseArgs(["--version=1"])).toThrow();
|
|
79
|
+
});
|
|
80
|
+
|
|
74
81
|
test("parses --output with value", () => {
|
|
75
82
|
const result = parseArgs(["build", "--output", "stack.json"]);
|
|
76
83
|
expect(result.output).toBe("stack.json");
|