AI Code Completion Service  ·  View 12 of 21  ·  Data

Data Model

Twelve entities, none of which holds a line of source code.

Editable source SVG draw.io All views
tenant tenant_id PK retention_mode geography model_tier spend_ceiling seat seat_id PK tenant_id FK principal_oid state revoked_at policy_rule rule_id PK scope tenant|group|seat languages filters precedence consent_record record_id PK tenant_id FK change actor at immutable edit_session session_id PK seat_id FK workspace_id FK replica_id prefix_hash suggestion_request request_id PK session_id FK model_digest FK recipe_version deadline_ms suggestion_outcome request_id PK FK state ttft_ms filtered_by arm_id FK retention_check request_id FK at_seconds chars_surviving measured_at workspace workspace_id PK tenant_id FK repo_ref index_version model_version model_digest PK family decoding_config eval_run_id signed_by experiment_arm arm_id PK experiment_id model_digest FK traffic_pct is_control cost_attribution day, tenant_id, model_digest PK gpu_seconds displayed accepted wasted_pct 1 : N 1 : N 0 : N 1 : N 1 : N 1 : N 1 : 1 1 : N 1 : N 1 : N Data Model — Policy, Session and the Suggestion Event No entity holds code: suggestion_request stores the recipe version, never the prompt. The model_digest on a request and the arm_id on an outcome are columns rather than drawn edges. v 1.0 · owner Developer Experience Architecture · date 2026-10

Decisions

  • suggestion_request stores the prompt recipe version, never the prompt. A quality change is then attributable to context composition without retaining the context.
  • retention_check is a separate entity with its own measurement time, because retention is sampled repeatedly after acceptance rather than recorded once.
  • cost_attribution is keyed by (day, tenant, model digest) so that cost per accepted suggestion is derivable per model without re-reading the interaction log.

Deliberate omissions

  • The model_digest on a request and the arm_id on an outcome are columns rather than drawn relations, to keep the diagram's edges planar.
  • edit_session is retained only as long as the session; it is in the model because routing and cache accounting need it, not because it is durable.

Risks

  • prefix_hash on edit_session is a fingerprint of code the developer has open. It is a hash, but it is a hash of a small, guessable space in some files — treated as code-bearing, not as metadata.