@beehexa/hexasync-template-validate 2608.15.1 → 2608.20.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 (121) hide show
  1. package/package.json +6 -6
  2. package/dist/index.d.ts +0 -39
  3. package/dist/index.d.ts.map +0 -1
  4. package/dist/index.js +0 -39
  5. package/dist/index.js.map +0 -1
  6. package/dist/validate/agentAnswers.d.ts +0 -48
  7. package/dist/validate/agentAnswers.d.ts.map +0 -1
  8. package/dist/validate/agentAnswers.js +0 -84
  9. package/dist/validate/agentAnswers.js.map +0 -1
  10. package/dist/validate/agentTools.d.ts +0 -37
  11. package/dist/validate/agentTools.d.ts.map +0 -1
  12. package/dist/validate/agentTools.js +0 -141
  13. package/dist/validate/agentTools.js.map +0 -1
  14. package/dist/validate/buildValidationModel.d.ts +0 -31
  15. package/dist/validate/buildValidationModel.d.ts.map +0 -1
  16. package/dist/validate/buildValidationModel.js +0 -68
  17. package/dist/validate/buildValidationModel.js.map +0 -1
  18. package/dist/validate/context.d.ts +0 -108
  19. package/dist/validate/context.d.ts.map +0 -1
  20. package/dist/validate/context.js +0 -95
  21. package/dist/validate/context.js.map +0 -1
  22. package/dist/validate/contextFromGraph.d.ts +0 -68
  23. package/dist/validate/contextFromGraph.d.ts.map +0 -1
  24. package/dist/validate/contextFromGraph.js +0 -81
  25. package/dist/validate/contextFromGraph.js.map +0 -1
  26. package/dist/validate/harvestPullerTaskIds.d.ts +0 -60
  27. package/dist/validate/harvestPullerTaskIds.d.ts.map +0 -1
  28. package/dist/validate/harvestPullerTaskIds.js +0 -116
  29. package/dist/validate/harvestPullerTaskIds.js.map +0 -1
  30. package/dist/validate/model.d.ts +0 -14
  31. package/dist/validate/model.d.ts.map +0 -1
  32. package/dist/validate/model.js +0 -97
  33. package/dist/validate/model.js.map +0 -1
  34. package/dist/validate/registry.d.ts +0 -24
  35. package/dist/validate/registry.d.ts.map +0 -1
  36. package/dist/validate/registry.js +0 -101
  37. package/dist/validate/registry.js.map +0 -1
  38. package/dist/validate/retrieve.d.ts +0 -125
  39. package/dist/validate/retrieve.d.ts.map +0 -1
  40. package/dist/validate/retrieve.js +0 -272
  41. package/dist/validate/retrieve.js.map +0 -1
  42. package/dist/validate/rule.d.ts +0 -18
  43. package/dist/validate/rule.d.ts.map +0 -1
  44. package/dist/validate/rule.js +0 -2
  45. package/dist/validate/rule.js.map +0 -1
  46. package/dist/validate/ruleCatalog.d.ts +0 -22
  47. package/dist/validate/ruleCatalog.d.ts.map +0 -1
  48. package/dist/validate/ruleCatalog.js +0 -473
  49. package/dist/validate/ruleCatalog.js.map +0 -1
  50. package/dist/validate/rules/apiShape.d.ts +0 -51
  51. package/dist/validate/rules/apiShape.d.ts.map +0 -1
  52. package/dist/validate/rules/apiShape.js +0 -150
  53. package/dist/validate/rules/apiShape.js.map +0 -1
  54. package/dist/validate/rules/arguments.d.ts +0 -3
  55. package/dist/validate/rules/arguments.d.ts.map +0 -1
  56. package/dist/validate/rules/arguments.js +0 -301
  57. package/dist/validate/rules/arguments.js.map +0 -1
  58. package/dist/validate/rules/connectorIdentity.d.ts +0 -3
  59. package/dist/validate/rules/connectorIdentity.d.ts.map +0 -1
  60. package/dist/validate/rules/connectorIdentity.js +0 -347
  61. package/dist/validate/rules/connectorIdentity.js.map +0 -1
  62. package/dist/validate/rules/context.d.ts +0 -42
  63. package/dist/validate/rules/context.d.ts.map +0 -1
  64. package/dist/validate/rules/context.js +0 -92
  65. package/dist/validate/rules/context.js.map +0 -1
  66. package/dist/validate/rules/dependencyIntegrity.d.ts +0 -60
  67. package/dist/validate/rules/dependencyIntegrity.d.ts.map +0 -1
  68. package/dist/validate/rules/dependencyIntegrity.js +0 -296
  69. package/dist/validate/rules/dependencyIntegrity.js.map +0 -1
  70. package/dist/validate/rules/duplicates.d.ts +0 -27
  71. package/dist/validate/rules/duplicates.d.ts.map +0 -1
  72. package/dist/validate/rules/duplicates.js +0 -337
  73. package/dist/validate/rules/duplicates.js.map +0 -1
  74. package/dist/validate/rules/flow.d.ts +0 -57
  75. package/dist/validate/rules/flow.d.ts.map +0 -1
  76. package/dist/validate/rules/flow.js +0 -714
  77. package/dist/validate/rules/flow.js.map +0 -1
  78. package/dist/validate/rules/overwriteLoss.d.ts +0 -23
  79. package/dist/validate/rules/overwriteLoss.d.ts.map +0 -1
  80. package/dist/validate/rules/overwriteLoss.js +0 -40
  81. package/dist/validate/rules/overwriteLoss.js.map +0 -1
  82. package/dist/validate/rules/pullerKind.d.ts +0 -3
  83. package/dist/validate/rules/pullerKind.d.ts.map +0 -1
  84. package/dist/validate/rules/pullerKind.js +0 -92
  85. package/dist/validate/rules/pullerKind.js.map +0 -1
  86. package/dist/validate/rules/reference.d.ts +0 -44
  87. package/dist/validate/rules/reference.d.ts.map +0 -1
  88. package/dist/validate/rules/reference.js +0 -405
  89. package/dist/validate/rules/reference.js.map +0 -1
  90. package/dist/validate/rules/referenceKind.d.ts +0 -25
  91. package/dist/validate/rules/referenceKind.d.ts.map +0 -1
  92. package/dist/validate/rules/referenceKind.js +0 -235
  93. package/dist/validate/rules/referenceKind.js.map +0 -1
  94. package/dist/validate/rules/retiredType.d.ts +0 -149
  95. package/dist/validate/rules/retiredType.d.ts.map +0 -1
  96. package/dist/validate/rules/retiredType.js +0 -235
  97. package/dist/validate/rules/retiredType.js.map +0 -1
  98. package/dist/validate/rules/stepData.d.ts +0 -122
  99. package/dist/validate/rules/stepData.d.ts.map +0 -1
  100. package/dist/validate/rules/stepData.js +0 -249
  101. package/dist/validate/rules/stepData.js.map +0 -1
  102. package/dist/validate/rules/stepIterations.d.ts +0 -49
  103. package/dist/validate/rules/stepIterations.d.ts.map +0 -1
  104. package/dist/validate/rules/stepIterations.js +0 -156
  105. package/dist/validate/rules/stepIterations.js.map +0 -1
  106. package/dist/validate/rules/tables.d.ts +0 -8
  107. package/dist/validate/rules/tables.d.ts.map +0 -1
  108. package/dist/validate/rules/tables.js +0 -116
  109. package/dist/validate/rules/tables.js.map +0 -1
  110. package/dist/validate/rules/variableDrift.d.ts +0 -63
  111. package/dist/validate/rules/variableDrift.d.ts.map +0 -1
  112. package/dist/validate/rules/variableDrift.js +0 -132
  113. package/dist/validate/rules/variableDrift.js.map +0 -1
  114. package/dist/validate/rules/variables.d.ts +0 -12
  115. package/dist/validate/rules/variables.d.ts.map +0 -1
  116. package/dist/validate/rules/variables.js +0 -207
  117. package/dist/validate/rules/variables.js.map +0 -1
  118. package/dist/validate/sourceLocator.d.ts +0 -32
  119. package/dist/validate/sourceLocator.d.ts.map +0 -1
  120. package/dist/validate/sourceLocator.js +0 -166
  121. package/dist/validate/sourceLocator.js.map +0 -1
