Skip to content

Clarify Cycles API documentation and balance calculations#8

Merged
amavashev merged 1 commit into
mainfrom
claude/audit-docs-consistency-RVa0v
Mar 12, 2026
Merged

Clarify Cycles API documentation and balance calculations#8
amavashev merged 1 commit into
mainfrom
claude/audit-docs-consistency-RVa0v

Conversation

@amavashev
Copy link
Copy Markdown
Contributor

Summary

This PR improves the accuracy and clarity of the Cycles protocol documentation by refining API response specifications, correcting dry-run behavior descriptions, and fixing the remaining balance calculation formula.

Key Changes

  • Extend Reservation API Response: Added formal response schema documentation for the 200 OK response, including field definitions for status, expires_at_ms, and optional balances array. Updated the example JSON to include the balances field.

  • Dry-Run Behavior Clarification: Corrected the description of dry-run mode to accurately state that "the method does not execute" rather than "the method always runs." Added context that decisions are logged for monitoring purposes, allowing teams to observe enforcement behavior without affecting runtime.

  • Balance Calculation Formula: Fixed the remaining balance calculation to include debt in the formula: allocated - spent - reserved - debt (previously omitted the debt component).

Implementation Details

These changes ensure that:

  1. API consumers have clear expectations about response structure and optional fields
  2. Teams understand that dry-run mode prevents actual method execution while still providing observability
  3. Balance tracking accurately reflects all components affecting available budget, including overdraft debt

https://claude.ai/code/session_01Vj82BkSJtkJPPpbUinb2Wp

- dry-run doc: method does NOT execute when dryRun=true (was incorrectly
  stated as always running)
- API reference: add optional balances field to extend response
- architecture overview: add missing - debt to remaining formula

https://claude.ai/code/session_01Vj82BkSJtkJPPpbUinb2Wp
@amavashev amavashev merged commit 1ac8583 into main Mar 12, 2026
@amavashev amavashev deleted the claude/audit-docs-consistency-RVa0v branch March 17, 2026 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants