Skip to content

Commit 66e9558

Browse files
anandgupta42claude
andcommitted
test: add comprehensive integration tests for telemetry signals
Add 38 integration tests that verify all 7 telemetry signals fire through real code paths with spy on Telemetry.track(): - Signal 1: quality signal derivation + error/abandoned/cancelled cases - Signal 2: intent classifier with 10 real DE prompts + PII safety - Signal 3: tool chain collection with error recovery state machine - Signal 4: error fingerprint hashing + consecutive error flush - Signal 5: SQL fingerprint via altimate-core (aggregation, CTE, DDL) - Signal 6: environment_census expansion + backward compatibility - Signal 7: schema complexity bucketing + zero-table edge case - Full E2E: complete session simulation with all 7 signals in order Also fixes regex patterns for natural language flexibility: - dbt debug: allows words between "dbt" and error keywords - migrate: allows words between "to/from" and warehouse name Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 294dab5 commit 66e9558

2 files changed

Lines changed: 877 additions & 2 deletions

File tree

packages/opencode/src/altimate/telemetry/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ export namespace Telemetry {
561561
const patterns: Array<{ intent: string; strong: RegExp[]; weak: RegExp[] }> = [
562562
{
563563
intent: "debug_dbt",
564-
strong: [/dbt\s+(error|fail|bug|issue|broken|fix|debug|not\s+work)/],
564+
strong: [/dbt\s+.*?(error|fail|bug|issue|broken|fix|debug|not\s+work)/],
565565
weak: [/dbt\s+(run|build|test|compile|parse)/, /dbt_project/, /ref\s*\(/, /source\s*\(/],
566566
},
567567
{
@@ -591,7 +591,7 @@ export namespace Telemetry {
591591
},
592592
{
593593
intent: "migrate_sql",
594-
strong: [/migrat|convert.*(?:to|from)\s+(?:snowflake|bigquery|postgres|redshift|databricks)/, /translate.*(?:sql|dialect)/],
594+
strong: [/migrat|convert.*(?:to|from)\s+.*?(?:snowflake|bigquery|postgres|redshift|databricks)/, /translate.*(?:sql|dialect)/],
595595
weak: [/dialect|transpile|port\s+(?:to|from)/],
596596
},
597597
{

0 commit comments

Comments
 (0)