@intentius/chant 0.95.1 → 0.96.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 +9 -1
- package/dist/cli/registry.d.ts.map +1 -1
- package/dist/lifecycle/run-ledger.d.ts +2 -0
- package/dist/lifecycle/run-ledger.d.ts.map +1 -1
- package/dist/op/activities/shell.d.ts.map +1 -1
- package/dist/op/index.d.ts +2 -0
- package/dist/op/index.d.ts.map +1 -1
- package/dist/op/local-executor.d.ts.map +1 -1
- package/dist/op/operator.d.ts.map +1 -1
- package/dist/op/run-live.d.ts +127 -0
- package/dist/op/run-live.d.ts.map +1 -0
- package/dist/op/runtime.d.ts +2 -0
- package/dist/op/runtime.d.ts.map +1 -1
- package/dist/workspace/checks/diagrams.d.ts +5 -0
- package/dist/workspace/checks/diagrams.d.ts.map +1 -1
- package/dist/workspace/declaration.d.ts +5 -5
- package/dist/workspace/declaration.d.ts.map +1 -1
- package/dist/workspace/declaration.schema.json +50 -7
- package/dist/workspace/intent-cli.d.ts +6 -0
- package/dist/workspace/intent-cli.d.ts.map +1 -1
- package/dist/workspace/intent-record.d.ts +145 -0
- package/dist/workspace/intent-record.d.ts.map +1 -0
- package/dist/workspace/intent.d.ts +46 -1
- package/dist/workspace/intent.d.ts.map +1 -1
- package/dist/workspace/ls.d.ts +2 -2
- package/dist/workspace/ls.d.ts.map +1 -1
- package/dist/workspace/patch.d.ts +122 -0
- package/dist/workspace/patch.d.ts.map +1 -0
- package/dist/workspace/points-cli.d.ts +8 -0
- package/dist/workspace/points-cli.d.ts.map +1 -1
- package/dist/workspace/reason-codes.d.ts +2 -0
- package/dist/workspace/reason-codes.d.ts.map +1 -1
- package/dist/workspace/record-decided.d.ts +36 -0
- package/dist/workspace/record-decided.d.ts.map +1 -0
- package/dist/workspace/records-cli.d.ts +8 -0
- package/dist/workspace/records-cli.d.ts.map +1 -1
- package/dist/workspace/status-stewards.d.ts +79 -12
- package/dist/workspace/status-stewards.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/cli/main.test.ts +16 -0
- package/src/cli/main.ts +34 -3
- package/src/cli/registry.ts +9 -1
- package/src/lifecycle/run-ledger.ts +7 -1
- package/src/op/activities/shell.ts +4 -1
- package/src/op/index.ts +2 -0
- package/src/op/local-executor.ts +51 -3
- package/src/op/operator.ts +2 -11
- package/src/op/run-live.test.ts +111 -0
- package/src/op/run-live.ts +305 -0
- package/src/op/runtime.ts +2 -0
- package/src/op/steward-points.test.ts +81 -0
- package/src/workspace/checks/diagrams.test.ts +24 -0
- package/src/workspace/checks/diagrams.ts +10 -3
- package/src/workspace/declaration.schema.json +50 -7
- package/src/workspace/declaration.test.ts +18 -0
- package/src/workspace/declaration.ts +7 -7
- package/src/workspace/intent-cli.ts +47 -1
- package/src/workspace/intent-record.schema.json +529 -0
- package/src/workspace/intent-record.test.ts +257 -0
- package/src/workspace/intent-record.ts +371 -0
- package/src/workspace/intent.schema.json +33 -1
- package/src/workspace/intent.ts +29 -12
- package/src/workspace/ls-contract.test.ts +14 -0
- package/src/workspace/ls.schema.json +3 -3
- package/src/workspace/ls.ts +3 -3
- package/src/workspace/patch.schema.json +321 -0
- package/src/workspace/patch.test.ts +198 -0
- package/src/workspace/patch.ts +377 -0
- package/src/workspace/points-cli.ts +18 -0
- package/src/workspace/read-contract.test.ts +29 -1
- package/src/workspace/reason-codes.test.ts +2 -0
- package/src/workspace/reason-codes.ts +3 -0
- package/src/workspace/record-decided.ts +107 -0
- package/src/workspace/records-cli.ts +12 -0
- package/src/workspace/records.schema.json +15 -0
- package/src/workspace/status-contract.test.ts +76 -2
- package/src/workspace/status-stewards.ts +149 -27
- package/src/workspace/status.schema.json +69 -6
|
@@ -12,11 +12,14 @@
|
|
|
12
12
|
import { resolve } from "node:path";
|
|
13
13
|
import { formatError } from "../cli/format";
|
|
14
14
|
import type { CommandContext } from "../cli/registry";
|
|
15
|
+
import { intentRecord, type IntentRecordDocument } from "./intent-record";
|
|
15
16
|
import { intentGraph, type ArtifactNode, type CommitNode, type DecisionNode, type IntentDocument, type IntentEdge, type IntentNode, type WorkNode } from "./intent";
|
|
16
17
|
|
|
17
18
|
const USAGE = "chant workspace graph --intent <path[:start-end]> [--at <rev>] [--kind <kind file>...] [--json]";
|
|
19
|
+
const RECORD_USAGE = "chant workspace graph --intent --record <id> [--at <rev>] [--kind <kind file>...] [--json]";
|
|
18
20
|
|
|
19
21
|
type Result = Exclude<IntentDocument, { error: unknown }>;
|
|
22
|
+
type RecordResult = Exclude<IntentRecordDocument, { error: unknown }>;
|
|
20
23
|
|
|
21
24
|
function edgesFrom(doc: Result, from: string, kind: IntentEdge["kind"]): IntentEdge[] {
|
|
22
25
|
return doc.edges.filter((e) => e.from === from && e.kind === kind);
|
|
@@ -53,9 +56,10 @@ function withinLines(doc: Result, d: DecisionNode): string[] {
|
|
|
53
56
|
function decisionLine(d: DecisionNode): string {
|
|
54
57
|
const via = d.constrains.length > 0 ? d.constrains.map((c) => `${c.entry} (${c.granularity})`).join(", ") : "through supersession only";
|
|
55
58
|
const by = d.decided_by ? `, decided by ${d.decided_by}${d.decided_on ? ` on ${d.decided_on}` : ""}` : "";
|
|
59
|
+
const decidedIn = d.decidedIn ? ` in ${short(d.decidedIn.sha)}` : "";
|
|
56
60
|
const reviews = `${d.reviews.agree} agree, ${d.reviews.dissent} dissent, ${d.reviews.abstain} abstain`;
|
|
57
61
|
const superseded = d.supersededBy ? `, superseded by ${d.supersededBy}` : "";
|
|
58
|
-
return `decision ${d.record} ${d.state ?? "stateless"}${superseded}: ${d.title ?? d.path}; constrains ${via}${by}; ${reviews}; ${d.provenance.level}${d.valid ? "" : `; invalid: ${d.reasons.map((r) => r.code).join(", ")}`}`;
|
|
62
|
+
return `decision ${d.record} ${d.state ?? "stateless"}${superseded}: ${d.title ?? d.path}; constrains ${via}${by}${decidedIn}; ${reviews}; ${d.provenance.level}${d.valid ? "" : `; invalid: ${d.reasons.map((r) => r.code).join(", ")}`}`;
|
|
59
63
|
}
|
|
60
64
|
|
|
61
65
|
/** A work item, then the commits made inside its window (#2683). */
|
|
@@ -123,8 +127,50 @@ export function formatIntent(doc: Result): string {
|
|
|
123
127
|
return out.join("\n");
|
|
124
128
|
}
|
|
125
129
|
|
|
130
|
+
/** The record walk as text: the record, its window, then each commit with its bucket, and the counts. */
|
|
131
|
+
export function formatIntentRecord(doc: RecordResult): string {
|
|
132
|
+
const r = doc.record;
|
|
133
|
+
const out = [`record ${r.record} ${r.state ?? "stateless"}${r.supersededBy ? `, superseded by ${r.supersededBy}` : ""}: ${r.title ?? r.path}`];
|
|
134
|
+
out.push(`window ${doc.window.from ? `from ${short(doc.window.from)}` : "no history"}${doc.window.until ? ` until ${short(doc.window.until)}` : ""}${r.decidedIn ? `; decided in ${short(r.decidedIn.sha)} ${r.decidedIn.date.slice(0, 10)}: ${r.decidedIn.subject}` : "; not decided in the history read"}`);
|
|
135
|
+
for (const c of r.constrains) out.push(`entry ${c.entry}${c.walked ? "" : c.exists === false ? " (not in the tree read)" : " (not walked)"}`);
|
|
136
|
+
for (const c of doc.commits) {
|
|
137
|
+
const why =
|
|
138
|
+
c.bucket === "own"
|
|
139
|
+
? `unit ${c.unit}`
|
|
140
|
+
: c.bucket === "worked"
|
|
141
|
+
? `worked by ${c.workedBy.map((w) => w.record).join(", ")}`
|
|
142
|
+
: c.bucket === "within-other"
|
|
143
|
+
? `within ${c.alsoWithin.map((w) => w.record).join(", ")}`
|
|
144
|
+
: "nothing else accounts for it";
|
|
145
|
+
out.push(`${c.bucket.padEnd(12)} ${short(c.sha)} ${c.date.slice(0, 10)} ${c.subject}; ${why}; ${c.files.join(", ") || c.entries.join(", ")}`);
|
|
146
|
+
}
|
|
147
|
+
for (const x of doc.reasons) out.push(`reason ${x.code}: ${x.message}`);
|
|
148
|
+
const n = doc.counts;
|
|
149
|
+
out.push(`${n.commits} commits in the window: ${n.own} own, ${n.worked} worked, ${n.withinOther} within another record's window, ${n.unexplained} unexplained; ${n.outsideWindow} outside it`);
|
|
150
|
+
return out.join("\n");
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
async function runRecord(ctx: CommandContext, cwd: string, kinds: string[] | undefined): Promise<number> {
|
|
154
|
+
const { args } = ctx;
|
|
155
|
+
const { doc, failed } = await intentRecord({ cwd, record: args.record!, at: args.at, kinds: kinds?.map((k) => resolve(k)) });
|
|
156
|
+
if (args.json) console.log(JSON.stringify(doc, null, 2));
|
|
157
|
+
if ("error" in doc) {
|
|
158
|
+
console.error(formatError({ message: `${doc.error.code}: ${doc.error.message}`, hint: RECORD_USAGE }));
|
|
159
|
+
return 1;
|
|
160
|
+
}
|
|
161
|
+
if (!args.json) console.log(formatIntentRecord(doc));
|
|
162
|
+
return failed ? 1 : 0;
|
|
163
|
+
}
|
|
164
|
+
|
|
126
165
|
export async function runWorkspaceIntent(ctx: CommandContext, cwd: string): Promise<number> {
|
|
127
166
|
const { args } = ctx;
|
|
167
|
+
if (args.record !== undefined) {
|
|
168
|
+
if (args.intent) {
|
|
169
|
+
console.error(formatError({ message: "--record walks a record, so --intent takes no region with it", hint: RECORD_USAGE }));
|
|
170
|
+
return 1;
|
|
171
|
+
}
|
|
172
|
+
return runRecord(ctx, cwd, args.kinds ?? (args.kind !== undefined ? [args.kind] : undefined));
|
|
173
|
+
}
|
|
128
174
|
if (!args.intent) {
|
|
129
175
|
console.error(formatError({ message: "--intent needs a region: a path, path:line or path:start-end", hint: USAGE }));
|
|
130
176
|
return 1;
|
|
@@ -0,0 +1,529 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://intentius.io/chant/schemas/workspace/intent-record/v1/intent-record.schema.json",
|
|
4
|
+
"title": "chant workspace graph --intent --record output",
|
|
5
|
+
"description": "What `chant workspace graph --intent --record <id> --json` prints: the intent walk for one decision record over every path: and member: entry its constrains lists, each commit once, kept to the commits inside the record's window, each with one bucket relative to the record. The walk decides nothing: own, worked and within-other say what else accounts for a commit, and unexplained says nothing does. Contract version 1 is written by chant 0.81.0 and newer, and this document was added to it by graph --intent --record; a chant without --record refuses the flag. Every code is in the one closed list of `reason-codes.ts`.",
|
|
6
|
+
"oneOf": [
|
|
7
|
+
{
|
|
8
|
+
"$ref": "#/$defs/result"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"$ref": "#/$defs/failure"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"$defs": {
|
|
15
|
+
"result": {
|
|
16
|
+
"description": "The record was read. Exit code 0, or 1 when a plugin failed; the document is printed either way.",
|
|
17
|
+
"type": "object",
|
|
18
|
+
"required": [
|
|
19
|
+
"$schema",
|
|
20
|
+
"contract",
|
|
21
|
+
"chant",
|
|
22
|
+
"at",
|
|
23
|
+
"workspace",
|
|
24
|
+
"record",
|
|
25
|
+
"history",
|
|
26
|
+
"window",
|
|
27
|
+
"kinds",
|
|
28
|
+
"commits",
|
|
29
|
+
"counts",
|
|
30
|
+
"reasons"
|
|
31
|
+
],
|
|
32
|
+
"properties": {
|
|
33
|
+
"$schema": {
|
|
34
|
+
"const": "https://intentius.io/chant/schemas/workspace/intent-record/v1/intent-record.schema.json"
|
|
35
|
+
},
|
|
36
|
+
"contract": {
|
|
37
|
+
"const": 1
|
|
38
|
+
},
|
|
39
|
+
"chant": {
|
|
40
|
+
"type": "string",
|
|
41
|
+
"description": "The chant that wrote the document."
|
|
42
|
+
},
|
|
43
|
+
"at": {
|
|
44
|
+
"type": [
|
|
45
|
+
"string",
|
|
46
|
+
"null"
|
|
47
|
+
],
|
|
48
|
+
"pattern": "^[0-9a-f]{40,64}$",
|
|
49
|
+
"description": "The full commit id read with --at, or null for the working tree. History is read from this commit, or from HEAD for the working tree."
|
|
50
|
+
},
|
|
51
|
+
"workspace": {
|
|
52
|
+
"type": "object",
|
|
53
|
+
"required": [
|
|
54
|
+
"name",
|
|
55
|
+
"root"
|
|
56
|
+
],
|
|
57
|
+
"properties": {
|
|
58
|
+
"name": {
|
|
59
|
+
"type": "string"
|
|
60
|
+
},
|
|
61
|
+
"root": {
|
|
62
|
+
"type": "string",
|
|
63
|
+
"description": "The workspace root relative to the git root, \".\" for the git root."
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
"record": {
|
|
68
|
+
"type": "object",
|
|
69
|
+
"required": [
|
|
70
|
+
"id",
|
|
71
|
+
"recordKind",
|
|
72
|
+
"record",
|
|
73
|
+
"path",
|
|
74
|
+
"title",
|
|
75
|
+
"state",
|
|
76
|
+
"supersededBy",
|
|
77
|
+
"decidedIn",
|
|
78
|
+
"constrains"
|
|
79
|
+
],
|
|
80
|
+
"properties": {
|
|
81
|
+
"id": {
|
|
82
|
+
"type": "string",
|
|
83
|
+
"pattern": "^record:",
|
|
84
|
+
"description": "record:<kind>/<id>, the id graph --intent gives the same record's node."
|
|
85
|
+
},
|
|
86
|
+
"recordKind": {
|
|
87
|
+
"type": "string"
|
|
88
|
+
},
|
|
89
|
+
"record": {
|
|
90
|
+
"type": "string"
|
|
91
|
+
},
|
|
92
|
+
"path": {
|
|
93
|
+
"type": "string",
|
|
94
|
+
"description": "The record file, from the repository root."
|
|
95
|
+
},
|
|
96
|
+
"title": {
|
|
97
|
+
"type": [
|
|
98
|
+
"string",
|
|
99
|
+
"null"
|
|
100
|
+
]
|
|
101
|
+
},
|
|
102
|
+
"state": {
|
|
103
|
+
"type": [
|
|
104
|
+
"string",
|
|
105
|
+
"null"
|
|
106
|
+
]
|
|
107
|
+
},
|
|
108
|
+
"supersededBy": {
|
|
109
|
+
"type": [
|
|
110
|
+
"string",
|
|
111
|
+
"null"
|
|
112
|
+
]
|
|
113
|
+
},
|
|
114
|
+
"decidedIn": {
|
|
115
|
+
"$ref": "#/$defs/decidedIn"
|
|
116
|
+
},
|
|
117
|
+
"constrains": {
|
|
118
|
+
"type": "array",
|
|
119
|
+
"description": "Every entry of the record's constrains list, in order.",
|
|
120
|
+
"items": {
|
|
121
|
+
"$ref": "#/$defs/constraint"
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
"history": {
|
|
127
|
+
"type": "object",
|
|
128
|
+
"required": [
|
|
129
|
+
"rev",
|
|
130
|
+
"shallow"
|
|
131
|
+
],
|
|
132
|
+
"properties": {
|
|
133
|
+
"rev": {
|
|
134
|
+
"type": [
|
|
135
|
+
"string",
|
|
136
|
+
"null"
|
|
137
|
+
],
|
|
138
|
+
"pattern": "^[0-9a-f]{40,64}$",
|
|
139
|
+
"description": "The commit the history was read from, or null when the repository has no commits."
|
|
140
|
+
},
|
|
141
|
+
"shallow": {
|
|
142
|
+
"type": "boolean",
|
|
143
|
+
"description": "Whether the repository is a shallow clone. When true, reasons holds intent-history-shallow."
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
"window": {
|
|
148
|
+
"type": "object",
|
|
149
|
+
"required": [
|
|
150
|
+
"from",
|
|
151
|
+
"until"
|
|
152
|
+
],
|
|
153
|
+
"properties": {
|
|
154
|
+
"from": {
|
|
155
|
+
"type": [
|
|
156
|
+
"string",
|
|
157
|
+
"null"
|
|
158
|
+
],
|
|
159
|
+
"pattern": "^[0-9a-f]{40,64}$",
|
|
160
|
+
"description": "The commit the window opens at: decidedIn, or the commit that added the record when it is not approved. Null when the record has no history."
|
|
161
|
+
},
|
|
162
|
+
"until": {
|
|
163
|
+
"type": [
|
|
164
|
+
"string",
|
|
165
|
+
"null"
|
|
166
|
+
],
|
|
167
|
+
"pattern": "^[0-9a-f]{40,64}$",
|
|
168
|
+
"description": "The commit that opened the window of the record superseding this one, which closes this one's, or null."
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
"kinds": {
|
|
173
|
+
"type": "array",
|
|
174
|
+
"description": "Each kind file read, as graph --intent lists them.",
|
|
175
|
+
"items": {
|
|
176
|
+
"type": "object",
|
|
177
|
+
"required": [
|
|
178
|
+
"file",
|
|
179
|
+
"name",
|
|
180
|
+
"records",
|
|
181
|
+
"joins"
|
|
182
|
+
],
|
|
183
|
+
"properties": {
|
|
184
|
+
"file": {
|
|
185
|
+
"type": "string"
|
|
186
|
+
},
|
|
187
|
+
"name": {
|
|
188
|
+
"type": "string"
|
|
189
|
+
},
|
|
190
|
+
"records": {
|
|
191
|
+
"type": [
|
|
192
|
+
"string",
|
|
193
|
+
"null"
|
|
194
|
+
]
|
|
195
|
+
},
|
|
196
|
+
"joins": {
|
|
197
|
+
"enum": [
|
|
198
|
+
"function",
|
|
199
|
+
"data",
|
|
200
|
+
null
|
|
201
|
+
]
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
"commits": {
|
|
207
|
+
"type": "array",
|
|
208
|
+
"description": "The commits inside the window that changed the record's region, newest first by commit date.",
|
|
209
|
+
"items": {
|
|
210
|
+
"$ref": "#/$defs/commit"
|
|
211
|
+
}
|
|
212
|
+
},
|
|
213
|
+
"counts": {
|
|
214
|
+
"type": "object",
|
|
215
|
+
"required": [
|
|
216
|
+
"commits",
|
|
217
|
+
"own",
|
|
218
|
+
"worked",
|
|
219
|
+
"withinOther",
|
|
220
|
+
"unexplained",
|
|
221
|
+
"outsideWindow"
|
|
222
|
+
],
|
|
223
|
+
"properties": {
|
|
224
|
+
"commits": {
|
|
225
|
+
"type": "integer",
|
|
226
|
+
"minimum": 0
|
|
227
|
+
},
|
|
228
|
+
"own": {
|
|
229
|
+
"type": "integer",
|
|
230
|
+
"minimum": 0
|
|
231
|
+
},
|
|
232
|
+
"worked": {
|
|
233
|
+
"type": "integer",
|
|
234
|
+
"minimum": 0
|
|
235
|
+
},
|
|
236
|
+
"withinOther": {
|
|
237
|
+
"type": "integer",
|
|
238
|
+
"minimum": 0,
|
|
239
|
+
"description": "Commits whose bucket is within-other."
|
|
240
|
+
},
|
|
241
|
+
"unexplained": {
|
|
242
|
+
"type": "integer",
|
|
243
|
+
"minimum": 0
|
|
244
|
+
},
|
|
245
|
+
"outsideWindow": {
|
|
246
|
+
"type": "integer",
|
|
247
|
+
"minimum": 0,
|
|
248
|
+
"description": "Commits that changed the region outside the window, which commits leaves out."
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
"reasons": {
|
|
253
|
+
"type": "array",
|
|
254
|
+
"items": {
|
|
255
|
+
"$ref": "#/$defs/reason"
|
|
256
|
+
}
|
|
257
|
+
},
|
|
258
|
+
"error": false
|
|
259
|
+
}
|
|
260
|
+
},
|
|
261
|
+
"constraint": {
|
|
262
|
+
"type": "object",
|
|
263
|
+
"required": [
|
|
264
|
+
"entry",
|
|
265
|
+
"granularity",
|
|
266
|
+
"path",
|
|
267
|
+
"exists",
|
|
268
|
+
"walked"
|
|
269
|
+
],
|
|
270
|
+
"properties": {
|
|
271
|
+
"entry": {
|
|
272
|
+
"type": "string"
|
|
273
|
+
},
|
|
274
|
+
"granularity": {
|
|
275
|
+
"enum": [
|
|
276
|
+
"path",
|
|
277
|
+
"member",
|
|
278
|
+
"contract",
|
|
279
|
+
"issue"
|
|
280
|
+
]
|
|
281
|
+
},
|
|
282
|
+
"path": {
|
|
283
|
+
"type": [
|
|
284
|
+
"string",
|
|
285
|
+
"null"
|
|
286
|
+
],
|
|
287
|
+
"description": "For a path entry, the path from the workspace root; for a member entry, the member's directory. Null for other entries, and for a member the declaration does not name."
|
|
288
|
+
},
|
|
289
|
+
"exists": {
|
|
290
|
+
"type": [
|
|
291
|
+
"boolean",
|
|
292
|
+
"null"
|
|
293
|
+
],
|
|
294
|
+
"description": "For a path entry, whether the path is in the tree read; for a member entry, whether the declaration names the member. Null for an entry that names no path."
|
|
295
|
+
},
|
|
296
|
+
"walked": {
|
|
297
|
+
"type": "boolean",
|
|
298
|
+
"description": "Whether the entry's history was read. Contract and issue entries name no path and are never walked."
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
},
|
|
302
|
+
"commit": {
|
|
303
|
+
"type": "object",
|
|
304
|
+
"required": [
|
|
305
|
+
"sha",
|
|
306
|
+
"subject",
|
|
307
|
+
"author",
|
|
308
|
+
"date",
|
|
309
|
+
"trailers",
|
|
310
|
+
"pullRequest",
|
|
311
|
+
"unit",
|
|
312
|
+
"entries",
|
|
313
|
+
"files",
|
|
314
|
+
"bucket",
|
|
315
|
+
"workedBy",
|
|
316
|
+
"alsoWithin"
|
|
317
|
+
],
|
|
318
|
+
"properties": {
|
|
319
|
+
"sha": {
|
|
320
|
+
"type": "string",
|
|
321
|
+
"pattern": "^[0-9a-f]{40,64}$"
|
|
322
|
+
},
|
|
323
|
+
"subject": {
|
|
324
|
+
"type": "string"
|
|
325
|
+
},
|
|
326
|
+
"author": {
|
|
327
|
+
"type": "object",
|
|
328
|
+
"required": [
|
|
329
|
+
"name",
|
|
330
|
+
"email"
|
|
331
|
+
],
|
|
332
|
+
"properties": {
|
|
333
|
+
"name": {
|
|
334
|
+
"type": "string"
|
|
335
|
+
},
|
|
336
|
+
"email": {
|
|
337
|
+
"type": "string"
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
},
|
|
341
|
+
"date": {
|
|
342
|
+
"type": "string",
|
|
343
|
+
"description": "Author date, ISO 8601."
|
|
344
|
+
},
|
|
345
|
+
"trailers": {
|
|
346
|
+
"type": "object",
|
|
347
|
+
"description": "Every trailer git parses from the message, keyed as written. Core gives no key a meaning; a kind's commitJoins may.",
|
|
348
|
+
"additionalProperties": {
|
|
349
|
+
"type": "array",
|
|
350
|
+
"items": {
|
|
351
|
+
"type": "string"
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
},
|
|
355
|
+
"pullRequest": {
|
|
356
|
+
"type": [
|
|
357
|
+
"integer",
|
|
358
|
+
"null"
|
|
359
|
+
],
|
|
360
|
+
"description": "The number in a (#n) that ends the subject, as a squash merge writes it, or null."
|
|
361
|
+
},
|
|
362
|
+
"unit": {
|
|
363
|
+
"type": [
|
|
364
|
+
"string",
|
|
365
|
+
"null"
|
|
366
|
+
],
|
|
367
|
+
"description": "The unit a kind file's commitJoins joined the commit to, or null."
|
|
368
|
+
},
|
|
369
|
+
"entries": {
|
|
370
|
+
"type": "array",
|
|
371
|
+
"items": {
|
|
372
|
+
"type": "string"
|
|
373
|
+
},
|
|
374
|
+
"description": "The record's constrains entries whose history lists the commit."
|
|
375
|
+
},
|
|
376
|
+
"files": {
|
|
377
|
+
"type": "array",
|
|
378
|
+
"items": {
|
|
379
|
+
"type": "string"
|
|
380
|
+
},
|
|
381
|
+
"description": "The files the commit changed in the record's region, from the workspace root; for a merge, against its first parent."
|
|
382
|
+
},
|
|
383
|
+
"bucket": {
|
|
384
|
+
"enum": [
|
|
385
|
+
"own",
|
|
386
|
+
"worked",
|
|
387
|
+
"within-other",
|
|
388
|
+
"unexplained"
|
|
389
|
+
],
|
|
390
|
+
"description": "The first that holds: own, the record's own work as graph --intent judges it (a unit or contract a plugin joins names the record, or serves a contract it constrains); worked, a work item in workedBy; within-other, a decision in alsoWithin; unexplained, none."
|
|
391
|
+
},
|
|
392
|
+
"workedBy": {
|
|
393
|
+
"type": "array",
|
|
394
|
+
"items": {
|
|
395
|
+
"$ref": "#/$defs/recordRef"
|
|
396
|
+
},
|
|
397
|
+
"description": "Each work item that is not dropped, whose window holds the commit, and that implements the record or covers one of the commit's files by a path: entry. A work item's window runs from the commit that added it to the one that closed it, that one included."
|
|
398
|
+
},
|
|
399
|
+
"alsoWithin": {
|
|
400
|
+
"type": "array",
|
|
401
|
+
"items": {
|
|
402
|
+
"$ref": "#/$defs/recordRef"
|
|
403
|
+
},
|
|
404
|
+
"description": "Each other decision whose window holds the commit and whose path: entries cover one of the commit's files."
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
},
|
|
408
|
+
"recordRef": {
|
|
409
|
+
"type": "object",
|
|
410
|
+
"required": [
|
|
411
|
+
"recordKind",
|
|
412
|
+
"record",
|
|
413
|
+
"state"
|
|
414
|
+
],
|
|
415
|
+
"properties": {
|
|
416
|
+
"recordKind": {
|
|
417
|
+
"type": "string"
|
|
418
|
+
},
|
|
419
|
+
"record": {
|
|
420
|
+
"type": "string"
|
|
421
|
+
},
|
|
422
|
+
"state": {
|
|
423
|
+
"type": [
|
|
424
|
+
"string",
|
|
425
|
+
"null"
|
|
426
|
+
]
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
},
|
|
430
|
+
"decidedIn": {
|
|
431
|
+
"description": "Added in contract 1. The commit that last moved the record into an approved state and kept it there: a state the kind's approval ranks above 0, or one of its closedStates when it has no approval. Read from the history of the record's file reachable from the revision read, or HEAD in the working tree. A record added approved was decided by the commit that added it. Null when the record is not approved in that history.",
|
|
432
|
+
"type": [
|
|
433
|
+
"object",
|
|
434
|
+
"null"
|
|
435
|
+
],
|
|
436
|
+
"required": [
|
|
437
|
+
"sha",
|
|
438
|
+
"date",
|
|
439
|
+
"subject"
|
|
440
|
+
],
|
|
441
|
+
"additionalProperties": false,
|
|
442
|
+
"properties": {
|
|
443
|
+
"sha": {
|
|
444
|
+
"type": "string",
|
|
445
|
+
"pattern": "^[0-9a-f]{40,64}$"
|
|
446
|
+
},
|
|
447
|
+
"date": {
|
|
448
|
+
"type": "string",
|
|
449
|
+
"description": "The author date, ISO 8601."
|
|
450
|
+
},
|
|
451
|
+
"subject": {
|
|
452
|
+
"type": "string"
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
},
|
|
456
|
+
"reason": {
|
|
457
|
+
"type": "object",
|
|
458
|
+
"required": [
|
|
459
|
+
"code",
|
|
460
|
+
"message"
|
|
461
|
+
],
|
|
462
|
+
"properties": {
|
|
463
|
+
"code": {
|
|
464
|
+
"enum": [
|
|
465
|
+
"intent-history-shallow",
|
|
466
|
+
"intent-plugin-failed"
|
|
467
|
+
]
|
|
468
|
+
},
|
|
469
|
+
"message": {
|
|
470
|
+
"type": "string"
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
},
|
|
474
|
+
"failure": {
|
|
475
|
+
"description": "The declaration or a record kind could not be read, or no decision has the id, and nothing was walked. Exit code 1.",
|
|
476
|
+
"type": "object",
|
|
477
|
+
"required": [
|
|
478
|
+
"$schema",
|
|
479
|
+
"contract",
|
|
480
|
+
"chant",
|
|
481
|
+
"error"
|
|
482
|
+
],
|
|
483
|
+
"properties": {
|
|
484
|
+
"$schema": {
|
|
485
|
+
"const": "https://intentius.io/chant/schemas/workspace/intent-record/v1/intent-record.schema.json"
|
|
486
|
+
},
|
|
487
|
+
"contract": {
|
|
488
|
+
"const": 1
|
|
489
|
+
},
|
|
490
|
+
"chant": {
|
|
491
|
+
"type": "string"
|
|
492
|
+
},
|
|
493
|
+
"error": {
|
|
494
|
+
"type": "object",
|
|
495
|
+
"required": [
|
|
496
|
+
"code",
|
|
497
|
+
"message"
|
|
498
|
+
],
|
|
499
|
+
"properties": {
|
|
500
|
+
"code": {
|
|
501
|
+
"enum": [
|
|
502
|
+
"declaration-missing",
|
|
503
|
+
"declaration-ambiguous",
|
|
504
|
+
"declaration-unparseable",
|
|
505
|
+
"declaration-invalid",
|
|
506
|
+
"placement-invalid",
|
|
507
|
+
"reader-too-old",
|
|
508
|
+
"root-chant-required",
|
|
509
|
+
"not-a-git-repository",
|
|
510
|
+
"revision-unknown",
|
|
511
|
+
"kind-unreadable",
|
|
512
|
+
"kind-invalid",
|
|
513
|
+
"schema-unreadable",
|
|
514
|
+
"schema-id-mismatch",
|
|
515
|
+
"schema-invalid",
|
|
516
|
+
"location-missing",
|
|
517
|
+
"intent-record-unknown"
|
|
518
|
+
]
|
|
519
|
+
},
|
|
520
|
+
"message": {
|
|
521
|
+
"type": "string"
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
},
|
|
525
|
+
"commits": false
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
}
|