@specverse/engines 6.53.1 → 6.63.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai/analyse-runner.d.ts.map +1 -1
- package/dist/ai/analyse-runner.js +22 -1
- package/dist/ai/analyse-runner.js.map +1 -1
- package/dist/analyse-prepass/adapters/module-functions.d.ts +25 -0
- package/dist/analyse-prepass/adapters/module-functions.d.ts.map +1 -1
- package/dist/analyse-prepass/adapters/module-functions.js +54 -0
- package/dist/analyse-prepass/adapters/module-functions.js.map +1 -1
- package/dist/analyse-prepass/backends/gitnexus.d.ts +28 -0
- package/dist/analyse-prepass/backends/gitnexus.d.ts.map +1 -1
- package/dist/analyse-prepass/backends/gitnexus.js +36 -2
- package/dist/analyse-prepass/backends/gitnexus.js.map +1 -1
- package/dist/analyse-prepass/index.d.ts.map +1 -1
- package/dist/analyse-prepass/index.js +17 -1
- package/dist/analyse-prepass/index.js.map +1 -1
- package/dist/libs/instance-factories/controllers/templates/fastify/routes-generator.js +29 -10
- package/dist/libs/instance-factories/services/templates/_shared/step-matching.js +11 -0
- package/dist/libs/instance-factories/services/templates/mongodb-native/step-conventions.js +39 -19
- package/dist/libs/instance-factories/services/templates/postgres-native/step-conventions.js +35 -18
- package/dist/libs/instance-factories/services/templates/prisma/ai-behaviors-generator.js +16 -11
- package/dist/libs/instance-factories/services/templates/prisma/controller-generator.js +1 -1
- package/dist/libs/instance-factories/services/templates/prisma/step-conventions.js +34 -12
- package/dist/libs/instance-factories/services/templates/shared-patterns.js +5 -5
- package/dist/realize/index.d.ts.map +1 -1
- package/dist/realize/index.js +91 -10
- package/dist/realize/index.js.map +1 -1
- package/dist/realize/per-action-recovery.d.ts +74 -0
- package/dist/realize/per-action-recovery.d.ts.map +1 -0
- package/dist/realize/per-action-recovery.js +255 -0
- package/dist/realize/per-action-recovery.js.map +1 -0
- package/dist/realize/per-owner-emit.d.ts +6 -0
- package/dist/realize/per-owner-emit.d.ts.map +1 -1
- package/dist/realize/per-owner-emit.js +22 -6
- package/dist/realize/per-owner-emit.js.map +1 -1
- package/dist/realize/per-owner-runner.d.ts +23 -2
- package/dist/realize/per-owner-runner.d.ts.map +1 -1
- package/dist/realize/per-owner-runner.js +91 -46
- package/dist/realize/per-owner-runner.js.map +1 -1
- package/dist/realize/post-emit-verify/diagnostics.d.ts +107 -0
- package/dist/realize/post-emit-verify/diagnostics.d.ts.map +1 -0
- package/dist/realize/post-emit-verify/diagnostics.js +148 -0
- package/dist/realize/post-emit-verify/diagnostics.js.map +1 -0
- package/dist/realize/post-emit-verify/feedback-runner.d.ts +41 -1
- package/dist/realize/post-emit-verify/feedback-runner.d.ts.map +1 -1
- package/dist/realize/post-emit-verify/feedback-runner.js +62 -6
- package/dist/realize/post-emit-verify/feedback-runner.js.map +1 -1
- package/dist/realize/post-emit-verify/index.d.ts +4 -2
- package/dist/realize/post-emit-verify/index.d.ts.map +1 -1
- package/dist/realize/post-emit-verify/index.js +3 -1
- package/dist/realize/post-emit-verify/index.js.map +1 -1
- package/dist/realize/post-emit-verify/reemit.d.ts +22 -1
- package/dist/realize/post-emit-verify/reemit.d.ts.map +1 -1
- package/dist/realize/post-emit-verify/reemit.js +20 -18
- package/dist/realize/post-emit-verify/reemit.js.map +1 -1
- package/dist/realize/post-emit-verify/types.d.ts +49 -0
- package/dist/realize/post-emit-verify/types.d.ts.map +1 -1
- package/dist/realize/post-emit-verify/verifier-manifest.d.ts.map +1 -1
- package/dist/realize/post-emit-verify/verifier-manifest.js +2 -0
- package/dist/realize/post-emit-verify/verifier-manifest.js.map +1 -1
- package/dist/realize/post-emit-verify/verifiers/stub-completeness.d.ts +127 -0
- package/dist/realize/post-emit-verify/verifiers/stub-completeness.d.ts.map +1 -0
- package/dist/realize/post-emit-verify/verifiers/stub-completeness.js +423 -0
- package/dist/realize/post-emit-verify/verifiers/stub-completeness.js.map +1 -0
- package/dist/realize/realize-context-snapshot.d.ts +70 -0
- package/dist/realize/realize-context-snapshot.d.ts.map +1 -0
- package/dist/realize/realize-context-snapshot.js +96 -0
- package/dist/realize/realize-context-snapshot.js.map +1 -0
- package/dist/realize/structural-validator.d.ts +36 -2
- package/dist/realize/structural-validator.d.ts.map +1 -1
- package/dist/realize/structural-validator.js +50 -7
- package/dist/realize/structural-validator.js.map +1 -1
- package/libs/instance-factories/controllers/templates/fastify/routes-generator.ts +49 -15
- package/libs/instance-factories/services/templates/_shared/step-matching.ts +43 -0
- package/libs/instance-factories/services/templates/mongodb-native/step-conventions.ts +39 -19
- package/libs/instance-factories/services/templates/postgres-native/step-conventions.ts +35 -18
- package/libs/instance-factories/services/templates/prisma/__tests__/step-conventions-create.test.ts +184 -0
- package/libs/instance-factories/services/templates/prisma/ai-behaviors-generator.ts +34 -5
- package/libs/instance-factories/services/templates/prisma/controller-generator.ts +6 -1
- package/libs/instance-factories/services/templates/prisma/step-conventions.ts +34 -12
- package/libs/instance-factories/services/templates/shared-patterns.ts +20 -10
- package/package.json +1 -1
- package/libs/instance-factories/services/templates/_shared/step-matching.d.ts +0 -39
- package/libs/instance-factories/services/templates/_shared/step-matching.d.ts.map +0 -1
- package/libs/instance-factories/services/templates/_shared/step-matching.js +0 -90
- package/libs/instance-factories/services/templates/_shared/step-matching.js.map +0 -1
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared step-matching machinery — common helpers + the canonical
|
|
3
|
-
* `matchAgainstConventions` walker that any ORM-specific step-conventions
|
|
4
|
-
* library can compose with.
|
|
5
|
-
*
|
|
6
|
-
* Each ORM library (prisma, mongodb-native) exports its own
|
|
7
|
-
* `STEP_CONVENTIONS` array of `{name, pattern, generateCall}` items
|
|
8
|
-
* describing what code to emit for matched patterns. The matcher itself
|
|
9
|
-
* is identical across libraries: walk the conventions in order, first
|
|
10
|
-
* match wins; if nothing matches, compute the AI-fallback shape
|
|
11
|
-
* (functionName + inputs + resultVar) deterministically.
|
|
12
|
-
*
|
|
13
|
-
* Extracted from prisma/step-conventions.ts and mongodb-native/step-conventions.ts
|
|
14
|
-
* so future ORM libraries can drop in just the conventions array
|
|
15
|
-
* without re-implementing matching logic. (#43K-D)
|
|
16
|
-
*/
|
|
17
|
-
/** Camel-case a step's text into a TS identifier. Identical algorithm
|
|
18
|
-
* across all ORM libraries — function names emitted in `aiBehaviors.<X>(...)`
|
|
19
|
-
* calls must agree with the function declarations the AI-behaviors-generator
|
|
20
|
-
* emits. Both sides go through this. */
|
|
21
|
-
export declare function toMethod(words: string): string;
|
|
22
|
-
export declare function toVar(name: string): string;
|
|
23
|
-
export type { SharedStepContext, SharedConvention, MatchResult, MatcherFn, } from '@specverse/types';
|
|
24
|
-
import type { SharedStepContext, SharedConvention, MatchResult } from '@specverse/types';
|
|
25
|
-
export interface StepMatchRecord {
|
|
26
|
-
ownerName: string;
|
|
27
|
-
actionName: string;
|
|
28
|
-
stepOrdinal: number;
|
|
29
|
-
stepText: string;
|
|
30
|
-
matched: boolean;
|
|
31
|
-
helperMethod?: string;
|
|
32
|
-
aiFunctionName?: string;
|
|
33
|
-
}
|
|
34
|
-
export declare function setStepMatchRecorder(fn: ((r: StepMatchRecord) => void) | null): void;
|
|
35
|
-
/** Walk conventions in order. First match wins (with empty-string fallthrough).
|
|
36
|
-
* Unmatched: compute the AI-delegate call site shape so the controller and
|
|
37
|
-
* the AI-behaviors-generator agree on function name + inputs + resultVar. */
|
|
38
|
-
export declare function matchAgainstConventions<C extends SharedStepContext>(step: string, ctx: C, conventions: ReadonlyArray<SharedConvention<C>>, aiArgsExpr: (inputs: string[], paramNames: string[]) => string): MatchResult;
|
|
39
|
-
//# sourceMappingURL=step-matching.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"step-matching.d.ts","sourceRoot":"","sources":["step-matching.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH;;;wCAGwC;AACxC,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAK9C;AAED,wBAAgB,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE1C;AAMD,YAAY,EACV,iBAAiB,EACjB,gBAAgB,EAChB,WAAW,EACX,SAAS,GACV,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAWzF,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,eAAe,KAAK,IAAI,CAAC,GAAG,IAAI,GAAG,IAAI,CAEpF;AAED;;6EAE6E;AAC7E,wBAAgB,uBAAuB,CAAC,CAAC,SAAS,iBAAiB,EACjE,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,CAAC,EACN,WAAW,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,EAC/C,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,MAAM,GAC7D,WAAW,CAsDb"}
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared step-matching machinery — common helpers + the canonical
|
|
3
|
-
* `matchAgainstConventions` walker that any ORM-specific step-conventions
|
|
4
|
-
* library can compose with.
|
|
5
|
-
*
|
|
6
|
-
* Each ORM library (prisma, mongodb-native) exports its own
|
|
7
|
-
* `STEP_CONVENTIONS` array of `{name, pattern, generateCall}` items
|
|
8
|
-
* describing what code to emit for matched patterns. The matcher itself
|
|
9
|
-
* is identical across libraries: walk the conventions in order, first
|
|
10
|
-
* match wins; if nothing matches, compute the AI-fallback shape
|
|
11
|
-
* (functionName + inputs + resultVar) deterministically.
|
|
12
|
-
*
|
|
13
|
-
* Extracted from prisma/step-conventions.ts and mongodb-native/step-conventions.ts
|
|
14
|
-
* so future ORM libraries can drop in just the conventions array
|
|
15
|
-
* without re-implementing matching logic. (#43K-D)
|
|
16
|
-
*/
|
|
17
|
-
/** Camel-case a step's text into a TS identifier. Identical algorithm
|
|
18
|
-
* across all ORM libraries — function names emitted in `aiBehaviors.<X>(...)`
|
|
19
|
-
* calls must agree with the function declarations the AI-behaviors-generator
|
|
20
|
-
* emits. Both sides go through this. */
|
|
21
|
-
export function toMethod(words) {
|
|
22
|
-
const cleaned = words.trim().replace(/[^A-Za-z0-9\s]+/g, ' ');
|
|
23
|
-
const camel = cleaned.replace(/\s+(.)/g, (_, c) => c.toUpperCase()).replace(/^\w/, (c) => c.toLowerCase());
|
|
24
|
-
const safe = camel.replace(/[^A-Za-z0-9_$]/g, '');
|
|
25
|
-
return safe || 'unnamedStep';
|
|
26
|
-
}
|
|
27
|
-
export function toVar(name) {
|
|
28
|
-
return name.charAt(0).toLowerCase() + name.slice(1);
|
|
29
|
-
}
|
|
30
|
-
let _stepRecorder = null;
|
|
31
|
-
export function setStepMatchRecorder(fn) {
|
|
32
|
-
_stepRecorder = fn;
|
|
33
|
-
}
|
|
34
|
-
/** Walk conventions in order. First match wins (with empty-string fallthrough).
|
|
35
|
-
* Unmatched: compute the AI-delegate call site shape so the controller and
|
|
36
|
-
* the AI-behaviors-generator agree on function name + inputs + resultVar. */
|
|
37
|
-
export function matchAgainstConventions(step, ctx, conventions, aiArgsExpr) {
|
|
38
|
-
let result = null;
|
|
39
|
-
for (const convention of conventions) {
|
|
40
|
-
const m = step.match(convention.pattern);
|
|
41
|
-
if (m) {
|
|
42
|
-
const call = convention.generateCall(m, ctx);
|
|
43
|
-
if (call) {
|
|
44
|
-
result = {
|
|
45
|
-
matched: true,
|
|
46
|
-
call,
|
|
47
|
-
helperMethod: convention.generateMethod?.(m, ctx),
|
|
48
|
-
};
|
|
49
|
-
break;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
if (!result) {
|
|
54
|
-
// AI fallback shape — same across all ORMs.
|
|
55
|
-
const functionName = toMethod(step);
|
|
56
|
-
const declared = Array.from(ctx.declaredVars || []);
|
|
57
|
-
const paramNames = ctx.parameterNames || [];
|
|
58
|
-
const inputs = [...paramNames, ...declared];
|
|
59
|
-
const resultVar = ctx.resultName || `step${ctx.stepNum}Result`;
|
|
60
|
-
if (ctx.declaredVars)
|
|
61
|
-
ctx.declaredVars.add(resultVar);
|
|
62
|
-
const inputObj = aiArgsExpr(inputs, paramNames);
|
|
63
|
-
result = {
|
|
64
|
-
matched: false,
|
|
65
|
-
call: ` // Step ${ctx.stepNum}: ${step} [AI-generated — pure transform]
|
|
66
|
-
const ${resultVar} = await aiBehaviors.${functionName}(${inputObj});`,
|
|
67
|
-
functionName,
|
|
68
|
-
inputs,
|
|
69
|
-
resultVar,
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
// Forward-log the decision. ctx.serviceName carries the spec owner
|
|
73
|
-
// (controller or service — the shared context uses one field for both).
|
|
74
|
-
if (_stepRecorder) {
|
|
75
|
-
try {
|
|
76
|
-
_stepRecorder({
|
|
77
|
-
ownerName: ctx.serviceName,
|
|
78
|
-
actionName: ctx.operationName,
|
|
79
|
-
stepOrdinal: ctx.stepNum,
|
|
80
|
-
stepText: step,
|
|
81
|
-
matched: result.matched,
|
|
82
|
-
helperMethod: result.helperMethod,
|
|
83
|
-
aiFunctionName: result.functionName,
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
catch { /* recorder must never break generation */ }
|
|
87
|
-
}
|
|
88
|
-
return result;
|
|
89
|
-
}
|
|
90
|
-
//# sourceMappingURL=step-matching.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"step-matching.js","sourceRoot":"","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