← Build log

Jun

June 2026: Surge cost tracking and expansion, DomainCal hardening

Surge · DomainCal

Surge

LLM cost tracking. Every LLM trace now carries the tenant and account it belongs to, and platform admins get cost rollups per environment. A reconcile_llm_usage command cross-checks those rollups against Langfuse, and cache tokens are rolled up from both of Langfuse’s usage-key conventions.

Product catalog. Settings has a new Product Catalog tab with tables, side panels and CSV import.

Account-intelligence orchestration also moved to a weekly cadence.

Expansion opportunities. A new Expansion Opportunity Agent runs after account intelligence, with a one-off sweep command for existing accounts. Then the rest of the product learned to use what it finds:

  • An Expansion Opportunities work queue.
  • Opportunities show up in the Negotiation tab, and the negotiation strategy agent takes them in as context.
  • The Give/Get rows and the CSM counters are expansion-aware.

Prompts now live only in Langfuse, as the single source of truth, and I dropped deprecated commercial-floor preference fields from the agent inputs.

Prompt caching. Anthropic prompt caching is on across every LLM call site, and usage counting now includes cached tokens. Negotiation strategy and trade-off generation also retries now, and surfaces failures instead of hiding them.

DomainCal

A hardening pass, all in one day:

  • Patched Next.js to 16.2.9 for high-severity security advisories.
  • Removed the unauthenticated test-whois and test-domains debug endpoints.
  • Email-verification tokens now expire, are hashed at rest and work once.
  • Stopped logging tokens and personal data, and made the cron secret check timing-safe.
  • Stopped shipping raw WHOIS JSON and join rows in the domain list.
  • Fixed the expiry-alert day math: it floors days and skips expired domains.