@transitrix/diagrams 1.8.21 → 1.9.18

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 (175) hide show
  1. package/dist/activity-card/types.js +1 -1
  2. package/dist/agreement.d.ts +15 -0
  3. package/dist/agreement.js +61 -0
  4. package/dist/applications/index.d.ts +2 -0
  5. package/dist/applications/index.js +1 -0
  6. package/dist/applications/resolve-maturity.d.ts +16 -0
  7. package/dist/applications/resolve-maturity.js +57 -0
  8. package/dist/applications/validate.js +20 -0
  9. package/dist/capability-map/CapabilityCardNode.d.ts +1 -1
  10. package/dist/capability-map/CapabilityRootNode.d.ts +1 -1
  11. package/dist/capability-map/index.d.ts +2 -0
  12. package/dist/capability-map/index.js +1 -0
  13. package/dist/capability-map/resolve-maturity.d.ts +20 -0
  14. package/dist/capability-map/resolve-maturity.js +72 -0
  15. package/dist/capability-map/validate.js +1 -2
  16. package/dist/compliance/classify.d.ts +10 -1
  17. package/dist/compliance/classify.js +44 -2
  18. package/dist/compliance/confidence.js +1 -1
  19. package/dist/compliance/gap-report.d.ts +31 -1
  20. package/dist/compliance/gap-report.js +55 -3
  21. package/dist/compliance/html.js +14 -6
  22. package/dist/compliance/impact.js +1 -1
  23. package/dist/compliance/index.d.ts +3 -1
  24. package/dist/compliance/index.js +2 -0
  25. package/dist/compliance/markdown.js +26 -4
  26. package/dist/compliance/reverse-index.d.ts +6 -1
  27. package/dist/compliance/reverse-index.js +27 -3
  28. package/dist/compliance/trace.js +5 -1
  29. package/dist/compliance/types.d.ts +70 -0
  30. package/dist/compliance/types.js +1 -2
  31. package/dist/compliance/views.js +1 -1
  32. package/dist/compliance-matrix/types.d.ts +1 -1
  33. package/dist/compliance-matrix/types.js +1 -1
  34. package/dist/confidence/score.js +1 -1
  35. package/dist/constraint/validate.js +3 -0
  36. package/dist/edge-path.js +1 -1
  37. package/dist/factor/validate.js +2 -2
  38. package/dist/fgca/chain-table.js +1 -1
  39. package/dist/fgca/nodeTypes.d.ts +4 -4
  40. package/dist/fgca/nodes/FGCAActivityNode.d.ts +1 -1
  41. package/dist/fgca/nodes/FGCAChangeNode.d.ts +1 -1
  42. package/dist/fgca/nodes/FGCAFactorNode.d.ts +1 -1
  43. package/dist/fgca/nodes/FGCAGoalNode.d.ts +1 -1
  44. package/dist/fgca/parse-canonical.d.ts +2 -2
  45. package/dist/fgca/parse-canonical.js +2 -2
  46. package/dist/fgca/preview-layout.d.ts +1 -1
  47. package/dist/goals/GoalNode.d.ts +1 -1
  48. package/dist/goals/layout.d.ts +1 -1
  49. package/dist/goals/layout.js +1 -1
  50. package/dist/goals/parse-canonical.d.ts +1 -1
  51. package/dist/goals/parse-canonical.js +1 -1
  52. package/dist/goals/types.d.ts +1 -1
  53. package/dist/goals/validate.js +2 -2
  54. package/dist/link-suspicion.d.ts +43 -0
  55. package/dist/link-suspicion.js +156 -0
  56. package/dist/metric/index.d.ts +4 -0
  57. package/dist/metric/index.js +2 -0
  58. package/dist/metric/types.d.ts +24 -0
  59. package/dist/metric/types.js +7 -0
  60. package/dist/metric/validate.d.ts +7 -0
  61. package/dist/metric/validate.js +90 -0
  62. package/dist/need/index.d.ts +3 -0
  63. package/dist/need/index.js +1 -0
  64. package/dist/need/types.d.ts +21 -0
  65. package/dist/need/types.js +3 -0
  66. package/dist/need/validate.d.ts +7 -0
  67. package/dist/need/validate.js +60 -0
  68. package/dist/repo-validate/check-versioned-attributes.d.ts +4 -0
  69. package/dist/repo-validate/check-versioned-attributes.js +105 -0
  70. package/dist/repo-validate/validate-repo.js +3 -0
  71. package/dist/requirement/index.d.ts +2 -2
  72. package/dist/requirement/index.js +1 -1
  73. package/dist/requirement/types.d.ts +18 -0
  74. package/dist/requirement/types.js +2 -0
  75. package/dist/requirement/validate.js +22 -1
  76. package/dist/risk/index.d.ts +4 -0
  77. package/dist/risk/index.js +2 -0
  78. package/dist/risk/types.d.ts +25 -0
  79. package/dist/risk/types.js +3 -0
  80. package/dist/risk/validate.d.ts +7 -0
  81. package/dist/risk/validate.js +108 -0
  82. package/dist/schema-version.d.ts +9 -6
  83. package/dist/schema-version.js +9 -6
  84. package/dist/theme/themes.js +3 -2
  85. package/dist/validation/index.d.ts +4 -0
  86. package/dist/validation/index.js +2 -0
  87. package/dist/validation/types.d.ts +31 -0
  88. package/dist/validation/types.js +21 -0
  89. package/dist/validation/validate.d.ts +7 -0
  90. package/dist/validation/validate.js +106 -0
  91. package/dist/verification/index.d.ts +4 -0
  92. package/dist/verification/index.js +2 -0
  93. package/dist/verification/types.d.ts +31 -0
  94. package/dist/verification/types.js +12 -0
  95. package/dist/verification/validate.d.ts +7 -0
  96. package/dist/verification/validate.js +104 -0
  97. package/dist/versioned-attribute/index.d.ts +4 -0
  98. package/dist/versioned-attribute/index.js +2 -0
  99. package/dist/versioned-attribute/resolve.d.ts +15 -0
  100. package/dist/versioned-attribute/resolve.js +37 -0
  101. package/dist/versioned-attribute/types.d.ts +12 -0
  102. package/dist/versioned-attribute/types.js +6 -0
  103. package/dist/versioned-attribute/validate.d.ts +17 -0
  104. package/dist/versioned-attribute/validate.js +87 -0
  105. package/dist/webview/render-applications.d.ts +15 -1
  106. package/dist/webview/render-applications.js +7 -2
  107. package/dist/webview/render-blocks.js +6 -4
  108. package/dist/webview/render-capability-map.d.ts +16 -1
  109. package/dist/webview/render-capability-map.js +4 -1
  110. package/dist/webview/render-process.d.ts +1 -1
  111. package/dist/webview/render-process.js +5 -5
  112. package/package.json +9 -6
  113. package/src/activity-card/types.ts +1 -1
  114. package/src/agreement.ts +71 -0
  115. package/src/applications/index.ts +3 -0
  116. package/src/applications/resolve-maturity.ts +66 -0
  117. package/src/applications/validate.ts +23 -0
  118. package/src/capability-map/index.ts +7 -0
  119. package/src/capability-map/resolve-maturity.ts +84 -0
  120. package/src/capability-map/validate.ts +1 -2
  121. package/src/compliance/classify.ts +54 -3
  122. package/src/compliance/confidence.ts +1 -1
  123. package/src/compliance/gap-report.ts +91 -4
  124. package/src/compliance/html.ts +18 -6
  125. package/src/compliance/impact.ts +1 -1
  126. package/src/compliance/index.ts +6 -0
  127. package/src/compliance/markdown.ts +18 -4
  128. package/src/compliance/reverse-index.ts +35 -4
  129. package/src/compliance/trace.ts +7 -1
  130. package/src/compliance/types.ts +75 -2
  131. package/src/compliance/views.ts +1 -1
  132. package/src/compliance-matrix/types.ts +2 -2
  133. package/src/confidence/score.ts +1 -1
  134. package/src/constraint/validate.ts +4 -0
  135. package/src/edge-path.ts +1 -1
  136. package/src/factor/validate.ts +2 -2
  137. package/src/fgca/chain-table.ts +1 -1
  138. package/src/fgca/parse-canonical.ts +2 -2
  139. package/src/fgca/preview-layout.ts +1 -1
  140. package/src/goals/layout.ts +1 -1
  141. package/src/goals/parse-canonical.ts +1 -1
  142. package/src/goals/types.ts +1 -1
  143. package/src/goals/validate.ts +2 -2
  144. package/src/link-suspicion.ts +181 -0
  145. package/src/metric/index.ts +4 -0
  146. package/src/metric/types.ts +38 -0
  147. package/src/metric/validate.ts +102 -0
  148. package/src/need/index.ts +3 -0
  149. package/src/need/types.ts +31 -0
  150. package/src/need/validate.ts +71 -0
  151. package/src/repo-validate/check-versioned-attributes.ts +112 -0
  152. package/src/repo-validate/validate-repo.ts +3 -0
  153. package/src/requirement/index.ts +2 -2
  154. package/src/requirement/types.ts +25 -0
  155. package/src/requirement/validate.ts +25 -1
  156. package/src/risk/index.ts +4 -0
  157. package/src/risk/types.ts +35 -0
  158. package/src/risk/validate.ts +121 -0
  159. package/src/schema-version.ts +9 -6
  160. package/src/theme/themes.ts +3 -2
  161. package/src/validation/index.ts +4 -0
  162. package/src/validation/types.ts +57 -0
  163. package/src/validation/validate.ts +113 -0
  164. package/src/verification/index.ts +4 -0
  165. package/src/verification/types.ts +48 -0
  166. package/src/verification/validate.ts +111 -0
  167. package/src/versioned-attribute/index.ts +4 -0
  168. package/src/versioned-attribute/resolve.ts +45 -0
  169. package/src/versioned-attribute/types.ts +19 -0
  170. package/src/versioned-attribute/validate.ts +109 -0
  171. package/src/webview/render-applications.ts +25 -2
  172. package/src/webview/render-blocks.ts +8 -4
  173. package/src/webview/render-capability-map.ts +23 -1
  174. package/src/webview/render-process.ts +5 -5
  175. package/src/webview/styles.css +6 -0
