naco-api/sql/queries
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Nacorid 0dcb74675e fix(analytics,x402): fix coverage gaps, engagement drivers, and Twitter cost passing
Analytics review fixes:
- Store Twitter analytics coverage as discrete intervals instead of a single
  contiguous window so disjoint fetch ranges no longer mask inner gaps as
  covered (fetch per uncovered range, add gap regression tests)
- Compute real AvgEngagement/Correlation in getEngagementDrivers instead of
  all-zero placeholders
- Make parseAnalyticsTimeRange surface invalid timestamps, cap merged analytics
  posts at limit, and normalize sentiment by timestamped posts only
- gofmt: fix misalignment in config.go and types.go
- Include Twitter in the default aggregate analytics scope; its API costs are
  passed to the caller through paid tool pricing

x402 cost passing:
- computeTwitterStyleProfileCost now charges base cost ($0.10) + user lookup
  ($0.01) + $0.005 per Twitter post, guaranteeing the charge always clears the
  underlying API cost (never break-even or loss)
- Return a $-prefixed dollar string for the settlement override, fixing the
  previously off-by-factor-100 raw-atomic-unit amount
- Raise getStyleProfile base registration to $0.36 to authorize the max Twitter
  charge
- Add tests for the cost formula, profitable floor, and dollar formatting
2026-09-02 22:44:02 +00:00
..
AnalyticsCache.sql store: add sqlc queries for analytics cache, posts and coverage 2026-09-02 23:49:35 +02:00
AnalyticsCoverage.sql fix(analytics,x402): fix coverage gaps, engagement drivers, and Twitter cost passing 2026-09-02 22:44:02 +00:00
AnalyticsPosts.sql store: add sqlc queries for analytics cache, posts and coverage 2026-09-02 23:49:35 +02:00
DeleteStylePosts.sql db: add user_style_posts table for post ID caching 2026-09-01 23:41:45 +02:00
FindSimilarUsers.sql Use named parameters in SQL queries to avoid ColumnN naming in sqlc generated structs 2026-08-30 22:41:53 +02:00
GetStylePostByID.sql db: add user_style_posts table for post ID caching 2026-09-01 23:41:45 +02:00
GetStylePosts.sql db: add user_style_posts table for post ID caching 2026-09-01 23:41:45 +02:00
GetStylePostsByIDs.sql db: add user_style_posts table for post ID caching 2026-09-01 23:41:45 +02:00
GetStyleProfile.sql Use named parameters in SQL queries to avoid ColumnN naming in sqlc generated structs 2026-08-30 22:41:53 +02:00
PruneStylePosts.sql db: add user_style_posts table for post ID caching 2026-09-01 23:41:45 +02:00
SaveTransaction.sql Major changes 2025-12-02 19:33:03 +00:00
UpsertStylePosts.sql db: add user_style_posts table for post ID caching 2026-09-01 23:41:45 +02:00
UpsertStyleProfiles.sql Use named parameters in SQL queries to avoid ColumnN naming in sqlc generated structs 2026-08-30 22:41:53 +02:00