@beehexa/hexasync-template-validate 2608.7.4 → 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
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { UNSUPPORTED_CONNECTOR_SHORT } from '@beehexa/hexasync-template-model';
|
|
1
2
|
export const RULE_CATALOG = {
|
|
2
3
|
// REF — reference integrity (profile-local edges only).
|
|
3
4
|
'REF-1': {
|
|
@@ -116,6 +117,105 @@ export const RULE_CATALOG = {
|
|
|
116
117
|
what: 'A new-kind puller (has `steps`) also declares a legacy field (responseFilters/beforePullSteps/pullSteps/afterPullSteps).',
|
|
117
118
|
consequence: 'The two shapes are mutually exclusive; the legacy fields are ignored on the steps path and signal a half-migrated puller — remove them.',
|
|
118
119
|
},
|
|
120
|
+
/**
|
|
121
|
+
* STEP — what a step's own `data` must contain (Story 5.12).
|
|
122
|
+
*
|
|
123
|
+
* A separate family from FLOW, which is about routing between steps. These are about the inside of one step, and
|
|
124
|
+
* a reader filtering for "why is my step wrong" should not have to know that a missing `sql` and a dangling
|
|
125
|
+
* `next` share a prefix.
|
|
126
|
+
*/
|
|
127
|
+
'STEP-1': {
|
|
128
|
+
title: 'A step’s `data` cannot run as written',
|
|
129
|
+
what: 'A step leaves out a field it requires, sets BOTH of a pair the runtime treats as one-or-the-other, sets ' +
|
|
130
|
+
'NEITHER, or writes `data` as something other than a block of fields. ⚠️ The two executors that read ' +
|
|
131
|
+
'`items`/`dataPath` resolve them in OPPOSITE order — `SAVE_TASK_DATA` keeps `items`, `DIRECT_INDEX` keeps ' +
|
|
132
|
+
'`dataPath` — so a habit learned on one step is wrong on the other.',
|
|
133
|
+
consequence: 'A missing required field: the step cannot do its work — sometimes by throwing, and sometimes by quietly ' +
|
|
134
|
+
'doing nothing (a `DIRECT_INDEX` with no `objectIds` indexes into no objects at all). Both of a pair set: ' +
|
|
135
|
+
'the loser is dropped in silence, so the step runs against data you did not mean. Neither set: the step ' +
|
|
136
|
+
'throws. ⚠️ An empty `dataPath` is set for the branch that picks a winner and ABSENT for the check that ' +
|
|
137
|
+
'throws — so beside a real `items` it wins and selects the whole run context as a single row, and on its ' +
|
|
138
|
+
'own it throws. That split is the hardest shape of all to debug.',
|
|
139
|
+
},
|
|
140
|
+
'API-1': {
|
|
141
|
+
title: 'A step sets a field the runtime never reads',
|
|
142
|
+
what: 'An `API` step writes `annonymous` — a misspelling of `anonymous`. ⚠️ Correcting the spelling does not ' +
|
|
143
|
+
'change the request either: the worker parses `anonymous` and never acts on it, so BOTH spellings are inert ' +
|
|
144
|
+
'today. The finding names a stated intent the platform does not honour.',
|
|
145
|
+
consequence: 'Nothing about the request changes, now or after a correction — the connection authenticates regardless. ' +
|
|
146
|
+
'Reported so the line is not mistaken for a working switch, and so the gap between what the template says ' +
|
|
147
|
+
'and what the platform does is visible somewhere.',
|
|
148
|
+
},
|
|
149
|
+
/**
|
|
150
|
+
* ⛔ `ARG-8` DOES NOT EXIST, deliberately, and this is the only place a reader of this file will learn why.
|
|
151
|
+
*
|
|
152
|
+
* Story 10.8 AC-3 asks that an argument a step type does not support be reported. The rule was written, measured
|
|
153
|
+
* against the corpus at 49 findings — every one FALSE — and deleted. `PusherStepExecutor.cs:129` passes the whole
|
|
154
|
+
* `StepArguments` map into `pusher.PushItem`, and any argument is readable from any expression as
|
|
155
|
+
* `__this.arguments.<name>`. "Not looked up by name by this executor" is simply not the same claim as "does
|
|
156
|
+
* nothing", and a closed per-type allowlist cannot tell them apart. The per-type knowledge ships as documentation
|
|
157
|
+
* in the extension's step schema instead. Do not re-add it without a per-executor pass-through map.
|
|
158
|
+
*/
|
|
159
|
+
'API-2': {
|
|
160
|
+
title: 'An API step has no address for the request it will build',
|
|
161
|
+
what: 'The step’s `type` selects which kind of request is built, and every type except `GOOGLE_APP_SCRIPT` builds ' +
|
|
162
|
+
'it from `url`. This step names such a type and sets no `url`. ⚠️ Only steps that look HTTP-shaped are ' +
|
|
163
|
+
'judged: one whose `data` carries `sql`, or which declares no HTTP field at all, belongs to a connector with ' +
|
|
164
|
+
'its own vocabulary and is left alone.',
|
|
165
|
+
consequence: 'The request cannot be addressed, so the step fails when it runs rather than when it is saved.',
|
|
166
|
+
},
|
|
167
|
+
'STEP-2': {
|
|
168
|
+
title: 'A step’s execution cap will not be applied as written',
|
|
169
|
+
what: 'A step declares `maxStepIterations` — the number of times that one step may run within a single run — as ' +
|
|
170
|
+
'something the runtime will not use: text, a true/false value, a list, a block, or a number that is zero or ' +
|
|
171
|
+
'negative. The runtime ignores it entirely and applies the engine default of 1000. ⚠️ A DECIMAL is the ' +
|
|
172
|
+
'exception: it is not ignored, it is rounded (`2.7` becomes `3`), so the cap that applies is not the number ' +
|
|
173
|
+
'written. Set at the step root or under `data`; if both are set the **root wins** and the other is dropped ' +
|
|
174
|
+
'in silence.',
|
|
175
|
+
consequence: 'The ceiling is not raised. A deliberately deep in-run loop still stops at 1000 executions of that step and ' +
|
|
176
|
+
'the run fails with `PULL_MAX_STEP_ITERATIONS` — naming a limit the author believes they already lifted, ' +
|
|
177
|
+
'with nothing at run time reporting that the value was discarded.',
|
|
178
|
+
},
|
|
179
|
+
'STEP-3': {
|
|
180
|
+
title: 'A step’s execution cap is larger than the whole run’s budget',
|
|
181
|
+
what: 'A step’s `maxStepIterations` exceeds the total number of step executions the run allows — the template’s ' +
|
|
182
|
+
'own `maxIterations` where it declares one, otherwise the engine ceiling of 300,000.',
|
|
183
|
+
consequence: 'The value is honoured, but clamped down to the run’s total: a single step can never be allowed more ' +
|
|
184
|
+
'executions than the whole run. Informational — nothing is broken, and the number in the file is simply not ' +
|
|
185
|
+
'the number that applies.',
|
|
186
|
+
},
|
|
187
|
+
'CTX-3': {
|
|
188
|
+
title: 'Steps are declared outside any component',
|
|
189
|
+
what: 'A step stage (`pullSteps`, `pushSteps`, …) sits at the top level of the document rather than inside a ' +
|
|
190
|
+
'puller or a pusher. It usually means a partial was composed at the root instead of into a component.',
|
|
191
|
+
consequence: 'Nothing runs those steps, and no validation rule sees them either — they are invisible rather than ' +
|
|
192
|
+
'reported. Move them inside the component they belong to.',
|
|
193
|
+
},
|
|
194
|
+
/**
|
|
195
|
+
* CTX — the context an expression reads, and whether the runtime can provide it (Story 8.13).
|
|
196
|
+
*
|
|
197
|
+
* A separate family from STEP and FLOW: those are about a step's own configuration and about routing between
|
|
198
|
+
* steps, while these are about the VALUES a step reads out of the run. The distinguishing property is that every
|
|
199
|
+
* CTX finding degrades in silence — nothing throws, nothing logs, a guard simply never fires.
|
|
200
|
+
*/
|
|
201
|
+
'CTX-1': {
|
|
202
|
+
title: 'A context path names a root that has no such child',
|
|
203
|
+
what: 'An expression reads something like `pusher.lastToken.…` where the root exists but that child does not — ' +
|
|
204
|
+
'`lastToken` is written only for a puller, so on a pusher it is never there.',
|
|
205
|
+
consequence: 'The path resolves to nothing under any composition, so whatever reads it receives an empty value rather ' +
|
|
206
|
+
'than an error. ⚠️ Fires on nothing in the corpus today: it guards a mistake that reads exactly like the ' +
|
|
207
|
+
'puller idiom an author has just come from.',
|
|
208
|
+
},
|
|
209
|
+
'CTX-2': {
|
|
210
|
+
title: 'A step reads a step key its phase does not contain',
|
|
211
|
+
what: 'An expression reads `puller.current.SOME_STEP` (or the same thing through the `history` / `lastToken` ' +
|
|
212
|
+
'alias) naming a step the phase does not declare at all — usually a step that was renamed, and the alias is ' +
|
|
213
|
+
'the same object as the phase rather than a separate store. ⚠️ A step declared LATER in the phase is NOT ' +
|
|
214
|
+
'reported: from the second page onwards it holds the previous page’s value, which is the pagination idiom.',
|
|
215
|
+
consequence: 'The path resolves to nothing on every run, so a guard written around it never fires and its `else` branch ' +
|
|
216
|
+
'is the only one ever taken. The commonest shape is an incremental pull whose watermark never resolves, ' +
|
|
217
|
+
'which quietly becomes a full re-pull from the initial date — forever, and without an error anywhere.',
|
|
218
|
+
},
|
|
119
219
|
// TBL — table & column integrity.
|
|
120
220
|
'TBL-1': {
|
|
121
221
|
title: 'Table has no SOURCE_ID column',
|
|
@@ -186,8 +286,12 @@ export const RULE_CATALOG = {
|
|
|
186
286
|
},
|
|
187
287
|
'FLOW-5': {
|
|
188
288
|
title: 'Cycle in the workflow graph',
|
|
189
|
-
what: 'The `next` edges form a cycle, so the workflow can loop back on itself.'
|
|
190
|
-
|
|
289
|
+
what: 'The `next` edges form a cycle, so the workflow can loop back on itself. For a NEW-KIND puller the cycle is ' +
|
|
290
|
+
'analysed and reported only when it is unguarded, inescapable, or unbounded — a guarded, bounded pagination ' +
|
|
291
|
+
'loop is valid and says nothing. For an old-kind puller or a pusher there is nothing to analyse, so any ' +
|
|
292
|
+
'back-edge is reported at `low` as something to look at.',
|
|
293
|
+
consequence: 'A loop with no reachable exit never terminates. A paginating loop that does have one is fine — which is why ' +
|
|
294
|
+
'the old-kind report is advisory rather than a defect claim.',
|
|
191
295
|
},
|
|
192
296
|
'FLOW-6': {
|
|
193
297
|
title: 'Empty SWITCH / incomplete branch',
|
|
@@ -196,17 +300,109 @@ export const RULE_CATALOG = {
|
|
|
196
300
|
'`else` that is a STRING is a step key and needs nothing further — only the object form is a branch.',
|
|
197
301
|
consequence: 'The branch step has nowhere to route — execution stalls or errors.',
|
|
198
302
|
},
|
|
303
|
+
'FLOW-8': {
|
|
304
|
+
title: 'Dangling `_outputs` reference',
|
|
305
|
+
what: 'A step reads `_outputs.<KEY>` where no step ANYWHERE in the same component declares that key. Checked over ' +
|
|
306
|
+
'the whole component rather than one stage, because reading an earlier stage\u2019s output is legitimate \u2014 an ' +
|
|
307
|
+
'`onErrorSteps` step may read what `steps` produced.',
|
|
308
|
+
consequence: 'The value resolves to nothing at run time. Nothing throws: the expression yields empty, so the mistake ' +
|
|
309
|
+
'surfaces as a blank field or a skipped branch rather than as an error.',
|
|
310
|
+
},
|
|
199
311
|
'FLOW-7': {
|
|
200
312
|
title: 'New-kind puller: misplaced sweep / bad Exception reference',
|
|
201
313
|
what: 'A removal-recipe `UPDATE_TASK_DATA_STATUS` (statusToAdd includes Removed) sits in `finalSteps`, or an Exception step `fromStep` names no existing step.',
|
|
202
314
|
consequence: 'A partial run sweeps un-pulled pages as removed, or the exception handler never binds to its source step.',
|
|
203
315
|
},
|
|
204
|
-
// RET — component types the platform has retired (Story 1.10).
|
|
316
|
+
// RET — component types the platform has retired (Story 1.10). Was last in FAMILY_ORDER; CONN and ARG now
|
|
317
|
+
// follow it, which the FAMILY_ORDER docstring explains.
|
|
205
318
|
'RET-1': {
|
|
206
319
|
title: 'Retired component type',
|
|
207
320
|
what: 'The project declares a `schemas` or `reports` component. Both types are retired: a Task (an `objects[]` entry) with `type: REFERENCE` replaces Schema. Report has no documented successor yet.',
|
|
208
321
|
consequence: 'Still composes today, so this is a warning and the build succeeds — but the type will stop being supported. Migrate Schema components to `type: REFERENCE` Tasks; ask the platform team about Report.',
|
|
209
322
|
},
|
|
323
|
+
// CONN — a connection's connector identity (Story 2.1, FR-9). Numbered from the fixture contract, which was
|
|
324
|
+
// written before the rules: CONN-1 uncatalogued, CONN-2 cross-entry system code, CONN-3 unusable identity,
|
|
325
|
+
// CONN-4 V3 without a system code, CONN-5 V2 carrying one.
|
|
326
|
+
'CONN-0': {
|
|
327
|
+
title: 'Connector-catalog checks were skipped',
|
|
328
|
+
what: "No connector catalog was supplied to this run, so the four catalog-dependent CONN checks could not run. The catalog ships in the VS Code extension's asset tree by decision, and a bare `hexasync compose` has no access to it.",
|
|
329
|
+
consequence: 'Nothing is wrong with the template; the run simply could not answer four of the five connector questions. Said out loud on purpose: "no catalog" must never be indistinguishable from "everything is fine".',
|
|
330
|
+
},
|
|
331
|
+
'CONN-1': {
|
|
332
|
+
title: 'Connector is not in the shipped catalog',
|
|
333
|
+
what: 'The connection names a well-formed connector id (or a V3 system code) that no catalog entry claims. Reported at INFO, and the message names the catalog version.',
|
|
334
|
+
/**
|
|
335
|
+
* ⛔ AD-31 — the request route is QUOTED, never re-typed (Epic 2 review).
|
|
336
|
+
*
|
|
337
|
+
* This sentence used to hand-write the policy, support address and all, and because the appendix
|
|
338
|
+
* renders `consequence`, the hand-written copy was the one a reader actually saw — while
|
|
339
|
+
* `unsupportedConnectorGuidance` and `REQUEST_REQUIREMENTS` in `@beehexa/hexasync-template-model` were
|
|
340
|
+
* referenced by nothing but their own spec file. AD-31 exists so six surfaces cannot drift; this was the
|
|
341
|
+
* seventh wording, shipped on the surface that mattered most.
|
|
342
|
+
*
|
|
343
|
+
* `unsupportedConnectorRequestGuard.spec.ts` now fails if the address or the four requirements are written
|
|
344
|
+
* anywhere but that one module, which is epic AC-4 for Story 2.5.
|
|
345
|
+
*/
|
|
346
|
+
consequence: "Absence from the catalog is NOT proof of a mistake — most corpus connections are Gateway V1 and work today — so this is information, not an error. When the catalog is simply behind, that is the tool's fault, which is why the version is named. If the system genuinely is unsupported: " +
|
|
347
|
+
UNSUPPORTED_CONNECTOR_SHORT,
|
|
348
|
+
},
|
|
349
|
+
'CONN-2': {
|
|
350
|
+
title: 'System code belongs to a different connector',
|
|
351
|
+
what: 'Two shapes, one consequence. (a) `systemId` and `systemCode` are 1:1 — each catalog entry has exactly one of each and neither is shared — so a Gateway V3 connection whose two fields name DIFFERENT entries is definitively wrong, not merely suspicious. (b) A V3 connection whose `systemCode` is registered to a real catalogued system that this connector does not cover, with or without a `systemId`. Both are the copy-paste mistake, and this is the only CRITICAL finding in this family.',
|
|
352
|
+
consequence: 'The connection WORKS and authenticates against the wrong system with valid-looking credentials, so nothing fails visibly and the data goes to the wrong place. Dangerous beats broken, because broken announces itself.',
|
|
353
|
+
},
|
|
354
|
+
'CONN-4': {
|
|
355
|
+
title: 'Gateway V3 connection has no system code',
|
|
356
|
+
what: 'The connection names the shared universal connector id and sets no `systemCode`. Keyed on the connector ID rather than on `generation: v3`, because the id is the fact dispatch routes on and the only one present in the document.',
|
|
357
|
+
consequence: 'Every V3 system shares one connector id, so the system code is the only thing dispatch can route on. Without it the connection reaches no system at all — reported as an ERROR, found before deployment rather than after. Not critical: that band is for a connection that works and reaches the WRONG system, which does not announce itself the way this does.',
|
|
358
|
+
},
|
|
359
|
+
'CONN-5': {
|
|
360
|
+
title: 'System code on a Gateway V2 connection is ignored',
|
|
361
|
+
what: 'A non-universal (V2) connection carries a `systemCode`. Both `systemCode` and `systemId` are OPTIONAL on V2, and V2 dispatch routes on the connector id alone and never reads them.',
|
|
362
|
+
consequence: 'Nothing breaks and nothing needs fixing — the field is optional here, which is why this is information rather than a warning. Surfaced because an author who set it expects it to do something, and on V2 it does not. Keeping it is reasonable, not least ahead of a V3 migration.',
|
|
363
|
+
},
|
|
364
|
+
// ARG — transform `arguments` correctness (Epic TA7). Restored 2026-08-09 after a ruleCatalog edit in the
|
|
365
|
+
// CONN work clobbered them; recovered from dist/ and re-indented. Owned by the transformation-arguments work.
|
|
366
|
+
'ARG-1': {
|
|
367
|
+
title: 'ARG operand references an undeclared argument',
|
|
368
|
+
what: 'A `where`/`join` operand `{ type: "ARG", key }` names a `key` that the transform\'s `arguments` block does not declare.',
|
|
369
|
+
consequence: 'The operand binds nothing at run time. An error: declare the argument in this transform, or reference an existing one.',
|
|
370
|
+
},
|
|
371
|
+
'ARG-2': {
|
|
372
|
+
title: 'Argument has an unknown declared type',
|
|
373
|
+
what: 'An ordered `arguments` entry declares a `type` that is not one of `string`/`integer`/`decimal`/`boolean`/`timestamp`/`uuid` (a typo like `"int"`).',
|
|
374
|
+
consequence: 'A warning: the value is not coerced to the intended type and binds as text, which can throw a type mismatch (e.g. `integer = text`) at run time.',
|
|
375
|
+
},
|
|
376
|
+
'ARG-3': {
|
|
377
|
+
title: 'Reserved argument key',
|
|
378
|
+
what: 'A declared argument `key` is `__`-prefixed or a builder-reserved name (`limit`, `offset`, or `p_#####`).',
|
|
379
|
+
consequence: 'An error: the runtime bans these keys — a `__` key collides with a system column and a reserved name collides with a builder param.',
|
|
380
|
+
},
|
|
381
|
+
'ARG-4': {
|
|
382
|
+
title: 'ARG operand in select',
|
|
383
|
+
what: 'An `ARG` operand appears in a `select` projection.',
|
|
384
|
+
consequence: 'An error: SELECT projects identifiers only — a value-binding `ARG` in select is rejected at compose. Bind the arg in `where`/`join` instead.',
|
|
385
|
+
},
|
|
386
|
+
'ARG-5': {
|
|
387
|
+
title: 'Duplicate declared argument',
|
|
388
|
+
what: 'The ordered `arguments` form declares the same `key` more than once.',
|
|
389
|
+
consequence: 'A warning: only the last occurrence survives (index order); the earlier declarations are silently dropped.',
|
|
390
|
+
},
|
|
391
|
+
'ARG-6': {
|
|
392
|
+
title: 'Unused declared argument',
|
|
393
|
+
what: 'A declared argument is never referenced — no `ARG` operand, no `@key` in the raw SQL, and no reuse by a later argument via `{{ __this.arguments.<key> }}`.',
|
|
394
|
+
consequence: 'A warning: the argument is resolved for every item to no effect — reference it or remove it.',
|
|
395
|
+
},
|
|
396
|
+
'ARG-7': {
|
|
397
|
+
title: 'List argument under a non-IN operator',
|
|
398
|
+
what: 'An `isList` argument is bound by an `ARG` operand under a comparison whose operator is not `IN` / `NOT_IN`.',
|
|
399
|
+
consequence: 'A warning: a list value only makes sense for set membership — under `=`/`>`/etc. it will not match as intended.',
|
|
400
|
+
},
|
|
401
|
+
'CONN-3': {
|
|
402
|
+
title: 'Connection has no usable connector identity',
|
|
403
|
+
what: 'A `connectors[]` entry names no connector — neither `connectorId` nor its legacy spelling `providerId` is set — or names one that is not a well-formed GUID. Judged on the COMPOSED document, so a `**Token**` identity is measured by the value it resolves to, not by the token.',
|
|
404
|
+
consequence: 'The connection cannot reach any system, so every puller, pusher and webhook that uses it fails at run time. An error, not a warning: there is no version of this that works. A value that is still a `**Token**` after composition is a VARIABLE problem and is reported by `VAR-1` instead, so the two never both fire for one cause.',
|
|
405
|
+
},
|
|
210
406
|
};
|
|
211
407
|
/**
|
|
212
408
|
* Family order for the appendix; unknown families sort last, alphabetically.
|
|
@@ -217,16 +413,26 @@ export const RULE_CATALOG = {
|
|
|
217
413
|
* came out in that order. Both were pre-existing for the unlisted families; adding `RET` is what made the
|
|
218
414
|
* docstring's promise visibly false. Found by the Story 1.10 review.
|
|
219
415
|
*
|
|
220
|
-
* `RET`
|
|
416
|
+
* `RET` was last deliberately — a deprecation notice is the least urgent thing in a report — and it is **no
|
|
417
|
+
* longer last**: `CONN` and `ARG` were appended after it by two concurrent features. The Epic 2 review caught
|
|
418
|
+
* three comments still asserting the old arrangement, including one claiming `CONN` sits "last-but-one" while
|
|
419
|
+
* `ARG` follows it.
|
|
420
|
+
*
|
|
421
|
+
* The ORDER IS FAMILY AGE, not urgency, and that is the honest description of what this array is: families were
|
|
422
|
+
* appended as they were built. A reader looking for the most serious findings uses the severity markers in the
|
|
423
|
+
* report body, which are ordered by consequence; the appendix is a reference list, and a stable order matters
|
|
424
|
+
* more there than a meaningful one. Anything appended here from now on lands after `RET` too — say so rather
|
|
425
|
+
* than re-litigating the position of a deprecation notice each time.
|
|
221
426
|
*
|
|
222
|
-
*
|
|
223
|
-
*
|
|
224
|
-
*
|
|
225
|
-
* than a list that happens to omit one, and so retiring a twelfth family does not silently jump ahead of it.
|
|
427
|
+
* `RET`'s own entry is REDUNDANT and kept on purpose: an unlisted family falls to index `99`, so `RET` would
|
|
428
|
+
* land after everything anyway — mutation-checked, deleting the `'RET'` line changes no test. What fixed the
|
|
429
|
+
* original defect was naming the OTHERS. It stays listed so the array reads as a complete, intentional order.
|
|
226
430
|
*/
|
|
227
431
|
const FAMILY_ORDER = [
|
|
228
432
|
'REF',
|
|
229
433
|
'DUP',
|
|
434
|
+
// STEP sits with the structural families: it is about one step's own contents.
|
|
435
|
+
'STEP',
|
|
230
436
|
'TBL',
|
|
231
437
|
'VAR',
|
|
232
438
|
'FLOW',
|
|
@@ -236,6 +442,10 @@ const FAMILY_ORDER = [
|
|
|
236
442
|
'OVW',
|
|
237
443
|
'PLK',
|
|
238
444
|
'RET',
|
|
445
|
+
// Appended in build order — see the docstring above. `CONN` (Epic 2) and `ARG` (transformation-arguments)
|
|
446
|
+
// landed after `RET`, which is why the docstring no longer claims `RET` is last.
|
|
447
|
+
'CONN',
|
|
448
|
+
'ARG',
|
|
239
449
|
];
|
|
240
450
|
/** The catalog entries for the given rule ids, deduped and sorted by family then number.
|
|
241
451
|
* Rule ids with no catalog entry are skipped (never invents documentation). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ruleCatalog.js","sourceRoot":"","sources":["../../src/validate/ruleCatalog.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ruleCatalog.js","sourceRoot":"","sources":["../../src/validate/ruleCatalog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAiB/E,MAAM,CAAC,MAAM,YAAY,GAA4B;IACnD,wDAAwD;IACxD,OAAO,EAAE;QACP,KAAK,EAAE,mCAAmC;QAC1C,IAAI,EAAE,2OAA2O;QACjP,WAAW,EACT,sEAAsE;KACzE;IACD,OAAO,EAAE;QACP,KAAK,EAAE,mCAAmC;QAC1C,IAAI,EAAE,8EAA8E;QACpF,WAAW,EACT,uEAAuE;KAC1E;IACD,OAAO,EAAE;QACP,KAAK,EAAE,kCAAkC;QACzC,IAAI,EAAE,4EAA4E;QAClF,WAAW,EAAE,2DAA2D;KACzE;IACD,OAAO,EAAE;QACP,KAAK,EAAE,uDAAuD;QAC9D,IAAI,EAAE,4FAA4F;QAClG,WAAW,EACT,+DAA+D;KAClE;IACD,OAAO,EAAE;QACP,KAAK,EAAE,uCAAuC;QAC9C,IAAI,EAAE,2FAA2F;QACjG,WAAW,EACT,uEAAuE;KAC1E;IACD,OAAO,EAAE;QACP,KAAK,EAAE,mCAAmC;QAC1C,IAAI,EAAE,uGAAuG;QAC7G,WAAW,EACT,wEAAwE;KAC3E;IACD,OAAO,EAAE;QACP,KAAK,EAAE,2CAA2C;QAClD,IAAI,EAAE,gFAAgF;QACtF,WAAW,EACT,kEAAkE;KACrE;IACD,QAAQ,EAAE;QACR,KAAK,EAAE,kCAAkC;QACzC,IAAI,EAAE,8FAA8F;QACpG,WAAW,EAAE,uCAAuC;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,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;QACzE,OAAO,EAAE,GAAG,EAAE,CAAC;IACjB,CAAC,CAAC;SACD,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,YAAY,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;AAC9D,CAAC;AAED,SAAS,WAAW,CAAC,EAAU;IAC7B,MAAM,CAAC,GAAG,qBAAqB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACzC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;AAC5C,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API-1 / API-2 — an `API` step's `data`, judged by the request builder its `type` selects (Epic 10).
|
|
3
|
+
*
|
|
4
|
+
* ### The model, read from the runtime rather than assumed
|
|
5
|
+
*
|
|
6
|
+
* `displayType: API` does **not** mean HTTP. It means *call the connector*, and the connector decides what it
|
|
7
|
+
* reads — `ApiStepExecutor` itself reads exactly one field (`gracefulException`) before delegating. For the HTTP
|
|
8
|
+
* connectors, the `data.type` value selects a request builder by keyed service
|
|
9
|
+
* (`ServiceInstaller.cs:756`, `REQUEST_BUILDER/{id}`), and **that** builder decides which fields exist:
|
|
10
|
+
*
|
|
11
|
+
* | `type` | builder | reads |
|
|
12
|
+
* | --- | --- | --- |
|
|
13
|
+
* | `REST` (default) | `RestRequestBuilder` | `url`, `queries`, `body` |
|
|
14
|
+
* | `GRAPHQL` | `GraphqlRequestBuilder` | `url`, `body.query`, `body.variables` |
|
|
15
|
+
* | `SOAP` | `SOAPRequestBuilder` | `url`, `body` |
|
|
16
|
+
* | `FORM_URL_ENCODED` | `FormUrlEncodedRequestBuilder` | `url`, `queries`, `body` |
|
|
17
|
+
* | `MULTIPART_UPLOAD` | `MultipartUploadRequestBuilder` | `url`, `queries`, `body` |
|
|
18
|
+
* | `BINARY_UPLOAD` | `BinaryUploadRequestBuilder` | `url`, `queries` |
|
|
19
|
+
* | `DOWNLOAD_CSV` | `DownloadCSVReqeustBuilder` | `url`, `queries`, `columns` |
|
|
20
|
+
* | `GOOGLE_APP_SCRIPT` | `GoogleAppScriptRequestBuilder` | `body` — **no `url`** |
|
|
21
|
+
*
|
|
22
|
+
* `BaseHttpRequestBuilder` reads the rest for every type: `method` (`?? "POST"`), `headers`, `anonymous`,
|
|
23
|
+
* `acceptHttpStatuses`, `responseFilters`, `responseType` (`?? "NONE"`) and `logOutput`.
|
|
24
|
+
*
|
|
25
|
+
* ⚠️ A step whose `data` carries `sql` is a NON-HTTP connector on an `API` step — 9 authored corpus steps do this,
|
|
26
|
+
* on `**RMHConnector**` and `**SelfConnector**`. None of the table above applies to them, so this rule leaves them
|
|
27
|
+
* alone entirely rather than reporting every HTTP field as missing.
|
|
28
|
+
*
|
|
29
|
+
* ### Severity, earned from the corpus (G-7)
|
|
30
|
+
*
|
|
31
|
+
* Measured 2026-08-14 over 2,811 authored `API` steps:
|
|
32
|
+
*
|
|
33
|
+
* | rule | findings | severity |
|
|
34
|
+
* | --- | --- | --- |
|
|
35
|
+
* | `API-1` `annonymous: true` — the misspelling, where it changes behaviour | **6** | `high` |
|
|
36
|
+
* | `API-1` `annonymous: false` — the same misspelling, inert because `false` is the default | **1,691** | `low` |
|
|
37
|
+
* | `API-2` a `type` that reads `url`, with no `url` | **0** | `high`, preventative |
|
|
38
|
+
*
|
|
39
|
+
* ⛔ The `annonymous` split is the whole reason severity is per-finding rather than per-rule. The runtime reads
|
|
40
|
+
* `$.anonymous` and **never** `annonymous` — verified absent from every `.cs` file. 1,697 authored steps carry the
|
|
41
|
+
* misspelling, so a single `high` would put 1,697 findings in front of every author and be switched off within a
|
|
42
|
+
* day, taking the 6 real ones with it. Reporting the 6 that change behaviour loudly and the rest quietly is what
|
|
43
|
+
* keeps both visible.
|
|
44
|
+
*/
|
|
45
|
+
import type { ValidationRule } from '../rule.js';
|
|
46
|
+
/** `type` → whether that builder reads `url`. Absent means the value has no builder at all. */
|
|
47
|
+
export declare const API_TYPE_READS_URL: Readonly<Record<string, boolean>>;
|
|
48
|
+
/** A misspelling the runtime silently ignores, and the field it was meant to be. */
|
|
49
|
+
export declare const NEAR_MISS: Readonly<Record<string, string>>;
|
|
50
|
+
export declare const apiShapeRule: ValidationRule;
|
|
51
|
+
//# sourceMappingURL=apiShape.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apiShape.d.ts","sourceRoot":"","sources":["../../../src/validate/rules/apiShape.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAIjD,+FAA+F;AAC/F,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAShE,CAAC;AAEF,oFAAoF;AACpF,eAAO,MAAM,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAEtD,CAAC;AAiBF,eAAO,MAAM,YAAY,EAAE,cAyI1B,CAAC"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
/** `type` → whether that builder reads `url`. Absent means the value has no builder at all. */
|
|
2
|
+
export const API_TYPE_READS_URL = {
|
|
3
|
+
REST: true,
|
|
4
|
+
GRAPHQL: true,
|
|
5
|
+
SOAP: true,
|
|
6
|
+
FORM_URL_ENCODED: true,
|
|
7
|
+
MULTIPART_UPLOAD: true,
|
|
8
|
+
BINARY_UPLOAD: true,
|
|
9
|
+
DOWNLOAD_CSV: true,
|
|
10
|
+
GOOGLE_APP_SCRIPT: false,
|
|
11
|
+
};
|
|
12
|
+
/** A misspelling the runtime silently ignores, and the field it was meant to be. */
|
|
13
|
+
export const NEAR_MISS = {
|
|
14
|
+
annonymous: 'anonymous',
|
|
15
|
+
};
|
|
16
|
+
const STAGES = [
|
|
17
|
+
'beforePullSteps',
|
|
18
|
+
'pullSteps',
|
|
19
|
+
'afterPullSteps',
|
|
20
|
+
'steps',
|
|
21
|
+
'onErrorSteps',
|
|
22
|
+
'finalSteps',
|
|
23
|
+
'beforePushSteps',
|
|
24
|
+
'pushSteps',
|
|
25
|
+
'afterPushSteps',
|
|
26
|
+
];
|
|
27
|
+
const arr = (value, key) => Array.isArray(value?.[key]) ? value[key] : [];
|
|
28
|
+
export const apiShapeRule = {
|
|
29
|
+
id: 'API',
|
|
30
|
+
family: 'API',
|
|
31
|
+
run(ctx) {
|
|
32
|
+
const cnf = ctx.tokenForm;
|
|
33
|
+
if (!cnf || typeof cnf !== 'object')
|
|
34
|
+
return [];
|
|
35
|
+
const issues = [];
|
|
36
|
+
const check = (step, parentKey, componentId) => {
|
|
37
|
+
if (step?.displayType !== 'API')
|
|
38
|
+
return;
|
|
39
|
+
const data = step?.data && typeof step.data === 'object' && !Array.isArray(step.data)
|
|
40
|
+
? step.data
|
|
41
|
+
: undefined;
|
|
42
|
+
if (!data)
|
|
43
|
+
return;
|
|
44
|
+
const stepKey = typeof step?.key === 'string' || typeof step?.key === 'number'
|
|
45
|
+
? String(step.key)
|
|
46
|
+
: '(step)';
|
|
47
|
+
/**
|
|
48
|
+
* ⛔ The STEP, not just the component. `locateValue` is a bare field name and the locator scans the whole
|
|
49
|
+
* component span for the first match, so two API steps in one puller produced findings that underlined each
|
|
50
|
+
* other's lines — measured at 1,035 of 1,648 corpus findings sharing a (component, locateValue) key. The
|
|
51
|
+
* webhook branch already folded its target in for exactly this reason; the step loops did not.
|
|
52
|
+
*/
|
|
53
|
+
const idOrKey = componentId
|
|
54
|
+
? `${componentId} step ${stepKey}`
|
|
55
|
+
: `step ${stepKey}`;
|
|
56
|
+
/**
|
|
57
|
+
* ⛔ A non-HTTP connector on an `API` step reads its own fields — `sql` is the tell. Judging it against the
|
|
58
|
+
* HTTP table would report every field as missing on a step that is entirely correct.
|
|
59
|
+
*
|
|
60
|
+
* ⛔ This returns EARLY. It used to sit below the near-miss loop, so API-1 still fired on SQL-shaped steps
|
|
61
|
+
* while the docblock and the spec's own test title both claimed the rule "leaves them alone entirely" — the
|
|
62
|
+
* test passed only because its fixture omitted the misspelling. Found by the Epic 10 review.
|
|
63
|
+
*/
|
|
64
|
+
if (data['sql'] !== undefined)
|
|
65
|
+
return;
|
|
66
|
+
for (const [wrong, right] of Object.entries(NEAR_MISS)) {
|
|
67
|
+
if (data[wrong] === undefined)
|
|
68
|
+
continue;
|
|
69
|
+
/**
|
|
70
|
+
* ⛔ `low`, uniformly — and the reason is the Epic 10 review's headline correction. The first version split
|
|
71
|
+
* severity on the VALUE, calling `annonymous: true` `high` because "the request is sent WITH credentials
|
|
72
|
+
* although this step asks for none". That is FALSE: `BaseHttpRequestBuilder.cs:969` parses `$.anonymous`
|
|
73
|
+
* into `_anonymous`, which is read NOWHERE in core.api. Neither spelling does anything, so correcting the
|
|
74
|
+
* typo changes nothing and there is no behavioural difference to rank. The finding is still worth making —
|
|
75
|
+
* 1,697 corpus steps state an intent the platform does not honour — but at the severity that is true.
|
|
76
|
+
*/
|
|
77
|
+
issues.push({
|
|
78
|
+
ruleId: 'API-1',
|
|
79
|
+
family: 'API',
|
|
80
|
+
severity: 'low',
|
|
81
|
+
parentKey,
|
|
82
|
+
idOrKey,
|
|
83
|
+
message: `step "${stepKey}" sets \`${wrong}\`, which the runtime never reads — the field is \`${right}\``,
|
|
84
|
+
why: `neither spelling changes the request: \`${right}\` is parsed by the worker and never acted on, so this line states an intent the platform does not honour`,
|
|
85
|
+
locateValue: wrong,
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
const type = typeof data['type'] === 'string' ? data['type'] : 'REST';
|
|
89
|
+
const readsUrl = API_TYPE_READS_URL[type];
|
|
90
|
+
/**
|
|
91
|
+
* An unknown `type` has no keyed builder, so `GetRequiredKeyedService` throws when the step runs. Not
|
|
92
|
+
* reported here: the schema's `enum` already refuses it at the caret, which is the earlier and better place.
|
|
93
|
+
*/
|
|
94
|
+
if (readsUrl === undefined)
|
|
95
|
+
return;
|
|
96
|
+
/**
|
|
97
|
+
* ⛔ Only judge a step that looks like an HTTP call. `sql` is not the only non-HTTP shape — a connector with
|
|
98
|
+
* its own vocabulary (`procedure`, say) has no `url` and is entirely correct. Requiring one piece of HTTP
|
|
99
|
+
* evidence keeps API-2 to steps that are demonstrably HTTP-shaped, at the cost of staying quiet on a step
|
|
100
|
+
* that declares nothing at all — which is the right trade at `high`.
|
|
101
|
+
*/
|
|
102
|
+
const HTTP_EVIDENCE = [
|
|
103
|
+
'type',
|
|
104
|
+
'method',
|
|
105
|
+
'headers',
|
|
106
|
+
'queries',
|
|
107
|
+
'body',
|
|
108
|
+
'acceptHttpStatuses',
|
|
109
|
+
'responseType',
|
|
110
|
+
];
|
|
111
|
+
const looksHttp = HTTP_EVIDENCE.some((f) => data[f] !== undefined);
|
|
112
|
+
if (readsUrl && looksHttp && data['url'] === undefined) {
|
|
113
|
+
issues.push({
|
|
114
|
+
ruleId: 'API-2',
|
|
115
|
+
family: 'API',
|
|
116
|
+
severity: 'high',
|
|
117
|
+
parentKey,
|
|
118
|
+
idOrKey,
|
|
119
|
+
message: `step "${stepKey}" is \`${type}\`, which builds its request from \`url\`, and no \`url\` is set`,
|
|
120
|
+
why: 'the request cannot be addressed, so the step fails when it runs rather than when it is saved',
|
|
121
|
+
locateValue: 'type',
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
for (const collection of ['pullers', 'pushers', 'objects']) {
|
|
126
|
+
for (const component of arr(cnf, collection)) {
|
|
127
|
+
const id = component?.id != null ? String(component.id) : undefined;
|
|
128
|
+
for (const stage of STAGES) {
|
|
129
|
+
for (const step of arr(component, stage))
|
|
130
|
+
check(step, collection, id);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
for (const webhook of arr(cnf, 'webhooks')) {
|
|
135
|
+
const id = webhook?.id != null ? String(webhook.id) : undefined;
|
|
136
|
+
const targets = webhook?.targets &&
|
|
137
|
+
typeof webhook.targets === 'object' &&
|
|
138
|
+
!Array.isArray(webhook.targets)
|
|
139
|
+
? webhook.targets
|
|
140
|
+
: {};
|
|
141
|
+
for (const [targetKey, target] of Object.entries(targets)) {
|
|
142
|
+
for (const step of arr(target, 'pullSteps')) {
|
|
143
|
+
check(step, 'webhooks', id ? `${id} target ${targetKey}` : `target ${targetKey}`);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
return issues;
|
|
148
|
+
},
|
|
149
|
+
};
|
|
150
|
+
//# sourceMappingURL=apiShape.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apiShape.js","sourceRoot":"","sources":["../../../src/validate/rules/apiShape.ts"],"names":[],"mappings":"AAgDA,+FAA+F;AAC/F,MAAM,CAAC,MAAM,kBAAkB,GAAsC;IACnE,IAAI,EAAE,IAAI;IACV,OAAO,EAAE,IAAI;IACb,IAAI,EAAE,IAAI;IACV,gBAAgB,EAAE,IAAI;IACtB,gBAAgB,EAAE,IAAI;IACtB,aAAa,EAAE,IAAI;IACnB,YAAY,EAAE,IAAI;IAClB,iBAAiB,EAAE,KAAK;CACzB,CAAC;AAEF,oFAAoF;AACpF,MAAM,CAAC,MAAM,SAAS,GAAqC;IACzD,UAAU,EAAE,WAAW;CACxB,CAAC;AAEF,MAAM,MAAM,GAAG;IACb,iBAAiB;IACjB,WAAW;IACX,gBAAgB;IAChB,OAAO;IACP,cAAc;IACd,YAAY;IACZ,iBAAiB;IACjB,WAAW;IACX,gBAAgB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