@probelabs/visor 0.1.85 → 0.1.87

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/sdk/sdk.js CHANGED
@@ -810,7 +810,8 @@ ${prContext}
810
810
  <rule>For INCREMENTAL analysis, ONLY review changes in commit_diff section</rule>
811
811
  <rule>For FULL analysis, review all changes in full_diff section</rule>
812
812
  <rule>Reference specific XML elements like files_summary, metadata when providing context</rule>
813
- <rule>SEVERITY ASSIGNMENT: All severity levels (critical, error, warning, info) should be based on the NEW code being introduced, not on what it fixes. When code INTRODUCES new problems (bugs, vulnerabilities, performance issues, breaking changes), assign appropriate severity (critical/error/warning). When code FIXES or IMPROVES existing issues, use lower severity (info/warning) to acknowledge the improvement. This applies to all issue types: security, performance, style, logic, documentation. The schema provides detailed severity level definitions.</rule>
813
+ <rule>STRICT OUTPUT POLICY: Report only actual problems, risks, or deficiencies. Do not write praise, congratulations, or celebratory text. Do not create issues that merely restate improvements or say "no action needed".</rule>
814
+ <rule>SEVERITY ASSIGNMENT: Assign severity ONLY to problems introduced or left unresolved by this change (critical/error/warning/info as appropriate). Do NOT create issue entries solely to acknowledge improvements; if no problems exist, return zero issues.</rule>
814
815
  </rules>
