Skip to content

[drift] CLI surface changed, consumers need update #15

Description

@areales

Drift Detection Report

Comparison of bbdata's current source against documented consumer expectations revealed the following mismatches:

1. Query Template Count Mismatch

Affected Consumer: ai-baseball-data-analyst
Expected: 21 query templates
Found: 22 query templates

New/additional templates not documented in consumer expectations:

  • All 21 expected templates are present, plus one extra template appears to be registered

2. Report JSON Meta Fields Mismatch (CRITICAL)

Affected Consumer: scout-app (src/lib/prefetch.ts)
Expected meta fields: source, cached, queryTimeMs, season, sampleSize
Actual meta fields in report command: template, player, audience, season, dataSources

Issue: The report command's meta object has completely different fields than what scout-app expects when consuming report templates (pro-pitcher-eval, pro-hitter-eval, advance-sp, relief-pitcher-quick, trade-target-onepager).

Missing fields in current implementation:

  • source (have dataSources array instead)
  • cached
  • queryTimeMs
  • sampleSize

Current report meta instead has:

  • template (matches expectation)
  • player (unexpected)
  • audience (unexpected)
  • season (matches expectation)
  • dataSources (plural, unexpected format)

3. Query JSON Meta Addition

Affected Consumer: scout-app (via query command)
Note: Query command's meta object adds an extra template field beyond what scout-app expects. This is additive and shouldn't break code that only destructures needed fields, but worth noting.


All Checks Passed

✓ All expected query flags present (--player, --players, --season, --format, --stat, --min-ip, --min-pa, --top, --pitch-type, --seasons, --source)
✓ All expected report flags present (--player, --season, --audience, --format, --validate)
✓ All expected report templates present (13 templates)
✓ All expected audiences present (coach, gm, scout, analyst)


Action Required

The report command's meta envelope needs to be reconciled with scout-app's expectations. Either:

  1. Update report meta to match scout-app's expected fields, OR
  2. Update scout-app's prefetch.ts to consume the new meta format, OR
  3. Document that the consumer expectations are outdated and update them to match current implementation

The query template count discrepancy should also be investigated—verify which template is the "extra" one and ensure both downstream consumers (scout-app's agent prompt and ai-baseball-data-analyst's skill docs) are synchronized with the current count.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions