Skip to content
Unverified: This page has not yet been anchored to automated code tests.

Telemetry and research_metrics contract

Code enforcement for row validation: validate_research_metric_row (called from append_research_metric). Repository-scoped producers should use TelemetryWriteOptions plus the METRIC_TYPE_* / SESSION_PREFIX_* / SESSION_ID_* constants in vox_db::research_metrics_contract.

Table research_metrics columns: session_id, metric_type, metric_value (nullable REAL), metadata_json.

  • metric_value: optional scalar. SQL NULL means “no scalar” — APIs must not coerce NULL to 0.0 (aggregations skip nulls; see list_research_metrics_by_type).
  • metadata_json: structured payload; may include units and names that disambiguate mixed benchmarks.
FieldRule
session_idNon-empty; max 512 UTF-8 characters.
metric_typeNon-empty; max 128 characters; characters must be ASCII alphanumeric or _, ., -, : (colon allows MCP-linked namespaces such as foo:bar).
metadata_jsonOptional; if present, max 256 KiB serialized length.

Producers should prefix session_id so rollups and dashboards can group without colliding:

PrefixExampleTypical producer
bench:bench:<repository_id>CLI / build timings
syntaxk:syntaxk:<repository_id>Syntax-K eval fixtures
mcp:mcp:<repository_id>MCP Socrates / surface telemetry
mens:mens:<repository_id>Populi control-plane audit (populi_control_event)
workflow:workflow:<repository_id>Interpreted workflow journal (workflow_journal_entry, versioned event payloads from the workflow durability contract)
route:route:<repository_id>Routing policy and capability-gate telemetry (model_route_event)

Fixed session (no repository in id): hybrid memory fusion uses session socrates:retrieval and metric type memory_hybrid_fusion (see SESSION_ID_MEMORY_HYBRID_FUSION in the Rust module).

Questioning / linked metrics: MCP may use opaque session_key strings for questioning_event and vox_db_research_metric_linked (not forced through TelemetryWriteOptions); those rows still must satisfy validation caps above.