@@ -5,6 +5,8 @@ export { buildGapReport } from './gap-report.js';
5
5
  export type { GapReport, GapReportOptions } from './gap-report.js';
6
6
  export { emptyCanon, ingestComplianceDoc } from './classify.js';
7
7
  export type { ComplianceCanon, ComplianceProduct, ComplianceCodexDoc } from './classify.js';
8
+ export { CLOSED_VERIFICATION_OUTCOMES } from '../verification/types.js';
9
+ export { CLOSED_VALIDATION_OUTCOMES } from '../validation/types.js';
8
10
  export { admitDocumentToCatalog, buildComplianceScan, catalogFromMap, } from './canon-catalog.js';
9
11
  export type { ComplianceScanResult, ScannedYamlDoc } from './canon-catalog.js';
10
12
  export { renderComplianceMarkdown } from './markdown.js';
@@ -16,4 +18,4 @@ export type { ImpactCell, ImpactColumn, ImpactEmptyCellLabels, ImpactFinding, Im
16
18
  export { assertionToScoringElement, complianceConfidenceHeader, requirementToScoringElement, scoreComplianceView, } from './confidence.js';
17
19
  export { parseCoverageMetricConfig, buildCoverageMatrix, collectCoverageViewResolutionFindings, } from './coverage-metric.js';
18
20
  export type { CoverageMetricConfig, CoverageMetricRegimes, CoverageMetricRegimesFilter, CoverageMetricSubjects, CoverageMetricThresholds, CoverageMatrix, CoverageRow, CoverageViewFinding, ParseCoverageMetricResult, RagStatus, } from './coverage-metric.js';
19
- export type { ComplianceIndex, ComplianceIndexInput, DeadlineStatus, IndexRequirement, IndexAssertion, LawTree, LawTreeRequirement, ProductView, ProductRequirementStatus, ObjectDetailDef, ObjectDetailInput, RequirementTrace, TraceAssertionRow, TraceElementCatalog, TraceElementRef, TraceSourceRef, } from './types.js';
21
+ export type { ComplianceIndex, ComplianceIndexInput, DeadlineStatus, IndexRequirement, IndexAssertion, IndexVerification, IndexNeed, IndexValidation, LawTree, LawTreeRequirement, ProductView, ProductRequirementStatus, ObjectDetailDef, ObjectDetailInput, RequirementTrace, TraceAssertionRow, TraceVerificationRow, TraceElementCatalog, TraceElementRef, TraceSourceRef, } from './types.js';
@@ -3,6 +3,8 @@ export { buildLawTree, buildProductView } from './views.js';
3
3
  export { buildRequirementTrace, buildTraceElementCatalog } from './trace.js';
4
4
  export { buildGapReport } from './gap-report.js';
5
5
  export { emptyCanon, ingestComplianceDoc } from './classify.js';
6
+ export { CLOSED_VERIFICATION_OUTCOMES } from '../verification/types.js';
7
+ export { CLOSED_VALIDATION_OUTCOMES } from '../validation/types.js';
6
8
  export { admitDocumentToCatalog, buildComplianceScan, catalogFromMap, } from './canon-catalog.js';
7
9
  export { renderComplianceMarkdown } from './markdown.js';
8
10
  export { renderComplianceHtml, renderImpactMatrixHtml } from './html.js';
@@ -1,4 +1,4 @@
1
- // Markdown renderers for the compliance views (vkgeorgia/strategy#84 Phase 5).
1
+ // Markdown renderers for the compliance views (Phase 5).
2
2
  // Pure string builders consumed by the `transitrix export-compliance` CLI.
3
3
  // PDF rendering lives in `html.ts` (HTML doc fed to WeasyPrint by the CLI).
4
4
  import { buildComplianceMatrix } from '../compliance-matrix/index.js';
@@ -90,10 +90,16 @@ function productMarkdown(canon, productId) {
90
90
  return out.join('\n');
91
91
  }
92
92
  function gapMarkdown(canon, today) {
93
- const index = buildComplianceIndex({ requirements: canon.requirements, assertions: canon.assertions });
93
+ const index = buildComplianceIndex({
94
+ requirements: canon.requirements,
95
+ assertions: canon.assertions,
96
+ verifications: canon.verifications,
97
+ });
94
98
  const report = buildGapReport(index, { today });
95
- const total = report.requirementsWithoutAssertions.length + report.assertionsWithoutEvidence.length + report.staleAssertions.length + report.pastDeadlineRequirements.length;
96
- const out = ['# Compliance Gap Dashboard', '', `_${total} gap(s) across 4 checks_`, ''];
99
+ const total = report.requirementsWithoutAssertions.length + report.assertionsWithoutEvidence.length
100
+ + report.staleAssertions.length + report.pastDeadlineRequirements.length
101
+ + report.requirementsWithoutVerification.length + report.requirementsWithUnresolvedVerification.length;
102
+ const out = ['# Compliance Gap Dashboard', '', `_${total} gap(s) across 6 checks_`, ''];
97
103
  out.push(`## Requirements without assertions (${report.requirementsWithoutAssertions.length})`, '');
98
104
  if (report.requirementsWithoutAssertions.length === 0)
99
105
  out.push('_✓ none_', '');
@@ -126,5 +132,21 @@ function gapMarkdown(canon, today) {
126
132
  out.push(`- [ ] \`${r.id}\` ${r.name} — deadline: ${r.deadline ?? '—'}${r.severity ? `, severity: ${r.severity}` : ''}`);
127
133
  out.push('');
128
134
  }
135
+ out.push(`## Requirements without verification — REQ-VERIF-COVERAGE-001 (${report.requirementsWithoutVerification.length})`, '');
136
+ if (report.requirementsWithoutVerification.length === 0)
137
+ out.push('_✓ none_', '');
138
+ else {
139
+ for (const r of report.requirementsWithoutVerification)
140
+ out.push(`- [ ] \`${r.id}\` ${r.name}${r.severity ? ` — severity: ${r.severity}` : ''}`);
141
+ out.push('');
142
+ }
143
+ out.push(`## Requirements with unresolved verification — REQ-VERIF-COVERAGE-002 (${report.requirementsWithUnresolvedVerification.length})`, '');
144
+ if (report.requirementsWithUnresolvedVerification.length === 0)
145
+ out.push('_✓ none_', '');
146
+ else {
147
+ for (const r of report.requirementsWithUnresolvedVerification)
148
+ out.push(`- [ ] \`${r.id}\` ${r.name}${r.severity ? ` — severity: ${r.severity}` : ''}`);
149
+ out.push('');
150
+ }
129
151
  return out.join('\n');
130
152
  }
@@ -3,6 +3,11 @@ import type { ComplianceIndex, ComplianceIndexInput } from './types.js';
3
3
  * Builds the reverse indexes used by every compliance view. Pure; the input
4
4
  * arrays are read, not mutated. Requirements with no `derived_from` simply do
5
5
  * not appear under any law; assertions are indexed by both their requirement
6
- * (`about`) and their subject.
6
+ * (`about`) and their subject; verifications are indexed by their requirement
7
+ * (`verifies`) — an independent catalogue from assertions (27-verification.md §4).
8
+ * Needs are indexed by id; requirements are additionally indexed by the NEED
9
+ * they `serves` (15-requirement.md §2.7), and validations by the NEED they
10
+ * `validate` (28-validation.md §2) — both feed the NEED-side coverage rules
11
+ * (ELEMENT_PRIMITIVES.md §9).
7
12
  */
8
13
  export declare function buildComplianceIndex(input: ComplianceIndexInput): ComplianceIndex;
@@ -1,4 +1,4 @@
1
- // Reverse-index builder (vkgeorgia/strategy#84 Phase 3).
1
+ // Reverse-index builder (Phase 3).
2
2
  function push(map, key, value) {
3
3
  const list = map.get(key);
4
4
  if (list)
@@ -10,7 +10,12 @@ function push(map, key, value) {
10
10
  * Builds the reverse indexes used by every compliance view. Pure; the input
11
11
  * arrays are read, not mutated. Requirements with no `derived_from` simply do
12
12
  * not appear under any law; assertions are indexed by both their requirement
13
- * (`about`) and their subject.
13
+ * (`about`) and their subject; verifications are indexed by their requirement
14
+ * (`verifies`) — an independent catalogue from assertions (27-verification.md §4).
15
+ * Needs are indexed by id; requirements are additionally indexed by the NEED
16
+ * they `serves` (15-requirement.md §2.7), and validations by the NEED they
17
+ * `validate` (28-validation.md §2) — both feed the NEED-side coverage rules
18
+ * (ELEMENT_PRIMITIVES.md §9).
14
19
  */
15
20
  export function buildComplianceIndex(input) {
16
21
  const requirementById = new Map();
@@ -18,16 +23,35 @@ export function buildComplianceIndex(input) {
18
23
  const assertionsByRequirement = new Map();
19
24
  const assertionsBySubject = new Map();
20
25
  const requirementsByParent = new Map();
26
+ const verificationsByRequirement = new Map();
27
+ const needById = new Map();
28
+ const requirementsByNeed = new Map();
29
+ const validationsByNeed = new Map();
21
30
  for (const r of input.requirements) {
22
31
  requirementById.set(r.id, r);
23
32
  for (const law of r.derived_from ?? [])
24
33
  push(requirementsByLaw, law, r);
25
34
  if (r.parent)
26
35
  push(requirementsByParent, r.parent, r);
36
+ if (r.serves)
37
+ push(requirementsByNeed, r.serves, r);
27
38
  }
28
39
  for (const a of input.assertions) {
29
40
  push(assertionsByRequirement, a.about, a);
30
41
  push(assertionsBySubject, a.subject, a);
31
42
  }
32
- return { requirementById, requirementsByLaw, assertionsByRequirement, assertionsBySubject, requirementsByParent };
43
+ for (const v of input.verifications ?? []) {
44
+ push(verificationsByRequirement, v.verifies, v);
45
+ }
46
+ for (const n of input.needs ?? []) {
47
+ needById.set(n.id, n);
48
+ }
49
+ for (const v of input.validations ?? []) {
50
+ push(validationsByNeed, v.validates, v);
51
+ }
52
+ return {
53
+ requirementById, requirementsByLaw, assertionsByRequirement, assertionsBySubject,
54
+ requirementsByParent, verificationsByRequirement,
55
+ needById, requirementsByNeed, validationsByNeed,
56
+ };
33
57
  }
@@ -69,9 +69,13 @@ export function buildRequirementTrace(requirementId, index, catalog, codex = [])
69
69
  subject: resolveElement(assertion.subject, catalog),
70
70
  realisedVia: (assertion.realised_via ?? []).map(rid => resolveElement(rid, catalog)),
71
71
  }));
72
+ const rawVerifications = index.verificationsByRequirement.get(requirementId) ?? [];
73
+ const verifications = [...rawVerifications]
74
+ .sort(byId)
75
+ .map(verification => ({ verification }));
72
76
  const ancestors = collectAncestors(requirement, index);
73
77
  const children = [...(index.requirementsByParent.get(requirementId) ?? [])].sort(byId);
74
- return { requirement, sources, assertions, ancestors, children };
78
+ return { requirement, sources, assertions, verifications, ancestors, children };
75
79
  }
