4.4 KiB
4.4 KiB
Address Runtime Contracts V1 (Code Sync)
Дата: 2026-04-02
Reference:
address_architecture_contract_v1.md(guardrails and stage boundaries)llm_normalizer/backend/src/types/addressQuery.tsllm_normalizer/backend/src/services/addressQueryService.tsllm_normalizer/backend/src/services/assistantService.ts(buildAddressDebugPayload)
Runtime Policy
- Runtime lane is
data-agnostic: без company-specific словарей в коде. - Acceptance lane is
data-aware: позитивные live-кейсы подбираются отдельно. - Address lane: MCP/live-first, whitelist-only, read-only.
- Canonical boundary:
Decompose -> Resolve -> Execute -> Compose. - LLM pre-decompose интерпретирует текст, но не подменяет whitelist execution.
Input Contract
question_mode:address_query | deep_analysis | unsupportedaddress_intent: enum intents +unknownextracted_filters: objectmissing_required_filters: string[]
Debug Contract (actual payload)
Core detection:
detected_modedetected_mode_confidencequery_shapequery_shape_confidencedetected_intentdetected_intent_confidence
Filter + recipe:
extracted_filtersmissing_required_filtersselected_recipe
Resolver block:
anchor_typeanchor_value_rawanchor_value_resolvedresolver_confidenceambiguity_count
MCP/evidence flow block:
mcp_call_statusmcp_call_status_legacymatch_failure_stagematch_failure_reasonrows_fetchedraw_rows_receivedrows_after_account_scoperows_materializedrows_after_recipe_filterrows_matchedraw_row_keys_samplematerialization_drop_reason
Account-scope audit block:
account_scope_modeaccount_scope_fallback_appliedaccount_token_rawaccount_token_normalizedaccount_scope_fields_checkedaccount_scope_match_strategyaccount_scope_drop_reason
Result block:
runtime_readinesslimited_reason_categoryresponse_typelimitationsreasons
Assistant-level metadata (added in buildAddressDebugPayload):
llm_decomposition_attemptedllm_decomposition_appliedllm_provider_usedllm_decomposition_trace_idllm_decomposition_effective_messagellm_decomposition_reasonfallback_rule_hitsanitized_user_messagetool_gate_decisiontool_gate_reasonexecution_lane(address_query)
Output Contract
FACTUAL_LIST
- short factual summary
- rows list
- optional hints
FACTUAL_SUMMARY
- aggregate summary
- compact top rows
LIMITED_WITH_REASON
- explicit reason code
- missing filters / data visibility note
Limited Reason Taxonomy
empty_match- live запрос выполнен, но по фильтрам нет строк.missing_anchor- не хватает обязательного якоря или якорь не подтвердился.recipe_visibility_gap- текущий recipe не дает нужной видимости.execution_error- ошибка MCP/feature-flag/инфраструктуры.unsupported- intent не поддержан в Address V1.
Runtime Readiness Status
LIVE_QUERYABLELIVE_QUERYABLE_WITH_LIMITSREQUIRES_SPECIALIZED_RECIPEDEEP_ONLYUNKNOWN
MCP Stage Status Taxonomy
skippederrorno_raw_rowsraw_rows_received_but_not_materializedmaterialized_but_not_anchor_matchedmaterialized_but_filtered_out_by_recipematched_non_empty
Legacy compatibility:
mcp_call_status_legacyможет бытьmaterialized_but_not_matchedдля backward-compatible аналитики.
Materialization Drop Reasons
nonedropped_by_account_scope_filtermissing_period_and_registrator_fieldsmissing_period_fieldmissing_registrator_fieldunknown_row_shape
Account Scope Strategy
strict- account scope обязателен и работает как hard filter.preferred- account scope применяется first-pass; если дал 0 строк при наличии raw rows, runtime может fallback к raw rows.
Compound Query Note
COMPOUND_FACTUAL_QUERYпока detection-only.- Multi-intent decomposition execution в runtime V1 не включен.
Guardrails
- whitelist recipes only
- read-only MCP
- no free-form query generation
- no silent source substitution
- false factuals are forbidden (
rows_matched > 0required for factual)