@transitrix/diagrams 1.14.0-rc.0 → 1.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/dist/activities/action-fields.d.ts +6 -0
  2. package/dist/activities/action-fields.js +34 -0
  3. package/dist/activities/validate.d.ts +3 -1
  4. package/dist/activities/validate.js +36 -34
  5. package/dist/applications/validate.js +27 -26
  6. package/dist/capability-map/validate.d.ts +4 -1
  7. package/dist/capability-map/validate.js +32 -30
  8. package/dist/codex/validate.js +3 -3
  9. package/dist/compliance/coverage-metric.js +3 -3
  10. package/dist/compliance/impact.js +4 -4
  11. package/dist/fgca/parse-canonical.d.ts +0 -25
  12. package/dist/fgca/parse-canonical.js +16 -26
  13. package/dist/fgca/projection-origin.d.ts +2 -0
  14. package/dist/fgca/projection-origin.js +2 -0
  15. package/dist/fgca/resolver.d.ts +0 -8
  16. package/dist/fgca/resolver.js +2 -0
  17. package/dist/products/validate.js +30 -25
  18. package/dist/repo-validate/check-strategy-chain.d.ts +8 -2
  19. package/dist/repo-validate/check-strategy-chain.js +64 -64
  20. package/dist/repo-validate/types.d.ts +2 -0
  21. package/dist/repo-validate/validate-repo.js +2 -0
  22. package/dist/risk/index.d.ts +1 -1
  23. package/dist/risk/types.d.ts +8 -1
  24. package/dist/risk/validate.js +19 -4
  25. package/dist/scenarios/validate.js +4 -0
  26. package/dist/schema-finding.d.ts +3 -0
  27. package/dist/schema-finding.js +6 -0
  28. package/dist/webview/entry.js +7 -2
  29. package/dist/webview/render-goals.js +2 -1
  30. package/package.json +1 -1
  31. package/src/activities/action-fields.ts +31 -0
  32. package/src/activities/validate.ts +37 -34
  33. package/src/applications/validate.ts +27 -26
  34. package/src/capability-map/validate.ts +33 -29
  35. package/src/codex/validate.ts +3 -3
  36. package/src/compliance/coverage-metric.ts +3 -3
  37. package/src/compliance/impact.ts +4 -4
  38. package/src/fgca/parse-canonical.ts +14 -1
  39. package/src/fgca/projection-origin.ts +2 -0
  40. package/src/fgca/resolver.ts +2 -0
  41. package/src/products/validate.ts +31 -25
  42. package/src/repo-validate/check-strategy-chain.ts +69 -64
  43. package/src/repo-validate/types.ts +2 -0
  44. package/src/repo-validate/validate-repo.ts +2 -0
  45. package/src/risk/index.ts +1 -1
  46. package/src/risk/types.ts +9 -1
  47. package/src/risk/validate.ts +19 -5
  48. package/src/scenarios/validate.ts +5 -0
  49. package/src/schema-finding.ts +8 -0
  50. package/src/webview/entry.ts +6 -2
  51. package/src/webview/render-goals.ts +2 -1
  52. package/src/webview/styles.css +8 -0
@@ -0,0 +1,8 @@
1
+ import type { ValidationError } from './validation-types.js';
2
+
3
+ /** Shared schema identity; callers supply the owning form and exact field. */
4
+ export function schemaFinding(form: string, path: string, expected: string, actual: unknown): ValidationError {
5
+ const type = actual === null ? 'null' : Array.isArray(actual) ? 'array' : typeof actual;
6
+ return { code: 'SCHEMA_INVALID', path,
7
+ message: `${form} field '${path}': expected ${expected}; actual ${type} (${String(actual)}).` };
8
+ }
@@ -275,10 +275,14 @@ function dispatchValidate(kind: NotationKind, doc: unknown): RenderResult {
275
275
  return renderFromValidation('scenarios', validateScenario(doc), () =>
276
276
  renderScenarioHtml((doc as ScenarioFile).scenario),
277
277
  );
278
- case 'capability-map':
279
- return renderFromValidation('capability-map', validateCapabilityMap(doc), () =>
278
+ case 'capability-map': {
279
+ const validation = validateCapabilityMap(doc);
280
+ const unresolved = validation.warnings.find(w => w.code === 'NOTATION-SKIP-001');
281
+ if (validation.valid && unresolved) return errorResult('capability-map', unresolved.code, unresolved.message);
282
+ return renderFromValidation('capability-map', validation, () =>
280
283
  renderCapabilityMapHtml((doc as CapabilityMapFile).capability_map),
281
284
  );
285
+ }
282
286
  default:
283
287
  return errorResult(
284
288
  kind,
@@ -56,7 +56,8 @@ export function renderGoalsSvg(tree: GoalTree, options: RenderGoalsOptions = {})
56
56
  ? `<text class="text-header" x="${PAD}" y="${PAD - 6}">${escXml(`Goal tree — ${treeName}`)}</text>`
57
57
  : '';
58
58
 
59
- return renderGoalsLayoutSvg(layout, { curvature, entryCurvature, edgeStyle, title, embedCssTheme: 'transitrix' });
59
+ // Reserve a separate header row; the theme centers text on its y coordinate.
60
+ return renderGoalsLayoutSvg(layout, { curvature, entryCurvature, edgeStyle, title, topInset: title ? PAD : 0, embedCssTheme: 'transitrix' });
60
61
  }
61
62
 
62
63
  export interface RenderGoalsLayoutOptions {
@@ -70,6 +70,14 @@ body {
70
70
  margin-left: 6px;
71
71
  }
72
72
 
73
+ /* The bundled SVG renderer uses its light palette independently of IDE chrome.
74
+ * Give transparent SVG titles and edges a matching canvas. */
75
+ .tx-svg-host {
76
+ background: #ffffff;
77
+ color: #0d2b35;
78
+ min-height: calc(100vh - 24px);
79
+ }
80
+
73
81
  .tx-svg-host svg {
74
82
  max-width: 100%;
75
83
  height: auto;