@intentius/chant 0.82.0 → 0.84.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/main.d.ts.map +1 -1
- package/dist/cli/registry.d.ts +4 -0
- package/dist/cli/registry.d.ts.map +1 -1
- package/dist/content-digest.d.ts +2 -0
- package/dist/content-digest.d.ts.map +1 -1
- package/dist/workspace/checks/records.d.ts +33 -0
- package/dist/workspace/checks/records.d.ts.map +1 -0
- package/dist/workspace/checks.d.ts +8 -0
- package/dist/workspace/checks.d.ts.map +1 -1
- package/dist/workspace/compose-graph.d.ts +22 -6
- package/dist/workspace/compose-graph.d.ts.map +1 -1
- package/dist/workspace/graph-cli.d.ts +15 -4
- package/dist/workspace/graph-cli.d.ts.map +1 -1
- package/dist/workspace/intent-cli.d.ts +17 -0
- package/dist/workspace/intent-cli.d.ts.map +1 -0
- package/dist/workspace/intent-joins.d.ts +93 -0
- package/dist/workspace/intent-joins.d.ts.map +1 -0
- package/dist/workspace/intent.d.ts +285 -0
- package/dist/workspace/intent.d.ts.map +1 -0
- package/dist/workspace/lineage-check.d.ts +5 -2
- package/dist/workspace/lineage-check.d.ts.map +1 -1
- package/dist/workspace/lineage-init.d.ts.map +1 -1
- package/dist/workspace/lineage-lock.d.ts +8 -0
- package/dist/workspace/lineage-lock.d.ts.map +1 -1
- package/dist/workspace/lineage-upgrade.d.ts.map +1 -1
- package/dist/workspace/reason-codes.d.ts +19 -0
- package/dist/workspace/reason-codes.d.ts.map +1 -1
- package/dist/workspace/record-assets.d.ts +108 -0
- package/dist/workspace/record-assets.d.ts.map +1 -0
- package/dist/workspace/records-cli.d.ts +32 -1
- package/dist/workspace/records-cli.d.ts.map +1 -1
- package/dist/workspace/records.d.ts +47 -0
- package/dist/workspace/records.d.ts.map +1 -1
- package/dist/workspace/template-pins.d.ts +33 -0
- package/dist/workspace/template-pins.d.ts.map +1 -0
- package/dist/workspace/tree.d.ts +5 -0
- package/dist/workspace/tree.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/cli/main.test.ts +11 -0
- package/src/cli/main.ts +22 -6
- package/src/cli/registry.ts +4 -0
- package/src/content-digest.ts +5 -0
- package/src/workspace/checks/records.ts +83 -0
- package/src/workspace/checks.test.ts +2 -0
- package/src/workspace/checks.ts +13 -3
- package/src/workspace/compose-graph.test.ts +2 -1
- package/src/workspace/compose-graph.ts +23 -6
- package/src/workspace/graph-cli.ts +40 -6
- package/src/workspace/graph-contract.test.ts +2 -1
- package/src/workspace/graph.schema.json +131 -2
- package/src/workspace/intent-cli.ts +95 -0
- package/src/workspace/intent-joins.ts +165 -0
- package/src/workspace/intent.schema.json +1078 -0
- package/src/workspace/intent.test.ts +448 -0
- package/src/workspace/intent.ts +941 -0
- package/src/workspace/lineage-check.ts +22 -5
- package/src/workspace/lineage-init.ts +5 -1
- package/src/workspace/lineage-lock.ts +7 -0
- package/src/workspace/lineage-upgrade.test.ts +29 -0
- package/src/workspace/lineage-upgrade.ts +21 -3
- package/src/workspace/member-commands.ts +1 -1
- package/src/workspace/read-contract.test.ts +16 -1
- package/src/workspace/reason-codes.test.ts +7 -2
- package/src/workspace/reason-codes.ts +23 -0
- package/src/workspace/record-assets.test.ts +319 -0
- package/src/workspace/record-assets.ts +207 -0
- package/src/workspace/records-cli.ts +117 -14
- package/src/workspace/records.schema.json +33 -1
- package/src/workspace/records.test.ts +50 -0
- package/src/workspace/records.ts +116 -6
- package/src/workspace/template-pins.test.ts +69 -0
- package/src/workspace/template-pins.ts +117 -0
- package/src/workspace/tree.ts +12 -0
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The intent graph over one region: `chant workspace graph --intent
|
|
3
|
+
* <path[:start-end]>` (#2651; #2650 sections B and C1; #2524 D8, D15).
|
|
4
|
+
*
|
|
5
|
+
* A person points at some code and asks how it got this way and who decided
|
|
6
|
+
* it should be this way. This module gathers what the workspace records about
|
|
7
|
+
* that, as one document of nodes and edges, and decides nothing. It gathers
|
|
8
|
+
* three sources before it relates any of them, so no one of them frames the
|
|
9
|
+
* others:
|
|
10
|
+
*
|
|
11
|
+
* - The commits that touched the region, from git: `git log -L` for a line
|
|
12
|
+
* range, `git log --follow` for a file and `git log -- <dir>` for a
|
|
13
|
+
* directory. Each carries its trailers and its provenance level, and a
|
|
14
|
+
* plugin may join it to a unit of work, a contract and evidence
|
|
15
|
+
* (`intent-joins.ts`).
|
|
16
|
+
* - The decisions whose `constrains` cover the region: a `path:` entry that
|
|
17
|
+
* is the region or a directory above it, the region's `member:`, an issue
|
|
18
|
+
* the region's commits name, or a contract a plugin joined. Their
|
|
19
|
+
* supersession chains come along.
|
|
20
|
+
* - The artifacts those decisions pin. Artifacts relate to code only through
|
|
21
|
+
* decisions (#2549), so an artifact is in the graph because a decision in
|
|
22
|
+
* the graph pins it.
|
|
23
|
+
*
|
|
24
|
+
* Every gap the walk finds is a `finding` node with a closed code, never
|
|
25
|
+
* prose, so a reader can draw it and a test can assert it. chant emits the
|
|
26
|
+
* graph and hud renders it (#2524 D8, D15). Git is read through a local
|
|
27
|
+
* `git` subprocess only: no fetch, no network.
|
|
28
|
+
*/
|
|
29
|
+
import { type LinkTableRow } from "./links.js";
|
|
30
|
+
import { type RecordView } from "./records-cli.js";
|
|
31
|
+
import { type ProvenanceLevel } from "./trust/attestor.js";
|
|
32
|
+
/** The version of the `intent` document this chant writes. */
|
|
33
|
+
export declare const INTENT_CONTRACT_VERSION = 1;
|
|
34
|
+
/** `$id` of the JSON Schema for the document, shipped beside this file. */
|
|
35
|
+
export declare const INTENT_OUTPUT_SCHEMA_ID = "https://intentius.io/chant/schemas/workspace/intent/v1/intent.schema.json";
|
|
36
|
+
/** The finding codes. Closed: a reader may switch on them. */
|
|
37
|
+
export declare const INTENT_FINDING_CODES: readonly ["intent-commit-undecided", "intent-commit-bare", "intent-pin-drifted", "intent-pin-missing", "intent-artifact-unpinned", "intent-decision-superseded-live", "intent-decision-provisional", "intent-constraint-coarse", "intent-constraint-lost", "intent-evidence-unpinned", "intent-trailer-unverified", "intent-region-unconstrained"];
|
|
38
|
+
export type IntentFindingCode = (typeof INTENT_FINDING_CODES)[number];
|
|
39
|
+
/** Why part of the walk could not be read. The read still succeeds. */
|
|
40
|
+
export declare const INTENT_REASON_CODES: readonly ["intent-history-shallow", "intent-plugin-failed"];
|
|
41
|
+
export type IntentReasonCode = (typeof INTENT_REASON_CODES)[number];
|
|
42
|
+
/** Why the read failed as a whole: the declaration's codes, the record kind's codes, or a region that isn't there. */
|
|
43
|
+
export declare const INTENT_ERROR_CODES: readonly ["declaration-missing", "declaration-ambiguous", "declaration-unparseable", "declaration-invalid", "placement-invalid", "reader-too-old", "root-chant-required", "not-a-git-repository", "revision-unknown", "kind-unreadable", "kind-invalid", "schema-unreadable", "schema-id-mismatch", "schema-invalid", "location-missing", "intent-region-invalid"];
|
|
44
|
+
export type IntentErrorCode = (typeof INTENT_ERROR_CODES)[number];
|
|
45
|
+
export declare class IntentError extends Error {
|
|
46
|
+
readonly code: IntentErrorCode;
|
|
47
|
+
constructor(code: IntentErrorCode, message: string);
|
|
48
|
+
}
|
|
49
|
+
export interface LineRange {
|
|
50
|
+
start: number;
|
|
51
|
+
end: number;
|
|
52
|
+
}
|
|
53
|
+
export interface RegionNode {
|
|
54
|
+
id: string;
|
|
55
|
+
kind: "region";
|
|
56
|
+
/** From the workspace root. */
|
|
57
|
+
path: string;
|
|
58
|
+
lines: LineRange | null;
|
|
59
|
+
/** The member whose directory holds the path, or null. */
|
|
60
|
+
member: string | null;
|
|
61
|
+
at: string | null;
|
|
62
|
+
type: "file" | "dir";
|
|
63
|
+
/** For a file region, whether the file is generated (#2524 D14); null for a directory. */
|
|
64
|
+
generated: boolean | null;
|
|
65
|
+
/** Set when the region was given as a graph node id. */
|
|
66
|
+
node: string | null;
|
|
67
|
+
}
|
|
68
|
+
export interface FileNode {
|
|
69
|
+
id: string;
|
|
70
|
+
kind: "file";
|
|
71
|
+
path: string;
|
|
72
|
+
member: string | null;
|
|
73
|
+
generated: boolean;
|
|
74
|
+
}
|
|
75
|
+
export interface MemberNode {
|
|
76
|
+
id: string;
|
|
77
|
+
kind: "member";
|
|
78
|
+
name: string;
|
|
79
|
+
dir: string;
|
|
80
|
+
memberKind: string;
|
|
81
|
+
}
|
|
82
|
+
export interface CommitNode {
|
|
83
|
+
id: string;
|
|
84
|
+
kind: "commit";
|
|
85
|
+
sha: string;
|
|
86
|
+
subject: string;
|
|
87
|
+
author: {
|
|
88
|
+
name: string;
|
|
89
|
+
email: string;
|
|
90
|
+
};
|
|
91
|
+
date: string;
|
|
92
|
+
trailers: Record<string, string[]>;
|
|
93
|
+
/** The pull request number the subject ends with, as a squash merge writes it, or null. */
|
|
94
|
+
pullRequest: number | null;
|
|
95
|
+
signature: {
|
|
96
|
+
level: ProvenanceLevel;
|
|
97
|
+
reason: string;
|
|
98
|
+
principal?: string;
|
|
99
|
+
};
|
|
100
|
+
/** The line ranges the commit changed in the region, in the commit's own version of the file; null for a file or directory region. */
|
|
101
|
+
lines: LineRange[] | null;
|
|
102
|
+
}
|
|
103
|
+
export interface JoinedNode {
|
|
104
|
+
id: string;
|
|
105
|
+
kind: "unit" | "contract" | "evidence";
|
|
106
|
+
/** The plugin's own id. */
|
|
107
|
+
ref: string;
|
|
108
|
+
/** The kind file that supplied it. */
|
|
109
|
+
plugin: string;
|
|
110
|
+
/** The fields the plugin gave, besides the id. */
|
|
111
|
+
data: Record<string, unknown>;
|
|
112
|
+
}
|
|
113
|
+
export interface EvidenceEntryNode {
|
|
114
|
+
id: string;
|
|
115
|
+
kind: "evidence";
|
|
116
|
+
ref: string;
|
|
117
|
+
plugin: null;
|
|
118
|
+
data: {
|
|
119
|
+
title: string | null;
|
|
120
|
+
url: string | null;
|
|
121
|
+
path: string | null;
|
|
122
|
+
as_of: string | null;
|
|
123
|
+
sha256: string | null;
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
export interface DecisionNode {
|
|
127
|
+
id: string;
|
|
128
|
+
kind: "decision";
|
|
129
|
+
recordKind: string;
|
|
130
|
+
record: string;
|
|
131
|
+
/** The record file, from the repository root. */
|
|
132
|
+
path: string;
|
|
133
|
+
title: string | null;
|
|
134
|
+
state: string | null;
|
|
135
|
+
/** Whether the kind counts the state as closed (final), such as ratified. */
|
|
136
|
+
closed: boolean;
|
|
137
|
+
valid: boolean;
|
|
138
|
+
reasons: RecordView["reasons"];
|
|
139
|
+
provenance: {
|
|
140
|
+
level: ProvenanceLevel;
|
|
141
|
+
commit: string | null;
|
|
142
|
+
reason: string;
|
|
143
|
+
};
|
|
144
|
+
decided_by: string | null;
|
|
145
|
+
decided_on: string | null;
|
|
146
|
+
reviews: {
|
|
147
|
+
agree: number;
|
|
148
|
+
dissent: number;
|
|
149
|
+
abstain: number;
|
|
150
|
+
openConcerns: number;
|
|
151
|
+
};
|
|
152
|
+
supersededBy: string | null;
|
|
153
|
+
/** The ids of the records this one's supersedes links name. */
|
|
154
|
+
supersedes: string[];
|
|
155
|
+
/** The constrains entries that cover the region, with their granularity. Empty for a decision in the graph only through supersession. */
|
|
156
|
+
constrains: {
|
|
157
|
+
entry: string;
|
|
158
|
+
granularity: Granularity;
|
|
159
|
+
}[];
|
|
160
|
+
}
|
|
161
|
+
export type PinState = "pinned" | "drifted" | "missing" | "stale" | "unpinned";
|
|
162
|
+
export interface ArtifactNode {
|
|
163
|
+
id: string;
|
|
164
|
+
kind: "artifact";
|
|
165
|
+
/** From the workspace root the pinning record's kind resolves pins in. */
|
|
166
|
+
path: string;
|
|
167
|
+
anchor: string | null;
|
|
168
|
+
/** The hash a current decision pins, or null when none does. */
|
|
169
|
+
pinnedSha256: string | null;
|
|
170
|
+
/** The file's hash in the tree read, or null when it is missing. */
|
|
171
|
+
currentSha256: string | null;
|
|
172
|
+
/** The state of a current decision's pin, or unpinned when only superseded decisions pin it. */
|
|
173
|
+
pinState: PinState;
|
|
174
|
+
}
|
|
175
|
+
export interface LinkNode {
|
|
176
|
+
id: string;
|
|
177
|
+
kind: "link";
|
|
178
|
+
row: LinkTableRow;
|
|
179
|
+
}
|
|
180
|
+
export interface FindingNode {
|
|
181
|
+
id: string;
|
|
182
|
+
kind: "finding";
|
|
183
|
+
code: IntentFindingCode;
|
|
184
|
+
message: string;
|
|
185
|
+
concerns: string[];
|
|
186
|
+
}
|
|
187
|
+
export type IntentNode = RegionNode | FileNode | MemberNode | CommitNode | JoinedNode | EvidenceEntryNode | DecisionNode | ArtifactNode | LinkNode | FindingNode;
|
|
188
|
+
export type Granularity = "path" | "member" | "contract" | "issue";
|
|
189
|
+
export type IntentEdge = {
|
|
190
|
+
kind: "constrains";
|
|
191
|
+
from: string;
|
|
192
|
+
to: string;
|
|
193
|
+
granularity: Granularity;
|
|
194
|
+
entry: string;
|
|
195
|
+
} | {
|
|
196
|
+
kind: "pins";
|
|
197
|
+
from: string;
|
|
198
|
+
to: string;
|
|
199
|
+
pinnedSha256: string | null;
|
|
200
|
+
pinState: PinState;
|
|
201
|
+
} | {
|
|
202
|
+
kind: "touched-by";
|
|
203
|
+
from: string;
|
|
204
|
+
to: string;
|
|
205
|
+
lines: LineRange[] | null;
|
|
206
|
+
} | {
|
|
207
|
+
kind: "produced-by" | "serves" | "cites-evidence" | "supersedes" | "links";
|
|
208
|
+
from: string;
|
|
209
|
+
to: string;
|
|
210
|
+
};
|
|
211
|
+
export interface IntentReason {
|
|
212
|
+
code: IntentReasonCode;
|
|
213
|
+
message: string;
|
|
214
|
+
}
|
|
215
|
+
interface Head {
|
|
216
|
+
$schema: string;
|
|
217
|
+
contract: number;
|
|
218
|
+
chant: string;
|
|
219
|
+
}
|
|
220
|
+
export type IntentDocument = (Head & {
|
|
221
|
+
at: string | null;
|
|
222
|
+
workspace: {
|
|
223
|
+
name: string;
|
|
224
|
+
root: string;
|
|
225
|
+
};
|
|
226
|
+
region: string;
|
|
227
|
+
history: {
|
|
228
|
+
rev: string | null;
|
|
229
|
+
follows: "line-range" | "file" | "directory";
|
|
230
|
+
shallow: boolean;
|
|
231
|
+
};
|
|
232
|
+
kinds: {
|
|
233
|
+
file: string;
|
|
234
|
+
records: string | null;
|
|
235
|
+
joins: "function" | "data" | null;
|
|
236
|
+
}[];
|
|
237
|
+
nodes: IntentNode[];
|
|
238
|
+
edges: IntentEdge[];
|
|
239
|
+
reasons: IntentReason[];
|
|
240
|
+
summary: {
|
|
241
|
+
commits: number;
|
|
242
|
+
decisions: number;
|
|
243
|
+
artifacts: number;
|
|
244
|
+
findings: number;
|
|
245
|
+
};
|
|
246
|
+
}) | (Head & {
|
|
247
|
+
error: {
|
|
248
|
+
code: IntentErrorCode;
|
|
249
|
+
message: string;
|
|
250
|
+
};
|
|
251
|
+
});
|
|
252
|
+
export interface IntentQuery {
|
|
253
|
+
/** Where the walk up to the declaration starts, and what the region path is relative to. */
|
|
254
|
+
cwd: string;
|
|
255
|
+
/** `path`, `path:line` or `path:start-end`, or a graph node id `<member>/<id>`. */
|
|
256
|
+
region: string;
|
|
257
|
+
at?: string;
|
|
258
|
+
/** Kind files: record kinds, plugins with `commitJoins`, or both. Relative to `cwd`. */
|
|
259
|
+
kinds?: string[];
|
|
260
|
+
/**
|
|
261
|
+
* Resolve a graph node id to its source location, for a region given as a
|
|
262
|
+
* node id. The default reads the member's graph as `chant workspace graph
|
|
263
|
+
* --member` does.
|
|
264
|
+
*/
|
|
265
|
+
resolveNode?: (cwd: string, at: string | undefined, member: string, id: string) => Promise<{
|
|
266
|
+
file: string;
|
|
267
|
+
line: number | null;
|
|
268
|
+
} | null | undefined>;
|
|
269
|
+
}
|
|
270
|
+
export interface IntentResult {
|
|
271
|
+
doc: IntentDocument;
|
|
272
|
+
/** The read failed, or a plugin failed. */
|
|
273
|
+
failed: boolean;
|
|
274
|
+
}
|
|
275
|
+
/** Parse `path`, `path:line` or `path:start-end`. */
|
|
276
|
+
export declare function parseRegion(arg: string): {
|
|
277
|
+
path: string;
|
|
278
|
+
lines: LineRange | null;
|
|
279
|
+
} | {
|
|
280
|
+
error: string;
|
|
281
|
+
};
|
|
282
|
+
/** Build the intent document. Never throws an {@link IntentError}, {@link WorkspaceReadError} or {@link RecordReadError}. */
|
|
283
|
+
export declare function intentGraph(query: IntentQuery): Promise<IntentResult>;
|
|
284
|
+
export {};
|
|
285
|
+
//# sourceMappingURL=intent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"intent.d.ts","sourceRoot":"","sources":["../../src/workspace/intent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AASH,OAAO,EAAgB,KAAK,YAAY,EAAE,MAAM,SAAS,CAAC;AAI1D,OAAO,EAAgB,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AAG9D,OAAO,EAAmB,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAIzE,8DAA8D;AAC9D,eAAO,MAAM,uBAAuB,IAAI,CAAC;AAEzC,2EAA2E;AAC3E,eAAO,MAAM,uBAAuB,8EAA8E,CAAC;AAInH,8DAA8D;AAC9D,eAAO,MAAM,oBAAoB,oVAyBS,CAAC;AAC3C,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtE,uEAAuE;AACvE,eAAO,MAAM,mBAAmB,6DAKU,CAAC;AAC3C,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEpE,sHAAsH;AACtH,eAAO,MAAM,kBAAkB,oWAUW,CAAC;AAC3C,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAElE,qBAAa,WAAY,SAAQ,KAAK;IAElC,QAAQ,CAAC,IAAI,EAAE,eAAe;gBAArB,IAAI,EAAE,eAAe,EAC9B,OAAO,EAAE,MAAM;CAKlB;AAID,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EA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MAAM,EAAE,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;CACtJ;AAED,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,cAAc,CAAC;IACpB,2CAA2C;IAC3C,MAAM,EAAE,OAAO,CAAC;CACjB;AAiHD,qDAAqD;AACrD,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,SAAS,GAAG,IAAI,CAAA;CAAE,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAOtG;AA4HD,6HAA6H;AAC7H,wBAAsB,WAAW,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC,CAU3E"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `chant workspace check [--at <rev>] [--json] [--format stylish|json|sarif] [--generated]`:
|
|
2
|
+
* `chant workspace check [--at <rev>] [--json] [--format stylish|json|sarif] [--generated] [--kind <kind file>]`:
|
|
3
3
|
* the lineage checks (#2550, D9), and the declaration checks (#2535, D16)
|
|
4
4
|
* when a declaration sits between the current directory and the git root.
|
|
5
5
|
*
|
|
@@ -10,7 +10,9 @@
|
|
|
10
10
|
* check. The declaration checks report `WSP` findings through lint's
|
|
11
11
|
* reporters (`./checks.ts`), and cover member ledgers (#2538), recorded
|
|
12
12
|
* pipelines (#2542) and generated files (#2541) as well as the declaration
|
|
13
|
-
* itself (#2641). `--generated` runs each declared generator too.
|
|
13
|
+
* itself (#2641). `--generated` runs each declared generator too. `--kind`
|
|
14
|
+
* reads a record kind's records and reports the files they pin by hash that
|
|
15
|
+
* have changed since (#2549).
|
|
14
16
|
*
|
|
15
17
|
* `chant workspace upgrade` runs the same checks in its staging worktree
|
|
16
18
|
* before it reaches its gate.
|
|
@@ -79,6 +81,7 @@ export type CheckDocument = (CheckReport & {
|
|
|
79
81
|
*/
|
|
80
82
|
export declare function runChecks(cwd: string, at?: string, options?: {
|
|
81
83
|
runGenerators?: boolean;
|
|
84
|
+
kind?: string;
|
|
82
85
|
}): Promise<CheckDocument>;
|
|
83
86
|
export declare function runWorkspaceCheck(ctx: CommandContext): Promise<number>;
|
|
84
87
|
//# sourceMappingURL=lineage-check.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lineage-check.d.ts","sourceRoot":"","sources":["../../src/workspace/lineage-check.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"lineage-check.d.ts","sourceRoot":"","sources":["../../src/workspace/lineage-check.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGtD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAMvD,yCAAyC;AACzC,eAAO,MAAM,WAAW,+CAAgF,CAAC;AACzG,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAErD,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,SAAS,CAAC;IAChB,oEAAoE;IACpE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,iFAAiF;IACjF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,EAAE,EAAE,OAAO,CAAC;IACZ,QAAQ,EAAE,YAAY,EAAE,CAAC;CAC1B;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,WAAW,CAsBhF;AAED,uD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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lineage-init.d.ts","sourceRoot":"","sources":["../../src/workspace/lineage-init.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;
|
|
1
|
+
{"version":3,"file":"lineage-init.d.ts","sourceRoot":"","sources":["../../src/workspace/lineage-init.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAwBH,MAAM,WAAW,YAAY;IAC3B,iCAAiC;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,mEAAmE;IACnE,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,wEAAwE;IACxE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,6GAA6G;IAC7G,EAAE,EAAE,MAAM,CAAC;CACZ;AAgBD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,GAAE,MAAsB,GAAG,YAAY,CAgCzF;AAID,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,wDAAwD;IACxD,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IAC1D,mDAAmD;IACnD,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAClD;AAED,wBAAgB,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,CAQvD;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,KAAK,EAAE,MAAM,GACZ;IAAE,IAAI,EAAE,M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IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2BAA2B;IAC3B,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,yCAAyC;IACzC,GAAG,CAAC,EAAE,eAAe,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mCAAmC;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,uDAAuD;IACvD,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACrC;AAED,wFAAwF;AACxF,wBAAsB,eAAe,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC,CA8GvF;AAgCD,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,iDAAiD;IACjD,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,mHAAmH;IACnH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,iBAAiB,GAAG,MAAM,GAAG,IAAI,CA0BzE"}
|
|
@@ -121,6 +121,10 @@ declare const LineageSchema: z.ZodObject<{
|
|
|
121
121
|
chant: z.ZodOptional<z.ZodString>;
|
|
122
122
|
}, z.core.$strict>>;
|
|
123
123
|
parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
124
|
+
repinned: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
125
|
+
record: z.ZodString;
|
|
126
|
+
paths: z.ZodArray<z.ZodString>;
|
|
127
|
+
}, z.core.$strict>>>;
|
|
124
128
|
migrations: z.ZodArray<z.ZodString>;
|
|
125
129
|
files: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
126
130
|
class: z.ZodEnum<{
|
|
@@ -183,6 +187,10 @@ declare const LockSchema: z.ZodObject<{
|
|
|
183
187
|
chant: z.ZodOptional<z.ZodString>;
|
|
184
188
|
}, z.core.$strict>>;
|
|
185
189
|
parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
190
|
+
repinned: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
191
|
+
record: z.ZodString;
|
|
192
|
+
paths: z.ZodArray<z.ZodString>;
|
|
193
|
+
}, z.core.$strict>>>;
|
|
186
194
|
migrations: z.ZodArray<z.ZodString>;
|
|
187
195
|
files: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
188
196
|
class: z.ZodEnum<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lineage-lock.d.ts","sourceRoot":"","sources":["../../src/workspace/lineage-lock.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAKH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAkC,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvF,yEAAyE;AACzE,eAAO,MAAM,SAAS,+BAA+B,CAAC;AAEtD,4EAA4E;AAC5E,eAAO,MAAM,YAAY,IAAI,CAAC;AAM9B;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,yCAA0C,CAAC;AACpE,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAYtD,iDAAiD;AACjD,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;4BAchB,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAqBzD;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,uFAAwF,CAAC;AACzH,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAA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I/G;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,CAO7D;AAED,kHAAkH;AAClH,wBAAgB,WAAW,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,QAAQ,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC,CAOlG;AAID,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,sFAAsF;IACtF,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,4DAA4D;IAC5D,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,wEAAwE;AACxE,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,WAAW,CAetF;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,UAAU,CAAA;CAAE,GAAG,IAAI,CAoBjH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lineage-upgrade.d.ts","sourceRoot":"","sources":["../../src/workspace/lineage-upgrade.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAOH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAGhE,OAAO,EAEL,SAAS,EAOT,KAAK,OAAO,EAGZ,KAAK,UAAU,EAChB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAiB,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"lineage-upgrade.d.ts","sourceRoot":"","sources":["../../src/workspace/lineage-upgrade.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;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AM,CAAC;IACxB,+CAA+C;IAC/C,OAAO,IAAI,IAAI,CAAC;CACjB;AAqOD,mGAAmG;AACnG,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEtD;AAyDD;;;;;GAKG;AACH,wBAAsB,YAAY,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC,CA0LlF;AAyBD,2EAA2E;AAC3E,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,CAa9D;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAiBlG;AAED,sEAAsE;AACtE,wBAAgB,cAAc,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,EAAE,CAqB9D"}
|
|
@@ -49,12 +49,31 @@ export declare const REASONS: {
|
|
|
49
49
|
readonly "record-id-duplicate": "Another record earlier in path order has the same id.";
|
|
50
50
|
readonly "record-supersedes-unknown": "A supersedes link names an id no record has.";
|
|
51
51
|
readonly "record-supersedes-conflict": "A second closed record supersedes a record another one already superseded.";
|
|
52
|
+
readonly "asset-drift": "A file the record pins by hash has changed: its bytes no longer hash to the pinned sha256.";
|
|
53
|
+
readonly "asset-missing": "A file the record pins by hash does not exist in the tree read.";
|
|
54
|
+
readonly "asset-stale": "A file the record pins is unchanged at the hash a record it supersedes pinned: the decision changed and the artifact did not follow.";
|
|
55
|
+
readonly "record-supersedes-pending": "A supersedes link from a record whose state is weaker than the record it names, so the link has no effect yet.";
|
|
52
56
|
readonly "kind-unreadable": "The record kind file is missing or could not be imported.";
|
|
53
57
|
readonly "kind-invalid": "The record kind file exports no recordKind, or its shape is wrong.";
|
|
54
58
|
readonly "schema-unreadable": "The schema file the record kind names is missing or is not JSON.";
|
|
55
59
|
readonly "schema-id-mismatch": "The schema's $id differs from the id the record kind names.";
|
|
56
60
|
readonly "schema-invalid": "The record schema itself does not compile.";
|
|
57
61
|
readonly "location-missing": "The records directory does not exist, in the tree or at the revision.";
|
|
62
|
+
readonly "intent-region-invalid": "The region's path, or its line range, does not exist in the tree read.";
|
|
63
|
+
readonly "intent-history-shallow": "The repository is a shallow clone, so the region's history stops at the clone's boundary.";
|
|
64
|
+
readonly "intent-plugin-failed": "A kind file's commitJoins, which joins commits to units, contracts and evidence, failed for a commit.";
|
|
65
|
+
readonly "intent-commit-undecided": "A commit changed the region when no decision constrained it at path granularity.";
|
|
66
|
+
readonly "intent-commit-bare": "A commit names no unit, no pull request and no decision covering the region at its time.";
|
|
67
|
+
readonly "intent-pin-drifted": "A decision's pinned artifact no longer hashes to the pin.";
|
|
68
|
+
readonly "intent-pin-missing": "A decision's pinned artifact does not exist in the tree read.";
|
|
69
|
+
readonly "intent-artifact-unpinned": "An artifact decisions in the graph pinned, which no current decision pins.";
|
|
70
|
+
readonly "intent-decision-superseded-live": "Every decision constraining the region is superseded.";
|
|
71
|
+
readonly "intent-decision-provisional": "The current decisions constraining the region are all in states their kind does not close, such as decided.";
|
|
72
|
+
readonly "intent-constraint-coarse": "The region is constrained only through its member, not by path.";
|
|
73
|
+
readonly "intent-constraint-lost": "A decision's path constraint names a path that does not exist in the tree read.";
|
|
74
|
+
readonly "intent-evidence-unpinned": "A decision's evidence has no hash: a URL, or a path with no sha256.";
|
|
75
|
+
readonly "intent-trailer-unverified": "A commit carries a trailer a plugin says claims authorship, and the commit is not attested.";
|
|
76
|
+
readonly "intent-region-unconstrained": "No decision constrains the region at any granularity.";
|
|
58
77
|
readonly "lock-invalid": "The lineage lock can't be read.";
|
|
59
78
|
readonly "manual-step-open": "A scope in the lineage lock has an open manual step.";
|
|
60
79
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reason-codes.d.ts","sourceRoot":"","sources":["../../src/workspace/reason-codes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,sHAAsH;AACtH,eAAO,MAAM,qBAAqB,IAAI,CAAC;AAEvC,uHAAuH;AACvH,eAAO,MAAM,mBAAmB,WAAW,CAAC;AAE5C,qFAAqF;AACrF,eAAO,MAAM,OAAO
|
|
1
|
+
{"version":3,"file":"reason-codes.d.ts","sourceRoot":"","sources":["../../src/workspace/reason-codes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,sHAAsH;AACtH,eAAO,MAAM,qBAAqB,IAAI,CAAC;AAEvC,uHAAuH;AACvH,eAAO,MAAM,mBAAmB,WAAW,CAAC;AAE5C,qFAAqF;AACrF,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkEV,CAAC;AAEX,MAAM,MAAM,UAAU,GAAG,MAAM,OAAO,OAAO,CAAC;AAE9C,mDAAmD;AACnD,eAAO,MAAM,YAAY,EAA2B,UAAU,EAAE,CAAC;AAEjE,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,UAAU,CAEhE"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Asset pins and record links (#2549; #2524 D4, D6, D18).
|
|
3
|
+
*
|
|
4
|
+
* Artifact relationships are derived from decisions. A decision record pins
|
|
5
|
+
* the workspace files it rests on in `evidence`, each as `{title, path,
|
|
6
|
+
* sha256}`, and names what it governs in `constrains`, as `member:<name>` or
|
|
7
|
+
* `path:<path>`. There is no direct link from a design artifact to code or to
|
|
8
|
+
* another artifact: a reader walks from a file to the decisions whose
|
|
9
|
+
* `constrains` cover it, and from them to their pinned assets.
|
|
10
|
+
*
|
|
11
|
+
* A pin is checked against the tree a read looks at (the working tree, or a
|
|
12
|
+
* revision's git objects). A file whose bytes hash differently is `drifted`,
|
|
13
|
+
* and one that is gone is `missing`. Neither makes the record invalid: the
|
|
14
|
+
* record is still what was decided, and the drift is reported beside it.
|
|
15
|
+
*
|
|
16
|
+
* Which front-matter fields hold pins and links is the kind's data
|
|
17
|
+
* (`pins.field`, `constrains.field`), so this module never names `evidence`.
|
|
18
|
+
*/
|
|
19
|
+
import type { RecordWarning } from "./records.js";
|
|
20
|
+
import type { WorkspaceTree } from "./tree.js";
|
|
21
|
+
/**
|
|
22
|
+
* A path from the workspace root: `/` separators, no leading `/`, no `.` or
|
|
23
|
+
* `..` segment, no empty segment, no backslash or control character and no
|
|
24
|
+
* trailing `/`. The decision schema holds the same pattern.
|
|
25
|
+
*/
|
|
26
|
+
export declare const WORKSPACE_PATH_PATTERN: string;
|
|
27
|
+
export declare function isWorkspacePath(value: unknown): value is string;
|
|
28
|
+
/**
|
|
29
|
+
* `pinned`: the file hashes to the pin. `drifted`: it doesn't. `missing`: it
|
|
30
|
+
* isn't there. `stale`: it hashes to the pin, which a record this one
|
|
31
|
+
* supersedes pinned too, so the decision changed and the artifact did not.
|
|
32
|
+
*/
|
|
33
|
+
export type PinState = "pinned" | "drifted" | "missing" | "stale";
|
|
34
|
+
/** One pinned file, as the tree read has it. */
|
|
35
|
+
export interface AssetPin {
|
|
36
|
+
/** From the workspace root. */
|
|
37
|
+
path: string;
|
|
38
|
+
/** The hash the record pins. */
|
|
39
|
+
sha256: string;
|
|
40
|
+
/** The hash of the file in the tree read, or null when it is missing. */
|
|
41
|
+
actual: string | null;
|
|
42
|
+
state: PinState;
|
|
43
|
+
}
|
|
44
|
+
/** The well-formed pins in a record's `field` list: entries with a workspace path and a hex sha256. */
|
|
45
|
+
export declare function pinEntries(data: Record<string, unknown> | null, field: string): {
|
|
46
|
+
path: string;
|
|
47
|
+
sha256: string;
|
|
48
|
+
}[];
|
|
49
|
+
/** The hex SHA-256 of the file at `path` in `tree`, or undefined when it is not a file there. */
|
|
50
|
+
export declare function fileDigest(tree: WorkspaceTree, path: string): string | undefined;
|
|
51
|
+
/** Check each pin against `tree`, rooted at the workspace root. */
|
|
52
|
+
export declare function checkPins(pins: {
|
|
53
|
+
path: string;
|
|
54
|
+
sha256: string;
|
|
55
|
+
}[], tree: WorkspaceTree): {
|
|
56
|
+
assets: AssetPin[];
|
|
57
|
+
warnings: RecordWarning[];
|
|
58
|
+
};
|
|
59
|
+
/** The kinds of link a record has in `chant workspace graph`. Closed. */
|
|
60
|
+
export declare const RECORD_LINK_KINDS: readonly ["asset", "constrains"];
|
|
61
|
+
/** A link from a record to a workspace path or member, a row of the graph's `links`. */
|
|
62
|
+
export interface RecordLinkRow {
|
|
63
|
+
kind: (typeof RECORD_LINK_KINDS)[number];
|
|
64
|
+
origin: "declared";
|
|
65
|
+
resolves: "source";
|
|
66
|
+
/** The record's kind, such as `decision`. */
|
|
67
|
+
recordKind: string;
|
|
68
|
+
/** The record's id. */
|
|
69
|
+
record: string;
|
|
70
|
+
/** The record file, from the repository root. */
|
|
71
|
+
recordPath: string;
|
|
72
|
+
/** For `asset`, the pinned path; for `constrains`, the entry as written (`member:<name>` or `path:<path>`). */
|
|
73
|
+
target: string;
|
|
74
|
+
/** The member the target is, or holds it; null when no member does. */
|
|
75
|
+
member: string | null;
|
|
76
|
+
/** `pinned`, `drifted`, `missing` or `stale` for an asset; `resolved` or `missing` for constrains. */
|
|
77
|
+
status: PinState | "resolved";
|
|
78
|
+
reason: string | null;
|
|
79
|
+
/** For an asset: the pinned hash and the hash in the tree read. */
|
|
80
|
+
sha256?: string;
|
|
81
|
+
actual?: string | null;
|
|
82
|
+
}
|
|
83
|
+
/** The member whose directory holds `path` (the deepest one), or null. */
|
|
84
|
+
export declare function memberHolding(path: string, members: readonly {
|
|
85
|
+
name: string;
|
|
86
|
+
dir: string;
|
|
87
|
+
}[]): string | null;
|
|
88
|
+
/** Whether a `path:` constraint covers `file`: the same path, or a directory above it. */
|
|
89
|
+
export declare function constraintCovers(constraint: string, file: string): boolean;
|
|
90
|
+
/** A record as the link rows read it. */
|
|
91
|
+
export interface LinkedRecord {
|
|
92
|
+
id: string | null;
|
|
93
|
+
path: string;
|
|
94
|
+
supersededBy: string | null;
|
|
95
|
+
data: Record<string, unknown> | null;
|
|
96
|
+
assets: AssetPin[];
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* The link rows of the records of one kind: an `asset` row per pin and a
|
|
100
|
+
* `constrains` row per `member:` or `path:` entry. Superseded records and
|
|
101
|
+
* records with no id have none, since their links no longer hold. Paths
|
|
102
|
+
* resolve in `tree` (the workspace root), members in `members`.
|
|
103
|
+
*/
|
|
104
|
+
export declare function recordLinkRows(kindName: string, records: readonly LinkedRecord[], constrainsField: string | undefined, tree: WorkspaceTree, members: readonly {
|
|
105
|
+
name: string;
|
|
106
|
+
dir: string;
|
|
107
|
+
}[]): RecordLinkRow[];
|
|
108
|
+
//# sourceMappingURL=record-assets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record-assets.d.ts","sourceRoot":"","sources":["../../src/workspace/record-assets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAE5C;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,QAA+F,CAAC;AAInI,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAE/D;AAED;;;;GAIG;AACH,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAElE,gDAAgD;AAChD,MAAM,WAAW,QAAQ;IACvB,+BAA+B;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,gCAAgC;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,yEAAyE;IACzE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,KAAK,EAAE,QAAQ,CAAC;CACjB;AAED,uGAAuG;AACvG,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CA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AE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,EAAE,GAAG,MAAM,GAAG,IAAI,CAO5G;AAED,0FAA0F;AAC1F,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAE1E;AAED,yCAAyC;AACzC,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACrC,MAAM,EAAE,QAAQ,EAAE,CAAC;CACpB;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,SAAS,YAAY,EAAE,EAChC,eAAe,EAAE,MAAM,GAAG,SAAS,EACnC,IAAI,EAAE,aAAa,EACnB,OAAO,EAAE,SAAS;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,EAAE,GAChD,aAAa,EAAE,CAgDjB"}
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* nothing is inferred (#2525 rule 1).
|
|
13
13
|
*/
|
|
14
14
|
import type { CommandContext } from "../cli/registry.js";
|
|
15
|
-
import { type ReadErrorCode, type RecordEntry } from "./records.js";
|
|
15
|
+
import { type LoadedRecordKind, type ReadErrorCode, type ReadRecordsResult, type RecordEntry } from "./records.js";
|
|
16
16
|
import { type ProvenanceLevel } from "./trust/attestor.js";
|
|
17
17
|
import { type BaseSource, type RecordProvenance } from "./trust/provenance.js";
|
|
18
18
|
/** The version of the `records` output this chant writes. */
|
|
@@ -54,6 +54,8 @@ export type RecordsDocument = {
|
|
|
54
54
|
file: string;
|
|
55
55
|
};
|
|
56
56
|
at: string | null;
|
|
57
|
+
/** The directory pinned paths resolve in, from the repository root: the workspace holding the kind file, or the repository root (#2549). */
|
|
58
|
+
workspaceRoot: string;
|
|
57
59
|
current: boolean;
|
|
58
60
|
trust: TrustView;
|
|
59
61
|
records: RecordView[];
|
|
@@ -71,8 +73,37 @@ export type RecordsDocument = {
|
|
|
71
73
|
message: string;
|
|
72
74
|
};
|
|
73
75
|
};
|
|
76
|
+
/** A records read, before provenance. */
|
|
77
|
+
export interface RecordsRead {
|
|
78
|
+
loaded: LoadedRecordKind;
|
|
79
|
+
/** The repository root, or the working directory outside git. Record paths are relative to it. */
|
|
80
|
+
root: string;
|
|
81
|
+
/** The git top, or undefined outside git. */
|
|
82
|
+
top: string | undefined;
|
|
83
|
+
at: string | null;
|
|
84
|
+
/** Where pinned paths resolve, relative to `root` ("." for the root itself). */
|
|
85
|
+
workspaceRoot: string;
|
|
86
|
+
result: ReadRecordsResult;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Load the kind and read its records, in the working tree or at `query.at`,
|
|
90
|
+
* with each pin checked in the same tree. Throws a {@link RecordReadError}.
|
|
91
|
+
* `chant workspace graph` and `check` read records through this too.
|
|
92
|
+
*/
|
|
93
|
+
export declare function readRecordsFor(query: Omit<RecordsQuery, "base">): Promise<RecordsRead>;
|
|
74
94
|
/** Run the query and build the document `--json` prints. Never throws a {@link RecordReadError}. */
|
|
75
95
|
export declare function queryRecords(query: RecordsQuery): Promise<RecordsDocument>;
|
|
96
|
+
/**
|
|
97
|
+
* `chant workspace records pin <path>`: the `{path, sha256}` a decision's
|
|
98
|
+
* evidence entry holds for a file, with the path from the workspace root
|
|
99
|
+
* (the nearest declaration above the file, or the repository root).
|
|
100
|
+
*/
|
|
101
|
+
export declare function pinFile(file: string, cwd: string): {
|
|
102
|
+
path: string;
|
|
103
|
+
sha256: string;
|
|
104
|
+
} | {
|
|
105
|
+
error: string;
|
|
106
|
+
};
|
|
76
107
|
export declare function runWorkspaceRecords(ctx: CommandContext): Promise<number>;
|
|
77
108
|
/** Records whose provenance falls below `required`. Only `attested` can be required. */
|
|
78
109
|
export declare function belowRequired(records: RecordView[], required: ProvenanceLevel): RecordView[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"records-cli.d.ts","sourceRoot":"","sources":["../../src/workspace/records-cli.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;
|
|
1
|
+
{"version":3,"file":"records-cli.d.ts","sourceRoot":"","sources":["../../src/workspace/records-cli.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAMH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAItD,OAAO,EAAgD,KAAK,gBAAgB,EAAE,KAAK,aAAa,EAAE,KAAK,iBAAiB,EAAE,KAAK,WAAW,EAAsB,MAAM,WAAW,CAAC;AAElL,OAAO,EAAmB,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACzE,OAAO,EAA+C,KAAK,UAAU,EAAE,KAAK,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEzH,6DAA6D;AAC7D,eAAO,MAAM,wBAAwB,IAAI,CAAC;AAE1C,kFAAkF;AAClF,eAAO,MAAM,wBAAwB,gFAAgF,CAAC;AAItH,2EAA2E;AAC3E,eAAO,MAAM,mBAAmB,IAAI,CAAC;AAErC,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,2FAA2F;IAC3F,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,iEAAiE;IACjE,GAAG,EAAE,MAAM,CAAC;CACb;AAED,gFAAgF;AAChF,MAAM,MAAM,UAAU,GAAG,WAAW,GAAG;IAAE,UAAU,EAAE,gBAAgB,CAAA;CAAE,CAAC;AAExE,gDAAgD;AAChD,MAAM,WAAW,SAAS;IACxB,gFAAgF;IAChF,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB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