Sibyl

Sibyl Platform -- Bootstrap, Session, Billing

Server-side sibyl -- bootstrap Tailscale auth, session manager tiers, billing ClickHouse, inference handler.

Sibyl Platform -- Bootstrap, Session, Billing (v2026-08-22T175604Z-b502e8bc6d) 2026-08-22 | Server-side sibyl -- bootstrap Tailscale auth, session manager tiers, billing ClickHouse, inference handler. 1 - BOOTSTRAP - Tailscale auth and session setup Client POST /api/sibyl/bootstrap sibyl-setup wizard bearer token sibyl_bootstrap.bootstrap _provision_tailscale_key _sign_response Tailscale API POST /api/v2/tailnet/{tailnet}/keys key_vault get_or_env TAILSCALE_API_KEY KEVIN_FLEET_KEY Grant Bearer t… ephemeral auth… signed response 2 - SESSION MANAGEMENT - Active user sessions User create touch teardown sibyl_session_manager.SibylSessionManager create touch teardown list_active EventBus sibyl:session_created sibyl:session_torn_down session request session info 3 - BILLING - ClickHouse billing events sibyl_billing_writer.record _insert BillingEvent ClickHouse INSERT INTO kevin.openspec_billing_events env CLICKHOUSE_HOST CLICKHOUSE_PORT CLICKHOUSE_USER CLICKHOUSE_PASSWORD billing event SQL insert 1. Client sends bootstrap… 2. Provision Tailscale key 3. Sign response with HMAC 4. User creates session 5. Touch session on activ… 6. Teardown session expli… 7. Record billing event Bootstrap response payload tailscale_auth_key: 'ts-auth-key' fleet_key_b64: 'fleet-key-b64' kevin_tailscale_ip: '100.64.0.1' expires_at: '2023-10-01T00:00:00Z' signature: 'hmac-signature' Billing event payload job_id: 'job-123' client_id: 'client-456' product: 'sibyl' task_type: 'document_process' provider: 'groq' model: 'mixtral-7b' input_tokens: 100 output_tokens: 200 cost_usd: 0.05 hmac_receipt: 'hmac-receipt' change_id: 'change-789' spec_level: 0 Tailscale API key and fleet key are fetched from key_vault. Session manager uses in-memory storage for active sessions. Billing events are asynchronously written to ClickHouse. Legend actor = initiates work · process = code path · store = state on disk · bus = durable queue · dashed = separate process cyan = request flow · pink = state read/write · dashed green = pull / return path · red = refusal As of 2026-08-22 22:15 UTC, from commit d94c202

Provenance

This drawing is generated, not drawn. It is rebuilt from the source files below, so when they change the picture changes — a diagram here cannot quietly describe a system that no longer works this way.

Owner
Sibyl
Slug
sibyl-platform
Rendered
2026-08-22T175604Z
From commit
b502e8bc6d
Updated
22 Aug 2026, 22:15 UTC
Sources at
d94c202
Watches
5 paths
  • daemon/src/sibyl_router.py
  • daemon/src/sibyl_bootstrap.py
  • daemon/src/sibyl_session_manager.py
  • daemon/src/sibyl_billing_writer.py
  • daemon/src/sibyl_inference_handler.py