metric_typeSession prefixScalar semanticsNotes
benchmark_eventbench:<repository_id>Optional; unit in metadata metric_value_unitCLI build timings use seconds for wall time.
syntax_k_eventsyntaxk:<repository_id>Optional ratio / timingFixture id in metadata; optional support_metrics (representability / LLM surface / runtime projection summaries per contracts/eval/syntax-k-event.schema.json).
socrates_surfacemcp:<repository_id>Hallucination-risk proxyPrefer metadata for interpretability; eval summaries inject explicit denominators (below).
agent_exec_timemcp:<repository_id>OptionalTool execution duration/budget events used for execution-time calibration.
model_route_eventroute:<repository_id>OptionalRuntime/orchestrator route decisions. metadata_json must include trace_id and route_policy_profile.
model_call_eventroute: / mcp: / producer-definedOptionalPer-call LLM / provider invocation audit row (latency, provider id, tokens when present).
task.root_summaryproducer-definedOptionalHigh-level task / conversation rollup for dashboards.
build.summarybench:OptionalBuild or CI lane rollup (METRIC_TYPE_BUILD_SUMMARY_EVENT).
telemetry.errorproducer-definedOptionalStructured error / fault envelope (METRIC_TYPE_ERROR_EVENT); use for HTTP failures, rate limits, and similar fault paths.
fixture.model.intent_resolvedproducer-definedOptionalAI-first @ai fixture: intent routing metadata (task category, strengths) (METRIC_TYPE_FIXTURE_MODEL_INTENT).
fixture.prompt.dispatchproducer-definedOptionalAI-first @prompt fixture: cascade dispatch observation (METRIC_TYPE_FIXTURE_PROMPT_DISPATCH).
fixture.search.dispatchproducer-definedOptionalAI-first @search fixture: retrieval dispatch observation (METRIC_TYPE_FIXTURE_SEARCH_DISPATCH).
fixture.hole.observedproducer-definedOptionalAI-first @hole fixture: compile-time hole observed (METRIC_TYPE_FIXTURE_HOLE_OBSERVED).
orch.circuit_breaker.triproute:<repository_id> or orchestrator session keyOptional counter / trip markerEmitted when the orchestrator doom-loop circuit breaker transitions to Open (METRIC_TYPE_CIRCUIT_BREAKER_TRIP).
orch.socrates.fusionorchestrator / MCP sessionOptionalSocrates eval fusion rollup (METRIC_TYPE_SOCRATES_FUSION).
orch.routing.tierroute:<repository_id>OptionalTier routing decision telemetry (METRIC_TYPE_MODEL_TIER_ROUTE).
orch.plan.mode_decisionorchestrator sessionOptionalPlan-mode selection (METRIC_TYPE_PLAN_MODE_DECISION).
orch.hitl.interruptorchestrator sessionOptionalHuman-in-the-loop interrupt signal (METRIC_TYPE_HITL_INTERRUPT).
orch.risk.scoreorchestrator sessionOptionalOrchestrator risk scoring (METRIC_TYPE_RISK_SCORE).
orch.privacy.route_decisionorchestrator sessionOptionalPrivacy-aware routing outcome (METRIC_TYPE_PRIVACY_ROUTE_DECISION).
orch.cache.hit_predictionorchestrator sessionOptionalCache hit / predictor telemetry (METRIC_TYPE_CACHE_HIT_PREDICTION).
orch.budget.decisionorchestrator sessionOptionalBudget gate decisions (METRIC_TYPE_BUDGET_DECISION).
orch.calibration.runorchestrator sessionOptionalCalibration job lifecycle (METRIC_TYPE_CALIBRATION_RUN).
orch.calibration.drift_alertorchestrator sessionOptionalModel / signal drift alert (METRIC_TYPE_DRIFT_ALERT).
orch.calibration.bandit_updateorchestrator sessionOptionalBandit / Thompson-style policy update (METRIC_TYPE_BANDIT_UPDATE).
orch.subagent.dispatchorchestrator sessionOptionalSub-agent dispatch (METRIC_TYPE_SUBAGENT_DISPATCH).
orch.subagent.chain_depth_alertorchestrator sessionOptionalDeep sub-agent chain warning (METRIC_TYPE_CHAIN_DEPTH_ALERT).
orch.agentos.guardrail_denyorchestrator sessionOptionalAgentOS guardrail denial (METRIC_TYPE_AGENTOS_GUARDRAIL_DENY).
vox.lint.findinglint:<repository_id>OptionalCR-L8 corpus-feedback: one lint rule firing at a specific location (METRIC_TYPE_LINT_FINDING).
vox.lint.autofix_appliedlint:<repository_id>OptionalCR-L8 corpus-feedback: an autofix was accepted and applied (METRIC_TYPE_LINT_AUTOFIX_APPLIED).
vox.lint.autofix_rejectedlint:<repository_id>OptionalCR-L8 corpus-feedback: an autofix was rejected by the user (METRIC_TYPE_LINT_AUTOFIX_REJECTED).
vox.repair.attemptrepair:<session_id>OptionalCR-L8 corpus-feedback: one LLM repair attempt (METRIC_TYPE_REPAIR_ATTEMPT).
vox.repair.outcomerepair:<session_id>OptionalCR-L8 corpus-feedback: terminal outcome of a vox repair session (METRIC_TYPE_REPAIR_OUTCOME).
vox.audit.runaudit:<thing>OptionalPer-vox audit <thing> run observation (corpus hash, duration, outcome) (METRIC_TYPE_AUDIT_RUN).
vox.model.selection_decisionmodel_autonomic:<id>OptionalModel-autonomic L0: one select(intent, registry) decision (METRIC_TYPE_SELECTION_DECISION).
vox.model.discoverymodel_autonomic:<id>OptionalModel-autonomic L1: new model id discovered in upstream catalog (METRIC_TYPE_MODEL_DISCOVERY).
vox.model.classificationmodel_autonomic:<id>OptionalModel-autonomic L2: classifier tagged a model with tier/strengths/confidence (METRIC_TYPE_MODEL_CLASSIFICATION).
vox.model.confidence_promotionmodel_autonomic:<id>OptionalModel-autonomic L2/L3: model crossed a confidence-state boundary (METRIC_TYPE_CONFIDENCE_PROMOTION).
plugin.load_failureplugin:<plugin_id>OptionalPlugin failed to load (ABI mismatch, missing entrypoint, or init error) (METRIC_TYPE_PLUGIN_LOAD_FAILURE).
sandbox.timeout_killactivity sessionOptionalActivity sandbox killed after exceeding its configured timeout — distinct from agent_exec_time which only tracks completed runs (METRIC_TYPE_SANDBOX_TIMEOUT_KILL).
orch.cache.missorchestrator sessionOptionalLLM provider prompt-cache lookup missed; enables online miss-rate computation alongside cache_read_input_tokens on ModelCallEvent (METRIC_TYPE_ORCH_CACHE_MISS).
orch.task.cancelledorchestrator sessionOptionalTask was explicitly cancelled mid-execution (user interrupt, parent timeout, or lease loss) (METRIC_TYPE_ORCH_TASK_CANCELLED).
vox.doctor.project_checkdoctor:<path>OptionalCR-L7: per-vox doctor --project <path> health-check run — structured outcome alongside human-readable output (METRIC_TYPE_DOCTOR_PROJECT_CHECK).
audit.effort.run.startedaudit:<run_id>Optionalvox audit effort run lifecycle: scan started (METRIC_TYPE_AUDIT_EFFORT_RUN_STARTED).
audit.effort.run.completedaudit:<run_id>Optional; duration in metadatavox audit effort run lifecycle: scan completed successfully (METRIC_TYPE_AUDIT_EFFORT_RUN_COMPLETED).
audit.effort.commit.judgedaudit:<run_id>Optionalvox audit effort: one commit scored/classified during a run (METRIC_TYPE_AUDIT_EFFORT_COMMIT_JUDGED).
audit.route.run.startedaudit:<run_id>Optionalvox audit effort-route run lifecycle: routing started (METRIC_TYPE_AUDIT_ROUTE_RUN_STARTED).
audit.route.run.completedaudit:<run_id>Optional; duration in metadatavox audit effort-route run lifecycle: routing completed successfully (METRIC_TYPE_AUDIT_ROUTE_RUN_COMPLETED).
audit.route.run.failedaudit:<run_id>Optionalvox audit effort-route run lifecycle: routing failed before completion (METRIC_TYPE_AUDIT_ROUTE_RUN_FAILED).
audit.route.cluster.decidedaudit:<run_id>Optionalvox audit effort-route: one cluster-and-route decision recorded (METRIC_TYPE_AUDIT_ROUTE_CLUSTER_DECIDED).
audit.effort.run.failedaudit:<run_id>Optionalvox audit effort run lifecycle: scan failed before completion (METRIC_TYPE_AUDIT_EFFORT_RUN_FAILED).