76
80
  /**
77
81
  * Convenience: build a `TraceElementCatalog` from the scanned canon's product
@@ -1,4 +1,6 @@
1
1
  import type { AssertionStatus } from '../assertion/types.js';
2
+ import type { VerificationMethod, VerificationOutcome } from '../verification/types.js';
3
+ import type { ValidationMethod, ValidationOutcome } from '../validation/types.js';
2
4
  import type { ComplianceCodexDoc } from './classify.js';
3
5
  /** Projection of a REQUIREMENT (or CONSTRAINT) the compliance views need. */
4
6
  export interface IndexRequirement {
@@ -47,6 +49,33 @@ export interface IndexRequirement {
47
49
  * Present when the author has scheduled a review; drives `REQ-STALE-001`.
48
50
  */
49
51
  next_review_at?: string;
52
+ /**
53
+ * Typed ID of the upstream `NEED` this requirement traces to
54
+ * (15-requirement.md §2.7; `REQ-SERVES-001`). Optional, singular. Feeds
55
+ * `NEED-COVERAGE-001` (ELEMENT_PRIMITIVES.md §9) on the NEED side.
56
+ */
57
+ serves?: string;
58
+ }
59
+ /** Projection of a `NEED` element (ELEMENT_PRIMITIVES.md §7.28) the compliance
60
+ * views need — just enough to list an unaddressed / unvalidated need. */
61
+ export interface IndexNeed {
62
+ id: string;
63
+ name: string;
64
+ }
65
+ /** Projection of a `VALIDATION` claim (28-validation.md §2) the compliance
66
+ * views need — the validation-domain peer of `IndexVerification`, anchored
67
+ * on NEED instead of REQUIREMENT. */
68
+ export interface IndexValidation {
69
+ id: string;
70
+ /** Typed ID of the NEED this validation targets. */
71
+ validates: string;
72
+ method: ValidationMethod;
73
+ outcome: ValidationOutcome;
74
+ performed_at?: string;
75
+ /** Number of evidence entries — feeds the VALID-006 gap. */
76
+ evidenceCount?: number;
77
+ /** Admission date (CONTRACT §6) — feeds DQ-1 freshness decay. */
78
+ admitted_at?: string;
50
79
  }
51
80
  /**
52
81
  * Temporal status of a requirement deadline relative to today.
@@ -80,6 +109,19 @@ export interface IndexAssertion {
80
109
  /** ID or name of the party who must confirm this assertion (pending-owner state). */
81
110
  owner_to_confirm?: string;
82
111
  }
