Skip to content

Commit faab17f

Browse files
suryaiyer95claude
andcommitted
fix: [AI-5975] decouple metadata.success from domain outcomes in finding tools
Five tools were suppressing `sql_quality` telemetry because their `metadata.success` tracked domain outcomes (SQL invalid, policy violated, queries not equivalent) rather than engine execution success. `tool.ts` gate: `!isSoftFailure && findings.length > 0` - `isSoftFailure = metadata.success === false` - Tools that found issues had `success: false` → findings suppressed Fix: set `success: true` when the engine ran (even if it found problems). Domain outcomes remain in dedicated fields (`valid`, `pass`, `equivalent`, `fixed`). Only catch blocks set `success: false` (real engine crashes). Affected tools: - `altimate_core_validate` — validation errors now emit `sql_quality` - `altimate_core_semantics` — semantic issues now emit `sql_quality` - `altimate_core_policy` — policy violations now emit `sql_quality` - `altimate_core_equivalence` — differences now emit `sql_quality` - `altimate_core_fix` — unfixable errors now emit `sql_quality` Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent d9cc0ae commit faab17f

5 files changed

Lines changed: 5 additions & 5 deletions

File tree

packages/opencode/src/altimate/tools/altimate-core-equivalence.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export const AltimateCoreEquivalenceTool = Tool.define("altimate_core_equivalenc
3333
return {
3434
title: `Equivalence: ${data.equivalent ? "EQUIVALENT" : "DIFFERENT"}`,
3535
metadata: {
36-
success: result.success,
36+
success: true, // engine ran — differences are findings, not failures
3737
equivalent: data.equivalent,
3838
has_schema: hasSchema,
3939
dialect: "snowflake",

packages/opencode/src/altimate/tools/altimate-core-fix.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export const AltimateCoreFixTool = Tool.define("altimate_core_fix", {
3434
return {
3535
title: `Fix: ${data.success ? "FIXED" : "COULD NOT FIX"}`,
3636
metadata: {
37-
success: result.success,
37+
success: true, // engine ran — unfixable errors are findings, not failures
3838
fixed: !!data.fixed_sql,
3939
has_schema: hasSchema,
4040
dialect: "snowflake",

packages/opencode/src/altimate/tools/altimate-core-policy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export const AltimateCorePolicyTool = Tool.define("altimate_core_policy", {
3030
return {
3131
title: `Policy: ${data.pass ? "PASS" : "VIOLATIONS FOUND"}`,
3232
metadata: {
33-
success: result.success,
33+
success: true, // engine ran — violations are findings, not failures
3434
pass: data.pass,
3535
has_schema: hasSchema,
3636
dialect: "snowflake",

packages/opencode/src/altimate/tools/altimate-core-semantics.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export const AltimateCoreSemanticsTool = Tool.define("altimate_core_semantics",
2929
return {
3030
title: `Semantics: ${data.valid ? "VALID" : `${issueCount} issues`}`,
3131
metadata: {
32-
success: result.success,
32+
success: true, // engine ran — semantic issues are findings, not failures
3333
valid: data.valid,
3434
issue_count: issueCount,
3535
has_schema: hasSchema,

packages/opencode/src/altimate/tools/altimate-core-validate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export const AltimateCoreValidateTool = Tool.define("altimate_core_validate", {
2828
return {
2929
title: `Validate: ${data.valid ? "VALID" : "INVALID"}`,
3030
metadata: {
31-
success: result.success,
31+
success: true, // engine ran — validation errors are findings, not failures
3232
valid: data.valid,
3333
has_schema: hasSchema,
3434
dialect: "snowflake",

0 commit comments

Comments
 (0)