Skip to content

Commit 38914b5

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 38a227a commit 38914b5

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export const AltimateCorePolicyTool = Tool.define("altimate_core_policy", {
3131
return {
3232
title: `Policy: ${data.pass ? "PASS" : "VIOLATIONS FOUND"}`,
3333
metadata: {
34-
success: result.success,
34+
success: true, // engine ran — violations are findings, not failures
3535
pass: data.pass,
3636
has_schema: hasSchema,
3737
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
@@ -35,7 +35,7 @@ export const AltimateCoreSemanticsTool = Tool.define("altimate_core_semantics",
3535
return {
3636
title: hasError ? "Semantics: ERROR" : `Semantics: ${data.valid ? "VALID" : `${issueCount} issues`}`,
3737
metadata: {
38-
success: result.success,
38+
success: true, // engine ran — semantic issues are findings, not failures
3939
valid: data.valid,
4040
issue_count: issueCount,
4141
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
@@ -34,7 +34,7 @@ export const AltimateCoreValidateTool = Tool.define("altimate_core_validate", {
3434
return {
3535
title: `Validate: ${data.valid ? "VALID" : "INVALID"}`,
3636
metadata: {
37-
success: result.success,
37+
success: true, // engine ran — validation errors are findings, not failures
3838
valid: data.valid,
3939
has_schema: hasSchema,
4040
dialect: "snowflake",

0 commit comments

Comments
 (0)