112
+ /** Projection of a VERIFICATION the compliance views need (27-verification.md §2). */
113
+ export interface IndexVerification {
114
+ id: string;
115
+ /** Typed ID of the REQUIREMENT this verification targets. */
116
+ verifies: string;
117
+ method: VerificationMethod;
118
+ outcome: VerificationOutcome;
119
+ performed_at?: string;
120
+ /** Number of evidence entries — feeds the VERIF-006 gap. */
121
+ evidenceCount?: number;
122
+ /** Admission date (CONTRACT §6) — feeds DQ-1 freshness decay. */
123
+ admitted_at?: string;
124
+ }
83
125
  /** One stage (or task) element of a business object, used as a matrix sub-column. */
84
126
  export interface ObjectDetailDef {
85
127
  id: string;
@@ -116,6 +158,12 @@ export interface ObjectDetailInput {
116
158
  export interface ComplianceIndexInput {
117
159
  requirements: IndexRequirement[];
118
160
  assertions: IndexAssertion[];
161
+ /** Optional — absent inputs (existing callers) simply index no verifications. */
162
+ verifications?: IndexVerification[];
163
+ /** Optional — absent inputs (existing callers) simply index no needs. */
164
+ needs?: IndexNeed[];
165
+ /** Optional — absent inputs (existing callers) simply index no validations. */
166
+ validations?: IndexValidation[];
119
167
  }
120
168
  /** The reverse-index — all maps are keyed by canonical id. */
121
169
  export interface ComplianceIndex {
@@ -131,6 +179,18 @@ export interface ComplianceIndex {
131
179
  * (15-requirement.md §2.4). Enables the requirement-hierarchy view.
132
180
  */
133
181
  requirementsByParent: Map<string, IndexRequirement[]>;
182
+ /** Requirement id → verifications whose `verifies` names it
183
+ * (27-verification.md §2). The engineering V&V analogue of
184
+ * `assertionsByRequirement` — the two catalogues are independent. */
185
+ verificationsByRequirement: Map<string, IndexVerification[]>;
186
+ /** NEED id → needs, keyed by their own id (single-entry lookup convenience). */
187
+ needById: Map<string, IndexNeed>;
188
+ /** NEED id → requirements whose `serves` names it (15-requirement.md §2.7).
189
+ * Feeds `NEED-COVERAGE-001`. */
190
+ requirementsByNeed: Map<string, IndexRequirement[]>;
191
+ /** NEED id → validations whose `validates` names it (28-validation.md §2).
192
+ * Feeds `NEED-VALIDATION-COVERAGE-001..002`. */
193
+ validationsByNeed: Map<string, IndexValidation[]>;
134
194
  }
135
195
  export interface LawTreeRequirement {
136
196
  requirement: IndexRequirement;
@@ -173,6 +233,12 @@ export interface TraceAssertionRow {
173
233
  /** Elements named in the assertion's `realised_via` list (may be empty). */
174
234
  realisedVia: TraceElementRef[];
175
235
  }
236
+ /** One VERIFICATION targeting the traced requirement (27-verification.md §2).
237
+ * No subject/realised_via — a verification claims a protocol was run against
238
+ * the requirement's acceptance criteria directly (16-assertion.md §4). */
239
+ export interface TraceVerificationRow {
240
+ verification: IndexVerification;
241
+ }
176
242
  /**
177
243
  * Requirement traceability + hierarchy view.
178
244
  *
@@ -194,6 +260,10 @@ export interface RequirementTrace {
194
260
  sources: TraceSourceRef[];
195
261
  /** Forward-trace via ASSERTION. Empty for CONSTRAINT elements (16-assertion.md §1) or for a REQUIREMENT with no filed assertion. */
196
262
  assertions: TraceAssertionRow[];
263
+ /** Forward-trace via VERIFICATION (27-verification.md §2). Empty for CONSTRAINT
264
+ * elements (the engineering V&V leg applies to REQUIREMENT only, same posture
265
+ * as ASSERTION) or for a REQUIREMENT with no filed verification. */
266
+ verifications: TraceVerificationRow[];
197
267
  /** Parent chain: immediate parent first, root last. Empty when the element has no `parent`. */
198
268
  ancestors: IndexRequirement[];
199
269
  /** Direct children: elements naming this one as their `parent`, id-sorted. */
@@ -1,5 +1,4 @@
1
- // Shared compliance reverse-index + derived views (vkgeorgia/strategy#84
2
- // Phase 3). The reverse-index pass (Law → Requirements, Requirement →
1
+ // Shared compliance reverse-index + derived views (Phase 3). The reverse-index pass (Law → Requirements, Requirement →
3
2
  // Assertions, Subject → Assertions) backs the single-law tree and the
4
3
  // single-product view here, and the gap dashboard in Phase 4.
5
4
  export {};
@@ -1,4 +1,4 @@
1
- // Single-law tree + single-product view builders (vkgeorgia/strategy#84 Phase 3).
1
+ // Single-law tree + single-product view builders (Phase 3).
2
2
  function byId(a, b) {
3
3
  return a.id < b.id ? -1 : a.id > b.id ? 1 : 0;
4
4
  }
@@ -81,6 +81,6 @@ export interface MatrixFilter {
81
81
  statuses?: AssertionStatus[];
82
82
  /** Keep only requirement columns whose resolved jurisdictions intersect this
83
83
  * set. Requirements with no resolved jurisdiction are filtered out when this
84
- * is non-empty (F16, epic #84). */
84
+ * is non-empty (F16). */
85
85
  jurisdictions?: string[];
86
86
  }
@@ -1,4 +1,4 @@
1
- // Compliance matrix model (vkgeorgia/strategy#84 Phase 2).
1
+ // Compliance matrix model (Phase 2).
2
2
  //
3
3
  // The matrix is Products × Requirements. Each cell is the status of the
4
4
  // (Product, Requirement) ASSERTION when one exists, or a gap when none does.
@@ -2,7 +2,7 @@
2
2
  // callers (Studio previews, DSM React) pass already-resolved element inputs
3
3
  // and a `today` reference; this module returns the per-element scores and
4
4
  // the view composite. Lives in @transitrix/diagrams so Studio and DSM share
5
- // one implementation (see vkgeorgia/strategy#159 — DQ-1).
5
+ // one implementation (DQ-1).
6
6
  /** §11.3 implicit defaults — used when the adopter omits `confidence_decay`. */
7
7
  export const IMPLICIT_DECAY_DEFAULTS = {
8
8
  fresh_days: 180,
@@ -1,6 +1,7 @@
1
1
  // CONSTRAINT validator — methodology ELEMENT_PRIMITIVES.md §7.13 (sibling to
2
2
  // 15-requirement.md). Implements CONST-001..005 for the compliance suite (#518 C4).
3
3
  import { typeOfId, isCanonicalIdOfType } from '../typed-id.js';
4
+ import { checkAgreement } from '../agreement.js';
4
5
  import { CONSTRAINT_STATUSES, CONSTRAINT_SEVERITIES } from './types.js';
5
6
  const REQUIRED_FIELDS = [
6
7
  'notation',
@@ -111,5 +112,7 @@ export function validateConstraint(input, options = {}) {
111
112
  });
112
113
  }
113
114
  }
115
+ // AGREE-001..003 — agreement axis (CONTRACT.md §6.3.1), optional; absent ⇒ agreed.
116
+ errors.push(...checkAgreement(c));
114
117
  return { valid: errors.length === 0, errors, warnings };
115
118
  }
package/dist/edge-path.js CHANGED
@@ -5,7 +5,7 @@
5
5
  // arrow reads as perpendicular to the node's vertical edge.
6
6
  //
7
7
  // Pulling the path math here (rather than duplicating it inline in each
8
- // preview) makes the configurable-curvature behaviour (vkgeorgia/strategy#76)
8
+ // preview) makes the configurable-curvature behaviour
9
9
  // unit-testable — the extension has no test harness.
10
10
  /**
11
11
  * Base handle length floor + span factors. The handle grows with both the
@@ -24,8 +24,8 @@ export function validateFactor(input, options = {}) {
24
24
  }
25
25
  const f = input;
26
26
  // FACTOR-001 — id grammar + notation tag + envelope.
27
- if (!isCanonicalIdOfType(f.id, 'FACTOR')) {
28
- errors.push({ code: 'FACTOR-001', message: `id "${String(f.id)}" must match FACTOR-[<middle>-]<INTEGER>.`, path: 'id' });
27
+ if (!isCanonicalIdOfType(f.id, 'DRIVER')) {
28
+ errors.push({ code: 'FACTOR-001', message: `id "${String(f.id)}" must match DRIVER-[<middle>-]<INTEGER>.`, path: 'id' });
29
29
  }
30
30
  if (f.notation !== 'driver') {
31
31
  errors.push({ code: 'FACTOR-001', message: 'notation must be the fixed value "driver".', path: 'notation' });
@@ -1,4 +1,4 @@
1
- // Chain-table model for the FGCA / FGA previews (vkgeorgia/strategy#137).
1
+ // Chain-table model for the FGCA / FGA previews.
2
2
  //
3
3
  // The tree/chain preview (`layoutFGCAPreview`) shows Driver → Goal → Change →
4
4
  // Activity as columns of nodes joined by edges. This module produces the
@@ -1,6 +1,6 @@
1
1
  export declare const FGCA_NODE_TYPES: {
2
- readonly fgcaDriver: import("react").MemoExoticComponent<({ data, isConnectable }: import("./nodes/FGCAFactorNode").FGCADriverNodeProps) => import("react/jsx-runtime").JSX.Element>;
3
- readonly fgcaGoal: import("react").MemoExoticComponent<({ data, isConnectable }: import("./nodes/FGCAGoalNode").FGCAGoalNodeProps) => import("react/jsx-runtime").JSX.Element>;
4
- readonly fgcaChange: import("react").MemoExoticComponent<({ data, isConnectable }: import("./nodes/FGCAChangeNode").FGCAChangeNodeProps) => import("react/jsx-runtime").JSX.Element>;
5
- readonly fgcaActivity: import("react").MemoExoticComponent<({ data, isConnectable }: import("./nodes/FGCAActivityNode").FGCAActivityNodeProps) => import("react/jsx-runtime").JSX.Element>;
2
+ readonly fgcaDriver: import("react").MemoExoticComponent<({ data, isConnectable }: import("./nodes/FGCAFactorNode").FGCADriverNodeProps) => import("react").JSX.Element>;
3
+ readonly fgcaGoal: import("react").MemoExoticComponent<({ data, isConnectable }: import("./nodes/FGCAGoalNode").FGCAGoalNodeProps) => import("react").JSX.Element>;
4
+ readonly fgcaChange: import("react").MemoExoticComponent<({ data, isConnectable }: import("./nodes/FGCAChangeNode").FGCAChangeNodeProps) => import("react").JSX.Element>;
5
+ readonly fgcaActivity: import("react").MemoExoticComponent<({ data, isConnectable }: import("./nodes/FGCAActivityNode").FGCAActivityNodeProps) => import("react").JSX.Element>;
6
6
  };
@@ -9,5 +9,5 @@ export interface FGCAActivityNodeProps {
9
9
  };
10
10
  isConnectable?: boolean;
11
11
  }
12
- declare const FGCAActivityNode: React.MemoExoticComponent<({ data, isConnectable }: FGCAActivityNodeProps) => import("react/jsx-runtime").JSX.Element>;
12
+ declare const FGCAActivityNode: React.MemoExoticComponent<({ data, isConnectable }: FGCAActivityNodeProps) => React.JSX.Element>;
13
13
  export default FGCAActivityNode;
@@ -8,5 +8,5 @@ export interface FGCAChangeNodeProps {
8
8
  };
9
9
  isConnectable?: boolean;
10
10
  }
11
- declare const FGCAChangeNode: React.MemoExoticComponent<({ data, isConnectable }: FGCAChangeNodeProps) => import("react/jsx-runtime").JSX.Element>;
11
+ declare const FGCAChangeNode: React.MemoExoticComponent<({ data, isConnectable }: FGCAChangeNodeProps) => React.JSX.Element>;
12
12
  export default FGCAChangeNode;
@@ -8,5 +8,5 @@ export interface FGCADriverNodeProps {
8
8
  };
9
9
  isConnectable?: boolean;
10
10
  }
11
- declare const FGCADriverNode: React.MemoExoticComponent<({ data, isConnectable }: FGCADriverNodeProps) => import("react/jsx-runtime").JSX.Element>;
11
+ declare const FGCADriverNode: React.MemoExoticComponent<({ data, isConnectable }: FGCADriverNodeProps) => React.JSX.Element>;
12
12
  export default FGCADriverNode;
@@ -10,5 +10,5 @@ export interface FGCAGoalNodeProps {
10
10
  };
11
11
  isConnectable?: boolean;
12
12
  }
13
- declare const FGCAGoalNode: React.MemoExoticComponent<({ data, isConnectable }: FGCAGoalNodeProps) => import("react/jsx-runtime").JSX.Element>;
13
+ declare const FGCAGoalNode: React.MemoExoticComponent<({ data, isConnectable }: FGCAGoalNodeProps) => React.JSX.Element>;
14
14
  export default FGCAGoalNode;
@@ -17,7 +17,7 @@
17
17
  * historically but the layout code only uses IDs as opaque keys, so
18
18
  * string IDs work fine.
19
19
  *
20
- * Strategy hub #63: this lives at the input boundary so the library's
20
+ * This lives at the input boundary so the library's
21
21
  * internal types (currently using DSM-API form — numeric IDs and
22
22
  * singular cross-refs) can stay where they are. A follow-up task can
23
23
  * unify the internal types with the canonical form across all sister
@@ -49,7 +49,7 @@ export interface CanonicalFGAResult extends ValidationResult {
49
49
  * FGA-001..011). The resulting internal `FGCADoc` carries `activity.goal_id`,
50
50
  * which is exactly what the renderer needs to draw goal → activity edges —
51
51
  * the field whose absence produced the "FGA nodes render, no edges" bug
52
- * (transitrix/methodology#65 / vkgeorgia/strategy#65).
52
+ * (transitrix/methodology#65).
53
53
  *
54
54
  * Lives beside `parseCanonicalFGCA` (rather than inline in the extension) so
55
55
  * the canonical FGA path is unit-testable and the library owns the single
@@ -17,7 +17,7 @@
17
17
  * historically but the layout code only uses IDs as opaque keys, so
18
18
  * string IDs work fine.
19
19
  *
20
- * Strategy hub #63: this lives at the input boundary so the library's
20
+ * This lives at the input boundary so the library's
21
21
  * internal types (currently using DSM-API form — numeric IDs and
22
22
  * singular cross-refs) can stay where they are. A follow-up task can
23
23
  * unify the internal types with the canonical form across all sister
@@ -301,7 +301,7 @@ const FGA_DOC_ID_RE = /^(FGA|DGA)(-[A-Z0-9][A-Z0-9_]*)*-\d+$/;
301
301
  * FGA-001..011). The resulting internal `FGCADoc` carries `activity.goal_id`,
302
302
  * which is exactly what the renderer needs to draw goal → activity edges —
303
303
  * the field whose absence produced the "FGA nodes render, no edges" bug
304
- * (transitrix/methodology#65 / vkgeorgia/strategy#65).
304
+ * (transitrix/methodology#65).
305
305
  *
306
306
  * Lives beside `parseCanonicalFGCA` (rather than inline in the extension) so
307
307
  * the canonical FGA path is unit-testable and the library owns the single
@@ -37,7 +37,7 @@ export interface FGCAPreviewLayoutOptions {
37
37
  colGap?: number;
38
38
  /** Vertical gap (px) between stacked nodes within a column. Default matches the historical hardcoded value. */
39
39
  rowGap?: number;
40
- /** Trim to a level cap or a single root goal (vkgeorgia/strategy#77). Defaults to 'all'. */
40
+ /** Trim to a level cap or a single root goal. Defaults to 'all'. */
41
41
  scope?: Scope;
42
42
  /** Entity node width (px). Default {@link FGCA_NODE_W}. */
43
43
  nodeWidth?: number;
@@ -15,5 +15,5 @@ export interface GoalNodeData {
15
15
  }
16
16
  declare const GoalNode: React.MemoExoticComponent<({ data }: {
17
17
  data: GoalNodeData;
18
- }) => import("react/jsx-runtime").JSX.Element>;
18
+ }) => React.JSX.Element>;
19
19
  export default GoalNode;
