Skip to content

fix(devex): start the depot contract line from the credit balance - #132037

Merged
trunk-io[bot] merged 2 commits into
masterfrom
ga/digest-depot-credit-balance
Nov 9, 2026
Merged

trunk-io[bot] merged 2 commits into
masterfrom
ga/digest-depot-credit-balance

Conversation

@gantoine

@gantoine gantoine commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Problem

Changes

  • The contract line now starts from Depot's credit balance, current as of the last invoice, and subtracts this month's usage.
  • A run makes at most about 31 one-day usage requests.
  • The sentence now says "not counting this month's cache storage".
  • A failed or non-USD balance read drops only the contract sentence.

How did you test this code?

  • Not run: the real Depot API, which needs an organization token. A dry-run dispatch after merge checks it.

Test rationale: the contract test now fails if the month-to-date subtraction is dropped. New cases cover a failed or non-USD balance.

Release status

  • No feature flag controls this change

Docs update

  • None.

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

Agent: Claude Code, Claude Opus 5.5 (claude-opus-5-5)

Skills: /writing-tests, /writing-pr-descriptions

More context for AI agents

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gantoine gantoine added the skip-agent-review Save $$$, skip auto agent reviews (Greptile) — use for trivial or chore PRs label Nov 9, 2026
@gantoine gantoine self-assigned this Nov 9, 2026
@trunk-io

trunk-io Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

😎 Merged successfully - details.

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

🤖 CI report

🚨 Trunk lane — universal lane

This PR is assigned to the universal lane. It cannot merge in parallel with other PRs, so it can take longer to merge. Ask dev-ex if you think this is wrong.

@gantoine
gantoine marked this pull request as ready for review November 9, 2026 18:03
@stamphog
stamphog Bot requested a review from a team November 9, 2026 18:03
@parameterai

parameterai Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Risk: No findings

The digest's Depot contract line now derives usage from Depot's credit balance (a new GetCreditBalance API call) minus month-to-date spend, instead of summing every day since the contract started; failed or non-USD balance reads drop only the contract sentence. The only new network surface is a hardcoded HTTPS call to api.depot.dev with strict response validation, fixed-text errors, and a 30-second timeout, so no user-controlled data reaches any dangerous sink.

Sentinel reviewed abfbc9e · Review settings

@veria-ai

veria-ai Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

PR overview

No security issues were found in this pull request.

Reviews

@gantoine

gantoine commented Nov 9, 2026

Copy link
Copy Markdown
Member Author

/trunk merge

@gantoine

gantoine commented Nov 9, 2026

Copy link
Copy Markdown
Member Author

/trunk merge

@trunk-io
trunk-io Bot merged commit 83f3464 into master Nov 9, 2026
202 checks passed
@trunk-io
trunk-io Bot deleted the ga/digest-depot-credit-balance branch November 9, 2026 21:39
@deployment-status-posthog

deployment-status-posthog Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Deploy status

Environment Status Deployed At Workflow
dev ✅ Deployed 2026-11-09 22:20 UTC Run
prod-us ✅ Deployed 2026-11-09 22:40 UTC Run
prod-eu ✅ Deployed 2026-11-09 22:44 UTC Run

This table shows the posthog release only. Hogstation shows every service that this PR reaches, Kargo services included.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-agent-review Save $$$, skip auto agent reviews (Greptile) — use for trivial or chore PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants