yarramate 1.7.0 → 1.8.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/adapters/visual/session-server.js +3 -0
- package/dist/adapters/visual/workspace-model.d.ts +4 -0
- package/dist/adapters/visual/workspace-model.js +1 -1
- package/dist/artifact-coverage.d.ts +13 -0
- package/dist/artifact-coverage.js +58 -0
- package/dist/ask-command.js +3 -3
- package/dist/cli.js +6 -1
- package/dist/compiler.d.ts +23 -0
- package/dist/compiler.js +23 -1
- package/dist/design-command.js +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.js +1 -0
- package/dist/interrogate-command.d.ts +36 -1
- package/dist/interrogate-command.js +26 -6
- package/dist/interrogation-entry.d.ts +1 -1
- package/dist/reconciliation.d.ts +21 -1
- package/dist/reconciliation.js +93 -2
- package/dist/visual-app-lib/editor.js +33 -396
- package/dist/visual-app-lib/types/adapters/visual/workspace-model.d.ts +4 -0
- package/dist/visual-app-lib/types/compiler.d.ts +23 -0
- package/dist/visual-app-lib/types/interrogate-command.d.ts +36 -1
- package/dist/visual-app-lib/types/workspace.d.ts +8 -0
- package/dist/workspace.d.ts +8 -0
- package/dist/workspace.js +35 -13
- package/package.json +1 -1
- package/schema/yarramate-question-catalogue.schema.json +30 -0
- package/schema/yarramate-reconciliation-report.schema.json +21 -1
- package/schema/yarramate-workspace.schema.json +4 -0
|
@@ -10,6 +10,14 @@ export interface WorkspaceManifest {
|
|
|
10
10
|
readonly questions?: readonly string[];
|
|
11
11
|
readonly evidence?: readonly string[];
|
|
12
12
|
readonly contracts?: readonly string[];
|
|
13
|
+
/**
|
|
14
|
+
* Glob patterns naming the artifacts the model intends to cover (#175,
|
|
15
|
+
* ADR 0130). Not a document category: nothing here is loaded or compiled,
|
|
16
|
+
* so it never joins ResolvedWorkspace. reconcile resolves the patterns
|
|
17
|
+
* against the root of the git repository the manifest lives in and reports
|
|
18
|
+
* every selected file no evidence observation claims.
|
|
19
|
+
*/
|
|
20
|
+
readonly coverage?: readonly string[];
|
|
13
21
|
}
|
|
14
22
|
export interface ResolvedWorkspace {
|
|
15
23
|
readonly id: string;
|
package/dist/workspace.d.ts
CHANGED
|
@@ -10,6 +10,14 @@ export interface WorkspaceManifest {
|
|
|
10
10
|
readonly questions?: readonly string[];
|
|
11
11
|
readonly evidence?: readonly string[];
|
|
12
12
|
readonly contracts?: readonly string[];
|
|
13
|
+
/**
|
|
14
|
+
* Glob patterns naming the artifacts the model intends to cover (#175,
|
|
15
|
+
* ADR 0130). Not a document category: nothing here is loaded or compiled,
|
|
16
|
+
* so it never joins ResolvedWorkspace. reconcile resolves the patterns
|
|
17
|
+
* against the root of the git repository the manifest lives in and reports
|
|
18
|
+
* every selected file no evidence observation claims.
|
|
19
|
+
*/
|
|
20
|
+
readonly coverage?: readonly string[];
|
|
13
21
|
}
|
|
14
22
|
export interface ResolvedWorkspace {
|
|
15
23
|
readonly id: string;
|
package/dist/workspace.js
CHANGED
|
@@ -21,21 +21,24 @@ export function loadWorkspaceManifest(source, cwd) {
|
|
|
21
21
|
const realBase = realpathSync(base);
|
|
22
22
|
const resolutionDiagnostics = [];
|
|
23
23
|
const categoryByPath = new Map();
|
|
24
|
+
const positionOf = (field, index) => {
|
|
25
|
+
const node = yaml.getIn([field, index], true);
|
|
26
|
+
const offset = typeof node === 'object' &&
|
|
27
|
+
node !== null &&
|
|
28
|
+
'range' in node &&
|
|
29
|
+
Array.isArray(node.range)
|
|
30
|
+
? node.range[0]
|
|
31
|
+
: 0;
|
|
32
|
+
return lineCounter.linePos(offset);
|
|
33
|
+
};
|
|
34
|
+
const unsafePattern = (pattern) => isAbsolute(pattern) ||
|
|
35
|
+
/^[A-Za-z]:[\\/]/.test(pattern) ||
|
|
36
|
+
pattern.includes('\\') ||
|
|
37
|
+
pattern.split('/').includes('..');
|
|
24
38
|
const expand = (field, label, patterns) => [
|
|
25
39
|
...new Set(patterns.flatMap((pattern, index) => {
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
node !== null &&
|
|
29
|
-
'range' in node &&
|
|
30
|
-
Array.isArray(node.range)
|
|
31
|
-
? node.range[0]
|
|
32
|
-
: 0;
|
|
33
|
-
const position = lineCounter.linePos(offset);
|
|
34
|
-
const unsafe = isAbsolute(pattern) ||
|
|
35
|
-
/^[A-Za-z]:[\\/]/.test(pattern) ||
|
|
36
|
-
pattern.includes('\\') ||
|
|
37
|
-
pattern.split('/').includes('..');
|
|
38
|
-
if (unsafe) {
|
|
40
|
+
const position = positionOf(field, index);
|
|
41
|
+
if (unsafePattern(pattern)) {
|
|
39
42
|
resolutionDiagnostics.push({
|
|
40
43
|
severity: 'error',
|
|
41
44
|
code: 'YM701',
|
|
@@ -111,6 +114,25 @@ export function loadWorkspaceManifest(source, cwd) {
|
|
|
111
114
|
evidence: expand('evidence', 'evidence', value.evidence ?? []),
|
|
112
115
|
contracts: expand('contracts', 'Core contract', value.contracts ?? []),
|
|
113
116
|
};
|
|
117
|
+
// Coverage patterns resolve to nothing here: they are not a document
|
|
118
|
+
// category, and reconcile interprets them against the repository root
|
|
119
|
+
// (ADR 0130). Load-time validation covers only pattern safety, with the
|
|
120
|
+
// same guard every resolving category gets — but relative to the
|
|
121
|
+
// repository, so escaping it is what YM701 refuses.
|
|
122
|
+
for (const [index, pattern] of (value.coverage ?? []).entries()) {
|
|
123
|
+
if (!unsafePattern(pattern))
|
|
124
|
+
continue;
|
|
125
|
+
const position = positionOf('coverage', index);
|
|
126
|
+
resolutionDiagnostics.push({
|
|
127
|
+
severity: 'error',
|
|
128
|
+
code: 'YM701',
|
|
129
|
+
message: `Workspace coverage pattern "${pattern}" must be a relative path beneath the repository root`,
|
|
130
|
+
path: source.path,
|
|
131
|
+
pointer: `/coverage/${index}`,
|
|
132
|
+
line: position.line,
|
|
133
|
+
column: position.col,
|
|
134
|
+
});
|
|
135
|
+
}
|
|
114
136
|
if (resolutionDiagnostics.length > 0) {
|
|
115
137
|
return {
|
|
116
138
|
ok: false,
|
package/package.json
CHANGED
|
@@ -523,6 +523,36 @@
|
|
|
523
523
|
}
|
|
524
524
|
}
|
|
525
525
|
},
|
|
526
|
+
{
|
|
527
|
+
"type": "object",
|
|
528
|
+
"additionalProperties": false,
|
|
529
|
+
"description": "The subject fills a slot of a pattern instance (ADR 0131). A guard, per the #334 split: it says a question applies here, and an ordinary condition beside it says what would answer it. Bare, it means bound into any slot of any instance; patternKinds narrows by the pattern's kind identity (never a document path, ADR 0129) and slots by part name. Evaluation reads pattern memberships from the compilation; a caller that does not supply them gets a condition that never holds.",
|
|
530
|
+
"required": [
|
|
531
|
+
"condition"
|
|
532
|
+
],
|
|
533
|
+
"properties": {
|
|
534
|
+
"condition": {
|
|
535
|
+
"const": "fills-pattern-slot"
|
|
536
|
+
},
|
|
537
|
+
"patternKinds": {
|
|
538
|
+
"type": "array",
|
|
539
|
+
"minItems": 1,
|
|
540
|
+
"uniqueItems": true,
|
|
541
|
+
"items": {
|
|
542
|
+
"$ref": "#/$defs/qualifiedKind"
|
|
543
|
+
}
|
|
544
|
+
},
|
|
545
|
+
"slots": {
|
|
546
|
+
"type": "array",
|
|
547
|
+
"minItems": 1,
|
|
548
|
+
"uniqueItems": true,
|
|
549
|
+
"items": {
|
|
550
|
+
"type": "string",
|
|
551
|
+
"pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$"
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
},
|
|
526
556
|
{
|
|
527
557
|
"type": "object",
|
|
528
558
|
"additionalProperties": false,
|
|
@@ -38,7 +38,17 @@
|
|
|
38
38
|
"staleAttestations": { "type": "integer", "minimum": 0 },
|
|
39
39
|
"unconfirmedAttestations": { "type": "integer", "minimum": 0 },
|
|
40
40
|
"expectationsCompared": { "type": "integer", "minimum": 0 },
|
|
41
|
-
"expectationsWithoutObservation": { "type": "integer", "minimum": 0 }
|
|
41
|
+
"expectationsWithoutObservation": { "type": "integer", "minimum": 0 },
|
|
42
|
+
"artifactsInScope": {
|
|
43
|
+
"type": "integer",
|
|
44
|
+
"minimum": 0,
|
|
45
|
+
"description": "Files the declared coverage scope selected (ADR 0130). Present exactly when coverage was assessed, so a report without it is one that never looked, not one that found nothing."
|
|
46
|
+
},
|
|
47
|
+
"unclaimedArtifacts": {
|
|
48
|
+
"type": "integer",
|
|
49
|
+
"minimum": 0,
|
|
50
|
+
"description": "Artifacts in scope that no observation's repo: locator claims (ADR 0130). Present exactly when coverage was assessed."
|
|
51
|
+
}
|
|
42
52
|
}
|
|
43
53
|
},
|
|
44
54
|
"findings": {
|
|
@@ -53,6 +63,16 @@
|
|
|
53
63
|
"type": "array",
|
|
54
64
|
"items": { "$ref": "#/$defs/unobservedExpectation" }
|
|
55
65
|
},
|
|
66
|
+
"coverageScope": {
|
|
67
|
+
"description": "The coverage patterns as the manifest declared them, echoed so the report is honest about what it was asked to look at (ADR 0130). Present exactly when coverage was assessed.",
|
|
68
|
+
"type": "array",
|
|
69
|
+
"items": { "type": "string", "minLength": 1 }
|
|
70
|
+
},
|
|
71
|
+
"unclaimedArtifacts": {
|
|
72
|
+
"description": "Repository-relative paths of in-scope artifacts no observation claims, sorted (ADR 0130). Absence, never accusation: no finding is fabricated and check --strict does not read this. Present when the count is positive.",
|
|
73
|
+
"type": "array",
|
|
74
|
+
"items": { "type": "string", "minLength": 1 }
|
|
75
|
+
},
|
|
56
76
|
"notes": {
|
|
57
77
|
"type": "array",
|
|
58
78
|
"items": { "type": "string", "minLength": 1 }
|
|
@@ -44,6 +44,10 @@
|
|
|
44
44
|
},
|
|
45
45
|
"contracts": {
|
|
46
46
|
"$ref": "#/$defs/patterns"
|
|
47
|
+
},
|
|
48
|
+
"coverage": {
|
|
49
|
+
"description": "Glob patterns naming the artifacts the model intends to cover (#175, ADR 0130). NOT a document category: nothing here is loaded or compiled. reconcile resolves the patterns against the root of the git repository the manifest lives in and reports every selected file no evidence observation claims. Opt-in; absent means coverage is not assessed and the reconciliation report says so.",
|
|
50
|
+
"$ref": "#/$defs/patterns"
|
|
47
51
|
}
|
|
48
52
|
},
|
|
49
53
|
"$defs": {
|