@intentset/cli 0.10.0 → 0.12.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/agents.d.ts.map +1 -1
- package/dist/agents.js +43 -2
- package/dist/agents.js.map +1 -1
- package/dist/commands/context.d.ts.map +1 -1
- package/dist/commands/context.js +18 -3
- package/dist/commands/context.js.map +1 -1
- package/dist/commands/graph.js +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +10 -8
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/list.d.ts +49 -0
- package/dist/commands/list.d.ts.map +1 -0
- package/dist/commands/list.js +295 -0
- package/dist/commands/list.js.map +1 -0
- package/dist/commands/shared.d.ts +8 -0
- package/dist/commands/shared.d.ts.map +1 -1
- package/dist/commands/shared.js +15 -5
- package/dist/commands/shared.js.map +1 -1
- package/dist/glob.d.ts +4 -13
- package/dist/glob.d.ts.map +1 -1
- package/dist/glob.js +4 -57
- package/dist/glob.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +78 -5
- package/dist/main.js.map +1 -1
- package/dist/session.d.ts +1 -2
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +2 -3
- package/dist/session.js.map +1 -1
- package/dist/slices.d.ts +3 -21
- package/dist/slices.d.ts.map +1 -1
- package/dist/slices.js +3 -45
- package/dist/slices.js.map +1 -1
- package/dist/subject.d.ts +2 -0
- package/dist/subject.d.ts.map +1 -1
- package/dist/subject.js +11 -1
- package/dist/subject.js.map +1 -1
- package/package.json +9 -9
- package/src/agents.ts +43 -2
- package/src/commands/context.ts +22 -2
- package/src/commands/graph.ts +1 -1
- package/src/commands/init.ts +10 -8
- package/src/commands/list.ts +346 -0
- package/src/commands/shared.ts +20 -0
- package/src/glob.ts +4 -56
- package/src/index.ts +2 -0
- package/src/main.ts +85 -6
- package/src/session.ts +2 -3
- package/src/slices.ts +3 -52
- package/src/subject.ts +13 -1
package/dist/slices.d.ts
CHANGED
|
@@ -1,24 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* (Core §10) and for `context <path>`.
|
|
5
|
-
*
|
|
6
|
-
* A slice's code is what its `source`, `backend` and `contract` claims match;
|
|
7
|
-
* its `verification` and `documentation` claims are checks and prose, not
|
|
8
|
-
* implementation. The records that describe a slice are the slice itself, the
|
|
9
|
-
* behaviors it implements, the rules that govern them, the scenarios that
|
|
10
|
-
* illustrate them, the verifications of any of those, the contracts it
|
|
11
|
-
* exposes, and the decisions that inform the slice, its behaviors or its
|
|
12
|
-
* contracts. Knowledge is left out: it explains the model to an audience, and
|
|
13
|
-
* review pins already mark it for review when the model changes.
|
|
2
|
+
* The slice helpers `review` and `context` use. They moved to `@intentset/core` in 0.11.0 (ADR 0016), where `select`
|
|
3
|
+
* shares them; the CLI re-exports them for one release, and from 0.12.0 a consumer imports them from core.
|
|
14
4
|
*/
|
|
15
|
-
|
|
16
|
-
/** Every slice that is not retired and has slice metadata, sorted by ID. */
|
|
17
|
-
export declare function activeSlices(graph: Graph): Artifact[];
|
|
18
|
-
/** The slices with any claim matching `path`, sorted by ID. */
|
|
19
|
-
export declare function claimingSlices(graph: Graph, path: string): Artifact[];
|
|
20
|
-
/** True when one of the slice's source, backend or contract claims matches `path`. */
|
|
21
|
-
export declare function isSliceCode(slice: Artifact, path: string): boolean;
|
|
22
|
-
/** The IDs of the records that describe a slice, the slice included, sorted. Only IDs present in the graph. */
|
|
23
|
-
export declare function describingRecords(graph: Graph, slice: Artifact): string[];
|
|
5
|
+
export { activeSlices, claimingSlices, describingRecords, isSliceCode } from "@intentset/core";
|
|
24
6
|
//# sourceMappingURL=slices.d.ts.map
|
package/dist/slices.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slices.d.ts","sourceRoot":"","sources":["../src/slices.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"slices.d.ts","sourceRoot":"","sources":["../src/slices.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC"}
|
package/dist/slices.js
CHANGED
|
@@ -1,48 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* (Core §10) and for `context <path>`.
|
|
5
|
-
*
|
|
6
|
-
* A slice's code is what its `source`, `backend` and `contract` claims match;
|
|
7
|
-
* its `verification` and `documentation` claims are checks and prose, not
|
|
8
|
-
* implementation. The records that describe a slice are the slice itself, the
|
|
9
|
-
* behaviors it implements, the rules that govern them, the scenarios that
|
|
10
|
-
* illustrate them, the verifications of any of those, the contracts it
|
|
11
|
-
* exposes, and the decisions that inform the slice, its behaviors or its
|
|
12
|
-
* contracts. Knowledge is left out: it explains the model to an audience, and
|
|
13
|
-
* review pins already mark it for review when the model changes.
|
|
2
|
+
* The slice helpers `review` and `context` use. They moved to `@intentset/core` in 0.11.0 (ADR 0016), where `select`
|
|
3
|
+
* shares them; the CLI re-exports them for one release, and from 0.12.0 a consumer imports them from core.
|
|
14
4
|
*/
|
|
15
|
-
|
|
16
|
-
import { matchGlob } from "./glob.js";
|
|
17
|
-
const CODE_CLAIMS = new Set(["source", "backend", "contract"]);
|
|
18
|
-
/** Every slice that is not retired and has slice metadata, sorted by ID. */
|
|
19
|
-
export function activeSlices(graph) {
|
|
20
|
-
return [...graph.artifacts.values()]
|
|
21
|
-
.filter((a) => a.meta.type === "slice" && a.meta.status !== "retired" && a.meta.slice !== undefined)
|
|
22
|
-
.sort((a, b) => compareStrings(a.meta.id, b.meta.id));
|
|
23
|
-
}
|
|
24
|
-
/** The slices with any claim matching `path`, sorted by ID. */
|
|
25
|
-
export function claimingSlices(graph, path) {
|
|
26
|
-
return activeSlices(graph).filter((slice) => slice.meta.slice?.claims.some((claim) => matchGlob(claim.path, path)));
|
|
27
|
-
}
|
|
28
|
-
/** True when one of the slice's source, backend or contract claims matches `path`. */
|
|
29
|
-
export function isSliceCode(slice, path) {
|
|
30
|
-
return slice.meta.slice?.claims.some((claim) => CODE_CLAIMS.has(claim.kind) && matchGlob(claim.path, path)) ?? false;
|
|
31
|
-
}
|
|
32
|
-
/** The IDs of the records that describe a slice, the slice included, sorted. Only IDs present in the graph. */
|
|
33
|
-
export function describingRecords(graph, slice) {
|
|
34
|
-
const out = new Set([slice.meta.id]);
|
|
35
|
-
const targets = (id, kind) => (graph.out.get(id) ?? []).filter((edge) => edge.kind === kind).map((edge) => edge.to);
|
|
36
|
-
const sources = (id, kind) => (graph.in.get(id) ?? []).filter((edge) => edge.kind === kind).map((edge) => edge.from);
|
|
37
|
-
const behaviors = targets(slice.meta.id, "implements");
|
|
38
|
-
const rules = behaviors.flatMap((id) => targets(id, "governedBy"));
|
|
39
|
-
const scenarios = behaviors.flatMap((id) => sources(id, "illustrates"));
|
|
40
|
-
const claims = [...behaviors, ...rules, ...scenarios];
|
|
41
|
-
const verifications = claims.flatMap((id) => sources(id, "verifies"));
|
|
42
|
-
const contracts = targets(slice.meta.id, "exposes");
|
|
43
|
-
const decisions = [slice.meta.id, ...behaviors, ...contracts].flatMap((id) => targets(id, "informedBy"));
|
|
44
|
-
for (const id of [...claims, ...verifications, ...contracts, ...decisions])
|
|
45
|
-
out.add(id);
|
|
46
|
-
return [...out].filter((id) => graph.artifacts.has(id)).sort(compareStrings);
|
|
47
|
-
}
|
|
5
|
+
export { activeSlices, claimingSlices, describingRecords, isSliceCode } from "@intentset/core";
|
|
48
6
|
//# sourceMappingURL=slices.js.map
|
package/dist/slices.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slices.js","sourceRoot":"","sources":["../src/slices.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"slices.js","sourceRoot":"","sources":["../src/slices.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC"}
|
package/dist/subject.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ import type { EvidenceBinding, Graph } from "@intentset/core";
|
|
|
2
2
|
import { type BindingDecision, type Subject, type SubjectSource } from "@intentset/verification";
|
|
3
3
|
import type { Repository } from "./repository.ts";
|
|
4
4
|
import type { Tree } from "./tree.ts";
|
|
5
|
+
/** Where run records are read from when no --evidence is given. Local output: not to be committed. */
|
|
6
|
+
export declare const EVIDENCE_DIR = ".intentset/evidence";
|
|
5
7
|
/** The binding in force: the option, else the configuration, else the default (Core §8). */
|
|
6
8
|
export declare function bindingFor(repo: Repository, graph: Graph, given: EvidenceBinding | undefined): BindingDecision;
|
|
7
9
|
/** The architecture's resolution over the tree, reading file contents from disk. */
|
package/dist/subject.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subject.d.ts","sourceRoot":"","sources":["../src/subject.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EACL,KAAK,eAAe,EAGpB,KAAK,OAAO,EACZ,KAAK,aAAa,EAEnB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEtC,4FAA4F;AAC5F,wBAAgB,UAAU,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,eAAe,GAAG,SAAS,GAAG,eAAe,CAE9G;AAED,oFAAoF;AACpF,wBAAgB,SAAS,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EA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AM,EAAE,GAAG,IAAI,CAAC;CACnD;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,GAAG,QAAQ,CAW/E"}
|
package/dist/subject.js
CHANGED
|
@@ -10,6 +10,16 @@ import { join } from "node:path";
|
|
|
10
10
|
import { subjectSource } from "@intentset/architecture";
|
|
11
11
|
import { hasSliceClaims, resolveBinding, subjectsFor, } from "@intentset/verification";
|
|
12
12
|
import { changedSince } from "./git.js";
|
|
13
|
+
/** Where run records are read from when no --evidence is given. Local output: not to be committed. */
|
|
14
|
+
export const EVIDENCE_DIR = ".intentset/evidence";
|
|
15
|
+
/**
|
|
16
|
+
* The run records under EVIDENCE_DIR are the toolchain's own output, never part of a subject, so a change to them
|
|
17
|
+
* says nothing about evidence and is left out of what `changedSince` answers: EVID005 would otherwise list the file
|
|
18
|
+
* `evidence import --out` has just written, until it is ignored or committed.
|
|
19
|
+
*/
|
|
20
|
+
function outsideEvidence(paths) {
|
|
21
|
+
return paths === null ? null : paths.filter((path) => path !== EVIDENCE_DIR && !path.startsWith(`${EVIDENCE_DIR}/`));
|
|
22
|
+
}
|
|
13
23
|
/** The binding in force: the option, else the configuration, else the default (Core §8). */
|
|
14
24
|
export function bindingFor(repo, graph, given) {
|
|
15
25
|
return resolveBinding(given ?? repo.config.evidence.binding, hasSliceClaims(graph));
|
|
@@ -38,7 +48,7 @@ export function subjectsOf(repo, graph, tree) {
|
|
|
38
48
|
source,
|
|
39
49
|
changedSince: (commit) => {
|
|
40
50
|
if (!asked.has(commit))
|
|
41
|
-
asked.set(commit, changedSince(repo.root, commit));
|
|
51
|
+
asked.set(commit, outsideEvidence(changedSince(repo.root, commit)));
|
|
42
52
|
return asked.get(commit) ?? null;
|
|
43
53
|
},
|
|
44
54
|
};
|
package/dist/subject.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subject.js","sourceRoot":"","sources":["../src/subject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|
1
1
|
{
|
|
2
2
|
"name": "@intentset/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"description": "The intentset command: validate, graph, architecture check, evidence, impact, review, publish, serve, context, mcp, guide.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"intentset",
|
|
@@ -39,14 +39,14 @@
|
|
|
39
39
|
"intentset": "./dist/intentset.js"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@intentset/core": "^0.
|
|
43
|
-
"@intentset/markset-adapter": "^0.
|
|
44
|
-
"@intentset/architecture": "^0.
|
|
45
|
-
"@intentset/verification": "^0.
|
|
46
|
-
"@intentset/publisher": "^0.
|
|
47
|
-
"@intentset/atlas": "^0.
|
|
48
|
-
"@intentset/mcp": "^0.
|
|
49
|
-
"@intentset/conformance-suite": "^0.
|
|
42
|
+
"@intentset/core": "^0.12.0",
|
|
43
|
+
"@intentset/markset-adapter": "^0.12.0",
|
|
44
|
+
"@intentset/architecture": "^0.12.0",
|
|
45
|
+
"@intentset/verification": "^0.12.0",
|
|
46
|
+
"@intentset/publisher": "^0.12.0",
|
|
47
|
+
"@intentset/atlas": "^0.12.0",
|
|
48
|
+
"@intentset/mcp": "^0.12.0",
|
|
49
|
+
"@intentset/conformance-suite": "^0.12.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@modelcontextprotocol/sdk": "^1.32.0"
|
package/src/agents.ts
CHANGED
|
@@ -85,6 +85,10 @@ Update the records in the same change as the code.
|
|
|
85
85
|
slice is a draft, the paths it plans may not exist yet.
|
|
86
86
|
- A changed check: a verification record names the test that checks a claim. Change the test and its record
|
|
87
87
|
together, and add one for a behavior or rule that has none.
|
|
88
|
+
- Whether the work is built: a capability, behavior, rule, scenario, slice or contract says so in \`delivery\`.
|
|
89
|
+
Write \`delivery: built\` on a record you wrote from code that exists, \`delivery: planned\` on one that proposes
|
|
90
|
+
work, and change \`planned\` to \`built\` in the change that builds it. It states a fact about the code, not an
|
|
91
|
+
approval, so you may set it; a draft that says \`built\` is still a draft until a person approves it.
|
|
88
92
|
|
|
89
93
|
Write each link once, on the record that points: a behavior is \`governedBy\` its rules, a scenario \`illustrates\`
|
|
90
94
|
a behavior, a slice \`implements\` behaviors, a verification \`verifies\` what it checks. Never write the reverse.
|
|
@@ -134,8 +138,10 @@ level-one heading repeats its title. Plain Markdown is valid Markset. For the re
|
|
|
134
138
|
callouts, tables and other constructs a record may use and the codes \`validate\` reports for them, read Markset's
|
|
135
139
|
guide at ${MARKSET_GUIDE_URL}, or print it with \`${markset}\`.
|
|
136
140
|
|
|
137
|
-
An existing record of the same type in this repository is the best template; a
|
|
138
|
-
|
|
141
|
+
An existing record of the same type in this repository is the best template; in a repository with none yet,
|
|
142
|
+
\`${run} init --example --root <an empty directory>\` writes one record of each type there to read. A capability sits
|
|
143
|
+
under an outcome, an outcome under an intent, and an intent under the product, so the first capability brings those
|
|
144
|
+
three with it. A new behavior looks like this, one recognizable promise including how it fails:
|
|
139
145
|
|
|
140
146
|
\`\`\`markdown
|
|
141
147
|
---
|
|
@@ -147,6 +153,7 @@ intentset:
|
|
|
147
153
|
type: behavior
|
|
148
154
|
title: The promise in a few words, such as Schedule a student assessment
|
|
149
155
|
status: draft
|
|
156
|
+
delivery: planned
|
|
150
157
|
owner: <an owner from the registry>
|
|
151
158
|
visibility: internal
|
|
152
159
|
audiences: [engineering, product]
|
|
@@ -173,6 +180,40 @@ What must be true first.
|
|
|
173
180
|
Success: what happens. Failure: what is rejected, and what is left unchanged.
|
|
174
181
|
\`\`\`
|
|
175
182
|
|
|
183
|
+
A verification record binds a check to what it verifies. An automated one names the test file and a selector the
|
|
184
|
+
test's title holds as whole words (a \`describe\`'s name binds all of its tests), which is how \`evidence import\`
|
|
185
|
+
matches a run to it:
|
|
186
|
+
|
|
187
|
+
\`\`\`markdown
|
|
188
|
+
---
|
|
189
|
+
markset: 0
|
|
190
|
+
intentset:
|
|
191
|
+
spec: '0.2'
|
|
192
|
+
profile: intentset/verification/0.2
|
|
193
|
+
id: TEST-AREA-NAME
|
|
194
|
+
type: verification
|
|
195
|
+
title: What the check proves, such as Unit test of scheduling an assessment
|
|
196
|
+
status: draft
|
|
197
|
+
owner: <an owner from the registry>
|
|
198
|
+
visibility: internal
|
|
199
|
+
audiences: [engineering]
|
|
200
|
+
links:
|
|
201
|
+
verifies: [BEH-AREA-NAME, RULE-AREA-LIMIT]
|
|
202
|
+
verification:
|
|
203
|
+
method: automated
|
|
204
|
+
locator: src/area/name.test.ts
|
|
205
|
+
selector: the test's title, or the describe's name
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
# What the check proves, such as Unit test of scheduling an assessment
|
|
209
|
+
|
|
210
|
+
## Procedure
|
|
211
|
+
The runner and the file, and the cases it covers, the failure cases included.
|
|
212
|
+
|
|
213
|
+
## Expected result
|
|
214
|
+
What a pass shows.
|
|
215
|
+
\`\`\`
|
|
216
|
+
|
|
176
217
|
A knowledge record explains behaviors, rules or capabilities to one audience, in that audience's words rather than
|
|
177
218
|
the behavior's. It may carry \`tips\`: one plain sentence per explained ID, at most 160 characters, which the
|
|
178
219
|
product shows beside the control that delivers that behavior once the knowledge is reviewed and published.
|
package/src/commands/context.ts
CHANGED
|
@@ -21,7 +21,9 @@ import {
|
|
|
21
21
|
type ContextRole,
|
|
22
22
|
compareStrings,
|
|
23
23
|
contextFor,
|
|
24
|
+
type Diagnostic,
|
|
24
25
|
type Graph,
|
|
26
|
+
ID_PATTERN,
|
|
25
27
|
type LinkKind,
|
|
26
28
|
} from "@intentset/core";
|
|
27
29
|
import { count, formatDiagnostic, type Io, json, snapshotLine, TOOL } from "../output.ts";
|
|
@@ -29,6 +31,21 @@ import type { Session } from "../session.ts";
|
|
|
29
31
|
import { claimingSlices } from "../slices.ts";
|
|
30
32
|
import { unresolved, validationLine, validationSummary } from "./shared.ts";
|
|
31
33
|
|
|
34
|
+
/** A file no slice claims has no context to load; VSA009 is the claims rule the architecture check reports it under. */
|
|
35
|
+
function unclaimed(path: string, session: Session): Diagnostic {
|
|
36
|
+
const slices = [...session.result.graph.artifacts.values()].filter((a) => a.meta.type === "slice").length;
|
|
37
|
+
return {
|
|
38
|
+
code: "VSA009",
|
|
39
|
+
severity: "error",
|
|
40
|
+
origin: "architecture",
|
|
41
|
+
artifact: null,
|
|
42
|
+
path,
|
|
43
|
+
message: `No slice claims ${path}, so there is no context to load for it (${count(slices, "slice")} in this graph).`,
|
|
44
|
+
remediation:
|
|
45
|
+
"Give the ID of the record whose context to load, or add the file to the claims of the slice that owns it (VSA §2).",
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
|
|
32
49
|
/**
|
|
33
50
|
* The artifact a `context` argument names: itself when it is an ID, else the
|
|
34
51
|
* one slice whose claims include it as a file path, relative to the working
|
|
@@ -81,9 +98,12 @@ export function contextCommand(
|
|
|
81
98
|
}
|
|
82
99
|
const via = "id" in target ? target.path : null;
|
|
83
100
|
const id = "id" in target ? target.id : argument;
|
|
84
|
-
const bundle = contextFor(graph, id, { includeRestricted });
|
|
101
|
+
const bundle = "slices" in target && !ID_PATTERN.test(argument) ? null : contextFor(graph, id, { includeRestricted });
|
|
85
102
|
if (bundle === null) {
|
|
86
|
-
|
|
103
|
+
// An argument that is not an ID was a file path, and no slice claims it: say that, rather than reading the
|
|
104
|
+
// path as a malformed ID, since the agent gave the file it is about to edit and wants to know what owns it.
|
|
105
|
+
const diagnostic =
|
|
106
|
+
"slices" in target && !ID_PATTERN.test(argument) ? unclaimed(target.path, session) : unresolved(id, session);
|
|
87
107
|
if (asJson) {
|
|
88
108
|
io.stdout(
|
|
89
109
|
json({
|
package/src/commands/graph.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `intentset graph --format json` (spec/export.md, Core §12): the
|
|
3
|
-
* `intentset/export/0.
|
|
3
|
+
* `intentset/export/0.5` envelope over the validated repository, with the
|
|
4
4
|
* report sections `--report` asks for. Printed to stdout, or written to the
|
|
5
5
|
* one file `--out` names, which may not be any file the repository reads.
|
|
6
6
|
* A failing validation still exports, with `validation.status: "fail"`, and
|
package/src/commands/init.ts
CHANGED
|
@@ -54,14 +54,16 @@ export const EMPTY_REGISTRIES_TEXT = [
|
|
|
54
54
|
"# Intentset registries (Core §4, §6, §7; VSA §3): the owners, audiences, release dimensions,",
|
|
55
55
|
"# evidence sources and shared resources records may name. An empty registry reads as not",
|
|
56
56
|
"# declared, and validate warns (CORE005) when a record names a value it could not check.",
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
57
|
+
"# Every record names an owner and audiences from these lists, and a behavior names at least",
|
|
58
|
+
"# one release, one role and one edition, so fill each of those before the first record.",
|
|
59
|
+
"owners: [] # who owns records, a team or a person, such as team-shop",
|
|
60
|
+
"audiences: [] # who records are written for, such as engineering and product",
|
|
61
|
+
"releases: [] # labels of the releases behaviors are available in, such as v1",
|
|
62
|
+
"roles: [] # roles of the product's users, such as shopper; a product with none still names one",
|
|
63
|
+
"editions: [] # editions the product ships in, such as standard; likewise",
|
|
64
|
+
"flags: [] # feature flags a behavior may require; usually none",
|
|
65
|
+
"evidenceSources: [] # where a measure's reading comes from, such as product-analytics",
|
|
66
|
+
"resources: [] # resources slices share, such as a data layer, each with its owner and consumers",
|
|
65
67
|
"",
|
|
66
68
|
].join("\n");
|
|
67
69
|
|