@@ -1,7 +1,7 @@
1
1
  import type { Goal, GoalTree, LayoutOptions, GoalTreeLayout } from './types.js';
2
2
  import type { Scope } from '../scope.js';
3
3
  /**
4
- * Trims a flat goal list to a scope (vkgeorgia/strategy#77).
4
+ * Trims a flat goal list to a scope.
5
5
  * - 'level' → goals with `level <= maxLevel`.
6
6
  * - 'root' → the root goal (matched by string id) plus all its descendants
7
7
  * via `parent_id`; an empty list when the root is absent.
@@ -4,7 +4,7 @@ const DEFAULT_NODE_HEIGHT = 80;
4
4
  const DEFAULT_RANK_SEP = 80;
5
5
  const DEFAULT_NODE_SEP = 40;
6
6
  /**
7
- * Trims a flat goal list to a scope (vkgeorgia/strategy#77).
7
+ * Trims a flat goal list to a scope.
8
8
  * - 'level' → goals with `level <= maxLevel`.
9
9
  * - 'root' → the root goal (matched by string id) plus all its descendants
10
10
  * via `parent_id`; an empty list when the root is absent.
@@ -15,7 +15,7 @@
15
15
  * mapped to internal sequential numbers, `parent: GOAL-X` becomes
16
16
  * `parent_id: <numeric>`, `parent_id: 0` denotes a root.
17
17
  *
18
- * Strategy hub #63: this lives at the input boundary so the library's
18
+ * This lives at the input boundary so the library's
19
19
  * internal types (numeric IDs) stay where they are. Convergence on
20
20
  * canonical typed-string IDs across all sister modules is a follow-up
21
21
  * task.
@@ -15,7 +15,7 @@
15
15
  * mapped to internal sequential numbers, `parent: GOAL-X` becomes
16
16
  * `parent_id: <numeric>`, `parent_id: 0` denotes a root.
17
17
  *
18
- * Strategy hub #63: this lives at the input boundary so the library's
18
+ * This lives at the input boundary so the library's
19
19
  * internal types (numeric IDs) stay where they are. Convergence on
20
20
  * canonical typed-string IDs across all sister modules is a follow-up
21
21
  * task.
@@ -44,7 +44,7 @@ export interface LayoutOptions {
44
44
  nodeSep?: number;
45
45
  hideCollapsed?: number[];
46
46
  viewDepth?: number | null;
47
- /** Trim the tree to a level cap or a subtree root (vkgeorgia/strategy#77). Defaults to 'all'. */
47
+ /** Trim the tree to a level cap or a subtree root. Defaults to 'all'. */
48
48
  scope?: Scope;
