Skip to content

Add comprehensive tenant and scope documentation#109

Merged
amavashev merged 4 commits intomainfrom
claude/improve-tenant-docs-7zd1B
Mar 20, 2026
Merged

Add comprehensive tenant and scope documentation#109
amavashev merged 4 commits intomainfrom
claude/improve-tenant-docs-7zd1B

Conversation

@amavashev
Copy link
Contributor

Summary

This PR adds two major new documentation guides that explain the foundational concepts of tenant isolation and budget hierarchy in Cycles, along with updates to existing docs to cross-reference the new material.

Key Changes

New Documentation:

  • how-to/tenant-creation-and-management-in-cycles.md (741 lines) — Complete guide to the tenant lifecycle including:

    • Creating, listing, retrieving, and updating tenants via the Admin API
    • Tenant status lifecycle (ACTIVE, SUSPENDED, CLOSED) with use cases and transitions
    • Hierarchical tenant relationships for organizational modeling
    • Tenant metadata for external system correlation
    • End-to-end onboarding sequence (tenant → API key → budget)
    • Common use cases (SaaS per-customer, internal departments, reseller hierarchies, environment separation)
    • Best practices and troubleshooting
  • how-to/understanding-tenants-scopes-and-budgets-in-cycles.md (534 lines) — Conceptual guide explaining how the three building blocks work together:

    • Tenant isolation boundaries and protocol-level enforcement
    • Scope hierarchy derived from Subject fields (tenant → workspace → app → workflow → agent → toolset)
    • Gap-skipping and custom dimensions for flexible budget modeling
    • Budget ledger formula and enforcement semantics
    • Scope structure design patterns (tenant-only → workspace → app → per-execution)
    • Complete worked example with multiple scope levels
    • Best practices for tenant and scope management

Documentation Updates:

  • Updated .vitepress/config.ts to add the two new guides to the "How-To" navigation section
  • Added cross-references in existing docs:
    • how-to/api-key-management-in-cycles.md — link to tenant creation guide
    • how-to/common-budget-patterns.md — link to tenants/scopes/budgets guide
    • quickstart/architecture-overview-how-cycles-fits-together.md — link to tenants/scopes/budgets guide
    • how-to/how-to-model-tenant-workflow-and-run-budgets-in-cycles.md — updated next steps section
    • protocol/authentication-tenancy-and-api-keys-in-cycles.md — updated next steps section
    • protocol/how-scope-derivation-works-in-cycles.md — updated next steps section
  • Minor clarification in glossary.md for the Scope definition
  • Updated quickstart/deploying-the-full-cycles-stack.md to reference tenant creation guide

Notable Implementation Details

  • Both guides use consistent formatting with code examples, tables, and visual diagrams to explain hierarchical concepts
  • The tenant guide includes practical curl examples for all Admin API operations
  • The scopes guide includes a decision framework table to help users choose appropriate scope levels
  • Both guides emphasize idempotency, atomicity, and protocol-level enforcement as key design principles
  • Cross-references are bidirectional to help users navigate between related concepts

https://claude.ai/code/session_01BTfkquf1MgDxBGjxm4B1ws

claude and others added 4 commits March 20, 2026 13:16
Addresses the gap where tenant management information was scattered
across 7+ docs with no single entry point. Developers asking about
tenant creation, scopes, lifecycle, and Admin API usage now have a
dedicated guide covering the full tenant CRUD lifecycle.

New: docs/how-to/tenant-creation-and-management-in-cycles.md
- Full Admin API walkthrough (create, list, get, update)
- Status lifecycle (ACTIVE/SUSPENDED/CLOSED) with operational guidance
- Hierarchical tenants (parent_tenant_id) with worked examples
- Tenant config defaults (TTL, overage policy, expiry policy)
- Metadata patterns and end-to-end onboarding workflow
- Common use cases (SaaS, departments, resellers, environments)
- Troubleshooting section for common tenant errors

Also updates:
- Sidebar: adds Tenant Management entry in How-To Guides
- Glossary: adds Tenant entry, cross-links Tenant Isolation and Admin Server
- 5 existing docs: adds cross-links for user journey navigation

https://claude.ai/code/session_01BTfkquf1MgDxBGjxm4B1ws
…s-linking

Developers lacked a single doc explaining how tenants, scopes, and budgets
relate as a unified model. Existing docs covered each concept in isolation
(architecture = components, scope derivation = mechanics, budget allocation
= curl commands) without tying them together.

New: docs/how-to/understanding-tenants-scopes-and-budgets-in-cycles.md
- Explains the three building blocks and how they relate
- Visual diagrams showing the tenant → scope → budget hierarchy
- How a reservation flows through the scope hierarchy atomically
- Scope design guidance (start simple, decision framework)
- Managing scopes in practice (creating budgets, querying, resetting)
- Complete worked example with curl commands
- Common questions (FAQ format)

Also updates:
- Sidebar: adds "Tenants, Scopes, and Budgets" as first How-To item
- Scope derivation doc: replaces generic GitHub links with targeted cross-links
- 5 existing docs: adds model guide links in intro/Next steps
- Glossary: enhances Scope entry with link to model guide

https://claude.ai/code/session_01BTfkquf1MgDxBGjxm4B1ws
Fixes:
- Remove unsupported fields from tenant creation curl example
  (TenantCreateRequest only accepts tenant_id, name, parent_tenant_id,
  metadata, default_commit_overage_policy — not TTL/expiry/extension fields)
- Clarify server-level defaults vs settable-per-tenant config
- Fix pagination max limit: 200 → 100 (matches Math.min(limit, 100))
- Fix budget allocation formula: add missing '- debt' term

New best practices sections:
- Model guide: tenant, scope, and budget best practices covering
  isolation boundaries, scope consistency, canonical hierarchy,
  overage policies, funding idempotency, and monitoring
- Tenant management: naming conventions, suspend-before-close,
  metadata consistency, per-environment API keys, and automated
  onboarding with scripted example

https://claude.ai/code/session_01BTfkquf1MgDxBGjxm4B1ws
fixed architecture layout
@amavashev amavashev merged commit 6a40ecc into main Mar 20, 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