@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.
Files changed (55) hide show
  1. package/dist/agents.d.ts.map +1 -1
  2. package/dist/agents.js +43 -2
  3. package/dist/agents.js.map +1 -1
  4. package/dist/commands/context.d.ts.map +1 -1
  5. package/dist/commands/context.js +18 -3
  6. package/dist/commands/context.js.map +1 -1
  7. package/dist/commands/graph.js +1 -1
  8. package/dist/commands/init.d.ts.map +1 -1
  9. package/dist/commands/init.js +10 -8
  10. package/dist/commands/init.js.map +1 -1
  11. package/dist/commands/list.d.ts +49 -0
  12. package/dist/commands/list.d.ts.map +1 -0
  13. package/dist/commands/list.js +295 -0
  14. package/dist/commands/list.js.map +1 -0
  15. package/dist/commands/shared.d.ts +8 -0
  16. package/dist/commands/shared.d.ts.map +1 -1
  17. package/dist/commands/shared.js +15 -5
  18. package/dist/commands/shared.js.map +1 -1
  19. package/dist/glob.d.ts +4 -13
  20. package/dist/glob.d.ts.map +1 -1
  21. package/dist/glob.js +4 -57
  22. package/dist/glob.js.map +1 -1
  23. package/dist/index.d.ts +2 -0
  24. package/dist/index.d.ts.map +1 -1
  25. package/dist/index.js +2 -0
  26. package/dist/index.js.map +1 -1
  27. package/dist/main.d.ts +1 -1
  28. package/dist/main.d.ts.map +1 -1
  29. package/dist/main.js +78 -5
  30. package/dist/main.js.map +1 -1
  31. package/dist/session.d.ts +1 -2
  32. package/dist/session.d.ts.map +1 -1
  33. package/dist/session.js +2 -3
  34. package/dist/session.js.map +1 -1
  35. package/dist/slices.d.ts +3 -21
  36. package/dist/slices.d.ts.map +1 -1
  37. package/dist/slices.js +3 -45
  38. package/dist/slices.js.map +1 -1
  39. package/dist/subject.d.ts +2 -0
  40. package/dist/subject.d.ts.map +1 -1
  41. package/dist/subject.js +11 -1
  42. package/dist/subject.js.map +1 -1
  43. package/package.json +9 -9
  44. package/src/agents.ts +43 -2
  45. package/src/commands/context.ts +22 -2
  46. package/src/commands/graph.ts +1 -1
  47. package/src/commands/init.ts +10 -8
  48. package/src/commands/list.ts +346 -0
  49. package/src/commands/shared.ts +20 -0
  50. package/src/glob.ts +4 -56
  51. package/src/index.ts +2 -0
  52. package/src/main.ts +85 -6
  53. package/src/session.ts +2 -3
  54. package/src/slices.ts +3 -52
  55. package/src/subject.ts +13 -1