@@ -1,108 +0,0 @@
1
- import type { OverwriteRecord } from '@beehexa/hexasync-template-report-model';
2
- import { Tracer } from '@beehexa/hexasync-template-compose';
3
- import type { ConnectorCatalog } from '@beehexa/hexasync-template-model';
4
- /** A contributing project (from the resolver), used for orphan/reference context. */
5
- export interface ValidationProjectInfo {
6
- project: string;
7
- generation: number;
8
- weight: number;
9
- componentPath: string;
10
- }
11
- /**
12
- * Everything a validation rule needs to inspect a composed profile, injected so the
13
- * rules and renderers stay pure and filesystem-free (AR-2/AR-4). `tokenForm` is the
14
- * pre-variable-substitution merged config (reconcileCnf); `outputForm` is the final
15
- * output.yaml config (sortedMainCnf). Some rules read one, some the other.
16
- */
17
- /** One component library's own variable declaration, as a rule sees it (Story 1.8). */
18
- export interface LibraryVariables {
19
- /** The library folder, named in the finding. */
20
- readonly library: string;
21
- readonly sourceFile: string;
22
- readonly variables: Record<string, unknown>;
23
- }
24
- export interface ValidationContext {
25
- projectTitle: string;
26
- tokenForm: any;
27
- outputForm: any;
28
- /** The assembled variable pool (keys = declared variable names). */
29
- variables: Record<string, unknown>;
30
- /** True when composed with --raw (tokens intentionally NOT substituted). */
31
- raw: boolean;
32
- projects: ValidationProjectInfo[];
33
- /** Libraries this project borrows files from, for the drift rule. Absent means none were found. */
34
- libraryVariables?: readonly LibraryVariables[];
35
- /** Wholesale array overwrites that dropped inherited components (Story 1.9). */
36
- overwrites?: readonly OverwriteRecord[];
37
- /**
38
- * The shipped connector catalog, when the caller has one (Story 2.2, FR-9/FR-10).
39
- *
40
- * INJECTED rather than bundled: the catalog ships in the extension's asset tree by decision
41
- * (`prd/addendum.md` §2), and the rules run here. Absent means the catalog-dependent CONN checks cannot run —
42
- * which the run must SAY, not swallow. See `CATALOG_CHECKS_SKIPPED`.
43
- */
44
- connectorCatalog?: ConnectorCatalog;
45
- reportDir: string;
46
- rootMainPath: string;
47
- relative: (from: string, to: string) => string;
48
- /** Absolute source file a top-level component came from (root main.yaml fallback). */
49
- sourceFileFor(parentKey: string, idOrKey: string): string | undefined;
50
- /** Absolute source file ONLY when a real tracer event maps it (no main.yaml fallback) —
51
- * used for line snippets so we never read the wrong file for a same-id component. */
52
- sourceFileForStrict(parentKey: string, idOrKey: string): string | undefined;
53
- /** `sourceFileFor` rendered relative to the report dir (null when unavailable). */
54
- sourceLinkFor(parentKey: string, idOrKey: string): string | null;
55
- /**
56
- * `variables.yaml` files discovered by the component glob but never admitted to the pool.
57
- *
58
- * The composer cannot infer this after the fact: by the time validation sees the output, an
59
- * unadmitted file is indistinguishable from one that simply defined nothing. Only the resolver
60
- * knows which files it chose not to admit, so it has to be carried here (Story 1.9 AC 2).
61
- */
62
- unadmittedVariableFiles: string[];
63
- }
64
- export interface ValidationContextInput {
65
- projectTitle: string;
66
- tokenForm: any;
67
- outputForm: any;
68
- variables: Record<string, unknown>;
69
- raw: boolean;
70
- projects: ValidationProjectInfo[];
71
- reportDir: string;
72
- rootMainPath: string;
73
- tracer?: Tracer;
74
- relative: (from: string, to: string) => string;
75
- /** Extra `JSON([parentKey, idOrKey]) → absolute file` seeds for components the tracer
76
- * didn't observe — notably components authored inline in the root main.yaml (whose
77
- * merge-base status means no tracer event). Real tracer events take precedence. */
78
- extraSources?: Map<string, string>;
79
- unadmittedVariableFiles?: string[];
80
- libraryVariables?: readonly LibraryVariables[];
81
- overwrites?: readonly OverwriteRecord[];
82
- /** See ValidationContext.connectorCatalog — injected, not bundled (addendum §2). */
83
- connectorCatalog?: ConnectorCatalog;
84
- }
85
- /**
86
- * Build a ValidationContext. Component→source-file mapping is derived from the tracer's
87
- * depth-0 events (first write wins); components authored inline in the root main.yaml (or
88
- * any without an event) fall back to the root main.yaml path.
89
- */
90
- /**
91
- * Top-level `main.yaml` keys that are COMPOSED but never VALIDATED (Jazz, 2026-08-05).
92
- *
93
- * `author` is metadata about who wrote a template — a name, an email, an id. It is not part of the thing
94
- * being validated, nobody plans to work on it, and it appears in **112 of the corpus's 113** projects, so
95
- * anything that ever did report on it would report on nearly everything.
96
- *
97
- * Removed from the document the RULES see, not from the composed output: `author` still composes, still
98
- * substitutes its variables, and still reaches `output.yaml`. This is the one seam where "part of the
99
- * project" and "part of what we check" come apart.
100
- *
101
- * Nothing reports on it today — verified across every validation report in the corpus, which contains
102
- * **zero** author findings, and its variables are referenced from the composed document so `VAR-3` does
103
- * not fire either. So this is a GUARD rather than a fix: it keeps a future rule that walks the document
104
- * generically from discovering 112 projects' worth of metadata and calling it a problem.
105
- */
106
- export declare const UNVALIDATED_TOP_LEVEL_KEYS: readonly string[];
107
- export declare function createValidationContext(input: ValidationContextInput): ValidationContext;
108
- //# sourceMappingURL=context.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/validate/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAC/E,OAAO,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAC5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAEzE,qFAAqF;AACrF,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;CACvB;AA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M,WAAW,sBAAsB;IACrC,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,GAAG,CAAC;IACf,UAAU,EAAE,GAAG,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,GAAG,EAAE,OAAO,CAAC;IACb,QAAQ,EAAE,qBAAqB,EAAE,CAAC;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,KAAK,MAAM,CAAC;IAC/C;;wFAEoF;IACpF,YAAY,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,uBAAuB,CAAC,EAAE,MAAM,EAAE,CAAC;IACnC,gBAAgB,CAAC,EAAE,SAAS,gBAAgB,EAAE,CAAC;IAC/C,UAAU,CAAC,EAAE,SAAS,eAAe,EAAE,CAAC;IACxC,oFAAoF;IACpF,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;CACrC;AAED;;;;GAIG;AACH;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,0BAA0B,EAAE,SAAS,MAAM,EAAe,CAAC;AAmBxE,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,sBAAsB,GAC5B,iBAAiB,CAsDnB"}
@@ -1,95 +0,0 @@
1
- /**
2
- * Build a ValidationContext. Component→source-file mapping is derived from the tracer's
3
- * depth-0 events (first write wins); components authored inline in the root main.yaml (or
4
- * any without an event) fall back to the root main.yaml path.
5
- */
6
- /**
7
- * Top-level `main.yaml` keys that are COMPOSED but never VALIDATED (Jazz, 2026-08-05).
8
- *
9
- * `author` is metadata about who wrote a template — a name, an email, an id. It is not part of the thing
10
- * being validated, nobody plans to work on it, and it appears in **112 of the corpus's 113** projects, so
11
- * anything that ever did report on it would report on nearly everything.
12
- *
13
- * Removed from the document the RULES see, not from the composed output: `author` still composes, still
14
- * substitutes its variables, and still reaches `output.yaml`. This is the one seam where "part of the
15
- * project" and "part of what we check" come apart.
16
- *
17
- * Nothing reports on it today — verified across every validation report in the corpus, which contains
18
- * **zero** author findings, and its variables are referenced from the composed document so `VAR-3` does
19
- * not fire either. So this is a GUARD rather than a fix: it keeps a future rule that walks the document
20
- * generically from discovering 112 projects' worth of metadata and calling it a problem.
21
- */
22
- export const UNVALIDATED_TOP_LEVEL_KEYS = ['author'];
23
- /**
24
- * The document the rules see: the composed one, minus the keys above.
25
- *
26
- * A shallow copy. The subtree is dropped by reference rather than cloned away, so this costs nothing on a
27
- * document that does not carry the key — which is the single project in the corpus without an `author`.
28
- */
29
- function validatable(tokenForm) {
30
- if (!tokenForm || typeof tokenForm !== 'object' || Array.isArray(tokenForm)) {
31
- return tokenForm;
32
- }
33
- const present = UNVALIDATED_TOP_LEVEL_KEYS.filter((key) => key in tokenForm);
34
- if (present.length === 0)
35
- return tokenForm;
36
- const copy = { ...tokenForm };
37
- for (const key of present)
38
- delete copy[key];
39
- return copy;
40
- }
41
- export function createValidationContext(input) {
42
- const sourceByKey = new Map();
43
- const events = input.tracer?.events?.() ?? [];
44
- for (const e of events) {
45
- if (e.depth !== 0 || !e.sourceFile)
46
- continue;
47
- const k = JSON.stringify([e.parentKey, e.idOrKey]);
48
- if (!sourceByKey.has(k))
49
- sourceByKey.set(k, e.sourceFile);
50
- }
51
- // Fill gaps with root-main (inline) components that produced no merge event; a real
52
- // tracer event (a partial) always wins over this default.
53
- if (input.extraSources) {
54
- for (const [k, file] of input.extraSources) {
55
- if (!sourceByKey.has(k))
56
- sourceByKey.set(k, file);
57
- }
58
- }
59
- const sourceFileForStrict = (parentKey, idOrKey) => sourceByKey.get(JSON.stringify([parentKey, idOrKey]));
60
- const sourceFileFor = (parentKey, idOrKey) => sourceFileForStrict(parentKey, idOrKey) ?? input.rootMainPath;
61
- const sourceLinkFor = (parentKey, idOrKey) => {
62
- const f = sourceFileFor(parentKey, idOrKey);
63
- if (!f)
64
- return null;
65
- try {
66
- return input.relative(input.reportDir, f);
67
- }
68
- catch {
69
- return null;
70
- }
71
- };
72
- return {
73
- projectTitle: input.projectTitle,
74
- tokenForm: validatable(input.tokenForm),
75
- outputForm: input.outputForm,
76
- variables: input.variables ?? {},
77
- raw: !!input.raw,
78
- projects: input.projects,
79
- libraryVariables: input.libraryVariables ?? [],
80
- overwrites: input.overwrites ?? [],
81
- // Passed through UNCHANGED, and absent stays absent: a `?? {}` here would turn "no catalog was supplied"
82
- // into "an empty catalog", and an empty catalog would make every connector look uncatalogued.
83
- ...(input.connectorCatalog
84
- ? { connectorCatalog: input.connectorCatalog }
85
- : {}),
86
- reportDir: input.reportDir,
87
- rootMainPath: input.rootMainPath,
88
- relative: input.relative,
89
- sourceFileFor,
90
- sourceFileForStrict,
91
- sourceLinkFor,
92
- unadmittedVariableFiles: input.unadmittedVariableFiles ?? [],
93
- };
94
- }
95
- //# sourceMappingURL=context.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/validate/context.ts"],"names":[],"mappings":"AAyFA;;;;GAIG;AACH;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAsB,CAAC,QAAQ,CAAC,CAAC;AAExE;;;;;GAKG;AACH,SAAS,WAAW,CAAC,SAAc;IACjC,IAAI,CAAC,SAAS,IAAI,OAAO,SAAS,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC;QAC5E,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,OAAO,GAAG,0BAA0B,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,IAAI,SAAS,CAAC,CAAC;IAC7E,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IAC3C,MAAM,IAAI,GAAG,EAAE,GAAG,SAAS,EAAE,CAAC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- import { type OverwriteRecord } from '@beehexa/hexasync-template-compose';
3
- import { ValidationContext, type LibraryVariables } from './context.js';
4
- /** A component as the graph knows it — collection, id, and the file it truly lives in. */
5
- export interface GraphComponentProvenance {
6
- readonly collection: string;
7
- readonly id: string;
8
- /** The file it was declared in. Absent for a component the graph could not attribute. */
9
- readonly sourceFile?: string;
10
- }
11
- export interface ContextFromGraphInput {
12
- readonly projectTitle: string;
13
- /**
14
- * The composed document as the graph holds it — its `mergedValue`, PRE-cleanup.
15
- *
16
- * Must be the document compose produced, not one rebuilt by regrouping the component list: a
17
- * re-derived document is a second answer to "what did compose produce", which is the disagreement
18
- * C3 exists to prevent.
19
- *
20
- * It is normalised below rather than used directly, and the reason is subtle enough to have caused
21
- * a real parity failure. The CLI's `tokenForm` is `parse(stringifyMerged(merged))` — a round trip
22
- * that applies the `!!_remove_` sweep. Phase 1 removed that round trip from the index for speed
23
- * (−382 ms), on the recorded grounds that the cleanup "only affects `indexGroups` arrays, never
24
- * component identity, so the pre-cleanup value is safe to hand to STRUCTURAL consumers". That
25
- * reasoning is correct and it does not extend here: validation is not a structural consumer. It
26
- * walks the entire document, so the uncleaned value made the editor find 71 fewer VAR-3 findings
27
- * than the CLI on one real project — caught by the parity test, not by reading.
28
- */
29
- readonly tokenForm: unknown;
30
- /**
31
- * The same document with variables substituted, when the caller has one.
32
- *
33
- * Only one rule reads it (VAR-1's leaked-token check) and only when not composing raw. Omitting it
34
- * is honest for a caller that has not substituted: the rule then behaves as it does under `--raw`,
35
- * which is a documented mode rather than a silent difference.
36
- */
37
- readonly outputForm?: unknown;
38
- readonly variables: Record<string, unknown>;
39
- /** True when tokens are deliberately left unsubstituted. */
40
- readonly raw?: boolean;
41
- /** The project's `partials` folder. `main.yaml` under it is the fallback source file. */
42
- readonly componentPath: string;
43
- /** Every component the graph holds, with its provenance. */
44
- readonly components: readonly GraphComponentProvenance[];
45
- /**
46
- * Where a report would be written, for `sourceLinkFor`.
47
- *
48
- * The editor has no report directory and passes the component path, which makes links relative to
49
- * the project. Nothing in the editor reads them; they exist so the same context type serves both.
50
- */
51
- readonly reportDir?: string;
52
- readonly relative?: (from: string, to: string) => string;
53
- readonly unadmittedVariableFiles?: readonly string[];
54
- /** Libraries this project borrows files from, carried on the graph (Story 1.8). */
55
- readonly libraryVariables?: readonly LibraryVariables[];
56
- /** Wholesale overwrites the graph observed while merging (Story 1.9). */
57
- readonly overwrites?: readonly OverwriteRecord[];
58
- /**
59
- * The shipped connector catalog, when the caller has one (Story 2.2).
60
- *
61
- * The EDITOR has one — it ships the asset — and a bare `hexasync compose` does not, which is exactly why this
62
- * is optional and why `CONN-0` says so out loud rather than letting silence pass for success.
63
- */
64
- readonly connectorCatalog?: ConnectorCatalog;
65
- readonly projects?: ValidationContext['projects'];
66
- }
67
- export declare function validationContextFromGraph(input: ContextFromGraphInput): ValidationContext;
68
- //# sourceMappingURL=contextFromGraph.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"contextFromGraph.d.ts","sourceRoot":"","sources":["../../src/validate/contextFromGraph.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAiBzE,OAAO,EAEL,KAAK,eAAe,EACrB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACL,iBAAiB,EAEjB,KAAK,gBAAgB,EACtB,MAAM,cAAc,CAAC;AAEtB,0FAA0F;AAC1F,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,yFAAyF;IACzF,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B;;;;;;;;;;;;;;;OAeG;IACH,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B;;;;;;OAMG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC5C,4DAA4D;IAC5D,QAAQ,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC;IACvB,yFAAyF;IACzF,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,4DAA4D;IAC5D,QAAQ,CAAC,UAAU,EAAE,SAAS,wBAAwB,EAAE,CAAC;IACzD;;;;;OAKG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,KAAK,MAAM,CAAC;IACzD,QAAQ,CAAC,uBAAuB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACrD,mFAAmF;IACnF,QAAQ,CAAC,gBAAgB,CAAC,EAAE,SAAS,gBAAgB,EAAE,CAAC;IACxD,yEAAyE;IACzE,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,eAAe,EAAE,CAAC;IACjD;;;;;OAKG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IAC7C,QAAQ,CAAC,QAAQ,CAAC,EAAE,iBAAiB,CAAC,UAAU,CAAC,CAAC;CACnD;AAyBD,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,qBAAqB,GAC3B,iBAAiB,CAwCnB"}
@@ -1,81 +0,0 @@
1
- /**
2
- * Build a `ValidationContext` from a composed graph rather than from a compose tracer.
3
- *
4
- * Phase 2 Story 1.1b. The CLI derives each component's source file from the tracer's depth-0 events;
5
- * the editor's Tier 2 index has no tracer and carries provenance on the components instead. Both are
6
- * the same fact recorded two ways, and this is the adapter between them.
7
- *
8
- * It lives HERE, beside the rules, for one reason: FR-54 says one rule set and two surfaces, and a
9
- * construction living in the extension would let a rule be wired into the CLI and forgotten in the
10
- * editor. Counter-metric C3 — "the editor and CI cannot disagree" — is a property of this file.
11
- *
12
- * The input is described STRUCTURALLY rather than as an `EffectiveGraph`, so `template-validate` does
13
- * not take a dependency on `template-index`. The two packages are siblings; making one import the
14
- * other to share three fields would be a boundary crossing that buys nothing (AD-3's direction rule).
15
- */
16
- import { parse } from 'yaml';
17
- import { stringifyMerged, } from '@beehexa/hexasync-template-compose';
18
- import { createValidationContext, } from './context.js';
19
- /**
20
- * URI-safe relative path, for a host that has no `path` module.
21
- *
22
- * Deliberately simple: strip a shared prefix, and otherwise return the target unchanged. A wrong
23
- * relative path costs a less pretty link; inventing `../` arithmetic over URIs with differing
24
- * schemes would risk a link to somewhere that does not exist.
25
- */
26
- function uriRelative(from, to) {
27
- const base = from.endsWith('/') ? from : `${from}/`;
28
- return to.startsWith(base) ? to.slice(base.length) : to;
29
- }
30
- /**
31
- * The document as the COMPOSER defines it, from the graph's uncleaned value.
32
- *
33
- * `stringifyMerged` + `parse` is exactly what `composeProject` does, reused rather than reimplemented
34
- * so the two cannot drift. Paid once per validation rather than once per build, which is why Phase 1
35
- * was right to take it off the build path and why taking it off this path too would be wrong.
36
- */
37
- function composedDocument(mergedValue) {
38
- return parse(stringifyMerged(mergedValue), { keepSourceTokens: true });
39
- }
40
- export function validationContextFromGraph(input) {
41
- const rootMainPath = `${input.componentPath}/main.yaml`;
42
- const tokenForm = composedDocument(input.tokenForm);
43
- // The same `[parentKey, idOrKey] → file` shape the tracer path produces. `extraSources` is the seam
44
- // the context already exposed for components the tracer never observed, which is exactly this case
45
- // — every component here comes from provenance rather than from an event.
46
- const sources = new Map();
47
- for (const component of input.components) {
48
- if (!component.sourceFile)
49
- continue;
50
- const key = JSON.stringify([component.collection, component.id]);
51
- // First wins, matching the tracer path's rule. Two components sharing an identity is a duplicate,
52
- // which is `duplicatesRule`'s finding to report — not something to resolve silently here.
53
- if (!sources.has(key))
54
- sources.set(key, component.sourceFile);
55
- }
56
- return createValidationContext({
57
- projectTitle: input.projectTitle,
58
- tokenForm,
59
- // `?? tokenForm` rather than `?? {}`: a rule reading an empty document would conclude the project
60
- // declares nothing, which is a WRONG answer where "unsubstituted" is merely an incomplete one.
61
- outputForm: input.outputForm ?? tokenForm,
62
- variables: input.variables,
63
- // Raw when no substituted form was supplied, because that is precisely what raw means: the
64
- // caller is working in token form. Inferring it keeps VAR-1 from comparing a document against
65
- // itself and reporting every token as leaked.
66
- raw: input.raw ?? input.outputForm === undefined,
67
- projects: input.projects ?? [],
68
- reportDir: input.reportDir ?? input.componentPath,
69
- rootMainPath,
70
- relative: input.relative ?? uriRelative,
71
- extraSources: sources,
72
- unadmittedVariableFiles: [...(input.unadmittedVariableFiles ?? [])],
73
- libraryVariables: input.libraryVariables ?? [],
74
- overwrites: input.overwrites ?? [],
75
- // Story 2.2: forwarded so the EDITOR's rules see the catalog the extension ships.
76
- ...(input.connectorCatalog
77
- ? { connectorCatalog: input.connectorCatalog }
78
- : {}),
79
- });
80
- }
81
- //# sourceMappingURL=contextFromGraph.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"contextFromGraph.js","sourceRoot":"","sources":["../../src/validate/contextFromGraph.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAC7B,OAAO,EACL,eAAe,GAEhB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAEL,uBAAuB,GAExB,MAAM,cAAc,CAAC;AAmEtB;;;;;;GAMG;AACH,SAAS,WAAW,CAAC,IAAY,EAAE,EAAU;IAC3C,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,CAAC;IACpD,OAAO,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAC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K,CAAC,aAAa;QACjD,YAAY;QACZ,QAAQ,EAAE,KAAK,CAAC,QAAQ,IAAI,WAAW;QACvC,YAAY,EAAE,OAAO;QACrB,uBAAuB,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,uBAAuB,IAAI,EAAE,CAAC,CAAC;QACnE,gBAAgB,EAAE,KAAK,CAAC,gBAAgB,IAAI,EAAE;QAC9C,UAAU,EAAE,KAAK,CAAC,UAAU,IAAI,EAAE;QAClC,kFAAkF;QAClF,GAAG,CAAC,KAAK,CAAC,gBAAgB;YACxB,CAAC,CAAC,EAAE,gBAAgB,EAAE,KAAK,CAAC,gBAAgB,EAAE;YAC9C,CAAC,CAAC,EAAE,CAAC;KACR,CAAC,CAAC;AACL,CAAC"}
@@ -1,60 +0,0 @@
1
- /**
2
- * Shared new-kind puller → task resolver (Story 7.1).
3
- *
4
- * A NEW-KIND puller declares which tasks it feeds via static `SAVE_TASK_DATA` /
5
- * `UPDATE_TASK_DATA_STATUS` steps carrying a `data.taskId` (mirrors core.api's
6
- * puller-owns-task inversion). Legacy pullers instead have the edge declared the other
7
- * way — `objectAssociations[taskId].puller.id` (task-declares-puller). This module
8
- * harvests the new-kind edge so the REF family can UNION it with the legacy edge and
9
- * see tasks that are only owned by a steps-based puller.
10
- *
11
- * Pure over the token-form config; never throws. All findings that consume this are
12
- * ADVISORY — nothing here can change the compose exit code.
13
- */
14
- /** The step arrays a new-kind puller uses (no legacy before/pull/afterPullSteps). */
15
- export declare const NEW_KIND_PHASES: readonly ["steps", "onErrorSteps", "finalSteps"];
16
- /** Step display types that statically declare a task the puller writes into. */
17
- export declare const TASK_DECL_STEP_TYPES: Set<string>;
18
- /** Normalized, upper-cased step type from any of the type-bearing fields.
19
- * NOTE: kept broad (reads `type`, case-insensitive) for the FLOW rules that recognize
20
- * IF/EXCEPTION guards authored under any field. The HARVEST uses `harvestStepType` instead. */
21
- export declare function stepType(s: any): string;
22
- /**
23
- * A puller is the NEW kind when it carries a non-empty `steps` array. This is the single
24
- * new-kind detection predicate used across compose (per the design's §7); old-kind pullers
25
- * (with beforePullSteps/pullSteps/afterPullSteps and no `steps`) return false, so every
26
- * legacy code path stays byte-identical.
27
- */
28
- export declare function isNewKindPuller(p: any): boolean;
29
- /** One harvested puller→task edge (a static taskId a SAVE/UPDATE step writes into). */
30
- export interface HarvestedTaskRef {
31
- /** Resolved task id (variables substituted). */
32
- taskId: string;
33
- /** Original token-form task id (for source-attributed messages). */
34
- rawTaskId: string;
35
- /** Owning puller id (when present). */
36
- pullerId?: string;
37
- /** The step key that declared it (when present). */
38
- stepKey?: string;
39
- /** The phase array it was found in (`steps`/`onErrorSteps`/`finalSteps`). */
40
- phase: string;
41
- /** The declaring step type (SAVE_TASK_DATA / UPDATE_TASK_DATA_STATUS). */
42
- stepType: string;
43
- }
44
- export interface PullerTaskHarvest {
45
- /** Every harvested edge, in document order. */
46
- refs: HarvestedTaskRef[];
47
- /** Resolved task ids owned by any new-kind puller. */
48
- taskIds: Set<string>;
49
- /** Resolved taskId → set of owning puller ids. */
50
- ownerByTask: Map<string, Set<string>>;
51
- }
52
- /**
53
- * Scan every puller's new-kind phase arrays for static `SAVE_TASK_DATA` /
54
- * `UPDATE_TASK_DATA_STATUS` steps and collect their `data.taskId`. Dynamic (`{{…}}`),
55
- * empty, and still-unresolved (`**token**`) task ids are skipped (they are not statically
56
- * decidable and are owned by other rules). `resolve` maps token-form values to their
57
- * composed values so a taskId and its object id compare equal across value-aliases.
58
- */
59
- export declare function harvestPullerTaskIds(cnf: any, resolve?: (v: string) => string): PullerTaskHarvest;
60
- //# sourceMappingURL=harvestPullerTaskIds.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"harvestPullerTaskIds.d.ts","sourceRoot":"","sources":["../../src/validate/harvestPullerTaskIds.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,qFAAqF;AACrF,eAAO,MAAM,eAAe,kDAAmD,CAAC;AAEhF,gFAAgF;AAChF,eAAO,MAAM,oBAAoB,aAI/B,CAAC;AAMH;;+FAE+F;AAC/F,wBAAgB,QAAQ,CAAC,CAAC,EAAE,GAAG,GAAG,MAAM,CAEvC;AA0BD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,GAAG,GAAG,OAAO,CAO/C;AAED,uFAAuF;AACvF,MAAM,WAAW,gBAAgB;IAC/B,gDAAgD;IAChD,MAAM,EAAE,MAAM,CAAC;IACf,oEAAoE;IACpE,SAAS,EAAE,MAAM,CAAC;IAClB,uCAAuC;IACvC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oDAAoD;IACpD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,6EAA6E;IAC7E,KAAK,EAAE,MAAM,CAAC;IACd,0EAA0E;IAC1E,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,iBAAiB;IAChC,+CAA+C;IAC/C,IAAI,EAAE,gBAAgB,EAAE,CAAC;IACzB,sDAAsD;IACtD,OAAO,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACrB,kDAAkD;IAClD,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;CACvC;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,GAAG,EACR,OAAO,GAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAiB,GACxC,iBAAiB,CAwCnB"}
@@ -1,116 +0,0 @@
1
- /**
2
- * Shared new-kind puller → task resolver (Story 7.1).
3
- *
4
- * A NEW-KIND puller declares which tasks it feeds via static `SAVE_TASK_DATA` /
5
- * `UPDATE_TASK_DATA_STATUS` steps carrying a `data.taskId` (mirrors core.api's
6
- * puller-owns-task inversion). Legacy pullers instead have the edge declared the other
7
- * way — `objectAssociations[taskId].puller.id` (task-declares-puller). This module
8
- * harvests the new-kind edge so the REF family can UNION it with the legacy edge and
9
- * see tasks that are only owned by a steps-based puller.
10
- *
11
- * Pure over the token-form config; never throws. All findings that consume this are
12
- * ADVISORY — nothing here can change the compose exit code.
13
- */
14
- /** The step arrays a new-kind puller uses (no legacy before/pull/afterPullSteps). */
15
- export const NEW_KIND_PHASES = ['steps', 'onErrorSteps', 'finalSteps'];
16
- /** Step display types that statically declare a task the puller writes into. */
17
- export const TASK_DECL_STEP_TYPES = new Set([
18
- 'SAVE_TASK_DATA',
19
- 'UPDATE_TASK_DATA_STATUS',
20
- 'TRACK_FOR_REMOVAL',
21
- ]);
22
- function arr(v) {
23
- return Array.isArray(v) ? v : [];
24
- }
25
- /** Normalized, upper-cased step type from any of the type-bearing fields.
26
- * NOTE: kept broad (reads `type`, case-insensitive) for the FLOW rules that recognize
27
- * IF/EXCEPTION guards authored under any field. The HARVEST uses `harvestStepType` instead. */
28
- export function stepType(s) {
29
- return String(s?.displayType ?? s?.type ?? s?.provider ?? '').toUpperCase();
30
- }
31
- /**
32
- * Canonical HARVEST step-type read: PROVIDER-FIRST (`provider ?? displayType`), exact-case,
33
- * and it does NOT read a `type` field — mirrors the core.api StepIterator authority
34
- * (`step.provider ?? step.displayType`) so the puller→task edge matches every other surface.
35
- */
36
- function harvestStepType(s) {
37
- return String(s?.provider ?? s?.displayType ?? '');
38
- }
39
- /** Canonical GUID shape — a taskId must be a static, well-formed hyphenated GUID (8-4-4-4-12). */
40
- const GUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
41
- function isDynamic(v) {
42
- return typeof v === 'string' && /\{\{[\s\S]*\}\}/.test(v);
43
- }
44
- function isEmpty(v) {
45
- return v == null || (typeof v === 'string' && v.trim() === '');
46
- }
47
- /** A `**token**` surviving a resolve means an undeclared variable (VAR-1 owns it). */
48
- const RESIDUAL_TOKEN = /\*\*[A-Za-z0-9_]+\*\*/;
49
- /**
50
- * A puller is the NEW kind when it carries a non-empty `steps` array. This is the single
51
- * new-kind detection predicate used across compose (per the design's §7); old-kind pullers
52
- * (with beforePullSteps/pullSteps/afterPullSteps and no `steps`) return false, so every
53
- * legacy code path stays byte-identical.
54
- */
55
- export function isNewKindPuller(p) {
56
- return (!!p &&
57
- typeof p === 'object' &&
58
- Array.isArray(p.steps) &&
59
- p.steps.length > 0);
60
- }
61
- /**
62
- * Scan every puller's new-kind phase arrays for static `SAVE_TASK_DATA` /
63
- * `UPDATE_TASK_DATA_STATUS` steps and collect their `data.taskId`. Dynamic (`{{…}}`),
64
- * empty, and still-unresolved (`**token**`) task ids are skipped (they are not statically
65
- * decidable and are owned by other rules). `resolve` maps token-form values to their
66
- * composed values so a taskId and its object id compare equal across value-aliases.
67
- */
68
- export function harvestPullerTaskIds(cnf, resolve = (v) => v) {
69
- const refs = [];
70
- const taskIds = new Set();
71
- const ownerByTask = new Map();
72
- for (const p of arr(cnf?.pullers)) {
73
- // Only NEW-KIND pullers (non-empty `steps`) declare task ownership; gate on that so an
74
- // old-kind puller with a SAVE step only in finalSteps/onErrorSteps is NOT harvested
75
- // (canonical parity with core.api / dashboard-v2 / profile.studio).
76
- if (!isNewKindPuller(p))
77
- continue;
78
- const pid = p.id != null ? String(p.id) : undefined;
79
- for (const phase of NEW_KIND_PHASES) {
80
- for (const s of arr(p[phase])) {
81
- if (!s || typeof s !== 'object')
82
- continue;
83
- const type = harvestStepType(s);
84
- if (!TASK_DECL_STEP_TYPES.has(type))
85
- continue;
86
- const raw = s?.data?.taskId;
87
- if (isEmpty(raw) || isDynamic(raw))
88
- continue;
89
- if (typeof raw !== 'string' && typeof raw !== 'number')
90
- continue;
91
- const resolved = resolve(String(raw));
92
- if (resolved === '' || RESIDUAL_TOKEN.test(resolved))
93
- continue;
94
- // taskId must be a static, well-formed hyphenated GUID (canonical clause D) — a
95
- // non-GUID id forms an ownership edge no runtime/backend/FE surface recognizes.
96
- if (!GUID_RE.test(resolved))
97
- continue;
98
- refs.push({
99
- taskId: resolved,
100
- rawTaskId: String(raw),
101
- pullerId: pid,
102
- stepKey: s.key != null ? String(s.key) : undefined,
103
- phase,
104
- stepType: type,
105
- });
106
- taskIds.add(resolved);
107
- if (!ownerByTask.has(resolved))
108
- ownerByTask.set(resolved, new Set());
109
- if (pid)
110
- ownerByTask.get(resolved).add(pid);
111
- }
112
- }
113
- }
114
- return { refs, taskIds, ownerByTask };
115
- }
116
- //# sourceMappingURL=harvestPullerTaskIds.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"harvestPullerTaskIds.js","sourceRoot":"","sources":["../../src/validate/harvestPullerTaskIds.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,qFAAqF;AACrF,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,OAAO,EAAE,cAAc,EAAE,YAAY,CAAU,CAAC;AAEhF,gFAAgF;AAChF,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,GAAG,CAAC;IAC1C,gBAAgB;IAChB,yBAAyB;IACzB,mBAAmB;CACpB,CAAC,CAAC;AAEH,SAAS,GAAG,CAAC,CAAM;IACjB,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACnC,CAAC;AAED;;+FAE+F;AAC/F,MAAM,UAAU,QAAQ,CAAC,CAAM;IAC7B,OAAO,MAAM,CAAC,CAAC,EAAE,WAAW,IAAI,CAAC,EAAE,IAAI,IAAI,CAAC,EAAE,QAAQ,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;AAC9E,CAAC;AAED;;;;GAIG;AACH,SAAS,eAAe,CAAC,CAAM;IAC7B,OAAO,MAAM,CAAC,CAAC,EAAE,QAAQ,IAAI,CAAC,EAAE,WAAW,IAAI,EAAE,CAAC,CAAC;AACrD,CAAC;AAED,kGAAkG;AAClG,MAAM,OAAO,GACX,iEAAiE,CAAC;AAEpE,SAAS,SAAS,CAAC,CAAU;IAC3B,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAI,iBAAiB,CAAC,IAAI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,CAAC;YAC/C,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC;AACxC,CAAC"}
@@ -1,14 +0,0 @@
1
- import { ValidationIssue, ValidationReportModel, ValidationSeverity } from '@beehexa/hexasync-template-report-model';
2
- import { ValidationContext } from './context.js';
3
- /** Severity display order (most to least severe). */
4
- export declare const SEVERITY_ORDER: ValidationSeverity[];
5
- /** Sort rank for a severity (lower = more severe). */
6
- export declare const SEVERITY_RANK: Record<ValidationSeverity, number>;
7
- /**
8
- * Fold raw issues into the report model: per-severity counts, per-component groups
9
- * (ordered by highest severity then component key), and a project-wide bucket for
10
- * component-less issues. Fully deterministic (no timestamps, stable ordering). Any
11
- * out-of-enum severity is normalized on intake so counts/ordering stay valid.
12
- */
13
- export declare function buildValidationReportModel(rawIssues: ValidationIssue[], ctx: Pick<ValidationContext, 'projectTitle' | 'sourceLinkFor'>): ValidationReportModel;
14
- //# sourceMappingURL=model.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../src/validate/model.ts"],"names":[],"mappings":"AACA,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,kBAAkB,EAEnB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEjD,qDAAqD;AACrD,eAAO,MAAM,cAAc,EAAE,kBAAkB,EAS9C,CAAC;AAEF,sDAAsD;AACtD,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,kBAAkB,EAAE,MAAM,CAO5D,CAAC;AAkBF;;;;;GAKG;AACH,wBAAgB,0BAA0B,CACxC,SAAS,EAAE,eAAe,EAAE,EAC5B,GAAG,EAAE,IAAI,CAAC,iBAAiB,EAAE,cAAc,GAAG,eAAe,CAAC,GAC7D,qBAAqB,CA0DvB"}