815
816
  </review_request>`;
816
817
  }
@@ -5460,26 +5461,36 @@ var init_failure_condition_evaluator = __esm({
5460
5461
  // eslint-disable-line @typescript-eslint/no-unused-vars
5461
5462
  ...otherFields
5462
5463
  } = reviewSummaryWithOutput;
5464
+ const aggregatedOutput = {
5465
+ issues: (issues || []).map((issue) => ({
5466
+ file: issue.file,
5467
+ line: issue.line,
5468
+ endLine: issue.endLine,
5469
+ ruleId: issue.ruleId,
5470
+ message: issue.message,
5471
+ severity: issue.severity,
5472
+ category: issue.category,
5473
+ group: issue.group,
5474
+ schema: issue.schema,
5475
+ suggestion: issue.suggestion,
5476
+ replacement: issue.replacement
5477
+ })),
5478
+ // Include additional schema-specific data from reviewSummary
5479
+ ...otherFields
5480
+ };
5481
+ if (Array.isArray(extractedOutput)) {
5482
+ aggregatedOutput.items = extractedOutput;
5483
+ const anyError = extractedOutput.find(
5484
+ (it) => it && typeof it === "object" && it.error
5485
+ );
5486
+ if (anyError && anyError.error !== void 0) {
5487
+ aggregatedOutput.error = anyError.error;
5488
+ }
5489
+ } else if (extractedOutput && typeof extractedOutput === "object") {
5490
+ Object.assign(aggregatedOutput, extractedOutput);
5491
+ }
5463
5492
  const context = {
5464
- output: {
5465
- issues: (issues || []).map((issue) => ({
5466
- file: issue.file,
5467
- line: issue.line,
5468
- endLine: issue.endLine,
5469
- ruleId: issue.ruleId,
5470
- message: issue.message,
5471
- severity: issue.severity,
5472
- category: issue.category,
5473
- group: issue.group,
5474
- schema: issue.schema,
5475
- suggestion: issue.suggestion,
5476
- replacement: issue.replacement
5477
- })),
5478
- // Include additional schema-specific data from reviewSummary
5479
- ...otherFields,
5480
- // Spread the extracted output directly (avoid output.output nesting)
5481
- ...extractedOutput && typeof extractedOutput === "object" ? extractedOutput : {}
5482
- },
5493
+ output: aggregatedOutput,
5483
5494
  outputs: (() => {
5484
5495
  if (!previousOutputs) return {};
5485
5496
  const outputs = {};
@@ -7350,6 +7361,9 @@ ${expr}
7350
7361
  // Pass event context for templates
7351
7362
  transform: checkConfig.transform,
7352
7363
  transform_js: checkConfig.transform_js,
7364
+ // Important: pass through provider-level timeout from check config
7365
+ // (e.g., command/http_client providers expect seconds/ms here)
7366
+ timeout: checkConfig.timeout,
7353
7367
  level: extendedCheckConfig.level,
7354
7368
  message: extendedCheckConfig.message,
7355
7369
  env: checkConfig.env,
@@ -7384,10 +7398,19 @@ ${expr}
7384
7398
  const id = issue.ruleId || "";
7385
7399
  return id.endsWith("/__skipped");
7386
7400
  });
7387
- const hasFatalFailure = (depRes.issues || []).some((issue) => {
7401
+ let hasFatalFailure = (depRes.issues || []).some((issue) => {
7388
7402
  const id = issue.ruleId || "";
7389
- return id === "command/execution_error" || id.endsWith("/command/execution_error") || id === "command/transform_js_error" || id.endsWith("/command/transform_js_error") || id === "command/transform_error" || id.endsWith("/command/transform_error") || id.endsWith("/forEach/iteration_error");
7403
+ return id === "command/execution_error" || id.endsWith("/command/execution_error") || id === "command/timeout" || id.endsWith("/command/timeout") || id === "command/transform_js_error" || id.endsWith("/command/transform_js_error") || id === "command/transform_error" || id.endsWith("/command/transform_error") || id.endsWith("/forEach/iteration_error") || id === "forEach/undefined_output" || id.endsWith("/forEach/undefined_output") || id.endsWith("_fail_if") || id.endsWith("/global_fail_if");
7390
7404
  });
7405
+ if (!hasFatalFailure && config && (config.fail_if || config.checks[depId]?.fail_if)) {
7406
+ const failIfResults = await this.evaluateFailureConditions(depId, depRes, config);
7407
+ hasFatalFailure = failIfResults.some((r) => r.failed);
7408
+ }
7409
+ if (debug) {
7410
+ log2(
7411
+ `\u{1F527} Debug: gating check '${checkName}' against dep '${depId}': wasSkipped=${wasSkipped} hasFatalFailure=${hasFatalFailure}`
7412
+ );
7413
+ }
7391
7414
  if (wasSkipped || hasFatalFailure) failedDeps.push(depId);
7392
7415
  }
7393
7416
  if (failedDeps.length > 0) {
@@ -7549,7 +7572,7 @@ ${expr}
7549
7572
  );
7550
7573
  const hadFatalError = (itemResult.issues || []).some((issue) => {
7551
7574
  const id = issue.ruleId || "";
7552
- return id === "command/execution_error" || id.endsWith("/command/execution_error") || id === "command/transform_js_error" || id.endsWith("/command/transform_js_error") || id === "command/transform_error" || id.endsWith("/command/transform_error");
7575
+ return id === "command/execution_error" || id.endsWith("/command/execution_error") || id === "command/transform_js_error" || id.endsWith("/command/transform_js_error") || id === "command/transform_error" || id.endsWith("/command/transform_error") || id === "forEach/undefined_output" || id.endsWith("/forEach/undefined_output");
7553
7576
  });
7554
7577
  const iterationDuration = (Date.now() - iterationStart) / 1e3;
7555
7578
  this.recordIterationComplete(
@@ -7619,6 +7642,24 @@ ${expr}
7619
7642
  issues: allIssues,
7620
7643
  ...finalOutput !== void 0 ? { output: finalOutput } : {}
7621
7644
  };
7645
+ if (config && (config.fail_if || checkConfig.fail_if)) {
7646
+ const failureResults = await this.evaluateFailureConditions(
7647
+ checkName,
7648
+ finalResult,
7649
+ config
7650
+ );
7651
+ if (failureResults.length > 0) {
7652
+ const failureIssues = failureResults.filter((f) => f.failed).map((f) => ({
7653
+ file: "system",
7654
+ line: 0,
7655
+ ruleId: f.conditionName,
7656
+ message: f.message || `Failure condition met: ${f.expression}`,
7657
+ severity: f.severity || "error",
7658
+ category: "logic"
7659
+ }));
7660
+ finalResult.issues = [...finalResult.issues || [], ...failureIssues];
7661
+ }
7662
+ }
7622
7663
  if (allOutputs.length > 0) {
7623
7664
  finalResult.isForEach = true;
7624
7665
  finalResult.forEachItems = allOutputs;
@@ -7665,9 +7706,27 @@ ${expr}
7665
7706
  debug,
7666
7707
  results
7667
7708
  );
7709
+ if (config && (config.fail_if || checkConfig.fail_if)) {
7710
+ const failureResults = await this.evaluateFailureConditions(
7711
+ checkName,
7712
+ finalResult,
7713
+ config
7714
+ );
7715
+ if (failureResults.length > 0) {
7716
+ const failureIssues = failureResults.filter((f) => f.failed).map((f) => ({
7717
+ file: "system",
7718
+ line: 0,
7719
+ ruleId: f.conditionName,
7720
+ message: f.message || `Failure condition met: ${f.expression}`,
7721
+ severity: f.severity || "error",
7722
+ category: "logic"
7723
+ }));
7724
+ finalResult.issues = [...finalResult.issues || [], ...failureIssues];
7725
+ }
7726
+ }
7668
7727
  const hadFatalError = (finalResult.issues || []).some((issue) => {
7669
7728
  const id = issue.ruleId || "";
7670
- return id === "command/execution_error" || id.endsWith("/command/execution_error") || id === "command/transform_js_error" || id.endsWith("/command/transform_js_error") || id === "command/transform_error" || id.endsWith("/command/transform_error");
7729
+ return id === "command/execution_error" || id.endsWith("/command/execution_error") || id === "command/timeout" || id.endsWith("/command/timeout") || id === "command/transform_js_error" || id.endsWith("/command/transform_js_error") || id === "command/transform_error" || id.endsWith("/command/transform_error") || id === "forEach/undefined_output" || id.endsWith("/forEach/undefined_output");
7671
7730
  });
7672
7731
  this.recordIterationComplete(
7673
7732
  checkName,