@transitrix/diagrams 1.8.21 → 1.10.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/activity-card/types.js +1 -1
- package/dist/agreement.d.ts +15 -0
- package/dist/agreement.js +61 -0
- package/dist/applications/index.d.ts +2 -0
- package/dist/applications/index.js +1 -0
- package/dist/applications/resolve-maturity.d.ts +16 -0
- package/dist/applications/resolve-maturity.js +57 -0
- package/dist/applications/validate.js +20 -0
- package/dist/capability-map/CapabilityCardNode.d.ts +1 -1
- package/dist/capability-map/CapabilityRootNode.d.ts +1 -1
- package/dist/capability-map/index.d.ts +2 -0
- package/dist/capability-map/index.js +1 -0
- package/dist/capability-map/resolve-maturity.d.ts +20 -0
- package/dist/capability-map/resolve-maturity.js +72 -0
- package/dist/capability-map/validate.js +1 -2
- package/dist/codex/index.d.ts +1 -1
- package/dist/codex/index.js +1 -1
- package/dist/codex/types.d.ts +9 -2
- package/dist/codex/types.js +10 -3
- package/dist/codex/validate.js +29 -3
- package/dist/compliance/classify.d.ts +21 -2
- package/dist/compliance/classify.js +68 -13
- package/dist/compliance/confidence.js +1 -1
- package/dist/compliance/gap-report.d.ts +31 -1
- package/dist/compliance/gap-report.js +55 -3
- package/dist/compliance/html.js +14 -6
- package/dist/compliance/impact.js +1 -1
- package/dist/compliance/index.d.ts +3 -1
- package/dist/compliance/index.js +2 -0
- package/dist/compliance/markdown.js +26 -4
- package/dist/compliance/reverse-index.d.ts +6 -1
- package/dist/compliance/reverse-index.js +27 -3
- package/dist/compliance/trace.js +5 -1
- package/dist/compliance/types.d.ts +70 -0
- package/dist/compliance/types.js +1 -2
- package/dist/compliance/views.js +1 -1
- package/dist/compliance-matrix/build.js +0 -0
- package/dist/compliance-matrix/types.d.ts +1 -1
- package/dist/compliance-matrix/types.js +1 -1
- package/dist/confidence/score.js +1 -1
- package/dist/constraint/validate.js +3 -0
- package/dist/edge-path.js +1 -1
- package/dist/factor/validate.js +2 -2
- package/dist/fgca/chain-table.js +1 -1
- package/dist/fgca/nodeTypes.d.ts +4 -4
- package/dist/fgca/nodes/FGCAActivityNode.d.ts +1 -1
- package/dist/fgca/nodes/FGCAChangeNode.d.ts +1 -1
- package/dist/fgca/nodes/FGCAFactorNode.d.ts +1 -1
- package/dist/fgca/nodes/FGCAGoalNode.d.ts +1 -1
- package/dist/fgca/parse-canonical.d.ts +2 -2
- package/dist/fgca/parse-canonical.js +2 -2
- package/dist/fgca/preview-layout.d.ts +1 -1
- package/dist/goals/GoalNode.d.ts +1 -1
- package/dist/goals/layout.d.ts +1 -1
- package/dist/goals/layout.js +1 -1
- package/dist/goals/parse-canonical.d.ts +1 -1
- package/dist/goals/parse-canonical.js +1 -1
- package/dist/goals/types.d.ts +1 -1
- package/dist/goals/validate.js +2 -2
- package/dist/link-suspicion.d.ts +43 -0
- package/dist/link-suspicion.js +156 -0
- package/dist/metric/index.d.ts +4 -0
- package/dist/metric/index.js +2 -0
- package/dist/metric/types.d.ts +24 -0
- package/dist/metric/types.js +7 -0
- package/dist/metric/validate.d.ts +7 -0
- package/dist/metric/validate.js +90 -0
- package/dist/need/index.d.ts +3 -0
- package/dist/need/index.js +1 -0
- package/dist/need/types.d.ts +21 -0
- package/dist/need/types.js +3 -0
- package/dist/need/validate.d.ts +7 -0
- package/dist/need/validate.js +60 -0
- package/dist/repo-validate/check-candidate-fields.d.ts +6 -0
- package/dist/repo-validate/check-candidate-fields.js +87 -0
- package/dist/repo-validate/check-versioned-attributes.d.ts +4 -0
- package/dist/repo-validate/check-versioned-attributes.js +105 -0
- package/dist/repo-validate/validate-repo.js +7 -0
- package/dist/requirement/index.d.ts +2 -2
- package/dist/requirement/index.js +1 -1
- package/dist/requirement/types.d.ts +19 -1
- package/dist/requirement/types.js +3 -1
- package/dist/requirement/validate.js +22 -1
- package/dist/risk/index.d.ts +4 -0
- package/dist/risk/index.js +2 -0
- package/dist/risk/types.d.ts +25 -0
- package/dist/risk/types.js +3 -0
- package/dist/risk/validate.d.ts +7 -0
- package/dist/risk/validate.js +108 -0
- package/dist/schema-version.d.ts +9 -6
- package/dist/schema-version.js +9 -6
- package/dist/theme/themes.js +3 -2
- package/dist/validation/index.d.ts +4 -0
- package/dist/validation/index.js +2 -0
- package/dist/validation/types.d.ts +31 -0
- package/dist/validation/types.js +21 -0
- package/dist/validation/validate.d.ts +7 -0
- package/dist/validation/validate.js +106 -0
- package/dist/verification/index.d.ts +4 -0
- package/dist/verification/index.js +2 -0
- package/dist/verification/types.d.ts +31 -0
- package/dist/verification/types.js +12 -0
- package/dist/verification/validate.d.ts +7 -0
- package/dist/verification/validate.js +104 -0
- package/dist/versioned-attribute/index.d.ts +4 -0
- package/dist/versioned-attribute/index.js +2 -0
- package/dist/versioned-attribute/resolve.d.ts +15 -0
- package/dist/versioned-attribute/resolve.js +37 -0
- package/dist/versioned-attribute/types.d.ts +12 -0
- package/dist/versioned-attribute/types.js +6 -0
- package/dist/versioned-attribute/validate.d.ts +17 -0
- package/dist/versioned-attribute/validate.js +87 -0
- package/dist/webview/entry.js +11 -4
- package/dist/webview/render-applications.d.ts +15 -1
- package/dist/webview/render-applications.js +7 -2
- package/dist/webview/render-blocks.js +6 -4
- package/dist/webview/render-capability-map.d.ts +16 -1
- package/dist/webview/render-capability-map.js +4 -1
- package/dist/webview/render-process.d.ts +1 -1
- package/dist/webview/render-process.js +5 -5
- package/package.json +9 -6
- package/src/activity-card/types.ts +1 -1
- package/src/agreement.ts +71 -0
- package/src/applications/index.ts +3 -0
- package/src/applications/resolve-maturity.ts +66 -0
- package/src/applications/validate.ts +23 -0
- package/src/capability-map/index.ts +7 -0
- package/src/capability-map/resolve-maturity.ts +84 -0
- package/src/capability-map/validate.ts +1 -2
- package/src/codex/index.ts +1 -1
- package/src/codex/types.ts +11 -3
- package/src/codex/validate.ts +30 -2
- package/src/compliance/classify.ts +87 -14
- package/src/compliance/confidence.ts +1 -1
- package/src/compliance/gap-report.ts +91 -4
- package/src/compliance/html.ts +18 -6
- package/src/compliance/impact.ts +1 -1
- package/src/compliance/index.ts +6 -0
- package/src/compliance/markdown.ts +18 -4
- package/src/compliance/reverse-index.ts +35 -4
- package/src/compliance/trace.ts +7 -1
- package/src/compliance/types.ts +75 -2
- package/src/compliance/views.ts +1 -1
- package/src/compliance-matrix/build.ts +0 -0
- package/src/compliance-matrix/types.ts +2 -2
- package/src/confidence/score.ts +1 -1
- package/src/constraint/validate.ts +4 -0
- package/src/edge-path.ts +1 -1
- package/src/factor/validate.ts +2 -2
- package/src/fgca/chain-table.ts +1 -1
- package/src/fgca/parse-canonical.ts +2 -2
- package/src/fgca/preview-layout.ts +1 -1
- package/src/goals/layout.ts +1 -1
- package/src/goals/parse-canonical.ts +1 -1
- package/src/goals/types.ts +1 -1
- package/src/goals/validate.ts +2 -2
- package/src/link-suspicion.ts +181 -0
- package/src/metric/index.ts +4 -0
- package/src/metric/types.ts +38 -0
- package/src/metric/validate.ts +102 -0
- package/src/need/index.ts +3 -0
- package/src/need/types.ts +31 -0
- package/src/need/validate.ts +71 -0
- package/src/repo-validate/check-candidate-fields.ts +93 -0
- package/src/repo-validate/check-versioned-attributes.ts +112 -0
- package/src/repo-validate/validate-repo.ts +7 -0
- package/src/requirement/index.ts +2 -2
- package/src/requirement/types.ts +26 -1
- package/src/requirement/validate.ts +25 -1
- package/src/risk/index.ts +4 -0
- package/src/risk/types.ts +35 -0
- package/src/risk/validate.ts +121 -0
- package/src/schema-version.ts +9 -6
- package/src/theme/themes.ts +3 -2
- package/src/validation/index.ts +4 -0
- package/src/validation/types.ts +57 -0
- package/src/validation/validate.ts +113 -0
- package/src/verification/index.ts +4 -0
- package/src/verification/types.ts +48 -0
- package/src/verification/validate.ts +111 -0
- package/src/versioned-attribute/index.ts +4 -0
- package/src/versioned-attribute/resolve.ts +45 -0
- package/src/versioned-attribute/types.ts +19 -0
- package/src/versioned-attribute/validate.ts +109 -0
- package/src/webview/entry.ts +13 -6
- package/src/webview/render-applications.ts +25 -2
- package/src/webview/render-blocks.ts +8 -4
- package/src/webview/render-capability-map.ts +23 -1
- package/src/webview/render-process.ts +5 -5
- package/src/webview/styles.css +6 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ComplianceIndex, IndexAssertion, IndexRequirement } from './types.js';
|
|
1
|
+
import type { ComplianceIndex, IndexAssertion, IndexRequirement, IndexNeed } from './types.js';
|
|
2
2
|
export interface GapReport {
|
|
3
3
|
/** Requirements with no assertion about them, severity-sorted then id. */
|
|
4
4
|
requirementsWithoutAssertions: IndexRequirement[];
|
|
@@ -12,6 +12,36 @@ export interface GapReport {
|
|
|
12
12
|
* (oldest first). Empty when `today` is not supplied.
|
|
13
13
|
*/
|
|
14
14
|
pastDeadlineRequirements: IndexRequirement[];
|
|
15
|
+
/**
|
|
16
|
+
* REQ-VERIF-COVERAGE-001: requirements with no VERIFICATION targeting them,
|
|
17
|
+
* severity-sorted then id — the engineering V&V analogue of
|
|
18
|
+
* `requirementsWithoutAssertions`.
|
|
19
|
+
*/
|
|
20
|
+
requirementsWithoutVerification: IndexRequirement[];
|
|
21
|
+
/**
|
|
22
|
+
* REQ-VERIF-COVERAGE-002: requirements with one or more VERIFICATIONs
|
|
23
|
+
* targeting them, but none closed (`pass`/`fail`) — every one is still
|
|
24
|
+
* `not_yet_run`/`inconclusive`. Severity-sorted then id.
|
|
25
|
+
*/
|
|
26
|
+
requirementsWithUnresolvedVerification: IndexRequirement[];
|
|
27
|
+
/**
|
|
28
|
+
* NEED-COVERAGE-001: needs with no REQUIREMENT whose `serves` names them —
|
|
29
|
+
* the NEED-side analogue of `requirementsWithoutAssertions`, id-sorted.
|
|
30
|
+
*/
|
|
31
|
+
needsWithoutRequirements: IndexNeed[];
|
|
32
|
+
/**
|
|
33
|
+
* NEED-VALIDATION-COVERAGE-001: needs with no VALIDATION targeting them,
|
|
34
|
+
* id-sorted — the validation-side analogue of
|
|
35
|
+
* `requirementsWithoutVerification`.
|
|
36
|
+
*/
|
|
37
|
+
needsWithoutValidation: IndexNeed[];
|
|
38
|
+
/**
|
|
39
|
+
* NEED-VALIDATION-COVERAGE-002: needs with one or more VALIDATIONs
|
|
40
|
+
* targeting them, but none closed (`pass`/`fail`) — every one is still
|
|
41
|
+
* `not_yet_run`/`inconclusive`. Mutually exclusive with
|
|
42
|
+
* `needsWithoutValidation` by construction. Id-sorted.
|
|
43
|
+
*/
|
|
44
|
+
needsWithUnresolvedValidation: IndexNeed[];
|
|
15
45
|
}
|
|
16
46
|
export interface GapReportOptions {
|
|
17
47
|
/** Today as ISO `YYYY-MM-DD`; required for the stale-assertion list. */
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
// Gap dashboard report (
|
|
1
|
+
// Gap dashboard report (Phase 4 / CV-5; REQ-VERIF-COVERAGE-001/002 per
|
|
2
|
+
// 15-requirement.md §4).
|
|
2
3
|
//
|
|
3
|
-
//
|
|
4
|
+
// Operational gap lists computed from the shared reverse-index (Phase 3):
|
|
4
5
|
// 1. Requirements with no Assertion targeting them (severity-sorted).
|
|
5
6
|
// 2. Assertions without evidence — the ASSERT-007 case: status ∈
|
|
6
7
|
// {compliant, partial} AND no evidence. `under_review` / `non_compliant` /
|
|
@@ -9,7 +10,16 @@
|
|
|
9
10
|
// 3. Stale Assertions — the ASSERT-008 case: `next_review_at` is in the past.
|
|
10
11
|
// 4. Past-deadline requirements (CV-5) — REQUIREMENT.deadline < today AND
|
|
11
12
|
// the requirement has no fully-compliant assertion. Deadline-missed gaps.
|
|
13
|
+
// 5. Requirements with no Verification targeting them — REQ-VERIF-COVERAGE-001
|
|
14
|
+
// (27-verification.md §5 / 15-requirement.md §4). Independent of #1 — the
|
|
15
|
+
// ASSERTION and VERIFICATION catalogues never disagree with each other by
|
|
16
|
+
// construction; a requirement may have one, both, or neither.
|
|
17
|
+
// 6. Requirements whose verifications exist but never closed — every one is
|
|
18
|
+
// still `not_yet_run` / `inconclusive` — REQ-VERIF-COVERAGE-002. Mutually
|
|
19
|
+
// exclusive with #5 by construction.
|
|
12
20
|
import { computeDeadlineStatus } from './impact.js';
|
|
21
|
+
import { CLOSED_VERIFICATION_OUTCOMES } from '../verification/types.js';
|
|
22
|
+
import { CLOSED_VALIDATION_OUTCOMES } from '../validation/types.js';
|
|
13
23
|
const SEVERITY_RANK = { high: 0, medium: 1, low: 2 };
|
|
14
24
|
function severityRank(s) {
|
|
15
25
|
return s !== undefined && s in SEVERITY_RANK ? SEVERITY_RANK[s] : 3;
|
|
@@ -60,5 +70,47 @@ export function buildGapReport(index, options = {}) {
|
|
|
60
70
|
return da < db ? -1 : da > db ? 1 : a.id < b.id ? -1 : 1;
|
|
61
71
|
})
|
|
62
72
|
: [];
|
|
63
|
-
|
|
73
|
+
// REQ-VERIF-COVERAGE-001 — no VERIFICATION targets the requirement at all.
|
|
74
|
+
const requirementsWithoutVerification = [...index.requirementById.values()]
|
|
75
|
+
.filter(r => (index.verificationsByRequirement.get(r.id) ?? []).length === 0)
|
|
76
|
+
.sort((a, b) => {
|
|
77
|
+
const d = severityRank(a.severity) - severityRank(b.severity);
|
|
78
|
+
return d !== 0 ? d : a.id < b.id ? -1 : a.id > b.id ? 1 : 0;
|
|
79
|
+
});
|
|
80
|
+
// REQ-VERIF-COVERAGE-002 — has verifications, but none closed (pass/fail).
|
|
81
|
+
// Mutually exclusive with -001 by construction (only requirements with at
|
|
82
|
+
// least one verification are considered here).
|
|
83
|
+
const requirementsWithUnresolvedVerification = [...index.requirementById.values()]
|
|
84
|
+
.filter(r => {
|
|
85
|
+
const verifications = index.verificationsByRequirement.get(r.id) ?? [];
|
|
86
|
+
return verifications.length > 0
|
|
87
|
+
&& !verifications.some(v => CLOSED_VERIFICATION_OUTCOMES.includes(v.outcome));
|
|
88
|
+
})
|
|
89
|
+
.sort((a, b) => {
|
|
90
|
+
const d = severityRank(a.severity) - severityRank(b.severity);
|
|
91
|
+
return d !== 0 ? d : a.id < b.id ? -1 : a.id > b.id ? 1 : 0;
|
|
92
|
+
});
|
|
93
|
+
// NEED-COVERAGE-001 — no REQUIREMENT.serves names this need.
|
|
94
|
+
const needsWithoutRequirements = [...index.needById.values()]
|
|
95
|
+
.filter(n => (index.requirementsByNeed.get(n.id) ?? []).length === 0)
|
|
96
|
+
.sort((a, b) => (a.id < b.id ? -1 : a.id > b.id ? 1 : 0));
|
|
97
|
+
// NEED-VALIDATION-COVERAGE-001 — no VALIDATION targets the need at all.
|
|
98
|
+
const needsWithoutValidation = [...index.needById.values()]
|
|
99
|
+
.filter(n => (index.validationsByNeed.get(n.id) ?? []).length === 0)
|
|
100
|
+
.sort((a, b) => (a.id < b.id ? -1 : a.id > b.id ? 1 : 0));
|
|
101
|
+
// NEED-VALIDATION-COVERAGE-002 — has validations, but none closed (pass/fail).
|
|
102
|
+
// Mutually exclusive with -001 by construction (only needs with at least
|
|
103
|
+
// one validation are considered here).
|
|
104
|
+
const needsWithUnresolvedValidation = [...index.needById.values()]
|
|
105
|
+
.filter(n => {
|
|
106
|
+
const validations = index.validationsByNeed.get(n.id) ?? [];
|
|
107
|
+
return validations.length > 0
|
|
108
|
+
&& !validations.some(v => CLOSED_VALIDATION_OUTCOMES.includes(v.outcome));
|
|
109
|
+
})
|
|
110
|
+
.sort((a, b) => (a.id < b.id ? -1 : a.id > b.id ? 1 : 0));
|
|
111
|
+
return {
|
|
112
|
+
requirementsWithoutAssertions, assertionsWithoutEvidence, staleAssertions, pastDeadlineRequirements,
|
|
113
|
+
requirementsWithoutVerification, requirementsWithUnresolvedVerification,
|
|
114
|
+
needsWithoutRequirements, needsWithoutValidation, needsWithUnresolvedValidation,
|
|
115
|
+
};
|
|
64
116
|
}
|
package/dist/compliance/html.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// HTML renderers for the compliance views (
|
|
1
|
+
// HTML renderers for the compliance views (Phase 5,
|
|
2
2
|
// PDF follow-on). Pure string builders — fed to WeasyPrint by the
|
|
3
3
|
// `transitrix export-compliance --format pdf` path in src/export-compliance.ts.
|
|
4
4
|
//
|
|
@@ -163,11 +163,13 @@ export function renderComplianceHtml(canon, scope, options = {}) {
|
|
|
163
163
|
return htmlDoc(title, options.today, `${summary}<table><thead>${head}</thead><tbody>${rows}</tbody></table>`);
|
|
164
164
|
}
|
|
165
165
|
case 'gap': {
|
|
166
|
-
const index = buildComplianceIndex({
|
|
166
|
+
const index = buildComplianceIndex({
|
|
167
|
+
requirements: canon.requirements,
|
|
168
|
+
assertions: canon.assertions,
|
|
169
|
+
verifications: canon.verifications,
|
|
170
|
+
});
|
|
167
171
|
const report = buildGapReport(index, { today: options.today });
|
|
168
172
|
const title = options.title ?? 'Compliance Gap Dashboard';
|
|
169
|
-
const total = report.requirementsWithoutAssertions.length + report.assertionsWithoutEvidence.length + report.staleAssertions.length;
|
|
170
|
-
const summary = `<p class="cmp-summary">${total} gap(s)</p>`;
|
|
171
173
|
const section = (heading, count, items) => {
|
|
172
174
|
const body = items.length === 0
|
|
173
175
|
? '<p class="cmp-ok">✓ none</p>'
|
|
@@ -178,13 +180,19 @@ export function renderComplianceHtml(canon, scope, options = {}) {
|
|
|
178
180
|
const noEvidence = report.assertionsWithoutEvidence.map(a => (`<li><code>${escHtml(a.id)}</code> <span class="cmp-meta">about <code>${escHtml(a.about)}</code>, subject <code>${escHtml(a.subject)}</code>, status ${escHtml(a.status)}</span></li>`));
|
|
179
181
|
const stale = report.staleAssertions.map(a => (`<li><code>${escHtml(a.id)}</code> <span class="cmp-meta">review due ${a.next_review_at ? escHtml(a.next_review_at) : '—'}, subject <code>${escHtml(a.subject)}</code></span></li>`));
|
|
180
182
|
const pastDl = report.pastDeadlineRequirements.map(r => (`<li><code>${escHtml(r.id)}</code> ${escHtml(r.name)} <span class="cmp-meta">deadline ${r.deadline ? escHtml(r.deadline) : '—'}${r.severity ? `, severity ${escHtml(r.severity)}` : ''}</span></li>`));
|
|
181
|
-
const
|
|
183
|
+
const noVerif = report.requirementsWithoutVerification.map(r => (`<li><code>${escHtml(r.id)}</code> ${escHtml(r.name)}${r.severity ? ` <span class="cmp-meta">severity ${escHtml(r.severity)}</span>` : ''}</li>`));
|
|
184
|
+
const unresolvedVerif = report.requirementsWithUnresolvedVerification.map(r => (`<li><code>${escHtml(r.id)}</code> ${escHtml(r.name)}${r.severity ? ` <span class="cmp-meta">severity ${escHtml(r.severity)}</span>` : ''}</li>`));
|
|
185
|
+
const total6 = report.requirementsWithoutAssertions.length + report.assertionsWithoutEvidence.length
|
|
186
|
+
+ report.staleAssertions.length + report.pastDeadlineRequirements.length
|
|
187
|
+
+ report.requirementsWithoutVerification.length + report.requirementsWithUnresolvedVerification.length;
|
|
182
188
|
const body = [
|
|
183
|
-
`<p class="cmp-summary">${
|
|
189
|
+
`<p class="cmp-summary">${total6} gap(s) across 6 checks</p>`,
|
|
184
190
|
section('Requirements without assertions', report.requirementsWithoutAssertions.length, reqs),
|
|
185
191
|
section('Assertions without evidence — ASSERT-007', report.assertionsWithoutEvidence.length, noEvidence),
|
|
186
192
|
section('Stale assertions — ASSERT-008', report.staleAssertions.length, stale),
|
|
187
193
|
section('Past-deadline requirements (CV-5)', report.pastDeadlineRequirements.length, pastDl),
|
|
194
|
+
section('Requirements without verification — REQ-VERIF-COVERAGE-001', report.requirementsWithoutVerification.length, noVerif),
|
|
195
|
+
section('Requirements with unresolved verification — REQ-VERIF-COVERAGE-002', report.requirementsWithUnresolvedVerification.length, unresolvedVerif),
|
|
188
196
|
].join('');
|
|
189
197
|
return htmlDoc(title, options.today, body);
|
|
190
198
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Compliance-impact matrix derivation + markdown renderer
|
|
2
|
-
// (
|
|
2
|
+
// (interim renderer; CV-1 view-config wiring
|
|
3
3
|
// per strategy#84 decomposition refresh).
|
|
4
4
|
//
|
|
5
5
|
// Implements the render contract from
|
|
@@ -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';
|
package/dist/compliance/index.js
CHANGED
|
@@ -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 (
|
|
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({
|
|
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
|
|
96
|
-
|
|
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 (
|
|
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
|
-
|
|
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
|
}
|
package/dist/compliance/trace.js
CHANGED
|
@@ -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. */
|
package/dist/compliance/types.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
// Shared compliance reverse-index + derived views (
|
|
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 {};
|
package/dist/compliance/views.js
CHANGED
|
Binary file
|
|
@@ -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
|
|
84
|
+
* is non-empty (F16). */
|
|
85
85
|
jurisdictions?: string[];
|
|
86
86
|
}
|
package/dist/confidence/score.js
CHANGED
|
@@ -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 (
|
|
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
|
|
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
|
package/dist/factor/validate.js
CHANGED
|
@@ -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, '
|
|
28
|
-
errors.push({ code: 'FACTOR-001', message: `id "${String(f.id)}" must match
|
|
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' });
|
package/dist/fgca/chain-table.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Chain-table model for the FGCA / FGA previews
|
|
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
|
package/dist/fgca/nodeTypes.d.ts
CHANGED
|
@@ -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
|
|
3
|
-
readonly fgcaGoal: import("react").MemoExoticComponent<({ data, isConnectable }: import("./nodes/FGCAGoalNode").FGCAGoalNodeProps) => import("react
|
|
4
|
-
readonly fgcaChange: import("react").MemoExoticComponent<({ data, isConnectable }: import("./nodes/FGCAChangeNode").FGCAChangeNodeProps) => import("react
|
|
5
|
-
readonly fgcaActivity: import("react").MemoExoticComponent<({ data, isConnectable }: import("./nodes/FGCAActivityNode").FGCAActivityNodeProps) => import("react
|
|
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) =>
|
|
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) =>
|
|
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) =>
|
|
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) =>
|
|
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
|
-
*
|
|
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
|
|
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
|
-
*
|
|
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
|
|
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
|