|
| 1 | +export const ACCOUNT_DIAGNOSIS_REQUEST_PATH = "/api/account-diagnosis"; |
| 2 | +export const ACCOUNT_DIAGNOSIS_INTERNAL_PREFIX = "/api/internal/account-diagnosis/"; |
| 3 | +export const ACCOUNT_DIAGNOSIS_TARGET_ID = "binance.crypto_live_pool_rotation"; |
| 4 | +export const ACCOUNT_DIAGNOSIS_TARGETS = Object.freeze({ |
| 5 | + [ACCOUNT_DIAGNOSIS_TARGET_ID]: Object.freeze({ |
| 6 | + platform: "binance", |
| 7 | + recheckRepository: "QuantStrategyLab/BinancePlatform", |
| 8 | + recheckWorkflow: "runtime-target-lifecycle.yml", |
| 9 | + }), |
| 10 | + "longbridge.paper": Object.freeze({ |
| 11 | + platform: "longbridge", |
| 12 | + recheckRepository: "QuantStrategyLab/LongBridgePlatform", |
| 13 | + recheckWorkflow: "runtime-target-lifecycle.yml", |
| 14 | + }), |
| 15 | + "longbridge.hk": Object.freeze({ |
| 16 | + platform: "longbridge", |
| 17 | + recheckRepository: "QuantStrategyLab/LongBridgePlatform", |
| 18 | + recheckWorkflow: "runtime-target-lifecycle.yml", |
| 19 | + }), |
| 20 | + "longbridge.sg": Object.freeze({ |
| 21 | + platform: "longbridge", |
| 22 | + recheckRepository: "QuantStrategyLab/LongBridgePlatform", |
| 23 | + recheckWorkflow: "runtime-target-lifecycle.yml", |
| 24 | + }), |
| 25 | + "schwab.primary": Object.freeze({ |
| 26 | + platform: "schwab", |
| 27 | + recheckRepository: "QuantStrategyLab/CharlesSchwabPlatform", |
| 28 | + recheckWorkflow: "runtime-target-lifecycle.yml", |
| 29 | + }), |
| 30 | + "firstrade.primary": Object.freeze({ |
| 31 | + platform: "firstrade", |
| 32 | + recheckRepository: "QuantStrategyLab/FirstradePlatform", |
| 33 | + recheckWorkflow: "runtime-target-lifecycle.yml", |
| 34 | + }), |
| 35 | +}); |
| 36 | +export const ACCOUNT_DIAGNOSIS_TRIGGERS = ["incident", "manual_check"]; |
| 37 | +export const ACCOUNT_DIAGNOSIS_STATUSES = ["queued", "running", "succeeded", "failed", "unknown"]; |
| 38 | +export const ACCOUNT_DIAGNOSIS_REASON_CODES = ["diagnosis_ready", "capacity_unavailable", "codex_unavailable", "invalid_response"]; |
| 39 | +export const ACCOUNT_DIAGNOSIS_MAX_BODY_BYTES = 16 * 1024; |
| 40 | +export const ACCOUNT_DIAGNOSIS_SUMMARY_MAX_CHARS = 600; |
| 41 | +export const ACCOUNT_DIAGNOSIS_DEDUPE_WINDOW_MS = 24 * 60 * 60 * 1000; |
| 42 | +export const ACCOUNT_DIAGNOSIS_AUTO_ENABLED_ENV = "ACCOUNT_DIAGNOSIS_AUTO_ENABLED"; |
| 43 | +export const ACCOUNT_DIAGNOSIS_DO_ACTIONS = new Set([ |
| 44 | + "diagnosis_create", "diagnosis_latest", "diagnosis_read", "diagnosis_mark_dispatch", "diagnosis_claim", "diagnosis_result", "diagnosis_mark_recheck", "diagnosis_native_intent", "diagnosis_native_save", "diagnosis_native_cancel", |
| 45 | +]); |
| 46 | +/** Stable 409/qualification reason codes for /api/account-diagnosis (P0-08). */ |
| 47 | +export const ACCOUNT_DIAGNOSIS_CONFLICT_REASON_TEXT = Object.freeze({ |
| 48 | + account_diagnosis_config_unavailable: "账户选项配置不可用,无法绑定诊断身份。", |
| 49 | + account_diagnosis_account_not_found: "未找到匹配的账户选项。", |
| 50 | + account_diagnosis_account_not_unique: "账户选项不唯一,无法安全绑定诊断身份。", |
| 51 | + account_diagnosis_target_not_admitted: "该 target 未纳入账户诊断准入清单。", |
| 52 | + account_diagnosis_identity_conflict: "target 与账户身份冲突或不唯一。", |
| 53 | + account_diagnosis_lifecycle_store_unavailable: "生命周期配置存储不可用。", |
| 54 | + account_diagnosis_lifecycle_match_missing: "缺少匹配的生命周期观测来源。", |
| 55 | + account_diagnosis_lifecycle_match_ambiguous: "生命周期观测来源不唯一。", |
| 56 | + account_diagnosis_source_unavailable: "生命周期来源不可用(非 ready/stale)。", |
| 57 | + account_diagnosis_observation_missing: "缺少观测时间,无法确认诊断资格。", |
| 58 | + account_diagnosis_incident_requires_attention: "incident 触发需要已确认的监测关注项。", |
| 59 | + account_diagnosis_native_binding_conflict: "诊断原生任务身份或材料绑定冲突。", |
| 60 | + account_diagnosis_workflow_binding_conflict: "诊断工作流运行绑定冲突。", |
| 61 | + account_diagnosis_schema_incompatible: "诊断上下文 schema 不兼容。", |
| 62 | +}); |
0 commit comments