@qulib/core 0.10.1 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/README.md +2 -0
  2. package/dist/cli/confidence-run.d.ts +18 -0
  3. package/dist/cli/confidence-run.d.ts.map +1 -1
  4. package/dist/cli/confidence-run.js +58 -1
  5. package/dist/index.d.ts +5 -1
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +2 -0
  8. package/dist/llm/provider.interface.d.ts +4 -1
  9. package/dist/llm/provider.interface.d.ts.map +1 -1
  10. package/dist/llm/providers/anthropic.d.ts +2 -2
  11. package/dist/llm/providers/anthropic.d.ts.map +1 -1
  12. package/dist/llm/providers/anthropic.js +2 -1
  13. package/dist/schemas/bug-report-score.schema.d.ts +163 -0
  14. package/dist/schemas/bug-report-score.schema.d.ts.map +1 -0
  15. package/dist/schemas/bug-report-score.schema.js +32 -0
  16. package/dist/schemas/confidence.schema.d.ts +33 -33
  17. package/dist/schemas/confidence.schema.d.ts.map +1 -1
  18. package/dist/schemas/confidence.schema.js +1 -0
  19. package/dist/schemas/decision-score.schema.d.ts +157 -0
  20. package/dist/schemas/decision-score.schema.d.ts.map +1 -0
  21. package/dist/schemas/decision-score.schema.js +39 -0
  22. package/dist/schemas/index.d.ts +2 -0
  23. package/dist/schemas/index.d.ts.map +1 -1
  24. package/dist/schemas/index.js +2 -0
  25. package/dist/schemas/views.schema.d.ts +11 -11
  26. package/dist/tools/scoring/bug-report-score.d.ts +34 -0
  27. package/dist/tools/scoring/bug-report-score.d.ts.map +1 -0
  28. package/dist/tools/scoring/bug-report-score.js +320 -0
  29. package/dist/tools/scoring/score-decisions.d.ts +30 -0
  30. package/dist/tools/scoring/score-decisions.d.ts.map +1 -0
  31. package/dist/tools/scoring/score-decisions.js +348 -0
  32. package/package.json +2 -2
package/README.md CHANGED
@@ -368,6 +368,8 @@ A minimal structural snapshot looks like:
368
368
  | `qulib_score_automation` | Score local repo test-automation maturity | absolute `repoPath`, optional `includeFullDimensions` |
369
369
  | `qulib_score_api` | Discover API endpoints and score their test coverage | absolute `repoPath`, optional `enableTier3`, `includeEndpointDetail` |
370
370
  | `qulib_scaffold_tests` | Generate Cypress scaffold from a live URL (`cypress-e2e` only; playwright not yet implemented) | `url`, optional `framework`, `maxPagesToScan`, `recipes` |
371
+ | **`qulib_score_bug_report`** | LLM-as-judge of a learner bug report vs planted-bug target | `report` (title, description, steps, severity), `target` (description, type, severity, expectedBehavior) |
372
+ | **`qulib_score_decisions`** | Pivotal-decision evaluation at agent forks | absolute `forksPath` (JSONL), optional `enableLlmJudge` |
371
373
  | `qulib_explore_auth` | Deeper auth-path discovery on unfamiliar apps | `url`, optional `timeoutMs` |
372
374
  | `qulib_detect_auth` | Fast single-pass auth pattern guess | `url`, optional `timeoutMs` |
373
375
  | `analyze_app` | Legacy alias for `qulib_analyze_app` — kept for backwards compatibility | same as `qulib_analyze_app` |
@@ -5,6 +5,24 @@ export interface ConfidenceOptions {
5
5
  repo?: string;
6
6
  json?: boolean;
7
7
  }