socrates_surface aggregate metadata (record_socrates_eval_summary)

Section titled “socrates_surface aggregate metadata (record_socrates_eval_summary)”

Rollups written to eval_runs include JSON with both raw counts and explicit denominators so downstream tools do not misread rates when some rows lack a scalar or parseable metadata:

  • rate_denominator: literal "parsed_metadata_rows" — rates (answer_rate, abstain_rate) use this count.
  • abstain_rate_denominator_n / answer_rate_denominator_n: same as parsed_metadata_rows.
  • mean_proxy_denominator_n: rows_with_metric_value — mean hallucination-risk proxy uses only rows where metric_value was non-NULL.
  • rows_total_n: sample_size — all socrates_surface rows scanned.

Quality in eval_runs uses the mean proxy only when rows_with_metric_value > 0; otherwise quality is 0.0 (avoids implying a perfect score with no scalar signal).

benchmark_event metadata (BenchmarkEventMeta)

Section titled “benchmark_event metadata (BenchmarkEventMeta)”
  • name: logical benchmark id (cargo_build_metrics, …).
  • metric_value_unit: when metric_value is set, unit SSOT (seconds, milliseconds, ratio, …).
  • details: free-form JSON (per-crate timings, pass/fail flags).
  • vox ci build-timings (shallow lanes) writes benchmark_event name ci_build_timings with:
    • metric_value: total wall time in seconds,
    • metric_value_unit: seconds,
    • details: lane rows (lane, ok, ms) plus total_ms.
  • vox ci build-timings --deep writes structured rows to build_run / build_crate_sample / build_warning; on structured-write fallback it writes benchmark_event name cargo_build_metrics with metric_value_unit = seconds.
  • VOX_BENCHMARK_TELEMETRY=1 controls benchmark_event writes; structured build_* writes follow command persistence settings and VoxDB availability.

For cross-repo querying via MCP, benchmark_event may use name = "cross_repo_query" with metric_value_unit = "milliseconds" and details such as:

  • query_kind
  • trace_id
  • correlation_id
  • conversation_id
  • workspace_repository_id
  • target_repository_ids
  • source_plane
  • query_backend
  • result_count
  • skipped_count

Envelope per line: { "ts_ms", "event", "payload" }. Payload keys are defined in crates/vox-populi/src/mens/tensor/telemetry_schema.rs (e.g. eta_seconds_remaining, steps_per_sec_ema). The CLI viewer vox mens watch-telemetry must track this schema (guarded by vox ci data-ssot-guards).

Mens training KPI ownership (decision-driving)

Section titled “Mens training KPI ownership (decision-driving)”
  • Tier 1 (gate-driving):
    • tokens_per_sec (with tokens_per_sec_is_proxy when derived),
    • valid_tokens,
    • theoretical_tokens,
    • supervised_ratio_pct.
  • Tier 2 (diagnostic):
    • steps_per_sec_ema,
    • eta_seconds_remaining,
    • skip counters (skip_no_supervised_positions, skip_short_seq, …).
  • Consumers should prefer canonical fields above.
  • Legacy aliases are still read with warnings (status / eval-gate paths), then normalized at read time.
  • steps_per_sec_ema as a throughput surrogate is considered deprecated for gates when tokens_per_sec is present.
  • vox ci data-ssot-guards — asserts watch-telemetry references schema keys and research_metrics list API avoids COALESCE(metric_value, 0.0).
  • Web IR structural gate: workflow sets VOX_WEBIR_VALIDATE=1 and runs cargo nextest run -p vox-compiler --test web_ir_lower_emit_test --run-ignored ignored-only (see .github/workflows/ci.yml).