@intentius/chant 0.84.0 → 0.86.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/mcp/resource-handlers.d.ts +2 -1
- package/dist/cli/mcp/resource-handlers.d.ts.map +1 -1
- package/dist/cli/mcp/server.d.ts +1 -0
- package/dist/cli/mcp/server.d.ts.map +1 -1
- package/dist/cli/mcp/tools/composites.d.ts +44 -0
- package/dist/cli/mcp/tools/composites.d.ts.map +1 -0
- package/dist/cli/mcp/tools/search.d.ts.map +1 -1
- package/dist/cli/registry.d.ts +13 -1
- package/dist/cli/registry.d.ts.map +1 -1
- package/dist/components/cli-support.d.ts +4 -0
- package/dist/components/cli-support.d.ts.map +1 -1
- package/dist/composite.d.ts +6 -0
- package/dist/composite.d.ts.map +1 -1
- package/dist/lexicon.d.ts +44 -0
- package/dist/lexicon.d.ts.map +1 -1
- package/dist/lifecycle/gate-ledger.d.ts +13 -0
- package/dist/lifecycle/gate-ledger.d.ts.map +1 -1
- package/dist/workspace/__fixtures__/contract-repo.d.ts +7 -0
- package/dist/workspace/__fixtures__/contract-repo.d.ts.map +1 -1
- package/dist/workspace/__fixtures__/sessions.d.ts +23 -0
- package/dist/workspace/__fixtures__/sessions.d.ts.map +1 -0
- package/dist/workspace/checks/records.d.ts +1 -0
- package/dist/workspace/checks/records.d.ts.map +1 -1
- package/dist/workspace/checks.d.ts +4 -0
- package/dist/workspace/checks.d.ts.map +1 -1
- package/dist/workspace/composites.d.ts +152 -0
- package/dist/workspace/composites.d.ts.map +1 -0
- package/dist/workspace/conformance/index.d.ts +211 -0
- package/dist/workspace/conformance/index.d.ts.map +1 -0
- package/dist/workspace/conformance/vitest.d.ts +11 -0
- package/dist/workspace/conformance/vitest.d.ts.map +1 -0
- package/dist/workspace/declaration.d.ts +28 -0
- package/dist/workspace/declaration.d.ts.map +1 -1
- package/dist/workspace/declaration.schema.json +40 -0
- package/dist/workspace/declared-kinds.d.ts +43 -0
- package/dist/workspace/declared-kinds.d.ts.map +1 -0
- package/dist/workspace/graph-cli.d.ts +24 -2
- package/dist/workspace/graph-cli.d.ts.map +1 -1
- package/dist/workspace/intent-cli.d.ts +6 -1
- package/dist/workspace/intent-cli.d.ts.map +1 -1
- package/dist/workspace/intent-joins.d.ts +74 -9
- package/dist/workspace/intent-joins.d.ts.map +1 -1
- package/dist/workspace/intent.d.ts +90 -6
- package/dist/workspace/intent.d.ts.map +1 -1
- package/dist/workspace/ls.d.ts +31 -1
- package/dist/workspace/ls.d.ts.map +1 -1
- package/dist/workspace/member-commands.d.ts +7 -2
- package/dist/workspace/member-commands.d.ts.map +1 -1
- package/dist/workspace/reason-codes.d.ts +52 -2
- package/dist/workspace/reason-codes.d.ts.map +1 -1
- package/dist/workspace/record-sessions.d.ts +51 -0
- package/dist/workspace/record-sessions.d.ts.map +1 -0
- package/dist/workspace/record-source.d.ts +2 -0
- package/dist/workspace/record-source.d.ts.map +1 -1
- package/dist/workspace/records-cli.d.ts +65 -4
- package/dist/workspace/records-cli.d.ts.map +1 -1
- package/dist/workspace/records-since.d.ts +90 -0
- package/dist/workspace/records-since.d.ts.map +1 -0
- package/dist/workspace/records-write.d.ts +164 -0
- package/dist/workspace/records-write.d.ts.map +1 -0
- package/dist/workspace/records.d.ts +202 -15
- package/dist/workspace/records.d.ts.map +1 -1
- package/dist/workspace/runtimes.d.ts +60 -0
- package/dist/workspace/runtimes.d.ts.map +1 -0
- package/dist/workspace/status-gates.d.ts +90 -0
- package/dist/workspace/status-gates.d.ts.map +1 -0
- package/dist/workspace/status.d.ts +17 -0
- package/dist/workspace/status.d.ts.map +1 -1
- package/dist/workspace/work.d.ts +56 -0
- package/dist/workspace/work.d.ts.map +1 -0
- package/package.json +19 -1
- package/src/cli/handlers/graph.ts +4 -0
- package/src/cli/main.test.ts +9 -0
- package/src/cli/main.ts +56 -3
- package/src/cli/mcp/resource-handlers.ts +17 -0
- package/src/cli/mcp/server.test.ts +140 -4
- package/src/cli/mcp/server.ts +5 -1
- package/src/cli/mcp/tools/composites.ts +98 -0
- package/src/cli/mcp/tools/search.ts +47 -5
- package/src/cli/registry.ts +13 -1
- package/src/components/cli-support.test.ts +16 -0
- package/src/components/cli-support.ts +8 -2
- package/src/composite.ts +9 -0
- package/src/lexicon.ts +47 -0
- package/src/lifecycle/gate-ledger.ts +14 -0
- package/src/workspace/__fixtures__/contract-repo.ts +17 -0
- package/src/workspace/__fixtures__/sessions.ts +66 -0
- package/src/workspace/checks/records.ts +19 -0
- package/src/workspace/checks.test.ts +2 -0
- package/src/workspace/checks.ts +7 -1
- package/src/workspace/composites.schema.json +533 -0
- package/src/workspace/composites.test.ts +334 -0
- package/src/workspace/composites.ts +316 -0
- package/src/workspace/conformance/__fixture__/app/package.json +7 -0
- package/src/workspace/conformance/__fixture__/app/src/server.mjs +29 -0
- package/src/workspace/conformance/__fixture__/decisions/decision.kind.mjs +32 -0
- package/src/workspace/conformance/__fixture__/decisions/decision.schema.json +364 -0
- package/src/workspace/conformance/__fixture__/decisions/fix-001-how-the-app-is-deployed.md +40 -0
- package/src/workspace/conformance/__fixture__/delivery/chant.config.ts +7 -0
- package/src/workspace/conformance/__fixture__/delivery/lexicon/index.ts +26 -0
- package/src/workspace/conformance/__fixture__/delivery/package.json +7 -0
- package/src/workspace/conformance/__fixture__/delivery/src/app.component.ts +14 -0
- package/src/workspace/conformance/__fixture__/delivery/src/app.ts +4 -0
- package/src/workspace/conformance/conformance.test.ts +149 -0
- package/src/workspace/conformance/index.mjs +31 -0
- package/src/workspace/conformance/index.ts +453 -0
- package/src/workspace/conformance/vitest.ts +62 -0
- package/src/workspace/declaration.schema.json +40 -0
- package/src/workspace/declaration.ts +62 -0
- package/src/workspace/declared-kinds.test.ts +321 -0
- package/src/workspace/declared-kinds.ts +76 -0
- package/src/workspace/graph-cli.ts +40 -4
- package/src/workspace/intent-cli.ts +54 -7
- package/src/workspace/intent-joins.test.ts +60 -0
- package/src/workspace/intent-joins.ts +117 -20
- package/src/workspace/intent.schema.json +357 -19
- package/src/workspace/intent.test.ts +235 -20
- package/src/workspace/intent.ts +396 -51
- package/src/workspace/ls.schema.json +34 -0
- package/src/workspace/ls.ts +69 -4
- package/src/workspace/member-commands.ts +11 -5
- package/src/workspace/read-contract.test.ts +52 -3
- package/src/workspace/reason-codes.test.ts +48 -4
- package/src/workspace/reason-codes.ts +67 -2
- package/src/workspace/record-assets.test.ts +3 -1
- package/src/workspace/record-sessions.ts +105 -0
- package/src/workspace/record-source.ts +14 -5
- package/src/workspace/records-amend.schema.json +167 -0
- package/src/workspace/records-cli.ts +246 -19
- package/src/workspace/records-contract.test.ts +77 -2
- package/src/workspace/records-formats.test.ts +640 -0
- package/src/workspace/records-new.schema.json +158 -0
- package/src/workspace/records-quorum.test.ts +196 -0
- package/src/workspace/records-review.schema.json +202 -0
- package/src/workspace/records-sessions.test.ts +108 -0
- package/src/workspace/records-since.schema.json +193 -0
- package/src/workspace/records-since.test.ts +174 -0
- package/src/workspace/records-since.ts +259 -0
- package/src/workspace/records-write-contract.test.ts +125 -0
- package/src/workspace/records-write.test.ts +373 -0
- package/src/workspace/records-write.ts +736 -0
- package/src/workspace/records.schema.json +187 -9
- package/src/workspace/records.test.ts +93 -0
- package/src/workspace/records.ts +683 -49
- package/src/workspace/runtimes.ts +107 -0
- package/src/workspace/status-contract.test.ts +163 -0
- package/src/workspace/status-gates.ts +215 -0
- package/src/workspace/status.schema.json +69 -3
- package/src/workspace/status.ts +35 -2
- package/src/workspace/work.test.ts +388 -0
- package/src/workspace/work.ts +163 -0
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Review sessions (#2673, #2650 C10): a record kind whose records are the
|
|
3
|
+
* sessions a group reviewed records in. A session kind names, in its
|
|
4
|
+
* `session` declaration, the list of verdicts a session produced, the field
|
|
5
|
+
* that seals it once closed, and the kind file of the records its verdicts
|
|
6
|
+
* name (the subjects, such as decisions).
|
|
7
|
+
*
|
|
8
|
+
* On read, a closed session's seal has to match its text
|
|
9
|
+
* (`session-seal-mismatch`), and each verdict has to name a subject record
|
|
10
|
+
* that exists (`session-verdict-unknown-record`). Each session also lists the
|
|
11
|
+
* subjects' review entries that name it in their `session` field, as
|
|
12
|
+
* `citedBy`. This module only reads; nothing here writes a seal into a file.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { recordTextDigest, type RecordEntry, type RecordFormat, type RecordKind } from "./records";
|
|
16
|
+
|
|
17
|
+
/** A subject record's review entry that names a session in its `session` field. */
|
|
18
|
+
export interface SessionCitation {
|
|
19
|
+
/** The subject record's id. */
|
|
20
|
+
id: string;
|
|
21
|
+
/** The subject record's path, from the repository root. */
|
|
22
|
+
path: string;
|
|
23
|
+
/** The entry's position in the subject's reviews list, from 0. */
|
|
24
|
+
index: number;
|
|
25
|
+
/** The reviewer as the entry writes it, or null when it names none. */
|
|
26
|
+
reviewer: string | null;
|
|
27
|
+
/** The verdict as the entry writes it, or null when it names none. */
|
|
28
|
+
verdict: string | null;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* The seal of a session record: {@link recordTextDigest} with the seal field
|
|
33
|
+
* in place of the reviews list. That is the lowercase hex SHA-256 of the
|
|
34
|
+
* file's text with LF line endings and without the front-matter line that
|
|
35
|
+
* holds the seal, a quoted string on one line. Every other byte, the `---`
|
|
36
|
+
* lines and the body included, is kept.
|
|
37
|
+
*
|
|
38
|
+
* `awk 'NR==1&&/^---$/{f=1;print;next} f&&/^---$/{f=0} f&&/^closed_digest:/{next} {print}' S-0001.md | shasum -a 256`
|
|
39
|
+
* gives the same value for a file with LF line endings that ends in one.
|
|
40
|
+
* For a session kind of format json (ws-053), the seal member is removed by
|
|
41
|
+
* the JSON rule of {@link recordTextDigest} instead.
|
|
42
|
+
*/
|
|
43
|
+
export function sessionSeal(text: string, field: string, format: RecordFormat = "markdown-front-matter"): string {
|
|
44
|
+
return recordTextDigest(text, field, format);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Check each session in `entries` against its seal and the subject records,
|
|
49
|
+
* and fill in `citedBy`. `texts` holds each entry's file text by path.
|
|
50
|
+
* `subjects` holds the subject records and the name of their reviews list;
|
|
51
|
+
* it is null when they were not read, and then no verdict is checked.
|
|
52
|
+
*/
|
|
53
|
+
export function joinSessions(kind: RecordKind, entries: RecordEntry[], texts: Map<string, string>, subjects: { records: RecordEntry[]; reviews: string } | null): void {
|
|
54
|
+
const decl = kind.session;
|
|
55
|
+
if (!decl) return;
|
|
56
|
+
const closed = new Set(kind.closedStates);
|
|
57
|
+
const subjectIds = new Set(subjects?.records.map((s) => s.id).filter((id): id is string => id !== null) ?? []);
|
|
58
|
+
const citations = new Map<string, SessionCitation[]>();
|
|
59
|
+
for (const s of subjects?.records ?? []) {
|
|
60
|
+
if (s.id === null) continue;
|
|
61
|
+
const reviews = s.data?.[subjects!.reviews];
|
|
62
|
+
if (!Array.isArray(reviews)) continue;
|
|
63
|
+
reviews.forEach((r, index) => {
|
|
64
|
+
if (r === null || typeof r !== "object") return;
|
|
65
|
+
const entry = r as Record<string, unknown>;
|
|
66
|
+
if (typeof entry.session !== "string") return;
|
|
67
|
+
const list = citations.get(entry.session) ?? [];
|
|
68
|
+
list.push({
|
|
69
|
+
id: s.id!,
|
|
70
|
+
path: s.path,
|
|
71
|
+
index,
|
|
72
|
+
reviewer: typeof entry.reviewer === "string" ? entry.reviewer : null,
|
|
73
|
+
verdict: typeof entry.verdict === "string" ? entry.verdict : null,
|
|
74
|
+
});
|
|
75
|
+
citations.set(entry.session, list);
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
for (const e of entries) {
|
|
79
|
+
e.citedBy = e.id === null ? [] : (citations.get(e.id) ?? []);
|
|
80
|
+
if (e.data === null) continue;
|
|
81
|
+
if (e.state !== null && closed.has(e.state)) {
|
|
82
|
+
const seal = e.data[decl.seal];
|
|
83
|
+
const text = texts.get(e.path);
|
|
84
|
+
if (typeof seal === "string" && text !== undefined) {
|
|
85
|
+
const actual = sessionSeal(text, decl.seal, kind.format);
|
|
86
|
+
if (actual !== seal) {
|
|
87
|
+
e.reasons.push({
|
|
88
|
+
code: "session-seal-mismatch",
|
|
89
|
+
message: `${decl.seal} is ${seal}, but the text hashes to ${actual}: the session changed after it closed`,
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
if (subjects === null) continue;
|
|
95
|
+
const verdicts = e.data[decl.verdicts];
|
|
96
|
+
if (!Array.isArray(verdicts)) continue;
|
|
97
|
+
verdicts.forEach((v, i) => {
|
|
98
|
+
if (v === null || typeof v !== "object") return;
|
|
99
|
+
const record = (v as Record<string, unknown>).record;
|
|
100
|
+
if (typeof record === "string" && !subjectIds.has(record)) {
|
|
101
|
+
e.reasons.push({ code: "session-verdict-unknown-record", message: `${decl.verdicts}[${i}] names ${record}, which no ${decl.subjects.kind} record has` });
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
}
|
|
@@ -16,6 +16,8 @@ export interface RecordSource {
|
|
|
16
16
|
list(dir: string): string[] | undefined;
|
|
17
17
|
/** The text of a file listed by `list`. */
|
|
18
18
|
read(path: string): string;
|
|
19
|
+
/** The bytes of a file listed by `list`, for a content-addressed id (ws-053). */
|
|
20
|
+
bytes(path: string): Uint8Array;
|
|
19
21
|
}
|
|
20
22
|
|
|
21
23
|
/** Records in the working tree under `root`. */
|
|
@@ -34,6 +36,9 @@ export function workingTreeSource(root: string): RecordSource {
|
|
|
34
36
|
read(path) {
|
|
35
37
|
return readFileSync(join(root, path), "utf-8");
|
|
36
38
|
},
|
|
39
|
+
bytes(path) {
|
|
40
|
+
return readFileSync(join(root, path));
|
|
41
|
+
},
|
|
37
42
|
};
|
|
38
43
|
}
|
|
39
44
|
|
|
@@ -68,7 +73,12 @@ export function resolveRevision(root: string, rev: string): string {
|
|
|
68
73
|
|
|
69
74
|
/** Records as they were at `commit`, read from the object store of the repository at `root`. */
|
|
70
75
|
export function gitRevisionSource(root: string, commit: string): RecordSource {
|
|
71
|
-
const blobs = new Map<string,
|
|
76
|
+
const blobs = new Map<string, Buffer>();
|
|
77
|
+
const blob = (path: string): Buffer => {
|
|
78
|
+
const bytes = blobs.get(path);
|
|
79
|
+
if (bytes === undefined) throw new Error(`${path} was not listed at ${commit}`);
|
|
80
|
+
return bytes;
|
|
81
|
+
};
|
|
72
82
|
return {
|
|
73
83
|
label: ` at ${commit.slice(0, 8)}`,
|
|
74
84
|
list(dir) {
|
|
@@ -102,16 +112,15 @@ export function gitRevisionSource(root: string, commit: string): RecordSource {
|
|
|
102
112
|
const nl = out.indexOf(0x0a, at);
|
|
103
113
|
const size = Number(out.subarray(at, nl).toString("utf-8").split(" ")[2]);
|
|
104
114
|
const start = nl + 1;
|
|
105
|
-
blobs.set(dir === "." ? e.name : `${dir}/${e.name}`, out.subarray(start, start + size)
|
|
115
|
+
blobs.set(dir === "." ? e.name : `${dir}/${e.name}`, out.subarray(start, start + size));
|
|
106
116
|
at = start + size + 1;
|
|
107
117
|
}
|
|
108
118
|
}
|
|
109
119
|
return entries.map((e) => e.name);
|
|
110
120
|
},
|
|
111
121
|
read(path) {
|
|
112
|
-
|
|
113
|
-
if (text === undefined) throw new Error(`${path} was not listed at ${commit}`);
|
|
114
|
-
return text;
|
|
122
|
+
return blob(path).toString("utf-8");
|
|
115
123
|
},
|
|
124
|
+
bytes: blob,
|
|
116
125
|
};
|
|
117
126
|
}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://intentius.io/chant/schemas/workspace/records-amend/v1/records-amend.schema.json",
|
|
4
|
+
"title": "chant workspace records amend output",
|
|
5
|
+
"description": "What `chant workspace records amend <id> --kind <kind file> --set <file|->` prints (#2670): the record's path and id and the top-level fields the amendment changed, or the reason it wrote nothing. Version 1 of the write contract for records. The command writes one file or none and never commits. Readers ignore fields they do not know; a field is only ever added within a version. The error codes are a closed list, each in the one closed list of `reason-codes.ts`. Contract version 1 of this document is written by chant 0.86.0 and newer.",
|
|
6
|
+
"oneOf": [
|
|
7
|
+
{
|
|
8
|
+
"$ref": "#/$defs/result"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"$ref": "#/$defs/failure"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"$defs": {
|
|
15
|
+
"result": {
|
|
16
|
+
"description": "The record was written, or would be with --dry-run. Exit code 0.",
|
|
17
|
+
"type": "object",
|
|
18
|
+
"required": [
|
|
19
|
+
"$schema",
|
|
20
|
+
"contract",
|
|
21
|
+
"kind",
|
|
22
|
+
"path",
|
|
23
|
+
"id",
|
|
24
|
+
"changed",
|
|
25
|
+
"dryRun",
|
|
26
|
+
"warnings"
|
|
27
|
+
],
|
|
28
|
+
"properties": {
|
|
29
|
+
"$schema": {
|
|
30
|
+
"const": "https://intentius.io/chant/schemas/workspace/records-amend/v1/records-amend.schema.json"
|
|
31
|
+
},
|
|
32
|
+
"contract": {
|
|
33
|
+
"const": 1
|
|
34
|
+
},
|
|
35
|
+
"kind": {
|
|
36
|
+
"type": "object",
|
|
37
|
+
"required": [
|
|
38
|
+
"name",
|
|
39
|
+
"schema",
|
|
40
|
+
"file"
|
|
41
|
+
],
|
|
42
|
+
"properties": {
|
|
43
|
+
"name": {
|
|
44
|
+
"type": "string",
|
|
45
|
+
"description": "The kind's name, such as \"decision\"."
|
|
46
|
+
},
|
|
47
|
+
"schema": {
|
|
48
|
+
"type": "string",
|
|
49
|
+
"description": "The `$id` of the schema the record was validated against."
|
|
50
|
+
},
|
|
51
|
+
"file": {
|
|
52
|
+
"type": "string",
|
|
53
|
+
"description": "The kind file, relative to the repository root, with / separators."
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"path": {
|
|
58
|
+
"type": "string",
|
|
59
|
+
"description": "The record file, relative to the repository root (the working directory outside git), with / separators."
|
|
60
|
+
},
|
|
61
|
+
"id": {
|
|
62
|
+
"type": "string",
|
|
63
|
+
"description": "The record's id."
|
|
64
|
+
},
|
|
65
|
+
"changed": {
|
|
66
|
+
"type": "array",
|
|
67
|
+
"items": {
|
|
68
|
+
"type": "string"
|
|
69
|
+
},
|
|
70
|
+
"description": "The top-level fields whose value differs from the record as it was, in the record's order. Empty when the fields set change nothing, and then nothing is written."
|
|
71
|
+
},
|
|
72
|
+
"dryRun": {
|
|
73
|
+
"type": "boolean",
|
|
74
|
+
"description": "True when --dry-run was given and nothing was written."
|
|
75
|
+
},
|
|
76
|
+
"warnings": {
|
|
77
|
+
"type": "array",
|
|
78
|
+
"description": "The written record's warnings, as chant workspace records reports them. A warning never refuses a write.",
|
|
79
|
+
"items": {
|
|
80
|
+
"$ref": "#/$defs/warning"
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
"text": {
|
|
84
|
+
"type": "string",
|
|
85
|
+
"description": "With --dry-run only: the whole text of the file the command would write."
|
|
86
|
+
},
|
|
87
|
+
"error": false
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
"warning": {
|
|
91
|
+
"type": "object",
|
|
92
|
+
"required": [
|
|
93
|
+
"code",
|
|
94
|
+
"message"
|
|
95
|
+
],
|
|
96
|
+
"properties": {
|
|
97
|
+
"code": {
|
|
98
|
+
"enum": [
|
|
99
|
+
"asset-drift",
|
|
100
|
+
"asset-missing",
|
|
101
|
+
"asset-stale",
|
|
102
|
+
"record-supersedes-pending",
|
|
103
|
+
"record-no-evidence",
|
|
104
|
+
"review-undigested"
|
|
105
|
+
]
|
|
106
|
+
},
|
|
107
|
+
"message": {
|
|
108
|
+
"type": "string"
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
"failure": {
|
|
113
|
+
"description": "Nothing was written. Exit code 1.",
|
|
114
|
+
"type": "object",
|
|
115
|
+
"required": [
|
|
116
|
+
"$schema",
|
|
117
|
+
"contract",
|
|
118
|
+
"error"
|
|
119
|
+
],
|
|
120
|
+
"properties": {
|
|
121
|
+
"$schema": {
|
|
122
|
+
"const": "https://intentius.io/chant/schemas/workspace/records-amend/v1/records-amend.schema.json"
|
|
123
|
+
},
|
|
124
|
+
"contract": {
|
|
125
|
+
"const": 1
|
|
126
|
+
},
|
|
127
|
+
"error": {
|
|
128
|
+
"type": "object",
|
|
129
|
+
"required": [
|
|
130
|
+
"code",
|
|
131
|
+
"message"
|
|
132
|
+
],
|
|
133
|
+
"properties": {
|
|
134
|
+
"code": {
|
|
135
|
+
"enum": [
|
|
136
|
+
"kind-unreadable",
|
|
137
|
+
"kind-invalid",
|
|
138
|
+
"schema-unreadable",
|
|
139
|
+
"schema-id-mismatch",
|
|
140
|
+
"schema-invalid",
|
|
141
|
+
"location-missing",
|
|
142
|
+
"write-usage-invalid",
|
|
143
|
+
"write-input-invalid",
|
|
144
|
+
"record-not-found",
|
|
145
|
+
"amend-id-immutable",
|
|
146
|
+
"record-closed",
|
|
147
|
+
"amend-supersede-instead",
|
|
148
|
+
"record-unparseable",
|
|
149
|
+
"record-schema-invalid",
|
|
150
|
+
"record-id-duplicate",
|
|
151
|
+
"record-supersedes-unknown",
|
|
152
|
+
"record-supersedes-conflict",
|
|
153
|
+
"session-seal-mismatch",
|
|
154
|
+
"session-verdict-unknown-record"
|
|
155
|
+
]
|
|
156
|
+
},
|
|
157
|
+
"message": {
|
|
158
|
+
"type": "string",
|
|
159
|
+
"description": "What was wrong, and what to do instead when there is something, such as writing a new record that supersedes this one."
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
"path": false
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|