49
49
  }
50
50
  export interface LaidOutNode {
@@ -15,7 +15,7 @@ export function validateGoalTree(input) {
15
15
  return { valid: false, errors, warnings };
16
16
  const tree = raw;
17
17
  // GOALS-013 — goal_types[].level values must be contiguous starting from 0.
18
- // Per the N+1 rule (decision in vkgeorgia/strategy#66), the level set must
18
+ // Per the N+1 rule, the level set must
19
19
  // be exactly {0, 1, …, N}; a gap breaks the parent→child level invariant
20
20
  // and means GOALS-012 cannot be enforced consistently.
21
21
  const levels = tree.goal_types
@@ -84,7 +84,7 @@ export function validateGoalTree(input) {
84
84
  continue;
85
85
  }
86
86
  // GOALS-012 — parent must be exactly one level above the child (N+1
87
- // hierarchy, decision in vkgeorgia/strategy#66). Only enforced when the
87
+ // hierarchy). Only enforced when the
88
88
  // parent is resolvable; a missing parent is covered by BROKEN_PARENT_REF.
89
89
  if (g.parent_id !== 0) {
90
90
  const parentLevel = levelById.get(g.parent_id);
@@ -0,0 +1,43 @@
1
+ export declare const ENVELOPE_FIELDS: string[];
2
+ /** Every non-blank, non-comment line of the file, except those belonging to
3
+ * an `ENVELOPE_FIELDS` block (the key line and its more-indented
4
+ * continuation lines), whitespace-normalised and sorted —
5
+ * order-independent, formatting-independent, comment-independent. Not a
6
+ * general YAML parser — a flat, line-oriented pass over the already-known
7
+ * envelope field names, the same posture the methodology reference script
8
+ * takes (its own header comment cites `baseline-manifest.mjs` /
9
+ * `check-agreement.mjs` for precedent). */
10
+ export declare function statementLines(text: string): string[];
11
+ export interface LineEdit {
12
+ from: string;
13
+ to: string;
14
+ }
15
+ /** A parsed `migrations/<slug>/TRANSFORM.yaml` manifest (§16.3). */
16
+ export interface MigrationManifest {
17
+ slug: string;
18
+ mechanical: boolean;
19
+ appliesTo: string[];
20
+ lineEdits: LineEdit[];
21
+ }
22
+ /** Minimal parse of the fixed `TRANSFORM.yaml` shape — `mechanical: true`,
23
+ * `applies_to: [exact relative paths]`, `line_edits: [{from, to}]`. Not a
24
+ * general YAML parser, same posture as {@link statementLines}. */
25
+ export declare function parseMigrationManifest(text: string): Omit<MigrationManifest, 'slug'>;
26
+ export interface SuspicionResult {
27
+ suspicious: boolean;
28
+ /** True when a manifest declared `mechanical: true` for this target but
29
+ * its replay did not fully explain the change — the hatch does not
30
+ * self-grant; suspicion stands regardless of the flag (§16.3). */
31
+ hatchRefused?: boolean;
32
+ }
33
+ /**
34
+ * §16.2: *Suspicious* ⟺ the target's content identity at the anchor commit
35
+ * differs from its content identity now, **and** §16.3's hatch does not
36
+ * explain the difference.
37
+ *
38
+ * `beforeText` / `afterText` are already-fetched (git IO lives in the
39
+ * caller); `undefined` for either (no anchor, or the target no longer
40
+ * exists) means nothing to compare — not suspicious, per the reference
41
+ * script's `target-absent-at-anchor` / `target-absent-now` cases.
42
+ */
43
+ export declare function checkSuspicion(beforeText: string | undefined, afterText: string | undefined, applicableManifests?: Array<Omit<MigrationManifest, 'slug'>>): SuspicionResult;