Skip to content

Claude/analyze tenant config 0 e cd6#17

Merged
amavashev merged 2 commits intomainfrom
claude/analyze-tenant-config-0ECd6
Mar 24, 2026
Merged

Claude/analyze tenant config 0 e cd6#17
amavashev merged 2 commits intomainfrom
claude/analyze-tenant-config-0ECd6

Conversation

@amavashev
Copy link
Contributor

Audit Summary

Fix Applied

Protocol spec (cycles-protocol/cycles-protocol-v0.yaml) — added 3 missing ErrorCode values that were in the Java implementation but not the YAML spec:

  • BUDGET_FROZEN — returned when operations target a frozen budget
  • BUDGET_CLOSED — returned when operations target a closed budget
  • MAX_EXTENSIONS_EXCEEDED — returned when a reservation hits its extension limit

Committed as bf5c620 and pushed to claude/analyze-tenant-config-0ECd6.

Everything Else Is Consistent

Check cycles-server cycles-server-admin Match?
UnitEnum values USD_MICROCENTS, TOKENS, CREDITS, RISK_POINTS Same Yes
Redis key format budget:{scope}:{unit} (Lua + Java) budget:{scope}:{unit} (Java) Yes
Scope string format tenant:{t}/workspace:{w} via ScopeDerivationService Same canonical format Yes
ErrorResponse fields error, message, request_id, details Same Yes
Endpoint paths All match spec All match spec (incl. query param refactor) Yes
HTTP status codes 201 for events, 409 for budget errors 201 for create, 409 for conflicts Yes
Spec version v0.1.24 v0.1.24 Yes

Test Results

  • cycles-server: BUILD SUCCESS (all unit tests pass)
  • cycles-server-admin: BUILD SUCCESS (all unit tests pass)

The admin audit found 2 more discrepancies. Let me fix them.

claude added 2 commits March 24, 2026 16:24
…DGET_CLOSED, MAX_EXTENSIONS_EXCEEDED)

The Java implementation and tests use these 3 error codes but they were
missing from the YAML spec enum. This brings the spec in sync with the
server implementation.

https://claude.ai/code/session_01WeUFfwYKWvpCXPUYsZLqUa
The Java implementation returns a charged field when overage_policy is
ALLOW_IF_AVAILABLE and the actual was capped. This was missing from the
YAML spec (which also has additionalProperties: false, making it a
strict violation). Adds the field to align spec with implementation.

https://claude.ai/code/session_01WeUFfwYKWvpCXPUYsZLqUa
@amavashev amavashev merged commit fcb147a into main Mar 24, 2026
1 check passed
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