@beehexa/hexasync-template-validate 2608.8.3 → 2608.15.1
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/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/dist/validate/agentAnswers.d.ts +48 -0
- package/dist/validate/agentAnswers.d.ts.map +1 -0
- package/dist/validate/agentAnswers.js +84 -0
- package/dist/validate/agentAnswers.js.map +1 -0
- package/dist/validate/agentTools.d.ts +37 -0
- package/dist/validate/agentTools.d.ts.map +1 -0
- package/dist/validate/agentTools.js +141 -0
- package/dist/validate/agentTools.js.map +1 -0
- package/dist/validate/context.d.ts +11 -0
- package/dist/validate/context.d.ts.map +1 -1
- package/dist/validate/context.js +5 -0
- package/dist/validate/context.js.map +1 -1
- package/dist/validate/contextFromGraph.d.ts +8 -0
- package/dist/validate/contextFromGraph.d.ts.map +1 -1
- package/dist/validate/contextFromGraph.js +4 -0
- package/dist/validate/contextFromGraph.js.map +1 -1
- package/dist/validate/harvestPullerTaskIds.d.ts.map +1 -1
- package/dist/validate/harvestPullerTaskIds.js +1 -0
- package/dist/validate/harvestPullerTaskIds.js.map +1 -1
- package/dist/validate/model.d.ts.map +1 -1
- package/dist/validate/model.js +5 -0
- package/dist/validate/model.js.map +1 -1
- package/dist/validate/registry.d.ts +4 -0
- package/dist/validate/registry.d.ts.map +1 -1
- package/dist/validate/registry.js +43 -0
- package/dist/validate/registry.js.map +1 -1
- package/dist/validate/retrieve.d.ts +125 -0
- package/dist/validate/retrieve.d.ts.map +1 -0
- package/dist/validate/retrieve.js +272 -0
- package/dist/validate/retrieve.js.map +1 -0
- package/dist/validate/ruleCatalog.d.ts.map +1 -1
- package/dist/validate/ruleCatalog.js +218 -8
- package/dist/validate/ruleCatalog.js.map +1 -1
- package/dist/validate/rules/apiShape.d.ts +51 -0
- package/dist/validate/rules/apiShape.d.ts.map +1 -0
- package/dist/validate/rules/apiShape.js +150 -0
- package/dist/validate/rules/apiShape.js.map +1 -0
- package/dist/validate/rules/arguments.d.ts +3 -0
- package/dist/validate/rules/arguments.d.ts.map +1 -0
- package/dist/validate/rules/arguments.js +301 -0
- package/dist/validate/rules/arguments.js.map +1 -0
- package/dist/validate/rules/connectorIdentity.d.ts +3 -0
- package/dist/validate/rules/connectorIdentity.d.ts.map +1 -0
- package/dist/validate/rules/connectorIdentity.js +347 -0
- package/dist/validate/rules/connectorIdentity.js.map +1 -0
- package/dist/validate/rules/context.d.ts +42 -0
- package/dist/validate/rules/context.d.ts.map +1 -0
- package/dist/validate/rules/context.js +92 -0
- package/dist/validate/rules/context.js.map +1 -0
- package/dist/validate/rules/duplicates.d.ts +6 -2
- package/dist/validate/rules/duplicates.d.ts.map +1 -1
- package/dist/validate/rules/duplicates.js +19 -3
- package/dist/validate/rules/duplicates.js.map +1 -1
- package/dist/validate/rules/flow.d.ts +20 -4
- package/dist/validate/rules/flow.d.ts.map +1 -1
- package/dist/validate/rules/flow.js +164 -9
- package/dist/validate/rules/flow.js.map +1 -1
- package/dist/validate/rules/pullerKind.d.ts.map +1 -1
- package/dist/validate/rules/pullerKind.js +10 -1
- package/dist/validate/rules/pullerKind.js.map +1 -1
- package/dist/validate/rules/reference.d.ts.map +1 -1
- package/dist/validate/rules/reference.js +38 -3
- package/dist/validate/rules/reference.js.map +1 -1
- package/dist/validate/rules/referenceKind.d.ts.map +1 -1
- package/dist/validate/rules/referenceKind.js +8 -3
- package/dist/validate/rules/referenceKind.js.map +1 -1
- package/dist/validate/rules/retiredType.d.ts +8 -1
- package/dist/validate/rules/retiredType.d.ts.map +1 -1
- package/dist/validate/rules/retiredType.js +9 -2
- package/dist/validate/rules/retiredType.js.map +1 -1
- package/dist/validate/rules/stepData.d.ts +122 -0
- package/dist/validate/rules/stepData.d.ts.map +1 -0
- package/dist/validate/rules/stepData.js +249 -0
- package/dist/validate/rules/stepData.js.map +1 -0
- package/dist/validate/rules/stepIterations.d.ts +49 -0
- package/dist/validate/rules/stepIterations.d.ts.map +1 -0
- package/dist/validate/rules/stepIterations.js +156 -0
- package/dist/validate/rules/stepIterations.js.map +1 -0
- package/package.json +6 -5
|
@@ -80,8 +80,15 @@ export declare const RETIRED_MEASUREMENTS: {
|
|
|
80
80
|
* other four figures did not move, so nothing about the rule's behaviour changed — only the population it
|
|
81
81
|
* was measured over. Re-derived rather than relaxed: a pinned number that is allowed to drift stops being
|
|
82
82
|
* evidence for the severity argument it supports.
|
|
83
|
+
*
|
|
84
|
+
* 105 → 106 on 2026-08-11, the same way: the sibling checkout took merges on
|
|
85
|
+
* `feature/intellisense-asset-distribution` that added a project. `projectsFiring` (52), `findingsTotal` (445),
|
|
86
|
+
* `worstProjectFindings` (57) and every `perCollection` figure matched EXACTLY, which is what makes this a
|
|
87
|
+
* population bump rather than a behaviour change — any change to the rule or to composition would have moved one of
|
|
88
|
+
* the other four. Bumped by a story that touches neither (the report's flow diagram), which is worth stating plainly:
|
|
89
|
+
* the alternative was leaving a known-red corpus gate for the next person to inherit without the evidence.
|
|
83
90
|
*/
|
|
84
|
-
readonly projectsComposed:
|
|
91
|
+
readonly projectsComposed: 106;
|
|
85
92
|
/**
|
|
86
93
|
* Projects the rule FIRES on: a non-empty retired collection somewhere.
|
|
87
94
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retiredType.d.ts","sourceRoot":"","sources":["../../../src/validate/rules/retiredType.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAIjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8DG;AAEH;;;;;;;;;GASG;AACH,eAAO,MAAM,oBAAoB;IAC/B
|
|
1
|
+
{"version":3,"file":"retiredType.d.ts","sourceRoot":"","sources":["../../../src/validate/rules/retiredType.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAIjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8DG;AAEH;;;;;;;;;GASG;AACH,eAAO,MAAM,oBAAoB;IAC/B;;;;;;;;;;;;;;OAcG;;IAEH;;;;;;OAMG;;IAEH,kFAAkF;;;IAGlF;;;;;;;;;OASG;;;;;;;;;;;CAKK,CAAC;AAEX,kDAAkD;AAClD,MAAM,WAAW,iBAAiB;IAChC,6DAA6D;IAC7D,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,iDAAiD;IACjD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB;;;;;;;;OAQG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B;AAcD;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,EAAE,SAAS,iBAAiB,EAY3D,CAAC;AA4DF,eAAO,MAAM,eAAe,EAAE,cA0C7B,CAAC"}
|
|
@@ -79,8 +79,15 @@ export const RETIRED_MEASUREMENTS = {
|
|
|
79
79
|
* other four figures did not move, so nothing about the rule's behaviour changed — only the population it
|
|
80
80
|
* was measured over. Re-derived rather than relaxed: a pinned number that is allowed to drift stops being
|
|
81
81
|
* evidence for the severity argument it supports.
|
|
82
|
+
*
|
|
83
|
+
* 105 → 106 on 2026-08-11, the same way: the sibling checkout took merges on
|
|
84
|
+
* `feature/intellisense-asset-distribution` that added a project. `projectsFiring` (52), `findingsTotal` (445),
|
|
85
|
+
* `worstProjectFindings` (57) and every `perCollection` figure matched EXACTLY, which is what makes this a
|
|
86
|
+
* population bump rather than a behaviour change — any change to the rule or to composition would have moved one of
|
|
87
|
+
* the other four. Bumped by a story that touches neither (the report's flow diagram), which is worth stating plainly:
|
|
88
|
+
* the alternative was leaving a known-red corpus gate for the next person to inherit without the evidence.
|
|
82
89
|
*/
|
|
83
|
-
projectsComposed:
|
|
90
|
+
projectsComposed: 106,
|
|
84
91
|
/**
|
|
85
92
|
* Projects the rule FIRES on: a non-empty retired collection somewhere.
|
|
86
93
|
*
|
|
@@ -198,7 +205,7 @@ export const retiredTypeRule = {
|
|
|
198
205
|
ruleId: 'RET-1',
|
|
199
206
|
family: 'RET',
|
|
200
207
|
// A warning, never an error. See the header for the measured reason.
|
|
201
|
-
severity: '
|
|
208
|
+
severity: 'very-low',
|
|
202
209
|
parentKey: retired.collection,
|
|
203
210
|
idOrKey: component.idOrKey,
|
|
204
211
|
message: `${retired.label} components are retired — \`${retired.collection}\` will stop being supported`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retiredType.js","sourceRoot":"","sources":["../../../src/validate/rules/retiredType.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8DG;AAEH;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC
|
|
1
|
+
{"version":3,"file":"retiredType.js","sourceRoot":"","sources":["../../../src/validate/rules/retiredType.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8DG;AAEH;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC;;;;;;;;;;;;;;OAcG;IACH,gBAAgB,EAAE,GAAG;IACrB;;;;;;OAMG;IACH,cAAc,EAAE,EAAE;IAClB,kFAAkF;IAClF,aAAa,EAAE,GAAG;IAClB,oBAAoB,EAAE,EAAE;IACxB;;;;;;;;;OASG;IACH,aAAa,EAAE;QACb,OAAO,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAE;QAC1C,OAAO,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAE;KAC3C;CACO,CAAC;AAgCX;;;;;GAKG;AACH,MAAM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oBACxC,GAAG,EAAE,OAAO,CAAC,WAAW;wBACtB,CAAC,CAAC,iBAAiB,OAAO,CAAC,WAAW,GAAG;wBACzC,CAAC,CAAC,4EAA4E;oBAChF,yCAAyC;oBACzC,EAAE;oBACF,sGAAsG;oBACtG,8FAA8F;oBAC9F,gGAAgG;oBAChG,iGAAiG;oBACjG,uDAAuD;oBACvD,EAAE;oBACF,wEAAwE;oBACxE,GAAG,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,SAAS,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;iBACnE,CAAC,CAAC;YACL,CAAC;QACH,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* STEP-1 — a step's `data` sets both of a one-or-the-other pair, or neither (Story 5.12).
|
|
3
|
+
*
|
|
4
|
+
* ### One rule, two surfaces, and that is the whole point
|
|
5
|
+
*
|
|
6
|
+
* The editor's diagnostics run this registry, and so does the composition report. So a rule learned in one place
|
|
7
|
+
* holds in the other **because it is the same computation**, not because two implementations were kept in step.
|
|
8
|
+
* The extension's `stepInputs.ts` reads the same relationships from the shipped asset for hover and completion; this
|
|
9
|
+
* is the assertive half of that pair.
|
|
10
|
+
*
|
|
11
|
+
* ### Why the pair is hardcoded here rather than read from the asset
|
|
12
|
+
*
|
|
13
|
+
* The asset ships with the EXTENSION and this package is consumed by both the extension and the CLI. A rule that
|
|
14
|
+
* needed an editor asset could not run in `hexasync compose`, which is where the report comes from — so the two
|
|
15
|
+
* relationships that exist today are stated here, and the asset carries the reader-facing prose for the same pair.
|
|
16
|
+
* ⚠️ That is a real duplication, and it is deliberate rather than overlooked: a test in the extension asserts the
|
|
17
|
+
* two agree, so drift fails a build rather than reaching an author.
|
|
18
|
+
*
|
|
19
|
+
* ### Measured before it was written
|
|
20
|
+
*
|
|
21
|
+
* `SAVE_TASK_DATA` keeps `items`; `DIRECT_INDEX` keeps `dataPath`. Neither raises anything — the loser is dropped in
|
|
22
|
+
* silence.
|
|
23
|
+
*
|
|
24
|
+
* ⛔ The figures first recorded here — *"604 use `dataPath` only, 27 use `items` only"* — do not reproduce under any
|
|
25
|
+
* basis. Re-measured 2026-08-13 and now asserted by `epic5Corpus.spec.ts` in the extension repo:
|
|
26
|
+
*
|
|
27
|
+
* | basis | dataPath only | items only | both | neither |
|
|
28
|
+
* | --- | --- | --- | --- | --- |
|
|
29
|
+
* | authored (excluding `output*.yaml`), PARSED — the figure `epic5Corpus.spec.ts` asserts | **423** | **23** | 0 | 0 |
|
|
30
|
+
* | every YAML | 847 | 48 | 0 | 0 |
|
|
31
|
+
*
|
|
32
|
+
* ⛔ A first correction here said **441**, which was a grep rather than a parse — the fourth figure for one query, added
|
|
33
|
+
* in the same change that criticised the previous three. 423 is what the gate runs.
|
|
34
|
+
*
|
|
35
|
+
* And `SAVE_TASK_DATA` occurs **ZERO** times in the corpus, so half this table has no corpus evidence at all — its
|
|
36
|
+
* winner and its exception come from the executor, not from usage. The load-bearing half holds: zero steps set both
|
|
37
|
+
* or neither, so this rule is preventative and fires on nothing the day it ships. Stated because "fires on nothing"
|
|
38
|
+
* and "is broken" look identical in a log.
|
|
39
|
+
*/
|
|
40
|
+
import type { ValidationRule } from '../rule.js';
|
|
41
|
+
/**
|
|
42
|
+
* How a field counts as SET.
|
|
43
|
+
*
|
|
44
|
+
* ⛔ Not one rule. The Story 5.12 review read the executors and found the two checks inside ONE step disagree:
|
|
45
|
+
*
|
|
46
|
+
* ```csharp
|
|
47
|
+
* // DirectIndexStepExecutor.cs:53 — the guard that throws
|
|
48
|
+
* if ((Items == null || !Items.Any()) && string.IsNullOrWhiteSpace(DataPath)) throw new ArgumentException(...);
|
|
49
|
+
* // DirectIndexStepExecutor.cs:57 — the branch that decides the winner
|
|
50
|
+
* else if (DataPath != null) { ...SelectTokens(DataPath)... }
|
|
51
|
+
* ```
|
|
52
|
+
*
|
|
53
|
+
* So `dataPath: ""` is **absent** to the guard and **present** to the branch. A single "the key is there" reading
|
|
54
|
+
* got two real shapes wrong: `dataPath: ""` alone throws and was reported as fine, and `dataPath: "" , items: []`
|
|
55
|
+
* throws and was reported as *"`dataPath` is used and the other is ignored, with no error"* — telling an author
|
|
56
|
+
* nothing is wrong about a step that cannot run.
|
|
57
|
+
*/
|
|
58
|
+
type Presence = 'non-null' | 'non-blank' | 'non-empty';
|
|
59
|
+
/**
|
|
60
|
+
* The one-or-the-other pairs, which field the runtime keeps, and what each check counts as set.
|
|
61
|
+
*
|
|
62
|
+
* Exported so the extension's drift guard can compare against THIS object rather than a hand-copied literal — the
|
|
63
|
+
* review flipped `wins` here and the extension's "drift guard" stayed green, which is the opposite of a guard.
|
|
64
|
+
*/
|
|
65
|
+
export declare const EXCLUSIVE: readonly {
|
|
66
|
+
readonly displayType: string;
|
|
67
|
+
readonly fields: readonly [string, string];
|
|
68
|
+
readonly wins: string;
|
|
69
|
+
readonly throws: string;
|
|
70
|
+
/** How each field counts as set when deciding which one the runtime USES. */
|
|
71
|
+
readonly branch: Readonly<Record<string, Presence>>;
|
|
72
|
+
/** How each field counts as set for the guard that THROWS. */
|
|
73
|
+
readonly guard: Readonly<Record<string, Presence>>;
|
|
74
|
+
}[];
|
|
75
|
+
/**
|
|
76
|
+
* Fields a step type requires, and what the runtime does without them (Story 5.12 AC-1, extended by decision).
|
|
77
|
+
*
|
|
78
|
+
* ⛔ AC-1 says *"a step whose `data` omits a field its type requires"*, which is broader than the one-or-the-other
|
|
79
|
+
* pair. The review found the rest reported by the editor's JSON Schema and by NOTHING in `hexasync compose` — the
|
|
80
|
+
* same two-surface disagreement the missing-`data` case closed.
|
|
81
|
+
*
|
|
82
|
+
* ⚠️ **The authority differs per field, and that is recorded rather than smoothed over.** The `SLEEP` lesson from
|
|
83
|
+
* this epic is that a schema's `required` can simply be wrong, so a field is only described as throwing where the
|
|
84
|
+
* throw was read in the executor:
|
|
85
|
+
*
|
|
86
|
+
* | field | what actually happens | read in |
|
|
87
|
+
* | --- | --- | --- |
|
|
88
|
+
* | `SAVE_TASK_DATA.taskId` | throws `InvalidOperationException` | `SaveTaskDataStepExecutor.cs:48-51` |
|
|
89
|
+
* | `DIRECT_INDEX.objectIds` | **no throw** — defaults to an empty list, so the step indexes into no objects and does nothing | `DirectIndexStepExecutor.cs:26,51` |
|
|
90
|
+
*
|
|
91
|
+
* ⛔ **`API.url`/`type`/`method` and `SQL.sql` were in this table for one commit, sourced to the shipped schema's
|
|
92
|
+
* `required`, and the CORPUS falsified them immediately** — 59 authored API steps and 1 SQL step were reported.
|
|
93
|
+
* Looking at them settles it: they declare `displayType: API` with a `connectorId` and a SQL-shaped `data`
|
|
94
|
+
* (`sql`, `timeout`, `resultSets`). An API step's fields are read by its **connector provider**, not by
|
|
95
|
+
* `ApiStepExecutor`, so what it requires depends on which provider it routes to — which is precisely why that
|
|
96
|
+
* executor delegates and why the field could not be verified there.
|
|
97
|
+
*
|
|
98
|
+
* That is this epic's `SLEEP` lesson a third time: a schema's `required` is not the runtime's word. A field is
|
|
99
|
+
* listed here only where the behaviour was read in code that actually reads the field.
|
|
100
|
+
*
|
|
101
|
+
* ⚠️ It also means the EDITOR reports those 59 steps as broken today, from `apiData.required` — a real false error,
|
|
102
|
+
* left recorded rather than silently edited, because fixing it needs the connector provider read first.
|
|
103
|
+
*
|
|
104
|
+
* ⚠️ Scope: 2 step types. The rest belongs to Epic 10's sweep, and saying so is the point — an author must not read
|
|
105
|
+
* silence here as approval.
|
|
106
|
+
*/
|
|
107
|
+
export declare const REQUIRED: readonly {
|
|
108
|
+
readonly displayType: string;
|
|
109
|
+
readonly field: string;
|
|
110
|
+
/** What the runtime does when it is missing, in the author's terms. */
|
|
111
|
+
readonly whenMissing: string;
|
|
112
|
+
/**
|
|
113
|
+
* Where the behaviour was established.
|
|
114
|
+
*
|
|
115
|
+
* `'executor'` is the only value in use. `'schema'` remains in the type as a warning: entries added on the
|
|
116
|
+
* schema's authority alone were falsified by the corpus within one commit — see the note above.
|
|
117
|
+
*/
|
|
118
|
+
readonly authority: 'executor' | 'schema';
|
|
119
|
+
}[];
|
|
120
|
+
export declare const stepDataRule: ValidationRule;
|
|
121
|
+
export {};
|
|
122
|
+
//# sourceMappingURL=stepData.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stepData.d.ts","sourceRoot":"","sources":["../../../src/validate/rules/stepData.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAIjD;;;;;;;;;;;;;;;;GAgBG;AACH,KAAK,QAAQ,GAAG,UAAU,GAAG,WAAW,GAAG,WAAW,CAAC;AAuBvD;;;;;GAKG;AACH,eAAO,MAAM,SAAS,EAAE,SAAS;IAC/B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,6EAA6E;IAC7E,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;IACpD,8DAA8D;IAC9D,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;CACpD,EAmBA,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,eAAO,MAAM,QAAQ,EAAE,SAAS;IAC9B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,uEAAuE;IACvE,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B;;;;;OAKG;IACH,QAAQ,CAAC,SAAS,EAAE,UAAU,GAAG,QAAQ,CAAC;CAC3C,EAcA,CAAC;AAiBF,eAAO,MAAM,YAAY,EAAE,cAwK1B,CAAC"}
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
const isSet = (data, field, how) => {
|
|
2
|
+
const value = data?.[field];
|
|
3
|
+
if (value === undefined || value === null)
|
|
4
|
+
return false;
|
|
5
|
+
if (how === 'non-blank')
|
|
6
|
+
return typeof value === 'string' ? value.trim() !== '' : true;
|
|
7
|
+
if (how === 'non-empty') {
|
|
8
|
+
/**
|
|
9
|
+
* ⛔ A STRING counts, and a blank one does not.
|
|
10
|
+
*
|
|
11
|
+
* `items` is authored as a template string in 23 corpus steps (`items: "{{ rows }}"`), so returning `true` for
|
|
12
|
+
* every non-array — the first version — meant `items: ''` and `items: ' '` were "set" while the identical
|
|
13
|
+
* `dataPath: ' '` was reported. The review found the asymmetry invisible because the branch only asked
|
|
14
|
+
* `Array.isArray`.
|
|
15
|
+
*/
|
|
16
|
+
if (Array.isArray(value))
|
|
17
|
+
return value.length > 0;
|
|
18
|
+
if (typeof value === 'string')
|
|
19
|
+
return value.trim() !== '';
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
return true;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* The one-or-the-other pairs, which field the runtime keeps, and what each check counts as set.
|
|
26
|
+
*
|
|
27
|
+
* Exported so the extension's drift guard can compare against THIS object rather than a hand-copied literal — the
|
|
28
|
+
* review flipped `wins` here and the extension's "drift guard" stayed green, which is the opposite of a guard.
|
|
29
|
+
*/
|
|
30
|
+
export const EXCLUSIVE = [
|
|
31
|
+
{
|
|
32
|
+
displayType: 'DIRECT_INDEX',
|
|
33
|
+
fields: ['dataPath', 'items'],
|
|
34
|
+
wins: 'dataPath',
|
|
35
|
+
throws: 'ArgumentException',
|
|
36
|
+
branch: { dataPath: 'non-null', items: 'non-empty' },
|
|
37
|
+
guard: { dataPath: 'non-blank', items: 'non-empty' },
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
// `SaveTaskDataStepExecutor.cs:136-148` uses `IsNullOrWhiteSpace(dataPath)` for the guard AND the branch, so a
|
|
41
|
+
// blank `dataPath` is uniformly absent here — the asymmetry above is DIRECT_INDEX's alone.
|
|
42
|
+
displayType: 'SAVE_TASK_DATA',
|
|
43
|
+
fields: ['items', 'dataPath'],
|
|
44
|
+
wins: 'items',
|
|
45
|
+
throws: 'InvalidOperationException',
|
|
46
|
+
branch: { items: 'non-null', dataPath: 'non-blank' },
|
|
47
|
+
guard: { items: 'non-null', dataPath: 'non-blank' },
|
|
48
|
+
},
|
|
49
|
+
];
|
|
50
|
+
/**
|
|
51
|
+
* Fields a step type requires, and what the runtime does without them (Story 5.12 AC-1, extended by decision).
|
|
52
|
+
*
|
|
53
|
+
* ⛔ AC-1 says *"a step whose `data` omits a field its type requires"*, which is broader than the one-or-the-other
|
|
54
|
+
* pair. The review found the rest reported by the editor's JSON Schema and by NOTHING in `hexasync compose` — the
|
|
55
|
+
* same two-surface disagreement the missing-`data` case closed.
|
|
56
|
+
*
|
|
57
|
+
* ⚠️ **The authority differs per field, and that is recorded rather than smoothed over.** The `SLEEP` lesson from
|
|
58
|
+
* this epic is that a schema's `required` can simply be wrong, so a field is only described as throwing where the
|
|
59
|
+
* throw was read in the executor:
|
|
60
|
+
*
|
|
61
|
+
* | field | what actually happens | read in |
|
|
62
|
+
* | --- | --- | --- |
|
|
63
|
+
* | `SAVE_TASK_DATA.taskId` | throws `InvalidOperationException` | `SaveTaskDataStepExecutor.cs:48-51` |
|
|
64
|
+
* | `DIRECT_INDEX.objectIds` | **no throw** — defaults to an empty list, so the step indexes into no objects and does nothing | `DirectIndexStepExecutor.cs:26,51` |
|
|
65
|
+
*
|
|
66
|
+
* ⛔ **`API.url`/`type`/`method` and `SQL.sql` were in this table for one commit, sourced to the shipped schema's
|
|
67
|
+
* `required`, and the CORPUS falsified them immediately** — 59 authored API steps and 1 SQL step were reported.
|
|
68
|
+
* Looking at them settles it: they declare `displayType: API` with a `connectorId` and a SQL-shaped `data`
|
|
69
|
+
* (`sql`, `timeout`, `resultSets`). An API step's fields are read by its **connector provider**, not by
|
|
70
|
+
* `ApiStepExecutor`, so what it requires depends on which provider it routes to — which is precisely why that
|
|
71
|
+
* executor delegates and why the field could not be verified there.
|
|
72
|
+
*
|
|
73
|
+
* That is this epic's `SLEEP` lesson a third time: a schema's `required` is not the runtime's word. A field is
|
|
74
|
+
* listed here only where the behaviour was read in code that actually reads the field.
|
|
75
|
+
*
|
|
76
|
+
* ⚠️ It also means the EDITOR reports those 59 steps as broken today, from `apiData.required` — a real false error,
|
|
77
|
+
* left recorded rather than silently edited, because fixing it needs the connector provider read first.
|
|
78
|
+
*
|
|
79
|
+
* ⚠️ Scope: 2 step types. The rest belongs to Epic 10's sweep, and saying so is the point — an author must not read
|
|
80
|
+
* silence here as approval.
|
|
81
|
+
*/
|
|
82
|
+
export const REQUIRED = [
|
|
83
|
+
{
|
|
84
|
+
displayType: 'SAVE_TASK_DATA',
|
|
85
|
+
field: 'taskId',
|
|
86
|
+
whenMissing: 'the step throws InvalidOperationException at run time',
|
|
87
|
+
authority: 'executor',
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
displayType: 'DIRECT_INDEX',
|
|
91
|
+
field: 'objectIds',
|
|
92
|
+
whenMissing: 'the step indexes into no objects and does nothing, without an error',
|
|
93
|
+
authority: 'executor',
|
|
94
|
+
},
|
|
95
|
+
];
|
|
96
|
+
const STAGES = [
|
|
97
|
+
'beforePullSteps',
|
|
98
|
+
'pullSteps',
|
|
99
|
+
'afterPullSteps',
|
|
100
|
+
'steps',
|
|
101
|
+
'onErrorSteps',
|
|
102
|
+
'finalSteps',
|
|
103
|
+
'beforePushSteps',
|
|
104
|
+
'pushSteps',
|
|
105
|
+
'afterPushSteps',
|
|
106
|
+
];
|
|
107
|
+
const arr = (value, key) => Array.isArray(value?.[key]) ? value[key] : [];
|
|
108
|
+
export const stepDataRule = {
|
|
109
|
+
id: 'STEP',
|
|
110
|
+
family: 'STEP',
|
|
111
|
+
run(ctx) {
|
|
112
|
+
const cnf = ctx.tokenForm;
|
|
113
|
+
if (!cnf || typeof cnf !== 'object')
|
|
114
|
+
return [];
|
|
115
|
+
const issues = [];
|
|
116
|
+
const check = (step, parentKey, idOrKey) => {
|
|
117
|
+
const displayType = typeof step?.displayType === 'string' ? step.displayType : undefined;
|
|
118
|
+
const rule = EXCLUSIVE.find((entry) => entry.displayType === displayType);
|
|
119
|
+
const required = REQUIRED.filter((entry) => entry.displayType === displayType);
|
|
120
|
+
if (!rule && required.length === 0)
|
|
121
|
+
return;
|
|
122
|
+
/**
|
|
123
|
+
* A missing `data` block is the SAME state as a `data` with neither field, and it is reported.
|
|
124
|
+
*
|
|
125
|
+
* ⛔ This used to return early, on the reasoning that a missing block is the schema's business. The review
|
|
126
|
+
* showed that reasoning breaks AC-1's second clause: `hexasync compose` runs no JSON Schema at all, so the
|
|
127
|
+
* report said nothing while the editor's schema flagged it — the two surfaces disagreeing about the most
|
|
128
|
+
* likely authoring shape, which is the one thing this story exists to prevent. The runtime throws either way.
|
|
129
|
+
*/
|
|
130
|
+
/**
|
|
131
|
+
* A key only counts when it is a scalar. `key: {a: 1}` produced `step "[object Object]"` in the message AND in
|
|
132
|
+
* `locateValue`, which the report then tried to find in the source.
|
|
133
|
+
*/
|
|
134
|
+
const stepKey = typeof step?.key === 'string' || typeof step?.key === 'number'
|
|
135
|
+
? String(step.key)
|
|
136
|
+
: '(step)';
|
|
137
|
+
const data = step?.data && typeof step.data === 'object' && !Array.isArray(step.data)
|
|
138
|
+
? step.data
|
|
139
|
+
: {};
|
|
140
|
+
/**
|
|
141
|
+
* `data` written as something other than a block of fields is its OWN defect, and naming it as a missing
|
|
142
|
+
* field sends the author to the wrong place: told to add `dataPath` under `data: "oops"`, they cannot act.
|
|
143
|
+
*/
|
|
144
|
+
const authored = step?.data;
|
|
145
|
+
if (authored != null &&
|
|
146
|
+
(typeof authored !== 'object' || Array.isArray(authored))) {
|
|
147
|
+
issues.push({
|
|
148
|
+
ruleId: 'STEP-1',
|
|
149
|
+
family: 'STEP',
|
|
150
|
+
severity: 'high',
|
|
151
|
+
parentKey,
|
|
152
|
+
idOrKey,
|
|
153
|
+
message: `step "${stepKey}" (${displayType}) writes "data" as ${Array.isArray(authored) ? 'a list' : `a ${typeof authored}`} — ` +
|
|
154
|
+
`it must be a block of fields`,
|
|
155
|
+
why: 'nothing in the step can be read, so it cannot run',
|
|
156
|
+
locateValue: stepKey,
|
|
157
|
+
});
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
for (const entry of required) {
|
|
161
|
+
if (isSet(data, entry.field, 'non-blank'))
|
|
162
|
+
continue;
|
|
163
|
+
issues.push({
|
|
164
|
+
ruleId: 'STEP-1',
|
|
165
|
+
family: 'STEP',
|
|
166
|
+
severity: 'high',
|
|
167
|
+
parentKey,
|
|
168
|
+
idOrKey,
|
|
169
|
+
message: `step "${stepKey}" (${displayType}) does not set "${entry.field}", which it requires — ` +
|
|
170
|
+
entry.whenMissing,
|
|
171
|
+
why: entry.authority === 'executor'
|
|
172
|
+
? 'the step cannot do its work'
|
|
173
|
+
: 'the editor already reports this; the composition report did not',
|
|
174
|
+
locateValue: stepKey,
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
if (!rule)
|
|
178
|
+
return;
|
|
179
|
+
const usable = rule.fields.filter((field) => isSet(data, field, rule.branch[field]));
|
|
180
|
+
const guarded = rule.fields.filter((field) => isSet(data, field, rule.guard[field]));
|
|
181
|
+
// The guard comes FIRST: a step that cannot run at all must not be reported as a step that silently drops a
|
|
182
|
+
// field. `dataPath: "", items: []` is both shapes at once, and only one of them is worth saying.
|
|
183
|
+
if (guarded.length === 0) {
|
|
184
|
+
issues.push({
|
|
185
|
+
ruleId: 'STEP-1',
|
|
186
|
+
family: 'STEP',
|
|
187
|
+
severity: 'high',
|
|
188
|
+
parentKey,
|
|
189
|
+
idOrKey,
|
|
190
|
+
message: `step "${stepKey}" (${displayType}) sets neither "${rule.fields[0]}" nor "${rule.fields[1]}" — ` +
|
|
191
|
+
`the step throws ${rule.throws} at run time`,
|
|
192
|
+
why: 'the step cannot run at all',
|
|
193
|
+
locateValue: stepKey,
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
else if (usable.length === 2) {
|
|
197
|
+
issues.push({
|
|
198
|
+
ruleId: 'STEP-1',
|
|
199
|
+
family: 'STEP',
|
|
200
|
+
severity: 'high',
|
|
201
|
+
parentKey,
|
|
202
|
+
idOrKey,
|
|
203
|
+
message: `step "${stepKey}" (${displayType}) sets both "${rule.fields[0]}" and "${rule.fields[1]}" — ` +
|
|
204
|
+
`"${rule.wins}" is used and the other is ignored, with no error`,
|
|
205
|
+
why: 'the step runs against data you did not mean, and nothing says so',
|
|
206
|
+
locateValue: stepKey,
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
};
|
|
210
|
+
for (const collection of ['pullers', 'pushers', 'objects']) {
|
|
211
|
+
for (const component of arr(cnf, collection)) {
|
|
212
|
+
const id = component?.id != null ? String(component.id) : undefined;
|
|
213
|
+
for (const stage of STAGES) {
|
|
214
|
+
for (const step of arr(component, stage))
|
|
215
|
+
check(step, collection, id);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* ⛔ A webhook's steps are one level DEEPER, under a `targets` map — `webhooks[].targets.<TARGET>.pullSteps[]`.
|
|
221
|
+
*
|
|
222
|
+
* `webhooks` was in the flat loop above, which reads stage keys that never exist there: the whole collection was
|
|
223
|
+
* checked vacuously. The corpus has **26 `DIRECT_INDEX` steps inside webhook targets** (10 authored), so this was
|
|
224
|
+
* not a theoretical gap. `flow.ts` already walks it correctly; this rule did not copy that.
|
|
225
|
+
*/
|
|
226
|
+
for (const webhook of arr(cnf, 'webhooks')) {
|
|
227
|
+
const id = webhook?.id != null ? String(webhook.id) : undefined;
|
|
228
|
+
const targets = webhook?.targets &&
|
|
229
|
+
typeof webhook.targets === 'object' &&
|
|
230
|
+
!Array.isArray(webhook.targets)
|
|
231
|
+
? webhook.targets
|
|
232
|
+
: {};
|
|
233
|
+
for (const [targetKey, target] of Object.entries(targets)) {
|
|
234
|
+
/**
|
|
235
|
+
* The TARGET is carried into the id, as `flow.ts:776` already does. Without it two same-keyed steps under
|
|
236
|
+
* different targets produce byte-identical findings and `locateValue` cannot tell them apart.
|
|
237
|
+
*
|
|
238
|
+
* Only `pullSteps` is read: measured across the corpus, 245 targets declare exactly that one stage key, and
|
|
239
|
+
* looping the other eight would be inventing a schema.
|
|
240
|
+
*/
|
|
241
|
+
for (const step of arr(target, 'pullSteps')) {
|
|
242
|
+
check(step, 'webhooks', id ? `${id} target ${targetKey}` : `target ${targetKey}`);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
return issues;
|
|
247
|
+
},
|
|
248
|
+
};
|
|
249
|
+
//# sourceMappingURL=stepData.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stepData.js","sourceRoot":"","sources":["../../../src/validate/rules/stepData.ts"],"names":[],"mappings":"AA8DA,MAAM,KAAK,GAAG,CAAC,IAAS,EAAE,KAAa,EAAE,GAAa,EAAW,EAAE;IACjE,MAAM,KAAK,GAAG,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC;IAC5B,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IACxD,IAAI,GAAG,KAAK,WAAW;QACrB,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IAChE,IAAI,GAAG,KAAK,WAAW,EAAE,CAAC;QACxB;;;;;;;WAOG;QACH,IAAI,KAAK,CAAC,OAAO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,CAAC,CAAC,OAAO,CAAC,OAAO;gBACjB,CAAC,CAAC,EAAE,CAAC;YACT,KAAK,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,CAAM,OAAO,CAAC,EAAE,CAAC;gBAC/D;;;;;;mBAMG;gBACH,KAAK,MAAM,IAAI,IAAI,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,EAAE,CAAC;oBAC5C,KAAK,CACH,IAAI,EACJ,UAAU,EACV,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,WAAW,SAAS,EAAE,CAAC,CAAC,CAAC,UAAU,SAAS,EAAE,CACzD,CAAC;gBACJ,CAAC;YACH,CAAC;QACH,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* STEP-2 / STEP-3 — a step's per-run execution cap says something the runtime will not do (Epic 9).
|
|
3
|
+
*
|
|
4
|
+
* ### The field
|
|
5
|
+
*
|
|
6
|
+
* `StepIterator` bounds how many times ONE step (`key` + `displayType`) may execute within a single run. Exceeding it
|
|
7
|
+
* trips a terminal `PULL_MAX_STEP_ITERATIONS`. An author raises that ceiling for a deliberately deep in-run
|
|
8
|
+
* (backward-`next`) loop by declaring `maxStepIterations`, and the resolution is exactly:
|
|
9
|
+
*
|
|
10
|
+
* ```csharp
|
|
11
|
+
* // StepIterator.cs:281 — ResolvePerStepCap
|
|
12
|
+
* var token = step.SelectToken("$.maxStepIterations") ?? step.SelectToken("$.data.maxStepIterations");
|
|
13
|
+
* if (token != null && (token.Type == JTokenType.Integer || token.Type == JTokenType.Float))
|
|
14
|
+
* over = token.ToObject<int?>();
|
|
15
|
+
* return over is > 0 ? Math.Min(over.Value, totalBudget) : EngineMaxStepIterations; // default 1000
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* Read off that, and nothing else: the ROOT wins over `data` (`??`, not a merge); a non-numeric value is ignored
|
|
19
|
+
* entirely; a value ≤ 0 is ignored; any surviving value is clamped to the whole-run budget, which is at most
|
|
20
|
+
* `EngineMaxIterations` (300,000) and may be smaller when the template declares its own.
|
|
21
|
+
*
|
|
22
|
+
* ### ⛔ A float is NOT ignored, though the epic's AC-1 says it is
|
|
23
|
+
*
|
|
24
|
+
* `JTokenType.Float` passes the type check and `ToObject<int?>()` converts it, so `maxStepIterations: 2.7` becomes
|
|
25
|
+
* **3** and is used. AC-1 lists a float among the values that are "ignored"; that is wrong, and core.api's own
|
|
26
|
+
* `StepIteratorPerStepCapTests` has no float case either way — absent, root, nested, root-wins, 0, -5, a string and
|
|
27
|
+
* the clamp are covered, so the behaviour is defined by the code alone. This rule reports what the code does and the
|
|
28
|
+
* AC was amended rather than the behaviour described from the spec. Getting this backwards is how this feature has
|
|
29
|
+
* repeatedly shipped a "requirement" the executor falsifies.
|
|
30
|
+
*
|
|
31
|
+
* ### Severity, earned rather than assumed (G-7)
|
|
32
|
+
*
|
|
33
|
+
* ⚠️ **Measured 2026-08-14: `maxStepIterations` appears ZERO times in the corpus**, as does `maxIterations`. The
|
|
34
|
+
* field is new in the runtime and no template has adopted it, so BOTH ids fire on nothing today. That is stated
|
|
35
|
+
* because "fires on nothing" and "is broken" look identical in a log — this is a guard for a capability as it is
|
|
36
|
+
* adopted, not a report on one in use.
|
|
37
|
+
*
|
|
38
|
+
* `STEP-2` is `medium`: the author believes they raised the ceiling and did not, so the run trips
|
|
39
|
+
* `PULL_MAX_STEP_ITERATIONS` at the old default with nothing anywhere explaining why. `STEP-3` is `low` — the value
|
|
40
|
+
* is honoured, just not at the number written, which is worth stating and is not a defect. Neither blocks a compose
|
|
41
|
+
* (G-10).
|
|
42
|
+
*/
|
|
43
|
+
import type { ValidationRule } from '../rule.js';
|
|
44
|
+
/** `StepIterator.EngineMaxStepIterations` — the per-step ceiling when no usable override is declared. */
|
|
45
|
+
export declare const ENGINE_MAX_STEP_ITERATIONS = 1000;
|
|
46
|
+
/** `StepIterator.EngineMaxIterations` — the hard ceiling on TOTAL step executions, and so on any per-step cap. */
|
|
47
|
+
export declare const ENGINE_MAX_ITERATIONS = 300000;
|
|
48
|
+
export declare const stepIterationsRule: ValidationRule;
|
|
49
|
+
//# sourceMappingURL=stepIterations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stepIterations.d.ts","sourceRoot":"","sources":["../../../src/validate/rules/stepIterations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAIjD,yGAAyG;AACzG,eAAO,MAAM,0BAA0B,OAAO,CAAC;AAE/C,kHAAkH;AAClH,eAAO,MAAM,qBAAqB,SAAU,CAAC;AA2C7C,eAAO,MAAM,kBAAkB,EAAE,cAgIhC,CAAC"}
|