package/dist/slices.d.ts CHANGED
@@ -1,24 +1,6 @@
1
1
  /**
2
- * Slices, the code they claim and the records that describe them, for
3
- * `review`'s list of slices whose code changed while their records did not
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
- import { type Artifact, type Graph } from "@intentset/core";
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
@@ -1 +1 @@
1
- {"version":3,"file":"slices.d.ts","sourceRoot":"","sources":["../src/slices.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,KAAK,QAAQ,EAAkB,KAAK,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAK5E,4EAA4E;AAC5E,wBAAgB,YAAY,CAAC,KAAK,EAAE,KAAK,GAAG,QAAQ,EAAE,CAIrD;AAED,+DAA+D;AAC/D,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,GAAG,QAAQ,EAAE,CAErE;AAED,sFAAsF;AACtF,wBAAgB,WAAW,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAElE;AAED,+GAA+G;AAC/G,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,GAAG,MAAM,EAAE,CAgBzE"}
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
- * Slices, the code they claim and the records that describe them, for
3
- * `review`'s list of slices whose code changed while their records did not
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
- import { compareStrings } from "@intentset/core";
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
@@ -1 +1 @@
1
- {"version":3,"file":"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CAAC,CAAC,CAAC;IACxE,MAAM,MAAM,GAAG,CAAC,GAAG,SAAS,EAAE,GAAG,KAAK,EAAE,GAAG,SAAS,CAAC,CAAC;IACtD,MAAM,aAAa,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE,UAAU,CAAC,CAAC,CAAC;IACtE,MAAM,SAAS,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC;IACpD,MAAM,SAAS,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,GAAG,SAAS,EAAE,GAAG,SAAS,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE,YAAY,CAAC,CAAC,CAAC;IACzG,KAAK,MAAM,EAAE,IAAI,CAAC,GAAG,MAAM,EAAE,GAAG,aAAa,EAAE,GAAG,SAAS,EAAE,GAAG,SAAS,CAAC;QAAE,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACxF,OAAO,CAAC,GAAG,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;AAC/E,CAAC"}
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. */
@@ -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,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,GAAG,aAAa,CAanF;AAED,MAAM,WAAW,QAAQ;IACvB,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,MAAM,EAAE,aAAa,CAAC;IACtB,kEAAkE;IAClE,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,EAAE,GAAG,IAAI,CAAC;CACnD;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,GAAG,QAAQ,CAW/E"}
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,sGAAsG;AACtG,eAAO,MAAM,YAAY,wBAAwB,CAAC;AAWlD,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,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,GAAG,aAAa,CAanF;AAED,MAAM,WAAW,QAAQ;IACvB,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,MAAM,EAAE,aAAa,CAAC;IACtB,kEAAkE;IAClE,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,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
  };
@@ -1 +1 @@
1
- {"version":3,"file":"subject.js","sourceRoot":"","sources":["../src/subject.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAEL,cAAc,EACd,cAAc,EAGd,WAAW,GACZ,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAIxC,4FAA4F;AAC5F,MAAM,UAAU,UAAU,CAAC,IAAgB,EAAE,KAAY,EAAE,KAAkC;IAC3F,OAAO,cAAc,CAAC,KAAK,IAAI,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC;AACtF,CAAC;AAED,oFAAoF;AACpF,MAAM,UAAU,SAAS,CAAC,IAAgB,EAAE,KAAY,EAAE,IAAU;IAClE,OAAO,aAAa,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,EAAE;QACjD,YAAY,EAAE,IAAI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L,CAAC;AASD,MAAM,UAAU,UAAU,CAAC,IAAgB,EAAE,KAAY,EAAE,IAAU;IACnE,MAAM,MAAM,GAAG,SAAS,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;IAC5C,MAAM,KAAK,GAAG,IAAI,GAAG,EAA2B,CAAC;IACjD,OAAO;QACL,QAAQ,EAAE,WAAW,CAAC,KAAK,EAAE,MAAM,CAAC;QACpC,MAAM;QACN,YAAY,EAAE,CAAC,MAAM,EAAE,EAAE;YACvB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC;gBAAE,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,eAAe,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;YAC5F,OAAO,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC;QACnC,CAAC;KACF,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intentset/cli",
3
- "version": "0.10.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.10.0",
43
- "@intentset/markset-adapter": "^0.10.0",
44
- "@intentset/architecture": "^0.10.0",
45
- "@intentset/verification": "^0.10.0",
46
- "@intentset/publisher": "^0.10.0",
47
- "@intentset/atlas": "^0.10.0",
48
- "@intentset/mcp": "^0.10.0",
49
- "@intentset/conformance-suite": "^0.10.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 new behavior looks like this, one
138
- recognizable promise including how it fails:
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.
@@ -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
- const diagnostic = unresolved(id, session);
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({
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * `intentset graph --format json` (spec/export.md, Core §12): the
3
- * `intentset/export/0.4` envelope over the validated repository, with the
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
@@ -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
- "owners: []",
58
- "audiences: []",
59
- "releases: []",
60
- "roles: []",
61
- "editions: []",
62
- "flags: []",
63
- "evidenceSources: []",
64
- "resources: []",
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