8
+ export interface ConfidenceGateResult {
9
+ /** Whether any gate (--fail-on / --min-score) was requested. */
10
+ requested: boolean;
11
+ /** True when the release passes the requested gate (or none was requested). */
12
+ passed: boolean;
13
+ /** Human-readable explanation of the gate outcome. */
14
+ reason: string;
15
+ }
16
+ /**
17
+ * Evaluate a CI gate against a release-confidence result. Pure + side-effect-free
18
+ * so it is unit-testable; the CLI action turns a failed gate into a non-zero exit.
19
+ *
20
+ * - `failOn`: fail when the verdict is at or worse than this threshold
21
+ * (e.g. `--fail-on hold` fails on `hold` or `block`).
22
+ * - `minScore`: fail when the confidence score is below this (a `null` score —
23
+ * nothing evaluable — always fails a min-score gate).
24
+ */
25
+ export declare function evaluateConfidenceGate(rc: ReleaseConfidence, failOn?: string, minScore?: number): ConfidenceGateResult;
8
26
  /** Render the human-friendly report for a ReleaseConfidence result. */
9
27
  export declare function formatConfidenceReport(rc: ReleaseConfidence, subjectRef: string): string;
10
28
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"confidence-run.d.ts","sourceRoot":"","sources":["../../src/cli/confidence-run.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAQzC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAGzE,MAAM,WAAW,iBAAiB;IAChC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAiBD,uEAAuE;AACvE,wBAAgB,sBAAsB,CAAC,EAAE,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAuCxF;AAED;;;GAGG;AACH,wBAAsB,aAAa,CACjC,OAAO,EAAE,iBAAiB,EAC1B,GAAG,GAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAkC,GACxD,OAAO,CAAC,iBAAiB,CAAC,CAmE5B;AAED,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAuBhE"}
1
+ {"version":3,"file":"confidence-run.d.ts","sourceRoot":"","sources":["../../src/cli/confidence-run.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAQzC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAGzE,MAAM,WAAW,iBAAiB;IAChC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAKD,MAAM,WAAW,oBAAoB;IACnC,gEAAgE;IAChE,SAAS,EAAE,OAAO,CAAC;IACnB,+EAA+E;IAC/E,MAAM,EAAE,OAAO,CAAC;IAChB,sDAAsD;IACtD,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CACpC,EAAE,EAAE,iBAAiB,EACrB,MAAM,CAAC,EAAE,MAAM,EACf,QAAQ,CAAC,EAAE,MAAM,GAChB,oBAAoB,CAuCtB;AAiBD,uEAAuE;AACvE,wBAAgB,sBAAsB,CAAC,EAAE,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAuCxF;AAED;;;GAGG;AACH,wBAAsB,aAAa,CACjC,OAAO,EAAE,iBAAiB,EAC1B,GAAG,GAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAkC,GACxD,OAAO,CAAC,iBAAiB,CAAC,CAmE5B;AAED,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA2ChE"}
@@ -21,6 +21,50 @@ import { discoverApiSurfaceWithRepo } from '../tools/repo/api-surface.js';
21
21
  import { computeApiCoverage } from '../tools/scoring/api-coverage.js';
22
22
  import { buildConfidenceInputFromQulib } from '../tools/scoring/confidence-from-qulib.js';
23
23
  import { computeReleaseConfidence } from '../tools/scoring/confidence.js';
24
+ /** Verdict severity, best (0) → worst (3). Used by the CI gate. */
25
+ const VERDICT_RANK = { ship: 0, caution: 1, hold: 2, block: 3 };
26
+ /**
27
+ * Evaluate a CI gate against a release-confidence result. Pure + side-effect-free
28
+ * so it is unit-testable; the CLI action turns a failed gate into a non-zero exit.
29
+ *
30
+ * - `failOn`: fail when the verdict is at or worse than this threshold
31
+ * (e.g. `--fail-on hold` fails on `hold` or `block`).
32
+ * - `minScore`: fail when the confidence score is below this (a `null` score —
33
+ * nothing evaluable — always fails a min-score gate).
34
+ */
35
+ export function evaluateConfidenceGate(rc, failOn, minScore) {
36
+ const failOnNorm = failOn?.trim().toLowerCase();
37
+ const hasFailOn = Boolean(failOnNorm);
38
+ const hasMinScore = typeof minScore === 'number' && !Number.isNaN(minScore);
39
+ if (!hasFailOn && !hasMinScore) {
40
+ return { requested: false, passed: true, reason: 'no gate requested' };
41
+ }
42
+ const reasons = [];
43
+ let passed = true;
44
+ if (hasFailOn) {
45
+ if (!(failOnNorm in VERDICT_RANK)) {
46
+ throw new Error(`--fail-on must be one of: ship, caution, hold, block (got "${failOn}")`);
47
+ }
48
+ const verdictRank = VERDICT_RANK[rc.verdict] ?? 99;
49
+ if (verdictRank >= VERDICT_RANK[failOnNorm]) {
50
+ passed = false;
51
+ reasons.push(`verdict '${rc.verdict}' is at or worse than --fail-on '${failOnNorm}'`);
52
+ }
53
+ }
54
+ if (hasMinScore) {
55
+ const score = rc.confidenceScore;
56
+ if (score === null || score < minScore) {
57
+ passed = false;
58
+ reasons.push(`confidence score ${score === null ? 'null (nothing evaluable)' : score} is below --min-score ${minScore}`);
59
+ }
60
+ }
61
+ const scoreSuffix = rc.confidenceScore !== null ? `, score ${rc.confidenceScore}` : '';
62
+ return {
63
+ requested: true,
64
+ passed,
65
+ reason: passed ? `verdict '${rc.verdict}'${scoreSuffix} meets the gate` : reasons.join('; '),
66
+ };
67
+ }
24
68
  /**
25
69
  * Resolve and validate an optional --repo path. Returns null if none was provided.
26
70
  */
@@ -152,11 +196,24 @@ export function registerConfidenceCommand(program) {
152
196
  .option('--url <url>', 'URL of the deployed app to analyze')
153
197
  .option('--repo <path>', 'Path to the local repository to score')
154
198
  .option('--json', 'Emit the full ReleaseConfidence object as JSON to stdout', false)
199
+ .option('--fail-on <verdict>', 'CI gate: exit non-zero when the verdict is at or worse than this (caution | hold | block)')
200
+ .option('--min-score <n>', 'CI gate: exit non-zero when the confidence score is below this (0–100)', (v) => parseInt(v, 10))
155
201
  .action(async (options) => {
156
- await runConfidence({
202
+ const rc = await runConfidence({
157
203
  url: options.url,
158
204
  repo: options.repo,
159
205
  json: Boolean(options.json),
160
206
  });
207
+ const gate = evaluateConfidenceGate(rc, options.failOn, options.minScore);
208
+ if (gate.requested) {
209
+ const line = `[qulib] GATE: ${gate.passed ? 'PASS' : 'FAIL'} — ${gate.reason}`;
210
+ // Keep stdout pure JSON in --json mode; the gate line goes to stderr there.
211
+ if (options.json)
212
+ console.error(line);
213
+ else
214
+ console.log(line);
215
+ if (!gate.passed)
216
+ process.exitCode = 1;
217
+ }
161
218
  });
162
219
  }
package/dist/index.d.ts CHANGED
@@ -13,6 +13,10 @@ export type { ApiSurface, DiscoveredEndpoint, DiscoverApiSurfaceOptions } from '
13
13
  export { computeAutomationMaturity } from './tools/scoring/automation-maturity.js';
14
14
  export { computeApiCoverage } from './tools/scoring/api-coverage.js';
15
15
  export { detectPromptLeakage } from './tools/scoring/prompt-leakage.js';
16
+ export { scoreBugReport, scoreBugReportDeterministic, buildBugReportJudgePrompt, parseBugReportJudgeResponse, BUG_REPORT_JUDGE_MODEL, RUBRIC_MAX_PTS, SEVERITY_WEIGHT, hasQualityRepro, hasEvidence, delimitUntrusted, } from './tools/scoring/bug-report-score.js';
17
+ export type { ScoreBugReportOptions } from './tools/scoring/bug-report-score.js';
18
+ export { scoreDecisions, scoreForkDeterministic, loadDecisionForks, validateForksPath, resolveAllowedForksRoot, buildDecisionJudgePrompt, parseDecisionJudgeResponse, } from './tools/scoring/score-decisions.js';
19
+ export type { ScoreDecisionsOptions } from './tools/scoring/score-decisions.js';
16
20
  export type { ApiCoverageResult, ApiEndpointCoverage } from './tools/scoring/api-coverage.js';
17
21
  export { scaffoldTests } from './scaffold-tests.js';
18
22
  export type { ScaffoldOptions, ScaffoldResult, ProjectConfig } from './scaffold-tests.js';
@@ -27,7 +31,7 @@ export { NoopTelemetrySink } from './telemetry/telemetry.interface.js';
27
31
  export { redactUrlForTelemetry } from './telemetry/emit.js';
28
32
  export type { LlmCallResult, LlmProvider } from './llm/provider.interface.js';
29
33
  export type { CallLlmConfigSlice } from './llm/provider.js';
30
- export type { HarnessConfig, AuthConfig, RouteInventory, GapAnalysis, RepoAnalysis, DetectedAuth, AuthExploration, AuthPath, AuthPathRequirements, CostIntelligence, LlmUsageRecord, RepeatedAiPattern, DeterministicMaturity, PublicSurface, AutomationMaturity, AutomationMaturityDimension, FrameworkDetectionResult, DetectedFrameworkPrimary, RecipeId, RecipeConfig, } from './schemas/index.js';
34
+ export type { HarnessConfig, AuthConfig, RouteInventory, GapAnalysis, RepoAnalysis, DetectedAuth, AuthExploration, AuthPath, AuthPathRequirements, CostIntelligence, LlmUsageRecord, RepeatedAiPattern, DeterministicMaturity, PublicSurface, AutomationMaturity, AutomationMaturityDimension, FrameworkDetectionResult, DetectedFrameworkPrimary, RecipeId, RecipeConfig, BugReportScoreResult, BugReportRubric, BugReportInput, BugReportTarget, ScoreBugReportInput, DecisionScoreResult, ScoredDecisionFork, DecisionFork, ScoreDecisionsInput, } from './schemas/index.js';
31
35
  export { RecipeIdSchema } from './schemas/index.js';
32
36
  export { computeReleaseConfidence } from './tools/scoring/confidence.js';
33
37
  export { analyzeRunDiff, formatAnalyzeDiffMarkdown, loadGapAnalysisFile } from './cli/analyze-diff-run.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EACL,UAAU,EACV,mBAAmB,EACnB,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,cAAc,EACd,gBAAgB,GACjB,MAAM,wBAAwB,CAAC;AAChC,YAAY,EACV,WAAW,EACX,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,GACd,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,YAAY,EACV,YAAY,EACZ,kBAAkB,EAClB,SAAS,EACT,cAAc,EACd,uBAAuB,GACxB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,UAAU,EACV,oBAAoB,EACpB,4BAA4B,EAC5B,yBAAyB,EACzB,qBAAqB,GACtB,MAAM,wBAAwB,CAAC;AAChC,YAAY,EACV,yBAAyB,EACzB,4BAA4B,GAC7B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,MAA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YAAY,EACV,kBAAkB,EAClB,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB,EACjB,oBAAoB,EACpB,SAAS,EACT,aAAa,EACb,UAAU,EACV,WAAW,EACX,UAAU,GACX,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,wBAAwB,EACxB,kBAAkB,EAClB,uBAAuB,EACvB,qBAAqB,EACrB,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EACL,UAAU,EACV,mBAAmB,EACnB,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,cAAc,EACd,gBAAgB,GACjB,MAAM,wBAAwB,CAAC;AAChC,YAAY,EACV,WAAW,EACX,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,GACd,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,YAAY,EACV,YAAY,EACZ,kBAAkB,EAClB,SAAS,EACT,cAAc,EACd,uBAAuB,GACxB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,UAAU,EACV,oBAAoB,EACpB,4BAA4B,EAC5B,yBAAyB,EACzB,qBAAqB,GACtB,MAAM,wBAAwB,CAAC;AAChC,YAAY,EACV,yBAAyB,EACzB,4BAA4B,GAC7B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAC1G,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,0BAA0B,EAAE,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,YAAY,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,YAAY,EAAE,eAAe,EAAE,WAAW,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACtH,OAAO,EAAE,6BAA6B,EAAE,MAAM,0CAA0C,CAAC;AACzF,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AAC7G,YAAY,EACV,kBAAkB,EAClB,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB,EACjB,oBAAoB,EACpB,SAAS,EACT,aAAa,EACb,UAAU,EACV,WAAW,EACX,UAAU,GACX,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,wBAAwB,EACxB,kBAAkB,EAClB,uBAAuB,EACvB,qBAAqB,EACrB,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,oBAAoB,CAAC"}
package/dist/index.js CHANGED
@@ -9,6 +9,8 @@ export { discoverApiSurface, discoverApiSurfaceWithRepo } from './tools/repo/api
9
9
  export { computeAutomationMaturity } from './tools/scoring/automation-maturity.js';
10
10
  export { computeApiCoverage } from './tools/scoring/api-coverage.js';
11
11
  export { detectPromptLeakage } from './tools/scoring/prompt-leakage.js';
12
+ export { scoreBugReport, scoreBugReportDeterministic, buildBugReportJudgePrompt, parseBugReportJudgeResponse, BUG_REPORT_JUDGE_MODEL, RUBRIC_MAX_PTS, SEVERITY_WEIGHT, hasQualityRepro, hasEvidence, delimitUntrusted, } from './tools/scoring/bug-report-score.js';
13
+ export { scoreDecisions, scoreForkDeterministic, loadDecisionForks, validateForksPath, resolveAllowedForksRoot, buildDecisionJudgePrompt, parseDecisionJudgeResponse, } from './tools/scoring/score-decisions.js';
12
14
  export { scaffoldTests } from './scaffold-tests.js';
13
15
  export { expandRecipes, buildAuthScenarios, buildA11yScenarios, buildNavScenarios, buildSeedScenarios } from './recipes/index.js';
14
16
  export { createProvider } from './llm/provider-registry.js';
@@ -8,9 +8,12 @@ export interface LlmCallResult {
8
8
  dataQuality: 'actual' | 'estimated';
9
9
  };
10
10
  }
11
+ export interface LlmCallOptions {
12
+ temperature?: number;
13
+ }
11
14
  export interface LlmProvider {
12
15
  readonly name: string;
13
16
  readonly model: string;
14
- call(prompt: string, maxOutputTokens: number): Promise<LlmCallResult>;
17
+ call(prompt: string, maxOutputTokens: number, options?: LlmCallOptions): Promise<LlmCallResult>;
15
18
  }
16
19
  //# sourceMappingURL=provider.interface.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"provider.interface.d.ts","sourceRoot":"","sources":["../../src/llm/provider.interface.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE;QACL,QAAQ,EAAE,MAAM,CAAC;QACjB,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,EAAE,MAAM,CAAC;QACpB,YAAY,EAAE,MAAM,CAAC;QACrB,WAAW,EAAE,QAAQ,GAAG,WAAW,CAAC;KACrC,CAAC;CACH;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;CACvE"}
1
+ {"version":3,"file":"provider.interface.d.ts","sourceRoot":"","sources":["../../src/llm/provider.interface.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE;QACL,QAAQ,EAAE,MAAM,CAAC;QACjB,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,EAAE,MAAM,CAAC;QACpB,YAAY,EAAE,MAAM,CAAC;QACrB,WAAW,EAAE,QAAQ,GAAG,WAAW,CAAC;KACrC,CAAC;CACH;AAED,MAAM,WAAW,cAAc;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;CACjG"}
@@ -1,4 +1,4 @@
1
- import type { LlmCallResult, LlmProvider } from '../provider.interface.js';
1
+ import type { LlmCallOptions, LlmCallResult, LlmProvider } from '../provider.interface.js';
2
2
  import type { TelemetrySink } from '../../telemetry/telemetry.interface.js';
3
3
  export type AnthropicProviderOptions = {
4
4
  model?: string;
@@ -11,6 +11,6 @@ export declare class AnthropicProvider implements LlmProvider {
11
11
  private readonly telemetry?;
12
12
  private readonly sessionId;
13
13
  constructor(options?: AnthropicProviderOptions);
14
- call(prompt: string, maxOutputTokens: number): Promise<LlmCallResult>;
14
+ call(prompt: string, maxOutputTokens: number, options?: LlmCallOptions): Promise<LlmCallResult>;
15
15
  }
16
16
  //# sourceMappingURL=anthropic.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"anthropic.d.ts","sourceRoot":"","sources":["../../../src/llm/providers/anthropic.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC3E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAS5E,MAAM,MAAM,wBAAwB,GAAG;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,qBAAa,iBAAkB,YAAW,WAAW;IACnD,QAAQ,CAAC,IAAI,eAAe;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAgB;IAC3C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;gBAEvB,OAAO,CAAC,EAAE,wBAAwB;IAMxC,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;CA+F5E"}
1
+ {"version":3,"file":"anthropic.d.ts","sourceRoot":"","sources":["../../../src/llm/providers/anthropic.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC3F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAS5E,MAAM,MAAM,wBAAwB,GAAG;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,qBAAa,iBAAkB,YAAW,WAAW;IACnD,QAAQ,CAAC,IAAI,eAAe;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAgB;IAC3C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;gBAEvB,OAAO,CAAC,EAAE,wBAAwB;IAMxC,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;CAgGtG"}
@@ -13,7 +13,7 @@ export class AnthropicProvider {
13
13
  this.telemetry = options?.telemetry;
14
14
  this.sessionId = options?.sessionId ?? 'anonymous';
15
15
  }
16
- async call(prompt, maxOutputTokens) {
16
+ async call(prompt, maxOutputTokens, options) {
17
17
  const apiKey = process.env.ANTHROPIC_API_KEY;
18
18
  if (!apiKey)
19
19
  throw new Error('ANTHROPIC_API_KEY is not set');
@@ -34,6 +34,7 @@ export class AnthropicProvider {
34
34
  body: JSON.stringify({
35
35
  model: this.model,
36
36
  max_tokens: maxOutputTokens,
37
+ ...(options?.temperature !== undefined ? { temperature: options.temperature } : {}),
37
38
  messages: [{ role: 'user', content: prompt }],
38
39
  }),
39
40
  });
@@ -0,0 +1,163 @@
1
+ import { z } from 'zod';
2
+ export declare const BugReportSeveritySchema: z.ZodEnum<["critical", "high", "medium", "low"]>;
3
+ export declare const BugReportInputSchema: z.ZodObject<{
4
+ title: z.ZodString;
5
+ description: z.ZodString;
6
+ steps: z.ZodString;
7
+ severity: z.ZodEnum<["critical", "high", "medium", "low"]>;
8
+ }, "strip", z.ZodTypeAny, {
9
+ severity: "critical" | "high" | "medium" | "low";
10
+ description: string;
11
+ title: string;
12
+ steps: string;
13
+ }, {
14
+ severity: "critical" | "high" | "medium" | "low";
15
+ description: string;
16
+ title: string;
17
+ steps: string;
18
+ }>;
19
+ export declare const BugReportTargetSchema: z.ZodObject<{
20
+ description: z.ZodString;
21
+ type: z.ZodString;
22
+ severity: z.ZodEnum<["critical", "high", "medium", "low"]>;
23
+ expectedBehavior: z.ZodString;
24
+ }, "strip", z.ZodTypeAny, {
25
+ type: string;
26
+ severity: "critical" | "high" | "medium" | "low";
27
+ description: string;
28
+ expectedBehavior: string;
29
+ }, {
30
+ type: string;
31
+ severity: "critical" | "high" | "medium" | "low";
32
+ description: string;
33
+ expectedBehavior: string;
34
+ }>;
35
+ export declare const ScoreBugReportInputSchema: z.ZodObject<{
36
+ report: z.ZodObject<{
37
+ title: z.ZodString;
38
+ description: z.ZodString;
39
+ steps: z.ZodString;
40
+ severity: z.ZodEnum<["critical", "high", "medium", "low"]>;
41
+ }, "strip", z.ZodTypeAny, {
42
+ severity: "critical" | "high" | "medium" | "low";
43
+ description: string;
44
+ title: string;
45
+ steps: string;
46
+ }, {
47
+ severity: "critical" | "high" | "medium" | "low";
48
+ description: string;
49
+ title: string;
50
+ steps: string;
51
+ }>;
52
+ target: z.ZodObject<{
53
+ description: z.ZodString;
54
+ type: z.ZodString;
55
+ severity: z.ZodEnum<["critical", "high", "medium", "low"]>;
56
+ expectedBehavior: z.ZodString;
57
+ }, "strip", z.ZodTypeAny, {
58
+ type: string;
59
+ severity: "critical" | "high" | "medium" | "low";
60
+ description: string;
61
+ expectedBehavior: string;
62
+ }, {
63
+ type: string;
64
+ severity: "critical" | "high" | "medium" | "low";
65
+ description: string;
66
+ expectedBehavior: string;
67
+ }>;
68
+ }, "strip", z.ZodTypeAny, {
69
+ target: {
70
+ type: string;
71
+ severity: "critical" | "high" | "medium" | "low";
72
+ description: string;
73
+ expectedBehavior: string;
74
+ };
75
+ report: {
76
+ severity: "critical" | "high" | "medium" | "low";
77
+ description: string;
78
+ title: string;
79
+ steps: string;
80
+ };
81
+ }, {
82
+ target: {
83
+ type: string;
84
+ severity: "critical" | "high" | "medium" | "low";
85
+ description: string;
86
+ expectedBehavior: string;
87
+ };
88
+ report: {
89
+ severity: "critical" | "high" | "medium" | "low";
90
+ description: string;
91
+ title: string;
92
+ steps: string;
93
+ };
94
+ }>;
95
+ export declare const BugReportRubricSchema: z.ZodObject<{
96
+ coverage: z.ZodNumber;
97
+ severity: z.ZodNumber;
98
+ repro: z.ZodNumber;
99
+ evidence: z.ZodNumber;
100
+ }, "strip", z.ZodTypeAny, {
101
+ severity: number;
102
+ coverage: number;
103
+ evidence: number;
104
+ repro: number;
105
+ }, {
106
+ severity: number;
107
+ coverage: number;
108
+ evidence: number;
109
+ repro: number;
110
+ }>;
111
+ export declare const BugReportScoringPathSchema: z.ZodEnum<["llm-judge", "deterministic-fallback"]>;
112
+ export declare const BugReportScoreResultSchema: z.ZodObject<{
113
+ matched: z.ZodBoolean;
114
+ matchConfidence: z.ZodNumber;
115
+ rubric: z.ZodObject<{
116
+ coverage: z.ZodNumber;
117
+ severity: z.ZodNumber;
118
+ repro: z.ZodNumber;
119
+ evidence: z.ZodNumber;
120
+ }, "strip", z.ZodTypeAny, {
121
+ severity: number;
122
+ coverage: number;
123
+ evidence: number;
124
+ repro: number;
125
+ }, {
126
+ severity: number;
127
+ coverage: number;
128
+ evidence: number;
129
+ repro: number;
130
+ }>;
131
+ feedback: z.ZodString;
132
+ scoringPath: z.ZodEnum<["llm-judge", "deterministic-fallback"]>;
133
+ }, "strip", z.ZodTypeAny, {
134
+ matched: boolean;
135
+ matchConfidence: number;
136
+ rubric: {
137
+ severity: number;
138
+ coverage: number;
139
+ evidence: number;
140
+ repro: number;
141
+ };
142
+ feedback: string;
143
+ scoringPath: "llm-judge" | "deterministic-fallback";
144
+ }, {
145
+ matched: boolean;
146
+ matchConfidence: number;
147
+ rubric: {
148
+ severity: number;
149
+ coverage: number;
150
+ evidence: number;
151
+ repro: number;
152
+ };
153
+ feedback: string;
154
+ scoringPath: "llm-judge" | "deterministic-fallback";
155
+ }>;
156
+ export type BugReportSeverity = z.infer<typeof BugReportSeveritySchema>;
157
+ export type BugReportInput = z.infer<typeof BugReportInputSchema>;
158
+ export type BugReportTarget = z.infer<typeof BugReportTargetSchema>;
159
+ export type ScoreBugReportInput = z.infer<typeof ScoreBugReportInputSchema>;
160
+ export type BugReportRubric = z.infer<typeof BugReportRubricSchema>;
161
+ export type BugReportScoringPath = z.infer<typeof BugReportScoringPathSchema>;
162
+ export type BugReportScoreResult = z.infer<typeof BugReportScoreResultSchema>;
163
+ //# sourceMappingURL=bug-report-score.schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bug-report-score.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/bug-report-score.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,uBAAuB,kDAAgD,CAAC;AAErF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;EAK/B,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;EAKhC,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGpC,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;EAKhC,CAAC;AAEH,eAAO,MAAM,0BAA0B,oDAAkD,CAAC;AAE1F,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMrC,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACxE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACpE,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC5E,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACpE,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAC9E,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC"}
@@ -0,0 +1,32 @@
1
+ import { z } from 'zod';
2
+ export const BugReportSeveritySchema = z.enum(['critical', 'high', 'medium', 'low']);
3
+ export const BugReportInputSchema = z.object({
4
+ title: z.string().min(1).max(500),
5
+ description: z.string().min(1).max(8000),
6
+ steps: z.string().min(1).max(8000),
7
+ severity: BugReportSeveritySchema,
8
+ });
9
+ export const BugReportTargetSchema = z.object({
10
+ description: z.string().min(1).max(8000),
11
+ type: z.string().min(1).max(200),
12
+ severity: BugReportSeveritySchema,
13
+ expectedBehavior: z.string().min(1).max(8000),
14
+ });
15
+ export const ScoreBugReportInputSchema = z.object({
16
+ report: BugReportInputSchema,
17
+ target: BugReportTargetSchema,
18
+ });
19
+ export const BugReportRubricSchema = z.object({
20
+ coverage: z.number().min(0).max(25),
21
+ severity: z.number().min(0).max(25),
22
+ repro: z.number().min(0).max(25),
23
+ evidence: z.number().min(0).max(25),
24
+ });
25
+ export const BugReportScoringPathSchema = z.enum(['llm-judge', 'deterministic-fallback']);
26
+ export const BugReportScoreResultSchema = z.object({
27
+ matched: z.boolean(),
28
+ matchConfidence: z.number().min(0).max(1),
29
+ rubric: BugReportRubricSchema,
30
+ feedback: z.string(),
31
+ scoringPath: BugReportScoringPathSchema,
32
+ });