@probelabs/visor 0.1.86 → 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 = {};
@@ -7387,10 +7398,19 @@ ${expr}
7387
7398
  const id = issue.ruleId || "";
7388
7399
  return id.endsWith("/__skipped");
7389
7400
  });
7390
- const hasFatalFailure = (depRes.issues || []).some((issue) => {
7401
+ let hasFatalFailure = (depRes.issues || []).some((issue) => {
7391
7402
  const id = issue.ruleId || "";
7392
- 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") || id === "forEach/undefined_output" || id.endsWith("/forEach/undefined_output") || id.endsWith("_fail_if") || id.endsWith("/global_fail_if");
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");
7393
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
+ }
7394
7414
  if (wasSkipped || hasFatalFailure) failedDeps.push(depId);
7395
7415
  }
7396
7416
  if (failedDeps.length > 0) {
@@ -7622,6 +7642,24 @@ ${expr}
7622
7642
  issues: allIssues,
7623
7643
  ...finalOutput !== void 0 ? { output: finalOutput } : {}
7624
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
+ }
7625
7663
  if (allOutputs.length > 0) {
7626
7664
  finalResult.isForEach = true;
7627
7665
  finalResult.forEachItems = allOutputs;
@@ -7668,9 +7706,27 @@ ${expr}
7668
7706
  debug,
7669
7707
  results
7670
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
+ }
7671
7727
  const hadFatalError = (finalResult.issues || []).some((issue) => {
7672
7728
  const id = issue.ruleId || "";
7673
- 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");
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");
7674
7730
  });
7675
7731
  this.recordIterationComplete(
7676
7732
  checkName,