NODEDC_1C/docs/orchestration/detector_registry.json

331 lines
16 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
"schema_version": "agent_detector_registry_v1",
"updated_at": "2026-05-24",
"purpose": "Machine-readable registry for detector names referenced by issue_catalog and business answer contracts. This keeps manual semantic findings on the path to repeatable replay/eval checks.",
"detectors": {
"missing_effective_runtime_json": {
"kind": "artifact_presence",
"automation_level": "automatic",
"description": "Run artifact directory must contain effective_runtime.json before a replay can be accepted or saved as evidence.",
"issue_codes": ["runtime_manifest_missing"],
"inputs": ["artifacts/domain_runs/<run_id>/effective_runtime.json"],
"check": {
"required_files": ["effective_runtime.json"]
}
},
"default_prompt_version_missing_files": {
"kind": "prompt_registry_healthcheck",
"automation_level": "automatic",
"description": "DEFAULT_PROMPT_VERSION points to prompt files that are missing from the prompt registry.",
"issue_codes": ["prompt_registry_opaque"],
"inputs": ["llm_normalizer/backend/src/services/promptBuilder.ts", "llm_normalizer/data/presets/*.json"],
"check": {
"command": "python scripts/prompt_registry_healthcheck.py"
}
},
"silent_prompt_fallback": {
"kind": "prompt_registry_healthcheck",
"automation_level": "automatic",
"description": "Runtime used a fallback prompt without explicit source/hash metadata in artifacts.",
"issue_codes": ["prompt_registry_opaque"],
"inputs": ["effective_runtime.json", "prompt registry"],
"check": {
"manifest_fields": ["prompt_source", "prompt_hash"],
"forbidden_prompt_sources": ["fallback", "unknown"]
}
},
"preset_version_mismatch": {
"kind": "prompt_registry_healthcheck",
"automation_level": "automatic",
"description": "Active preset prompt version does not match the runtime prompt version used by the replay.",
"issue_codes": ["prompt_registry_opaque"],
"inputs": ["shared_llm_connection.json", "effective_runtime.json", "prompt presets"],
"check": {
"compare_fields": ["prompt_version"]
}
},
"forbidden_margin_terms": {
"kind": "answer_text_regex_forbidden",
"automation_level": "automatic",
"description": "Margin answer contains wrong-domain terms such as fixed assets, amortization, bank, payment, or settlement vocabulary.",
"issue_codes": ["margin_domain_leak_accounting_route"],
"inputs": ["steps/<step_id>/output.md", "steps/<step_id>/turn.json"],
"check": {
"forbidden_patterns": [
"(?i)(амортизац|объект\\s+ОС|основн(ые|ых)?\\s+средств|payment_document|settlement)"
]
}
},
"missing_revenue_cogs_margin_fields": {
"kind": "answer_text_required_any",
"automation_level": "semi_automatic",
"description": "Margin answer does not mention revenue, COGS/cost, gross profit, margin, or an honest limitation around those fields.",
"issue_codes": ["margin_domain_leak_accounting_route"],
"inputs": ["steps/<step_id>/output.md"],
"check": {
"required_patterns_any": [
"(?i)(выруч|себестоим|валов|марж|не хватает|не могу подтвердить|не подтвержден|unknown)"
],
"artifact_path_include_patterns": [
"(?i)steps[\\\\/][^\\\\/]*(?:margin|profitability|марж)"
],
"artifact_path_exclude_patterns": [
"(?i)selected_item",
"(?i)supplier",
"(?i)purchase_date",
"(?i)purchase_document"
]
}
},
"wrong_capability_family": {
"kind": "trace_value_guard",
"automation_level": "semi_automatic",
"description": "Trace/capability family for a margin question points to another accounting family instead of margin/profitability/inventory evidence.",
"issue_codes": ["margin_domain_leak_accounting_route"],
"inputs": ["steps/<step_id>/turn.json"],
"check": {
"forbidden_trace_markers": ["fixed_asset", "amortization", "payment_document", "settlement"]
}
},
"margin_domain_leak_accounting_route": {
"kind": "composite_detector",
"automation_level": "semi_automatic",
"description": "Composite margin-domain detector used by margin_profitability_v1 contract to group wrong-domain route leaks.",
"issue_codes": ["margin_domain_leak_accounting_route"],
"inputs": ["steps/<step_id>/output.md", "steps/<step_id>/turn.json"],
"check": {
"uses_detectors": ["forbidden_margin_terms", "wrong_capability_family"]
}
},
"margin_required_fields_missing": {
"kind": "contract_field_detector",
"automation_level": "semi_automatic",
"description": "Margin answer misses required revenue/COGS/gross profit/margin fields or honest unknowns.",
"issue_codes": ["margin_domain_leak_accounting_route"],
"inputs": ["steps/<step_id>/output.md", "docs/orchestration/contracts/margin_profitability_v1.json"],
"check": {
"uses_detectors": ["missing_revenue_cogs_margin_fields"]
}
},
"margin_next_action_missing": {
"kind": "limited_answer_next_action",
"automation_level": "semi_automatic",
"description": "Limited margin answer does not propose the next verifiable action.",
"issue_codes": ["business_next_step_missing", "margin_domain_leak_accounting_route"],
"inputs": ["steps/<step_id>/output.md"],
"check": {
"uses_detectors": ["limited_answer_without_next_action"]
}
},
"margin_payment_document_false_source": {
"kind": "answer_text_regex_forbidden",
"automation_level": "automatic",
"description": "Margin answer treats payment/bank documents as the source for margin calculation.",
"issue_codes": ["margin_domain_leak_accounting_route"],
"inputs": ["steps/<step_id>/output.md"],
"check": {
"forbidden_patterns": [
"(?i)(payment_document|банковск|плат[её]ж|оплат[аы]).{0,80}(достаточ|посчитал|рассчитал|является\\s+источник|как\\s+источник|на\\s+основании.{0,40}(марж|себестоим|валов))"
]
}
},
"margin_os_amortization_leak": {
"kind": "answer_text_regex_forbidden",
"automation_level": "automatic",
"description": "Margin answer leaks fixed-assets or amortization language.",
"issue_codes": ["margin_domain_leak_accounting_route"],
"inputs": ["steps/<step_id>/output.md"],
"check": {
"forbidden_patterns": ["(?i)(амортизац|объект\\s+ОС|основн(ые|ых)?\\s+средств)"]
}
},
"first_line_not_direct_answer": {
"kind": "answer_text_shape",
"automation_level": "semi_automatic",
"description": "The first meaningful line is not a direct business answer for a direct user question.",
"issue_codes": ["business_direct_answer_missing", "business_utility_gap"],
"inputs": ["steps/<step_id>/output.md"],
"check": {
"first_line_should_be": "business_answer_or_honest_boundary"
}
},
"top_level_scaffold_before_answer": {
"kind": "answer_text_regex_forbidden_in_prefix",
"automation_level": "automatic",
"description": "Answer starts with scaffold/service narration before the user-facing business conclusion.",
"issue_codes": ["business_direct_answer_missing", "business_utility_gap"],
"inputs": ["steps/<step_id>/output.md"],
"check": {
"prefix_line_count": 3,
"forbidden_patterns": ["(?i)(для ответа|сначала|я проверю|я посмотрю|route|debug|capability)"]
}
},
"runtime_tokens_in_user_answer": {
"kind": "answer_text_regex_forbidden",
"automation_level": "automatic",
"description": "Final user-facing answer contains runtime/debug/service tokens.",
"issue_codes": ["technical_garbage_in_answer", "business_utility_gap"],
"inputs": ["steps/<step_id>/output.md"],
"check": {
"forbidden_patterns": ["(?i)(route_id|capability_id|runtime_|snapshot_items|debug|answer_object|selected_object)"]
}
},
"capability_ids_in_user_answer": {
"kind": "answer_text_regex_forbidden",
"automation_level": "automatic",
"description": "Final user-facing answer contains capability ids or route ids.",
"issue_codes": ["technical_garbage_in_answer", "business_utility_gap"],
"inputs": ["steps/<step_id>/output.md"],
"check": {
"forbidden_patterns": ["(?i)(capability[_ -]?id|route[_ -]?id|address\\.[a-z0-9_\\.]+)"]
}
},
"required_contract_fields_missing": {
"kind": "contract_field_detector",
"automation_level": "semi_automatic",
"description": "Answer does not satisfy required fields from the expected business answer contract.",
"issue_codes": ["accounting_contract_missing"],
"inputs": ["steps/<step_id>/output.md", "docs/orchestration/contracts/<contract_id>.json"],
"check": {
"contract_field": "answer_surface.required_fields"
}
},
"limited_answer_without_next_action": {
"kind": "answer_text_required_when_limited",
"automation_level": "semi_automatic",
"description": "Answer states a limitation but gives no concrete next action for recovering or narrowing the answer.",
"issue_codes": ["business_next_step_missing", "business_utility_gap"],
"inputs": ["steps/<step_id>/output.md"],
"check": {
"limited_patterns": ["(?i)(не могу|не хватает|не подтвержден|нет данных|недостаточно)"],
"required_next_action_patterns_any": ["(?i)(можно|следующ|уточн|перезапусти|проверь|выбери|нужен|добавь)"]
}
},
"business_answer_too_verbose_output": {
"kind": "answer_text_regex_forbidden",
"automation_level": "automatic",
"description": "A scoped business follow-up answer still exposes verbose proof/scaffold sections that should be collapsed into a compact proof line.",
"issue_codes": ["business_utility_gap", "business_answer_too_verbose"],
"inputs": ["steps/<step_id>/output.md"],
"check": {
"forbidden_patterns": ["(?im)^\\s*(Что проверили|Опорные документы):"]
}
},
"counterparty_value_flow_required_surface": {
"kind": "answer_text_required_any",
"automation_level": "automatic",
"description": "Counterparty value-flow answers must surface counterparty scope, incoming amount, outgoing amount, and net/saldo wording.",
"issue_codes": ["counterparty_value_flow_misrouted_to_company_profit"],
"inputs": ["steps/<step_id>/output.md"],
"check": {
"artifact_path_include_patterns": ["(?i)(s01_svk_money_documents|s01_select_svk_counterparty_money)"],
"required_patterns_any": [
"(?is)(?=.*(СВК|Группа\\s+СВК))(?=.*(входящ|получил|получено|получили))(?=.*(исходящ|заплатил|заплачено|заплатили|ушло))(?=.*(нетто|сальдо|разниц|чистый\\s+денежный))"
]
}
},
"counterparty_value_flow_profit_accounts_forbidden": {
"kind": "answer_text_regex_forbidden",
"automation_level": "automatic",
"description": "Counterparty received/paid/net-flow answers must not use company profit or 90/91/99 accounts as the direct answer.",
"issue_codes": ["counterparty_value_flow_misrouted_to_company_profit"],
"inputs": ["steps/<step_id>/output.md"],
"check": {
"artifact_path_include_patterns": ["(?i)(s01_svk_money_documents|s01_select_svk_counterparty_money)"],
"forbidden_patterns": ["(?i)(сч[её]т\\s*(90|91|99)|90[\\./](01|02|09)|91[\\./]|99\\b|company[- ]level\\s+profit)"]
}
},
"bank_counterparty_boundary_required": {
"kind": "answer_text_required_any",
"automation_level": "semi_automatic",
"description": "Money-leader answers that explicitly mention bank role must include a boundary instead of presenting a bank as an ordinary customer/supplier.",
"issue_codes": ["bank_counterparty_misclassified_as_business_partner"],
"inputs": ["steps/<step_id>/output.md"],
"check": {
"artifact_path_include_patterns": ["(?i)(s02_colloquial_money_leaders|step_03_sberbank_role_after_role_tail_overview)"],
"required_patterns_any": ["(?is)(банк|банковск|финансов|не\\s+обычн|роль|назначени[ея]|плат[её]ж)"]
}
},
"route_candidate_needs_enablement": {
"kind": "stage_review_signal",
"automation_level": "semi_automatic",
"description": "Stage review produced a route candidate that still needs runtime capability enablement.",
"issue_codes": ["route_candidate_enablement_gap"],
"inputs": ["run_review.json", "repair_targets.json"],
"check": {
"target_status": "needs_route_enablement"
}
},
"backend_error_response_signal": {
"kind": "stage_review_signal",
"automation_level": "automatic",
"description": "GUI/stage run review found a backend_error user-facing response.",
"issue_codes": ["backend_error_response"],
"inputs": ["run_review.json", "conversation_pairs.json"],
"check": {
"target_status": "backend_error_response"
}
},
"top_year_direct_answer_missing": {
"kind": "stage_review_signal",
"automation_level": "automatic",
"description": "GUI/stage run review found a top-year ranking answer without direct winning-year surface.",
"issue_codes": ["year_ranking_direct_answer_missing"],
"inputs": ["run_review.json", "conversation_pairs.json"],
"check": {
"target_status": "year_ranking_direct_answer_missing"
}
},
"vat_purchase_date_anchor_missing": {
"kind": "stage_review_signal",
"automation_level": "automatic",
"description": "GUI/stage run review found a VAT purchase-date question whose answer did not explain the purchase-date anchor.",
"issue_codes": ["purchase_date_vat_anchor_ambiguous"],
"inputs": ["run_review.json", "conversation_pairs.json"],
"check": {
"target_status": "purchase_date_vat_anchor_ambiguous"
}
},
"counterparty_value_flow_profit_mismatch": {
"kind": "stage_review_signal",
"automation_level": "automatic",
"description": "GUI/stage run review found a counterparty received/paid/net-flow question answered as company profit.",
"issue_codes": ["counterparty_value_flow_misrouted_to_company_profit"],
"inputs": ["run_review.json", "conversation_pairs.json"],
"check": {
"target_status": "counterparty_value_flow_misrouted_to_company_profit"
}
},
"answer_layering_noise_signal": {
"kind": "stage_review_signal",
"automation_level": "semi_automatic",
"description": "GUI/stage run review found answer layering noise before the business conclusion.",
"issue_codes": ["answer_layering_noise"],
"inputs": ["run_review.json", "conversation_pairs.json"],
"check": {
"target_status": "answer_layering_noise"
}
},
"business_answer_too_verbose_signal": {
"kind": "stage_review_signal",
"automation_level": "semi_automatic",
"description": "GUI/stage run review found a direct business answer that is too verbose for practical use.",
"issue_codes": ["business_answer_too_verbose"],
"inputs": ["run_review.json", "conversation_pairs.json"],
"check": {
"target_status": "business_answer_too_verbose"
}
},
"bank_counterparty_role_boundary_missing": {
"kind": "stage_review_signal",
"automation_level": "semi_automatic",
"description": "GUI/stage run review found a bank/financial counterparty presented as an ordinary business partner without a role boundary.",
"issue_codes": ["bank_counterparty_misclassified_as_business_partner"],
"inputs": ["run_review.json", "conversation_pairs.json"],
"check": {
"target_status": "bank_counterparty_misclassified_as_business_partner"
}
}
}
}