{"openapi":"3.1.0","info":{"title":"笃语开放平台 OpenAPI v1","version":"1.75.0","description":"文档原子能力测试流程：先上传取得 doc_id，再提交文档任务；异步接口返回 202 和 job_id，随后查询任务状态及结果。"},"paths":{"/open/v1/knowledge/query":{"post":{"tags":["3. 知识库"],"summary":"查询笃语内置知识库并返回证据","description":"查询范围由 API Key 的 Document Space 服务端绑定，调用方不能跨空间指定。回答与证据只使用安全投影；原始内部 metadata、relationships、表名、主键和图谱不对外暴露。 显式提供knowledge_base_id时按动态知识版本查询并返回202任务；该分支要求dkRead，省略时保留原viewKnowledge查询。显式query_mode=memory及actor_context启用私有联合查询，返回result_type=memory_process及process_id，仅由memories/get_process读取。省略query_mode不读写记忆；learn或record_history另需dkWrite，旧请求行为不变。\n\n**动态知识库关联边界**\n\n**适用范围**：下列规则仅用于显式传knowledge_base_id的动态分支；省略时保持原知识查询，不自动搜索全部动态库。该分支要求dkRead、Idempotency-Key，返回202，不是同步答案。\n\n**默认版本边界**：默认在指定知识库内检索，无需逐份选择文件，但制度正文及独立修订说明须已确认且在可读快照中可检索。普通内容查询可陈述已确认材料的记载，不因缺少发布日期或生效日期一律拒绝，也不将这些记载当成现行执行标准。执行建议、指定时点及适用效力判断仍核对发布状态、有效期和场景条件；依据不足或版本冲突可能返回insufficient_evidence或needs_clarification。最新已发布按issued_at，不按上传时间。正文确认、检索准备和制度正式发布是不同状态。\n\n**指定材料与现行判断**：version_ids仅限定材料版本，不绕过正文确认或效力核验。已确认的草稿记载可用于普通内容查询，但不能凭指定版本证明当前适用；调用方必须同时展示引用版本的publication_status及日期。document_ids只限定主体，不等于指定其业务版本；effective_at只指定判断日期，不补造发布日期或效力。没有所问原件、只有转述时应保留证据不足。\n\n**效力查询的例外**：明确草稿或已经过撤回截止日期的单一主体，可能有依据回答“不适用”，而非一律空答案。已撤回版本如有明确生效起止日期，所问历史日期在区间内时仍可用于核对当时效力，不代表恢复当前效力。资料缺失或多个主体不能套用该结论。\n\n**输出及结果**：output默认answer；evidence返回原始证据与缺口，不承诺生成答案；advice生成条件化standards/actions/risks/cases，不只返回搜索片段。演示的“仅查看原文证据”复用evidence模式；核验失败的任务仍为failed，可由用户显式另发原文查询，不自动把失败改成功或重复提交。answer/answer_notice可null，citations可空；必须展示gaps、ambiguities、warnings、source_conflicts及pending_updates。answered表示在本次范围内完成处理，不是对全库完整性或法律效力作保证，evidence模式answered也不代表生成过答案；insufficient_evidence可含部分已核对事实；needs_clarification表示对象、版本、条件或来源冲突需要核实，不能按最高分强行选一个。\n\n**场景与案例**：scenario_context的通用attributes、兼容单位/人员/日期和details只是场景条件，不扩权；case_version_ids仅限制案例范围，不授权跨库读取。案例作为补充参考，不参与执行制度的发布、生效或竞争版本判断，但仍须通过正文确认、快照范围和当前来源权限检查。案例与现行标准分开展示，模拟案例必须标注，缺案例就说明，不编造人名、案号或处罚结果；仅有草稿不能据案例推导现行标准。缺少必要条件时返回有依据的条件分支或澄清问题，不要求终端用户提供内部证据编号。\n\n**筛选与恢复**：import_batch_id限定成功接入条目，部分失败/待处理会在coverage/gaps中说明。snapshot_id省略固定本次活动快照，指定时须仍可读；后续读引用携带返回的snapshot_id。历史结果也重新核验原来源、Space及依赖，403/404/503不能被当前说明可读或目录缓存替代。模型验证不通过时任务failed并给error，不返回未经核验答案。\n\n**私有联合查询**：显式query_mode=memory，并提供knowledge_base_id、可信actor_context及Idempotency-Key；read=true、learn=false、short_term=true、record_history=false。learn或record_history另需dkWrite；evidence不得学习或保存回答历史。返回result_type=memory_process及process_id，仅使用memories/get_process读取，不传公共job。可携带X-Memory-Recovery-Scope，分区不一致拒绝；普通请求不读写记忆，私有失败不回退普通查询。memories/action=query已退役；标准QA沉淀统一使用annotations/origin_type=memory的qa_save、qa_confirm、qa_withdraw，memories/promote_qa已退役。原候选和任务保持可读，调用方与服务端配套升级或回滚。\n\n完整说明：/swagger-ui/open-v1/docs/dynamic-knowledge","operationId":"queryKnowledge","responses":{"200":{"description":"请求已成功处理","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"required":["answer","evidence","sources","query","environment","retrieval_target","target_notice","graph"],"properties":{"answer":{"type":"string"},"evidence":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["evidence_ref","environment","entity_type","title","snippet","score","source","facts","provenance"],"properties":{"evidence_ref":{"type":"string","pattern":"^ev_[A-Za-z0-9_-]{20,64}$"},"environment":{"type":"string"},"entity_type":{"type":"string"},"title":{"type":"string"},"snippet":{"type":"string"},"score":{"type":"number"},"source":{"type":"string"},"facts":{"type":"object","additionalProperties":true},"provenance":{"type":"object","additionalProperties":false,"required":["source_table","source_id","record_id","environment","title"],"properties":{"source_table":{"type":["string","null"]},"source_id":{"type":["string","null"]},"record_id":{"type":["string","null"]},"environment":{"type":["string","null"]},"title":{"type":["string","null"]}}}}}},"sources":{"type":"array","items":{"type":"string"}},"query":{"type":"string"},"environment":{"type":"string"},"retrieval_target":{"type":"string"},"target_notice":{"type":"string"},"graph":{"type":"object","additionalProperties":true}}},"error":{"type":"null"}}}]}}}},"202":{"description":"已受理；job_id使用公共job读取，result_type=memory_process的process_id仅使用memories/get_process读取","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"oneOf":[{"type":"object","properties":{"job_id":{"type":"string"},"status":{"const":"queued"},"status_url":{"type":"string","pattern":"^/open/v1/job/","description":"查询任务状态，成功后在该地址追加 /result 读取结果。"},"etag":{"type":"string"}},"required":["job_id","status","status_url"]},{"type":"object","properties":{"process_id":{"type":"string"},"status":{"type":"string"},"result_type":{"const":"memory_process"}},"required":["process_id","status","result_type"]}]},"error":{"type":"null"}}}]}}},"headers":{"Location":{"description":"任务状态查询地址","schema":{"type":"string","example":"/open/v1/job/0123456789abcdef0123456789abcdef"}}},"links":{"查询任务进度":{"operationId":"getJob","parameters":{"job_id":"$response.body#/data/job_id"},"description":"仅适用于返回job_id的普通动态查询；私有process_id不得传入。"},"读取任务结果":{"operationId":"getJobResult","parameters":{"job_id":"$response.body#/data/job_id"},"description":"仅适用于返回job_id的普通动态查询；私有过程使用memories/get_process并附当前actor_context。"}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"409":{"description":"幂等键、任务状态或资源状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"412":{"description":"资源修订已变化，请重新读取后提交","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"413":{"description":"请求体过大","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"415":{"description":"请求媒体类型不支持","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"428":{"description":"缺少资源修订前置条件 If-Match","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"429":{"description":"队列或模型并发额度已满，请稍后重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"500":{"description":"服务内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"502":{"description":"上游服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"504":{"description":"上游服务超时","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"viewKnowledge","x-stability":"stable","x-alternative-scopes":["dkRead"],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string"},"description":"动态知识查询分支必填；同一请求重试保持不变。"},{"name":"X-Memory-Recovery-Scope","in":"header","required":false,"schema":{"type":"string","pattern":"^[0-9a-f]{64}$"},"description":"仅用于query_mode=memory，与当前用户恢复分区不一致时拒绝且不写入。"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","additionalProperties":false,"required":["query"],"properties":{"query":{"type":"string","minLength":1,"maxLength":12000},"target":{"type":["string","null"],"maxLength":12000},"source":{"type":["string","null"],"maxLength":256},"top_k":{"type":"integer","minimum":1,"maximum":50},"entity_types":{"type":"array","maxItems":50,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":128}},"generate_answer":{"type":"boolean"},"include_graph":{"type":"boolean"},"expand_graph":{"type":"boolean"}}},{"additionalProperties":false,"properties":{"query":{"maxLength":8000,"minLength":1,"title":"Query","type":"string"},"output":{"default":"answer","enum":["answer","evidence","advice"],"title":"Output","type":"string"},"scenario_context":{"anyOf":[{"additionalProperties":false,"properties":{"attributes":{"anyOf":[{"maxProperties":50,"patternProperties":{"^[A-Za-z][A-Za-z0-9_]*$":{"anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}]}},"propertyNames":{"maxLength":64,"minLength":1},"type":"object"},{"type":"null"}],"title":"Attributes"},"organization":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}],"title":"Organization"},"personnel_category":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}],"title":"Personnel Category"},"event_date":{"anyOf":[{"maxLength":128,"type":"string"},{"type":"null"}],"title":"Event Date"},"details":{"default":"","maxLength":4000,"title":"Details","type":"string"}},"title":"ScenarioContext","type":"object"},{"type":"null"}]},"case_version_ids":{"items":{"type":"string"},"maxItems":100,"title":"Case Version Ids","type":"array"},"case_retrieval":{"anyOf":[{"additionalProperties":false,"properties":{"enabled":{"title":"Enabled","type":"boolean"},"query":{"anyOf":[{"maxLength":2000,"minLength":1,"type":"string"},{"type":"null"}],"title":"Query"}},"required":["enabled"],"title":"CaseRetrieval","type":"object"},{"type":"null"}]},"document_ids":{"items":{"type":"string"},"maxItems":50,"title":"Document Ids","type":"array"},"version_ids":{"items":{"type":"string"},"maxItems":100,"title":"Version Ids","type":"array"},"effective_at":{"anyOf":[{"format":"date","type":"string"},{"format":"date-time","type":"string"},{"type":"null"}],"title":"Effective At"},"import_batch_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Import Batch Id"},"snapshot_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Snapshot Id"},"knowledge_base_id":{"maxLength":32,"minLength":1,"title":"Knowledge Base Id","type":"string"}},"required":["query","knowledge_base_id"],"title":"ScopedKnowledgeQuery","type":"object"},{"additionalProperties":false,"properties":{"query":{"maxLength":8000,"minLength":1,"title":"Query","type":"string"},"conversation_id":{"anyOf":[{"pattern":"^[0-9a-f]{32}$","type":"string"},{"type":"null"}],"title":"Conversation Id"},"task_id":{"anyOf":[{"pattern":"^[0-9a-f]{32}$","type":"string"},{"type":"null"}],"title":"Task Id"},"team_ids":{"items":{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","type":"string"},"maxItems":1000,"title":"Team Ids","type":"array"},"context_budget":{"anyOf":[{"maximum":100000,"minimum":1,"type":"integer"},{"type":"null"}],"title":"Context Budget"},"output":{"default":"answer","enum":["answer","evidence","advice"],"title":"Output","type":"string"},"scenario_context":{"anyOf":[{"additionalProperties":false,"properties":{"attributes":{"anyOf":[{"maxProperties":50,"patternProperties":{"^[A-Za-z][A-Za-z0-9_]*$":{"anyOf":[{"maxLength":2000,"type":"string"},{"type":"null"}]}},"propertyNames":{"maxLength":64,"minLength":1},"type":"object"},{"type":"null"}],"title":"Attributes"},"organization":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}],"title":"Organization"},"personnel_category":{"anyOf":[{"maxLength":255,"type":"string"},{"type":"null"}],"title":"Personnel Category"},"event_date":{"anyOf":[{"maxLength":128,"type":"string"},{"type":"null"}],"title":"Event Date"},"details":{"default":"","maxLength":4000,"title":"Details","type":"string"}},"title":"ScenarioContext","type":"object"},{"type":"null"}]},"case_version_ids":{"items":{"type":"string"},"maxItems":100,"title":"Case Version Ids","type":"array"},"case_retrieval":{"anyOf":[{"additionalProperties":false,"properties":{"enabled":{"title":"Enabled","type":"boolean"},"query":{"anyOf":[{"maxLength":2000,"minLength":1,"type":"string"},{"type":"null"}],"title":"Query"}},"required":["enabled"],"title":"CaseRetrieval","type":"object"},{"type":"null"}]},"document_ids":{"items":{"type":"string"},"maxItems":50,"title":"Document Ids","type":"array"},"version_ids":{"items":{"type":"string"},"maxItems":100,"title":"Version Ids","type":"array"},"effective_at":{"anyOf":[{"format":"date","type":"string"},{"format":"date-time","type":"string"},{"type":"null"}],"title":"Effective At"},"import_batch_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Import Batch Id"},"snapshot_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Snapshot Id"},"knowledge_base_id":{"pattern":"^[0-9a-f]{32}$","title":"Knowledge Base Id","type":"string"},"read":{"default":true,"title":"Read","type":"boolean"},"learn":{"default":false,"title":"Learn","type":"boolean"},"short_term":{"default":true,"title":"Short Term","type":"boolean"},"record_history":{"default":false,"title":"Record History","type":"boolean"},"external_conversation_id":{"anyOf":[{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","type":"string"},{"type":"null"}],"title":"External Conversation Id"},"query_turn_id":{"anyOf":[{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","type":"string"},{"type":"null"}],"title":"Query Turn Id"},"query_mode":{"const":"memory","title":"Query Mode","type":"string"},"actor_context":{"additionalProperties":false,"properties":{"subject_id":{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","title":"Subject Id","type":"string"},"authorization_revision":{"exclusiveMaximum":4611686018427387904,"minimum":1,"title":"Authorization Revision","type":"integer"},"enabled":{"title":"Enabled","type":"boolean"},"teams":{"items":{"additionalProperties":false,"properties":{"team_id":{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","title":"Team Id","type":"string"},"role":{"enum":["member","reviewer"],"title":"Role","type":"string"}},"required":["team_id","role"],"title":"TeamGrant","type":"object"},"maxItems":1000,"title":"Teams","type":"array"},"knowledge_base_grants":{"items":{"additionalProperties":false,"properties":{"kb_id":{"pattern":"^[0-9a-f]{32}$","title":"Kb Id","type":"string"},"permissions":{"items":{"enum":["read","write","confirm"],"type":"string"},"maxItems":3,"minItems":1,"title":"Permissions","type":"array"}},"required":["kb_id","permissions"],"title":"KnowledgeGrant","type":"object"},"maxItems":1000,"title":"Knowledge Base Grants","type":"array"}},"required":["subject_id","authorization_revision","enabled","teams","knowledge_base_grants"],"title":"ActorContext","type":"object"}},"required":["query","knowledge_base_id","query_mode","actor_context"],"title":"PrivateKnowledgeQuery","type":"object"}]},"example":{"query":"发票智能体有哪些抽取指标？","top_k":12,"generate_answer":true,"include_graph":true,"expand_graph":true}}}}}},"/open/v1/knowledge/stats":{"get":{"tags":["3. 知识库"],"summary":"读取服务端配置范围内的知识库统计","description":"统计范围与知识库查询使用同一 Document Space 服务端绑定。","operationId":"getKnowledgeStats","responses":{"200":{"description":"请求已成功处理","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"properties":{"success":{"const":true},"data":{"properties":{"total":{"type":"integer","minimum":0.0},"by_environment":{"additionalProperties":{"type":"integer","minimum":0.0},"type":"object"},"by_type":{"additionalProperties":{"type":"integer","minimum":0.0},"type":"object"},"qdrant_enabled":{"type":"boolean"},"neo4j_enabled":{"type":"boolean"}},"additionalProperties":false,"type":"object","required":["total","by_environment","by_type","qdrant_enabled","neo4j_enabled"]},"error":{"type":"null"}},"type":"object"}]}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"500":{"description":"服务内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"502":{"description":"上游服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"504":{"description":"上游服务超时","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"viewKnowledge","x-stability":"stable"}},"/open/v1/documents/imports":{"post":{"tags":["2. 文档准备"],"summary":"批量或 ZIP 导入文档","description":"该接口采用异步处理。成功提交返回 HTTP 202，响应体 `data.job_id` 和响应头 `Location` 指向任务。随后通过 `getJob` 查询进度；状态为 `succeeded` 后，通过 `getJobResult` 获取最终结果。 可用JSON source_url登记服务端授权的私有MinIO原件，原件不永久复制；与multipart文件输入互斥。来源关闭时仍支持原文件上传。支持UTF-8 TXT本地解析。\n\n**动态知识库关联边界**\n\nZIP/批量文件先复用原入口；包装完成或原任务成功仍须逐项检查解析状态，不能将ZIP本身当一份制度正文。提取到的真实文件doc_id各自作为aiservice-documents来源引用提交materials/import；动态导入、分组/前驱和发布状态另行核验。预览压缩包不等于已上传或入库。\n\n完整说明：/swagger-ui/open-v1/docs/dynamic-knowledge","operationId":"importDocuments","requestBody":{"content":{"multipart/form-data":{"schema":{"properties":{"file":{"type":"string","format":"binary"},"client_request_id":{"type":"string","maxLength":128,"minLength":1,"pattern":"^[A-Za-z0-9._:-]+$","description":"调用方生成的幂等请求标识；相同调用方重试时保持不变。"},"owner_ref":{"type":"string","maxLength":128}},"additionalProperties":false,"type":"object","required":["file","client_request_id"]}},"application/json":{"schema":{"properties":{"source_url":{"type":"string","maxLength":8192,"minLength":1,"description":"私有MinIO对象地址，只允许当前Space服务端绑定的endpoint、桶和前缀；禁止凭据、query及fragment。"},"file_name":{"type":"string","maxLength":255,"minLength":1},"client_request_id":{"type":"string","maxLength":128,"minLength":1,"pattern":"^[A-Za-z0-9._:-]+$","description":"调用方生成的幂等请求标识；相同调用方重试时保持不变。"},"owner_ref":{"type":"string","maxLength":128}},"additionalProperties":false,"type":"object","required":["source_url","client_request_id"]}}},"required":true},"responses":{"202":{"description":"任务已受理；请使用 job_id 查询进度和结果","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"required":["job_id","operation","status","phase","progress","progress_detail","sequence","attempt","poll_after_ms","result_ref","error","created_at","updated_at","finished_at"],"properties":{"job_id":{"type":"string","minLength":32,"maxLength":32,"pattern":"^[a-f0-9]{32}$","description":"异步任务唯一 ID；刷新页面或跨请求查询时保持不变。"},"operation":{"type":"string","description":"任务类型；当前主要为 upload、parse 或 extract。"},"status":{"type":"string","description":"queued=排队中，running=处理中，succeeded=已完成，failed/cancelled/unknown=终态异常。","enum":["queued","running","succeeded","failed","cancelled","unknown"]},"phase":{"type":["string","null"],"description":"当前处理阶段；服务未提供细分阶段时为 null。"},"progress":{"type":["integer","null"],"minimum":0,"maximum":100,"description":"0 到 100 的处理进度；无法计算时为 null。"},"progress_detail":{"oneOf":[{"type":"object","additionalProperties":false,"required":["unit","current","total"],"properties":{"unit":{"type":"string","enum":["bytes","documents","items","pages"]},"current":{"type":"integer","minimum":0},"total":{"type":"integer","minimum":1}}},{"type":"null"}],"description":"可核验的真实进度分子、分母；无法度量时为 null。"},"sequence":{"type":"integer","minimum":0,"description":"状态事件单调序号；客户端用它丢弃乱序轮询结果。"},"attempt":{"type":"integer","minimum":0,"description":"worker 执行尝试次数；上传直接执行时固定为 1。"},"poll_after_ms":{"type":"integer","minimum":100,"description":"服务端建议的下次轮询间隔。"},"result_ref":{"type":["string","null"],"description":"任务成功后的结果引用，通常为 /open/v1/job/{job_id}/result。"},"owner_ref":{"type":"string","maxLength":128,"description":"上传任务创建时固化的业务归属；非上传任务通常不返回。"},"error":{"oneOf":[{"type":"object","additionalProperties":false,"required":["code","message","retryable"],"properties":{"code":{"type":"string","enum":["conversion_failed","embedding_access_denied","embedding_output_invalid","embedding_unavailable","feature_disabled","forbidden","index_config_conflict","index_incomplete","input_invalid","input_too_large","internal_error","method_not_allowed","model_access_denied","model_output_invalid","model_unavailable","not_acceptable","not_found","payload_too_large","precondition_failed","precondition_required","processor_budget","processor_failed","processor_invalid_response","processor_rejected","processor_timeout","processor_unauthorized","processor_unavailable","queue_capacity_exceeded","rate_limited","resource_conflict","resource_not_found","semantic_unavailable","service_unavailable","source_ambiguous","source_changed","source_invalid","source_unavailable","source_writeback_unavailable","unauthorized","unsupported_media_type","upstream_rejected","upstream_timeout","upstream_unavailable"]},"message":{"type":"string","minLength":1},"retryable":{"type":"boolean"}}},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"finished_at":{"type":["string","null"],"format":"date-time"},"document_parse_diagnostics_v1":{"type":"object","additionalProperties":false,"required":["schema_version","requested_provider","requested_mode","result_source","pipeline_stage","worker_attempt_count","fallback_occurred","isolation_used","attempts","attempts_truncated","warnings"],"properties":{"schema_version":{"const":"document_parse_diagnostics_v1"},"requested_provider":{"type":"string","enum":["auto","docparse","tencent","local","mineru"],"default":"auto","description":"解析 Provider 策略。auto 按服务端启用列表和顺序执行；MinerU 默认禁用；指定 Provider 时严格执行该 Provider，不静默切换。"},"requested_mode":{"type":"string","enum":["standard","high_accuracy","structure_preserving"]},"result_source":{"type":"string","enum":["fresh","reused"]},"pipeline_stage":{"type":"string","enum":["completed","failed"]},"worker_attempt_count":{"type":"integer","minimum":1},"fallback_occurred":{"type":"boolean"},"isolation_used":{"type":"boolean"},"attempts":{"type":"array","maxItems":32,"items":{"type":"object","additionalProperties":false,"required":["provider","status","scope"],"properties":{"provider":{"type":"string","enum":["docparse","tencent","local","mineru","unknown"]},"status":{"type":"string","enum":["succeeded","failed","unknown"]},"scope":{"type":"string","enum":["group","page","isolation","unknown"]},"page_count":{"type":"integer","minimum":0},"duration_ms":{"type":"integer","minimum":0},"safe_error_code":{"type":"string","maxLength":64},"retryable":{"type":"boolean"},"fallback_allowed":{"type":"boolean"}}}},"attempts_truncated":{"type":"boolean"},"page_summary":{"type":"object","additionalProperties":false,"required":["total","ready","degraded","by_provider"],"properties":{"total":{"type":"integer","minimum":0},"ready":{"type":"integer","minimum":0},"degraded":{"type":"integer","minimum":0},"by_provider":{"type":"object","additionalProperties":false,"required":[],"properties":{"docparse":{"type":"integer","minimum":0},"tencent":{"type":"integer","minimum":0},"local":{"type":"integer","minimum":0}}}}},"warnings":{"type":"object","additionalProperties":false,"required":["count","codes"],"properties":{"count":{"type":"integer","minimum":0},"codes":{"type":"array","maxItems":32,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":64}}}},"source_format":{"type":"string","minLength":1,"maxLength":32},"canonicalized":{"type":"boolean"},"content_version":{"type":"string","minLength":1,"maxLength":128},"failure_stage":{"type":"string","enum":["precondition","source_read","convert","split","provider_parse","persist","unknown"]}}}}},"error":{"type":"null"}}}]}}},"headers":{"Location":{"description":"任务状态查询地址","schema":{"type":"string","example":"/open/v1/job/0123456789abcdef0123456789abcdef"}}},"links":{"查询任务进度":{"operationId":"getJob","parameters":{"job_id":"$response.body#/data/job_id"},"description":"使用本次返回的 job_id 查询任务进度。"},"读取任务结果":{"operationId":"getJobResult","parameters":{"job_id":"$response.body#/data/job_id"},"description":"任务 succeeded 后读取结构化结果。"}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"409":{"description":"幂等键、任务状态或资源状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"413":{"description":"请求体过大","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"415":{"description":"请求媒体类型不支持","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"429":{"description":"队列或模型并发额度已满，请稍后重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"500":{"description":"服务内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"502":{"description":"上游服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"504":{"description":"上游服务超时","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"document.write","x-stability":"preview"}},"/open/v1/documents/resolve":{"post":{"tags":["2. 文档准备"],"summary":"按内容哈希检查可复用文档","operationId":"resolveDocument","requestBody":{"content":{"application/json":{"schema":{"properties":{"sha256":{"type":"string","maxLength":64,"minLength":64,"pattern":"^[0-9a-fA-F]{64}$"},"owner_ref":{"type":"string","maxLength":128}},"additionalProperties":false,"type":"object","required":["sha256"]}}},"required":true},"responses":{"200":{"description":"请求已成功处理","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"required":["found","document"],"properties":{"found":{"type":"boolean"},"document":{"oneOf":[{"type":"object","additionalProperties":false,"required":["doc_id","name","extension","size","sha256","owner_ref","total_pages","doc_type","created_at","directory_id"],"properties":{"doc_id":{"type":"integer","minimum":1},"name":{"type":"string","minLength":1,"maxLength":255},"extension":{"type":["string","null"],"maxLength":32},"size":{"type":["integer","null"],"minimum":0},"sha256":{"type":["string","null"],"pattern":"^[0-9a-f]{64}$"},"owner_ref":{"type":["string","null"],"maxLength":128},"total_pages":{"type":"integer","minimum":0},"doc_type":{"type":["string","null"],"maxLength":32,"description":"单证形态类型(平台封闭枚举,如 vat_invoice/id_card;null=未判定,按 general 处理)。"},"created_at":{"type":["string","null"],"format":"date-time"},"directory_id":{"type":["integer","null"],"minimum":1},"busi_id":{"type":["string","null"],"maxLength":128,"description":"外部渠道业务标识（可选，P0-3 恢复按 busi_id 查询链路）。"}}},{"type":"null"}]}}},"error":{"type":"null"}}}]}}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"409":{"description":"幂等键、任务状态或资源状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"413":{"description":"请求体过大","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"415":{"description":"请求媒体类型不支持","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"429":{"description":"队列或模型并发额度已满，请稍后重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"500":{"description":"服务内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"502":{"description":"上游服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"504":{"description":"上游服务超时","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"document.read","x-stability":"stable"}},"/open/v1/documents/batch-get":{"post":{"tags":["2. 文档准备"],"summary":"批量读取文档元数据","description":"**动态知识库关联边界**\n\n演示页复用原批量文档元数据读取入口，按既有document.read和当前Space鉴权读取文件名及sha256。来源文件名仅用于展示；与版本固定来源指纹不符时不借用当前名字。相同内容只提示用户维护已有版本或明确新增，不自动合并或认定同一制度。此入口不读取知识版本、不变更前驱或制度发布状态。\n\n完整说明：/swagger-ui/open-v1/docs/dynamic-knowledge","operationId":"batchGetDocuments","requestBody":{"content":{"application/json":{"schema":{"properties":{"doc_ids":{"items":{"type":"integer","minimum":1.0},"type":"array","minItems":1,"uniqueItems":true}},"additionalProperties":false,"type":"object","required":["doc_ids"]}}},"required":true},"responses":{"200":{"description":"请求已成功处理","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"required":["items"],"properties":{"items":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["doc_id","name","extension","size","sha256","owner_ref","total_pages","doc_type","created_at","directory_id"],"properties":{"doc_id":{"type":"integer","minimum":1},"name":{"type":"string","minLength":1,"maxLength":255},"extension":{"type":["string","null"],"maxLength":32},"size":{"type":["integer","null"],"minimum":0},"sha256":{"type":["string","null"],"pattern":"^[0-9a-f]{64}$"},"owner_ref":{"type":["string","null"],"maxLength":128},"total_pages":{"type":"integer","minimum":0},"doc_type":{"type":["string","null"],"maxLength":32,"description":"单证形态类型(平台封闭枚举,如 vat_invoice/id_card;null=未判定,按 general 处理)。"},"created_at":{"type":["string","null"],"format":"date-time"},"directory_id":{"type":["integer","null"],"minimum":1},"busi_id":{"type":["string","null"],"maxLength":128,"description":"外部渠道业务标识（可选，P0-3 恢复按 busi_id 查询链路）。"}}}}}},"error":{"type":"null"}}}]}}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"409":{"description":"幂等键、任务状态或资源状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"413":{"description":"请求体过大","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"415":{"description":"请求媒体类型不支持","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"429":{"description":"队列或模型并发额度已满，请稍后重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"500":{"description":"服务内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"502":{"description":"上游服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"504":{"description":"上游服务超时","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"document.read","x-stability":"stable"}},"/open/v1/documents/archive-images:order":{"post":{"tags":["2. 文档准备"],"summary":"启动归档图片排序","description":"该接口为同步处理。成功返回 HTTP 200，响应体 `data.order` 为排序后的图片索引序列。 支持JSON files对象数组，每项为source_url及可选file_name；可保留names数组，数量须与files一致。原multipart仍兼容。","operationId":"startDocumentArchiveImagesOrder","requestBody":{"content":{"multipart/form-data":{"schema":{"properties":{"client_request_id":{"type":"string","maxLength":128,"minLength":1,"pattern":"^[A-Za-z0-9._:-]+$","description":"调用方生成的幂等请求标识；相同调用方重试时保持不变。"},"names":{"items":{"type":"string","maxLength":255,"minLength":1},"type":"array","maxItems":200,"minItems":2}},"additionalProperties":false,"type":"object","required":["client_request_id"]}},"application/json":{"schema":{"properties":{"client_request_id":{"type":"string","maxLength":128,"minLength":1,"pattern":"^[A-Za-z0-9._:-]+$","description":"调用方生成的幂等请求标识；相同调用方重试时保持不变。"},"files":{"items":{"properties":{"source_url":{"type":"string","maxLength":8192,"minLength":1,"description":"私有MinIO对象地址，只允许当前Space服务端绑定的endpoint、桶和前缀；禁止凭据、query及fragment。"},"file_name":{"type":"string","maxLength":255,"minLength":1}},"additionalProperties":false,"type":"object","required":["source_url"]},"type":"array","maxItems":200,"minItems":2},"names":{"items":{"type":"string","maxLength":255,"minLength":1},"type":"array","maxItems":200,"minItems":2}},"additionalProperties":false,"type":"object","required":["client_request_id","files"]}}},"required":true},"responses":{"200":{"description":"请求已成功处理","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"required":["job_id","operation","status","phase","progress","progress_detail","sequence","attempt","poll_after_ms","result_ref","error","created_at","updated_at","finished_at"],"properties":{"job_id":{"type":"string","minLength":32,"maxLength":32,"pattern":"^[a-f0-9]{32}$","description":"异步任务唯一 ID；刷新页面或跨请求查询时保持不变。"},"operation":{"type":"string","description":"任务类型；当前主要为 upload、parse 或 extract。"},"status":{"type":"string","description":"queued=排队中，running=处理中，succeeded=已完成，failed/cancelled/unknown=终态异常。","enum":["queued","running","succeeded","failed","cancelled","unknown"]},"phase":{"type":["string","null"],"description":"当前处理阶段；服务未提供细分阶段时为 null。"},"progress":{"type":["integer","null"],"minimum":0,"maximum":100,"description":"0 到 100 的处理进度；无法计算时为 null。"},"progress_detail":{"oneOf":[{"type":"object","additionalProperties":false,"required":["unit","current","total"],"properties":{"unit":{"type":"string","enum":["bytes","documents","items","pages"]},"current":{"type":"integer","minimum":0},"total":{"type":"integer","minimum":1}}},{"type":"null"}],"description":"可核验的真实进度分子、分母；无法度量时为 null。"},"sequence":{"type":"integer","minimum":0,"description":"状态事件单调序号；客户端用它丢弃乱序轮询结果。"},"attempt":{"type":"integer","minimum":0,"description":"worker 执行尝试次数；上传直接执行时固定为 1。"},"poll_after_ms":{"type":"integer","minimum":100,"description":"服务端建议的下次轮询间隔。"},"result_ref":{"type":["string","null"],"description":"任务成功后的结果引用，通常为 /open/v1/job/{job_id}/result。"},"owner_ref":{"type":"string","maxLength":128,"description":"上传任务创建时固化的业务归属；非上传任务通常不返回。"},"error":{"oneOf":[{"type":"object","additionalProperties":false,"required":["code","message","retryable"],"properties":{"code":{"type":"string","enum":["conversion_failed","embedding_access_denied","embedding_output_invalid","embedding_unavailable","feature_disabled","forbidden","index_config_conflict","index_incomplete","input_invalid","input_too_large","internal_error","method_not_allowed","model_access_denied","model_output_invalid","model_unavailable","not_acceptable","not_found","payload_too_large","precondition_failed","precondition_required","processor_budget","processor_failed","processor_invalid_response","processor_rejected","processor_timeout","processor_unauthorized","processor_unavailable","queue_capacity_exceeded","rate_limited","resource_conflict","resource_not_found","semantic_unavailable","service_unavailable","source_ambiguous","source_changed","source_invalid","source_unavailable","source_writeback_unavailable","unauthorized","unsupported_media_type","upstream_rejected","upstream_timeout","upstream_unavailable"]},"message":{"type":"string","minLength":1},"retryable":{"type":"boolean"}}},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"finished_at":{"type":["string","null"],"format":"date-time"},"document_parse_diagnostics_v1":{"type":"object","additionalProperties":false,"required":["schema_version","requested_provider","requested_mode","result_source","pipeline_stage","worker_attempt_count","fallback_occurred","isolation_used","attempts","attempts_truncated","warnings"],"properties":{"schema_version":{"const":"document_parse_diagnostics_v1"},"requested_provider":{"type":"string","enum":["auto","docparse","tencent","local","mineru"],"default":"auto","description":"解析 Provider 策略。auto 按服务端启用列表和顺序执行；MinerU 默认禁用；指定 Provider 时严格执行该 Provider，不静默切换。"},"requested_mode":{"type":"string","enum":["standard","high_accuracy","structure_preserving"]},"result_source":{"type":"string","enum":["fresh","reused"]},"pipeline_stage":{"type":"string","enum":["completed","failed"]},"worker_attempt_count":{"type":"integer","minimum":1},"fallback_occurred":{"type":"boolean"},"isolation_used":{"type":"boolean"},"attempts":{"type":"array","maxItems":32,"items":{"type":"object","additionalProperties":false,"required":["provider","status","scope"],"properties":{"provider":{"type":"string","enum":["docparse","tencent","local","mineru","unknown"]},"status":{"type":"string","enum":["succeeded","failed","unknown"]},"scope":{"type":"string","enum":["group","page","isolation","unknown"]},"page_count":{"type":"integer","minimum":0},"duration_ms":{"type":"integer","minimum":0},"safe_error_code":{"type":"string","maxLength":64},"retryable":{"type":"boolean"},"fallback_allowed":{"type":"boolean"}}}},"attempts_truncated":{"type":"boolean"},"page_summary":{"type":"object","additionalProperties":false,"required":["total","ready","degraded","by_provider"],"properties":{"total":{"type":"integer","minimum":0},"ready":{"type":"integer","minimum":0},"degraded":{"type":"integer","minimum":0},"by_provider":{"type":"object","additionalProperties":false,"required":[],"properties":{"docparse":{"type":"integer","minimum":0},"tencent":{"type":"integer","minimum":0},"local":{"type":"integer","minimum":0}}}}},"warnings":{"type":"object","additionalProperties":false,"required":["count","codes"],"properties":{"count":{"type":"integer","minimum":0},"codes":{"type":"array","maxItems":32,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":64}}}},"source_format":{"type":"string","minLength":1,"maxLength":32},"canonicalized":{"type":"boolean"},"content_version":{"type":"string","minLength":1,"maxLength":128},"failure_stage":{"type":"string","enum":["precondition","source_read","convert","split","provider_parse","persist","unknown"]}}}}},"error":{"type":"null"}}}]}}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"409":{"description":"幂等键、任务状态或资源状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"413":{"description":"请求体过大","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"500":{"description":"服务内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"502":{"description":"上游服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"504":{"description":"上游服务超时","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"document.parse","x-stability":"preview"}},"/open/v1/documents/directories":{"get":{"tags":["2. 文档准备"],"summary":"列出文档目录","operationId":"listDocumentDirectories","responses":{"200":{"description":"请求已成功处理","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"required":["items"],"properties":{"items":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["directory_id","name","parent_id","owner_ref","kind","doc_id","created_at"],"properties":{"directory_id":{"type":"integer","minimum":1},"name":{"type":["string","null"],"maxLength":255},"parent_id":{"type":["integer","null"],"minimum":1},"owner_ref":{"type":["string","null"],"maxLength":128},"kind":{"type":"string","enum":["directory","document"]},"doc_id":{"type":["integer","null"],"minimum":1},"created_at":{"type":["string","null"],"format":"date-time"}}}}}},"error":{"type":"null"}}}]}}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"500":{"description":"服务内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"502":{"description":"上游服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"504":{"description":"上游服务超时","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"document.read","x-stability":"preview","parameters":[{"name":"owner_ref","in":"query","required":false,"schema":{"type":"string","maxLength":128}},{"name":"parent_id","in":"query","required":false,"schema":{"type":"integer","minimum":-1}}]},"post":{"tags":["2. 文档准备"],"summary":"创建文档目录","operationId":"createDocumentDirectory","responses":{"201":{"description":"文件上传成功；请保存响应中的 doc_id","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"required":["directory_id","name","parent_id","owner_ref","kind","doc_id","created_at"],"properties":{"directory_id":{"type":"integer","minimum":1},"name":{"type":["string","null"],"maxLength":255},"parent_id":{"type":["integer","null"],"minimum":1},"owner_ref":{"type":["string","null"],"maxLength":128},"kind":{"type":"string","enum":["directory","document"]},"doc_id":{"type":["integer","null"],"minimum":1},"created_at":{"type":["string","null"],"format":"date-time"}}},"error":{"type":"null"}}}]}}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"409":{"description":"幂等键、任务状态或资源状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"413":{"description":"请求体过大","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"415":{"description":"请求媒体类型不支持","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"429":{"description":"队列或模型并发额度已满，请稍后重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"500":{"description":"服务内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"502":{"description":"上游服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"504":{"description":"上游服务超时","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"document.manage","x-stability":"preview","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"name":{"type":"string","minLength":1,"maxLength":255},"parent_id":{"type":["integer","null"],"minimum":1},"owner_ref":{"type":"string","maxLength":128}}}}}}}},"/open/v1/usage/records":{"get":{"tags":["6. 用量与计量"],"summary":"分页查询当前 API Key 的原子能力计量明细","description":"只返回当前 API Key 自身的脱敏用量；可按时间、能力、Job 或 client_request_id 过滤。","operationId":"listUsageRecords","responses":{"200":{"description":"请求已成功处理","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"required":["items","total","page","size"],"properties":{"items":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["capability","request_id","job_id","client_request_id","result_status","created_at","updated_at","metering"],"properties":{"capability":{"type":"string"},"request_id":{"type":"string"},"job_id":{"type":["string","null"],"pattern":"^[a-f0-9]{32}$"},"client_request_id":{"type":["string","null"],"pattern":"^[A-Za-z0-9._:-]{1,128}$"},"result_status":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"metering":{"type":"object","additionalProperties":false,"required":["status","models","ocr","timing"],"properties":{"status":{"type":"string","enum":["pending","reported","partial","unavailable","not_applicable"]},"job_id":{"type":["string","null"],"pattern":"^[a-f0-9]{32}$"},"metered_request_id":{"type":["string","null"]},"document_page_count":{"type":["integer","null"],"minimum":0},"models":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["provider","model_type","model_id","model_id_source","input_tokens","output_tokens","call_count","duration_ms","usage_status"],"properties":{"provider":{"type":["string","null"]},"model_type":{"type":"string","enum":["chat","embedding","rerank","vision"]},"model_id":{"type":["string","null"]},"model_id_source":{"type":"string","enum":["provider","configured","unavailable"]},"input_tokens":{"type":["integer","null"],"minimum":0},"output_tokens":{"type":["integer","null"],"minimum":0},"call_count":{"type":"integer","minimum":1},"duration_ms":{"type":["integer","null"],"minimum":0},"usage_status":{"type":"string","enum":["reported","partial","unavailable"]}}}},"ocr":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["provider","service","page_count","call_count","cache_hit_count","duration_ms","usage_status"],"properties":{"provider":{"type":"string"},"service":{"type":"string"},"page_count":{"type":["integer","null"],"minimum":0},"call_count":{"type":"integer","minimum":1},"cache_hit_count":{"type":"integer","minimum":0},"duration_ms":{"type":["integer","null"],"minimum":0},"usage_status":{"type":"string","enum":["reported","partial","unavailable"]}}}},"audio":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["provider","model_id","call_count","unknown_call_count","audio_duration_seconds","input_tokens","output_tokens","usage_status"],"properties":{"provider":{"type":"string"},"model_id":{"type":"string"},"call_count":{"type":"integer","minimum":1},"unknown_call_count":{"type":"integer","minimum":0},"audio_duration_seconds":{"type":["integer","null"],"minimum":0},"input_tokens":{"type":["integer","null"],"minimum":0},"output_tokens":{"type":["integer","null"],"minimum":0},"usage_status":{"type":"string","enum":["reported","partial","unavailable"]}}}},"image_generation":{"type":"object","additionalProperties":false,"required":["attempt_count","unknown_result_count","image_count","usage_status"],"properties":{"attempt_count":{"type":"integer","minimum":1},"unknown_result_count":{"type":"integer","minimum":0},"image_count":{"type":["integer","null"],"minimum":0},"usage_status":{"type":"string","enum":["reported","partial","unavailable"]}}},"timing":{"type":"object","additionalProperties":false,"required":["gateway_ms","execution_ms","total_ms"],"properties":{"gateway_ms":{"type":["integer","null"],"minimum":0},"execution_ms":{"type":["integer","null"],"minimum":0},"total_ms":{"type":["integer","null"],"minimum":0}}}}}}}},"total":{"type":"integer","minimum":0},"page":{"type":"integer","minimum":1},"size":{"type":"integer","minimum":1,"maximum":100}}},"error":{"type":"null"}}}]}}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"500":{"description":"服务内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"502":{"description":"上游服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"504":{"description":"上游服务超时","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"viewUsage","x-stability":"stable","parameters":[{"name":"from","in":"query","required":false,"schema":{"type":"string","format":"date-time"},"description":"起始时间（包含）。"},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date-time"},"description":"结束时间（不包含）。"},{"name":"capability","in":"query","required":false,"schema":{"type":"string","maxLength":128}},{"name":"job_id","in":"query","required":false,"schema":{"type":"string","pattern":"^[a-f0-9]{32}$"}},{"name":"client_request_id","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$","description":"调用方生成的幂等请求标识；相同调用方重试时保持不变。"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":1000000,"default":1}},{"name":"size","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":20}}]}},"/open/v1/usage/summary":{"get":{"tags":["6. 用量与计量"],"summary":"按时间或任务汇总当前 API Key 用量","description":"可提供完整 from/to 时间范围，或使用 job_id/client_request_id 查询具体任务；时间区间为左闭右开。","operationId":"summarizeUsage","responses":{"200":{"description":"请求已成功处理","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"required":["from","to","capabilities","models","ocr"],"properties":{"audio":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["provider","model_id","call_count","unknown_call_count","audio_duration_seconds","input_tokens","output_tokens","usage_status"],"properties":{"provider":{"type":"string"},"model_id":{"type":"string"},"call_count":{"type":"integer","minimum":1},"unknown_call_count":{"type":"integer","minimum":0},"audio_duration_seconds":{"type":["integer","null"],"minimum":0},"input_tokens":{"type":["integer","null"],"minimum":0},"output_tokens":{"type":["integer","null"],"minimum":0},"usage_status":{"type":"string","enum":["reported","partial","unavailable"]}}}},"image_generation":{"type":"object","additionalProperties":false,"required":["attempt_count","unknown_result_count","image_count","usage_status"],"properties":{"attempt_count":{"type":"integer","minimum":1},"unknown_result_count":{"type":"integer","minimum":0},"image_count":{"type":["integer","null"],"minimum":0},"usage_status":{"type":"string","enum":["reported","partial","unavailable"]}}},"from":{"type":["string","null"],"format":"date-time"},"to":{"type":["string","null"],"format":"date-time"},"capabilities":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["capability","request_count","gateway_call_count","model_call_count","input_tokens","output_tokens","ocr_page_count","total_duration_ms","reported_count","partial_count","unavailable_count","pending_count","not_applicable_count"],"properties":{"capability":{"type":"string"},"request_count":{"type":"integer","minimum":0},"gateway_call_count":{"type":"integer","minimum":0},"model_call_count":{"type":"integer","minimum":0},"input_tokens":{"type":["integer","null"],"minimum":0},"output_tokens":{"type":["integer","null"],"minimum":0},"ocr_page_count":{"type":["integer","null"],"minimum":0},"total_duration_ms":{"type":["integer","null"],"minimum":0},"reported_count":{"type":"integer","minimum":0},"partial_count":{"type":"integer","minimum":0},"unavailable_count":{"type":"integer","minimum":0},"pending_count":{"type":"integer","minimum":0},"not_applicable_count":{"type":"integer","minimum":0}}}},"models":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["provider_code","model_type","model_id","call_count","input_tokens","output_tokens","duration_ms","usage_status"],"properties":{"provider_code":{"type":["string","null"]},"model_type":{"type":"string","enum":["chat","embedding","rerank","vision"]},"model_id":{"type":["string","null"]},"call_count":{"type":"integer","minimum":0},"input_tokens":{"type":["integer","null"],"minimum":0},"output_tokens":{"type":["integer","null"],"minimum":0},"duration_ms":{"type":["integer","null"],"minimum":0},"usage_status":{"type":"string","enum":["reported","partial","unavailable"]}}}},"ocr":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["provider_code","service_code","call_count","cache_hit_count","page_count","duration_ms","usage_status"],"properties":{"provider_code":{"type":"string"},"service_code":{"type":"string"},"call_count":{"type":"integer","minimum":0},"cache_hit_count":{"type":"integer","minimum":0},"page_count":{"type":["integer","null"],"minimum":0},"duration_ms":{"type":["integer","null"],"minimum":0},"usage_status":{"type":"string","enum":["reported","partial","unavailable"]}}}}}},"error":{"type":"null"}}}]}}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"500":{"description":"服务内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"502":{"description":"上游服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"504":{"description":"上游服务超时","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"viewUsage","x-stability":"preview","parameters":[{"name":"from","in":"query","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","format":"date-time"}},{"name":"capability","in":"query","required":false,"schema":{"type":"string","maxLength":128}},{"name":"job_id","in":"query","required":false,"schema":{"type":"string","pattern":"^[a-f0-9]{32}$"}},{"name":"client_request_id","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$","description":"调用方生成的幂等请求标识；相同调用方重试时保持不变。"}}]}},"/open/v1/knowledge/bases":{"post":{"tags":["7. 动态知识库"],"summary":"知识库管理","description":"**接入前必读**：完整状态、效力、鉴权、异步及错误边界见动态知识库接入指南：`/swagger-ui/open-v1/docs/dynamic-knowledge`。\n\n**分支调用边界**：以下列出本页样例基础形态的权限与条件头；历史revision、confirmed标注、分组及参考稿保存的附加要求见各分支正文和接入指南，组合权限须同时具备。字段、类型、默认值、上限及互斥条件以本页请求Schema为准。业务响应no-store，写入后读取最新ETag，异步结果沿原任务入口取得。\n\n**CreateKnowledgeBase · action=create**：必填`action、payload`；权限`dkWrite`；Idempotency-Key必填；If-Match不需要；成功HTTP 201。只创建当前Space中的空库，不自动上传、解析或建立快照。限定kb_ids的Key不能创建新库。\n\n**ListKnowledgeBases · action=list**：必填`action`；权限`dkRead`；Idempotency-Key不需要；If-Match不需要；成功HTTP 200。只返回当前Key有权读取的库；空列表表示当前可见范围为空，不代表全平台没有库。\n\n**AuditKnowledgeBase · action=audit**：必填`action、kb_id`；权限`dkAudit`；Idempotency-Key不需要；If-Match不需要；成功HTTP 200。读取本库审计；object_id可限定对象。cursor是审计序号，从0开始；不返回其他Space的记录。\n\n**共同限制**：ready不等于released，确认/快照发布不等于制度正式发布；旧来源撤权不能靠历史快照绕过。","operationId":"dkManageBases","responses":{"200":{"description":"请求已成功处理","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"oneOf":[{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"active_snapshot_id":{"type":["string","null"]},"generation":{"type":"integer","minimum":0}},"required":["id","name","active_snapshot_id","generation"]}},"next_cursor":{"type":["string","null"]},"action":{"const":"list"}},"required":["items","next_cursor","action"]},{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"object_id":{"type":"string"},"action":{"type":"string"},"old_revision":{"type":["integer","null"]},"new_revision":{"type":["integer","null"]},"actor_id":{"type":"integer"},"edit_reason":{"type":"string"},"occurred_at":{"type":"string"}},"required":["id","object_id","action"]}},"next_cursor":{"type":["integer","null"]},"action":{"const":"audit"}},"required":["items","next_cursor","action"]}]},"error":{"type":"null"}}}]}}}},"201":{"description":"业务对象已创建；请保存响应中的 id","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"active_snapshot_id":{"type":["string","null"]},"generation":{"type":"integer","minimum":0},"action":{"const":"create"}},"required":["id","name","active_snapshot_id","generation","action"]},"error":{"type":"null"}}}]}}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"409":{"description":"幂等键、任务状态或资源状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"412":{"description":"资源修订已变化，请重新读取后提交","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"413":{"description":"请求体过大","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"422":{"description":"文件内容无法转换(已确认文件被截断、不完整,重传无效)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"428":{"description":"缺少资源修订前置条件 If-Match","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"429":{"description":"队列或模型并发额度已满，请稍后重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"dkRead","x-stability":"preview","x-alternative-scopes":["dkWrite","dkAudit"],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":128},"description":"仅写操作必填；同一次业务动作重试保持原值。"},{"name":"If-Match","in":"header","required":false,"schema":{"type":"string"},"description":"修改、确认、撤销、纠错、索引设置和结构化新版保存必填；分组按对象ETag，指定批次另需本头部。"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"additionalProperties":false,"properties":{"action":{"const":"create","title":"Action","type":"string"},"payload":{"additionalProperties":false,"properties":{"name":{"maxLength":255,"minLength":1,"title":"Name","type":"string"}},"required":["name"],"title":"CreateBase","type":"object"}},"required":["action","payload"],"title":"CreateKnowledgeBase","type":"object"},{"additionalProperties":false,"properties":{"action":{"const":"list","title":"Action","type":"string"},"cursor":{"default":"","maxLength":32,"title":"Cursor","type":"string"},"limit":{"default":50,"maximum":99,"minimum":1,"title":"Limit","type":"integer"}},"required":["action"],"title":"ListKnowledgeBases","type":"object"},{"additionalProperties":false,"properties":{"action":{"const":"audit","title":"Action","type":"string"},"kb_id":{"maxLength":32,"minLength":1,"title":"Kb Id","type":"string"},"object_id":{"oneOf":[{"type":"string"},{"type":"null"}],"title":"Object Id"},"cursor":{"default":0,"minimum":0,"title":"Cursor","type":"integer"},"limit":{"default":50,"maximum":100,"minimum":1,"title":"Limit","type":"integer"}},"required":["action","kb_id"],"title":"AuditKnowledgeBase","type":"object"}],"title":"dkManageBasesInput"},"examples":{"CreateKnowledgeBase":{"summary":"create","value":{"action":"create","payload":{"name":"虚构制度演示库"}}},"ListKnowledgeBases":{"summary":"list","value":{"action":"list"}},"AuditKnowledgeBase":{"summary":"audit","value":{"action":"audit","kb_id":"demo-base"}}}}}}}},"/open/v1/knowledge/materials":{"post":{"tags":["7. 动态知识库"],"summary":"知识资料管理","description":"**接入前必读**：完整状态、效力、鉴权、异步及错误边界见动态知识库接入指南：`/swagger-ui/open-v1/docs/dynamic-knowledge`。\n\n**分支调用边界**：以下列出本页样例基础形态的权限与条件头；历史revision、confirmed标注、分组及参考稿保存的附加要求见各分支正文和接入指南，组合权限须同时具备。字段、类型、默认值、上限及互斥条件以本页请求Schema为准。业务响应no-store，写入后读取最新ETag，异步结果沿原任务入口取得。\n\n**ImportKnowledgeMaterials · action=import**：必填`action、kb_id、payload`；权限`dkWrite`；Idempotency-Key必填；If-Match不需要；成功HTTP 202。files是已配置Source的文件引用，不是上传字节或任意URL。manifest显式指定主体、分组、版本标签与前驱；未声明的关系只能形成候选，不能按文件名或上传顺序认定。批量任务允许部分条目失败，必须继续读取get_import逐项检查。manifest.source_record仅用于文档版本；kind=revision_note不接受非空source_record。自动识别为说明而带该字段时该条目受控失败，保留原文件引用；明确kind=document并用新幂等键重新import，不能用retry_import修改原manifest。\n\n**GetKnowledgeImport · action=get_import**：必填`action、kb_id、import_id`；权限`dkRead`；Idempotency-Key不需要；If-Match不需要；成功HTTP 200。读取批次及全部条目；条目的ready/failed/needs_review等结果比任务succeeded更具体。失败条目的错误和可恢复信息必须保留。\n\n**RetryKnowledgeImport · action=retry_import**：必填`action、kb_id、import_id、payload`；权限`dkWrite`；Idempotency-Key必填；If-Match不需要；成功HTTP 202。仅重试此批次指定且status=failed的条目；待复核项不属于本接口可重试范围，应先核对其关系或资料。已成功条目、其他批次条目和来源已换版不能盲目重放。修正原因后用新幂等键提交恢复。\n\n**CreateKnowledgeDocument · action=save_document**：必填`action、kb_id、payload`；权限`dkWrite`；Idempotency-Key必填；If-Match不需要；成功HTTP 201。只新增逻辑文档主体和描述信息，不创建正文版本；空主体不能作为可执行制度依据。source_record为通用来源描述，旧provided_record仍兼容；均不授予权限或证明效力。\n\n**EditKnowledgeDocument · action=save_document**：必填`action、kb_id、document_id、payload`；权限`dkWrite`；Idempotency-Key必填；If-Match必填；成功HTTP 202。维护主体标题、单位、别名和静态描述投影；不改原文件或业务发布状态。source_record/provided_record省略保留，显式null清空；新旧格式互斥。返回异步任务，关联元信息可能需重新核验。\n\n**ListKnowledgeDocuments · action=list_documents**：必填`action、kb_id`；权限`dkRead`；Idempotency-Key不需要；If-Match不需要；成功HTTP 200。返回逻辑文档目录，不列独立修订说明。逐项检查来源权限：本页任一关联来源不可读可能404、授权服务不可核实可能503；调用方不能把列表失败推断成库为空。\n\n**GetKnowledgeDocument · action=get_document**：必填`action、kb_id、document_id`；权限`dkRead`；Idempotency-Key不需要；If-Match不需要；成功HTTP 200。按ID读取主体并核对其相关来源，不能用它获取别库对象。revision是对象修订号，读取历史仍检查当前权限；它不是制度版本标签。\n\n**ListKnowledgeVersions · action=list_versions**：必填`action、kb_id、document_id`；权限`dkRead`；Idempotency-Key不需要；If-Match不需要；成功HTTP 200。列出一个主体的业务版本，按返回的前驱和日期解释关系，不把排列顺序当作新旧或现行顺序。state/processing_status与body.publication_status必须分开判断。\n\n**GetKnowledgeVersion · action=get_version**：必填`action、kb_id、version_id`；权限`dkRead`；Idempotency-Key不需要；If-Match不需要；成功HTTP 200。读取版本及body.publication_status、issued_at、effective_from、effective_to等元信息；ready只代表处理就绪。revision读取对象历史，不能代替version_id。\n\n**GetKnowledgeContent · action=get_content**：必填`action、kb_id、version_id`；权限`dkRead`；Idempotency-Key不需要；If-Match不需要；成功HTTP 200。读取指定版本的正文投影与定位；content_revision_id可固定正文修订，但须确属该版本。body.processing_warnings为可选解析限制提示，须单独展示，不作为正文或引用事实。blocks的section_path保留正文、脚注、页眉页脚等来源区段；table_cells的row_index/column_index从0开始，row_span/column_span表示真实跨度。内嵌表为独立块，parent_id指直接父表，父单元格nested_table_ids只列直接子表；不能把子表文字重复拼入父表。无页级定位的原生源结构不提供虚构page/bbox。正文可读不等于已确认现行效力；原件下载仍用原文档读取入口。\n\n**CorrectKnowledgeContent · action=correct**：必填`action、kb_id、version_id、payload`；权限`dkWrite`；Idempotency-Key必填；If-Match必填；成功HTTP 202。按block_id纠正同一业务版本的正文，形成可追溯正文修订；不创建新的制度业务版本、不回写原件。依赖旧正文的变化、原因或依据可能转待复核。\n\n**ConfirmKnowledgeContent · action=confirm_content**：必填`action、kb_id、version_id、payload`；权限`dkConfirm+dkRead+dkWrite`；Idempotency-Key必填；If-Match必填；成功HTTP 202。确认当前正文可参与问答，不修改制度发布状态或生效日期。要求dkRead、dkWrite、dkConfirm、If-Match与幂等键；payload指定当前content_revision_id及edit_reason。正文变化或非就绪拒绝，来源权限重新核验；受理后查询任务及confirmation_index，等待检索准备完成。\n\n**VerifyKnowledgeVersion · action=verify**：必填`action、kb_id、version_id、payload`；权限`dkConfirm+dkRead+dkWrite`；Idempotency-Key必填；If-Match必填；成功HTTP 202。核实当前ready版本的名称、发布状态及发布日期/生效区间，须dkRead+dkWrite+dkConfirm、当前版本If-Match和幂等键。完整替换这些字段，缺失日期不编造；content_revision_id、block_id、逐字quote、basis及edit_reason必填。原文明示草稿/撤回不能直接改成released，须导入正式文件。保留原件及核实审计；异步刷新成功后才更新检索，仍受日期/范围/证据限制。相同核实信息以新幂等键重试仅刷新、不新增业务版本或核实修订；正文纠错后须重新核实。\n\n**RemoveKnowledgeVersion · action=remove_version**：必填`action、kb_id、version_id、payload`；权限`dkConfirm+dkRead+dkWrite`；Idempotency-Key必填；If-Match必填；成功HTTP 202。从当前库删除单版本及其全部正文投影；最后一个版本同时移除空主体。须dkRead+dkWrite+dkConfirm、当前版本If-Match、幂等键及edit_reason。保留上传/静态库原件、历史修订和审计，不等于制度业务撤回。实际任务仍排队/运行或仍被其他版本用作前驱时409；任务已失败/取消的版本可删除，即使对象仍残留queued状态，未解析文件或结构化基准仍须核实来源权限。返回object_id、kind、新etag及检索任务；受理后立即屏蔽旧证据/旧问答，派生结果转needs_review。索引失败不恢复资料：用返回的新etag、原目标、相同范围和新幂等键重试，只更新索引、不再次删除。历史revision需dkAudit且仍校验来源。\n\n**RemoveKnowledgeDocument · action=remove_document**：必填`action、kb_id、document_id、payload`；权限`dkConfirm+dkRead+dkWrite`；Idempotency-Key必填；If-Match必填；成功HTTP 202。删除整份制度及当前全部版本，保留原件与审计。权限/异步/重试边界同remove_version。payload.versions必须列出弹窗中完整version_id/version_etag集合（空主体传空数组）；新增/移动版本导致409、任一ETag过期412，均不部分删除。集合内部前驱允许，集合外前驱阻断。重试必须沿用原完整versions清单，If-Match改为受理返回的新etag。\n\n**GroupKnowledgeVersions · action=group**：必填`action、kb_id、payload`；权限`dkWrite`；Idempotency-Key必填；If-Match仅含import_id时必填，各对象ETag仍必填；成功HTTP 202。维护前驱、拒绝候选、手工合并/拆分逻辑分组。每个版本及已有目标文档提供各自ETag；指定import_id时另提供批次If-Match。前驱须同主体、无环；不改变原件或业务生效期。\n\n**GetKnowledgeGroup · action=get_group**：必填`action、kb_id、relation_id`；权限`dkRead`；Idempotency-Key不需要；If-Match不需要；成功HTTP 200。读取分组/前驱候选关系；候选不等于已人工确认的关系。历史读取不绕过当前来源权限。\n\n**GetKnowledgeFile · action=get_file**：必填`action、kb_id、file_id`；权限`dkRead`；Idempotency-Key不需要；If-Match不需要；成功HTTP 200。读取动态资料的文件引用记录，仅AIService集成入口提供；不是原文件字节下载，也不是一个新的上传入口。独立Core没有上传适配器时503。\n\n**RevokeKnowledgeFile · action=revoke_file**：必填`action、kb_id、payload、file_id`；权限`dkWrite`；Idempotency-Key必填；If-Match必填；成功HTTP 200。撤销本库的动态文件引用；不删除宿主原件。当前权限与引用ETag必须有效；旧结果读取仍会重新核对被撤销来源。\n\n**共同限制**：ready不等于released，确认/快照发布不等于制度正式发布；旧来源撤权不能靠历史快照绕过。","operationId":"dkManageMaterials","responses":{"200":{"description":"请求已成功处理","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"kb_id":{"type":"string"},"kind":{"type":"string"},"state":{"type":"string"},"parent_id":{"type":["string","null"]},"revision":{"type":"integer","minimum":1},"etag":{"type":"string"},"body":{"type":"object","description":"对应 kind 的固定修订内容；读取历史修订需要审计权限。"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kb_id":{"type":"string"},"kind":{"type":"string"},"state":{"type":"string"},"parent_id":{"type":["string","null"]},"revision":{"type":"integer","minimum":1},"etag":{"type":"string"},"body":{"type":"object","description":"对应 kind 的固定修订内容；读取历史修订需要审计权限。"}},"required":["id","kb_id","kind","state","parent_id","revision","etag","body"]}},"action":{"const":"get_import"}},"required":["id","kb_id","kind","state","parent_id","revision","etag","body","items","action"]},{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kb_id":{"type":"string"},"kind":{"type":"string"},"state":{"type":"string"},"parent_id":{"type":["string","null"]},"revision":{"type":"integer","minimum":1},"etag":{"type":"string"},"body":{"type":"object","description":"对应 kind 的固定修订内容；读取历史修订需要审计权限。"}},"required":["id","kb_id","kind","state","parent_id","revision","etag","body"]}},"next_cursor":{"type":["string","null"]},"action":{"const":"list_documents"}},"required":["items","next_cursor","action"]},{"type":"object","properties":{"id":{"type":"string"},"kb_id":{"type":"string"},"kind":{"type":"string"},"state":{"type":"string"},"parent_id":{"type":["string","null"]},"revision":{"type":"integer","minimum":1},"etag":{"type":"string"},"body":{"type":"object","description":"对应 kind 的固定修订内容；读取历史修订需要审计权限。"},"action":{"const":"get_document"}},"required":["id","kb_id","kind","state","parent_id","revision","etag","body","action"]},{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kb_id":{"type":"string"},"kind":{"type":"string"},"state":{"type":"string"},"parent_id":{"type":["string","null"]},"revision":{"type":"integer","minimum":1},"etag":{"type":"string"},"body":{"type":"object","description":"对应 kind 的固定修订内容；读取历史修订需要审计权限。"},"verification_index":{"type":"object","properties":{"state":{"enum":["not_eligible","pending","ready","failed"]},"job_id":{"type":["string","null"]}},"required":["state","job_id"]},"confirmation_index":{"type":"object","properties":{"state":{"enum":["not_eligible","pending","ready","failed"]},"job_id":{"type":["string","null"]}},"required":["state","job_id"]}},"required":["id","kb_id","kind","state","parent_id","revision","etag","body"]}},"next_cursor":{"type":["string","null"]},"action":{"const":"list_versions"}},"required":["items","next_cursor","action"]},{"type":"object","properties":{"id":{"type":"string"},"kb_id":{"type":"string"},"kind":{"type":"string"},"state":{"type":"string"},"parent_id":{"type":["string","null"]},"revision":{"type":"integer","minimum":1},"etag":{"type":"string"},"body":{"type":"object","description":"对应 kind 的固定修订内容；读取历史修订需要审计权限。"},"verification_index":{"type":"object","properties":{"state":{"enum":["not_eligible","pending","ready","failed"]},"job_id":{"type":["string","null"]}},"required":["state","job_id"]},"confirmation_index":{"type":"object","properties":{"state":{"enum":["not_eligible","pending","ready","failed"]},"job_id":{"type":["string","null"]}},"required":["state","job_id"]},"action":{"const":"get_version"}},"required":["id","kb_id","kind","state","parent_id","revision","etag","body","action"]},{"type":"object","properties":{"id":{"type":"string"},"kb_id":{"type":"string"},"kind":{"type":"string"},"state":{"type":"string"},"parent_id":{"type":["string","null"]},"revision":{"type":"integer","minimum":1},"etag":{"type":"string"},"body":{"type":"object","description":"对应 kind 的固定修订内容；读取历史修订需要审计权限。"},"representation":{"type":"string"},"action":{"const":"get_content"}},"required":["id","kb_id","kind","state","parent_id","revision","etag","body","representation","action"]},{"type":"object","properties":{"id":{"type":"string"},"kb_id":{"type":"string"},"kind":{"type":"string"},"state":{"type":"string"},"parent_id":{"type":["string","null"]},"revision":{"type":"integer","minimum":1},"etag":{"type":"string"},"body":{"type":"object","description":"对应 kind 的固定修订内容；读取历史修订需要审计权限。"},"action":{"const":"get_group"}},"required":["id","kb_id","kind","state","parent_id","revision","etag","body","action"]},{"type":"object","properties":{"file_ref":{"type":"object","properties":{"source_id":{"type":"string"},"file_id":{"type":"string"},"source_revision":{"type":"string"}},"required":["source_id","file_id","source_revision"]},"path":{"type":"string"},"status":{"enum":["ready","withdrawn"]},"etag":{"type":"string"},"action":{"const":"get_file"}},"required":["file_ref","path","status","etag","action"]},{"type":"object","properties":{"file_ref":{"type":"object","properties":{"source_id":{"type":"string"},"file_id":{"type":"string"},"source_revision":{"type":"string"}},"required":["source_id","file_id","source_revision"]},"path":{"type":"string"},"status":{"enum":["ready","withdrawn"]},"etag":{"type":"string"},"action":{"const":"revoke_file"}},"required":["file_ref","path","status","etag","action"]}]},"error":{"type":"null"}}}]}}}},"201":{"description":"业务对象已创建；请保存响应中的 id","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","properties":{"id":{"type":"string"},"kb_id":{"type":"string"},"kind":{"type":"string"},"state":{"type":"string"},"parent_id":{"type":["string","null"]},"revision":{"type":"integer","minimum":1},"etag":{"type":"string"},"body":{"type":"object","description":"对应 kind 的固定修订内容；读取历史修订需要审计权限。"},"action":{"const":"save_document"}},"required":["id","kb_id","kind","state","parent_id","revision","etag","body","action"]},"error":{"type":"null"}}}]}}}},"202":{"description":"任务已受理；请使用 job_id 查询进度和结果","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"oneOf":[{"type":"object","properties":{"job_id":{"type":"string"},"status":{"const":"queued"},"status_url":{"type":"string","pattern":"^/open/v1/job/[0-9a-f]{32}$","description":"查询任务状态，成功后在该地址追加 /result 读取结果。"},"etag":{"type":"string"},"import_id":{"type":"string"},"action":{"const":"import"}},"required":["job_id","status","status_url","import_id","action"]},{"type":"object","properties":{"job_id":{"type":"string"},"status":{"const":"queued"},"status_url":{"type":"string","pattern":"^/open/v1/job/[0-9a-f]{32}$","description":"查询任务状态，成功后在该地址追加 /result 读取结果。"},"etag":{"type":"string"},"import_id":{"type":"string"},"action":{"const":"retry_import"}},"required":["job_id","status","status_url","import_id","action"]},{"type":"object","properties":{"job_id":{"type":"string"},"status":{"const":"queued"},"status_url":{"type":"string","pattern":"^/open/v1/job/[0-9a-f]{32}$","description":"查询任务状态，成功后在该地址追加 /result 读取结果。"},"etag":{"type":"string"},"document_id":{"type":"string"},"action":{"const":"save_document"}},"required":["job_id","status","status_url","document_id","action"]},{"type":"object","properties":{"job_id":{"type":"string"},"status":{"const":"queued"},"status_url":{"type":"string","pattern":"^/open/v1/job/[0-9a-f]{32}$","description":"查询任务状态，成功后在该地址追加 /result 读取结果。"},"etag":{"type":"string"},"version_id":{"type":"string"},"action":{"const":"correct"}},"required":["job_id","status","status_url","version_id","action"]},{"type":"object","properties":{"job_id":{"type":"string"},"status":{"const":"queued"},"status_url":{"type":"string","pattern":"^/open/v1/job/[0-9a-f]{32}$","description":"查询任务状态，成功后在该地址追加 /result 读取结果。"},"etag":{"type":"string"},"version_id":{"type":"string"},"action":{"const":"verify"}},"required":["job_id","status","status_url","version_id","action"]},{"type":"object","properties":{"job_id":{"type":"string"},"status":{"const":"queued"},"status_url":{"type":"string","pattern":"^/open/v1/job/[0-9a-f]{32}$","description":"查询任务状态，成功后在该地址追加 /result 读取结果。"},"etag":{"type":"string"},"version_id":{"type":"string"},"action":{"const":"confirm_content"}},"required":["job_id","status","status_url","version_id","action"]},{"type":"object","properties":{"job_id":{"type":"string"},"status":{"const":"queued"},"status_url":{"type":"string","pattern":"^/open/v1/job/[0-9a-f]{32}$","description":"查询任务状态，成功后在该地址追加 /result 读取结果。"},"etag":{"type":"string"},"versions":{"type":"array","items":{"type":"object","properties":{"version_id":{"type":"string"},"etag":{"type":"string"},"document_id":{"type":"string"}},"required":["version_id","etag"]}},"action":{"const":"group"}},"required":["job_id","status","status_url","action"]},{"type":"object","properties":{"job_id":{"type":"string"},"status":{"const":"queued"},"status_url":{"type":"string","pattern":"^/open/v1/job/[0-9a-f]{32}$","description":"查询任务状态，成功后在该地址追加 /result 读取结果。"},"etag":{"type":"string"},"object_id":{"type":"string"},"kind":{"enum":["version","document"]},"action":{"const":"remove_version"}},"required":["job_id","status","status_url","object_id","kind","etag","action"]},{"type":"object","properties":{"job_id":{"type":"string"},"status":{"const":"queued"},"status_url":{"type":"string","pattern":"^/open/v1/job/[0-9a-f]{32}$","description":"查询任务状态，成功后在该地址追加 /result 读取结果。"},"etag":{"type":"string"},"object_id":{"type":"string"},"kind":{"enum":["version","document"]},"action":{"const":"remove_document"}},"required":["job_id","status","status_url","object_id","kind","etag","action"]}]},"error":{"type":"null"}}}]}}},"headers":{"Location":{"description":"任务状态查询地址","schema":{"type":"string","example":"/open/v1/job/0123456789abcdef0123456789abcdef"}}},"links":{"查询任务进度":{"operationId":"getJob","parameters":{"job_id":"$response.body#/data/job_id"},"description":"使用本次返回的 job_id 查询任务进度。"},"读取任务结果":{"operationId":"getJobResult","parameters":{"job_id":"$response.body#/data/job_id"},"description":"任务 succeeded 后读取结构化结果。"}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"409":{"description":"幂等键、任务状态或资源状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"412":{"description":"资源修订已变化，请重新读取后提交","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"413":{"description":"请求体过大","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"422":{"description":"文件内容无法转换(已确认文件被截断、不完整,重传无效)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"428":{"description":"缺少资源修订前置条件 If-Match","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"429":{"description":"队列或模型并发额度已满，请稍后重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"dkRead","x-stability":"preview","x-alternative-scopes":["dkWrite","dkConfirm"],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":128},"description":"仅写操作必填；同一次业务动作重试保持原值。"},{"name":"If-Match","in":"header","required":false,"schema":{"type":"string"},"description":"修改、确认、撤销、纠错、索引设置和结构化新版保存必填；分组按对象ETag，指定批次另需本头部。"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"additionalProperties":false,"properties":{"action":{"const":"import","title":"Action","type":"string"},"kb_id":{"maxLength":32,"minLength":1,"title":"Kb Id","type":"string"},"payload":{"additionalProperties":false,"properties":{"files":{"items":{"additionalProperties":false,"properties":{"source_id":{"maxLength":128,"minLength":1,"pattern":"^[A-Za-z0-9_.-]+$","title":"Source Id","type":"string"},"file_id":{"maxLength":256,"minLength":1,"title":"File Id","type":"string"},"source_revision":{"oneOf":[{"maxLength":256,"minLength":1,"type":"string"},{"type":"null"}],"title":"Source Revision"}},"required":["source_id","file_id"],"title":"FileRef","type":"object"},"maxItems":1000,"minItems":1,"title":"Files","type":"array"},"manifest":{"items":{"additionalProperties":false,"properties":{"source_record":{"oneOf":[{"additionalProperties":false,"properties":{"namespace":{"maxLength":128,"minLength":1,"title":"Namespace","type":"string"},"record_type":{"maxLength":64,"minLength":1,"title":"Record Type","type":"string"},"record_id":{"maxLength":256,"minLength":1,"title":"Record Id","type":"string"},"revision":{"oneOf":[{"maxLength":256,"minLength":1,"type":"string"},{"type":"null"}],"title":"Revision"},"parent_record_id":{"oneOf":[{"maxLength":256,"minLength":1,"type":"string"},{"type":"null"}],"title":"Parent Record Id"},"description":{"oneOf":[{"maxLength":4000,"type":"string"},{"type":"null"}],"title":"Description"}},"required":["namespace","record_type","record_id"],"title":"SourceRecord","type":"object"},{"type":"null"}]},"provided_record":{"oneOf":[{"additionalProperties":false,"properties":{"source_table":{"enum":["ca_law_version","ca_policy_version","ca_case_content"],"title":"Source Table","type":"string"},"id":{"pattern":"^[1-9][0-9]{0,18}$","title":"Id","type":"string"},"document_id":{"pattern":"^[1-9][0-9]{0,18}$","title":"Document Id","type":"string"},"version_no":{"oneOf":[{"maxLength":32,"minLength":1,"type":"string"},{"type":"null"}],"title":"Version No"},"version_status":{"oneOf":[{"enum":["CURRENT","HISTORY"],"type":"string"},{"type":"null"}],"title":"Version Status"},"current_flag":{"oneOf":[{"enum":[0,1],"type":"integer"},{"type":"null"}],"title":"Current Flag"},"publish_date":{"oneOf":[{"format":"date","type":"string"},{"type":"null"}],"title":"Publish Date"},"effective_date":{"oneOf":[{"format":"date","type":"string"},{"type":"null"}],"title":"Effective Date"},"expiry_date":{"oneOf":[{"format":"date","type":"string"},{"type":"null"}],"title":"Expiry Date"},"version_note":{"oneOf":[{"maxLength":500,"type":"string"},{"type":"null"}],"title":"Version Note"}},"required":["source_table","id","document_id"],"title":"StaticVersionRecord","type":"object"},{"type":"null"}],"description":"保留来源版本/案例内容记录，不按版本号推断前驱或覆盖自动效力判定"},"file_index":{"minimum":0,"title":"File Index","type":"integer"},"document_id":{"oneOf":[{"type":"string"},{"type":"null"}],"title":"Document Id"},"document_metadata":{"oneOf":[{"additionalProperties":false,"properties":{"source_record":{"oneOf":[{"additionalProperties":false,"properties":{"namespace":{"maxLength":128,"minLength":1,"title":"Namespace","type":"string"},"record_type":{"maxLength":64,"minLength":1,"title":"Record Type","type":"string"},"record_id":{"maxLength":256,"minLength":1,"title":"Record Id","type":"string"},"revision":{"oneOf":[{"maxLength":256,"minLength":1,"type":"string"},{"type":"null"}],"title":"Revision"},"parent_record_id":{"oneOf":[{"maxLength":256,"minLength":1,"type":"string"},{"type":"null"}],"title":"Parent Record Id"},"description":{"oneOf":[{"maxLength":4000,"type":"string"},{"type":"null"}],"title":"Description"}},"required":["namespace","record_type","record_id"],"title":"SourceRecord","type":"object"},{"type":"null"}]},"provided_record":{"oneOf":[{"additionalProperties":false,"properties":{"source_table":{"enum":["ca_law","ca_policy","ca_case"],"title":"Source Table","type":"string"},"id":{"pattern":"^[1-9][0-9]{0,18}$","title":"Id","type":"string"},"title":{"maxLength":500,"minLength":1,"title":"Title","type":"string"},"business_ref":{"oneOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"title":"Business Ref"},"status":{"oneOf":[{"maxLength":32,"type":"string"},{"type":"null"}],"title":"Status"},"maintenance_status":{"oneOf":[{"maxLength":24,"type":"string"},{"type":"null"}],"title":"Maintenance Status"},"publish_date":{"oneOf":[{"format":"date","type":"string"},{"type":"null"}],"title":"Publish Date"},"effective_date":{"oneOf":[{"format":"date","type":"string"},{"type":"null"}],"title":"Effective Date"},"expiry_date":{"oneOf":[{"format":"date","type":"string"},{"type":"null"}],"title":"Expiry Date"},"punish_date":{"oneOf":[{"format":"date","type":"string"},{"type":"null"}],"title":"Punish Date"},"applicable_org":{"oneOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"title":"Applicable Org"},"applicable_scope":{"oneOf":[{"maxLength":500,"type":"string"},{"type":"null"}],"title":"Applicable Scope"}},"required":["source_table","id","title"],"title":"StaticDocumentRecord","type":"object"},{"type":"null"}],"description":"静态主体的描述投影，不作为授权或已确认效力的依据"},"title":{"maxLength":255,"minLength":1,"title":"Title","type":"string"},"business_ref":{"oneOf":[{"maxLength":255,"type":"string"},{"type":"null"}],"title":"Business Ref"},"aliases":{"items":{"type":"string"},"maxItems":50,"title":"Aliases","type":"array"}},"required":["title"],"title":"CreateDocument","type":"object"},{"type":"null"}],"description":"仅用于新建文档主体的描述；不能与document_id并用，也不更新已有主体"},"group":{"oneOf":[{"maxLength":128,"minLength":1,"type":"string"},{"type":"null"}],"title":"Group"},"version_label":{"oneOf":[{"maxLength":128,"minLength":1,"type":"string"},{"type":"null"}],"title":"Version Label"},"predecessor_file_index":{"oneOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"title":"Predecessor File Index"},"kind":{"oneOf":[{"enum":["document","revision_note"],"type":"string"},{"type":"null"}],"title":"Kind"},"from_file_index":{"oneOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"title":"From File Index"},"to_file_index":{"oneOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"title":"To File Index"}},"required":["file_index"],"title":"ManifestItem","type":"object"},"maxItems":1000,"title":"Manifest","type":"array"}},"required":["files"],"title":"ImportFiles","type":"object"}},"required":["action","kb_id","payload"],"title":"ImportKnowledgeMaterials","type":"object"},{"additionalProperties":false,"properties":{"action":{"const":"get_import","title":"Action","type":"string"},"kb_id":{"maxLength":32,"minLength":1,"title":"Kb Id","type":"string"},"import_id":{"maxLength":32,"minLength":1,"title":"Import Id","type":"string"}},"required":["action","kb_id","import_id"],"title":"GetKnowledgeImport","type":"object"},{"additionalProperties":false,"properties":{"action":{"const":"retry_import","title":"Action","type":"string"},"kb_id":{"maxLength":32,"minLength":1,"title":"Kb Id","type":"string"},"import_id":{"maxLength":32,"minLength":1,"title":"Import Id","type":"string"},"payload":{"additionalProperties":false,"properties":{"item_ids":{"items":{"type":"string"},"maxItems":1000,"minItems":1,"title":"Item Ids","type":"array"}},"required":["item_ids"],"title":"RetryImport","type":"object"}},"required":["action","kb_id","import_id","payload"],"title":"RetryKnowledgeImport","type":"object"},{"additionalProperties":false,"properties":{"action":{"const":"save_document","title":"Action","type":"string"},"kb_id":{"maxLength":32,"minLength":1,"title":"Kb Id","type":"string"},"document_id":{"title":"Document Id","type":"null"},"payload":{"additionalProperties":false,"properties":{"source_record":{"oneOf":[{"additionalProperties":false,"properties":{"namespace":{"maxLength":128,"minLength":1,"title":"Namespace","type":"string"},"record_type":{"maxLength":64,"minLength":1,"title":"Record Type","type":"string"},"record_id":{"maxLength":256,"minLength":1,"title":"Record Id","type":"string"},"revision":{"oneOf":[{"maxLength":256,"minLength":1,"type":"string"},{"type":"null"}],"title":"Revision"},"parent_record_id":{"oneOf":[{"maxLength":256,"minLength":1,"type":"string"},{"type":"null"}],"title":"Parent Record Id"},"description":{"oneOf":[{"maxLength":4000,"type":"string"},{"type":"null"}],"title":"Description"}},"required":["namespace","record_type","record_id"],"title":"SourceRecord","type":"object"},{"type":"null"}]},"provided_record":{"oneOf":[{"additionalProperties":false,"properties":{"source_table":{"enum":["ca_law","ca_policy","ca_case"],"title":"Source Table","type":"string"},"id":{"pattern":"^[1-9][0-9]{0,18}$","title":"Id","type":"string"},"title":{"maxLength":500,"minLength":1,"title":"Title","type":"string"},"business_ref":{"oneOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"title":"Business Ref"},"status":{"oneOf":[{"maxLength":32,"type":"string"},{"type":"null"}],"title":"Status"},"maintenance_status":{"oneOf":[{"maxLength":24,"type":"string"},{"type":"null"}],"title":"Maintenance Status"},"publish_date":{"oneOf":[{"format":"date","type":"string"},{"type":"null"}],"title":"Publish Date"},"effective_date":{"oneOf":[{"format":"date","type":"string"},{"type":"null"}],"title":"Effective Date"},"expiry_date":{"oneOf":[{"format":"date","type":"string"},{"type":"null"}],"title":"Expiry Date"},"punish_date":{"oneOf":[{"format":"date","type":"string"},{"type":"null"}],"title":"Punish Date"},"applicable_org":{"oneOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"title":"Applicable Org"},"applicable_scope":{"oneOf":[{"maxLength":500,"type":"string"},{"type":"null"}],"title":"Applicable Scope"}},"required":["source_table","id","title"],"title":"StaticDocumentRecord","type":"object"},{"type":"null"}],"description":"静态主体的描述投影，不作为授权或已确认效力的依据"},"title":{"maxLength":255,"minLength":1,"title":"Title","type":"string"},"business_ref":{"oneOf":[{"maxLength":255,"type":"string"},{"type":"null"}],"title":"Business Ref"},"aliases":{"items":{"type":"string"},"maxItems":50,"title":"Aliases","type":"array"}},"required":["title"],"title":"CreateDocument","type":"object"}},"required":["action","kb_id","payload"],"title":"CreateKnowledgeDocument","type":"object"},{"additionalProperties":false,"properties":{"action":{"const":"save_document","title":"Action","type":"string"},"kb_id":{"maxLength":32,"minLength":1,"title":"Kb Id","type":"string"},"document_id":{"maxLength":32,"minLength":1,"title":"Document Id","type":"string"},"payload":{"additionalProperties":false,"properties":{"source_record":{"oneOf":[{"additionalProperties":false,"properties":{"namespace":{"maxLength":128,"minLength":1,"title":"Namespace","type":"string"},"record_type":{"maxLength":64,"minLength":1,"title":"Record Type","type":"string"},"record_id":{"maxLength":256,"minLength":1,"title":"Record Id","type":"string"},"revision":{"oneOf":[{"maxLength":256,"minLength":1,"type":"string"},{"type":"null"}],"title":"Revision"},"parent_record_id":{"oneOf":[{"maxLength":256,"minLength":1,"type":"string"},{"type":"null"}],"title":"Parent Record Id"},"description":{"oneOf":[{"maxLength":4000,"type":"string"},{"type":"null"}],"title":"Description"}},"required":["namespace","record_type","record_id"],"title":"SourceRecord","type":"object"},{"type":"null"}]},"provided_record":{"oneOf":[{"additionalProperties":false,"properties":{"source_table":{"enum":["ca_law","ca_policy","ca_case"],"title":"Source Table","type":"string"},"id":{"pattern":"^[1-9][0-9]{0,18}$","title":"Id","type":"string"},"title":{"maxLength":500,"minLength":1,"title":"Title","type":"string"},"business_ref":{"oneOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"title":"Business Ref"},"status":{"oneOf":[{"maxLength":32,"type":"string"},{"type":"null"}],"title":"Status"},"maintenance_status":{"oneOf":[{"maxLength":24,"type":"string"},{"type":"null"}],"title":"Maintenance Status"},"publish_date":{"oneOf":[{"format":"date","type":"string"},{"type":"null"}],"title":"Publish Date"},"effective_date":{"oneOf":[{"format":"date","type":"string"},{"type":"null"}],"title":"Effective Date"},"expiry_date":{"oneOf":[{"format":"date","type":"string"},{"type":"null"}],"title":"Expiry Date"},"punish_date":{"oneOf":[{"format":"date","type":"string"},{"type":"null"}],"title":"Punish Date"},"applicable_org":{"oneOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"title":"Applicable Org"},"applicable_scope":{"oneOf":[{"maxLength":500,"type":"string"},{"type":"null"}],"title":"Applicable Scope"}},"required":["source_table","id","title"],"title":"StaticDocumentRecord","type":"object"},{"type":"null"}],"description":"静态主体的描述投影，不作为授权或已确认效力的依据"},"title":{"maxLength":255,"minLength":1,"title":"Title","type":"string"},"business_ref":{"oneOf":[{"maxLength":255,"type":"string"},{"type":"null"}],"title":"Business Ref"},"aliases":{"items":{"type":"string"},"maxItems":50,"title":"Aliases","type":"array"},"organization":{"oneOf":[{"maxLength":255,"type":"string"},{"type":"null"}],"title":"Organization"},"edit_reason":{"maxLength":1000,"minLength":1,"title":"Edit Reason","type":"string"}},"required":["title","edit_reason"],"title":"EditDocument","type":"object"}},"required":["action","kb_id","document_id","payload"],"title":"EditKnowledgeDocument","type":"object"},{"additionalProperties":false,"properties":{"action":{"const":"list_documents","title":"Action","type":"string"},"kb_id":{"maxLength":32,"minLength":1,"title":"Kb Id","type":"string"},"cursor":{"default":"","maxLength":32,"title":"Cursor","type":"string"},"limit":{"default":50,"maximum":100,"minimum":1,"title":"Limit","type":"integer"}},"required":["action","kb_id"],"title":"ListKnowledgeDocuments","type":"object"},{"additionalProperties":false,"properties":{"action":{"const":"get_document","title":"Action","type":"string"},"kb_id":{"maxLength":32,"minLength":1,"title":"Kb Id","type":"string"},"document_id":{"maxLength":32,"minLength":1,"title":"Document Id","type":"string"},"revision":{"oneOf":[{"minimum":1,"type":"integer"},{"type":"null"}],"title":"Revision"}},"required":["action","kb_id","document_id"],"title":"GetKnowledgeDocument","type":"object"},{"additionalProperties":false,"properties":{"action":{"const":"list_versions","title":"Action","type":"string"},"kb_id":{"maxLength":32,"minLength":1,"title":"Kb Id","type":"string"},"document_id":{"maxLength":32,"minLength":1,"title":"Document Id","type":"string"},"cursor":{"default":"","maxLength":32,"title":"Cursor","type":"string"},"limit":{"default":50,"maximum":100,"minimum":1,"title":"Limit","type":"integer"}},"required":["action","kb_id","document_id"],"title":"ListKnowledgeVersions","type":"object"},{"additionalProperties":false,"properties":{"action":{"const":"get_version","title":"Action","type":"string"},"kb_id":{"maxLength":32,"minLength":1,"title":"Kb Id","type":"string"},"version_id":{"maxLength":32,"minLength":1,"title":"Version Id","type":"string"},"revision":{"oneOf":[{"minimum":1,"type":"integer"},{"type":"null"}],"title":"Revision"}},"required":["action","kb_id","version_id"],"title":"GetKnowledgeVersion","type":"object"},{"additionalProperties":false,"properties":{"action":{"const":"get_content","title":"Action","type":"string"},"kb_id":{"maxLength":32,"minLength":1,"title":"Kb Id","type":"string"},"version_id":{"maxLength":32,"minLength":1,"title":"Version Id","type":"string"},"content_revision_id":{"oneOf":[{"type":"string"},{"type":"null"}],"title":"Content Revision Id"}},"required":["action","kb_id","version_id"],"title":"GetKnowledgeContent","type":"object"},{"additionalProperties":false,"properties":{"action":{"const":"correct","title":"Action","type":"string"},"kb_id":{"maxLength":32,"minLength":1,"title":"Kb Id","type":"string"},"version_id":{"maxLength":32,"minLength":1,"title":"Version Id","type":"string"},"payload":{"additionalProperties":false,"properties":{"content_edits":{"items":{"additionalProperties":false,"properties":{"block_id":{"maxLength":128,"minLength":1,"title":"Block Id","type":"string"},"text":{"maxLength":100000,"title":"Text","type":"string"}},"required":["block_id","text"],"title":"ContentEdit","type":"object"},"maxItems":1000,"minItems":1,"title":"Content Edits","type":"array"},"edit_reason":{"maxLength":1000,"minLength":1,"title":"Edit Reason","type":"string"}},"required":["content_edits","edit_reason"],"title":"Correction","type":"object"}},"required":["action","kb_id","version_id","payload"],"title":"CorrectKnowledgeContent","type":"object"},{"additionalProperties":false,"properties":{"action":{"const":"confirm_content","title":"Action","type":"string"},"kb_id":{"maxLength":32,"minLength":1,"title":"Kb Id","type":"string"},"version_id":{"maxLength":32,"minLength":1,"title":"Version Id","type":"string"},"payload":{"additionalProperties":false,"description":"Confirm a particular text revision without declaring legal effectiveness.","properties":{"content_revision_id":{"maxLength":32,"minLength":1,"title":"Content Revision Id","type":"string"},"edit_reason":{"maxLength":1000,"minLength":1,"title":"Edit Reason","type":"string"}},"required":["content_revision_id","edit_reason"],"title":"ContentConfirmation","type":"object"}},"required":["action","kb_id","version_id","payload"],"title":"ConfirmKnowledgeContent","type":"object"},{"additionalProperties":false,"properties":{"action":{"const":"verify","title":"Action","type":"string"},"kb_id":{"maxLength":32,"minLength":1,"title":"Kb Id","type":"string"},"version_id":{"maxLength":32,"minLength":1,"title":"Version Id","type":"string"},"payload":{"additionalProperties":false,"properties":{"version_label":{"oneOf":[{"maxLength":128,"minLength":1,"type":"string"},{"type":"null"}],"title":"Version Label"},"publication_status":{"enum":["draft","released","withdrawn"],"title":"Publication Status","type":"string"},"issued_at":{"oneOf":[{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"null"}],"title":"Issued At"},"effective_from":{"oneOf":[{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"null"}],"title":"Effective From"},"effective_to":{"oneOf":[{"format":"date-time","type":"string"},{"format":"date","type":"string"},{"type":"null"}],"title":"Effective To"},"content_revision_id":{"maxLength":32,"minLength":1,"title":"Content Revision Id","type":"string"},"block_id":{"maxLength":128,"minLength":1,"title":"Block Id","type":"string"},"quote":{"maxLength":4000,"minLength":1,"title":"Quote","type":"string"},"basis":{"maxLength":4000,"minLength":1,"title":"Basis","type":"string"},"edit_reason":{"maxLength":1000,"minLength":1,"title":"Edit Reason","type":"string"}},"required":["publication_status","content_revision_id","block_id","quote","basis","edit_reason"],"title":"VersionVerification","type":"object"}},"required":["action","kb_id","version_id","payload"],"title":"VerifyKnowledgeVersion","type":"object"},{"additionalProperties":false,"properties":{"action":{"const":"remove_version","title":"Action","type":"string"},"kb_id":{"maxLength":32,"minLength":1,"title":"Kb Id","type":"string"},"version_id":{"maxLength":32,"minLength":1,"title":"Version Id","type":"string"},"payload":{"additionalProperties":false,"properties":{"edit_reason":{"maxLength":1000,"minLength":1,"title":"Edit Reason","type":"string"}},"required":["edit_reason"],"title":"RemoveVersion","type":"object"}},"required":["action","kb_id","version_id","payload"],"title":"RemoveKnowledgeVersion","type":"object"},{"additionalProperties":false,"properties":{"action":{"const":"remove_document","title":"Action","type":"string"},"kb_id":{"maxLength":32,"minLength":1,"title":"Kb Id","type":"string"},"document_id":{"maxLength":32,"minLength":1,"title":"Document Id","type":"string"},"payload":{"additionalProperties":false,"properties":{"edit_reason":{"maxLength":1000,"minLength":1,"title":"Edit Reason","type":"string"},"versions":{"items":{"additionalProperties":false,"properties":{"version_id":{"maxLength":32,"minLength":1,"title":"Version Id","type":"string"},"version_etag":{"maxLength":64,"minLength":1,"title":"Version Etag","type":"string"}},"required":["version_id","version_etag"],"title":"GroupingVersion","type":"object"},"maxItems":1000,"title":"Versions","type":"array"}},"required":["edit_reason","versions"],"title":"RemoveDocument","type":"object"}},"required":["action","kb_id","document_id","payload"],"title":"RemoveKnowledgeDocument","type":"object"},{"additionalProperties":false,"properties":{"action":{"const":"group","title":"Action","type":"string"},"kb_id":{"maxLength":32,"minLength":1,"title":"Kb Id","type":"string"},"payload":{"additionalProperties":false,"properties":{"predecessors":{"items":{"additionalProperties":false,"properties":{"version_id":{"maxLength":32,"minLength":1,"title":"Version Id","type":"string"},"predecessor_id":{"oneOf":[{"maxLength":32,"minLength":1,"type":"string"},{"type":"null"}],"title":"Predecessor Id"},"version_etag":{"maxLength":64,"minLength":1,"title":"Version Etag","type":"string"}},"required":["version_id","version_etag"],"title":"PredecessorChange","type":"object"},"maxItems":1000,"title":"Predecessors","type":"array"},"rejected_groupings":{"items":{"additionalProperties":false,"properties":{"relation_id":{"maxLength":32,"minLength":1,"title":"Relation Id","type":"string"},"relation_etag":{"maxLength":64,"minLength":1,"title":"Relation Etag","type":"string"}},"required":["relation_id","relation_etag"],"title":"GroupingRejection","type":"object"},"maxItems":1000,"title":"Rejected Groupings","type":"array"},"groupings":{"items":{"additionalProperties":false,"properties":{"versions":{"items":{"additionalProperties":false,"properties":{"version_id":{"maxLength":32,"minLength":1,"title":"Version Id","type":"string"},"version_etag":{"maxLength":64,"minLength":1,"title":"Version Etag","type":"string"}},"required":["version_id","version_etag"],"title":"GroupingVersion","type":"object"},"maxItems":1000,"minItems":1,"title":"Versions","type":"array"},"document_id":{"oneOf":[{"maxLength":32,"minLength":1,"type":"string"},{"type":"null"}],"title":"Document Id"},"document_etag":{"oneOf":[{"maxLength":64,"minLength":1,"type":"string"},{"type":"null"}],"title":"Document Etag"},"new_document":{"oneOf":[{"additionalProperties":false,"properties":{"source_record":{"oneOf":[{"additionalProperties":false,"properties":{"namespace":{"maxLength":128,"minLength":1,"title":"Namespace","type":"string"},"record_type":{"maxLength":64,"minLength":1,"title":"Record Type","type":"string"},"record_id":{"maxLength":256,"minLength":1,"title":"Record Id","type":"string"},"revision":{"oneOf":[{"maxLength":256,"minLength":1,"type":"string"},{"type":"null"}],"title":"Revision"},"parent_record_id":{"oneOf":[{"maxLength":256,"minLength":1,"type":"string"},{"type":"null"}],"title":"Parent Record Id"},"description":{"oneOf":[{"maxLength":4000,"type":"string"},{"type":"null"}],"title":"Description"}},"required":["namespace","record_type","record_id"],"title":"SourceRecord","type":"object"},{"type":"null"}]},"provided_record":{"oneOf":[{"additionalProperties":false,"properties":{"source_table":{"enum":["ca_law","ca_policy","ca_case"],"title":"Source Table","type":"string"},"id":{"pattern":"^[1-9][0-9]{0,18}$","title":"Id","type":"string"},"title":{"maxLength":500,"minLength":1,"title":"Title","type":"string"},"business_ref":{"oneOf":[{"maxLength":100,"type":"string"},{"type":"null"}],"title":"Business Ref"},"status":{"oneOf":[{"maxLength":32,"type":"string"},{"type":"null"}],"title":"Status"},"maintenance_status":{"oneOf":[{"maxLength":24,"type":"string"},{"type":"null"}],"title":"Maintenance Status"},"publish_date":{"oneOf":[{"format":"date","type":"string"},{"type":"null"}],"title":"Publish Date"},"effective_date":{"oneOf":[{"format":"date","type":"string"},{"type":"null"}],"title":"Effective Date"},"expiry_date":{"oneOf":[{"format":"date","type":"string"},{"type":"null"}],"title":"Expiry Date"},"punish_date":{"oneOf":[{"format":"date","type":"string"},{"type":"null"}],"title":"Punish Date"},"applicable_org":{"oneOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"title":"Applicable Org"},"applicable_scope":{"oneOf":[{"maxLength":500,"type":"string"},{"type":"null"}],"title":"Applicable Scope"}},"required":["source_table","id","title"],"title":"StaticDocumentRecord","type":"object"},{"type":"null"}],"description":"静态主体的描述投影，不作为授权或已确认效力的依据"},"title":{"maxLength":255,"minLength":1,"title":"Title","type":"string"},"business_ref":{"oneOf":[{"maxLength":255,"type":"string"},{"type":"null"}],"title":"Business Ref"},"aliases":{"items":{"type":"string"},"maxItems":50,"title":"Aliases","type":"array"}},"required":["title"],"title":"CreateDocument","type":"object"},{"type":"null"}]}},"required":["versions"],"title":"DocumentGrouping","type":"object"},"maxItems":1000,"title":"Groupings","type":"array"},"edit_reason":{"maxLength":1000,"minLength":1,"title":"Edit Reason","type":"string"},"import_id":{"oneOf":[{"maxLength":32,"minLength":1,"type":"string"},{"type":"null"}],"title":"Import Id"}},"required":["edit_reason"],"title":"LibraryRelations","type":"object"}},"required":["action","kb_id","payload"],"title":"GroupKnowledgeVersions","type":"object"},{"additionalProperties":false,"properties":{"action":{"const":"get_group","title":"Action","type":"string"},"kb_id":{"maxLength":32,"minLength":1,"title":"Kb Id","type":"string"},"relation_id":{"maxLength":32,"minLength":1,"title":"Relation Id","type":"string"},"revision":{"oneOf":[{"minimum":1,"type":"integer"},{"type":"null"}],"title":"Revision"}},"required":["action","kb_id","relation_id"],"title":"GetKnowledgeGroup","type":"object"},{"additionalProperties":false,"properties":{"action":{"const":"get_file","title":"Action","type":"string"},"kb_id":{"maxLength":32,"minLength":1,"title":"Kb Id","type":"string"},"file_id":{"maxLength":256,"minLength":1,"title":"File Id","type":"string"}},"required":["action","kb_id","file_id"],"title":"GetKnowledgeFile","type":"object"},{"additionalProperties":false,"properties":{"action":{"const":"revoke_file","title":"Action","type":"string"},"kb_id":{"maxLength":32,"minLength":1,"title":"Kb Id","type":"string"},"payload":{"additionalProperties":false,"properties":{"edit_reason":{"maxLength":1000,"minLength":1,"title":"Edit Reason","type":"string"}},"required":["edit_reason"],"title":"RevokeFile","type":"object"},"file_id":{"maxLength":256,"minLength":1,"title":"File Id","type":"string"}},"required":["action","kb_id","payload","file_id"],"title":"RevokeKnowledgeFile","type":"object"}],"title":"dkManageMaterialsInput"},"examples":{"ImportKnowledgeMaterials":{"summary":"import","value":{"action":"import","kb_id":"demo-base","payload":{"files":[{"source_id":"aiservice-documents","file_id":"101"}]}}},"GetKnowledgeImport":{"summary":"get_import","value":{"action":"get_import","kb_id":"demo-base","import_id":"demo-import_id"}},"RetryKnowledgeImport":{"summary":"retry_import","value":{"action":"retry_import","kb_id":"demo-base","import_id":"demo-import_id","payload":{"item_ids":["import-item"]}}},"CreateKnowledgeDocument":{"summary":"save_document（新增）","value":{"action":"save_document","kb_id":"demo-base","payload":{"title":"虚构采购制度"}}},"EditKnowledgeDocument":{"summary":"save_document（修改）","value":{"action":"save_document","kb_id":"demo-base","document_id":"demo-document_id","payload":{"title":"虚构采购制度","edit_reason":"核对虚构材料"}}},"ListKnowledgeDocuments":{"summary":"list_documents","value":{"action":"list_documents","kb_id":"demo-base"}},"GetKnowledgeDocument":{"summary":"get_document","value":{"action":"get_document","kb_id":"demo-base","document_id":"demo-document_id"}},"ListKnowledgeVersions":{"summary":"list_versions","value":{"action":"list_versions","kb_id":"demo-base","document_id":"demo-document_id"}},"GetKnowledgeVersion":{"summary":"get_version","value":{"action":"get_version","kb_id":"demo-base","version_id":"demo-version_id"}},"GetKnowledgeContent":{"summary":"get_content","value":{"action":"get_content","kb_id":"demo-base","version_id":"demo-version_id"}},"CorrectKnowledgeContent":{"summary":"correct","value":{"action":"correct","kb_id":"demo-base","version_id":"demo-version_id","payload":{"content_edits":[{"block_id":"clause","text":"核对后的虚构正文"}],"edit_reason":"核对虚构材料"}}},"ConfirmKnowledgeContent":{"summary":"confirm_content","value":{"action":"confirm_content","kb_id":"demo-base","version_id":"demo-version_id","payload":{"content_revision_id":"content-a","edit_reason":"核对虚构材料"}}},"VerifyKnowledgeVersion":{"summary":"verify","value":{"action":"verify","kb_id":"demo-base","version_id":"demo-version_id","payload":{"publication_status":"draft","content_revision_id":"content-a","block_id":"clause","quote":"虚构条款","basis":"依据所选虚构正文核对","edit_reason":"核对虚构材料"}}},"RemoveKnowledgeVersion":{"summary":"remove_version","value":{"action":"remove_version","kb_id":"demo-base","version_id":"demo-version_id","payload":{"edit_reason":"核对虚构材料"}}},"RemoveKnowledgeDocument":{"summary":"remove_document","value":{"action":"remove_document","kb_id":"demo-base","document_id":"demo-document_id","payload":{"versions":[{"version_id":"version-a","version_etag":"\"2\""}],"edit_reason":"核对虚构材料"}}},"GroupKnowledgeVersions":{"summary":"group","value":{"action":"group","kb_id":"demo-base","payload":{"predecessors":[{"version_id":"version-b","predecessor_id":"version-a","version_etag":"\"2\""}],"edit_reason":"核对虚构材料"}}},"GetKnowledgeGroup":{"summary":"get_group","value":{"action":"get_group","kb_id":"demo-base","relation_id":"demo-relation_id"}},"GetKnowledgeFile":{"summary":"get_file","value":{"action":"get_file","kb_id":"demo-base","file_id":"demo-file_id"}},"RevokeKnowledgeFile":{"summary":"revoke_file","value":{"action":"revoke_file","kb_id":"demo-base","payload":{"edit_reason":"核对虚构材料"},"file_id":"demo-file_id"}}}}}}}},"/open/v1/knowledge/impacts":{"post":{"tags":["7. 动态知识库"],"summary":"变化影响分析","description":"**接入前必读**：完整状态、效力、鉴权、异步及错误边界见动态知识库接入指南：`/swagger-ui/open-v1/docs/dynamic-knowledge`。\n\n**分支调用边界**：以下列出本页样例基础形态的权限与条件头；历史revision、confirmed标注、分组及参考稿保存的附加要求见各分支正文和接入指南，组合权限须同时具备。字段、类型、默认值、上限及互斥条件以本页请求Schema为准。业务响应no-store，写入后读取最新ETag，异步结果沿原任务入口取得。\n\n**AnalyzeKnowledgeImpact · action=analyze**：必填`action、kb_id、payload`；权限`dkWrite`；Idempotency-Key必填；If-Match不需要；成功HTTP 202。输入comparison_id，或完整from_version_id/to_version_id，两种方式互斥；显式正文修订须属于对应版本。candidate_version_ids为空时排查其他可见且正文就绪的版本，可能包含历史版本；非空时只检查指定候选。演示页默认自动查找，手工范围空选择不会隐式扩大。固定变更制度前后版及候选正文生成建议，返回范围和未分析缺口；候选不代表均需修改，不自动修改制度或确认模型结论。\n\n**GetKnowledgeImpact · action=get**：必填`action、kb_id、analysis_id`；权限`dkRead`；Idempotency-Key不需要；If-Match不需要；成功HTTP 200。返回analysis、可用comparison和items_page；items_cursor/items_limit独立翻页。include_changes=true才返回changes_page，变化游标与影响项游标不能混用。\n\n**DecideKnowledgeImpact · action=decide**：必填`action、kb_id、item_id、payload`；权限`dkConfirm`；Idempotency-Key必填；If-Match必填；成功HTTP 200。人工决定needs_change/no_change/needs_verification。needs_change须给proposed_text，空字符串表示删除该块；其他决定不允许携带改文。决定本身不会保存新B或批准原制度。\n\n**GetKnowledgeComparison · action=get_comparison**：必填`action、kb_id、comparison_id`；权限`dkRead`；Idempotency-Key不需要；If-Match不需要；成功HTTP 200。读取固定比较；include_changes=true遍历changes_page直到next_cursor=null。历史revision不能聚合当前变化；比较无变化也是合法结果。\n\n**共同限制**：ready不等于released，确认/快照发布不等于制度正式发布；旧来源撤权不能靠历史快照绕过。","operationId":"dkAnalyzeImpacts","responses":{"200":{"description":"请求已成功处理","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"oneOf":[{"type":"object","properties":{"analysis":{"type":"object","properties":{"id":{"type":"string"},"kb_id":{"type":"string"},"kind":{"type":"string"},"state":{"type":"string"},"parent_id":{"type":["string","null"]},"revision":{"type":"integer","minimum":1},"etag":{"type":"string"},"body":{"type":"object","description":"对应 kind 的固定修订内容；读取历史修订需要审计权限。"}},"required":["id","kb_id","kind","state","parent_id","revision","etag","body"]},"comparison":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"kb_id":{"type":"string"},"kind":{"type":"string"},"state":{"type":"string"},"parent_id":{"type":["string","null"]},"revision":{"type":"integer","minimum":1},"etag":{"type":"string"},"body":{"type":"object","description":"对应 kind 的固定修订内容；读取历史修订需要审计权限。"}},"required":["id","kb_id","kind","state","parent_id","revision","etag","body"]},{"type":"null"}]},"items_page":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kb_id":{"type":"string"},"kind":{"type":"string"},"state":{"type":"string"},"parent_id":{"type":["string","null"]},"revision":{"type":"integer","minimum":1},"etag":{"type":"string"},"body":{"type":"object","description":"对应 kind 的固定修订内容；读取历史修订需要审计权限。"}},"required":["id","kb_id","kind","state","parent_id","revision","etag","body"]}},"next_cursor":{"type":["string","null"]}},"required":["items","next_cursor"]},"changes_page":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kb_id":{"type":"string"},"kind":{"type":"string"},"state":{"type":"string"},"parent_id":{"type":["string","null"]},"revision":{"type":"integer","minimum":1},"etag":{"type":"string"},"body":{"type":"object","description":"对应 kind 的固定修订内容；读取历史修订需要审计权限。"}},"required":["id","kb_id","kind","state","parent_id","revision","etag","body"]}},"next_cursor":{"type":["string","null"]}},"required":["items","next_cursor"]},"action":{"const":"get"}},"required":["analysis","comparison","items_page","action"]},{"type":"object","properties":{"comparison":{"type":"object","properties":{"id":{"type":"string"},"kb_id":{"type":"string"},"kind":{"type":"string"},"state":{"type":"string"},"parent_id":{"type":["string","null"]},"revision":{"type":"integer","minimum":1},"etag":{"type":"string"},"body":{"type":"object","description":"对应 kind 的固定修订内容；读取历史修订需要审计权限。"}},"required":["id","kb_id","kind","state","parent_id","revision","etag","body"]},"changes_page":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kb_id":{"type":"string"},"kind":{"type":"string"},"state":{"type":"string"},"parent_id":{"type":["string","null"]},"revision":{"type":"integer","minimum":1},"etag":{"type":"string"},"body":{"type":"object","description":"对应 kind 的固定修订内容；读取历史修订需要审计权限。"}},"required":["id","kb_id","kind","state","parent_id","revision","etag","body"]}},"next_cursor":{"type":["string","null"]}},"required":["items","next_cursor"]},"action":{"const":"get_comparison"}},"required":["comparison","action"]},{"type":"object","properties":{"id":{"type":"string"},"kb_id":{"type":"string"},"kind":{"type":"string"},"state":{"type":"string"},"parent_id":{"type":["string","null"]},"revision":{"type":"integer","minimum":1},"etag":{"type":"string"},"body":{"type":"object","description":"对应 kind 的固定修订内容；读取历史修订需要审计权限。"},"action":{"const":"decide"}},"required":["id","kb_id","kind","state","parent_id","revision","etag","body","action"]}]},"error":{"type":"null"}}}]}}}},"202":{"description":"任务已受理；请使用 job_id 查询进度和结果","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","properties":{"job_id":{"type":"string"},"status":{"const":"queued"},"status_url":{"type":"string","pattern":"^/open/v1/job/[0-9a-f]{32}$","description":"查询任务状态，成功后在该地址追加 /result 读取结果。"},"etag":{"type":"string"},"analysis_id":{"type":"string"},"action":{"const":"analyze"}},"required":["job_id","status","status_url","analysis_id","action"]},"error":{"type":"null"}}}]}}},"headers":{"Location":{"description":"任务状态查询地址","schema":{"type":"string","example":"/open/v1/job/0123456789abcdef0123456789abcdef"}}},"links":{"查询任务进度":{"operationId":"getJob","parameters":{"job_id":"$response.body#/data/job_id"},"description":"使用本次返回的 job_id 查询任务进度。"},"读取任务结果":{"operationId":"getJobResult","parameters":{"job_id":"$response.body#/data/job_id"},"description":"任务 succeeded 后读取结构化结果。"}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"409":{"description":"幂等键、任务状态或资源状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"412":{"description":"资源修订已变化，请重新读取后提交","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"413":{"description":"请求体过大","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"422":{"description":"文件内容无法转换(已确认文件被截断、不完整,重传无效)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"428":{"description":"缺少资源修订前置条件 If-Match","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"429":{"description":"队列或模型并发额度已满，请稍后重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"dkRead","x-stability":"preview","x-alternative-scopes":["dkWrite","dkConfirm"],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":128},"description":"仅写操作必填；同一次业务动作重试保持原值。"},{"name":"If-Match","in":"header","required":false,"schema":{"type":"string"},"description":"修改、确认、撤销、纠错、索引设置和结构化新版保存必填；分组按对象ETag，指定批次另需本头部。"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"additionalProperties":false,"properties":{"action":{"const":"analyze","title":"Action","type":"string"},"kb_id":{"maxLength":32,"minLength":1,"title":"Kb Id","type":"string"},"payload":{"additionalProperties":false,"properties":{"comparison_id":{"oneOf":[{"maxLength":32,"minLength":1,"type":"string"},{"type":"null"}],"title":"Comparison Id"},"from_version_id":{"oneOf":[{"maxLength":32,"minLength":1,"type":"string"},{"type":"null"}],"title":"From Version Id"},"to_version_id":{"oneOf":[{"maxLength":32,"minLength":1,"type":"string"},{"type":"null"}],"title":"To Version Id"},"from_content_revision_id":{"oneOf":[{"maxLength":32,"minLength":1,"type":"string"},{"type":"null"}],"title":"From Content Revision Id"},"to_content_revision_id":{"oneOf":[{"maxLength":32,"minLength":1,"type":"string"},{"type":"null"}],"title":"To Content Revision Id"},"candidate_version_ids":{"items":{"type":"string"},"maxItems":100,"title":"Candidate Version Ids","type":"array"}},"title":"ImpactAnalysis","type":"object"}},"required":["action","kb_id","payload"],"title":"AnalyzeKnowledgeImpact","type":"object"},{"additionalProperties":false,"properties":{"action":{"const":"get","title":"Action","type":"string"},"kb_id":{"maxLength":32,"minLength":1,"title":"Kb Id","type":"string"},"analysis_id":{"maxLength":32,"minLength":1,"title":"Analysis Id","type":"string"},"items_cursor":{"default":"","maxLength":32,"title":"Items Cursor","type":"string"},"items_limit":{"default":50,"maximum":100,"minimum":1,"title":"Items Limit","type":"integer"},"include_changes":{"default":false,"title":"Include Changes","type":"boolean"},"changes_cursor":{"default":"","maxLength":32,"title":"Changes Cursor","type":"string"},"changes_limit":{"default":50,"maximum":100,"minimum":1,"title":"Changes Limit","type":"integer"}},"required":["action","kb_id","analysis_id"],"title":"GetKnowledgeImpact","type":"object"},{"additionalProperties":false,"properties":{"action":{"const":"decide","title":"Action","type":"string"},"kb_id":{"maxLength":32,"minLength":1,"title":"Kb Id","type":"string"},"item_id":{"maxLength":32,"minLength":1,"title":"Item Id","type":"string"},"payload":{"additionalProperties":false,"properties":{"decision":{"enum":["needs_change","no_change","needs_verification"],"title":"Decision","type":"string"},"rationale":{"maxLength":4000,"minLength":1,"title":"Rationale","type":"string"},"proposed_text":{"oneOf":[{"maxLength":100000,"type":"string"},{"type":"null"}],"title":"Proposed Text"}},"required":["decision","rationale"],"title":"ImpactDecision","type":"object"}},"required":["action","kb_id","item_id","payload"],"title":"DecideKnowledgeImpact","type":"object"},{"additionalProperties":false,"properties":{"action":{"const":"get_comparison","title":"Action","type":"string"},"kb_id":{"maxLength":32,"minLength":1,"title":"Kb Id","type":"string"},"comparison_id":{"maxLength":32,"minLength":1,"title":"Comparison Id","type":"string"},"revision":{"oneOf":[{"minimum":1,"type":"integer"},{"type":"null"}],"title":"Revision"},"include_changes":{"default":false,"title":"Include Changes","type":"boolean"},"changes_cursor":{"default":"","maxLength":32,"title":"Changes Cursor","type":"string"},"changes_limit":{"default":50,"maximum":100,"minimum":1,"title":"Changes Limit","type":"integer"}},"required":["action","kb_id","comparison_id"],"title":"GetKnowledgeComparison","type":"object"}],"title":"dkAnalyzeImpactsInput"},"examples":{"AnalyzeKnowledgeImpact":{"summary":"analyze","value":{"action":"analyze","kb_id":"demo-base","payload":{"from_version_id":"version-a","to_version_id":"version-b"}}},"GetKnowledgeImpact":{"summary":"get","value":{"action":"get","kb_id":"demo-base","analysis_id":"demo-analysis_id"}},"DecideKnowledgeImpact":{"summary":"decide","value":{"action":"decide","kb_id":"demo-base","item_id":"demo-item_id","payload":{"decision":"no_change","rationale":"已按虚构原文核实"}}},"GetKnowledgeComparison":{"summary":"get_comparison","value":{"action":"get_comparison","kb_id":"demo-base","comparison_id":"demo-comparison_id"}}}}}}}},"/open/v1/knowledge/revisions":{"post":{"tags":["7. 动态知识库"],"summary":"制度修订","description":"**接入前必读**：完整状态、效力、鉴权、异步及错误边界见动态知识库接入指南：`/swagger-ui/open-v1/docs/dynamic-knowledge`。\n\n**分支调用边界**：以下列出本页样例基础形态的权限与条件头；历史revision、confirmed标注、分组及参考稿保存的附加要求见各分支正文和接入指南，组合权限须同时具备。字段、类型、默认值、上限及互斥条件以本页请求Schema为准。业务响应no-store，写入后读取最新ETag，异步结果沿原任务入口取得。\n\n**GenerateRegulationRevision · action=generate**：必填`action、kb_id、payload`；权限`dkWrite`；Idempotency-Key必填；If-Match不需要；成功HTTP 202。analysis须ready，base_version_id须属于本次待修订候选。references可空，最多100项；每项file_ref、version_ref、structured_comparison三选一，role为comparison或supplement，结构化输入仅允许role=comparison。version_ref包含version_id和content_revision_id，读取同库当前就绪正文并固定修订及来源权限；版本或正文修订改变后须重新选择并生成，读取旧稿和保存也会复核。待确认资料可仅用于本次修订，不自动加入问答。结构化引文须匹配本次变更后制度及待修订原文。structured_comparison.provided_record可携带schema_version=V1.0.3或V1.1.0的人工导出快照，含files显式任务文件/本地条款映射及implicit_pairs/comparisons/composites。SDK文件ID不是本地版本ID；每个任务须绑定上位及待修订双方，综合建议只能引用同任务同内规条款的冲突。过时、被替代、错文件/条款或缺冲突引用拒绝。完整分析、建议及修订条文进入本次参考，仍受输入/模型预算限制，不静默截断。快照未在线核实，不授予权限、不自动确认关系或发布制度；正式二期查询服务尚未接入。生成完整参考稿供审阅，不覆盖原文、不自动采纳外部意见。\n\n**GenerateDirectRegulationRevision · action=generate**：必填`action、payload、input_mode`；权限`dkWrite`；Idempotency-Key必填；If-Match不需要；成功HTTP 202。显式input_mode=direct，payload提交baseline_id、clauses(id/text)、references(id/title/source_description/text)、problem及可选context/instructions。无需kb_id、analysis_id或版本对象；不能混用内部对象引用。dkWrite和Idempotency-Key必需。返回202、input_mode、baseline_id、job_id/status_url，不产生draft_id；沿原GET /open/v1/job/{job_id}及/result查询。每项operation给出原文位置、before_text、新文、理由、逐字引用及pending状态；gaps列资料缺口。引用块id固定为text。可在下一次提交中附previous_suggestion及adjustment_instructions，保留相同基准但使用新幂等键。只生成建议，不自动采纳、建库或进入记忆/检索；正式保存由调用方负责。宿主由现有Key、dkWrite与Space状态授权，后台执行与读取持续核验当前Key。\n\n**ApplyDirectRegulationRevision · action=apply**：必填`action、payload、input_mode`；权限`dkWrite`；Idempotency-Key必填；If-Match不需要；成功HTTP 200。input_mode=direct，提交baseline_id、完整document和operations，仅应用accepted项。同步200返回正文、实际events与revision_notes；原文不符或操作冲突整次拒绝。可选numbering按chinese_article/arabic_article重排顶层条编号，返回number_mapping、reference_updates和reference_review_items；默认只自动处理明确的本文引用，有歧义、外部文件、范围或新增改写内容中的引用保留待复核。位置为UTF-16单位，同时给出引用调整前后位置；编号与引用调整均入实际记录。省略numbering保留原编号。详见ApplyWithNumbering样例及接入指南。无需建库或先generate，不调用模型、不保存正式版本；dkWrite及Idempotency-Key必需，计算不保存幂等键。组装后的完整document同样最多1000块；自动编号及引用调整后的最终文档、每个中间事件快照均重新校验，每块正文最多100000字符，超限返回不可重试的422 input_invalid且不返回部分结果；范围外最终编号按已应用修订后的正文与number识别，冲突整次拒绝。实际事件、引用调整和待复核清单分别最多3000项，跨块累计；生成超限返回413且不返回部分结果。由现有Key、dkWrite与Space状态授权，无额外环境准入。外部保存仍须检查版本。\n\n**GetRegulationRevision · action=get**：必填`action、kb_id、draft_id`；权限`dkRead`；Idempotency-Key不需要；If-Match不需要；成功HTTP 200。读取参考稿、完整blocks、operations/gaps及save_context；影响项处理决定变化时仍可只读回看，read_only_reason说明原因且save_context为空，不能继续审阅或保存。基准或固定来源变化仍可能409，撤权仍拒绝。save_context为空不能自行构造保存依据；已保存版本仍可回看。\n\n**ReviewRegulationRevision · action=review**：必填`action、kb_id、draft_id、payload`；权限`dkConfirm`；Idempotency-Key必填；If-Match必填；成功HTTP 200。审阅操作为pending/accepted/rejected/needs_verification，保存审阅后重新组装完整稿。删除既有缺口须给gap_resolution；已提交新版本的稿件不能继续修改。审阅不等于新版本已保存。\n\n**SaveRegulationRevision · action=save**：必填`action、kb_id、document_id、payload`；权限`dkWrite`；Idempotency-Key必填；If-Match文件形态不需要，结构化/参考稿形态必填；成功HTTP 202。三选一：source_ref文件；base_version_id+content_edits结构化修改；base_version_id+reference_draft_id+reference_draft_etag保存已审阅稿。version_label必填。文件形态要求dkWrite；结构化修改另须基准版本If-Match；参考稿保存同时要求dkWrite+dkConfirm、基准版本If-Match和稿件reference_draft_etag。基准、前驱须属于本主体；不允许无已接受实际改动的重复参考版。write_back=true当前422拒绝，不创建版本或任务。新版本默认草稿；保存、审阅、索引快照成功均不等于制度正式发布。\n\n**RetryRegulationRevision · action=retry_save**：必填`action、kb_id、draft_id、payload`；权限`dkConfirm+dkWrite`；Idempotency-Key必填；If-Match必填；成功HTTP 202。只恢复已有参考稿中失败/取消的版本保存任务；原任务仍运行时应继续轮询。复用已生成版本，不再次创建B；基准、来源或决定变化时拒绝，需重新分析。\n\n**共同限制**：ready不等于released，确认/快照发布不等于制度正式发布；旧来源撤权不能靠历史快照绕过。","operationId":"dkReviseRegulations","responses":{"200":{"description":"请求已成功处理","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"kb_id":{"type":"string"},"kind":{"type":"string"},"state":{"type":"string"},"parent_id":{"type":["string","null"]},"revision":{"type":"integer","minimum":1},"etag":{"type":"string"},"body":{"type":"object","description":"对应 kind 的固定修订内容；读取历史修订需要审计权限。"},"read_only_reason":{"type":["string","null"],"description":"历史参考稿不可继续审阅或保存的原因；非空时save_context为空。固定来源变化或撤权仍拒绝读取。"},"save_context":{"type":["object","null"],"properties":{"document_id":{"type":"string"},"base_version_id":{"type":"string"},"base_version_etag":{"type":"string"},"content_revision_id":{"type":"string"},"draft_etag":{"type":"string"}},"required":["document_id","base_version_id","base_version_etag","content_revision_id","draft_etag"]},"action":{"const":"get"}},"required":["id","kb_id","kind","state","parent_id","revision","etag","body","save_context","action"]},{"type":"object","properties":{"id":{"type":"string"},"kb_id":{"type":"string"},"kind":{"type":"string"},"state":{"type":"string"},"parent_id":{"type":["string","null"]},"revision":{"type":"integer","minimum":1},"etag":{"type":"string"},"body":{"type":"object","description":"对应 kind 的固定修订内容；读取历史修订需要审计权限。"},"action":{"const":"review"}},"required":["id","kb_id","kind","state","parent_id","revision","etag","body","action"]},{"additionalProperties":false,"properties":{"action":{"const":"apply"},"input_mode":{"const":"direct","default":"direct","title":"Input Mode","type":"string"},"baseline_id":{"title":"Baseline Id","type":"string"},"result_id":{"title":"Result Id","type":"string"},"baseline_fingerprint":{"title":"Baseline Fingerprint","type":"string"},"result_fingerprint":{"title":"Result Fingerprint","type":"string"},"document":{"additionalProperties":false,"properties":{"title":{"oneOf":[{"maxLength":1000,"type":"string"},{"type":"null"}],"title":"Title"},"blocks":{"items":{"additionalProperties":false,"properties":{"id":{"maxLength":128,"minLength":1,"title":"Id","type":"string"},"type":{"default":"paragraph","enum":["paragraph","heading","table","formula"],"title":"Type","type":"string"},"text":{"maxLength":100000,"title":"Text","type":"string"},"section_path":{"items":{"type":"string"},"maxItems":32,"title":"Section Path","type":"array"},"table_cells":{"items":{"additionalProperties":true,"type":"object"},"maxItems":10000,"title":"Table Cells","type":"array"},"source_anchor":{"additionalProperties":false,"properties":{"page":{"oneOf":[{"minimum":1,"type":"integer"},{"type":"null"}],"title":"Page"},"bbox":{"oneOf":[{"maxItems":4,"minItems":4,"prefixItems":[{"type":"number"},{"type":"number"},{"type":"number"},{"type":"number"}],"type":"array"},{"type":"null"}],"title":"Bbox"},"coordinate_system":{"oneOf":[{"type":"string"},{"type":"null"}],"title":"Coordinate System"},"char_start":{"oneOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"title":"Char Start"},"char_end":{"oneOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"title":"Char End"},"table_row":{"oneOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"title":"Table Row"},"table_column":{"oneOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"title":"Table Column"}},"title":"SourceAnchor","type":"object"},"parent_id":{"oneOf":[{"type":"string"},{"type":"null"}],"title":"Parent Id"},"number":{"oneOf":[{"maxLength":128,"type":"string"},{"type":"null"}],"title":"Number"}},"required":["id","text"],"title":"ApplyBlock","type":"object"},"maxItems":1000,"minItems":1,"title":"Blocks","type":"array"}},"required":["blocks"],"title":"ApplyDocument","type":"object"},"events":{"items":{"additionalProperties":false,"properties":{"event_id":{"title":"Event Id","type":"string"},"operation_id":{"title":"Operation Id","type":"string"},"operation":{"enum":["replace","delete","insert_after","renumber","update_reference"],"title":"Operation","type":"string"},"block_id":{"title":"Block Id","type":"string"},"anchor_block_id":{"oneOf":[{"type":"string"},{"type":"null"}],"title":"Anchor Block Id"},"before":{"oneOf":[{"additionalProperties":false,"properties":{"id":{"maxLength":128,"minLength":1,"title":"Id","type":"string"},"type":{"default":"paragraph","enum":["paragraph","heading","table","formula"],"title":"Type","type":"string"},"text":{"maxLength":100000,"title":"Text","type":"string"},"section_path":{"items":{"type":"string"},"maxItems":32,"title":"Section Path","type":"array"},"table_cells":{"items":{"additionalProperties":true,"type":"object"},"maxItems":10000,"title":"Table Cells","type":"array"},"source_anchor":{"additionalProperties":false,"properties":{"page":{"oneOf":[{"minimum":1,"type":"integer"},{"type":"null"}],"title":"Page"},"bbox":{"oneOf":[{"maxItems":4,"minItems":4,"prefixItems":[{"type":"number"},{"type":"number"},{"type":"number"},{"type":"number"}],"type":"array"},{"type":"null"}],"title":"Bbox"},"coordinate_system":{"oneOf":[{"type":"string"},{"type":"null"}],"title":"Coordinate System"},"char_start":{"oneOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"title":"Char Start"},"char_end":{"oneOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"title":"Char End"},"table_row":{"oneOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"title":"Table Row"},"table_column":{"oneOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"title":"Table Column"}},"title":"SourceAnchor","type":"object"},"parent_id":{"oneOf":[{"type":"string"},{"type":"null"}],"title":"Parent Id"},"number":{"oneOf":[{"maxLength":128,"type":"string"},{"type":"null"}],"title":"Number"}},"required":["id","text"],"title":"ApplyBlock","type":"object"},{"type":"null"}]},"after":{"oneOf":[{"additionalProperties":false,"properties":{"id":{"maxLength":128,"minLength":1,"title":"Id","type":"string"},"type":{"default":"paragraph","enum":["paragraph","heading","table","formula"],"title":"Type","type":"string"},"text":{"maxLength":100000,"title":"Text","type":"string"},"section_path":{"items":{"type":"string"},"maxItems":32,"title":"Section Path","type":"array"},"table_cells":{"items":{"additionalProperties":true,"type":"object"},"maxItems":10000,"title":"Table Cells","type":"array"},"source_anchor":{"additionalProperties":false,"properties":{"page":{"oneOf":[{"minimum":1,"type":"integer"},{"type":"null"}],"title":"Page"},"bbox":{"oneOf":[{"maxItems":4,"minItems":4,"prefixItems":[{"type":"number"},{"type":"number"},{"type":"number"},{"type":"number"}],"type":"array"},{"type":"null"}],"title":"Bbox"},"coordinate_system":{"oneOf":[{"type":"string"},{"type":"null"}],"title":"Coordinate System"},"char_start":{"oneOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"title":"Char Start"},"char_end":{"oneOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"title":"Char End"},"table_row":{"oneOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"title":"Table Row"},"table_column":{"oneOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"title":"Table Column"}},"title":"SourceAnchor","type":"object"},"parent_id":{"oneOf":[{"type":"string"},{"type":"null"}],"title":"Parent Id"},"number":{"oneOf":[{"maxLength":128,"type":"string"},{"type":"null"}],"title":"Number"}},"required":["id","text"],"title":"ApplyBlock","type":"object"},{"type":"null"}]},"rationale":{"oneOf":[{"type":"string"},{"type":"null"}],"title":"Rationale"},"citations":{"items":{"additionalProperties":false,"properties":{"reference_id":{"maxLength":128,"minLength":1,"title":"Reference Id","type":"string"},"block_id":{"maxLength":128,"minLength":1,"title":"Block Id","type":"string"},"quote":{"maxLength":100000,"minLength":1,"title":"Quote","type":"string"}},"required":["reference_id","block_id","quote"],"title":"DraftCitation","type":"object"},"title":"Citations","type":"array"},"reference_updates":{"items":{"additionalProperties":false,"properties":{"block_id":{"title":"Block Id","type":"string"},"field":{"enum":["text","table_cells.text"],"title":"Field","type":"string"},"cell_index":{"oneOf":[{"type":"integer"},{"type":"null"}],"title":"Cell Index"},"offset_unit":{"const":"utf-16-code-unit","default":"utf-16-code-unit","title":"Offset Unit","type":"string"},"source_start":{"title":"Source Start","type":"integer"},"source_end":{"title":"Source End","type":"integer"},"result_start":{"title":"Result Start","type":"integer"},"result_end":{"title":"Result End","type":"integer"},"quote":{"title":"Quote","type":"string"},"target_block_id":{"title":"Target Block Id","type":"string"},"replacement":{"title":"Replacement","type":"string"}},"required":["block_id","field","cell_index","source_start","source_end","result_start","result_end","quote","target_block_id","replacement"],"title":"ReferenceUpdate","type":"object"},"maxItems":3000,"title":"Reference Updates","type":"array"},"reference_review_items":{"items":{"additionalProperties":false,"properties":{"block_id":{"title":"Block Id","type":"string"},"field":{"enum":["text","table_cells.text"],"title":"Field","type":"string"},"cell_index":{"oneOf":[{"type":"integer"},{"type":"null"}],"title":"Cell Index"},"offset_unit":{"const":"utf-16-code-unit","default":"utf-16-code-unit","title":"Offset Unit","type":"string"},"source_start":{"title":"Source Start","type":"integer"},"source_end":{"title":"Source End","type":"integer"},"result_start":{"title":"Result Start","type":"integer"},"result_end":{"title":"Result End","type":"integer"},"quote":{"title":"Quote","type":"string"},"reason":{"enum":["ambiguous_target","target_deleted","unresolved_target","unqualified_reference","external_reference","compound_reference","quoted_reference","changed_source"],"title":"Reason","type":"string"},"candidate_block_ids":{"items":{"type":"string"},"title":"Candidate Block Ids","type":"array"},"message":{"title":"Message","type":"string"}},"required":["block_id","field","cell_index","source_start","source_end","result_start","result_end","quote","reason","candidate_block_ids","message"],"title":"ReferenceReview","type":"object"},"maxItems":3000,"title":"Reference Review Items","type":"array"}},"required":["event_id","operation_id","operation","block_id","anchor_block_id","before","after","rationale","citations"],"title":"AppliedEvent","type":"object"},"maxItems":3000,"title":"Events","type":"array"},"revision_notes":{"additionalProperties":false,"properties":{"baseline_id":{"title":"Baseline Id","type":"string"},"result_id":{"title":"Result Id","type":"string"},"summary":{"additionalProperties":false,"properties":{"total":{"title":"Total","type":"integer"},"replace":{"title":"Replace","type":"integer"},"delete":{"title":"Delete","type":"integer"},"insert_after":{"title":"Insert After","type":"integer"},"renumber":{"default":0,"title":"Renumber","type":"integer"},"update_reference":{"default":0,"title":"Update Reference","type":"integer"}},"required":["total","replace","delete","insert_after"],"title":"RevisionSummary","type":"object"},"rows":{"items":{"additionalProperties":false,"properties":{"event_id":{"title":"Event Id","type":"string"},"operation_id":{"title":"Operation Id","type":"string"},"operation":{"enum":["replace","delete","insert_after","renumber","update_reference"],"title":"Operation","type":"string"},"block_id":{"title":"Block Id","type":"string"},"before_text":{"oneOf":[{"type":"string"},{"type":"null"}],"title":"Before Text"},"after_text":{"oneOf":[{"type":"string"},{"type":"null"}],"title":"After Text"},"before_number":{"oneOf":[{"type":"string"},{"type":"null"}],"title":"Before Number"},"after_number":{"oneOf":[{"type":"string"},{"type":"null"}],"title":"After Number"},"rationale":{"oneOf":[{"type":"string"},{"type":"null"}],"title":"Rationale"},"citations":{"items":{"additionalProperties":false,"properties":{"reference_id":{"maxLength":128,"minLength":1,"title":"Reference Id","type":"string"},"block_id":{"maxLength":128,"minLength":1,"title":"Block Id","type":"string"},"quote":{"maxLength":100000,"minLength":1,"title":"Quote","type":"string"}},"required":["reference_id","block_id","quote"],"title":"DraftCitation","type":"object"},"title":"Citations","type":"array"},"reference_updates":{"items":{"additionalProperties":false,"properties":{"block_id":{"title":"Block Id","type":"string"},"field":{"enum":["text","table_cells.text"],"title":"Field","type":"string"},"cell_index":{"oneOf":[{"type":"integer"},{"type":"null"}],"title":"Cell Index"},"offset_unit":{"const":"utf-16-code-unit","default":"utf-16-code-unit","title":"Offset Unit","type":"string"},"source_start":{"title":"Source Start","type":"integer"},"source_end":{"title":"Source End","type":"integer"},"result_start":{"title":"Result Start","type":"integer"},"result_end":{"title":"Result End","type":"integer"},"quote":{"title":"Quote","type":"string"},"target_block_id":{"title":"Target Block Id","type":"string"},"replacement":{"title":"Replacement","type":"string"}},"required":["block_id","field","cell_index","source_start","source_end","result_start","result_end","quote","target_block_id","replacement"],"title":"ReferenceUpdate","type":"object"},"title":"Reference Updates","type":"array"}},"required":["event_id","operation_id","operation","block_id","before_text","after_text","before_number","after_number","rationale","citations"],"title":"RevisionRow","type":"object"},"title":"Rows","type":"array"},"references":{"items":{"additionalProperties":false,"properties":{"id":{"maxLength":128,"minLength":1,"title":"Id","type":"string"},"text":{"maxLength":100000,"minLength":1,"title":"Text","type":"string"},"title":{"maxLength":255,"minLength":1,"title":"Title","type":"string"},"source_description":{"maxLength":4000,"minLength":1,"title":"Source Description","type":"string"}},"required":["id","text","title","source_description"],"title":"DirectReference","type":"object"},"title":"References","type":"array"},"unresolved_items":{"items":{"additionalProperties":false,"properties":{"block_id":{"title":"Block Id","type":"string"},"field":{"enum":["text","table_cells.text"],"title":"Field","type":"string"},"cell_index":{"oneOf":[{"type":"integer"},{"type":"null"}],"title":"Cell Index"},"offset_unit":{"const":"utf-16-code-unit","default":"utf-16-code-unit","title":"Offset Unit","type":"string"},"source_start":{"title":"Source Start","type":"integer"},"source_end":{"title":"Source End","type":"integer"},"result_start":{"title":"Result Start","type":"integer"},"result_end":{"title":"Result End","type":"integer"},"quote":{"title":"Quote","type":"string"},"reason":{"enum":["ambiguous_target","target_deleted","unresolved_target","unqualified_reference","external_reference","compound_reference","quoted_reference","changed_source"],"title":"Reason","type":"string"},"candidate_block_ids":{"items":{"type":"string"},"title":"Candidate Block Ids","type":"array"},"message":{"title":"Message","type":"string"}},"required":["block_id","field","cell_index","source_start","source_end","result_start","result_end","quote","reason","candidate_block_ids","message"],"title":"ReferenceReview","type":"object"},"title":"Unresolved Items","type":"array"}},"required":["baseline_id","result_id","summary","rows","references"],"title":"RevisionRecord","type":"object"},"unapplied_operations":{"items":{"additionalProperties":false,"properties":{"id":{"title":"Id","type":"string"},"decision":{"enum":["pending","rejected","needs_verification"],"title":"Decision","type":"string"}},"required":["id","decision"],"title":"UnappliedOperation","type":"object"},"title":"Unapplied Operations","type":"array"},"number_mapping":{"items":{"additionalProperties":false,"properties":{"block_id":{"title":"Block Id","type":"string"},"before_number":{"oneOf":[{"type":"string"},{"type":"null"}],"title":"Before Number"},"after_number":{"oneOf":[{"type":"string"},{"type":"null"}],"title":"After Number"}},"required":["block_id","before_number","after_number"],"title":"NumberMapping","type":"object"},"title":"Number Mapping","type":"array"},"reference_updates":{"items":{"additionalProperties":false,"properties":{"block_id":{"title":"Block Id","type":"string"},"field":{"enum":["text","table_cells.text"],"title":"Field","type":"string"},"cell_index":{"oneOf":[{"type":"integer"},{"type":"null"}],"title":"Cell Index"},"offset_unit":{"const":"utf-16-code-unit","default":"utf-16-code-unit","title":"Offset Unit","type":"string"},"source_start":{"title":"Source Start","type":"integer"},"source_end":{"title":"Source End","type":"integer"},"result_start":{"title":"Result Start","type":"integer"},"result_end":{"title":"Result End","type":"integer"},"quote":{"title":"Quote","type":"string"},"target_block_id":{"title":"Target Block Id","type":"string"},"replacement":{"title":"Replacement","type":"string"}},"required":["block_id","field","cell_index","source_start","source_end","result_start","result_end","quote","target_block_id","replacement"],"title":"ReferenceUpdate","type":"object"},"maxItems":3000,"title":"Reference Updates","type":"array"},"reference_review_items":{"items":{"additionalProperties":false,"properties":{"block_id":{"title":"Block Id","type":"string"},"field":{"enum":["text","table_cells.text"],"title":"Field","type":"string"},"cell_index":{"oneOf":[{"type":"integer"},{"type":"null"}],"title":"Cell Index"},"offset_unit":{"const":"utf-16-code-unit","default":"utf-16-code-unit","title":"Offset Unit","type":"string"},"source_start":{"title":"Source Start","type":"integer"},"source_end":{"title":"Source End","type":"integer"},"result_start":{"title":"Result Start","type":"integer"},"result_end":{"title":"Result End","type":"integer"},"quote":{"title":"Quote","type":"string"},"reason":{"enum":["ambiguous_target","target_deleted","unresolved_target","unqualified_reference","external_reference","compound_reference","quoted_reference","changed_source"],"title":"Reason","type":"string"},"candidate_block_ids":{"items":{"type":"string"},"title":"Candidate Block Ids","type":"array"},"message":{"title":"Message","type":"string"}},"required":["block_id","field","cell_index","source_start","source_end","result_start","result_end","quote","reason","candidate_block_ids","message"],"title":"ReferenceReview","type":"object"},"maxItems":3000,"title":"Reference Review Items","type":"array"}},"required":["baseline_id","result_id","baseline_fingerprint","result_fingerprint","document","events","revision_notes","unapplied_operations","number_mapping","reference_updates","reference_review_items","action"],"title":"DirectApplyResult","type":"object"}]},"error":{"type":"null"}}}]}}}},"202":{"description":"任务已受理；请使用 job_id 查询进度和结果","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"oneOf":[{"type":"object","properties":{"job_id":{"type":"string"},"status":{"const":"queued"},"status_url":{"type":"string","pattern":"^/open/v1/job/[0-9a-f]{32}$","description":"查询任务状态，成功后在该地址追加 /result 读取结果。"},"etag":{"type":"string"},"draft_id":{"type":"string"},"input_mode":{"type":"null"},"action":{"const":"generate"}},"required":["job_id","status","status_url","draft_id","action"]},{"type":"object","properties":{"job_id":{"type":"string"},"status":{"const":"queued"},"status_url":{"type":"string","pattern":"^/open/v1/job/[0-9a-f]{32}$","description":"查询任务状态，成功后在该地址追加 /result 读取结果。"},"etag":{"type":"string"},"input_mode":{"const":"direct"},"baseline_id":{"type":"string"},"action":{"const":"generate"}},"required":["job_id","status","status_url","input_mode","baseline_id","action"],"additionalProperties":false},{"type":"object","properties":{"job_id":{"type":"string"},"status":{"const":"queued"},"status_url":{"type":"string","pattern":"^/open/v1/job/[0-9a-f]{32}$","description":"查询任务状态，成功后在该地址追加 /result 读取结果。"},"etag":{"type":"string"},"version_id":{"type":"string"},"action":{"const":"save"}},"required":["job_id","status","status_url","version_id","action"]},{"type":"object","properties":{"job_id":{"type":"string"},"status":{"const":"queued"},"status_url":{"type":"string","pattern":"^/open/v1/job/[0-9a-f]{32}$","description":"查询任务状态，成功后在该地址追加 /result 读取结果。"},"etag":{"type":"string"},"version_id":{"type":"string"},"action":{"const":"retry_save"}},"required":["job_id","status","status_url","version_id","action"]}]},"error":{"type":"null"}}}]}}},"headers":{"Location":{"description":"任务状态查询地址","schema":{"type":"string","example":"/open/v1/job/0123456789abcdef0123456789abcdef"}}},"links":{"查询任务进度":{"operationId":"getJob","parameters":{"job_id":"$response.body#/data/job_id"},"description":"使用本次返回的 job_id 查询任务进度。"},"读取任务结果":{"operationId":"getJobResult","parameters":{"job_id":"$response.body#/data/job_id"},"description":"任务 succeeded 后读取结构化结果。"}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"409":{"description":"幂等键、任务状态或资源状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"412":{"description":"资源修订已变化，请重新读取后提交","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"413":{"description":"请求体过大","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"422":{"description":"文件内容无法转换(已确认文件被截断、不完整,重传无效)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"428":{"description":"缺少资源修订前置条件 If-Match","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"429":{"description":"队列或模型并发额度已满，请稍后重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"dkRead","x-stability":"preview","x-alternative-scopes":["dkWrite","dkConfirm"],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":128},"description":"仅写操作必填；同一次业务动作重试保持原值。"},{"name":"If-Match","in":"header","required":false,"schema":{"type":"string"},"description":"修改、确认、撤销、纠错、索引设置和结构化新版保存必填；分组按对象ETag，指定批次另需本头部。"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"additionalProperties":false,"properties":{"action":{"const":"generate","title":"Action","type":"string"},"kb_id":{"maxLength":32,"minLength":1,"title":"Kb Id","type":"string"},"payload":{"additionalProperties":false,"properties":{"analysis_id":{"maxLength":32,"minLength":1,"title":"Analysis Id","type":"string"},"base_version_id":{"maxLength":32,"minLength":1,"title":"Base Version Id","type":"string"},"references":{"items":{"additionalProperties":false,"properties":{"title":{"maxLength":255,"minLength":1,"title":"Title","type":"string"},"role":{"enum":["comparison","supplement"],"title":"Role","type":"string"},"file_ref":{"oneOf":[{"additionalProperties":false,"properties":{"source_id":{"maxLength":128,"minLength":1,"pattern":"^[A-Za-z0-9_.-]+$","title":"Source Id","type":"string"},"file_id":{"maxLength":256,"minLength":1,"title":"File Id","type":"string"},"source_revision":{"oneOf":[{"maxLength":256,"minLength":1,"type":"string"},{"type":"null"}],"title":"Source Revision"}},"required":["source_id","file_id"],"title":"FileRef","type":"object"},{"type":"null"}]},"version_ref":{"oneOf":[{"additionalProperties":false,"properties":{"version_id":{"maxLength":32,"minLength":1,"title":"Version Id","type":"string"},"content_revision_id":{"maxLength":32,"minLength":1,"title":"Content Revision Id","type":"string"}},"required":["version_id","content_revision_id"],"title":"VersionReference","type":"object"},{"type":"null"}]},"structured_comparison":{"oneOf":[{"additionalProperties":false,"properties":{"source_record":{"oneOf":[{"additionalProperties":false,"properties":{"namespace":{"maxLength":128,"minLength":1,"title":"Namespace","type":"string"},"record_type":{"maxLength":64,"minLength":1,"title":"Record Type","type":"string"},"record_id":{"maxLength":256,"minLength":1,"title":"Record Id","type":"string"},"revision":{"oneOf":[{"maxLength":256,"minLength":1,"type":"string"},{"type":"null"}],"title":"Revision"},"parent_record_id":{"oneOf":[{"maxLength":256,"minLength":1,"type":"string"},{"type":"null"}],"title":"Parent Record Id"},"description":{"oneOf":[{"maxLength":4000,"type":"string"},{"type":"null"}],"title":"Description"}},"required":["namespace","record_type","record_id"],"title":"SourceRecord","type":"object"},{"type":"null"}]},"upstream_version_id":{"maxLength":32,"minLength":1,"title":"Upstream Version Id","type":"string"},"upstream_content_revision_id":{"maxLength":32,"minLength":1,"title":"Upstream Content Revision Id","type":"string"},"downstream_version_id":{"maxLength":32,"minLength":1,"title":"Downstream Version Id","type":"string"},"downstream_content_revision_id":{"maxLength":32,"minLength":1,"title":"Downstream Content Revision Id","type":"string"},"items":{"items":{"additionalProperties":false,"properties":{"upstream_block_id":{"maxLength":128,"minLength":1,"title":"Upstream Block Id","type":"string"},"upstream_quote":{"maxLength":100000,"minLength":1,"title":"Upstream Quote","type":"string"},"downstream_block_id":{"maxLength":128,"minLength":1,"title":"Downstream Block Id","type":"string"},"downstream_quote":{"maxLength":100000,"minLength":1,"title":"Downstream Quote","type":"string"},"observation":{"maxLength":8000,"minLength":1,"title":"Observation","type":"string"},"suggestion":{"oneOf":[{"maxLength":8000,"type":"string"},{"type":"null"}],"title":"Suggestion"},"proposed_text":{"oneOf":[{"maxLength":100000,"type":"string"},{"type":"null"}],"title":"Proposed Text"},"source_record":{"oneOf":[{"additionalProperties":false,"properties":{"namespace":{"maxLength":128,"minLength":1,"title":"Namespace","type":"string"},"record_type":{"maxLength":64,"minLength":1,"title":"Record Type","type":"string"},"record_id":{"maxLength":256,"minLength":1,"title":"Record Id","type":"string"},"revision":{"oneOf":[{"maxLength":256,"minLength":1,"type":"string"},{"type":"null"}],"title":"Revision"},"parent_record_id":{"oneOf":[{"maxLength":256,"minLength":1,"type":"string"},{"type":"null"}],"title":"Parent Record Id"},"description":{"oneOf":[{"maxLength":4000,"type":"string"},{"type":"null"}],"title":"Description"}},"required":["namespace","record_type","record_id"],"title":"SourceRecord","type":"object"},{"type":"null"}]}},"required":["upstream_block_id","upstream_quote","downstream_block_id","downstream_quote","observation"],"title":"ComparisonReferenceItem","type":"object"},"maxItems":1000,"minItems":1,"title":"Items","type":"array"},"provided_record":{"oneOf":[{"additionalProperties":false,"description":"Caller-provided export snapshot, never live authorization or confirmation.","properties":{"schema_version":{"enum":["V1.0.3","V1.1.0"],"title":"Schema Version","type":"string"},"files":{"items":{"additionalProperties":false,"properties":{"side":{"enum":["upstream","downstream"],"title":"Side","type":"string"},"task_file":{"additionalProperties":false,"properties":{"source_table":{"const":"ca_task_file","title":"Source Table","type":"string"},"id":{"pattern":"^[1-9][0-9]{0,18}$","title":"Id","type":"string"},"parse_task_id":{"pattern":"^[1-9][0-9]{0,18}$","title":"Parse Task Id","type":"string"},"document_id":{"maxLength":128,"minLength":1,"title":"Document Id","type":"string"},"biz_type":{"oneOf":[{"enum":["LAW","POLICY"],"type":"string"},{"type":"null"}],"title":"Biz Type"},"biz_id":{"oneOf":[{"pattern":"^[1-9][0-9]{0,18}$","type":"string"},{"type":"null"}],"title":"Biz Id"},"biz_version_id":{"oneOf":[{"pattern":"^[1-9][0-9]{0,18}$","type":"string"},{"type":"null"}],"title":"Biz Version Id"},"file_order":{"default":0,"minimum":0,"title":"File Order","type":"integer"},"file_name":{"default":"","maxLength":500,"title":"File Name","type":"string"},"file_role":{"oneOf":[{"enum":[1,2],"type":"integer"},{"type":"null"}],"title":"File Role"},"status":{"oneOf":[{"enum":["SUCCEEDED","FAILED"],"type":"string"},{"type":"null"}],"title":"Status"},"error_code":{"oneOf":[{"maxLength":64,"type":"string"},{"type":"null"}],"title":"Error Code"}},"required":["source_table","id","parse_task_id","document_id"],"title":"StaticTaskFile","type":"object"},"clauses":{"items":{"additionalProperties":false,"properties":{"clause_kind":{"enum":[1,2],"title":"Clause Kind","type":"integer"},"clause_id":{"maxLength":64,"minLength":1,"title":"Clause Id","type":"string"},"block_id":{"maxLength":128,"minLength":1,"title":"Block Id","type":"string"}},"required":["clause_kind","clause_id","block_id"],"title":"ExportClauseBinding","type":"object"},"maxItems":1000,"title":"Clauses","type":"array"}},"required":["side","task_file"],"title":"ExportFileBinding","type":"object"},"maxItems":200,"minItems":2,"title":"Files","type":"array"},"implicit_pairs":{"items":{"additionalProperties":false,"properties":{"id":{"pattern":"^[1-9][0-9]{0,18}$","title":"Id","type":"string"},"parse_task_id":{"pattern":"^[1-9][0-9]{0,18}$","title":"Parse Task Id","type":"string"},"replaced_by_task_id":{"oneOf":[{"pattern":"^[1-9][0-9]{0,18}$","type":"string"},{"type":"null"}],"title":"Replaced By Task Id"},"input_outdated":{"enum":[0,1],"title":"Input Outdated","type":"integer"},"source_table":{"const":"ca_implicit_pair","title":"Source Table","type":"string"},"pair_order":{"default":0,"minimum":0,"title":"Pair Order","type":"integer"},"document_id_a":{"maxLength":128,"minLength":1,"title":"Document Id A","type":"string"},"document_id_b":{"maxLength":128,"minLength":1,"title":"Document Id B","type":"string"},"coverage":{"oneOf":[{"maximum":100.0,"minimum":0.0,"type":"number"},{"type":"string"}],"title":"Coverage"}},"required":["id","parse_task_id","replaced_by_task_id","input_outdated","source_table","document_id_a","document_id_b","coverage"],"title":"StaticImplicitPair","type":"object"},"maxItems":100,"title":"Implicit Pairs","type":"array"},"comparisons":{"items":{"additionalProperties":false,"properties":{"id":{"pattern":"^[1-9][0-9]{0,18}$","title":"Id","type":"string"},"parse_task_id":{"pattern":"^[1-9][0-9]{0,18}$","title":"Parse Task Id","type":"string"},"replaced_by_task_id":{"oneOf":[{"pattern":"^[1-9][0-9]{0,18}$","type":"string"},{"type":"null"}],"title":"Replaced By Task Id"},"input_outdated":{"enum":[0,1],"title":"Input Outdated","type":"integer"},"source_table":{"const":"ca_internalize_comparison","title":"Source Table","type":"string"},"comparison_id":{"maxLength":64,"minLength":1,"title":"Comparison Id","type":"string"},"comparison_order":{"default":0,"minimum":0,"title":"Comparison Order","type":"integer"},"internal_document_id":{"maxLength":128,"minLength":1,"title":"Internal Document Id","type":"string"},"internal_file_name":{"default":"","maxLength":500,"title":"Internal File Name","type":"string"},"internal_clause_kind":{"enum":[1,2],"title":"Internal Clause Kind","type":"integer"},"internal_clause_id":{"maxLength":64,"minLength":1,"title":"Internal Clause Id","type":"string"},"external_document_id":{"maxLength":128,"minLength":1,"title":"External Document Id","type":"string"},"external_file_name":{"default":"","maxLength":500,"title":"External File Name","type":"string"},"external_clause_kind":{"enum":[1,2],"title":"External Clause Kind","type":"integer"},"external_clause_id":{"maxLength":64,"minLength":1,"title":"External Clause Id","type":"string"},"mr_pairs_json":{"oneOf":[{"items":{"additionalProperties":false,"properties":{"internal_mr_id":{"maxLength":64,"minLength":1,"title":"Internal Mr Id","type":"string"},"external_mr_id":{"maxLength":64,"minLength":1,"title":"External Mr Id","type":"string"}},"required":["internal_mr_id","external_mr_id"],"title":"StaticMRPair","type":"object"},"type":"array"},{"type":"null"}],"title":"Mr Pairs Json"},"has_conflict":{"enum":[0,1],"title":"Has Conflict","type":"integer"},"conflict_type":{"oneOf":[{"maximum":8,"minimum":1,"type":"integer"},{"type":"null"}],"title":"Conflict Type"},"severity":{"oneOf":[{"maximum":3,"minimum":1,"type":"integer"},{"type":"null"}],"title":"Severity"},"description":{"oneOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"suggestion":{"oneOf":[{"type":"string"},{"type":"null"}],"title":"Suggestion"},"revision":{"oneOf":[{"type":"string"},{"type":"null"}],"title":"Revision"}},"required":["id","parse_task_id","replaced_by_task_id","input_outdated","source_table","comparison_id","internal_document_id","internal_clause_kind","internal_clause_id","external_document_id","external_clause_kind","external_clause_id","has_conflict"],"title":"StaticInternalizeComparison","type":"object"},"maxItems":1000,"title":"Comparisons","type":"array"},"composites":{"items":{"additionalProperties":false,"properties":{"id":{"pattern":"^[1-9][0-9]{0,18}$","title":"Id","type":"string"},"parse_task_id":{"pattern":"^[1-9][0-9]{0,18}$","title":"Parse Task Id","type":"string"},"replaced_by_task_id":{"oneOf":[{"pattern":"^[1-9][0-9]{0,18}$","type":"string"},{"type":"null"}],"title":"Replaced By Task Id"},"input_outdated":{"enum":[0,1],"title":"Input Outdated","type":"integer"},"source_table":{"const":"ca_internalize_composite","title":"Source Table","type":"string"},"composite_order":{"default":0,"minimum":0,"title":"Composite Order","type":"integer"},"internal_document_id":{"maxLength":128,"minLength":1,"title":"Internal Document Id","type":"string"},"internal_file_name":{"default":"","maxLength":500,"title":"Internal File Name","type":"string"},"internal_clause_kind":{"enum":[1,2],"title":"Internal Clause Kind","type":"integer"},"internal_clause_id":{"maxLength":64,"minLength":1,"title":"Internal Clause Id","type":"string"},"comparison_ids_json":{"oneOf":[{"items":{"maxLength":64,"minLength":1,"type":"string"},"type":"array"},{"type":"null"}],"title":"Comparison Ids Json"},"description":{"oneOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"suggestion":{"oneOf":[{"type":"string"},{"type":"null"}],"title":"Suggestion"},"revision":{"oneOf":[{"type":"string"},{"type":"null"}],"title":"Revision"}},"required":["id","parse_task_id","replaced_by_task_id","input_outdated","source_table","internal_document_id","internal_clause_kind","internal_clause_id"],"title":"StaticInternalizeComposite","type":"object"},"maxItems":1000,"title":"Composites","type":"array"}},"required":["schema_version","files"],"title":"ProvidedComparisonRecord","type":"object"},{"type":"null"}]}},"required":["upstream_version_id","upstream_content_revision_id","downstream_version_id","downstream_content_revision_id","items"],"title":"StructuredComparisonReference","type":"object"},{"type":"null"}]},"provider_label":{"oneOf":[{"maxLength":255,"type":"string"},{"type":"null"}],"title":"Provider Label"}},"required":["title","role"],"title":"RevisionReference","type":"object"},"maxItems":100,"title":"References","type":"array"},"instructions":{"default":"","maxLength":8000,"title":"Instructions","type":"string"}},"required":["analysis_id","base_version_id"],"title":"DraftRequest","type":"object"}},"required":["action","kb_id","payload"],"title":"GenerateRegulationRevision","type":"object"},{"additionalProperties":false,"properties":{"action":{"const":"generate","title":"Action","type":"string"},"payload":{"additionalProperties":false,"properties":{"baseline_id":{"maxLength":256,"minLength":1,"title":"Baseline Id","type":"string"},"clauses":{"items":{"additionalProperties":false,"properties":{"id":{"maxLength":128,"minLength":1,"title":"Id","type":"string"},"text":{"maxLength":100000,"minLength":1,"title":"Text","type":"string"}},"required":["id","text"],"title":"DirectClause","type":"object"},"maxItems":1000,"minItems":1,"title":"Clauses","type":"array"},"context":{"default":"","maxLength":20000,"title":"Context","type":"string"},"references":{"items":{"additionalProperties":false,"properties":{"id":{"maxLength":128,"minLength":1,"title":"Id","type":"string"},"text":{"maxLength":100000,"minLength":1,"title":"Text","type":"string"},"title":{"maxLength":255,"minLength":1,"title":"Title","type":"string"},"source_description":{"maxLength":4000,"minLength":1,"title":"Source Description","type":"string"}},"required":["id","text","title","source_description"],"title":"DirectReference","type":"object"},"maxItems":100,"title":"References","type":"array"},"problem":{"maxLength":8000,"minLength":1,"title":"Problem","type":"string"},"instructions":{"default":"","maxLength":8000,"title":"Instructions","type":"string"},"previous_suggestion":{"oneOf":[{"additionalProperties":false,"properties":{"operations":{"items":{"additionalProperties":false,"properties":{"id":{"maxLength":128,"minLength":1,"title":"Id","type":"string"},"operation":{"enum":["replace","delete","insert_after"],"title":"Operation","type":"string"},"block_id":{"maxLength":128,"minLength":1,"title":"Block Id","type":"string"},"before_text":{"maxLength":100000,"title":"Before Text","type":"string"},"text":{"default":"","maxLength":100000,"title":"Text","type":"string"},"rationale":{"maxLength":4000,"minLength":1,"title":"Rationale","type":"string"},"citations":{"items":{"additionalProperties":false,"properties":{"reference_id":{"maxLength":128,"minLength":1,"title":"Reference Id","type":"string"},"block_id":{"maxLength":128,"minLength":1,"title":"Block Id","type":"string"},"quote":{"maxLength":100000,"minLength":1,"title":"Quote","type":"string"}},"required":["reference_id","block_id","quote"],"title":"DraftCitation","type":"object"},"maxItems":100,"minItems":1,"title":"Citations","type":"array"},"decision":{"default":"pending","enum":["pending","accepted","rejected","needs_verification"],"title":"Decision","type":"string"}},"required":["id","operation","block_id","before_text","rationale","citations"],"title":"DraftOperation","type":"object"},"maxItems":1000,"title":"Operations","type":"array"},"gaps":{"items":{"type":"string"},"maxItems":100,"title":"Gaps","type":"array"}},"title":"ReferenceDraft","type":"object"},{"type":"null"}]},"adjustment_instructions":{"default":"","maxLength":8000,"title":"Adjustment Instructions","type":"string"}},"required":["baseline_id","clauses","problem"],"title":"DirectDraftRequest","type":"object"},"input_mode":{"const":"direct","title":"Input Mode","type":"string"}},"required":["action","payload","input_mode"],"title":"GenerateDirectRegulationRevision","type":"object"},{"additionalProperties":false,"properties":{"action":{"const":"apply","title":"Action","type":"string"},"payload":{"additionalProperties":false,"properties":{"baseline_id":{"maxLength":256,"minLength":1,"title":"Baseline Id","type":"string"},"document":{"additionalProperties":false,"properties":{"title":{"oneOf":[{"maxLength":1000,"type":"string"},{"type":"null"}],"title":"Title"},"blocks":{"items":{"additionalProperties":false,"properties":{"id":{"maxLength":128,"minLength":1,"title":"Id","type":"string"},"type":{"default":"paragraph","enum":["paragraph","heading","table","formula"],"title":"Type","type":"string"},"text":{"maxLength":100000,"title":"Text","type":"string"},"section_path":{"items":{"type":"string"},"maxItems":32,"title":"Section Path","type":"array"},"table_cells":{"items":{"additionalProperties":true,"type":"object"},"maxItems":10000,"title":"Table Cells","type":"array"},"source_anchor":{"additionalProperties":false,"properties":{"page":{"oneOf":[{"minimum":1,"type":"integer"},{"type":"null"}],"title":"Page"},"bbox":{"oneOf":[{"maxItems":4,"minItems":4,"prefixItems":[{"type":"number"},{"type":"number"},{"type":"number"},{"type":"number"}],"type":"array"},{"type":"null"}],"title":"Bbox"},"coordinate_system":{"oneOf":[{"type":"string"},{"type":"null"}],"title":"Coordinate System"},"char_start":{"oneOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"title":"Char Start"},"char_end":{"oneOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"title":"Char End"},"table_row":{"oneOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"title":"Table Row"},"table_column":{"oneOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"title":"Table Column"}},"title":"SourceAnchor","type":"object"},"parent_id":{"oneOf":[{"type":"string"},{"type":"null"}],"title":"Parent Id"},"number":{"oneOf":[{"maxLength":128,"type":"string"},{"type":"null"}],"title":"Number"}},"required":["id","text"],"title":"ApplyBlock","type":"object"},"maxItems":1000,"minItems":1,"title":"Blocks","type":"array"}},"required":["blocks"],"title":"ApplyDocument","type":"object"},"operations":{"items":{"additionalProperties":false,"properties":{"id":{"maxLength":128,"minLength":1,"title":"Id","type":"string"},"operation":{"enum":["replace","delete","insert_after"],"title":"Operation","type":"string"},"block_id":{"maxLength":128,"minLength":1,"title":"Block Id","type":"string"},"before_text":{"maxLength":100000,"title":"Before Text","type":"string"},"text":{"default":"","maxLength":100000,"title":"Text","type":"string"},"rationale":{"oneOf":[{"maxLength":4000,"minLength":1,"type":"string"},{"type":"null"}],"title":"Rationale"},"citations":{"items":{"additionalProperties":false,"properties":{"reference_id":{"maxLength":128,"minLength":1,"title":"Reference Id","type":"string"},"block_id":{"maxLength":128,"minLength":1,"title":"Block Id","type":"string"},"quote":{"maxLength":100000,"minLength":1,"title":"Quote","type":"string"}},"required":["reference_id","block_id","quote"],"title":"DraftCitation","type":"object"},"maxItems":100,"title":"Citations","type":"array"},"decision":{"default":"pending","enum":["pending","accepted","rejected","needs_verification"],"title":"Decision","type":"string"}},"required":["id","operation","block_id","before_text"],"title":"ConfirmedOperation","type":"object"},"maxItems":1000,"title":"Operations","type":"array"},"references":{"items":{"additionalProperties":false,"properties":{"id":{"maxLength":128,"minLength":1,"title":"Id","type":"string"},"text":{"maxLength":100000,"minLength":1,"title":"Text","type":"string"},"title":{"maxLength":255,"minLength":1,"title":"Title","type":"string"},"source_description":{"maxLength":4000,"minLength":1,"title":"Source Description","type":"string"}},"required":["id","text","title","source_description"],"title":"DirectReference","type":"object"},"maxItems":100,"title":"References","type":"array"},"numbering":{"oneOf":[{"additionalProperties":false,"properties":{"format":{"default":"chinese_article","enum":["chinese_article","arabic_article"],"title":"Format","type":"string"},"start":{"default":1,"maximum":99999,"minimum":1,"title":"Start","type":"integer"},"block_ids":{"oneOf":[{"items":{"type":"string"},"maxItems":1000,"minItems":1,"type":"array"},{"type":"null"}],"title":"Block Ids"},"reference_policy":{"default":"explicit_local","enum":["explicit_local","document_local"],"title":"Reference Policy","type":"string"}},"title":"NumberingRule","type":"object"},{"type":"null"}]}},"required":["baseline_id","document"],"title":"DirectApplyRequest","type":"object"},"input_mode":{"const":"direct","title":"Input Mode","type":"string"}},"required":["action","payload","input_mode"],"title":"ApplyDirectRegulationRevision","type":"object"},{"additionalProperties":false,"properties":{"action":{"const":"get","title":"Action","type":"string"},"kb_id":{"maxLength":32,"minLength":1,"title":"Kb Id","type":"string"},"draft_id":{"maxLength":32,"minLength":1,"title":"Draft Id","type":"string"}},"required":["action","kb_id","draft_id"],"title":"GetRegulationRevision","type":"object"},{"additionalProperties":false,"properties":{"action":{"const":"review","title":"Action","type":"string"},"kb_id":{"maxLength":32,"minLength":1,"title":"Kb Id","type":"string"},"draft_id":{"maxLength":32,"minLength":1,"title":"Draft Id","type":"string"},"payload":{"additionalProperties":false,"properties":{"operations":{"items":{"additionalProperties":false,"properties":{"id":{"maxLength":128,"minLength":1,"title":"Id","type":"string"},"operation":{"enum":["replace","delete","insert_after"],"title":"Operation","type":"string"},"block_id":{"maxLength":128,"minLength":1,"title":"Block Id","type":"string"},"before_text":{"maxLength":100000,"title":"Before Text","type":"string"},"text":{"default":"","maxLength":100000,"title":"Text","type":"string"},"rationale":{"maxLength":4000,"minLength":1,"title":"Rationale","type":"string"},"citations":{"items":{"additionalProperties":false,"properties":{"reference_id":{"maxLength":128,"minLength":1,"title":"Reference Id","type":"string"},"block_id":{"maxLength":128,"minLength":1,"title":"Block Id","type":"string"},"quote":{"maxLength":100000,"minLength":1,"title":"Quote","type":"string"}},"required":["reference_id","block_id","quote"],"title":"DraftCitation","type":"object"},"maxItems":100,"minItems":1,"title":"Citations","type":"array"},"decision":{"default":"pending","enum":["pending","accepted","rejected","needs_verification"],"title":"Decision","type":"string"}},"required":["id","operation","block_id","before_text","rationale","citations"],"title":"DraftOperation","type":"object"},"maxItems":1000,"title":"Operations","type":"array"},"gaps":{"items":{"type":"string"},"maxItems":100,"title":"Gaps","type":"array"},"edit_reason":{"maxLength":1000,"minLength":1,"title":"Edit Reason","type":"string"},"gap_resolution":{"oneOf":[{"maxLength":4000,"minLength":1,"type":"string"},{"type":"null"}],"title":"Gap Resolution"}},"required":["edit_reason"],"title":"EditReferenceDraft","type":"object"}},"required":["action","kb_id","draft_id","payload"],"title":"ReviewRegulationRevision","type":"object"},{"additionalProperties":false,"properties":{"action":{"const":"save","title":"Action","type":"string"},"kb_id":{"maxLength":32,"minLength":1,"title":"Kb Id","type":"string"},"document_id":{"maxLength":32,"minLength":1,"title":"Document Id","type":"string"},"payload":{"additionalProperties":false,"properties":{"source_record":{"oneOf":[{"additionalProperties":false,"properties":{"namespace":{"maxLength":128,"minLength":1,"title":"Namespace","type":"string"},"record_type":{"maxLength":64,"minLength":1,"title":"Record Type","type":"string"},"record_id":{"maxLength":256,"minLength":1,"title":"Record Id","type":"string"},"revision":{"oneOf":[{"maxLength":256,"minLength":1,"type":"string"},{"type":"null"}],"title":"Revision"},"parent_record_id":{"oneOf":[{"maxLength":256,"minLength":1,"type":"string"},{"type":"null"}],"title":"Parent Record Id"},"description":{"oneOf":[{"maxLength":4000,"type":"string"},{"type":"null"}],"title":"Description"}},"required":["namespace","record_type","record_id"],"title":"SourceRecord","type":"object"},{"type":"null"}]},"provided_record":{"oneOf":[{"additionalProperties":false,"properties":{"source_table":{"enum":["ca_law_version","ca_policy_version","ca_case_content"],"title":"Source Table","type":"string"},"id":{"pattern":"^[1-9][0-9]{0,18}$","title":"Id","type":"string"},"document_id":{"pattern":"^[1-9][0-9]{0,18}$","title":"Document Id","type":"string"},"version_no":{"oneOf":[{"maxLength":32,"minLength":1,"type":"string"},{"type":"null"}],"title":"Version No"},"version_status":{"oneOf":[{"enum":["CURRENT","HISTORY"],"type":"string"},{"type":"null"}],"title":"Version Status"},"current_flag":{"oneOf":[{"enum":[0,1],"type":"integer"},{"type":"null"}],"title":"Current Flag"},"publish_date":{"oneOf":[{"format":"date","type":"string"},{"type":"null"}],"title":"Publish Date"},"effective_date":{"oneOf":[{"format":"date","type":"string"},{"type":"null"}],"title":"Effective Date"},"expiry_date":{"oneOf":[{"format":"date","type":"string"},{"type":"null"}],"title":"Expiry Date"},"version_note":{"oneOf":[{"maxLength":500,"type":"string"},{"type":"null"}],"title":"Version Note"}},"required":["source_table","id","document_id"],"title":"StaticVersionRecord","type":"object"},{"type":"null"}],"description":"静态库来源记录的描述投影，不覆盖原件、授权或自动效力判定"},"source_ref":{"oneOf":[{"additionalProperties":false,"properties":{"source_id":{"maxLength":128,"minLength":1,"pattern":"^[A-Za-z0-9_.-]+$","title":"Source Id","type":"string"},"file_id":{"maxLength":256,"minLength":1,"title":"File Id","type":"string"},"source_revision":{"oneOf":[{"maxLength":256,"minLength":1,"type":"string"},{"type":"null"}],"title":"Source Revision"}},"required":["source_id","file_id"],"title":"FileRef","type":"object"},{"type":"null"}]},"base_version_id":{"oneOf":[{"type":"string"},{"type":"null"}],"title":"Base Version Id"},"content_edits":{"items":{"additionalProperties":false,"properties":{"block_id":{"maxLength":128,"minLength":1,"title":"Block Id","type":"string"},"text":{"maxLength":100000,"title":"Text","type":"string"}},"required":["block_id","text"],"title":"ContentEdit","type":"object"},"maxItems":1000,"title":"Content Edits","type":"array"},"reference_draft_id":{"oneOf":[{"maxLength":32,"minLength":1,"type":"string"},{"type":"null"}],"title":"Reference Draft Id"},"reference_draft_etag":{"oneOf":[{"maxLength":64,"minLength":1,"type":"string"},{"type":"null"}],"title":"Reference Draft Etag"},"version_label":{"maxLength":128,"minLength":1,"title":"Version Label","type":"string"},"predecessor_id":{"oneOf":[{"type":"string"},{"type":"null"}],"title":"Predecessor Id"},"issued_at":{"oneOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Issued At"},"effective_from":{"oneOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Effective From"},"effective_to":{"oneOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Effective To"},"write_back":{"default":false,"description":"是否同时要求回写静态原件；当前只读Source未提供该能力，true明确拒绝且不创建知识版本","title":"Write Back","type":"boolean"}},"required":["version_label"],"title":"NewVersion","type":"object"}},"required":["action","kb_id","document_id","payload"],"title":"SaveRegulationRevision","type":"object"},{"additionalProperties":false,"properties":{"action":{"const":"retry_save","title":"Action","type":"string"},"kb_id":{"maxLength":32,"minLength":1,"title":"Kb Id","type":"string"},"draft_id":{"maxLength":32,"minLength":1,"title":"Draft Id","type":"string"},"payload":{"additionalProperties":false,"properties":{"edit_reason":{"maxLength":1000,"minLength":1,"title":"Edit Reason","type":"string"}},"required":["edit_reason"],"title":"RegulationReview","type":"object"}},"required":["action","kb_id","draft_id","payload"],"title":"RetryRegulationRevision","type":"object"}],"title":"dkReviseRegulationsInput"},"examples":{"GenerateRegulationRevision":{"summary":"generate","value":{"action":"generate","kb_id":"demo-base","payload":{"analysis_id":"analysis","base_version_id":"version-b"}}},"GenerateDirectRegulationRevision":{"summary":"generate","value":{"action":"generate","payload":{"baseline_id":"external-v1","clauses":[{"id":"clause-1","text":"采购由部门负责人审批。"}],"references":[{"id":"notice","title":"虚构通知","source_description":"调用方提供的合成通知","text":"采购由集团负责人审批。"}],"problem":"审批主体需按通知调整","instructions":"保留其他要求"},"input_mode":"direct"}},"ApplyDirectRegulationRevision":{"summary":"apply","value":{"action":"apply","payload":{"baseline_id":"external-v1","document":{"title":"虚构采购制度","blocks":[{"id":"clause-1","number":"第一条","text":"采购由部门负责人审批。"},{"id":"clause-2","number":"第二条","text":"档案保存十年。"}]},"operations":[{"id":"change-1","operation":"replace","block_id":"clause-1","before_text":"采购由部门负责人审批。","text":"采购由集团负责人审批。","decision":"accepted","rationale":"调用方确认调整审批主体"}]},"input_mode":"direct"}},"GetRegulationRevision":{"summary":"get","value":{"action":"get","kb_id":"demo-base","draft_id":"demo-draft_id"}},"ReviewRegulationRevision":{"summary":"review","value":{"action":"review","kb_id":"demo-base","draft_id":"demo-draft_id","payload":{"edit_reason":"核对虚构材料"}}},"SaveRegulationRevision":{"summary":"save（修改）","value":{"action":"save","kb_id":"demo-base","document_id":"demo-document_id","payload":{"version_label":"V2","source_ref":{"source_id":"aiservice-documents","file_id":"102"}}}},"RetryRegulationRevision":{"summary":"retry_save","value":{"action":"retry_save","kb_id":"demo-base","draft_id":"demo-draft_id","payload":{"edit_reason":"核对虚构材料"}}},"ApplyWithNumbering":{"summary":"apply（编号重排与引用检查）","value":{"action":"apply","input_mode":"direct","payload":{"baseline_id":"external-v1","document":{"title":"虚构审批制度","blocks":[{"id":"clause-1","number":"第一条","text":"申请材料要求。"},{"id":"clause-2","number":"第二条","text":"审批流程要求。"},{"id":"clause-3","number":"第三条","text":"按照本制度第二条审批；参见第九条。"}]},"operations":[{"id":"add-materials","operation":"insert_after","block_id":"clause-1","before_text":"申请材料要求。","text":"补充材料要求。","decision":"accepted"}],"numbering":{"format":"chinese_article","start":1,"reference_policy":"explicit_local"}}}}}}}}}},"/open/v1/knowledge/regulation-links":{"post":{"tags":["7. 动态知识库"],"summary":"制度依据维护","description":"**接入前必读**：完整状态、效力、鉴权、异步及错误边界见动态知识库接入指南：`/swagger-ui/open-v1/docs/dynamic-knowledge`。\n\n**分支调用边界**：以下列出本页样例基础形态的权限与条件头；历史revision、confirmed标注、分组及参考稿保存的附加要求见各分支正文和接入指南，组合权限须同时具备。字段、类型、默认值、上限及互斥条件以本页请求Schema为准。业务响应no-store，写入后读取最新ETag，异步结果沿原任务入口取得。\n\n**CreateKnowledgeRegulationLink · action=save**：必填`action、kb_id、payload`；权限`dkWrite`；Idempotency-Key必填；If-Match不需要；成功HTTP 201。登记新上位/内部制度依据。支持固定正文锚点或静态关系描述，不能指向自身；引用原文、Space和版本归属均要可核实。新登记不自动确认。\n\n**EditKnowledgeRegulationLink · action=save**：必填`action、kb_id、link_id、payload`；权限`dkWrite`；Idempotency-Key必填；If-Match必填；成功HTTP 200。修改既有依据及其来源，使用当前link_id/ETag；原确认可能失效并影响派生结果，不把提供方的关系声明当成权限或最终法律结论。\n\n**ConfirmKnowledgeRegulationLink · action=confirm**：必填`action、kb_id、link_id、payload`；权限`dkConfirm`；Idempotency-Key必填；If-Match必填；成功HTTP 200。人工确认此依据关系；不发布制度、不直接要求B必改，后续仍须分析具体变化。\n\n**RevokeKnowledgeRegulationLink · action=revoke**：必填`action、kb_id、link_id、payload`；权限`dkWrite`；Idempotency-Key必填；If-Match必填；成功HTTP 200。撤回此依据关系并保留历史；不删除两端原文件，也不能继续把旧确认作为当前有效依据。\n\n**ListKnowledgeRegulationLinks · action=list**：必填`action、kb_id`；权限`dkRead`；Idempotency-Key不需要；If-Match不需要；成功HTTP 200。读取本库可见依据关系及状态；仅confirmed关系可作为已确认依据使用，不能把候选/撤回关系混同。\n\n**GetKnowledgeRegulationLink · action=get**：必填`action、kb_id、link_id`；权限`dkRead`；Idempotency-Key不需要；If-Match不需要；成功HTTP 200。按ID读取依据及历史；原文锚点和两端来源仍须当前可读，知道ID不代表有权限。\n\n**共同限制**：ready不等于released，确认/快照发布不等于制度正式发布；旧来源撤权不能靠历史快照绕过。","operationId":"dkMaintainRegulationLinks","responses":{"200":{"description":"请求已成功处理","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"oneOf":[{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kb_id":{"type":"string"},"kind":{"type":"string"},"state":{"type":"string"},"parent_id":{"type":["string","null"]},"revision":{"type":"integer","minimum":1},"etag":{"type":"string"},"body":{"type":"object","description":"对应 kind 的固定修订内容；读取历史修订需要审计权限。"},"relation_status":{"type":"object","properties":{"confirmable":{"type":"boolean"},"upstream_side":{"enum":["law","policy","upstream",null]},"reason":{"type":["string","null"]},"relation_key":{"type":["string","null"]},"source_table":{"type":["string","null"]},"record_id":{"type":["string","null"]}},"required":["confirmable","upstream_side","reason","relation_key","source_table","record_id"],"description":"主体关系当前的来源状态及方向提示，按服务端业务时区计算；不替代本地state或当前来源授权。通用关系方向为upstream，source_table为null；未提供来源描述时record_id也为null。"}},"required":["id","kb_id","kind","state","parent_id","revision","etag","body"]}},"next_cursor":{"type":["string","null"]},"action":{"const":"list"}},"required":["items","next_cursor","action"]},{"type":"object","properties":{"id":{"type":"string"},"kb_id":{"type":"string"},"kind":{"type":"string"},"state":{"type":"string"},"parent_id":{"type":["string","null"]},"revision":{"type":"integer","minimum":1},"etag":{"type":"string"},"body":{"type":"object","description":"对应 kind 的固定修订内容；读取历史修订需要审计权限。"},"relation_status":{"type":"object","properties":{"confirmable":{"type":"boolean"},"upstream_side":{"enum":["law","policy","upstream",null]},"reason":{"type":["string","null"]},"relation_key":{"type":["string","null"]},"source_table":{"type":["string","null"]},"record_id":{"type":["string","null"]}},"required":["confirmable","upstream_side","reason","relation_key","source_table","record_id"],"description":"主体关系当前的来源状态及方向提示，按服务端业务时区计算；不替代本地state或当前来源授权。通用关系方向为upstream，source_table为null；未提供来源描述时record_id也为null。"},"action":{"const":"get"}},"required":["id","kb_id","kind","state","parent_id","revision","etag","body","action"]},{"type":"object","properties":{"id":{"type":"string"},"kb_id":{"type":"string"},"kind":{"type":"string"},"state":{"type":"string"},"parent_id":{"type":["string","null"]},"revision":{"type":"integer","minimum":1},"etag":{"type":"string"},"body":{"type":"object","description":"对应 kind 的固定修订内容；读取历史修订需要审计权限。"},"relation_status":{"type":"object","properties":{"confirmable":{"type":"boolean"},"upstream_side":{"enum":["law","policy","upstream",null]},"reason":{"type":["string","null"]},"relation_key":{"type":["string","null"]},"source_table":{"type":["string","null"]},"record_id":{"type":["string","null"]}},"required":["confirmable","upstream_side","reason","relation_key","source_table","record_id"],"description":"主体关系当前的来源状态及方向提示，按服务端业务时区计算；不替代本地state或当前来源授权。通用关系方向为upstream，source_table为null；未提供来源描述时record_id也为null。"},"action":{"const":"save"}},"required":["id","kb_id","kind","state","parent_id","revision","etag","body","action"]},{"type":"object","properties":{"id":{"type":"string"},"kb_id":{"type":"string"},"kind":{"type":"string"},"state":{"type":"string"},"parent_id":{"type":["string","null"]},"revision":{"type":"integer","minimum":1},"etag":{"type":"string"},"body":{"type":"object","description":"对应 kind 的固定修订内容；读取历史修订需要审计权限。"},"relation_status":{"type":"object","properties":{"confirmable":{"type":"boolean"},"upstream_side":{"enum":["law","policy","upstream",null]},"reason":{"type":["string","null"]},"relation_key":{"type":["string","null"]},"source_table":{"type":["string","null"]},"record_id":{"type":["string","null"]}},"required":["confirmable","upstream_side","reason","relation_key","source_table","record_id"],"description":"主体关系当前的来源状态及方向提示，按服务端业务时区计算；不替代本地state或当前来源授权。通用关系方向为upstream，source_table为null；未提供来源描述时record_id也为null。"},"action":{"const":"confirm"}},"required":["id","kb_id","kind","state","parent_id","revision","etag","body","action"]},{"type":"object","properties":{"id":{"type":"string"},"kb_id":{"type":"string"},"kind":{"type":"string"},"state":{"type":"string"},"parent_id":{"type":["string","null"]},"revision":{"type":"integer","minimum":1},"etag":{"type":"string"},"body":{"type":"object","description":"对应 kind 的固定修订内容；读取历史修订需要审计权限。"},"relation_status":{"type":"object","properties":{"confirmable":{"type":"boolean"},"upstream_side":{"enum":["law","policy","upstream",null]},"reason":{"type":["string","null"]},"relation_key":{"type":["string","null"]},"source_table":{"type":["string","null"]},"record_id":{"type":["string","null"]}},"required":["confirmable","upstream_side","reason","relation_key","source_table","record_id"],"description":"主体关系当前的来源状态及方向提示，按服务端业务时区计算；不替代本地state或当前来源授权。通用关系方向为upstream，source_table为null；未提供来源描述时record_id也为null。"},"action":{"const":"revoke"}},"required":["id","kb_id","kind","state","parent_id","revision","etag","body","action"]}]},"error":{"type":"null"}}}]}}}},"201":{"description":"业务对象已创建；请保存响应中的 id","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","properties":{"id":{"type":"string"},"kb_id":{"type":"string"},"kind":{"type":"string"},"state":{"type":"string"},"parent_id":{"type":["string","null"]},"revision":{"type":"integer","minimum":1},"etag":{"type":"string"},"body":{"type":"object","description":"对应 kind 的固定修订内容；读取历史修订需要审计权限。"},"relation_status":{"type":"object","properties":{"confirmable":{"type":"boolean"},"upstream_side":{"enum":["law","policy","upstream",null]},"reason":{"type":["string","null"]},"relation_key":{"type":["string","null"]},"source_table":{"type":["string","null"]},"record_id":{"type":["string","null"]}},"required":["confirmable","upstream_side","reason","relation_key","source_table","record_id"],"description":"主体关系当前的来源状态及方向提示，按服务端业务时区计算；不替代本地state或当前来源授权。通用关系方向为upstream，source_table为null；未提供来源描述时record_id也为null。"},"action":{"const":"save"}},"required":["id","kb_id","kind","state","parent_id","revision","etag","body","action"]},"error":{"type":"null"}}}]}}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"409":{"description":"幂等键、任务状态或资源状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"412":{"description":"资源修订已变化，请重新读取后提交","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"413":{"description":"请求体过大","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"422":{"description":"文件内容无法转换(已确认文件被截断、不完整,重传无效)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"428":{"description":"缺少资源修订前置条件 If-Match","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"429":{"description":"队列或模型并发额度已满，请稍后重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"dkRead","x-stability":"preview","x-alternative-scopes":["dkWrite","dkConfirm"],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":128},"description":"仅写操作必填；同一次业务动作重试保持原值。"},{"name":"If-Match","in":"header","required":false,"schema":{"type":"string"},"description":"修改、确认、撤销、纠错、索引设置和结构化新版保存必填；分组按对象ETag，指定批次另需本头部。"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"additionalProperties":false,"properties":{"action":{"const":"save","title":"Action","type":"string"},"kb_id":{"maxLength":32,"minLength":1,"title":"Kb Id","type":"string"},"link_id":{"title":"Link Id","type":"null"},"payload":{"oneOf":[{"additionalProperties":false,"properties":{"upstream":{"additionalProperties":false,"properties":{"version_id":{"maxLength":32,"minLength":1,"title":"Version Id","type":"string"},"content_revision_id":{"maxLength":32,"minLength":1,"title":"Content Revision Id","type":"string"},"block_id":{"maxLength":128,"minLength":1,"title":"Block Id","type":"string"},"quote":{"maxLength":100000,"minLength":1,"title":"Quote","type":"string"}},"required":["version_id","content_revision_id","block_id","quote"],"title":"RegulationAnchor","type":"object"},"downstream":{"additionalProperties":false,"properties":{"version_id":{"maxLength":32,"minLength":1,"title":"Version Id","type":"string"},"content_revision_id":{"maxLength":32,"minLength":1,"title":"Content Revision Id","type":"string"},"block_id":{"maxLength":128,"minLength":1,"title":"Block Id","type":"string"},"quote":{"maxLength":100000,"minLength":1,"title":"Quote","type":"string"}},"required":["version_id","content_revision_id","block_id","quote"],"title":"RegulationAnchor","type":"object"},"basis":{"maxLength":4000,"minLength":1,"title":"Basis","type":"string"},"edit_reason":{"maxLength":1000,"minLength":1,"title":"Edit Reason","type":"string"}},"required":["upstream","downstream","basis","edit_reason"],"title":"RegulationLink","type":"object"},{"additionalProperties":false,"properties":{"policy_version_id":{"maxLength":32,"minLength":1,"title":"Policy Version Id","type":"string"},"law_version_id":{"maxLength":32,"minLength":1,"title":"Law Version Id","type":"string"},"provided_record":{"additionalProperties":false,"properties":{"record":{"oneOf":[{"additionalProperties":false,"properties":{"source_table":{"const":"ca_policy_law_relation","title":"Source Table","type":"string"},"id":{"pattern":"^[1-9][0-9]{0,18}$","title":"Id","type":"string"},"policy_id":{"pattern":"^[1-9][0-9]{0,18}$","title":"Policy Id","type":"string"},"law_id":{"pattern":"^[1-9][0-9]{0,18}$","title":"Law Id","type":"string"},"source_version_id":{"oneOf":[{"pattern":"^[1-9][0-9]{0,18}$","type":"string"},{"type":"null"}],"title":"Source Version Id"},"target_version_id":{"oneOf":[{"pattern":"^[1-9][0-9]{0,18}$","type":"string"},{"type":"null"}],"title":"Target Version Id"},"source_side":{"enum":["POLICY","LAW"],"title":"Source Side","type":"string"},"relation_type":{"enum":["SUPERIOR","REFERENCE","REPEAL","RELATED","NO_RELATION","UNCERTAIN"],"title":"Relation Type","type":"string"},"relation_basis":{"oneOf":[{"maxLength":500,"type":"string"},{"type":"null"}],"title":"Relation Basis"},"evidence_clause_no":{"oneOf":[{"maxLength":64,"type":"string"},{"type":"null"}],"title":"Evidence Clause No"},"evidence_file_id":{"oneOf":[{"pattern":"^[1-9][0-9]{0,18}$","type":"string"},{"type":"null"}],"title":"Evidence File Id"},"effective_date":{"oneOf":[{"format":"date","type":"string"},{"type":"null"}],"title":"Effective Date"},"source_type":{"default":"MANUAL","enum":["MANUAL","ENGINE"],"title":"Source Type","type":"string"},"manual_verified":{"default":0,"enum":[0,1],"title":"Manual Verified","type":"integer"},"engine_code":{"oneOf":[{"maximum":127,"minimum":-128,"type":"integer"},{"type":"null"}],"title":"Engine Code"},"engine_issue":{"oneOf":[{"maxLength":16,"type":"string"},{"type":"null"}],"title":"Engine Issue"},"parse_task_id":{"oneOf":[{"pattern":"^[1-9][0-9]{0,18}$","type":"string"},{"type":"null"}],"title":"Parse Task Id"},"row_version":{"default":0,"minimum":0,"title":"Row Version","type":"integer"},"valid_from":{"oneOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Valid From"},"valid_to":{"oneOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Valid To"},"current_flag":{"oneOf":[{"enum":[0,1],"type":"integer"},{"type":"null"}],"title":"Current Flag"},"relation_fingerprint":{"oneOf":[{"maxLength":64,"minLength":1,"type":"string"},{"type":"null"}],"title":"Relation Fingerprint"}},"required":["source_table","id","policy_id","law_id","source_side","relation_type"],"title":"PolicyLawRelation","type":"object"},{"additionalProperties":false,"properties":{"source_table":{"const":"ca_relation_hint","title":"Source Table","type":"string"},"id":{"pattern":"^[1-9][0-9]{0,18}$","title":"Id","type":"string"},"parse_task_id":{"pattern":"^[1-9][0-9]{0,18}$","title":"Parse Task Id","type":"string"},"source_kind":{"enum":["LAW","POLICY"],"title":"Source Kind","type":"string"},"source_id":{"pattern":"^[1-9][0-9]{0,18}$","title":"Source Id","type":"string"},"to_title":{"maxLength":500,"minLength":1,"title":"To Title","type":"string"},"to_doc_hint":{"oneOf":[{"maxLength":128,"type":"string"},{"type":"null"}],"title":"To Doc Hint"},"relation_code":{"maximum":127,"minimum":-128,"title":"Relation Code","type":"integer"},"hint_kind":{"maxLength":16,"minLength":1,"title":"Hint Kind","type":"string"},"evidence_ref":{"maxLength":200,"minLength":1,"title":"Evidence Ref","type":"string"},"handle_status":{"default":"PENDING","enum":["PENDING","LINKED","IGNORED"],"title":"Handle Status","type":"string"},"linked_kind":{"oneOf":[{"enum":["LAW_RELATION","POLICY_RELATION","POLICY_LAW_RELATION"],"type":"string"},{"type":"null"}],"title":"Linked Kind"},"linked_id":{"oneOf":[{"pattern":"^[1-9][0-9]{0,18}$","type":"string"},{"type":"null"}],"title":"Linked Id"},"handle_note":{"oneOf":[{"maxLength":500,"type":"string"},{"type":"null"}],"title":"Handle Note"}},"required":["source_table","id","parse_task_id","source_kind","source_id","to_title","relation_code","hint_kind","evidence_ref"],"title":"RelationHint","type":"object"}],"title":"Record"},"linked_relation":{"oneOf":[{"additionalProperties":false,"properties":{"source_table":{"const":"ca_policy_law_relation","title":"Source Table","type":"string"},"id":{"pattern":"^[1-9][0-9]{0,18}$","title":"Id","type":"string"},"policy_id":{"pattern":"^[1-9][0-9]{0,18}$","title":"Policy Id","type":"string"},"law_id":{"pattern":"^[1-9][0-9]{0,18}$","title":"Law Id","type":"string"},"source_version_id":{"oneOf":[{"pattern":"^[1-9][0-9]{0,18}$","type":"string"},{"type":"null"}],"title":"Source Version Id"},"target_version_id":{"oneOf":[{"pattern":"^[1-9][0-9]{0,18}$","type":"string"},{"type":"null"}],"title":"Target Version Id"},"source_side":{"enum":["POLICY","LAW"],"title":"Source Side","type":"string"},"relation_type":{"enum":["SUPERIOR","REFERENCE","REPEAL","RELATED","NO_RELATION","UNCERTAIN"],"title":"Relation Type","type":"string"},"relation_basis":{"oneOf":[{"maxLength":500,"type":"string"},{"type":"null"}],"title":"Relation Basis"},"evidence_clause_no":{"oneOf":[{"maxLength":64,"type":"string"},{"type":"null"}],"title":"Evidence Clause No"},"evidence_file_id":{"oneOf":[{"pattern":"^[1-9][0-9]{0,18}$","type":"string"},{"type":"null"}],"title":"Evidence File Id"},"effective_date":{"oneOf":[{"format":"date","type":"string"},{"type":"null"}],"title":"Effective Date"},"source_type":{"default":"MANUAL","enum":["MANUAL","ENGINE"],"title":"Source Type","type":"string"},"manual_verified":{"default":0,"enum":[0,1],"title":"Manual Verified","type":"integer"},"engine_code":{"oneOf":[{"maximum":127,"minimum":-128,"type":"integer"},{"type":"null"}],"title":"Engine Code"},"engine_issue":{"oneOf":[{"maxLength":16,"type":"string"},{"type":"null"}],"title":"Engine Issue"},"parse_task_id":{"oneOf":[{"pattern":"^[1-9][0-9]{0,18}$","type":"string"},{"type":"null"}],"title":"Parse Task Id"},"row_version":{"default":0,"minimum":0,"title":"Row Version","type":"integer"},"valid_from":{"oneOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Valid From"},"valid_to":{"oneOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Valid To"},"current_flag":{"oneOf":[{"enum":[0,1],"type":"integer"},{"type":"null"}],"title":"Current Flag"},"relation_fingerprint":{"oneOf":[{"maxLength":64,"minLength":1,"type":"string"},{"type":"null"}],"title":"Relation Fingerprint"}},"required":["source_table","id","policy_id","law_id","source_side","relation_type"],"title":"PolicyLawRelation","type":"object"},{"type":"null"}]}},"required":["record"],"title":"StaticRelationRecord","type":"object","description":"调用方提供的关系资料，不授予来源访问权限或本地确认状态"},"basis":{"maxLength":4000,"minLength":1,"title":"Basis","type":"string"},"edit_reason":{"maxLength":1000,"minLength":1,"title":"Edit Reason","type":"string"}},"required":["policy_version_id","law_version_id","provided_record","basis","edit_reason"],"title":"StaticRegulationLink","type":"object"},{"additionalProperties":false,"properties":{"scope":{"const":"document","title":"Scope","type":"string"},"upstream":{"additionalProperties":false,"properties":{"version_id":{"maxLength":32,"minLength":1,"title":"Version Id","type":"string"},"content_revision_id":{"maxLength":32,"minLength":1,"title":"Content Revision Id","type":"string"}},"required":["version_id","content_revision_id"],"title":"DocumentEndpoint","type":"object"},"downstream":{"additionalProperties":false,"properties":{"version_id":{"maxLength":32,"minLength":1,"title":"Version Id","type":"string"},"content_revision_id":{"maxLength":32,"minLength":1,"title":"Content Revision Id","type":"string"}},"required":["version_id","content_revision_id"],"title":"DocumentEndpoint","type":"object"},"relation_kind":{"maxLength":64,"minLength":1,"title":"Relation Kind","type":"string"},"source_state":{"default":"unknown","enum":["unknown","active","inactive"],"title":"Source State","type":"string"},"source_record":{"oneOf":[{"additionalProperties":false,"properties":{"namespace":{"maxLength":128,"minLength":1,"title":"Namespace","type":"string"},"record_type":{"maxLength":64,"minLength":1,"title":"Record Type","type":"string"},"record_id":{"maxLength":256,"minLength":1,"title":"Record Id","type":"string"},"revision":{"oneOf":[{"maxLength":256,"minLength":1,"type":"string"},{"type":"null"}],"title":"Revision"},"parent_record_id":{"oneOf":[{"maxLength":256,"minLength":1,"type":"string"},{"type":"null"}],"title":"Parent Record Id"},"description":{"oneOf":[{"maxLength":4000,"type":"string"},{"type":"null"}],"title":"Description"}},"required":["namespace","record_type","record_id"],"title":"SourceRecord","type":"object"},{"type":"null"}]},"valid_from":{"oneOf":[{"format":"date","type":"string"},{"format":"date-time","type":"string"},{"type":"null"}],"title":"Valid From"},"valid_to":{"oneOf":[{"format":"date","type":"string"},{"format":"date-time","type":"string"},{"type":"null"}],"title":"Valid To"},"basis":{"maxLength":4000,"minLength":1,"title":"Basis","type":"string"},"edit_reason":{"maxLength":1000,"minLength":1,"title":"Edit Reason","type":"string"}},"required":["scope","upstream","downstream","relation_kind","basis","edit_reason"],"title":"DocumentRegulationLink","type":"object"}],"title":"RegulationLinkRequest"}},"required":["action","kb_id","payload"],"title":"CreateKnowledgeRegulationLink","type":"object"},{"additionalProperties":false,"properties":{"action":{"const":"save","title":"Action","type":"string"},"kb_id":{"maxLength":32,"minLength":1,"title":"Kb Id","type":"string"},"link_id":{"maxLength":32,"minLength":1,"title":"Link Id","type":"string"},"payload":{"oneOf":[{"additionalProperties":false,"properties":{"upstream":{"additionalProperties":false,"properties":{"version_id":{"maxLength":32,"minLength":1,"title":"Version Id","type":"string"},"content_revision_id":{"maxLength":32,"minLength":1,"title":"Content Revision Id","type":"string"},"block_id":{"maxLength":128,"minLength":1,"title":"Block Id","type":"string"},"quote":{"maxLength":100000,"minLength":1,"title":"Quote","type":"string"}},"required":["version_id","content_revision_id","block_id","quote"],"title":"RegulationAnchor","type":"object"},"downstream":{"additionalProperties":false,"properties":{"version_id":{"maxLength":32,"minLength":1,"title":"Version Id","type":"string"},"content_revision_id":{"maxLength":32,"minLength":1,"title":"Content Revision Id","type":"string"},"block_id":{"maxLength":128,"minLength":1,"title":"Block Id","type":"string"},"quote":{"maxLength":100000,"minLength":1,"title":"Quote","type":"string"}},"required":["version_id","content_revision_id","block_id","quote"],"title":"RegulationAnchor","type":"object"},"basis":{"maxLength":4000,"minLength":1,"title":"Basis","type":"string"},"edit_reason":{"maxLength":1000,"minLength":1,"title":"Edit Reason","type":"string"}},"required":["upstream","downstream","basis","edit_reason"],"title":"RegulationLink","type":"object"},{"additionalProperties":false,"properties":{"policy_version_id":{"maxLength":32,"minLength":1,"title":"Policy Version Id","type":"string"},"law_version_id":{"maxLength":32,"minLength":1,"title":"Law Version Id","type":"string"},"provided_record":{"additionalProperties":false,"properties":{"record":{"oneOf":[{"additionalProperties":false,"properties":{"source_table":{"const":"ca_policy_law_relation","title":"Source Table","type":"string"},"id":{"pattern":"^[1-9][0-9]{0,18}$","title":"Id","type":"string"},"policy_id":{"pattern":"^[1-9][0-9]{0,18}$","title":"Policy Id","type":"string"},"law_id":{"pattern":"^[1-9][0-9]{0,18}$","title":"Law Id","type":"string"},"source_version_id":{"oneOf":[{"pattern":"^[1-9][0-9]{0,18}$","type":"string"},{"type":"null"}],"title":"Source Version Id"},"target_version_id":{"oneOf":[{"pattern":"^[1-9][0-9]{0,18}$","type":"string"},{"type":"null"}],"title":"Target Version Id"},"source_side":{"enum":["POLICY","LAW"],"title":"Source Side","type":"string"},"relation_type":{"enum":["SUPERIOR","REFERENCE","REPEAL","RELATED","NO_RELATION","UNCERTAIN"],"title":"Relation Type","type":"string"},"relation_basis":{"oneOf":[{"maxLength":500,"type":"string"},{"type":"null"}],"title":"Relation Basis"},"evidence_clause_no":{"oneOf":[{"maxLength":64,"type":"string"},{"type":"null"}],"title":"Evidence Clause No"},"evidence_file_id":{"oneOf":[{"pattern":"^[1-9][0-9]{0,18}$","type":"string"},{"type":"null"}],"title":"Evidence File Id"},"effective_date":{"oneOf":[{"format":"date","type":"string"},{"type":"null"}],"title":"Effective Date"},"source_type":{"default":"MANUAL","enum":["MANUAL","ENGINE"],"title":"Source Type","type":"string"},"manual_verified":{"default":0,"enum":[0,1],"title":"Manual Verified","type":"integer"},"engine_code":{"oneOf":[{"maximum":127,"minimum":-128,"type":"integer"},{"type":"null"}],"title":"Engine Code"},"engine_issue":{"oneOf":[{"maxLength":16,"type":"string"},{"type":"null"}],"title":"Engine Issue"},"parse_task_id":{"oneOf":[{"pattern":"^[1-9][0-9]{0,18}$","type":"string"},{"type":"null"}],"title":"Parse Task Id"},"row_version":{"default":0,"minimum":0,"title":"Row Version","type":"integer"},"valid_from":{"oneOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Valid From"},"valid_to":{"oneOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Valid To"},"current_flag":{"oneOf":[{"enum":[0,1],"type":"integer"},{"type":"null"}],"title":"Current Flag"},"relation_fingerprint":{"oneOf":[{"maxLength":64,"minLength":1,"type":"string"},{"type":"null"}],"title":"Relation Fingerprint"}},"required":["source_table","id","policy_id","law_id","source_side","relation_type"],"title":"PolicyLawRelation","type":"object"},{"additionalProperties":false,"properties":{"source_table":{"const":"ca_relation_hint","title":"Source Table","type":"string"},"id":{"pattern":"^[1-9][0-9]{0,18}$","title":"Id","type":"string"},"parse_task_id":{"pattern":"^[1-9][0-9]{0,18}$","title":"Parse Task Id","type":"string"},"source_kind":{"enum":["LAW","POLICY"],"title":"Source Kind","type":"string"},"source_id":{"pattern":"^[1-9][0-9]{0,18}$","title":"Source Id","type":"string"},"to_title":{"maxLength":500,"minLength":1,"title":"To Title","type":"string"},"to_doc_hint":{"oneOf":[{"maxLength":128,"type":"string"},{"type":"null"}],"title":"To Doc Hint"},"relation_code":{"maximum":127,"minimum":-128,"title":"Relation Code","type":"integer"},"hint_kind":{"maxLength":16,"minLength":1,"title":"Hint Kind","type":"string"},"evidence_ref":{"maxLength":200,"minLength":1,"title":"Evidence Ref","type":"string"},"handle_status":{"default":"PENDING","enum":["PENDING","LINKED","IGNORED"],"title":"Handle Status","type":"string"},"linked_kind":{"oneOf":[{"enum":["LAW_RELATION","POLICY_RELATION","POLICY_LAW_RELATION"],"type":"string"},{"type":"null"}],"title":"Linked Kind"},"linked_id":{"oneOf":[{"pattern":"^[1-9][0-9]{0,18}$","type":"string"},{"type":"null"}],"title":"Linked Id"},"handle_note":{"oneOf":[{"maxLength":500,"type":"string"},{"type":"null"}],"title":"Handle Note"}},"required":["source_table","id","parse_task_id","source_kind","source_id","to_title","relation_code","hint_kind","evidence_ref"],"title":"RelationHint","type":"object"}],"title":"Record"},"linked_relation":{"oneOf":[{"additionalProperties":false,"properties":{"source_table":{"const":"ca_policy_law_relation","title":"Source Table","type":"string"},"id":{"pattern":"^[1-9][0-9]{0,18}$","title":"Id","type":"string"},"policy_id":{"pattern":"^[1-9][0-9]{0,18}$","title":"Policy Id","type":"string"},"law_id":{"pattern":"^[1-9][0-9]{0,18}$","title":"Law Id","type":"string"},"source_version_id":{"oneOf":[{"pattern":"^[1-9][0-9]{0,18}$","type":"string"},{"type":"null"}],"title":"Source Version Id"},"target_version_id":{"oneOf":[{"pattern":"^[1-9][0-9]{0,18}$","type":"string"},{"type":"null"}],"title":"Target Version Id"},"source_side":{"enum":["POLICY","LAW"],"title":"Source Side","type":"string"},"relation_type":{"enum":["SUPERIOR","REFERENCE","REPEAL","RELATED","NO_RELATION","UNCERTAIN"],"title":"Relation Type","type":"string"},"relation_basis":{"oneOf":[{"maxLength":500,"type":"string"},{"type":"null"}],"title":"Relation Basis"},"evidence_clause_no":{"oneOf":[{"maxLength":64,"type":"string"},{"type":"null"}],"title":"Evidence Clause No"},"evidence_file_id":{"oneOf":[{"pattern":"^[1-9][0-9]{0,18}$","type":"string"},{"type":"null"}],"title":"Evidence File Id"},"effective_date":{"oneOf":[{"format":"date","type":"string"},{"type":"null"}],"title":"Effective Date"},"source_type":{"default":"MANUAL","enum":["MANUAL","ENGINE"],"title":"Source Type","type":"string"},"manual_verified":{"default":0,"enum":[0,1],"title":"Manual Verified","type":"integer"},"engine_code":{"oneOf":[{"maximum":127,"minimum":-128,"type":"integer"},{"type":"null"}],"title":"Engine Code"},"engine_issue":{"oneOf":[{"maxLength":16,"type":"string"},{"type":"null"}],"title":"Engine Issue"},"parse_task_id":{"oneOf":[{"pattern":"^[1-9][0-9]{0,18}$","type":"string"},{"type":"null"}],"title":"Parse Task Id"},"row_version":{"default":0,"minimum":0,"title":"Row Version","type":"integer"},"valid_from":{"oneOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Valid From"},"valid_to":{"oneOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Valid To"},"current_flag":{"oneOf":[{"enum":[0,1],"type":"integer"},{"type":"null"}],"title":"Current Flag"},"relation_fingerprint":{"oneOf":[{"maxLength":64,"minLength":1,"type":"string"},{"type":"null"}],"title":"Relation Fingerprint"}},"required":["source_table","id","policy_id","law_id","source_side","relation_type"],"title":"PolicyLawRelation","type":"object"},{"type":"null"}]}},"required":["record"],"title":"StaticRelationRecord","type":"object","description":"调用方提供的关系资料，不授予来源访问权限或本地确认状态"},"basis":{"maxLength":4000,"minLength":1,"title":"Basis","type":"string"},"edit_reason":{"maxLength":1000,"minLength":1,"title":"Edit Reason","type":"string"}},"required":["policy_version_id","law_version_id","provided_record","basis","edit_reason"],"title":"StaticRegulationLink","type":"object"},{"additionalProperties":false,"properties":{"scope":{"const":"document","title":"Scope","type":"string"},"upstream":{"additionalProperties":false,"properties":{"version_id":{"maxLength":32,"minLength":1,"title":"Version Id","type":"string"},"content_revision_id":{"maxLength":32,"minLength":1,"title":"Content Revision Id","type":"string"}},"required":["version_id","content_revision_id"],"title":"DocumentEndpoint","type":"object"},"downstream":{"additionalProperties":false,"properties":{"version_id":{"maxLength":32,"minLength":1,"title":"Version Id","type":"string"},"content_revision_id":{"maxLength":32,"minLength":1,"title":"Content Revision Id","type":"string"}},"required":["version_id","content_revision_id"],"title":"DocumentEndpoint","type":"object"},"relation_kind":{"maxLength":64,"minLength":1,"title":"Relation Kind","type":"string"},"source_state":{"default":"unknown","enum":["unknown","active","inactive"],"title":"Source State","type":"string"},"source_record":{"oneOf":[{"additionalProperties":false,"properties":{"namespace":{"maxLength":128,"minLength":1,"title":"Namespace","type":"string"},"record_type":{"maxLength":64,"minLength":1,"title":"Record Type","type":"string"},"record_id":{"maxLength":256,"minLength":1,"title":"Record Id","type":"string"},"revision":{"oneOf":[{"maxLength":256,"minLength":1,"type":"string"},{"type":"null"}],"title":"Revision"},"parent_record_id":{"oneOf":[{"maxLength":256,"minLength":1,"type":"string"},{"type":"null"}],"title":"Parent Record Id"},"description":{"oneOf":[{"maxLength":4000,"type":"string"},{"type":"null"}],"title":"Description"}},"required":["namespace","record_type","record_id"],"title":"SourceRecord","type":"object"},{"type":"null"}]},"valid_from":{"oneOf":[{"format":"date","type":"string"},{"format":"date-time","type":"string"},{"type":"null"}],"title":"Valid From"},"valid_to":{"oneOf":[{"format":"date","type":"string"},{"format":"date-time","type":"string"},{"type":"null"}],"title":"Valid To"},"basis":{"maxLength":4000,"minLength":1,"title":"Basis","type":"string"},"edit_reason":{"maxLength":1000,"minLength":1,"title":"Edit Reason","type":"string"}},"required":["scope","upstream","downstream","relation_kind","basis","edit_reason"],"title":"DocumentRegulationLink","type":"object"}],"title":"RegulationLinkRequest"}},"required":["action","kb_id","link_id","payload"],"title":"EditKnowledgeRegulationLink","type":"object"},{"additionalProperties":false,"properties":{"action":{"const":"confirm","title":"Action","type":"string"},"kb_id":{"maxLength":32,"minLength":1,"title":"Kb Id","type":"string"},"link_id":{"maxLength":32,"minLength":1,"title":"Link Id","type":"string"},"payload":{"additionalProperties":false,"properties":{"edit_reason":{"maxLength":1000,"minLength":1,"title":"Edit Reason","type":"string"}},"required":["edit_reason"],"title":"RegulationReview","type":"object"}},"required":["action","kb_id","link_id","payload"],"title":"ConfirmKnowledgeRegulationLink","type":"object"},{"additionalProperties":false,"properties":{"action":{"const":"revoke","title":"Action","type":"string"},"kb_id":{"maxLength":32,"minLength":1,"title":"Kb Id","type":"string"},"link_id":{"maxLength":32,"minLength":1,"title":"Link Id","type":"string"},"payload":{"additionalProperties":false,"properties":{"edit_reason":{"maxLength":1000,"minLength":1,"title":"Edit Reason","type":"string"}},"required":["edit_reason"],"title":"RegulationReview","type":"object"}},"required":["action","kb_id","link_id","payload"],"title":"RevokeKnowledgeRegulationLink","type":"object"},{"additionalProperties":false,"properties":{"action":{"const":"list","title":"Action","type":"string"},"kb_id":{"maxLength":32,"minLength":1,"title":"Kb Id","type":"string"},"cursor":{"default":"","maxLength":32,"title":"Cursor","type":"string"},"limit":{"default":50,"maximum":100,"minimum":1,"title":"Limit","type":"integer"}},"required":["action","kb_id"],"title":"ListKnowledgeRegulationLinks","type":"object"},{"additionalProperties":false,"properties":{"action":{"const":"get","title":"Action","type":"string"},"kb_id":{"maxLength":32,"minLength":1,"title":"Kb Id","type":"string"},"link_id":{"maxLength":32,"minLength":1,"title":"Link Id","type":"string"},"revision":{"oneOf":[{"minimum":1,"type":"integer"},{"type":"null"}],"title":"Revision"}},"required":["action","kb_id","link_id"],"title":"GetKnowledgeRegulationLink","type":"object"}],"title":"dkMaintainRegulationLinksInput"},"examples":{"CreateKnowledgeRegulationLink":{"summary":"save（新增）","value":{"action":"save","kb_id":"demo-base","payload":{"upstream":{"version_id":"version-a","content_revision_id":"content-a","block_id":"clause","quote":"虚构条款"},"downstream":{"version_id":"version-b","content_revision_id":"content-b","block_id":"clause","quote":"虚构条款"},"basis":"虚构内部制度参照上位制度","edit_reason":"核对虚构材料"}}},"EditKnowledgeRegulationLink":{"summary":"save（修改）","value":{"action":"save","kb_id":"demo-base","link_id":"demo-link_id","payload":{"upstream":{"version_id":"version-a","content_revision_id":"content-a","block_id":"clause","quote":"虚构条款"},"downstream":{"version_id":"version-b","content_revision_id":"content-b","block_id":"clause","quote":"虚构条款"},"basis":"虚构内部制度参照上位制度","edit_reason":"核对虚构材料"}}},"ConfirmKnowledgeRegulationLink":{"summary":"confirm","value":{"action":"confirm","kb_id":"demo-base","link_id":"demo-link_id","payload":{"edit_reason":"核对虚构材料"}}},"RevokeKnowledgeRegulationLink":{"summary":"revoke","value":{"action":"revoke","kb_id":"demo-base","link_id":"demo-link_id","payload":{"edit_reason":"核对虚构材料"}}},"ListKnowledgeRegulationLinks":{"summary":"list","value":{"action":"list","kb_id":"demo-base"}},"GetKnowledgeRegulationLink":{"summary":"get","value":{"action":"get","kb_id":"demo-base","link_id":"demo-link_id"}}}}}}}},"/open/v1/knowledge/revision-notes":{"post":{"tags":["7. 动态知识库"],"summary":"修订说明维护","description":"**接入前必读**：完整状态、效力、鉴权、异步及错误边界见动态知识库接入指南：`/swagger-ui/open-v1/docs/dynamic-knowledge`。\n\n**分支调用边界**：以下列出本页样例基础形态的权限与条件头；历史revision、confirmed标注、分组及参考稿保存的附加要求见各分支正文和接入指南，组合权限须同时具备。字段、类型、默认值、上限及互斥条件以本页请求Schema为准。业务响应no-store，写入后读取最新ETag，异步结果沿原任务入口取得。\n\n**GenerateDirectRevisionNotes · action=generate**：必填`action、payload、input_mode`；权限`dkWrite`；Idempotency-Key必填；If-Match不需要；成功HTTP 200。input_mode=direct，传baseline_id、final_id及before_document/after_document；块id应跨版本稳定。可附events、references、unresolved_items和human_opinions。同步200返回修订对照、摘要、完整快照与核对状态。只传正文为comparison_only；事件逐项重放一致为events_verified；不符为inconsistent并列明问题，记录退回正文差异，不沿用未经核实的事件理由。依据引用逐字核对；理由、意见均属调用方提供。无需建库，不调用模型，不自动保存、确认或发布；dkWrite和Idempotency-Key必需，计算不保存幂等键。由现有Key、dkWrite与Space状态授权，无额外环境准入。apply已返回记录，无须重复调用。\n\n**ConfirmKnowledgeNoteContent · action=confirm_content**：必填`action、kb_id、note_id、payload`；权限`dkConfirm+dkRead+dkWrite`；Idempotency-Key必填；If-Match必填；成功HTTP 202。确认当前修订说明内容用于问答，不确认因果判断或制度关系。要求dkRead、dkWrite、dkConfirm及If-Match；说明正文、来源或关联信息变化后需重新确认，旧快照不能借用新确认。\n\n**CreateKnowledgeRevisionNote · action=save**：必填`action、kb_id、payload`；权限`dkWrite`；Idempotency-Key必填；If-Match不需要；成功HTTP 202。text/source_ref恰好一种；version_pairs必须显式提供，[]表示不指定版本关联的独立说明，关系保持待核对；非空前后版须同一主体且不同。新增的是修订说明，不是已确认变化原因；手工声明版本对也不自动确认因果，内容仍须单独确认用于问答。\n\n**EditKnowledgeRevisionNote · action=save**：必填`action、kb_id、note_id、payload`；权限`dkWrite`；Idempotency-Key必填；If-Match必填；成功HTTP 202。修改说明后重新处理，保留修订记录；依赖旧说明的关系和原因可能待复核。provided_record省略保留、null清空；不得用当前说明来源替代旧任务原来源授权。\n\n**GetKnowledgeRevisionNote · action=get**：必填`action、kb_id、note_id`；权限`dkRead`；Idempotency-Key不需要；If-Match不需要；成功HTTP 200。读取独立说明及关联/处理状态；当前读取还返回content_confirmed及confirmation_index，历史revision不附当前状态。正文、来源或关联改变后旧确认失效，活动快照有该对象也不代表已确认。说明可以没有普通文档目录项，不能据目录未命中判定跨库。来源可读仍不代表原件已完整、原因已确认。\n\n**ListKnowledgeRevisionNotes · action=list**：必填`action、kb_id`；权限`dkRead`；Idempotency-Key不需要；If-Match不需要；成功HTTP 200。列出本库说明及状态，独立说明在此读取，不在list_documents重复显示；逐项来源核验和分页规则同样适用。\n\n**共同限制**：ready不等于released，确认/快照发布不等于制度正式发布；旧来源撤权不能靠历史快照绕过。","operationId":"dkMaintainRevisionNotes","responses":{"200":{"description":"请求已成功处理","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"kb_id":{"type":"string"},"kind":{"type":"string"},"state":{"type":"string"},"parent_id":{"type":["string","null"]},"revision":{"type":"integer","minimum":1},"etag":{"type":"string"},"body":{"type":"object","description":"对应 kind 的固定修订内容；读取历史修订需要审计权限。"},"content_confirmed":{"type":"boolean"},"confirmation_index":{"type":"object","properties":{"state":{"enum":["not_eligible","pending","ready","failed"]},"job_id":{"type":["string","null"]}},"required":["state","job_id"]},"action":{"const":"get"}},"required":["id","kb_id","kind","state","parent_id","revision","etag","body","action"]},{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kb_id":{"type":"string"},"kind":{"type":"string"},"state":{"type":"string"},"parent_id":{"type":["string","null"]},"revision":{"type":"integer","minimum":1},"etag":{"type":"string"},"body":{"type":"object","description":"对应 kind 的固定修订内容；读取历史修订需要审计权限。"},"content_confirmed":{"type":"boolean"},"confirmation_index":{"type":"object","properties":{"state":{"enum":["not_eligible","pending","ready","failed"]},"job_id":{"type":["string","null"]}},"required":["state","job_id"]}},"required":["id","kb_id","kind","state","parent_id","revision","etag","body"]}},"next_cursor":{"type":["string","null"]},"action":{"const":"list"}},"required":["items","next_cursor","action"]},{"additionalProperties":false,"properties":{"action":{"const":"generate"},"input_mode":{"const":"direct","default":"direct","title":"Input Mode","type":"string"},"record_id":{"title":"Record Id","type":"string"},"baseline_id":{"title":"Baseline Id","type":"string"},"final_id":{"title":"Final Id","type":"string"},"baseline_fingerprint":{"title":"Baseline Fingerprint","type":"string"},"final_fingerprint":{"title":"Final Fingerprint","type":"string"},"verification_status":{"enum":["comparison_only","events_verified","inconsistent"],"title":"Verification Status","type":"string"},"event_source":{"enum":["supplied_verified","snapshot_comparison"],"title":"Event Source","type":"string"},"summary_text":{"title":"Summary Text","type":"string"},"revision_notes":{"additionalProperties":false,"properties":{"baseline_id":{"title":"Baseline Id","type":"string"},"result_id":{"title":"Result Id","type":"string"},"summary":{"additionalProperties":false,"properties":{"total":{"title":"Total","type":"integer"},"replace":{"title":"Replace","type":"integer"},"delete":{"title":"Delete","type":"integer"},"insert_after":{"title":"Insert After","type":"integer"},"renumber":{"default":0,"title":"Renumber","type":"integer"},"update_reference":{"default":0,"title":"Update Reference","type":"integer"}},"required":["total","replace","delete","insert_after"],"title":"RevisionSummary","type":"object"},"rows":{"items":{"additionalProperties":false,"properties":{"event_id":{"title":"Event Id","type":"string"},"operation_id":{"title":"Operation Id","type":"string"},"operation":{"enum":["replace","delete","insert_after","renumber","update_reference"],"title":"Operation","type":"string"},"block_id":{"title":"Block Id","type":"string"},"before_text":{"oneOf":[{"type":"string"},{"type":"null"}],"title":"Before Text"},"after_text":{"oneOf":[{"type":"string"},{"type":"null"}],"title":"After Text"},"before_number":{"oneOf":[{"type":"string"},{"type":"null"}],"title":"Before Number"},"after_number":{"oneOf":[{"type":"string"},{"type":"null"}],"title":"After Number"},"rationale":{"oneOf":[{"type":"string"},{"type":"null"}],"title":"Rationale"},"citations":{"items":{"additionalProperties":false,"properties":{"reference_id":{"maxLength":128,"minLength":1,"title":"Reference Id","type":"string"},"block_id":{"maxLength":128,"minLength":1,"title":"Block Id","type":"string"},"quote":{"maxLength":100000,"minLength":1,"title":"Quote","type":"string"}},"required":["reference_id","block_id","quote"],"title":"DraftCitation","type":"object"},"title":"Citations","type":"array"},"reference_updates":{"items":{"additionalProperties":false,"properties":{"block_id":{"title":"Block Id","type":"string"},"field":{"enum":["text","table_cells.text"],"title":"Field","type":"string"},"cell_index":{"oneOf":[{"type":"integer"},{"type":"null"}],"title":"Cell Index"},"offset_unit":{"const":"utf-16-code-unit","default":"utf-16-code-unit","title":"Offset Unit","type":"string"},"source_start":{"title":"Source Start","type":"integer"},"source_end":{"title":"Source End","type":"integer"},"result_start":{"title":"Result Start","type":"integer"},"result_end":{"title":"Result End","type":"integer"},"quote":{"title":"Quote","type":"string"},"target_block_id":{"title":"Target Block Id","type":"string"},"replacement":{"title":"Replacement","type":"string"}},"required":["block_id","field","cell_index","source_start","source_end","result_start","result_end","quote","target_block_id","replacement"],"title":"ReferenceUpdate","type":"object"},"title":"Reference Updates","type":"array"}},"required":["event_id","operation_id","operation","block_id","before_text","after_text","before_number","after_number","rationale","citations"],"title":"RevisionRow","type":"object"},"title":"Rows","type":"array"},"references":{"items":{"additionalProperties":false,"properties":{"id":{"maxLength":128,"minLength":1,"title":"Id","type":"string"},"text":{"maxLength":100000,"minLength":1,"title":"Text","type":"string"},"title":{"maxLength":255,"minLength":1,"title":"Title","type":"string"},"source_description":{"maxLength":4000,"minLength":1,"title":"Source Description","type":"string"}},"required":["id","text","title","source_description"],"title":"DirectReference","type":"object"},"title":"References","type":"array"},"unresolved_items":{"items":{"additionalProperties":false,"properties":{"block_id":{"title":"Block Id","type":"string"},"field":{"enum":["text","table_cells.text"],"title":"Field","type":"string"},"cell_index":{"oneOf":[{"type":"integer"},{"type":"null"}],"title":"Cell Index"},"offset_unit":{"const":"utf-16-code-unit","default":"utf-16-code-unit","title":"Offset Unit","type":"string"},"source_start":{"title":"Source Start","type":"integer"},"source_end":{"title":"Source End","type":"integer"},"result_start":{"title":"Result Start","type":"integer"},"result_end":{"title":"Result End","type":"integer"},"quote":{"title":"Quote","type":"string"},"reason":{"enum":["ambiguous_target","target_deleted","unresolved_target","unqualified_reference","external_reference","compound_reference","quoted_reference","changed_source"],"title":"Reason","type":"string"},"candidate_block_ids":{"items":{"type":"string"},"title":"Candidate Block Ids","type":"array"},"message":{"title":"Message","type":"string"}},"required":["block_id","field","cell_index","source_start","source_end","result_start","result_end","quote","reason","candidate_block_ids","message"],"title":"ReferenceReview","type":"object"},"title":"Unresolved Items","type":"array"}},"required":["baseline_id","result_id","summary","rows","references"],"title":"RevisionRecord","type":"object"},"events":{"items":{"additionalProperties":false,"properties":{"event_id":{"title":"Event Id","type":"string"},"operation_id":{"title":"Operation Id","type":"string"},"operation":{"enum":["replace","delete","insert_after","renumber","update_reference"],"title":"Operation","type":"string"},"block_id":{"title":"Block Id","type":"string"},"anchor_block_id":{"oneOf":[{"type":"string"},{"type":"null"}],"title":"Anchor Block Id"},"before":{"oneOf":[{"additionalProperties":false,"properties":{"id":{"maxLength":128,"minLength":1,"title":"Id","type":"string"},"type":{"default":"paragraph","enum":["paragraph","heading","table","formula"],"title":"Type","type":"string"},"text":{"maxLength":100000,"title":"Text","type":"string"},"section_path":{"items":{"type":"string"},"maxItems":32,"title":"Section Path","type":"array"},"table_cells":{"items":{"additionalProperties":true,"type":"object"},"maxItems":10000,"title":"Table Cells","type":"array"},"source_anchor":{"additionalProperties":false,"properties":{"page":{"oneOf":[{"minimum":1,"type":"integer"},{"type":"null"}],"title":"Page"},"bbox":{"oneOf":[{"maxItems":4,"minItems":4,"prefixItems":[{"type":"number"},{"type":"number"},{"type":"number"},{"type":"number"}],"type":"array"},{"type":"null"}],"title":"Bbox"},"coordinate_system":{"oneOf":[{"type":"string"},{"type":"null"}],"title":"Coordinate System"},"char_start":{"oneOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"title":"Char Start"},"char_end":{"oneOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"title":"Char End"},"table_row":{"oneOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"title":"Table Row"},"table_column":{"oneOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"title":"Table Column"}},"title":"SourceAnchor","type":"object"},"parent_id":{"oneOf":[{"type":"string"},{"type":"null"}],"title":"Parent Id"},"number":{"oneOf":[{"maxLength":128,"type":"string"},{"type":"null"}],"title":"Number"}},"required":["id","text"],"title":"ApplyBlock","type":"object"},{"type":"null"}]},"after":{"oneOf":[{"additionalProperties":false,"properties":{"id":{"maxLength":128,"minLength":1,"title":"Id","type":"string"},"type":{"default":"paragraph","enum":["paragraph","heading","table","formula"],"title":"Type","type":"string"},"text":{"maxLength":100000,"title":"Text","type":"string"},"section_path":{"items":{"type":"string"},"maxItems":32,"title":"Section Path","type":"array"},"table_cells":{"items":{"additionalProperties":true,"type":"object"},"maxItems":10000,"title":"Table Cells","type":"array"},"source_anchor":{"additionalProperties":false,"properties":{"page":{"oneOf":[{"minimum":1,"type":"integer"},{"type":"null"}],"title":"Page"},"bbox":{"oneOf":[{"maxItems":4,"minItems":4,"prefixItems":[{"type":"number"},{"type":"number"},{"type":"number"},{"type":"number"}],"type":"array"},{"type":"null"}],"title":"Bbox"},"coordinate_system":{"oneOf":[{"type":"string"},{"type":"null"}],"title":"Coordinate System"},"char_start":{"oneOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"title":"Char Start"},"char_end":{"oneOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"title":"Char End"},"table_row":{"oneOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"title":"Table Row"},"table_column":{"oneOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"title":"Table Column"}},"title":"SourceAnchor","type":"object"},"parent_id":{"oneOf":[{"type":"string"},{"type":"null"}],"title":"Parent Id"},"number":{"oneOf":[{"maxLength":128,"type":"string"},{"type":"null"}],"title":"Number"}},"required":["id","text"],"title":"ApplyBlock","type":"object"},{"type":"null"}]},"rationale":{"oneOf":[{"type":"string"},{"type":"null"}],"title":"Rationale"},"citations":{"items":{"additionalProperties":false,"properties":{"reference_id":{"maxLength":128,"minLength":1,"title":"Reference Id","type":"string"},"block_id":{"maxLength":128,"minLength":1,"title":"Block Id","type":"string"},"quote":{"maxLength":100000,"minLength":1,"title":"Quote","type":"string"}},"required":["reference_id","block_id","quote"],"title":"DraftCitation","type":"object"},"title":"Citations","type":"array"},"reference_updates":{"items":{"additionalProperties":false,"properties":{"block_id":{"title":"Block Id","type":"string"},"field":{"enum":["text","table_cells.text"],"title":"Field","type":"string"},"cell_index":{"oneOf":[{"type":"integer"},{"type":"null"}],"title":"Cell Index"},"offset_unit":{"const":"utf-16-code-unit","default":"utf-16-code-unit","title":"Offset Unit","type":"string"},"source_start":{"title":"Source Start","type":"integer"},"source_end":{"title":"Source End","type":"integer"},"result_start":{"title":"Result Start","type":"integer"},"result_end":{"title":"Result End","type":"integer"},"quote":{"title":"Quote","type":"string"},"target_block_id":{"title":"Target Block Id","type":"string"},"replacement":{"title":"Replacement","type":"string"}},"required":["block_id","field","cell_index","source_start","source_end","result_start","result_end","quote","target_block_id","replacement"],"title":"ReferenceUpdate","type":"object"},"maxItems":3000,"title":"Reference Updates","type":"array"},"reference_review_items":{"items":{"additionalProperties":false,"properties":{"block_id":{"title":"Block Id","type":"string"},"field":{"enum":["text","table_cells.text"],"title":"Field","type":"string"},"cell_index":{"oneOf":[{"type":"integer"},{"type":"null"}],"title":"Cell Index"},"offset_unit":{"const":"utf-16-code-unit","default":"utf-16-code-unit","title":"Offset Unit","type":"string"},"source_start":{"title":"Source Start","type":"integer"},"source_end":{"title":"Source End","type":"integer"},"result_start":{"title":"Result Start","type":"integer"},"result_end":{"title":"Result End","type":"integer"},"quote":{"title":"Quote","type":"string"},"reason":{"enum":["ambiguous_target","target_deleted","unresolved_target","unqualified_reference","external_reference","compound_reference","quoted_reference","changed_source"],"title":"Reason","type":"string"},"candidate_block_ids":{"items":{"type":"string"},"title":"Candidate Block Ids","type":"array"},"message":{"title":"Message","type":"string"}},"required":["block_id","field","cell_index","source_start","source_end","result_start","result_end","quote","reason","candidate_block_ids","message"],"title":"ReferenceReview","type":"object"},"maxItems":3000,"title":"Reference Review Items","type":"array"}},"required":["event_id","operation_id","operation","block_id","anchor_block_id","before","after","rationale","citations"],"title":"AppliedEvent","type":"object"},"title":"Events","type":"array"},"submitted_events":{"oneOf":[{"items":{"additionalProperties":false,"properties":{"event_id":{"title":"Event Id","type":"string"},"operation_id":{"title":"Operation Id","type":"string"},"operation":{"enum":["replace","delete","insert_after","renumber","update_reference"],"title":"Operation","type":"string"},"block_id":{"title":"Block Id","type":"string"},"anchor_block_id":{"oneOf":[{"type":"string"},{"type":"null"}],"title":"Anchor Block Id"},"before":{"oneOf":[{"additionalProperties":false,"properties":{"id":{"maxLength":128,"minLength":1,"title":"Id","type":"string"},"type":{"default":"paragraph","enum":["paragraph","heading","table","formula"],"title":"Type","type":"string"},"text":{"maxLength":100000,"title":"Text","type":"string"},"section_path":{"items":{"type":"string"},"maxItems":32,"title":"Section Path","type":"array"},"table_cells":{"items":{"additionalProperties":true,"type":"object"},"maxItems":10000,"title":"Table Cells","type":"array"},"source_anchor":{"additionalProperties":false,"properties":{"page":{"oneOf":[{"minimum":1,"type":"integer"},{"type":"null"}],"title":"Page"},"bbox":{"oneOf":[{"maxItems":4,"minItems":4,"prefixItems":[{"type":"number"},{"type":"number"},{"type":"number"},{"type":"number"}],"type":"array"},{"type":"null"}],"title":"Bbox"},"coordinate_system":{"oneOf":[{"type":"string"},{"type":"null"}],"title":"Coordinate System"},"char_start":{"oneOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"title":"Char Start"},"char_end":{"oneOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"title":"Char End"},"table_row":{"oneOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"title":"Table Row"},"table_column":{"oneOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"title":"Table Column"}},"title":"SourceAnchor","type":"object"},"parent_id":{"oneOf":[{"type":"string"},{"type":"null"}],"title":"Parent Id"},"number":{"oneOf":[{"maxLength":128,"type":"string"},{"type":"null"}],"title":"Number"}},"required":["id","text"],"title":"ApplyBlock","type":"object"},{"type":"null"}]},"after":{"oneOf":[{"additionalProperties":false,"properties":{"id":{"maxLength":128,"minLength":1,"title":"Id","type":"string"},"type":{"default":"paragraph","enum":["paragraph","heading","table","formula"],"title":"Type","type":"string"},"text":{"maxLength":100000,"title":"Text","type":"string"},"section_path":{"items":{"type":"string"},"maxItems":32,"title":"Section Path","type":"array"},"table_cells":{"items":{"additionalProperties":true,"type":"object"},"maxItems":10000,"title":"Table Cells","type":"array"},"source_anchor":{"additionalProperties":false,"properties":{"page":{"oneOf":[{"minimum":1,"type":"integer"},{"type":"null"}],"title":"Page"},"bbox":{"oneOf":[{"maxItems":4,"minItems":4,"prefixItems":[{"type":"number"},{"type":"number"},{"type":"number"},{"type":"number"}],"type":"array"},{"type":"null"}],"title":"Bbox"},"coordinate_system":{"oneOf":[{"type":"string"},{"type":"null"}],"title":"Coordinate System"},"char_start":{"oneOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"title":"Char Start"},"char_end":{"oneOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"title":"Char End"},"table_row":{"oneOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"title":"Table Row"},"table_column":{"oneOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"title":"Table Column"}},"title":"SourceAnchor","type":"object"},"parent_id":{"oneOf":[{"type":"string"},{"type":"null"}],"title":"Parent Id"},"number":{"oneOf":[{"maxLength":128,"type":"string"},{"type":"null"}],"title":"Number"}},"required":["id","text"],"title":"ApplyBlock","type":"object"},{"type":"null"}]},"rationale":{"oneOf":[{"type":"string"},{"type":"null"}],"title":"Rationale"},"citations":{"items":{"additionalProperties":false,"properties":{"reference_id":{"maxLength":128,"minLength":1,"title":"Reference Id","type":"string"},"block_id":{"maxLength":128,"minLength":1,"title":"Block Id","type":"string"},"quote":{"maxLength":100000,"minLength":1,"title":"Quote","type":"string"}},"required":["reference_id","block_id","quote"],"title":"DraftCitation","type":"object"},"title":"Citations","type":"array"},"reference_updates":{"items":{"additionalProperties":false,"properties":{"block_id":{"title":"Block Id","type":"string"},"field":{"enum":["text","table_cells.text"],"title":"Field","type":"string"},"cell_index":{"oneOf":[{"type":"integer"},{"type":"null"}],"title":"Cell Index"},"offset_unit":{"const":"utf-16-code-unit","default":"utf-16-code-unit","title":"Offset Unit","type":"string"},"source_start":{"title":"Source Start","type":"integer"},"source_end":{"title":"Source End","type":"integer"},"result_start":{"title":"Result Start","type":"integer"},"result_end":{"title":"Result End","type":"integer"},"quote":{"title":"Quote","type":"string"},"target_block_id":{"title":"Target Block Id","type":"string"},"replacement":{"title":"Replacement","type":"string"}},"required":["block_id","field","cell_index","source_start","source_end","result_start","result_end","quote","target_block_id","replacement"],"title":"ReferenceUpdate","type":"object"},"maxItems":3000,"title":"Reference Updates","type":"array"},"reference_review_items":{"items":{"additionalProperties":false,"properties":{"block_id":{"title":"Block Id","type":"string"},"field":{"enum":["text","table_cells.text"],"title":"Field","type":"string"},"cell_index":{"oneOf":[{"type":"integer"},{"type":"null"}],"title":"Cell Index"},"offset_unit":{"const":"utf-16-code-unit","default":"utf-16-code-unit","title":"Offset Unit","type":"string"},"source_start":{"title":"Source Start","type":"integer"},"source_end":{"title":"Source End","type":"integer"},"result_start":{"title":"Result Start","type":"integer"},"result_end":{"title":"Result End","type":"integer"},"quote":{"title":"Quote","type":"string"},"reason":{"enum":["ambiguous_target","target_deleted","unresolved_target","unqualified_reference","external_reference","compound_reference","quoted_reference","changed_source"],"title":"Reason","type":"string"},"candidate_block_ids":{"items":{"type":"string"},"title":"Candidate Block Ids","type":"array"},"message":{"title":"Message","type":"string"}},"required":["block_id","field","cell_index","source_start","source_end","result_start","result_end","quote","reason","candidate_block_ids","message"],"title":"ReferenceReview","type":"object"},"maxItems":3000,"title":"Reference Review Items","type":"array"}},"required":["event_id","operation_id","operation","block_id","anchor_block_id","before","after","rationale","citations"],"title":"AppliedEvent","type":"object"},"type":"array"},{"type":"null"}],"title":"Submitted Events"},"title_change":{"oneOf":[{"additionalProperties":{"oneOf":[{"type":"string"},{"type":"null"}]},"type":"object"},{"type":"null"}],"title":"Title Change"},"inconsistencies":{"items":{"additionalProperties":false,"properties":{"code":{"enum":["invalid_event","before_mismatch","invalid_citation","final_mismatch","unknown_event"],"title":"Code","type":"string"},"event_id":{"oneOf":[{"type":"string"},{"type":"null"}],"title":"Event Id"},"block_id":{"oneOf":[{"type":"string"},{"type":"null"}],"title":"Block Id"},"message":{"title":"Message","type":"string"}},"required":["code","message"],"title":"RecordInconsistency","type":"object"},"title":"Inconsistencies","type":"array"},"unresolved_items":{"items":{"additionalProperties":false,"properties":{"id":{"maxLength":128,"minLength":1,"title":"Id","type":"string"},"text":{"maxLength":4000,"minLength":1,"title":"Text","type":"string"},"event_ids":{"items":{"type":"string"},"maxItems":1000,"title":"Event Ids","type":"array"}},"required":["id","text"],"title":"RecordContext","type":"object"},"title":"Unresolved Items","type":"array"},"human_opinions":{"items":{"additionalProperties":false,"properties":{"id":{"maxLength":128,"minLength":1,"title":"Id","type":"string"},"text":{"maxLength":4000,"minLength":1,"title":"Text","type":"string"},"event_ids":{"items":{"type":"string"},"maxItems":1000,"title":"Event Ids","type":"array"}},"required":["id","text"],"title":"RecordContext","type":"object"},"title":"Human Opinions","type":"array"}},"required":["record_id","baseline_id","final_id","baseline_fingerprint","final_fingerprint","verification_status","event_source","summary_text","revision_notes","events","submitted_events","title_change","inconsistencies","unresolved_items","human_opinions","action"],"title":"DirectRevisionNotesResult","type":"object"}]},"error":{"type":"null"}}}]}}}},"202":{"description":"任务已受理；请使用 job_id 查询进度和结果","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"oneOf":[{"type":"object","properties":{"job_id":{"type":"string"},"status":{"const":"queued"},"status_url":{"type":"string","pattern":"^/open/v1/job/[0-9a-f]{32}$","description":"查询任务状态，成功后在该地址追加 /result 读取结果。"},"etag":{"type":"string"},"note_id":{"type":"string"},"action":{"const":"save"}},"required":["job_id","status","status_url","note_id","action"]},{"type":"object","properties":{"job_id":{"type":"string"},"status":{"const":"queued"},"status_url":{"type":"string","pattern":"^/open/v1/job/[0-9a-f]{32}$","description":"查询任务状态，成功后在该地址追加 /result 读取结果。"},"etag":{"type":"string"},"note_id":{"type":"string"},"action":{"const":"confirm_content"}},"required":["job_id","status","status_url","note_id","action"]}]},"error":{"type":"null"}}}]}}},"headers":{"Location":{"description":"任务状态查询地址","schema":{"type":"string","example":"/open/v1/job/0123456789abcdef0123456789abcdef"}}},"links":{"查询任务进度":{"operationId":"getJob","parameters":{"job_id":"$response.body#/data/job_id"},"description":"使用本次返回的 job_id 查询任务进度。"},"读取任务结果":{"operationId":"getJobResult","parameters":{"job_id":"$response.body#/data/job_id"},"description":"任务 succeeded 后读取结构化结果。"}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"409":{"description":"幂等键、任务状态或资源状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"412":{"description":"资源修订已变化，请重新读取后提交","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"413":{"description":"请求体过大","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"422":{"description":"文件内容无法转换(已确认文件被截断、不完整,重传无效)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"428":{"description":"缺少资源修订前置条件 If-Match","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"429":{"description":"队列或模型并发额度已满，请稍后重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"dkRead","x-stability":"preview","x-alternative-scopes":["dkWrite"],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":128},"description":"仅写操作必填；同一次业务动作重试保持原值。"},{"name":"If-Match","in":"header","required":false,"schema":{"type":"string"},"description":"修改、确认、撤销、纠错、索引设置和结构化新版保存必填；分组按对象ETag，指定批次另需本头部。"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"additionalProperties":false,"properties":{"action":{"const":"generate","title":"Action","type":"string"},"payload":{"additionalProperties":false,"properties":{"baseline_id":{"maxLength":256,"minLength":1,"title":"Baseline Id","type":"string"},"final_id":{"maxLength":256,"minLength":1,"title":"Final Id","type":"string"},"before_document":{"additionalProperties":false,"properties":{"title":{"oneOf":[{"maxLength":1000,"type":"string"},{"type":"null"}],"title":"Title"},"blocks":{"items":{"additionalProperties":false,"properties":{"id":{"maxLength":128,"minLength":1,"title":"Id","type":"string"},"type":{"default":"paragraph","enum":["paragraph","heading","table","formula"],"title":"Type","type":"string"},"text":{"maxLength":100000,"title":"Text","type":"string"},"section_path":{"items":{"type":"string"},"maxItems":32,"title":"Section Path","type":"array"},"table_cells":{"items":{"additionalProperties":true,"type":"object"},"maxItems":10000,"title":"Table Cells","type":"array"},"source_anchor":{"additionalProperties":false,"properties":{"page":{"oneOf":[{"minimum":1,"type":"integer"},{"type":"null"}],"title":"Page"},"bbox":{"oneOf":[{"maxItems":4,"minItems":4,"prefixItems":[{"type":"number"},{"type":"number"},{"type":"number"},{"type":"number"}],"type":"array"},{"type":"null"}],"title":"Bbox"},"coordinate_system":{"oneOf":[{"type":"string"},{"type":"null"}],"title":"Coordinate System"},"char_start":{"oneOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"title":"Char Start"},"char_end":{"oneOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"title":"Char End"},"table_row":{"oneOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"title":"Table Row"},"table_column":{"oneOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"title":"Table Column"}},"title":"SourceAnchor","type":"object"},"parent_id":{"oneOf":[{"type":"string"},{"type":"null"}],"title":"Parent Id"},"number":{"oneOf":[{"maxLength":128,"type":"string"},{"type":"null"}],"title":"Number"}},"required":["id","text"],"title":"ApplyBlock","type":"object"},"maxItems":1000,"minItems":1,"title":"Blocks","type":"array"}},"required":["blocks"],"title":"ApplyDocument","type":"object"},"after_document":{"additionalProperties":false,"properties":{"title":{"oneOf":[{"maxLength":1000,"type":"string"},{"type":"null"}],"title":"Title"},"blocks":{"items":{"additionalProperties":false,"properties":{"id":{"maxLength":128,"minLength":1,"title":"Id","type":"string"},"type":{"default":"paragraph","enum":["paragraph","heading","table","formula"],"title":"Type","type":"string"},"text":{"maxLength":100000,"title":"Text","type":"string"},"section_path":{"items":{"type":"string"},"maxItems":32,"title":"Section Path","type":"array"},"table_cells":{"items":{"additionalProperties":true,"type":"object"},"maxItems":10000,"title":"Table Cells","type":"array"},"source_anchor":{"additionalProperties":false,"properties":{"page":{"oneOf":[{"minimum":1,"type":"integer"},{"type":"null"}],"title":"Page"},"bbox":{"oneOf":[{"maxItems":4,"minItems":4,"prefixItems":[{"type":"number"},{"type":"number"},{"type":"number"},{"type":"number"}],"type":"array"},{"type":"null"}],"title":"Bbox"},"coordinate_system":{"oneOf":[{"type":"string"},{"type":"null"}],"title":"Coordinate System"},"char_start":{"oneOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"title":"Char Start"},"char_end":{"oneOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"title":"Char End"},"table_row":{"oneOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"title":"Table Row"},"table_column":{"oneOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"title":"Table Column"}},"title":"SourceAnchor","type":"object"},"parent_id":{"oneOf":[{"type":"string"},{"type":"null"}],"title":"Parent Id"},"number":{"oneOf":[{"maxLength":128,"type":"string"},{"type":"null"}],"title":"Number"}},"required":["id","text"],"title":"ApplyBlock","type":"object"},"maxItems":1000,"minItems":1,"title":"Blocks","type":"array"}},"required":["blocks"],"title":"ApplyDocument","type":"object"},"events":{"oneOf":[{"items":{"additionalProperties":false,"properties":{"event_id":{"title":"Event Id","type":"string"},"operation_id":{"title":"Operation Id","type":"string"},"operation":{"enum":["replace","delete","insert_after","renumber","update_reference"],"title":"Operation","type":"string"},"block_id":{"title":"Block Id","type":"string"},"anchor_block_id":{"oneOf":[{"type":"string"},{"type":"null"}],"title":"Anchor Block Id"},"before":{"oneOf":[{"additionalProperties":false,"properties":{"id":{"maxLength":128,"minLength":1,"title":"Id","type":"string"},"type":{"default":"paragraph","enum":["paragraph","heading","table","formula"],"title":"Type","type":"string"},"text":{"maxLength":100000,"title":"Text","type":"string"},"section_path":{"items":{"type":"string"},"maxItems":32,"title":"Section Path","type":"array"},"table_cells":{"items":{"additionalProperties":true,"type":"object"},"maxItems":10000,"title":"Table Cells","type":"array"},"source_anchor":{"additionalProperties":false,"properties":{"page":{"oneOf":[{"minimum":1,"type":"integer"},{"type":"null"}],"title":"Page"},"bbox":{"oneOf":[{"maxItems":4,"minItems":4,"prefixItems":[{"type":"number"},{"type":"number"},{"type":"number"},{"type":"number"}],"type":"array"},{"type":"null"}],"title":"Bbox"},"coordinate_system":{"oneOf":[{"type":"string"},{"type":"null"}],"title":"Coordinate System"},"char_start":{"oneOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"title":"Char Start"},"char_end":{"oneOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"title":"Char End"},"table_row":{"oneOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"title":"Table Row"},"table_column":{"oneOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"title":"Table Column"}},"title":"SourceAnchor","type":"object"},"parent_id":{"oneOf":[{"type":"string"},{"type":"null"}],"title":"Parent Id"},"number":{"oneOf":[{"maxLength":128,"type":"string"},{"type":"null"}],"title":"Number"}},"required":["id","text"],"title":"ApplyBlock","type":"object"},{"type":"null"}]},"after":{"oneOf":[{"additionalProperties":false,"properties":{"id":{"maxLength":128,"minLength":1,"title":"Id","type":"string"},"type":{"default":"paragraph","enum":["paragraph","heading","table","formula"],"title":"Type","type":"string"},"text":{"maxLength":100000,"title":"Text","type":"string"},"section_path":{"items":{"type":"string"},"maxItems":32,"title":"Section Path","type":"array"},"table_cells":{"items":{"additionalProperties":true,"type":"object"},"maxItems":10000,"title":"Table Cells","type":"array"},"source_anchor":{"additionalProperties":false,"properties":{"page":{"oneOf":[{"minimum":1,"type":"integer"},{"type":"null"}],"title":"Page"},"bbox":{"oneOf":[{"maxItems":4,"minItems":4,"prefixItems":[{"type":"number"},{"type":"number"},{"type":"number"},{"type":"number"}],"type":"array"},{"type":"null"}],"title":"Bbox"},"coordinate_system":{"oneOf":[{"type":"string"},{"type":"null"}],"title":"Coordinate System"},"char_start":{"oneOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"title":"Char Start"},"char_end":{"oneOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"title":"Char End"},"table_row":{"oneOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"title":"Table Row"},"table_column":{"oneOf":[{"minimum":0,"type":"integer"},{"type":"null"}],"title":"Table Column"}},"title":"SourceAnchor","type":"object"},"parent_id":{"oneOf":[{"type":"string"},{"type":"null"}],"title":"Parent Id"},"number":{"oneOf":[{"maxLength":128,"type":"string"},{"type":"null"}],"title":"Number"}},"required":["id","text"],"title":"ApplyBlock","type":"object"},{"type":"null"}]},"rationale":{"oneOf":[{"type":"string"},{"type":"null"}],"title":"Rationale"},"citations":{"items":{"additionalProperties":false,"properties":{"reference_id":{"maxLength":128,"minLength":1,"title":"Reference Id","type":"string"},"block_id":{"maxLength":128,"minLength":1,"title":"Block Id","type":"string"},"quote":{"maxLength":100000,"minLength":1,"title":"Quote","type":"string"}},"required":["reference_id","block_id","quote"],"title":"DraftCitation","type":"object"},"title":"Citations","type":"array"},"reference_updates":{"items":{"additionalProperties":false,"properties":{"block_id":{"title":"Block Id","type":"string"},"field":{"enum":["text","table_cells.text"],"title":"Field","type":"string"},"cell_index":{"oneOf":[{"type":"integer"},{"type":"null"}],"title":"Cell Index"},"offset_unit":{"const":"utf-16-code-unit","default":"utf-16-code-unit","title":"Offset Unit","type":"string"},"source_start":{"title":"Source Start","type":"integer"},"source_end":{"title":"Source End","type":"integer"},"result_start":{"title":"Result Start","type":"integer"},"result_end":{"title":"Result End","type":"integer"},"quote":{"title":"Quote","type":"string"},"target_block_id":{"title":"Target Block Id","type":"string"},"replacement":{"title":"Replacement","type":"string"}},"required":["block_id","field","cell_index","source_start","source_end","result_start","result_end","quote","target_block_id","replacement"],"title":"ReferenceUpdate","type":"object"},"maxItems":3000,"title":"Reference Updates","type":"array"},"reference_review_items":{"items":{"additionalProperties":false,"properties":{"block_id":{"title":"Block Id","type":"string"},"field":{"enum":["text","table_cells.text"],"title":"Field","type":"string"},"cell_index":{"oneOf":[{"type":"integer"},{"type":"null"}],"title":"Cell Index"},"offset_unit":{"const":"utf-16-code-unit","default":"utf-16-code-unit","title":"Offset Unit","type":"string"},"source_start":{"title":"Source Start","type":"integer"},"source_end":{"title":"Source End","type":"integer"},"result_start":{"title":"Result Start","type":"integer"},"result_end":{"title":"Result End","type":"integer"},"quote":{"title":"Quote","type":"string"},"reason":{"enum":["ambiguous_target","target_deleted","unresolved_target","unqualified_reference","external_reference","compound_reference","quoted_reference","changed_source"],"title":"Reason","type":"string"},"candidate_block_ids":{"items":{"type":"string"},"title":"Candidate Block Ids","type":"array"},"message":{"title":"Message","type":"string"}},"required":["block_id","field","cell_index","source_start","source_end","result_start","result_end","quote","reason","candidate_block_ids","message"],"title":"ReferenceReview","type":"object"},"maxItems":3000,"title":"Reference Review Items","type":"array"}},"required":["event_id","operation_id","operation","block_id","anchor_block_id","before","after","rationale","citations"],"title":"AppliedEvent","type":"object"},"maxItems":3000,"type":"array"},{"type":"null"}],"title":"Events"},"references":{"items":{"additionalProperties":false,"properties":{"id":{"maxLength":128,"minLength":1,"title":"Id","type":"string"},"text":{"maxLength":100000,"minLength":1,"title":"Text","type":"string"},"title":{"maxLength":255,"minLength":1,"title":"Title","type":"string"},"source_description":{"maxLength":4000,"minLength":1,"title":"Source Description","type":"string"}},"required":["id","text","title","source_description"],"title":"DirectReference","type":"object"},"maxItems":100,"title":"References","type":"array"},"unresolved_items":{"items":{"additionalProperties":false,"properties":{"id":{"maxLength":128,"minLength":1,"title":"Id","type":"string"},"text":{"maxLength":4000,"minLength":1,"title":"Text","type":"string"},"event_ids":{"items":{"type":"string"},"maxItems":1000,"title":"Event Ids","type":"array"}},"required":["id","text"],"title":"RecordContext","type":"object"},"maxItems":100,"title":"Unresolved Items","type":"array"},"human_opinions":{"items":{"additionalProperties":false,"properties":{"id":{"maxLength":128,"minLength":1,"title":"Id","type":"string"},"text":{"maxLength":4000,"minLength":1,"title":"Text","type":"string"},"event_ids":{"items":{"type":"string"},"maxItems":1000,"title":"Event Ids","type":"array"}},"required":["id","text"],"title":"RecordContext","type":"object"},"maxItems":100,"title":"Human Opinions","type":"array"},"reference_updates":{"items":{"additionalProperties":false,"properties":{"block_id":{"title":"Block Id","type":"string"},"field":{"enum":["text","table_cells.text"],"title":"Field","type":"string"},"cell_index":{"oneOf":[{"type":"integer"},{"type":"null"}],"title":"Cell Index"},"offset_unit":{"const":"utf-16-code-unit","default":"utf-16-code-unit","title":"Offset Unit","type":"string"},"source_start":{"title":"Source Start","type":"integer"},"source_end":{"title":"Source End","type":"integer"},"result_start":{"title":"Result Start","type":"integer"},"result_end":{"title":"Result End","type":"integer"},"quote":{"title":"Quote","type":"string"},"target_block_id":{"title":"Target Block Id","type":"string"},"replacement":{"title":"Replacement","type":"string"}},"required":["block_id","field","cell_index","source_start","source_end","result_start","result_end","quote","target_block_id","replacement"],"title":"ReferenceUpdate","type":"object"},"maxItems":3000,"title":"Reference Updates","type":"array"},"reference_review_items":{"items":{"additionalProperties":false,"properties":{"block_id":{"title":"Block Id","type":"string"},"field":{"enum":["text","table_cells.text"],"title":"Field","type":"string"},"cell_index":{"oneOf":[{"type":"integer"},{"type":"null"}],"title":"Cell Index"},"offset_unit":{"const":"utf-16-code-unit","default":"utf-16-code-unit","title":"Offset Unit","type":"string"},"source_start":{"title":"Source Start","type":"integer"},"source_end":{"title":"Source End","type":"integer"},"result_start":{"title":"Result Start","type":"integer"},"result_end":{"title":"Result End","type":"integer"},"quote":{"title":"Quote","type":"string"},"reason":{"enum":["ambiguous_target","target_deleted","unresolved_target","unqualified_reference","external_reference","compound_reference","quoted_reference","changed_source"],"title":"Reason","type":"string"},"candidate_block_ids":{"items":{"type":"string"},"title":"Candidate Block Ids","type":"array"},"message":{"title":"Message","type":"string"}},"required":["block_id","field","cell_index","source_start","source_end","result_start","result_end","quote","reason","candidate_block_ids","message"],"title":"ReferenceReview","type":"object"},"maxItems":3000,"title":"Reference Review Items","type":"array"}},"required":["baseline_id","final_id","before_document","after_document"],"title":"DirectRevisionNotesRequest","type":"object"},"input_mode":{"const":"direct","title":"Input Mode","type":"string"}},"required":["action","payload","input_mode"],"title":"GenerateDirectRevisionNotes","type":"object"},{"additionalProperties":false,"properties":{"action":{"const":"confirm_content","title":"Action","type":"string"},"kb_id":{"maxLength":32,"minLength":1,"title":"Kb Id","type":"string"},"note_id":{"maxLength":32,"minLength":1,"title":"Note Id","type":"string"},"payload":{"additionalProperties":false,"properties":{"edit_reason":{"maxLength":1000,"minLength":1,"title":"Edit Reason","type":"string"}},"required":["edit_reason"],"title":"Confirmation","type":"object"}},"required":["action","kb_id","note_id","payload"],"title":"ConfirmKnowledgeNoteContent","type":"object"},{"additionalProperties":false,"properties":{"action":{"const":"save","title":"Action","type":"string"},"kb_id":{"maxLength":32,"minLength":1,"title":"Kb Id","type":"string"},"note_id":{"title":"Note Id","type":"null"},"payload":{"additionalProperties":false,"properties":{"text":{"oneOf":[{"maxLength":100000,"minLength":1,"type":"string"},{"type":"null"}],"title":"Text"},"source_ref":{"oneOf":[{"additionalProperties":false,"properties":{"source_id":{"maxLength":128,"minLength":1,"pattern":"^[A-Za-z0-9_.-]+$","title":"Source Id","type":"string"},"file_id":{"maxLength":256,"minLength":1,"title":"File Id","type":"string"},"source_revision":{"oneOf":[{"maxLength":256,"minLength":1,"type":"string"},{"type":"null"}],"title":"Source Revision"}},"required":["source_id","file_id"],"title":"FileRef","type":"object"},{"type":"null"}]},"provided_record":{"oneOf":[{"additionalProperties":false,"properties":{"title":{"maxLength":255,"minLength":1,"title":"Title","type":"string"},"record_id":{"oneOf":[{"maxLength":255,"type":"string"},{"type":"null"}],"title":"Record Id"},"provider":{"oneOf":[{"maxLength":255,"type":"string"},{"type":"null"}],"title":"Provider"},"recorded_at":{"oneOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Recorded At"}},"required":["title"],"title":"ProvidedRevisionRecord","type":"object"},{"type":"null"}]},"version_pairs":{"items":{"additionalProperties":false,"properties":{"from_version_id":{"title":"From Version Id","type":"string"},"to_version_id":{"title":"To Version Id","type":"string"}},"required":["from_version_id","to_version_id"],"title":"VersionPair","type":"object"},"maxItems":100,"title":"Version Pairs","type":"array"},"edit_reason":{"default":"添加修订说明","maxLength":1000,"minLength":1,"title":"Edit Reason","type":"string"}},"required":["version_pairs"],"title":"RevisionNote","type":"object"}},"required":["action","kb_id","payload"],"title":"CreateKnowledgeRevisionNote","type":"object"},{"additionalProperties":false,"properties":{"action":{"const":"save","title":"Action","type":"string"},"kb_id":{"maxLength":32,"minLength":1,"title":"Kb Id","type":"string"},"note_id":{"maxLength":32,"minLength":1,"title":"Note Id","type":"string"},"payload":{"additionalProperties":false,"properties":{"text":{"oneOf":[{"maxLength":100000,"minLength":1,"type":"string"},{"type":"null"}],"title":"Text"},"source_ref":{"oneOf":[{"additionalProperties":false,"properties":{"source_id":{"maxLength":128,"minLength":1,"pattern":"^[A-Za-z0-9_.-]+$","title":"Source Id","type":"string"},"file_id":{"maxLength":256,"minLength":1,"title":"File Id","type":"string"},"source_revision":{"oneOf":[{"maxLength":256,"minLength":1,"type":"string"},{"type":"null"}],"title":"Source Revision"}},"required":["source_id","file_id"],"title":"FileRef","type":"object"},{"type":"null"}]},"provided_record":{"oneOf":[{"additionalProperties":false,"properties":{"title":{"maxLength":255,"minLength":1,"title":"Title","type":"string"},"record_id":{"oneOf":[{"maxLength":255,"type":"string"},{"type":"null"}],"title":"Record Id"},"provider":{"oneOf":[{"maxLength":255,"type":"string"},{"type":"null"}],"title":"Provider"},"recorded_at":{"oneOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Recorded At"}},"required":["title"],"title":"ProvidedRevisionRecord","type":"object"},{"type":"null"}]},"version_pairs":{"items":{"additionalProperties":false,"properties":{"from_version_id":{"title":"From Version Id","type":"string"},"to_version_id":{"title":"To Version Id","type":"string"}},"required":["from_version_id","to_version_id"],"title":"VersionPair","type":"object"},"maxItems":100,"title":"Version Pairs","type":"array"},"edit_reason":{"default":"添加修订说明","maxLength":1000,"minLength":1,"title":"Edit Reason","type":"string"}},"required":["version_pairs"],"title":"RevisionNote","type":"object"}},"required":["action","kb_id","note_id","payload"],"title":"EditKnowledgeRevisionNote","type":"object"},{"additionalProperties":false,"properties":{"action":{"const":"get","title":"Action","type":"string"},"kb_id":{"maxLength":32,"minLength":1,"title":"Kb Id","type":"string"},"note_id":{"maxLength":32,"minLength":1,"title":"Note Id","type":"string"},"revision":{"oneOf":[{"minimum":1,"type":"integer"},{"type":"null"}],"title":"Revision"}},"required":["action","kb_id","note_id"],"title":"GetKnowledgeRevisionNote","type":"object"},{"additionalProperties":false,"properties":{"action":{"const":"list","title":"Action","type":"string"},"kb_id":{"maxLength":32,"minLength":1,"title":"Kb Id","type":"string"},"cursor":{"default":"","maxLength":32,"title":"Cursor","type":"string"},"limit":{"default":50,"maximum":100,"minimum":1,"title":"Limit","type":"integer"}},"required":["action","kb_id"],"title":"ListKnowledgeRevisionNotes","type":"object"}],"title":"dkMaintainRevisionNotesInput"},"examples":{"GenerateDirectRevisionNotes":{"summary":"generate","value":{"action":"generate","payload":{"baseline_id":"external-v1","final_id":"external-v2","before_document":{"blocks":[{"id":"clause-1","text":"采购由部门负责人审批。"}]},"after_document":{"blocks":[{"id":"clause-1","text":"采购由集团负责人审批。"}]}},"input_mode":"direct"}},"ConfirmKnowledgeNoteContent":{"summary":"confirm_content","value":{"action":"confirm_content","kb_id":"demo-base","note_id":"demo-note_id","payload":{"edit_reason":"核对虚构材料"}}},"CreateKnowledgeRevisionNote":{"summary":"save（新增）","value":{"action":"save","kb_id":"demo-base","payload":{"text":"虚构审批职责调整说明","version_pairs":[{"from_version_id":"version-a","to_version_id":"version-b"}],"edit_reason":"核对虚构材料"}}},"EditKnowledgeRevisionNote":{"summary":"save（修改）","value":{"action":"save","kb_id":"demo-base","note_id":"demo-note_id","payload":{"text":"虚构审批职责调整说明","version_pairs":[{"from_version_id":"version-a","to_version_id":"version-b"}],"edit_reason":"核对虚构材料"}}},"GetKnowledgeRevisionNote":{"summary":"get","value":{"action":"get","kb_id":"demo-base","note_id":"demo-note_id"}},"ListKnowledgeRevisionNotes":{"summary":"list","value":{"action":"list","kb_id":"demo-base"}}}}}}}},"/open/v1/knowledge/annotations":{"post":{"tags":["7. 动态知识库"],"summary":"知识标注维护","description":"**接入前必读**：完整状态、效力、鉴权、异步及错误边界见动态知识库接入指南：`/swagger-ui/open-v1/docs/dynamic-knowledge`。\n\n**分支调用边界**：以下列出本页样例基础形态的权限与条件头；历史revision、confirmed标注、分组及参考稿保存的附加要求见各分支正文和接入指南，组合权限须同时具备。字段、类型、默认值、上限及互斥条件以本页请求Schema为准。业务响应no-store，写入后读取最新ETag，异步结果沿原任务入口取得。\n\n**PrivateFeedbackRequest · action=feedback**：必填`actor_context、kb_id、process_id、verdict、action、origin_type`；权限`dkRead+dkWrite`；Idempotency-Key必填；If-Match不需要；成功HTTP 201。origin_type=memory_query，可信后端提交actor_context、本人process_id、kb_id、verdict及意见；使用私有查询固定结果，不能以job_id代替。反馈不自动学习、共享或确认，写入须dkRead+dkWrite。\n\n**GetPrivateFeedback · action=get**：必填`actor_context、action、resource_type、kb_id、feedback_id`；权限`dkRead`；Idempotency-Key不需要；If-Match不需要；成功HTTP 200。resource_type=memory_feedback，可信后端传actor_context、kb_id和feedback_id，仅本人可读；读取重新核验当前权限与来源，不进入公共反馈列表。\n\n**ListPrivateFeedback · action=list**：必填`actor_context、action、resource_type、kb_id`；权限`dkRead`；Idempotency-Key不需要；If-Match不需要；成功HTTP 200。resource_type=memory_feedback，仅列本人指定库的反馈，可按process_id筛选；游标分页且每项重新核验来源，不凭共享Key枚举其他用户。\n\n**PrepareMemoryQaAnnotation · action=qa_save**：必填`actor_context、memory_id、memory_revision、kb_id、action、origin_type`；权限`dkConfirm+dkRead+dkWrite`；Idempotency-Key必填；If-Match不需要；成功HTTP 202。origin_type=memory，可信后端传actor_context、源memory_id及memory_revision、目标kb_id；可传qa_id及target_qa_revision指定修改目标。标准问答沉淀的唯一准备入口；使用原私有过程和幂等，不伪造feedback_id，仅准备候选、不公开。\n\n**ConfirmMemoryQaAnnotation · action=qa_confirm**：必填`actor_context、proposal_id、kb_id、reason、action、origin_type`；权限`dkConfirm+dkRead+dkWrite`；Idempotency-Key必填；If-Match必填；成功HTTP 202。origin_type=memory，传actor_context、proposal_id、kb_id、reason及候选If-Match，确认固定候选内容和披露范围；标准问答沉淀的唯一确认入口，保留原服务及幂等，检索须等待retrieval_status=ready。\n\n**WithdrawMemoryQaAnnotation · action=qa_withdraw**：必填`actor_context、proposal_id、kb_id、reason、action、origin_type`；权限`dkConfirm+dkRead+dkWrite`；Idempotency-Key必填；If-Match必填；成功HTTP 202。origin_type=memory，传actor_context、proposal_id、kb_id、reason及候选If-Match；撤回私有候选或已批准QA，要求当前目标库read/write/confirm权限。原记忆失效不阻止撤回。\n\n**CreateKnowledgeAnnotation · action=save**：必填`action、kb_id、payload`；权限`dkWrite`；Idempotency-Key必填；If-Match不需要；成功HTTP 202。标注目标限文档主体、业务版本、当前正文修订或变化；默认proposed，不自动用于回答，也不改变正文。\n\n**EditKnowledgeAnnotation · action=save**：必填`action、kb_id、annotation_id、payload`；权限`dkWrite`；Idempotency-Key必填；If-Match必填；成功HTTP 202。可修改text及proposed/confirmed/withdrawn状态；confirmed额外要求dkConfirm。撤回后不再作为当前索引依据，不能用标注伪造制度发布状态或来源身份。\n\n**GetKnowledgeAnnotation · action=get**：必填`action、kb_id、annotation_id`；权限`dkRead`；Idempotency-Key不需要；If-Match不需要；成功HTTP 200。读取标注当前或历史修订；历史可查不代表仍应作为当前结论依据。\n\n**ListKnowledgeAnnotations · action=list**：必填`action、kb_id`；权限`dkRead`；Idempotency-Key不需要；If-Match不需要；成功HTTP 200。列出普通标注，调用方须检查state/review_status；未确认标注不进入可引用的确认标注索引。可选version_id限定该版本及其全部正文目标，先按归属过滤再分页；不传保留全库普通标注读取。历史正文标注只能核对其原绑定正文，不代表当前正文仍适用；不能编辑或确认已被替换的正文标注。feedback和standard_qa分支不接受此筛选参数。\n\n**CreateQueryFeedback · action=feedback**：必填`action、kb_id、payload`；权限`dkRead+dkWrite`；Idempotency-Key必填；If-Match不需要；成功HTTP 201。仅原任务主体可评价本库已成功且有非空answer的dkQuery，须dkRead+dkWrite。服务端从任务取得问题、回答及来源快照，不接受客户端冒充原回答或评价人；仅证据、未完成、失败、无答案及跨主体任务拒绝。反馈只保存和审计，不自动成为知识、不刷新索引或向量化。\n\n**CreateStandardQa · action=qa_save**：必填`action、kb_id、payload`；权限`dkConfirm+dkRead+dkWrite`；Idempotency-Key必填；If-Match不需要；成功HTTP 201。须dkRead+dkWrite+dkConfirm，根据可读反馈整理标准问题、答案、适用范围及1至20条当前制度正文证据。新增201、状态proposed，不可检索。主版本须属于正文依据，不允许其他QA循环自证；不回写原库。\n\n**EditStandardQa · action=qa_save**：必填`action、kb_id、annotation_id、payload`；权限`dkConfirm+dkRead+dkWrite`；Idempotency-Key必填；If-Match必填；成功HTTP 200。完整替换标准问答编辑字段，须三项权限、当前QA If-Match及修改理由；不得更换原反馈。修改转proposed，原确认立即失效。通常200；原confirmed修订失效另排索引刷新并返回202及job_id，旧快照也不能继续引用。\n\n**ConfirmStandardQa · action=qa_confirm**：必填`action、kb_id、annotation_id、payload`；权限`dkConfirm+dkRead+dkWrite`；Idempotency-Key必填；If-Match必填；成功HTTP 202。须dkRead+dkWrite+dkConfirm、If-Match和幂等键，复查当前正文/版本/文档依赖后确认并异步刷新202。confirmed不等于已检索生效；须活动快照含当前修订。相同修订失败可重试，不增加业务修订或重复排运行任务；已ready返回200。其他主体正在更新时返回200/pending，不暴露其私有任务句柄，由get继续核对共享状态。不能借此发布制度草稿。\n\n**WithdrawStandardQa · action=qa_withdraw**：必填`action、kb_id、annotation_id、payload`；权限`dkConfirm+dkRead+dkWrite`；Idempotency-Key必填；If-Match必填；成功HTTP 202。须三项权限、当前ETag及理由；撤回立即停止检索复用并返回202刷新任务，保留历史。旧快照、残留向量和历史任务不能绕过撤回状态。\n\n**GetQueryFeedback · action=get**：必填`action、kb_id、feedback_id、resource_type`；权限`dkRead`；Idempotency-Key不需要；If-Match不需要；成功HTTP 200。显式resource_type=feedback及feedback_id；仅提交者或同库dkConfirm审核者可读，仍复查固定快照及当前来源权限，不授予读取他人job权限。正文纠错后可审阅历史反馈并改用新依据，但旧答案不能继续当作当前查询结果；来源撤权仍拒绝。历史反馈对象修订额外dkAudit。\n\n**ListQueryFeedback · action=list**：必填`action、kb_id、resource_type`；权限`dkRead`；Idempotency-Key不需要；If-Match不需要；成功HTTP 200。显式resource_type=feedback，可按job_id过滤；仅自己的反馈或同库审核者可见反馈，先核验权限再分页，空页不泄露其他主体条目数。\n\n**GetStandardQa · action=get**：必填`action、kb_id、annotation_id、resource_type`；权限`dkRead`；Idempotency-Key不需要；If-Match不需要；成功HTTP 200。显式resource_type=standard_qa及annotation_id，返回record、retrieval_status、job_id。仅审核者可读草稿/待复核/撤回，普通读取仅当前已确认且索引有效项；历史另需审计且不能绕过当前可见性。状态区分not_eligible/pending/ready/failed。\n\n**ListStandardQa · action=list**：必填`action、kb_id、resource_type`；权限`dkRead`；Idempotency-Key不需要；If-Match不需要；成功HTTP 200。显式resource_type=standard_qa，可按业务status过滤；items为QA_VIEW，权限和检索状态按get规则逐项核验后分页。默认普通annotation列表不混入标准问答。\n\n**共同限制**：ready不等于released，确认/快照发布不等于制度正式发布；旧来源撤权不能靠历史快照绕过。","operationId":"dkMaintainAnnotations","responses":{"200":{"description":"请求已成功处理","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"kb_id":{"type":"string"},"kind":{"type":"string"},"state":{"type":"string"},"parent_id":{"type":["string","null"]},"revision":{"type":"integer","minimum":1},"etag":{"type":"string"},"body":{"type":"object","description":"对应 kind 的固定修订内容；读取历史修订需要审计权限。"},"resource_type":{"const":"annotation"},"action":{"const":"get"}},"required":["id","kb_id","kind","state","parent_id","revision","etag","body","action"]},{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kb_id":{"type":"string"},"kind":{"type":"string"},"state":{"type":"string"},"parent_id":{"type":["string","null"]},"revision":{"type":"integer","minimum":1},"etag":{"type":"string"},"body":{"type":"object","description":"对应 kind 的固定修订内容；读取历史修订需要审计权限。"}},"required":["id","kb_id","kind","state","parent_id","revision","etag","body"]}},"next_cursor":{"type":["string","null"]},"resource_type":{"const":"annotation"},"action":{"const":"list"}},"required":["items","next_cursor","action"]},{"type":"object","properties":{"id":{"type":"string"},"kb_id":{"type":"string"},"kind":{"type":"string"},"state":{"type":"string"},"parent_id":{"type":["string","null"]},"revision":{"type":"integer","minimum":1},"etag":{"type":"string"},"body":{"type":"object","description":"对应 kind 的固定修订内容；读取历史修订需要审计权限。"},"resource_type":{"const":"feedback"},"action":{"const":"get"}},"required":["id","kb_id","kind","state","parent_id","revision","etag","body","resource_type","action"]},{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kb_id":{"type":"string"},"kind":{"type":"string"},"state":{"type":"string"},"parent_id":{"type":["string","null"]},"revision":{"type":"integer","minimum":1},"etag":{"type":"string"},"body":{"type":"object","description":"对应 kind 的固定修订内容；读取历史修订需要审计权限。"}},"required":["id","kb_id","kind","state","parent_id","revision","etag","body"]}},"next_cursor":{"type":["string","null"]},"resource_type":{"const":"feedback"},"action":{"const":"list"}},"required":["items","next_cursor","resource_type","action"]},{"type":"object","properties":{"record":{"type":"object","properties":{"id":{"type":"string"},"kb_id":{"type":"string"},"kind":{"type":"string"},"state":{"type":"string"},"parent_id":{"type":["string","null"]},"revision":{"type":"integer","minimum":1},"etag":{"type":"string"},"body":{"type":"object","description":"对应 kind 的固定修订内容；读取历史修订需要审计权限。"}},"required":["id","kb_id","kind","state","parent_id","revision","etag","body"]},"retrieval_status":{"enum":["not_eligible","pending","ready","failed"]},"job_id":{"type":["string","null"]},"resource_type":{"const":"standard_qa"},"action":{"const":"get"}},"required":["record","retrieval_status","job_id","resource_type","action"]},{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"record":{"type":"object","properties":{"id":{"type":"string"},"kb_id":{"type":"string"},"kind":{"type":"string"},"state":{"type":"string"},"parent_id":{"type":["string","null"]},"revision":{"type":"integer","minimum":1},"etag":{"type":"string"},"body":{"type":"object","description":"对应 kind 的固定修订内容；读取历史修订需要审计权限。"}},"required":["id","kb_id","kind","state","parent_id","revision","etag","body"]},"retrieval_status":{"enum":["not_eligible","pending","ready","failed"]},"job_id":{"type":["string","null"]}},"required":["record","retrieval_status","job_id"]}},"next_cursor":{"type":["string","null"]},"resource_type":{"const":"standard_qa"},"action":{"const":"list"}},"required":["items","next_cursor","resource_type","action"]},{"type":"object","properties":{"id":{"type":"string"},"kb_id":{"type":"string"},"kind":{"type":"string"},"state":{"type":"string"},"parent_id":{"type":["string","null"]},"revision":{"type":"integer","minimum":1},"etag":{"type":"string"},"body":{"type":"object","description":"对应 kind 的固定修订内容；读取历史修订需要审计权限。"},"job_id":{"type":"null"},"action":{"const":"qa_save"}},"required":["id","kb_id","kind","state","parent_id","revision","etag","body","action"]},{"type":"object","properties":{"annotation_id":{"type":"string"},"etag":{"type":"string"},"state":{"const":"confirmed"},"retrieval_status":{"enum":["ready","pending"]},"job_id":{"type":["string","null"]},"action":{"const":"qa_confirm"}},"required":["annotation_id","etag","state","retrieval_status","action"]},{"type":"object","properties":{"proposal_id":{"type":"string"},"revision":{"type":"integer","minimum":1},"etag":{"type":"string"},"state":{"const":"confirmed"},"qa_id":{"type":"string"},"qa_revision":{"type":"integer","minimum":1},"retrieval_status":{"type":"string"},"job_id":{"type":["string","null"]},"origin_type":{"const":"memory"},"action":{"const":"qa_confirm"}},"required":["proposal_id","revision","etag","state","qa_id","qa_revision","retrieval_status","job_id","origin_type","action"]},{"type":"object","properties":{"proposal_id":{"type":"string"},"revision":{"type":"integer","minimum":1},"etag":{"type":"string"},"state":{"const":"withdrawn"},"qa_id":{"type":["string","null"]},"retrieval_status":{"const":"not_eligible"},"job_id":{"type":"string"},"origin_type":{"const":"memory"},"action":{"const":"qa_withdraw"}},"required":["proposal_id","revision","etag","state","qa_id","retrieval_status","origin_type","action"]},{"type":"object","properties":{"feedback_id":{"type":"string"},"revision":{"type":"integer","minimum":1},"etag":{"type":"string"},"process_id":{"type":"string"},"kb_id":{"type":"string"},"verdict":{"type":"string"},"comment":{"type":"string"},"suggested_answer":{"type":"string"},"query_snapshot":{"type":"object"},"resource_type":{"const":"memory_feedback"},"action":{"const":"get"}},"required":["feedback_id","revision","etag","process_id","kb_id","verdict","comment","suggested_answer","query_snapshot","resource_type","action"]},{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"feedback_id":{"type":"string"},"revision":{"type":"integer","minimum":1},"etag":{"type":"string"},"process_id":{"type":"string"},"kb_id":{"type":"string"},"verdict":{"type":"string"},"comment":{"type":"string"},"suggested_answer":{"type":"string"},"query_snapshot":{"type":"object"}},"required":["feedback_id","revision","etag","process_id","kb_id","verdict","comment","suggested_answer","query_snapshot"]}},"next_cursor":{"type":["string","null"]},"resource_type":{"const":"memory_feedback"},"action":{"const":"list"}},"required":["items","next_cursor","resource_type","action"]}]},"error":{"type":"null"}}}]}}}},"201":{"description":"文件上传成功；请保存响应中的 doc_id","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"oneOf":[{"type":"object","properties":{"id":{"type":"string"},"kb_id":{"type":"string"},"kind":{"type":"string"},"state":{"type":"string"},"parent_id":{"type":["string","null"]},"revision":{"type":"integer","minimum":1},"etag":{"type":"string"},"body":{"type":"object","description":"对应 kind 的固定修订内容；读取历史修订需要审计权限。"},"action":{"const":"feedback"}},"required":["id","kb_id","kind","state","parent_id","revision","etag","body","action"]},{"type":"object","properties":{"id":{"type":"string"},"kb_id":{"type":"string"},"kind":{"type":"string"},"state":{"type":"string"},"parent_id":{"type":["string","null"]},"revision":{"type":"integer","minimum":1},"etag":{"type":"string"},"body":{"type":"object","description":"对应 kind 的固定修订内容；读取历史修订需要审计权限。"},"job_id":{"type":"null"},"action":{"const":"qa_save"}},"required":["id","kb_id","kind","state","parent_id","revision","etag","body","action"]},{"type":"object","properties":{"feedback_id":{"type":"string"},"revision":{"type":"integer","minimum":1},"etag":{"type":"string"},"origin_type":{"const":"memory_query"},"action":{"const":"feedback"}},"required":["feedback_id","revision","etag","origin_type","action"]}]},"error":{"type":"null"}}}]}}}},"202":{"description":"任务已受理；请使用 job_id 查询进度和结果","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"oneOf":[{"type":"object","properties":{"job_id":{"type":"string"},"status":{"const":"queued"},"status_url":{"type":"string","pattern":"^/open/v1/job/[0-9a-f]{32}$","description":"查询任务状态，成功后在该地址追加 /result 读取结果。"},"etag":{"type":"string"},"annotation_id":{"type":"string"},"action":{"const":"save"}},"required":["job_id","status","status_url","annotation_id","action"]},{"type":"object","properties":{"id":{"type":"string"},"kb_id":{"type":"string"},"kind":{"type":"string"},"state":{"type":"string"},"parent_id":{"type":["string","null"]},"revision":{"type":"integer","minimum":1},"etag":{"type":"string"},"body":{"type":"object","description":"对应 kind 的固定修订内容；读取历史修订需要审计权限。"},"job_id":{"type":"string"},"status":{"const":"queued"},"status_url":{"type":"string","pattern":"^/open/v1/job/[0-9a-f]{32}$","description":"查询任务状态，成功后在该地址追加 /result 读取结果。"},"action":{"const":"qa_save"}},"required":["id","kb_id","kind","state","parent_id","revision","etag","body","job_id","status","status_url","action"]},{"type":"object","properties":{"job_id":{"type":"string"},"status":{"const":"queued"},"status_url":{"type":"string","pattern":"^/open/v1/job/[0-9a-f]{32}$","description":"查询任务状态，成功后在该地址追加 /result 读取结果。"},"etag":{"type":"string"},"annotation_id":{"type":"string"},"state":{"enum":["confirmed","withdrawn"]},"action":{"const":"qa_confirm"}},"required":["job_id","status","status_url","annotation_id","etag","state","action"]},{"type":"object","properties":{"job_id":{"type":"string"},"status":{"const":"queued"},"status_url":{"type":"string","pattern":"^/open/v1/job/[0-9a-f]{32}$","description":"查询任务状态，成功后在该地址追加 /result 读取结果。"},"etag":{"type":"string"},"annotation_id":{"type":"string"},"state":{"enum":["confirmed","withdrawn"]},"action":{"const":"qa_withdraw"}},"required":["job_id","status","status_url","annotation_id","etag","state","action"]},{"type":"object","properties":{"process_id":{"type":"string"},"status":{"type":"string"},"revision":{"type":"integer","minimum":1},"etag":{"type":"string"},"stage":{"type":["string","null"]},"result":{"type":["object","null"]},"error":{"type":["object","null"]},"retryable":{"type":"boolean"},"origin_type":{"const":"memory"},"action":{"const":"qa_save"}},"required":["process_id","status","origin_type","action"]},{"type":"object","properties":{"proposal_id":{"type":"string"},"revision":{"type":"integer","minimum":1},"etag":{"type":"string"},"state":{"const":"confirmed"},"qa_id":{"type":"string"},"qa_revision":{"type":"integer","minimum":1},"retrieval_status":{"type":"string"},"job_id":{"type":["string","null"]},"origin_type":{"const":"memory"},"action":{"const":"qa_confirm"}},"required":["proposal_id","revision","etag","state","qa_id","qa_revision","retrieval_status","job_id","origin_type","action"]},{"type":"object","properties":{"proposal_id":{"type":"string"},"revision":{"type":"integer","minimum":1},"etag":{"type":"string"},"state":{"const":"withdrawn"},"qa_id":{"type":["string","null"]},"retrieval_status":{"const":"not_eligible"},"job_id":{"type":"string"},"origin_type":{"const":"memory"},"action":{"const":"qa_withdraw"}},"required":["proposal_id","revision","etag","state","qa_id","retrieval_status","origin_type","action"]}]},"error":{"type":"null"}}}]}}},"headers":{"Location":{"description":"任务状态查询地址","schema":{"type":"string","example":"/open/v1/job/0123456789abcdef0123456789abcdef"}}},"links":{"查询任务进度":{"operationId":"getJob","parameters":{"job_id":"$response.body#/data/job_id"},"description":"使用本次返回的 job_id 查询任务进度。"},"读取任务结果":{"operationId":"getJobResult","parameters":{"job_id":"$response.body#/data/job_id"},"description":"任务 succeeded 后读取结构化结果。"}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"409":{"description":"幂等键、任务状态或资源状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"412":{"description":"资源修订已变化，请重新读取后提交","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"413":{"description":"请求体过大","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"422":{"description":"文件内容无法转换(已确认文件被截断、不完整,重传无效)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"428":{"description":"缺少资源修订前置条件 If-Match","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"429":{"description":"队列或模型并发额度已满，请稍后重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"dkRead","x-stability":"preview","x-alternative-scopes":["dkWrite","dkConfirm"],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":128},"description":"仅写操作必填；同一次业务动作重试保持原值。"},{"name":"If-Match","in":"header","required":false,"schema":{"type":"string"},"description":"修改、确认、撤销、纠错、索引设置和结构化新版保存必填；分组按对象ETag，指定批次另需本头部。"},{"name":"X-Memory-Recovery-Scope","in":"header","required":false,"schema":{"type":"string","pattern":"^[0-9a-f]{64}$"},"description":"仅用于memory、memory_query来源及memory_feedback私有分支；分区不一致时409且不写入身份或业务数据。"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"additionalProperties":false,"properties":{"actor_context":{"additionalProperties":false,"properties":{"subject_id":{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","title":"Subject Id","type":"string"},"authorization_revision":{"exclusiveMaximum":4611686018427387904,"minimum":1,"title":"Authorization Revision","type":"integer"},"enabled":{"title":"Enabled","type":"boolean"},"teams":{"items":{"additionalProperties":false,"properties":{"team_id":{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","title":"Team Id","type":"string"},"role":{"enum":["member","reviewer"],"title":"Role","type":"string"}},"required":["team_id","role"],"title":"TeamGrant","type":"object"},"maxItems":1000,"title":"Teams","type":"array"},"knowledge_base_grants":{"items":{"additionalProperties":false,"properties":{"kb_id":{"pattern":"^[0-9a-f]{32}$","title":"Kb Id","type":"string"},"permissions":{"items":{"enum":["read","write","confirm"],"type":"string"},"maxItems":3,"minItems":1,"title":"Permissions","type":"array"}},"required":["kb_id","permissions"],"title":"KnowledgeGrant","type":"object"},"maxItems":1000,"title":"Knowledge Base Grants","type":"array"}},"required":["subject_id","authorization_revision","enabled","teams","knowledge_base_grants"],"title":"ActorContext","type":"object"},"kb_id":{"pattern":"^[0-9a-f]{32}$","title":"Kb Id","type":"string"},"process_id":{"pattern":"^[0-9a-f]{32}$","title":"Process Id","type":"string"},"verdict":{"enum":["correct","incorrect","suggestion"],"title":"Verdict","type":"string"},"comment":{"default":"","maxLength":2000,"title":"Comment","type":"string"},"suggested_answer":{"default":"","maxLength":6000,"title":"Suggested Answer","type":"string"},"action":{"const":"feedback","title":"Action","type":"string"},"origin_type":{"const":"memory_query","title":"Origin Type","type":"string"}},"required":["actor_context","kb_id","process_id","verdict","action","origin_type"],"title":"PrivateFeedbackRequest","type":"object"},{"additionalProperties":false,"properties":{"actor_context":{"additionalProperties":false,"properties":{"subject_id":{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","title":"Subject Id","type":"string"},"authorization_revision":{"exclusiveMaximum":4611686018427387904,"minimum":1,"title":"Authorization Revision","type":"integer"},"enabled":{"title":"Enabled","type":"boolean"},"teams":{"items":{"additionalProperties":false,"properties":{"team_id":{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","title":"Team Id","type":"string"},"role":{"enum":["member","reviewer"],"title":"Role","type":"string"}},"required":["team_id","role"],"title":"TeamGrant","type":"object"},"maxItems":1000,"title":"Teams","type":"array"},"knowledge_base_grants":{"items":{"additionalProperties":false,"properties":{"kb_id":{"pattern":"^[0-9a-f]{32}$","title":"Kb Id","type":"string"},"permissions":{"items":{"enum":["read","write","confirm"],"type":"string"},"maxItems":3,"minItems":1,"title":"Permissions","type":"array"}},"required":["kb_id","permissions"],"title":"KnowledgeGrant","type":"object"},"maxItems":1000,"title":"Knowledge Base Grants","type":"array"}},"required":["subject_id","authorization_revision","enabled","teams","knowledge_base_grants"],"title":"ActorContext","type":"object"},"action":{"const":"get","title":"Action","type":"string"},"resource_type":{"const":"memory_feedback","title":"Resource Type","type":"string"},"kb_id":{"pattern":"^[0-9a-f]{32}$","title":"Kb Id","type":"string"},"feedback_id":{"pattern":"^[0-9a-f]{32}$","title":"Feedback Id","type":"string"}},"required":["actor_context","action","resource_type","kb_id","feedback_id"],"title":"GetPrivateFeedback","type":"object"},{"additionalProperties":false,"properties":{"actor_context":{"additionalProperties":false,"properties":{"subject_id":{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","title":"Subject Id","type":"string"},"authorization_revision":{"exclusiveMaximum":4611686018427387904,"minimum":1,"title":"Authorization Revision","type":"integer"},"enabled":{"title":"Enabled","type":"boolean"},"teams":{"items":{"additionalProperties":false,"properties":{"team_id":{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","title":"Team Id","type":"string"},"role":{"enum":["member","reviewer"],"title":"Role","type":"string"}},"required":["team_id","role"],"title":"TeamGrant","type":"object"},"maxItems":1000,"title":"Teams","type":"array"},"knowledge_base_grants":{"items":{"additionalProperties":false,"properties":{"kb_id":{"pattern":"^[0-9a-f]{32}$","title":"Kb Id","type":"string"},"permissions":{"items":{"enum":["read","write","confirm"],"type":"string"},"maxItems":3,"minItems":1,"title":"Permissions","type":"array"}},"required":["kb_id","permissions"],"title":"KnowledgeGrant","type":"object"},"maxItems":1000,"title":"Knowledge Base Grants","type":"array"}},"required":["subject_id","authorization_revision","enabled","teams","knowledge_base_grants"],"title":"ActorContext","type":"object"},"action":{"const":"list","title":"Action","type":"string"},"resource_type":{"const":"memory_feedback","title":"Resource Type","type":"string"},"kb_id":{"pattern":"^[0-9a-f]{32}$","title":"Kb Id","type":"string"},"process_id":{"oneOf":[{"pattern":"^[0-9a-f]{32}$","type":"string"},{"type":"null"}],"title":"Process Id"},"cursor":{"default":"","pattern":"^(?:[0-9a-f]{32})?$","title":"Cursor","type":"string"},"limit":{"default":20,"maximum":100,"minimum":1,"title":"Limit","type":"integer"}},"required":["actor_context","action","resource_type","kb_id"],"title":"ListPrivateFeedback","type":"object"},{"additionalProperties":false,"properties":{"actor_context":{"additionalProperties":false,"properties":{"subject_id":{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","title":"Subject Id","type":"string"},"authorization_revision":{"exclusiveMaximum":4611686018427387904,"minimum":1,"title":"Authorization Revision","type":"integer"},"enabled":{"title":"Enabled","type":"boolean"},"teams":{"items":{"additionalProperties":false,"properties":{"team_id":{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","title":"Team Id","type":"string"},"role":{"enum":["member","reviewer"],"title":"Role","type":"string"}},"required":["team_id","role"],"title":"TeamGrant","type":"object"},"maxItems":1000,"title":"Teams","type":"array"},"knowledge_base_grants":{"items":{"additionalProperties":false,"properties":{"kb_id":{"pattern":"^[0-9a-f]{32}$","title":"Kb Id","type":"string"},"permissions":{"items":{"enum":["read","write","confirm"],"type":"string"},"maxItems":3,"minItems":1,"title":"Permissions","type":"array"}},"required":["kb_id","permissions"],"title":"KnowledgeGrant","type":"object"},"maxItems":1000,"title":"Knowledge Base Grants","type":"array"}},"required":["subject_id","authorization_revision","enabled","teams","knowledge_base_grants"],"title":"ActorContext","type":"object"},"memory_id":{"pattern":"^[0-9a-f]{32}$","title":"Memory Id","type":"string"},"memory_revision":{"exclusiveMaximum":4611686018427387904,"minimum":1,"title":"Memory Revision","type":"integer"},"kb_id":{"pattern":"^[0-9a-f]{32}$","title":"Kb Id","type":"string"},"question":{"oneOf":[{"maxLength":1000,"minLength":1,"type":"string"},{"type":"null"}],"title":"Question"},"qa_id":{"oneOf":[{"pattern":"^[0-9a-f]{32}$","type":"string"},{"type":"null"}],"title":"Qa Id"},"target_qa_revision":{"oneOf":[{"exclusiveMaximum":4611686018427387904,"minimum":1,"type":"integer"},{"type":"null"}],"title":"Target Qa Revision"},"action":{"const":"qa_save","title":"Action","type":"string"},"origin_type":{"const":"memory","title":"Origin Type","type":"string"}},"required":["actor_context","memory_id","memory_revision","kb_id","action","origin_type"],"title":"PrepareMemoryQaAnnotation","type":"object"},{"additionalProperties":false,"properties":{"actor_context":{"additionalProperties":false,"properties":{"subject_id":{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","title":"Subject Id","type":"string"},"authorization_revision":{"exclusiveMaximum":4611686018427387904,"minimum":1,"title":"Authorization Revision","type":"integer"},"enabled":{"title":"Enabled","type":"boolean"},"teams":{"items":{"additionalProperties":false,"properties":{"team_id":{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","title":"Team Id","type":"string"},"role":{"enum":["member","reviewer"],"title":"Role","type":"string"}},"required":["team_id","role"],"title":"TeamGrant","type":"object"},"maxItems":1000,"title":"Teams","type":"array"},"knowledge_base_grants":{"items":{"additionalProperties":false,"properties":{"kb_id":{"pattern":"^[0-9a-f]{32}$","title":"Kb Id","type":"string"},"permissions":{"items":{"enum":["read","write","confirm"],"type":"string"},"maxItems":3,"minItems":1,"title":"Permissions","type":"array"}},"required":["kb_id","permissions"],"title":"KnowledgeGrant","type":"object"},"maxItems":1000,"title":"Knowledge Base Grants","type":"array"}},"required":["subject_id","authorization_revision","enabled","teams","knowledge_base_grants"],"title":"ActorContext","type":"object"},"proposal_id":{"pattern":"^[0-9a-f]{32}$","title":"Proposal Id","type":"string"},"kb_id":{"pattern":"^[0-9a-f]{32}$","title":"Kb Id","type":"string"},"reason":{"maxLength":1000,"minLength":1,"title":"Reason","type":"string"},"action":{"const":"qa_confirm","title":"Action","type":"string"},"origin_type":{"const":"memory","title":"Origin Type","type":"string"}},"required":["actor_context","proposal_id","kb_id","reason","action","origin_type"],"title":"ConfirmMemoryQaAnnotation","type":"object"},{"additionalProperties":false,"properties":{"actor_context":{"additionalProperties":false,"properties":{"subject_id":{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","title":"Subject Id","type":"string"},"authorization_revision":{"exclusiveMaximum":4611686018427387904,"minimum":1,"title":"Authorization Revision","type":"integer"},"enabled":{"title":"Enabled","type":"boolean"},"teams":{"items":{"additionalProperties":false,"properties":{"team_id":{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","title":"Team Id","type":"string"},"role":{"enum":["member","reviewer"],"title":"Role","type":"string"}},"required":["team_id","role"],"title":"TeamGrant","type":"object"},"maxItems":1000,"title":"Teams","type":"array"},"knowledge_base_grants":{"items":{"additionalProperties":false,"properties":{"kb_id":{"pattern":"^[0-9a-f]{32}$","title":"Kb Id","type":"string"},"permissions":{"items":{"enum":["read","write","confirm"],"type":"string"},"maxItems":3,"minItems":1,"title":"Permissions","type":"array"}},"required":["kb_id","permissions"],"title":"KnowledgeGrant","type":"object"},"maxItems":1000,"title":"Knowledge Base Grants","type":"array"}},"required":["subject_id","authorization_revision","enabled","teams","knowledge_base_grants"],"title":"ActorContext","type":"object"},"proposal_id":{"pattern":"^[0-9a-f]{32}$","title":"Proposal Id","type":"string"},"kb_id":{"pattern":"^[0-9a-f]{32}$","title":"Kb Id","type":"string"},"reason":{"maxLength":1000,"minLength":1,"title":"Reason","type":"string"},"action":{"const":"qa_withdraw","title":"Action","type":"string"},"origin_type":{"const":"memory","title":"Origin Type","type":"string"}},"required":["actor_context","proposal_id","kb_id","reason","action","origin_type"],"title":"WithdrawMemoryQaAnnotation","type":"object"},{"additionalProperties":false,"properties":{"action":{"const":"save","title":"Action","type":"string"},"kb_id":{"maxLength":32,"minLength":1,"title":"Kb Id","type":"string"},"annotation_id":{"title":"Annotation Id","type":"null"},"payload":{"additionalProperties":false,"properties":{"target_id":{"title":"Target Id","type":"string"},"text":{"maxLength":10000,"minLength":1,"title":"Text","type":"string"},"edit_reason":{"default":"添加标注","maxLength":1000,"minLength":1,"title":"Edit Reason","type":"string"}},"required":["target_id","text"],"title":"Annotation","type":"object"}},"required":["action","kb_id","payload"],"title":"CreateKnowledgeAnnotation","type":"object"},{"additionalProperties":false,"properties":{"action":{"const":"save","title":"Action","type":"string"},"kb_id":{"maxLength":32,"minLength":1,"title":"Kb Id","type":"string"},"annotation_id":{"maxLength":32,"minLength":1,"title":"Annotation Id","type":"string"},"payload":{"additionalProperties":false,"properties":{"text":{"oneOf":[{"maxLength":10000,"minLength":1,"type":"string"},{"type":"null"}],"title":"Text"},"status":{"oneOf":[{"enum":["proposed","confirmed","withdrawn"],"type":"string"},{"type":"null"}],"title":"Status"},"edit_reason":{"maxLength":1000,"minLength":1,"title":"Edit Reason","type":"string"}},"required":["edit_reason"],"title":"AnnotationPatch","type":"object"}},"required":["action","kb_id","annotation_id","payload"],"title":"EditKnowledgeAnnotation","type":"object"},{"additionalProperties":false,"properties":{"action":{"const":"get","title":"Action","type":"string"},"kb_id":{"maxLength":32,"minLength":1,"title":"Kb Id","type":"string"},"annotation_id":{"maxLength":32,"minLength":1,"title":"Annotation Id","type":"string"},"revision":{"oneOf":[{"minimum":1,"type":"integer"},{"type":"null"}],"title":"Revision"},"resource_type":{"const":"annotation","default":"annotation","title":"Resource Type","type":"string"}},"required":["action","kb_id","annotation_id"],"title":"GetKnowledgeAnnotation","type":"object"},{"additionalProperties":false,"properties":{"action":{"const":"list","title":"Action","type":"string"},"kb_id":{"maxLength":32,"minLength":1,"title":"Kb Id","type":"string"},"cursor":{"default":"","maxLength":32,"title":"Cursor","type":"string"},"limit":{"default":50,"maximum":100,"minimum":1,"title":"Limit","type":"integer"},"resource_type":{"const":"annotation","default":"annotation","title":"Resource Type","type":"string"},"version_id":{"oneOf":[{"maxLength":32,"minLength":1,"type":"string"},{"type":"null"}],"title":"Version Id"}},"required":["action","kb_id"],"title":"ListKnowledgeAnnotations","type":"object"},{"additionalProperties":false,"properties":{"action":{"const":"feedback","title":"Action","type":"string"},"kb_id":{"maxLength":32,"minLength":1,"title":"Kb Id","type":"string"},"payload":{"additionalProperties":false,"properties":{"job_id":{"maxLength":32,"minLength":32,"pattern":"^[0-9a-f]{32}$","title":"Job Id","type":"string"},"verdict":{"enum":["correct","incorrect","suggestion"],"title":"Verdict","type":"string"},"comment":{"default":"","maxLength":2000,"title":"Comment","type":"string"},"suggested_answer":{"default":"","maxLength":6000,"title":"Suggested Answer","type":"string"}},"required":["job_id","verdict"],"title":"QueryFeedback","type":"object"}},"required":["action","kb_id","payload"],"title":"CreateQueryFeedback","type":"object"},{"additionalProperties":false,"properties":{"action":{"const":"qa_save","title":"Action","type":"string"},"kb_id":{"maxLength":32,"minLength":1,"title":"Kb Id","type":"string"},"annotation_id":{"title":"Annotation Id","type":"null"},"payload":{"additionalProperties":false,"properties":{"feedback_id":{"maxLength":32,"minLength":1,"title":"Feedback Id","type":"string"},"question":{"maxLength":1000,"minLength":1,"title":"Question","type":"string"},"answer":{"maxLength":6000,"minLength":1,"title":"Answer","type":"string"},"source_snapshot_id":{"maxLength":32,"minLength":1,"title":"Source Snapshot Id","type":"string"},"evidence_ids":{"items":{"type":"string"},"maxItems":20,"minItems":1,"title":"Evidence Ids","type":"array"},"primary_version_id":{"maxLength":32,"minLength":1,"title":"Primary Version Id","type":"string"},"scope":{"additionalProperties":false,"properties":{"attributes":{"oneOf":[{"maxProperties":50,"patternProperties":{"^[A-Za-z][A-Za-z0-9_]*$":{"maxLength":2000,"minLength":1,"type":"string"}},"propertyNames":{"maxLength":64,"minLength":1},"type":"object"},{"type":"null"}],"title":"Attributes"},"date_source":{"oneOf":[{"maxLength":75,"pattern":"^(effective_at|attributes\\.[A-Za-z][A-Za-z0-9_]{0,63})$","type":"string"},{"type":"null"}],"title":"Date Source"},"organization":{"oneOf":[{"maxLength":255,"minLength":1,"type":"string"},{"type":"null"}],"title":"Organization"},"personnel_category":{"oneOf":[{"maxLength":255,"minLength":1,"type":"string"},{"type":"null"}],"title":"Personnel Category"},"valid_from":{"oneOf":[{"format":"date","type":"string"},{"type":"null"}],"title":"Valid From"},"valid_to":{"oneOf":[{"format":"date","type":"string"},{"type":"null"}],"title":"Valid To"},"conditions":{"default":"","maxLength":1000,"title":"Conditions","type":"string"}},"title":"QaScope","type":"object"},"edit_reason":{"maxLength":1000,"minLength":1,"title":"Edit Reason","type":"string"}},"required":["feedback_id","question","answer","source_snapshot_id","evidence_ids","primary_version_id","scope","edit_reason"],"title":"StandardQa","type":"object"}},"required":["action","kb_id","payload"],"title":"CreateStandardQa","type":"object"},{"additionalProperties":false,"properties":{"action":{"const":"qa_save","title":"Action","type":"string"},"kb_id":{"maxLength":32,"minLength":1,"title":"Kb Id","type":"string"},"annotation_id":{"maxLength":32,"minLength":1,"title":"Annotation Id","type":"string"},"payload":{"additionalProperties":false,"properties":{"feedback_id":{"maxLength":32,"minLength":1,"title":"Feedback Id","type":"string"},"question":{"maxLength":1000,"minLength":1,"title":"Question","type":"string"},"answer":{"maxLength":6000,"minLength":1,"title":"Answer","type":"string"},"source_snapshot_id":{"maxLength":32,"minLength":1,"title":"Source Snapshot Id","type":"string"},"evidence_ids":{"items":{"type":"string"},"maxItems":20,"minItems":1,"title":"Evidence Ids","type":"array"},"primary_version_id":{"maxLength":32,"minLength":1,"title":"Primary Version Id","type":"string"},"scope":{"additionalProperties":false,"properties":{"attributes":{"oneOf":[{"maxProperties":50,"patternProperties":{"^[A-Za-z][A-Za-z0-9_]*$":{"maxLength":2000,"minLength":1,"type":"string"}},"propertyNames":{"maxLength":64,"minLength":1},"type":"object"},{"type":"null"}],"title":"Attributes"},"date_source":{"oneOf":[{"maxLength":75,"pattern":"^(effective_at|attributes\\.[A-Za-z][A-Za-z0-9_]{0,63})$","type":"string"},{"type":"null"}],"title":"Date Source"},"organization":{"oneOf":[{"maxLength":255,"minLength":1,"type":"string"},{"type":"null"}],"title":"Organization"},"personnel_category":{"oneOf":[{"maxLength":255,"minLength":1,"type":"string"},{"type":"null"}],"title":"Personnel Category"},"valid_from":{"oneOf":[{"format":"date","type":"string"},{"type":"null"}],"title":"Valid From"},"valid_to":{"oneOf":[{"format":"date","type":"string"},{"type":"null"}],"title":"Valid To"},"conditions":{"default":"","maxLength":1000,"title":"Conditions","type":"string"}},"title":"QaScope","type":"object"},"edit_reason":{"maxLength":1000,"minLength":1,"title":"Edit Reason","type":"string"}},"required":["feedback_id","question","answer","source_snapshot_id","evidence_ids","primary_version_id","scope","edit_reason"],"title":"StandardQa","type":"object"}},"required":["action","kb_id","annotation_id","payload"],"title":"EditStandardQa","type":"object"},{"additionalProperties":false,"properties":{"action":{"const":"qa_confirm","title":"Action","type":"string"},"kb_id":{"maxLength":32,"minLength":1,"title":"Kb Id","type":"string"},"annotation_id":{"maxLength":32,"minLength":1,"title":"Annotation Id","type":"string"},"payload":{"additionalProperties":false,"properties":{"edit_reason":{"maxLength":1000,"minLength":1,"title":"Edit Reason","type":"string"}},"required":["edit_reason"],"title":"Confirmation","type":"object"}},"required":["action","kb_id","annotation_id","payload"],"title":"ConfirmStandardQa","type":"object"},{"additionalProperties":false,"properties":{"action":{"const":"qa_withdraw","title":"Action","type":"string"},"kb_id":{"maxLength":32,"minLength":1,"title":"Kb Id","type":"string"},"annotation_id":{"maxLength":32,"minLength":1,"title":"Annotation Id","type":"string"},"payload":{"additionalProperties":false,"properties":{"edit_reason":{"maxLength":1000,"minLength":1,"title":"Edit Reason","type":"string"}},"required":["edit_reason"],"title":"Confirmation","type":"object"}},"required":["action","kb_id","annotation_id","payload"],"title":"WithdrawStandardQa","type":"object"},{"additionalProperties":false,"properties":{"action":{"const":"get","title":"Action","type":"string"},"kb_id":{"maxLength":32,"minLength":1,"title":"Kb Id","type":"string"},"feedback_id":{"maxLength":32,"minLength":1,"title":"Feedback Id","type":"string"},"revision":{"oneOf":[{"minimum":1,"type":"integer"},{"type":"null"}],"title":"Revision"},"resource_type":{"const":"feedback","title":"Resource Type","type":"string"}},"required":["action","kb_id","feedback_id","resource_type"],"title":"GetQueryFeedback","type":"object"},{"additionalProperties":false,"properties":{"action":{"const":"list","title":"Action","type":"string"},"kb_id":{"maxLength":32,"minLength":1,"title":"Kb Id","type":"string"},"cursor":{"default":"","maxLength":32,"title":"Cursor","type":"string"},"limit":{"default":50,"maximum":100,"minimum":1,"title":"Limit","type":"integer"},"resource_type":{"const":"feedback","title":"Resource Type","type":"string"},"job_id":{"oneOf":[{"maxLength":32,"minLength":1,"type":"string"},{"type":"null"}],"title":"Job Id"}},"required":["action","kb_id","resource_type"],"title":"ListQueryFeedback","type":"object"},{"additionalProperties":false,"properties":{"action":{"const":"get","title":"Action","type":"string"},"kb_id":{"maxLength":32,"minLength":1,"title":"Kb Id","type":"string"},"annotation_id":{"maxLength":32,"minLength":1,"title":"Annotation Id","type":"string"},"revision":{"oneOf":[{"minimum":1,"type":"integer"},{"type":"null"}],"title":"Revision"},"resource_type":{"const":"standard_qa","title":"Resource Type","type":"string"}},"required":["action","kb_id","annotation_id","resource_type"],"title":"GetStandardQa","type":"object"},{"additionalProperties":false,"properties":{"action":{"const":"list","title":"Action","type":"string"},"kb_id":{"maxLength":32,"minLength":1,"title":"Kb Id","type":"string"},"cursor":{"default":"","maxLength":32,"title":"Cursor","type":"string"},"limit":{"default":50,"maximum":100,"minimum":1,"title":"Limit","type":"integer"},"resource_type":{"const":"standard_qa","title":"Resource Type","type":"string"},"status":{"oneOf":[{"enum":["proposed","confirmed","needs_review","withdrawn"],"type":"string"},{"type":"null"}],"title":"Status"}},"required":["action","kb_id","resource_type"],"title":"ListStandardQa","type":"object"}],"title":"dkMaintainAnnotationsInput"},"examples":{"PrivateFeedbackRequest":{"summary":"feedback（私人查询反馈）","value":{"action":"feedback","kb_id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","actor_context":{"subject_id":"example-user","authorization_revision":1,"enabled":true,"teams":[],"knowledge_base_grants":[{"kb_id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","permissions":["read"]}]},"origin_type":"memory_query","process_id":"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb","verdict":"correct"}},"GetPrivateFeedback":{"summary":"get（私人查询反馈）","value":{"action":"get","kb_id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","actor_context":{"subject_id":"example-user","authorization_revision":1,"enabled":true,"teams":[],"knowledge_base_grants":[{"kb_id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","permissions":["read"]}]},"resource_type":"memory_feedback","feedback_id":"cccccccccccccccccccccccccccccccc"}},"ListPrivateFeedback":{"summary":"list（私人查询反馈）","value":{"action":"list","kb_id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","actor_context":{"subject_id":"example-user","authorization_revision":1,"enabled":true,"teams":[],"knowledge_base_grants":[{"kb_id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","permissions":["read"]}]},"resource_type":"memory_feedback"}},"PrepareMemoryQaAnnotation":{"summary":"qa_save（记忆来源）","value":{"action":"qa_save","origin_type":"memory","kb_id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","actor_context":{"subject_id":"example-user","authorization_revision":1,"enabled":true,"teams":[],"knowledge_base_grants":[{"kb_id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","permissions":["read","write","confirm"]}]},"memory_id":"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb","memory_revision":1}},"ConfirmMemoryQaAnnotation":{"summary":"qa_confirm（记忆来源）","value":{"action":"qa_confirm","origin_type":"memory","kb_id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","actor_context":{"subject_id":"example-user","authorization_revision":1,"enabled":true,"teams":[],"knowledge_base_grants":[{"kb_id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","permissions":["read","write","confirm"]}]},"proposal_id":"cccccccccccccccccccccccccccccccc","reason":"核对拟公开内容与适用范围"}},"WithdrawMemoryQaAnnotation":{"summary":"qa_withdraw（记忆来源）","value":{"action":"qa_withdraw","origin_type":"memory","kb_id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","actor_context":{"subject_id":"example-user","authorization_revision":1,"enabled":true,"teams":[],"knowledge_base_grants":[{"kb_id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","permissions":["read","write","confirm"]}]},"proposal_id":"cccccccccccccccccccccccccccccccc","reason":"核对拟公开内容与适用范围"}},"CreateKnowledgeAnnotation":{"summary":"save（新增）","value":{"action":"save","kb_id":"demo-base","payload":{"target_id":"version-b","text":"待核对的虚构说明"}}},"EditKnowledgeAnnotation":{"summary":"save（修改）","value":{"action":"save","kb_id":"demo-base","annotation_id":"demo-annotation_id","payload":{"text":"已核对的虚构说明","edit_reason":"核对虚构材料"}}},"GetKnowledgeAnnotation":{"summary":"get","value":{"action":"get","kb_id":"demo-base","annotation_id":"demo-annotation_id"}},"ListKnowledgeAnnotations":{"summary":"list","value":{"action":"list","kb_id":"demo-base"}},"CreateQueryFeedback":{"summary":"feedback","value":{"action":"feedback","kb_id":"demo-base","payload":{"job_id":"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","verdict":"suggestion","comment":"建议补充适用人员"}}},"CreateStandardQa":{"summary":"qa_save（新增）","value":{"action":"qa_save","kb_id":"demo-base","payload":{"feedback_id":"feedback","question":"该标准适用于哪些人员？","answer":"按所附虚构制度正文列明的人员范围执行。","source_snapshot_id":"snapshot","evidence_ids":["evidence"],"primary_version_id":"version-b","scope":{"conditions":"以正文列明的适用范围为准"},"edit_reason":"核对虚构材料"}}},"EditStandardQa":{"summary":"qa_save","value":{"action":"qa_save","kb_id":"demo-base","annotation_id":"demo-annotation_id","payload":{"feedback_id":"feedback","question":"该标准适用于哪些人员？","answer":"按所附虚构制度正文列明的人员范围执行。","source_snapshot_id":"snapshot","evidence_ids":["evidence"],"primary_version_id":"version-b","scope":{"conditions":"以正文列明的适用范围为准"},"edit_reason":"核对虚构材料"}}},"ConfirmStandardQa":{"summary":"qa_confirm","value":{"action":"qa_confirm","kb_id":"demo-base","annotation_id":"demo-annotation_id","payload":{"edit_reason":"核对虚构材料"}}},"WithdrawStandardQa":{"summary":"qa_withdraw","value":{"action":"qa_withdraw","kb_id":"demo-base","annotation_id":"demo-annotation_id","payload":{"edit_reason":"核对虚构材料"}}},"GetQueryFeedback":{"summary":"get","value":{"action":"get","kb_id":"demo-base","feedback_id":"demo-feedback_id","resource_type":"feedback"}},"ListQueryFeedback":{"summary":"list","value":{"action":"list","kb_id":"demo-base","resource_type":"feedback"}},"GetStandardQa":{"summary":"get","value":{"action":"get","kb_id":"demo-base","annotation_id":"demo-annotation_id","resource_type":"standard_qa"}},"ListStandardQa":{"summary":"list","value":{"action":"list","kb_id":"demo-base","resource_type":"standard_qa"}}}}}}}},"/open/v1/knowledge/reasons":{"post":{"tags":["7. 动态知识库"],"summary":"变化原因维护","description":"**接入前必读**：完整状态、效力、鉴权、异步及错误边界见动态知识库接入指南：`/swagger-ui/open-v1/docs/dynamic-knowledge`。\n\n**分支调用边界**：以下列出本页样例基础形态的权限与条件头；历史revision、confirmed标注、分组及参考稿保存的附加要求见各分支正文和接入指南，组合权限须同时具备。字段、类型、默认值、上限及互斥条件以本页请求Schema为准。业务响应no-store，写入后读取最新ETag，异步结果沿原任务入口取得。\n\n**CreateKnowledgeReason · action=save**：必填`action、kb_id、payload`；权限`dkWrite`；Idempotency-Key必填；If-Match不需要；成功HTTP 202。人工录入变化原因，change_ids非空且变化须有效，evidence_ids只能引用当前可见证据；初态proposed、来源human_statement，不自动确认。\n\n**EditKnowledgeReason · action=save**：必填`action、kb_id、reason_id、payload`；权限`dkWrite`；Idempotency-Key必填；If-Match必填；成功HTTP 202。编辑后回到proposed，withdrawn=true可撤回；原文说明不自动等于已确认原因，旧确认不得沿用到已修改文本。\n\n**ConfirmKnowledgeReason · action=confirm**：必填`action、kb_id、reason_id、payload`；权限`dkConfirm`；Idempotency-Key必填；If-Match必填；成功HTTP 202。人工确认当前原因及其变化/证据依赖，异步刷新索引；只确认这一因果说明，不发布制度，也不把其他变化的原因移用过来。\n\n**GetKnowledgeReason · action=get**：必填`action、kb_id、reason_id`；权限`dkRead`；Idempotency-Key不需要；If-Match不需要；成功HTTP 200。读取原因及source_type/review_status、变化/证据关联；只有当前confirmed且来源仍可核验的原因才可用于确定因果回答。\n\n**共同限制**：ready不等于released，确认/快照发布不等于制度正式发布；旧来源撤权不能靠历史快照绕过。","operationId":"dkMaintainReasons","responses":{"200":{"description":"请求已成功处理","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","properties":{"id":{"type":"string"},"kb_id":{"type":"string"},"kind":{"type":"string"},"state":{"type":"string"},"parent_id":{"type":["string","null"]},"revision":{"type":"integer","minimum":1},"etag":{"type":"string"},"body":{"type":"object","description":"对应 kind 的固定修订内容；读取历史修订需要审计权限。"},"action":{"const":"get"}},"required":["id","kb_id","kind","state","parent_id","revision","etag","body","action"]},"error":{"type":"null"}}}]}}}},"202":{"description":"任务已受理；请使用 job_id 查询进度和结果","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"oneOf":[{"type":"object","properties":{"job_id":{"type":"string"},"status":{"const":"queued"},"status_url":{"type":"string","pattern":"^/open/v1/job/[0-9a-f]{32}$","description":"查询任务状态，成功后在该地址追加 /result 读取结果。"},"etag":{"type":"string"},"reason_id":{"type":"string"},"action":{"const":"save"}},"required":["job_id","status","status_url","reason_id","action"]},{"type":"object","properties":{"job_id":{"type":"string"},"status":{"const":"queued"},"status_url":{"type":"string","pattern":"^/open/v1/job/[0-9a-f]{32}$","description":"查询任务状态，成功后在该地址追加 /result 读取结果。"},"etag":{"type":"string"},"reason_id":{"type":"string"},"action":{"const":"confirm"}},"required":["job_id","status","status_url","reason_id","action"]}]},"error":{"type":"null"}}}]}}},"headers":{"Location":{"description":"任务状态查询地址","schema":{"type":"string","example":"/open/v1/job/0123456789abcdef0123456789abcdef"}}},"links":{"查询任务进度":{"operationId":"getJob","parameters":{"job_id":"$response.body#/data/job_id"},"description":"使用本次返回的 job_id 查询任务进度。"},"读取任务结果":{"operationId":"getJobResult","parameters":{"job_id":"$response.body#/data/job_id"},"description":"任务 succeeded 后读取结构化结果。"}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"409":{"description":"幂等键、任务状态或资源状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"412":{"description":"资源修订已变化，请重新读取后提交","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"413":{"description":"请求体过大","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"422":{"description":"文件内容无法转换(已确认文件被截断、不完整,重传无效)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"428":{"description":"缺少资源修订前置条件 If-Match","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"429":{"description":"队列或模型并发额度已满，请稍后重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"dkRead","x-stability":"preview","x-alternative-scopes":["dkWrite","dkConfirm"],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":128},"description":"仅写操作必填；同一次业务动作重试保持原值。"},{"name":"If-Match","in":"header","required":false,"schema":{"type":"string"},"description":"修改、确认、撤销、纠错、索引设置和结构化新版保存必填；分组按对象ETag，指定批次另需本头部。"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"additionalProperties":false,"properties":{"action":{"const":"save","title":"Action","type":"string"},"kb_id":{"maxLength":32,"minLength":1,"title":"Kb Id","type":"string"},"reason_id":{"title":"Reason Id","type":"null"},"payload":{"additionalProperties":false,"properties":{"text":{"maxLength":10000,"minLength":1,"title":"Text","type":"string"},"change_ids":{"items":{"type":"string"},"maxItems":100,"minItems":1,"title":"Change Ids","type":"array"},"evidence_ids":{"items":{"type":"string"},"maxItems":100,"title":"Evidence Ids","type":"array"},"edit_reason":{"maxLength":1000,"minLength":1,"title":"Edit Reason","type":"string"}},"required":["text","change_ids","edit_reason"],"title":"Reason","type":"object"}},"required":["action","kb_id","payload"],"title":"CreateKnowledgeReason","type":"object"},{"additionalProperties":false,"properties":{"action":{"const":"save","title":"Action","type":"string"},"kb_id":{"maxLength":32,"minLength":1,"title":"Kb Id","type":"string"},"reason_id":{"maxLength":32,"minLength":1,"title":"Reason Id","type":"string"},"payload":{"additionalProperties":false,"properties":{"text":{"oneOf":[{"maxLength":10000,"minLength":1,"type":"string"},{"type":"null"}],"title":"Text"},"change_ids":{"oneOf":[{"items":{"type":"string"},"maxItems":100,"minItems":1,"type":"array"},{"type":"null"}],"title":"Change Ids"},"evidence_ids":{"oneOf":[{"items":{"type":"string"},"maxItems":100,"type":"array"},{"type":"null"}],"title":"Evidence Ids"},"withdrawn":{"default":false,"title":"Withdrawn","type":"boolean"},"edit_reason":{"maxLength":1000,"minLength":1,"title":"Edit Reason","type":"string"}},"required":["edit_reason"],"title":"ReasonPatch","type":"object"}},"required":["action","kb_id","reason_id","payload"],"title":"EditKnowledgeReason","type":"object"},{"additionalProperties":false,"properties":{"action":{"const":"confirm","title":"Action","type":"string"},"kb_id":{"maxLength":32,"minLength":1,"title":"Kb Id","type":"string"},"reason_id":{"maxLength":32,"minLength":1,"title":"Reason Id","type":"string"},"payload":{"additionalProperties":false,"properties":{"edit_reason":{"maxLength":1000,"minLength":1,"title":"Edit Reason","type":"string"}},"required":["edit_reason"],"title":"Confirmation","type":"object"}},"required":["action","kb_id","reason_id","payload"],"title":"ConfirmKnowledgeReason","type":"object"},{"additionalProperties":false,"properties":{"action":{"const":"get","title":"Action","type":"string"},"kb_id":{"maxLength":32,"minLength":1,"title":"Kb Id","type":"string"},"reason_id":{"maxLength":32,"minLength":1,"title":"Reason Id","type":"string"},"revision":{"oneOf":[{"minimum":1,"type":"integer"},{"type":"null"}],"title":"Revision"}},"required":["action","kb_id","reason_id"],"title":"GetKnowledgeReason","type":"object"}],"title":"dkMaintainReasonsInput"},"examples":{"CreateKnowledgeReason":{"summary":"save（新增）","value":{"action":"save","kb_id":"demo-base","payload":{"text":"虚构变更原因","change_ids":["change"],"edit_reason":"核对虚构材料"}}},"EditKnowledgeReason":{"summary":"save（修改）","value":{"action":"save","kb_id":"demo-base","reason_id":"demo-reason_id","payload":{"text":"核对后的虚构原因","edit_reason":"核对虚构材料"}}},"ConfirmKnowledgeReason":{"summary":"confirm","value":{"action":"confirm","kb_id":"demo-base","reason_id":"demo-reason_id","payload":{"edit_reason":"核对虚构材料"}}},"GetKnowledgeReason":{"summary":"get","value":{"action":"get","kb_id":"demo-base","reason_id":"demo-reason_id"}}}}}}}},"/open/v1/knowledge/evidence":{"post":{"tags":["7. 动态知识库"],"summary":"引用原文核验","description":"**接入前必读**：完整状态、效力、鉴权、异步及错误边界见动态知识库接入指南：`/swagger-ui/open-v1/docs/dynamic-knowledge`。\n\n**分支调用边界**：以下列出本页样例基础形态的权限与条件头；历史revision、confirmed标注、分组及参考稿保存的附加要求见各分支正文和接入指南，组合权限须同时具备。字段、类型、默认值、上限及互斥条件以本页请求Schema为准。业务响应no-store，写入后读取最新ETag，异步结果沿原任务入口取得。\n\n**ReadKnowledgeEvidence · action=get**：必填`action、kb_id、evidence_id`；权限`dkRead`；Idempotency-Key不需要；If-Match不需要；成功HTTP 200。evidence_id必须属于本Space/库；恢复历史回答时携带结果snapshot_id。省略快照读取当前活动快照，可能与旧任务不同；旧快照也仍检查当前来源撤权。503表示无法核实，不能当作404或空证据吞掉。\n\n**共同限制**：ready不等于released，确认/快照发布不等于制度正式发布；旧来源撤权不能靠历史快照绕过。","operationId":"dkReadEvidence","responses":{"200":{"description":"请求已成功处理","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","properties":{"evidence_id":{"type":"string"},"object_id":{"type":"string"},"source_kind":{"type":"string"},"block_id":{"type":"string"},"title":{"type":"string"},"text":{"type":"string"},"snapshot_id":{"type":"string"},"document_id":{"type":["string","null"]},"version_id":{"type":["string","null"]},"revision":{"type":"integer"},"anchor":{"type":"object"},"section_path":{"type":"array","items":{"type":"string"}},"table_cells":{"type":"array","items":{"type":"object"}},"action":{"const":"get"}},"required":["evidence_id","object_id","revision","source_kind","text","anchor","action"]},"error":{"type":"null"}}}]}}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"409":{"description":"幂等键、任务状态或资源状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"412":{"description":"资源修订已变化，请重新读取后提交","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"413":{"description":"请求体过大","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"422":{"description":"文件内容无法转换(已确认文件被截断、不完整,重传无效)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"428":{"description":"缺少资源修订前置条件 If-Match","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"429":{"description":"队列或模型并发额度已满，请稍后重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"dkRead","x-stability":"preview","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":128},"description":"仅写操作必填；同一次业务动作重试保持原值。"},{"name":"If-Match","in":"header","required":false,"schema":{"type":"string"},"description":"修改、确认、撤销、纠错、索引设置和结构化新版保存必填；分组按对象ETag，指定批次另需本头部。"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"action":{"const":"get","title":"Action","type":"string"},"kb_id":{"maxLength":32,"minLength":1,"title":"Kb Id","type":"string"},"evidence_id":{"maxLength":32,"minLength":1,"title":"Evidence Id","type":"string"},"snapshot_id":{"oneOf":[{"type":"string"},{"type":"null"}],"title":"Snapshot Id"}},"required":["action","kb_id","evidence_id"],"title":"dkReadEvidenceInput","type":"object"},"examples":{"ReadKnowledgeEvidence":{"summary":"get","value":{"action":"get","kb_id":"demo-base","evidence_id":"demo-evidence_id"}}}}}}}},"/open/v1/knowledge/index":{"post":{"tags":["7. 动态知识库"],"summary":"检索索引设置","description":"**接入前必读**：完整状态、效力、鉴权、异步及错误边界见动态知识库接入指南：`/swagger-ui/open-v1/docs/dynamic-knowledge`。\n\n**分支调用边界**：以下列出本页样例基础形态的权限与条件头；历史revision、confirmed标注、分组及参考稿保存的附加要求见各分支正文和接入指南，组合权限须同时具备。字段、类型、默认值、上限及互斥条件以本页请求Schema为准。业务响应no-store，写入后读取最新ETag，异步结果沿原任务入口取得。\n\n**GetKnowledgeIndex · action=get**：必填`action、kb_id`；权限`dkRead`；Idempotency-Key不需要；If-Match不需要；成功HTTP 200。semantic_available是服务端能力，semantic_enabled是本库偏好，active_semantic是活动快照是否已有向量；三者不同，active_snapshot_id可能为空。无设置记录的ETag为\"0\"。\n\n**SetKnowledgeIndex · action=set**：必填`action、kb_id、payload`；权限`dkWrite`；Idempotency-Key必填；If-Match必填；成功HTTP 202。客户端只能在服务端允许时启用语义索引；全局未开启却请求true返回409。写入偏好后异步重建快照，成功前不能宣称向量已可用；关闭后保留词法检索，不删除原件。\n\n**共同限制**：ready不等于released，确认/快照发布不等于制度正式发布；旧来源撤权不能靠历史快照绕过。","operationId":"dkConfigureIndex","responses":{"200":{"description":"请求已成功处理","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","properties":{"semantic_available":{"type":"boolean"},"semantic_enabled":{"type":"boolean"},"active_semantic":{"type":["boolean","null"]},"active_snapshot_id":{"type":["string","null"]},"etag":{"type":"string"},"action":{"const":"get"}},"required":["semantic_available","semantic_enabled","active_semantic","active_snapshot_id","etag","action"]},"error":{"type":"null"}}}]}}}},"202":{"description":"任务已受理；请使用 job_id 查询进度和结果","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","properties":{"job_id":{"type":"string"},"status":{"const":"queued"},"status_url":{"type":"string","pattern":"^/open/v1/job/[0-9a-f]{32}$","description":"查询任务状态，成功后在该地址追加 /result 读取结果。"},"etag":{"type":"string"},"action":{"const":"set"}},"required":["job_id","status","status_url","action"]},"error":{"type":"null"}}}]}}},"headers":{"Location":{"description":"任务状态查询地址","schema":{"type":"string","example":"/open/v1/job/0123456789abcdef0123456789abcdef"}}},"links":{"查询任务进度":{"operationId":"getJob","parameters":{"job_id":"$response.body#/data/job_id"},"description":"使用本次返回的 job_id 查询任务进度。"},"读取任务结果":{"operationId":"getJobResult","parameters":{"job_id":"$response.body#/data/job_id"},"description":"任务 succeeded 后读取结构化结果。"}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"409":{"description":"幂等键、任务状态或资源状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"412":{"description":"资源修订已变化，请重新读取后提交","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"413":{"description":"请求体过大","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"422":{"description":"文件内容无法转换(已确认文件被截断、不完整,重传无效)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"428":{"description":"缺少资源修订前置条件 If-Match","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"429":{"description":"队列或模型并发额度已满，请稍后重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"dkRead","x-stability":"preview","x-alternative-scopes":["dkWrite"],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":128},"description":"仅写操作必填；同一次业务动作重试保持原值。"},{"name":"If-Match","in":"header","required":false,"schema":{"type":"string"},"description":"修改、确认、撤销、纠错、索引设置和结构化新版保存必填；分组按对象ETag，指定批次另需本头部。"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"additionalProperties":false,"properties":{"action":{"const":"get","title":"Action","type":"string"},"kb_id":{"maxLength":32,"minLength":1,"title":"Kb Id","type":"string"}},"required":["action","kb_id"],"title":"GetKnowledgeIndex","type":"object"},{"additionalProperties":false,"properties":{"action":{"const":"set","title":"Action","type":"string"},"kb_id":{"maxLength":32,"minLength":1,"title":"Kb Id","type":"string"},"payload":{"additionalProperties":false,"properties":{"semantic_enabled":{"title":"Semantic Enabled","type":"boolean"},"edit_reason":{"maxLength":1000,"minLength":1,"title":"Edit Reason","type":"string"}},"required":["semantic_enabled","edit_reason"],"title":"IndexSettings","type":"object"}},"required":["action","kb_id","payload"],"title":"SetKnowledgeIndex","type":"object"}],"title":"dkConfigureIndexInput"},"examples":{"GetKnowledgeIndex":{"summary":"get","value":{"action":"get","kb_id":"demo-base"}},"SetKnowledgeIndex":{"summary":"set","value":{"action":"set","kb_id":"demo-base","payload":{"semantic_enabled":false,"edit_reason":"核对虚构材料"}}}}}}}}},"/open/v1/knowledge/publications":{"post":{"tags":["7. 动态知识库"],"summary":"知识快照发布","description":"**接入前必读**：完整状态、效力、鉴权、异步及错误边界见动态知识库接入指南：`/swagger-ui/open-v1/docs/dynamic-knowledge`。\n\n**分支调用边界**：以下列出本页样例基础形态的权限与条件头；历史revision、confirmed标注、分组及参考稿保存的附加要求见各分支正文和接入指南，组合权限须同时具备。字段、类型、默认值、上限及互斥条件以本页请求Schema为准。业务响应no-store，写入后读取最新ETag，异步结果沿原任务入口取得。\n\n**PublishKnowledgeSnapshot · action=publish**：必填`action、kb_id、payload`；权限`dkPublish`；Idempotency-Key必填；If-Match不需要；成功HTTP 202。固定revisions中的对象/修订及必要依赖，baseline_snapshot_id可约束活动基线；空revisions按当前可发布候选选择。任务以CAS原子切换检索快照，来源/基线变化或依赖不完整时拒绝。这是索引快照发布，不会把版本publication_status从draft改成released，也不代替OA审批。\n\n**GetKnowledgePublication · action=get**：必填`action、kb_id、publication_id`；权限`dkRead`；Idempotency-Key不需要；If-Match不需要；成功HTTP 200。读取固定发布清单、任务状态、快照及失败信息；旧发布状态可查仍要核对其固定来源。不能仅凭此对象存在就认定切换成功，须检查对应任务。\n\n**共同限制**：ready不等于released，确认/快照发布不等于制度正式发布；旧来源撤权不能靠历史快照绕过。","operationId":"dkPublishKnowledge","responses":{"200":{"description":"请求已成功处理","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","properties":{"id":{"type":"string"},"job_id":{"type":["string","null"]},"status":{"type":"string"},"snapshot_id":{"type":["string","null"]},"baseline_snapshot_id":{"type":["string","null"]},"error":{"type":["object","null"]},"revisions":{"type":"array","items":{"type":"object"}},"action":{"const":"get"}},"required":["id","job_id","status","snapshot_id","error","revisions","action"]},"error":{"type":"null"}}}]}}}},"202":{"description":"任务已受理；请使用 job_id 查询进度和结果","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","properties":{"job_id":{"type":"string"},"status":{"const":"queued"},"status_url":{"type":"string","pattern":"^/open/v1/job/[0-9a-f]{32}$","description":"查询任务状态，成功后在该地址追加 /result 读取结果。"},"etag":{"type":"string"},"publication_id":{"type":"string"},"action":{"const":"publish"}},"required":["job_id","status","status_url","publication_id","action"]},"error":{"type":"null"}}}]}}},"headers":{"Location":{"description":"任务状态查询地址","schema":{"type":"string","example":"/open/v1/job/0123456789abcdef0123456789abcdef"}}},"links":{"查询任务进度":{"operationId":"getJob","parameters":{"job_id":"$response.body#/data/job_id"},"description":"使用本次返回的 job_id 查询任务进度。"},"读取任务结果":{"operationId":"getJobResult","parameters":{"job_id":"$response.body#/data/job_id"},"description":"任务 succeeded 后读取结构化结果。"}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"409":{"description":"幂等键、任务状态或资源状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"412":{"description":"资源修订已变化，请重新读取后提交","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"413":{"description":"请求体过大","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"422":{"description":"文件内容无法转换(已确认文件被截断、不完整,重传无效)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"428":{"description":"缺少资源修订前置条件 If-Match","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"429":{"description":"队列或模型并发额度已满，请稍后重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"dkRead","x-stability":"preview","x-alternative-scopes":["dkPublish"],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":128},"description":"仅写操作必填；同一次业务动作重试保持原值。"},{"name":"If-Match","in":"header","required":false,"schema":{"type":"string"},"description":"修改、确认、撤销、纠错、索引设置和结构化新版保存必填；分组按对象ETag，指定批次另需本头部。"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"additionalProperties":false,"properties":{"action":{"const":"publish","title":"Action","type":"string"},"kb_id":{"maxLength":32,"minLength":1,"title":"Kb Id","type":"string"},"payload":{"additionalProperties":false,"properties":{"revisions":{"items":{"additionalProperties":false,"properties":{"object_id":{"maxLength":32,"minLength":1,"title":"Object Id","type":"string"},"revision":{"minimum":1,"title":"Revision","type":"integer"}},"required":["object_id","revision"],"title":"RevisionSelection","type":"object"},"maxItems":10000,"title":"Revisions","type":"array"},"baseline_snapshot_id":{"oneOf":[{"maxLength":32,"minLength":1,"type":"string"},{"type":"null"}],"title":"Baseline Snapshot Id"}},"title":"Publication","type":"object"}},"required":["action","kb_id","payload"],"title":"PublishKnowledgeSnapshot","type":"object"},{"additionalProperties":false,"properties":{"action":{"const":"get","title":"Action","type":"string"},"kb_id":{"maxLength":32,"minLength":1,"title":"Kb Id","type":"string"},"publication_id":{"maxLength":32,"minLength":1,"title":"Publication Id","type":"string"}},"required":["action","kb_id","publication_id"],"title":"GetKnowledgePublication","type":"object"}],"title":"dkPublishKnowledgeInput"},"examples":{"PublishKnowledgeSnapshot":{"summary":"publish","value":{"action":"publish","kb_id":"demo-base","payload":{"revisions":[]}}},"GetKnowledgePublication":{"summary":"get","value":{"action":"get","kb_id":"demo-base","publication_id":"demo-publication_id"}}}}}}}},"/open/v1/knowledge/conversations":{"post":{"tags":["7. 动态知识库"],"summary":"对话历史管理","description":"仅由持有应用Key的可信业务后端传递完整actor_context；不得将浏览器或模型自报的身份作为授权。最终用户、团队与库权限取当前完整授权快照，授权变化须递增authorization_revision并sync_subject。get/list/recall/get_process要求dkRead，写操作要求dkWrite，团队审核另需dkConfirm，历史记忆修订另需dkAudit。record保存已完成消息，处理状态分别位于context_processing和memory_processing；保存成功不等于提炼完成。异步process_id只能通过memories/get_process查询，不能使用公共job接口；retry_process只重试原私有过程。原执行Key在受理后、派发前撤销、失去所需权限或移出原应用委托时，worker将其标为failed/retryable，错误execution_key_unavailable；功能关闭或临时依赖故障不当成Key失效。当前同应用、同Space、同用户且授权未变化的合法Key可携带当前If-Match和新Idempotency-Key显式恢复，也可在worker标记前恢复未派发pending。保留原process_id和来源，更新执行Key并新增attempt；不自动换Key，不重派已派发或成功的过程。recall不传会话ID仍可召回本人长期记忆，不传team_ids仅个人；knowledge_mode默认off，evidence须指定单个kb_id并按本人当前库权限合并已确认的知识证据。只做词法证据检索，不生成答案、不学习或写历史。知识证据与记忆共用context_budget，超预算整条省略并标记truncated，不截断正文和适用条件；knowledge_snapshot_id供原evidence入口核验，knowledge_pending_updates提示尚未入快照的变更。联合query统一使用knowledge/query的query_mode=memory分支，需knowledge_base_id、actor_context、Idempotency-Key和dkRead；learn或record_history另需dkWrite。memories不再接受action=query。query默认read=true、learn=false、short_term=true、record_history=false；只查evidence不能学习或保存回答。保存查询历史须提供external_conversation_id及query_turn_id；回答、学习与历史保存状态分别返回，失败子过程独立重试。合法的无逐条引用回答或超过100条引用的回答也可保存完整历史，服务内部独立保留固定查询来源证明，过程到期不删除该证明。历史get中的knowledge_reference_status=verified表示来源核验通过；query_context仅给出固定库和快照，不是客户端可写的knowledge_context。来源失效或撤权时只隐藏对应知识回答并说明原因，核验暂不可用则明确失败；查询证明不能代替知识提炼的正文依据。标准问答沉淀统一使用annotations的origin_type=memory及qa_save/qa_confirm/qa_withdraw；memories不再接受promote_qa。qa_save准备私有候选，qa_withdraw携带proposal_id、kb_id、reason和候选If-Match撤回。若来源QA或本次检索QA的问题、答案和完整适用条件等价，过程返回status=reused、proposal_id=null及原qa_id/qa_revision，不新增QA或改写原依赖，无需再次confirm；原QA的retrieval_status仍须核对。新内容仍先生成待确认候选。不能用派生记忆覆盖其来源QA形成循环；source_cycle须改用独立正文来源或创建独立问答，不自动换目标。confirm使用同样的候选标识与If-Match确认固定内容，复用原标准问答和索引；retrieval_status=ready才表示可检索。撤回要求当前目标库read/write/confirm权限；原记忆失效不阻止撤回，已批准问答同步停止使用并安排索引刷新。候选不等于团队共享或知识入库；submit_team披露候选，reviewer确认后才生效。save的source.kind=memory_feedback分支传kb_id、feedback_id及revision，仅核验本人反馈并生成候选；意见和建议答案不作制度依据，无真实正文依据返回needs_basis，不自动确认或公开。save的refresh_basis=true分支只接受memory_id、edit_reason及当前If-Match；服务按原依据文档查询并生成新候选，不接收客户端自报的新正文或来源，不恢复已忘记或过期事项；缺少可确认依据时返回needs_basis。get/list的update分别描述待刷新、排队、运行、待确认、缺依据及失败；process_id仅向原过程本人提供，团队成员只见合法的进度元信息。requires_authorized_refresh表示原后台授权已失效或当前人员无权刷新，可由当前有权人员通过save/refresh_basis重新提交；不自动扩大授权。所有响应no-store；关闭记忆服务返回503并保留数据，身份或来源失败不伪装成正常空结果。","operationId":"dkManageConversationHistory","responses":{"200":{"description":"请求已成功处理","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"oneOf":[{"type":"object","properties":{"conversation_id":{"type":["string","null"]},"etag":{"type":"string"},"history_status":{"type":"string"},"stored_message_ids":{"type":"array","items":{"type":"string"}},"stored_message_revisions":{"type":"array","items":{"type":"object"}},"context_processing":{"type":"object"},"memory_processing":{"type":"object"},"task_id":{"type":"string"},"task_etag":{"type":"string"},"action":{"const":"record"}},"required":["history_status","stored_message_ids","context_processing","memory_processing","action"]},{"type":"object","properties":{"conversation_id":{"type":"string"},"external_conversation_id":{"type":"string"},"revision":{"type":"integer","minimum":1},"etag":{"type":"string"},"state":{"type":"string"},"messages_page":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object"}},"next_cursor":{"type":["string","null"]}},"required":["items","next_cursor"]},"action":{"const":"get"}},"required":["conversation_id","messages_page","etag","action"]},{"type":"object","properties":{"task_id":{"type":"string"},"task_etag":{"type":"string"},"status":{"type":"string"},"context_revision":{"type":"integer","minimum":1},"summary":{"type":["string","null"]},"action":{"const":"get"}},"required":["task_id","task_etag","action"]},{"type":"object","properties":{"items":{"type":"array","items":{"type":"object"}},"next_cursor":{"type":["string","null"]},"action":{"const":"list"}},"required":["items","next_cursor","action"]},{"type":"object","properties":{"conversation_id":{"type":"string"},"task_id":{"type":"string"},"state":{"type":"string"},"etag":{"type":"string"},"action":{"const":"forget"}},"required":["state","action"]}]},"error":{"type":"null"}}}]}}}},"202":{"description":"任务已受理；请使用 job_id 查询进度和结果","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"oneOf":[{"type":"object","properties":{"conversation_id":{"type":["string","null"]},"etag":{"type":"string"},"history_status":{"type":"string"},"stored_message_ids":{"type":"array","items":{"type":"string"}},"stored_message_revisions":{"type":"array","items":{"type":"object"}},"context_processing":{"type":"object"},"memory_processing":{"type":"object"},"task_id":{"type":"string"},"task_etag":{"type":"string"},"action":{"const":"record"}},"required":["history_status","stored_message_ids","context_processing","memory_processing","action"]},{"type":"object","properties":{"conversation_id":{"type":"string"},"external_conversation_id":{"type":"string"},"revision":{"type":"integer","minimum":1},"etag":{"type":"string"},"state":{"type":"string"},"messages_page":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object"}},"next_cursor":{"type":["string","null"]}},"required":["items","next_cursor"]},"action":{"const":"get"}},"required":["conversation_id","messages_page","etag","action"]},{"type":"object","properties":{"task_id":{"type":"string"},"task_etag":{"type":"string"},"status":{"type":"string"},"context_revision":{"type":"integer","minimum":1},"summary":{"type":["string","null"]},"action":{"const":"get"}},"required":["task_id","task_etag","action"]},{"type":"object","properties":{"items":{"type":"array","items":{"type":"object"}},"next_cursor":{"type":["string","null"]},"action":{"const":"list"}},"required":["items","next_cursor","action"]},{"type":"object","properties":{"conversation_id":{"type":"string"},"task_id":{"type":"string"},"state":{"type":"string"},"etag":{"type":"string"},"action":{"const":"forget"}},"required":["state","action"]}]},"error":{"type":"null"}}}]}}},"headers":{"Location":{"description":"任务状态查询地址","schema":{"type":"string","example":"/open/v1/job/0123456789abcdef0123456789abcdef"}}},"links":{"查询任务进度":{"operationId":"getJob","parameters":{"job_id":"$response.body#/data/job_id"},"description":"使用本次返回的 job_id 查询任务进度。"},"读取任务结果":{"operationId":"getJobResult","parameters":{"job_id":"$response.body#/data/job_id"},"description":"任务 succeeded 后读取结构化结果。"}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"409":{"description":"幂等键、任务状态或资源状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"410":{"description":"处理结果已超过保留期限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"412":{"description":"资源修订已变化，请重新读取后提交","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"413":{"description":"请求体过大","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"422":{"description":"文件内容无法转换(已确认文件被截断、不完整,重传无效)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"428":{"description":"缺少资源修订前置条件 If-Match","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"429":{"description":"队列或模型并发额度已满，请稍后重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"dkRead","x-stability":"preview","x-alternative-scopes":["dkWrite"],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":128},"description":"所有写操作必填；同一动作重试保持原值。"},{"name":"X-Memory-Recovery-Scope","in":"header","required":false,"schema":{"type":"string","pattern":"^[0-9a-f]{64}$"},"description":"请求可携带sync_subject返回的recovery_scope作条件校验，sync_subject同样支持；服务端在同步用户授权和执行业务前比较，不一致返回409且不修改该作用域的授权或数据，不把旧请求重放到新应用或用户。这不是鉴权凭据。"},{"name":"If-Match","in":"header","required":false,"schema":{"type":"string"},"description":"修改、确认、忘记、共享和重试必填；追加消息不要求，消息更正使用消息ETag。"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"additionalProperties":false,"properties":{"actor_context":{"additionalProperties":false,"properties":{"subject_id":{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","title":"Subject Id","type":"string"},"authorization_revision":{"exclusiveMaximum":4611686018427387904,"minimum":1,"title":"Authorization Revision","type":"integer"},"enabled":{"title":"Enabled","type":"boolean"},"teams":{"items":{"additionalProperties":false,"properties":{"team_id":{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","title":"Team Id","type":"string"},"role":{"enum":["member","reviewer"],"title":"Role","type":"string"}},"required":["team_id","role"],"title":"TeamGrant","type":"object"},"maxItems":1000,"title":"Teams","type":"array"},"knowledge_base_grants":{"items":{"additionalProperties":false,"properties":{"kb_id":{"pattern":"^[0-9a-f]{32}$","title":"Kb Id","type":"string"},"permissions":{"items":{"enum":["read","write","confirm"],"type":"string"},"maxItems":3,"minItems":1,"title":"Permissions","type":"array"}},"required":["kb_id","permissions"],"title":"KnowledgeGrant","type":"object"},"maxItems":1000,"title":"Knowledge Base Grants","type":"array"}},"required":["subject_id","authorization_revision","enabled","teams","knowledge_base_grants"],"title":"ActorContext","type":"object"},"external_conversation_id":{"oneOf":[{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","type":"string"},{"type":"null"}],"title":"External Conversation Id"},"conversation_id":{"oneOf":[{"pattern":"^[0-9a-f]{32}$","type":"string"},{"type":"null"}],"title":"Conversation Id"},"context_team_id":{"oneOf":[{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","type":"string"},{"type":"null"}],"title":"Context Team Id"},"messages":{"items":{"additionalProperties":false,"properties":{"external_message_id":{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","title":"External Message Id","type":"string"},"turn_id":{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","title":"Turn Id","type":"string"},"sequence":{"exclusiveMaximum":4611686018427387904,"minimum":1,"title":"Sequence","type":"integer"},"role":{"enum":["user","assistant"],"title":"Role","type":"string"},"content":{"maxLength":100000,"minLength":1,"title":"Content","type":"string"},"occurred_at":{"format":"date-time","title":"Occurred At","type":"string"},"knowledge_context":{"oneOf":[{"additionalProperties":false,"properties":{"kb_id":{"pattern":"^[0-9a-f]{32}$","title":"Kb Id","type":"string"},"snapshot_id":{"pattern":"^[0-9a-f]{32}$","title":"Snapshot Id","type":"string"},"evidence_ids":{"items":{"pattern":"^[0-9a-f]{32}$","type":"string"},"maxItems":100,"minItems":1,"title":"Evidence Ids","type":"array"},"qa_refs":{"items":{"additionalProperties":false,"properties":{"id":{"pattern":"^[0-9a-f]{32}$","title":"Id","type":"string"},"revision":{"exclusiveMaximum":4611686018427387904,"minimum":1,"title":"Revision","type":"integer"}},"required":["id","revision"],"title":"QaReference","type":"object"},"maxItems":100,"title":"Qa Refs","type":"array"}},"required":["kb_id","snapshot_id","evidence_ids"],"title":"KnowledgeContext","type":"object"},{"type":"null"}]}},"required":["external_message_id","turn_id","sequence","role","content","occurred_at"],"title":"CompletedMessage","type":"object"},"maxItems":1000,"title":"Messages","type":"array"},"mode":{"default":"append","enum":["append","replace"],"title":"Mode","type":"string"},"replacement_message_id":{"oneOf":[{"pattern":"^[0-9a-f]{32}$","type":"string"},{"type":"null"}],"title":"Replacement Message Id"},"edit_reason":{"oneOf":[{"maxLength":1000,"minLength":1,"type":"string"},{"type":"null"}],"title":"Edit Reason"},"extract_memories":{"default":true,"title":"Extract Memories","type":"boolean"},"update_context":{"default":true,"title":"Update Context","type":"boolean"},"task_id":{"oneOf":[{"pattern":"^[0-9a-f]{32}$","type":"string"},{"type":"null"}],"title":"Task Id"},"external_task_id":{"oneOf":[{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","type":"string"},{"type":"null"}],"title":"External Task Id"},"task_etag":{"oneOf":[{"pattern":"^\"[1-9][0-9]*\"$","type":"string"},{"type":"null"}],"title":"Task Etag"},"task_update":{"oneOf":[{"additionalProperties":false,"properties":{"status":{"oneOf":[{"enum":["active","completed","abandoned"],"type":"string"},{"type":"null"}],"title":"Status"},"pending_items":{"oneOf":[{"items":{"maxLength":2000,"minLength":1,"type":"string"},"maxItems":100,"type":"array"},{"type":"null"}],"title":"Pending Items"}},"title":"TaskUpdate","type":"object"},{"type":"null"}]},"action":{"const":"record","title":"Action","type":"string"}},"required":["actor_context","messages","action"],"title":"RecordRequest","type":"object"},{"additionalProperties":false,"properties":{"actor_context":{"additionalProperties":false,"properties":{"subject_id":{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","title":"Subject Id","type":"string"},"authorization_revision":{"exclusiveMaximum":4611686018427387904,"minimum":1,"title":"Authorization Revision","type":"integer"},"enabled":{"title":"Enabled","type":"boolean"},"teams":{"items":{"additionalProperties":false,"properties":{"team_id":{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","title":"Team Id","type":"string"},"role":{"enum":["member","reviewer"],"title":"Role","type":"string"}},"required":["team_id","role"],"title":"TeamGrant","type":"object"},"maxItems":1000,"title":"Teams","type":"array"},"knowledge_base_grants":{"items":{"additionalProperties":false,"properties":{"kb_id":{"pattern":"^[0-9a-f]{32}$","title":"Kb Id","type":"string"},"permissions":{"items":{"enum":["read","write","confirm"],"type":"string"},"maxItems":3,"minItems":1,"title":"Permissions","type":"array"}},"required":["kb_id","permissions"],"title":"KnowledgeGrant","type":"object"},"maxItems":1000,"title":"Knowledge Base Grants","type":"array"}},"required":["subject_id","authorization_revision","enabled","teams","knowledge_base_grants"],"title":"ActorContext","type":"object"},"cursor":{"default":"","maxLength":1024,"title":"Cursor","type":"string"},"limit":{"default":20,"maximum":100,"minimum":1,"title":"Limit","type":"integer"},"action":{"const":"get","title":"Action","type":"string"},"target_type":{"const":"conversation","default":"conversation","title":"Target Type","type":"string"},"conversation_id":{"pattern":"^[0-9a-f]{32}$","title":"Conversation Id","type":"string"}},"required":["actor_context","action","conversation_id"],"title":"GetConversation","type":"object"},{"additionalProperties":false,"properties":{"actor_context":{"additionalProperties":false,"properties":{"subject_id":{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","title":"Subject Id","type":"string"},"authorization_revision":{"exclusiveMaximum":4611686018427387904,"minimum":1,"title":"Authorization Revision","type":"integer"},"enabled":{"title":"Enabled","type":"boolean"},"teams":{"items":{"additionalProperties":false,"properties":{"team_id":{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","title":"Team Id","type":"string"},"role":{"enum":["member","reviewer"],"title":"Role","type":"string"}},"required":["team_id","role"],"title":"TeamGrant","type":"object"},"maxItems":1000,"title":"Teams","type":"array"},"knowledge_base_grants":{"items":{"additionalProperties":false,"properties":{"kb_id":{"pattern":"^[0-9a-f]{32}$","title":"Kb Id","type":"string"},"permissions":{"items":{"enum":["read","write","confirm"],"type":"string"},"maxItems":3,"minItems":1,"title":"Permissions","type":"array"}},"required":["kb_id","permissions"],"title":"KnowledgeGrant","type":"object"},"maxItems":1000,"title":"Knowledge Base Grants","type":"array"}},"required":["subject_id","authorization_revision","enabled","teams","knowledge_base_grants"],"title":"ActorContext","type":"object"},"action":{"const":"get","title":"Action","type":"string"},"target_type":{"const":"task","title":"Target Type","type":"string"},"task_id":{"pattern":"^[0-9a-f]{32}$","title":"Task Id","type":"string"}},"required":["actor_context","action","target_type","task_id"],"title":"GetTask","type":"object"},{"additionalProperties":false,"properties":{"actor_context":{"additionalProperties":false,"properties":{"subject_id":{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","title":"Subject Id","type":"string"},"authorization_revision":{"exclusiveMaximum":4611686018427387904,"minimum":1,"title":"Authorization Revision","type":"integer"},"enabled":{"title":"Enabled","type":"boolean"},"teams":{"items":{"additionalProperties":false,"properties":{"team_id":{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","title":"Team Id","type":"string"},"role":{"enum":["member","reviewer"],"title":"Role","type":"string"}},"required":["team_id","role"],"title":"TeamGrant","type":"object"},"maxItems":1000,"title":"Teams","type":"array"},"knowledge_base_grants":{"items":{"additionalProperties":false,"properties":{"kb_id":{"pattern":"^[0-9a-f]{32}$","title":"Kb Id","type":"string"},"permissions":{"items":{"enum":["read","write","confirm"],"type":"string"},"maxItems":3,"minItems":1,"title":"Permissions","type":"array"}},"required":["kb_id","permissions"],"title":"KnowledgeGrant","type":"object"},"maxItems":1000,"title":"Knowledge Base Grants","type":"array"}},"required":["subject_id","authorization_revision","enabled","teams","knowledge_base_grants"],"title":"ActorContext","type":"object"},"cursor":{"default":"","maxLength":1024,"title":"Cursor","type":"string"},"limit":{"default":20,"maximum":100,"minimum":1,"title":"Limit","type":"integer"},"action":{"const":"list","title":"Action","type":"string"},"target_type":{"const":"conversation","default":"conversation","title":"Target Type","type":"string"}},"required":["actor_context","action"],"title":"ListConversations","type":"object"},{"additionalProperties":false,"properties":{"actor_context":{"additionalProperties":false,"properties":{"subject_id":{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","title":"Subject Id","type":"string"},"authorization_revision":{"exclusiveMaximum":4611686018427387904,"minimum":1,"title":"Authorization Revision","type":"integer"},"enabled":{"title":"Enabled","type":"boolean"},"teams":{"items":{"additionalProperties":false,"properties":{"team_id":{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","title":"Team Id","type":"string"},"role":{"enum":["member","reviewer"],"title":"Role","type":"string"}},"required":["team_id","role"],"title":"TeamGrant","type":"object"},"maxItems":1000,"title":"Teams","type":"array"},"knowledge_base_grants":{"items":{"additionalProperties":false,"properties":{"kb_id":{"pattern":"^[0-9a-f]{32}$","title":"Kb Id","type":"string"},"permissions":{"items":{"enum":["read","write","confirm"],"type":"string"},"maxItems":3,"minItems":1,"title":"Permissions","type":"array"}},"required":["kb_id","permissions"],"title":"KnowledgeGrant","type":"object"},"maxItems":1000,"title":"Knowledge Base Grants","type":"array"}},"required":["subject_id","authorization_revision","enabled","teams","knowledge_base_grants"],"title":"ActorContext","type":"object"},"cursor":{"default":"","maxLength":1024,"title":"Cursor","type":"string"},"limit":{"default":20,"maximum":100,"minimum":1,"title":"Limit","type":"integer"},"action":{"const":"list","title":"Action","type":"string"},"target_type":{"const":"task","title":"Target Type","type":"string"},"status":{"oneOf":[{"enum":["active","completed","abandoned"],"type":"string"},{"type":"null"}],"title":"Status"}},"required":["actor_context","action","target_type"],"title":"ListTasks","type":"object"},{"additionalProperties":false,"properties":{"actor_context":{"additionalProperties":false,"properties":{"subject_id":{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","title":"Subject Id","type":"string"},"authorization_revision":{"exclusiveMaximum":4611686018427387904,"minimum":1,"title":"Authorization Revision","type":"integer"},"enabled":{"title":"Enabled","type":"boolean"},"teams":{"items":{"additionalProperties":false,"properties":{"team_id":{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","title":"Team Id","type":"string"},"role":{"enum":["member","reviewer"],"title":"Role","type":"string"}},"required":["team_id","role"],"title":"TeamGrant","type":"object"},"maxItems":1000,"title":"Teams","type":"array"},"knowledge_base_grants":{"items":{"additionalProperties":false,"properties":{"kb_id":{"pattern":"^[0-9a-f]{32}$","title":"Kb Id","type":"string"},"permissions":{"items":{"enum":["read","write","confirm"],"type":"string"},"maxItems":3,"minItems":1,"title":"Permissions","type":"array"}},"required":["kb_id","permissions"],"title":"KnowledgeGrant","type":"object"},"maxItems":1000,"title":"Knowledge Base Grants","type":"array"}},"required":["subject_id","authorization_revision","enabled","teams","knowledge_base_grants"],"title":"ActorContext","type":"object"},"action":{"const":"forget","title":"Action","type":"string"},"target_type":{"const":"conversation","default":"conversation","title":"Target Type","type":"string"},"conversation_id":{"pattern":"^[0-9a-f]{32}$","title":"Conversation Id","type":"string"},"reason":{"maxLength":1000,"minLength":1,"title":"Reason","type":"string"}},"required":["actor_context","action","conversation_id","reason"],"title":"ForgetConversation","type":"object"},{"additionalProperties":false,"properties":{"actor_context":{"additionalProperties":false,"properties":{"subject_id":{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","title":"Subject Id","type":"string"},"authorization_revision":{"exclusiveMaximum":4611686018427387904,"minimum":1,"title":"Authorization Revision","type":"integer"},"enabled":{"title":"Enabled","type":"boolean"},"teams":{"items":{"additionalProperties":false,"properties":{"team_id":{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","title":"Team Id","type":"string"},"role":{"enum":["member","reviewer"],"title":"Role","type":"string"}},"required":["team_id","role"],"title":"TeamGrant","type":"object"},"maxItems":1000,"title":"Teams","type":"array"},"knowledge_base_grants":{"items":{"additionalProperties":false,"properties":{"kb_id":{"pattern":"^[0-9a-f]{32}$","title":"Kb Id","type":"string"},"permissions":{"items":{"enum":["read","write","confirm"],"type":"string"},"maxItems":3,"minItems":1,"title":"Permissions","type":"array"}},"required":["kb_id","permissions"],"title":"KnowledgeGrant","type":"object"},"maxItems":1000,"title":"Knowledge Base Grants","type":"array"}},"required":["subject_id","authorization_revision","enabled","teams","knowledge_base_grants"],"title":"ActorContext","type":"object"},"action":{"const":"forget","title":"Action","type":"string"},"target_type":{"const":"task","title":"Target Type","type":"string"},"task_id":{"pattern":"^[0-9a-f]{32}$","title":"Task Id","type":"string"},"reason":{"maxLength":1000,"minLength":1,"title":"Reason","type":"string"}},"required":["actor_context","action","target_type","task_id","reason"],"title":"ForgetTask","type":"object"}],"title":"RootModel[Union[RecordRequest, GetConversation, GetTask, ListConversations, ListTasks, ForgetConversation, ForgetTask]]"}}}}}},"/open/v1/knowledge/memories":{"post":{"tags":["7. 动态知识库"],"summary":"跨会话记忆管理","description":"仅由持有应用Key的可信业务后端传递完整actor_context；不得将浏览器或模型自报的身份作为授权。最终用户、团队与库权限取当前完整授权快照，授权变化须递增authorization_revision并sync_subject。get/list/recall/get_process要求dkRead，写操作要求dkWrite，团队审核另需dkConfirm，历史记忆修订另需dkAudit。record保存已完成消息，处理状态分别位于context_processing和memory_processing；保存成功不等于提炼完成。异步process_id只能通过memories/get_process查询，不能使用公共job接口；retry_process只重试原私有过程。原执行Key在受理后、派发前撤销、失去所需权限或移出原应用委托时，worker将其标为failed/retryable，错误execution_key_unavailable；功能关闭或临时依赖故障不当成Key失效。当前同应用、同Space、同用户且授权未变化的合法Key可携带当前If-Match和新Idempotency-Key显式恢复，也可在worker标记前恢复未派发pending。保留原process_id和来源，更新执行Key并新增attempt；不自动换Key，不重派已派发或成功的过程。recall不传会话ID仍可召回本人长期记忆，不传team_ids仅个人；knowledge_mode默认off，evidence须指定单个kb_id并按本人当前库权限合并已确认的知识证据。只做词法证据检索，不生成答案、不学习或写历史。知识证据与记忆共用context_budget，超预算整条省略并标记truncated，不截断正文和适用条件；knowledge_snapshot_id供原evidence入口核验，knowledge_pending_updates提示尚未入快照的变更。联合query统一使用knowledge/query的query_mode=memory分支，需knowledge_base_id、actor_context、Idempotency-Key和dkRead；learn或record_history另需dkWrite。memories不再接受action=query。query默认read=true、learn=false、short_term=true、record_history=false；只查evidence不能学习或保存回答。保存查询历史须提供external_conversation_id及query_turn_id；回答、学习与历史保存状态分别返回，失败子过程独立重试。合法的无逐条引用回答或超过100条引用的回答也可保存完整历史，服务内部独立保留固定查询来源证明，过程到期不删除该证明。历史get中的knowledge_reference_status=verified表示来源核验通过；query_context仅给出固定库和快照，不是客户端可写的knowledge_context。来源失效或撤权时只隐藏对应知识回答并说明原因，核验暂不可用则明确失败；查询证明不能代替知识提炼的正文依据。标准问答沉淀统一使用annotations的origin_type=memory及qa_save/qa_confirm/qa_withdraw；memories不再接受promote_qa。qa_save准备私有候选，qa_withdraw携带proposal_id、kb_id、reason和候选If-Match撤回。若来源QA或本次检索QA的问题、答案和完整适用条件等价，过程返回status=reused、proposal_id=null及原qa_id/qa_revision，不新增QA或改写原依赖，无需再次confirm；原QA的retrieval_status仍须核对。新内容仍先生成待确认候选。不能用派生记忆覆盖其来源QA形成循环；source_cycle须改用独立正文来源或创建独立问答，不自动换目标。confirm使用同样的候选标识与If-Match确认固定内容，复用原标准问答和索引；retrieval_status=ready才表示可检索。撤回要求当前目标库read/write/confirm权限；原记忆失效不阻止撤回，已批准问答同步停止使用并安排索引刷新。候选不等于团队共享或知识入库；submit_team披露候选，reviewer确认后才生效。save的source.kind=memory_feedback分支传kb_id、feedback_id及revision，仅核验本人反馈并生成候选；意见和建议答案不作制度依据，无真实正文依据返回needs_basis，不自动确认或公开。save的refresh_basis=true分支只接受memory_id、edit_reason及当前If-Match；服务按原依据文档查询并生成新候选，不接收客户端自报的新正文或来源，不恢复已忘记或过期事项；缺少可确认依据时返回needs_basis。get/list的update分别描述待刷新、排队、运行、待确认、缺依据及失败；process_id仅向原过程本人提供，团队成员只见合法的进度元信息。requires_authorized_refresh表示原后台授权已失效或当前人员无权刷新，可由当前有权人员通过save/refresh_basis重新提交；不自动扩大授权。所有响应no-store；关闭记忆服务返回503并保留数据，身份或来源失败不伪装成正常空结果。","operationId":"dkManageMemories","responses":{"200":{"description":"请求已成功处理","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"oneOf":[{"type":"object","properties":{"recent_messages":{"type":"array","items":{"type":"object"}},"short_term_context":{"type":"array","items":{"type":"object"}},"personal_memories":{"type":"array","items":{"type":"object"}},"team_memories":{"type":"array","items":{"type":"object"}},"knowledge_evidence":{"type":"array","items":{"type":"object"}},"pending_conflicts":{"type":"array","items":{"type":"object"}},"source_refs":{"type":"array","items":{"type":"object"}},"retrieval_mode":{"type":"string"},"knowledge_retrieval_mode":{"enum":["off","lexical"]},"knowledge_snapshot_id":{"type":["string","null"]},"knowledge_pending_updates":{"type":"boolean"},"used_budget":{"type":"object","properties":{"value":{"type":"integer","minimum":0},"unit":{"const":"unicode_code_points"}},"required":["value","unit"]},"truncated":{"type":"boolean"},"warnings":{"type":"array","items":{"type":"string"}},"action":{"const":"recall"}},"required":["recent_messages","short_term_context","personal_memories","team_memories","knowledge_evidence","pending_conflicts","source_refs","retrieval_mode","used_budget","truncated","warnings","action"]},{"type":"object","properties":{"memory_id":{"type":"string"},"revision":{"type":"integer","minimum":1},"etag":{"type":"string"},"owner_scope":{"type":"string"},"team_id":{"type":["string","null"]},"type":{"type":"string"},"state":{"type":"string"},"sharing_state":{"type":"string"},"active":{"type":["object","null"]},"candidate":{"type":["object","null"]},"eligible":{"type":"boolean"},"pending_review":{"type":"boolean"},"basis_status":{"type":"string"},"update":{"type":"object","properties":{"status":{"enum":["not_required","current","refresh_required","pending","running","awaiting_confirmation","requires_authorized_refresh","needs_basis","no_relevant_memory","failed","cancelled","skipped"]},"process_id":{"type":["string","null"]}},"required":["status","process_id"]},"action":{"const":"save"}},"required":["memory_id","revision","etag","state","action"]},{"type":"object","properties":{"process_id":{"type":"string"},"status":{"type":"string"},"revision":{"type":"integer","minimum":1},"etag":{"type":"string"},"stage":{"type":["string","null"]},"result":{"type":["object","null"]},"error":{"type":["object","null"]},"retryable":{"type":"boolean"},"action":{"const":"save"}},"required":["process_id","status","action"]},{"type":"object","properties":{"memory_id":{"type":"string"},"revision":{"type":"integer","minimum":1},"etag":{"type":"string"},"owner_scope":{"type":"string"},"team_id":{"type":["string","null"]},"type":{"type":"string"},"state":{"type":"string"},"sharing_state":{"type":"string"},"active":{"type":["object","null"]},"candidate":{"type":["object","null"]},"eligible":{"type":"boolean"},"pending_review":{"type":"boolean"},"basis_status":{"type":"string"},"update":{"type":"object","properties":{"status":{"enum":["not_required","current","refresh_required","pending","running","awaiting_confirmation","requires_authorized_refresh","needs_basis","no_relevant_memory","failed","cancelled","skipped"]},"process_id":{"type":["string","null"]}},"required":["status","process_id"]},"action":{"const":"get"}},"required":["memory_id","revision","etag","state","action"]},{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"memory_id":{"type":"string"},"revision":{"type":"integer","minimum":1},"etag":{"type":"string"},"owner_scope":{"type":"string"},"team_id":{"type":["string","null"]},"type":{"type":"string"},"state":{"type":"string"},"sharing_state":{"type":"string"},"active":{"type":["object","null"]},"candidate":{"type":["object","null"]},"eligible":{"type":"boolean"},"pending_review":{"type":"boolean"},"basis_status":{"type":"string"},"update":{"type":"object","properties":{"status":{"enum":["not_required","current","refresh_required","pending","running","awaiting_confirmation","requires_authorized_refresh","needs_basis","no_relevant_memory","failed","cancelled","skipped"]},"process_id":{"type":["string","null"]}},"required":["status","process_id"]}},"required":["memory_id","revision","etag","state"]}},"next_cursor":{"type":["string","null"]},"action":{"const":"list"}},"required":["items","next_cursor","action"]},{"type":"object","properties":{"memory_id":{"type":"string"},"revision":{"type":"integer","minimum":1},"etag":{"type":"string"},"owner_scope":{"type":"string"},"team_id":{"type":["string","null"]},"type":{"type":"string"},"state":{"type":"string"},"sharing_state":{"type":"string"},"active":{"type":["object","null"]},"candidate":{"type":["object","null"]},"eligible":{"type":"boolean"},"pending_review":{"type":"boolean"},"basis_status":{"type":"string"},"update":{"type":"object","properties":{"status":{"enum":["not_required","current","refresh_required","pending","running","awaiting_confirmation","requires_authorized_refresh","needs_basis","no_relevant_memory","failed","cancelled","skipped"]},"process_id":{"type":["string","null"]}},"required":["status","process_id"]},"action":{"const":"submit_team"}},"required":["memory_id","revision","etag","state","action"]},{"type":"object","properties":{"memory_id":{"type":"string"},"revision":{"type":"integer","minimum":1},"etag":{"type":"string"},"owner_scope":{"type":"string"},"team_id":{"type":["string","null"]},"type":{"type":"string"},"state":{"type":"string"},"sharing_state":{"type":"string"},"active":{"type":["object","null"]},"candidate":{"type":["object","null"]},"eligible":{"type":"boolean"},"pending_review":{"type":"boolean"},"basis_status":{"type":"string"},"update":{"type":"object","properties":{"status":{"enum":["not_required","current","refresh_required","pending","running","awaiting_confirmation","requires_authorized_refresh","needs_basis","no_relevant_memory","failed","cancelled","skipped"]},"process_id":{"type":["string","null"]}},"required":["status","process_id"]},"action":{"const":"confirm"}},"required":["memory_id","revision","etag","state","action"]},{"type":"object","properties":{"memory_id":{"type":"string"},"revision":{"type":"integer","minimum":1},"etag":{"type":"string"},"owner_scope":{"type":"string"},"team_id":{"type":["string","null"]},"type":{"type":"string"},"state":{"type":"string"},"sharing_state":{"type":"string"},"active":{"type":["object","null"]},"candidate":{"type":["object","null"]},"eligible":{"type":"boolean"},"pending_review":{"type":"boolean"},"basis_status":{"type":"string"},"update":{"type":"object","properties":{"status":{"enum":["not_required","current","refresh_required","pending","running","awaiting_confirmation","requires_authorized_refresh","needs_basis","no_relevant_memory","failed","cancelled","skipped"]},"process_id":{"type":["string","null"]}},"required":["status","process_id"]},"action":{"const":"forget"}},"required":["memory_id","revision","etag","state","action"]},{"type":"object","properties":{"process_id":{"type":"string"},"status":{"type":"string"},"revision":{"type":"integer","minimum":1},"etag":{"type":"string"},"stage":{"type":["string","null"]},"result":{"type":["object","null"]},"error":{"type":["object","null"]},"retryable":{"type":"boolean"},"action":{"const":"get_process"}},"required":["process_id","status","action"]},{"type":"object","properties":{"process_id":{"type":"string"},"status":{"type":"string"},"revision":{"type":"integer","minimum":1},"etag":{"type":"string"},"stage":{"type":["string","null"]},"result":{"type":["object","null"]},"error":{"type":["object","null"]},"retryable":{"type":"boolean"},"action":{"const":"retry_process"}},"required":["process_id","status","action"]},{"type":"object","properties":{"authorization_revision":{"type":"integer","minimum":1},"enabled":{"type":"boolean"},"recovery_scope":{"type":"string","pattern":"^[0-9a-f]{64}$","description":"服务端生成的恢复分区，跨Key轮换和授权修订保持稳定；不是鉴权凭据，调用仍须当前完整授权。"},"action":{"const":"sync_subject"}},"required":["authorization_revision","enabled","recovery_scope","action"]}]},"error":{"type":"null"}}}]}}}},"202":{"description":"任务已受理；请使用 job_id 查询进度和结果","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"oneOf":[{"type":"object","properties":{"recent_messages":{"type":"array","items":{"type":"object"}},"short_term_context":{"type":"array","items":{"type":"object"}},"personal_memories":{"type":"array","items":{"type":"object"}},"team_memories":{"type":"array","items":{"type":"object"}},"knowledge_evidence":{"type":"array","items":{"type":"object"}},"pending_conflicts":{"type":"array","items":{"type":"object"}},"source_refs":{"type":"array","items":{"type":"object"}},"retrieval_mode":{"type":"string"},"knowledge_retrieval_mode":{"enum":["off","lexical"]},"knowledge_snapshot_id":{"type":["string","null"]},"knowledge_pending_updates":{"type":"boolean"},"used_budget":{"type":"object","properties":{"value":{"type":"integer","minimum":0},"unit":{"const":"unicode_code_points"}},"required":["value","unit"]},"truncated":{"type":"boolean"},"warnings":{"type":"array","items":{"type":"string"}},"action":{"const":"recall"}},"required":["recent_messages","short_term_context","personal_memories","team_memories","knowledge_evidence","pending_conflicts","source_refs","retrieval_mode","used_budget","truncated","warnings","action"]},{"type":"object","properties":{"memory_id":{"type":"string"},"revision":{"type":"integer","minimum":1},"etag":{"type":"string"},"owner_scope":{"type":"string"},"team_id":{"type":["string","null"]},"type":{"type":"string"},"state":{"type":"string"},"sharing_state":{"type":"string"},"active":{"type":["object","null"]},"candidate":{"type":["object","null"]},"eligible":{"type":"boolean"},"pending_review":{"type":"boolean"},"basis_status":{"type":"string"},"update":{"type":"object","properties":{"status":{"enum":["not_required","current","refresh_required","pending","running","awaiting_confirmation","requires_authorized_refresh","needs_basis","no_relevant_memory","failed","cancelled","skipped"]},"process_id":{"type":["string","null"]}},"required":["status","process_id"]},"action":{"const":"save"}},"required":["memory_id","revision","etag","state","action"]},{"type":"object","properties":{"process_id":{"type":"string"},"status":{"type":"string"},"revision":{"type":"integer","minimum":1},"etag":{"type":"string"},"stage":{"type":["string","null"]},"result":{"type":["object","null"]},"error":{"type":["object","null"]},"retryable":{"type":"boolean"},"action":{"const":"save"}},"required":["process_id","status","action"]},{"type":"object","properties":{"memory_id":{"type":"string"},"revision":{"type":"integer","minimum":1},"etag":{"type":"string"},"owner_scope":{"type":"string"},"team_id":{"type":["string","null"]},"type":{"type":"string"},"state":{"type":"string"},"sharing_state":{"type":"string"},"active":{"type":["object","null"]},"candidate":{"type":["object","null"]},"eligible":{"type":"boolean"},"pending_review":{"type":"boolean"},"basis_status":{"type":"string"},"update":{"type":"object","properties":{"status":{"enum":["not_required","current","refresh_required","pending","running","awaiting_confirmation","requires_authorized_refresh","needs_basis","no_relevant_memory","failed","cancelled","skipped"]},"process_id":{"type":["string","null"]}},"required":["status","process_id"]},"action":{"const":"get"}},"required":["memory_id","revision","etag","state","action"]},{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"memory_id":{"type":"string"},"revision":{"type":"integer","minimum":1},"etag":{"type":"string"},"owner_scope":{"type":"string"},"team_id":{"type":["string","null"]},"type":{"type":"string"},"state":{"type":"string"},"sharing_state":{"type":"string"},"active":{"type":["object","null"]},"candidate":{"type":["object","null"]},"eligible":{"type":"boolean"},"pending_review":{"type":"boolean"},"basis_status":{"type":"string"},"update":{"type":"object","properties":{"status":{"enum":["not_required","current","refresh_required","pending","running","awaiting_confirmation","requires_authorized_refresh","needs_basis","no_relevant_memory","failed","cancelled","skipped"]},"process_id":{"type":["string","null"]}},"required":["status","process_id"]}},"required":["memory_id","revision","etag","state"]}},"next_cursor":{"type":["string","null"]},"action":{"const":"list"}},"required":["items","next_cursor","action"]},{"type":"object","properties":{"memory_id":{"type":"string"},"revision":{"type":"integer","minimum":1},"etag":{"type":"string"},"owner_scope":{"type":"string"},"team_id":{"type":["string","null"]},"type":{"type":"string"},"state":{"type":"string"},"sharing_state":{"type":"string"},"active":{"type":["object","null"]},"candidate":{"type":["object","null"]},"eligible":{"type":"boolean"},"pending_review":{"type":"boolean"},"basis_status":{"type":"string"},"update":{"type":"object","properties":{"status":{"enum":["not_required","current","refresh_required","pending","running","awaiting_confirmation","requires_authorized_refresh","needs_basis","no_relevant_memory","failed","cancelled","skipped"]},"process_id":{"type":["string","null"]}},"required":["status","process_id"]},"action":{"const":"submit_team"}},"required":["memory_id","revision","etag","state","action"]},{"type":"object","properties":{"memory_id":{"type":"string"},"revision":{"type":"integer","minimum":1},"etag":{"type":"string"},"owner_scope":{"type":"string"},"team_id":{"type":["string","null"]},"type":{"type":"string"},"state":{"type":"string"},"sharing_state":{"type":"string"},"active":{"type":["object","null"]},"candidate":{"type":["object","null"]},"eligible":{"type":"boolean"},"pending_review":{"type":"boolean"},"basis_status":{"type":"string"},"update":{"type":"object","properties":{"status":{"enum":["not_required","current","refresh_required","pending","running","awaiting_confirmation","requires_authorized_refresh","needs_basis","no_relevant_memory","failed","cancelled","skipped"]},"process_id":{"type":["string","null"]}},"required":["status","process_id"]},"action":{"const":"confirm"}},"required":["memory_id","revision","etag","state","action"]},{"type":"object","properties":{"memory_id":{"type":"string"},"revision":{"type":"integer","minimum":1},"etag":{"type":"string"},"owner_scope":{"type":"string"},"team_id":{"type":["string","null"]},"type":{"type":"string"},"state":{"type":"string"},"sharing_state":{"type":"string"},"active":{"type":["object","null"]},"candidate":{"type":["object","null"]},"eligible":{"type":"boolean"},"pending_review":{"type":"boolean"},"basis_status":{"type":"string"},"update":{"type":"object","properties":{"status":{"enum":["not_required","current","refresh_required","pending","running","awaiting_confirmation","requires_authorized_refresh","needs_basis","no_relevant_memory","failed","cancelled","skipped"]},"process_id":{"type":["string","null"]}},"required":["status","process_id"]},"action":{"const":"forget"}},"required":["memory_id","revision","etag","state","action"]},{"type":"object","properties":{"process_id":{"type":"string"},"status":{"type":"string"},"revision":{"type":"integer","minimum":1},"etag":{"type":"string"},"stage":{"type":["string","null"]},"result":{"type":["object","null"]},"error":{"type":["object","null"]},"retryable":{"type":"boolean"},"action":{"const":"get_process"}},"required":["process_id","status","action"]},{"type":"object","properties":{"process_id":{"type":"string"},"status":{"type":"string"},"revision":{"type":"integer","minimum":1},"etag":{"type":"string"},"stage":{"type":["string","null"]},"result":{"type":["object","null"]},"error":{"type":["object","null"]},"retryable":{"type":"boolean"},"action":{"const":"retry_process"}},"required":["process_id","status","action"]},{"type":"object","properties":{"authorization_revision":{"type":"integer","minimum":1},"enabled":{"type":"boolean"},"recovery_scope":{"type":"string","pattern":"^[0-9a-f]{64}$","description":"服务端生成的恢复分区，跨Key轮换和授权修订保持稳定；不是鉴权凭据，调用仍须当前完整授权。"},"action":{"const":"sync_subject"}},"required":["authorization_revision","enabled","recovery_scope","action"]}]},"error":{"type":"null"}}}]}}},"headers":{"Location":{"description":"任务状态查询地址","schema":{"type":"string","example":"/open/v1/job/0123456789abcdef0123456789abcdef"}}},"links":{"查询任务进度":{"operationId":"getJob","parameters":{"job_id":"$response.body#/data/job_id"},"description":"使用本次返回的 job_id 查询任务进度。"},"读取任务结果":{"operationId":"getJobResult","parameters":{"job_id":"$response.body#/data/job_id"},"description":"任务 succeeded 后读取结构化结果。"}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"409":{"description":"幂等键、任务状态或资源状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"410":{"description":"处理结果已超过保留期限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"412":{"description":"资源修订已变化，请重新读取后提交","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"413":{"description":"请求体过大","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"422":{"description":"文件内容无法转换(已确认文件被截断、不完整,重传无效)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"428":{"description":"缺少资源修订前置条件 If-Match","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"429":{"description":"队列或模型并发额度已满，请稍后重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"dkRead","x-stability":"preview","x-alternative-scopes":["dkWrite"],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":128},"description":"所有写操作必填；同一动作重试保持原值。"},{"name":"X-Memory-Recovery-Scope","in":"header","required":false,"schema":{"type":"string","pattern":"^[0-9a-f]{64}$"},"description":"请求可携带sync_subject返回的recovery_scope作条件校验，sync_subject同样支持；服务端在同步用户授权和执行业务前比较，不一致返回409且不修改该作用域的授权或数据，不把旧请求重放到新应用或用户。这不是鉴权凭据。"},{"name":"If-Match","in":"header","required":false,"schema":{"type":"string"},"description":"修改、确认、忘记、共享和重试必填；追加消息不要求，消息更正使用消息ETag。"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"additionalProperties":false,"oneOf":[{"properties":{"knowledge_mode":{"const":"off"},"kb_id":{"type":"null"}}},{"properties":{"knowledge_mode":{"const":"evidence"},"kb_id":{"type":"string"}},"required":["knowledge_mode","kb_id"]}],"properties":{"actor_context":{"additionalProperties":false,"properties":{"subject_id":{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","title":"Subject Id","type":"string"},"authorization_revision":{"exclusiveMaximum":4611686018427387904,"minimum":1,"title":"Authorization Revision","type":"integer"},"enabled":{"title":"Enabled","type":"boolean"},"teams":{"items":{"additionalProperties":false,"properties":{"team_id":{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","title":"Team Id","type":"string"},"role":{"enum":["member","reviewer"],"title":"Role","type":"string"}},"required":["team_id","role"],"title":"TeamGrant","type":"object"},"maxItems":1000,"title":"Teams","type":"array"},"knowledge_base_grants":{"items":{"additionalProperties":false,"properties":{"kb_id":{"pattern":"^[0-9a-f]{32}$","title":"Kb Id","type":"string"},"permissions":{"items":{"enum":["read","write","confirm"],"type":"string"},"maxItems":3,"minItems":1,"title":"Permissions","type":"array"}},"required":["kb_id","permissions"],"title":"KnowledgeGrant","type":"object"},"maxItems":1000,"title":"Knowledge Base Grants","type":"array"}},"required":["subject_id","authorization_revision","enabled","teams","knowledge_base_grants"],"title":"ActorContext","type":"object"},"query":{"maxLength":8000,"minLength":1,"title":"Query","type":"string"},"conversation_id":{"oneOf":[{"pattern":"^[0-9a-f]{32}$","type":"string"},{"type":"null"}],"title":"Conversation Id"},"task_id":{"oneOf":[{"pattern":"^[0-9a-f]{32}$","type":"string"},{"type":"null"}],"title":"Task Id"},"team_ids":{"items":{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","type":"string"},"maxItems":1000,"title":"Team Ids","type":"array"},"context_budget":{"oneOf":[{"maximum":100000,"minimum":1,"type":"integer"},{"type":"null"}],"title":"Context Budget"},"knowledge_mode":{"default":"off","enum":["off","evidence"],"title":"Knowledge Mode","type":"string"},"kb_id":{"oneOf":[{"pattern":"^[0-9a-f]{32}$","type":"string"},{"type":"null"}],"title":"Kb Id"},"action":{"const":"recall","title":"Action","type":"string"}},"required":["actor_context","query","action"],"title":"RecallRequest","type":"object"},{"additionalProperties":false,"properties":{"actor_context":{"additionalProperties":false,"properties":{"subject_id":{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","title":"Subject Id","type":"string"},"authorization_revision":{"exclusiveMaximum":4611686018427387904,"minimum":1,"title":"Authorization Revision","type":"integer"},"enabled":{"title":"Enabled","type":"boolean"},"teams":{"items":{"additionalProperties":false,"properties":{"team_id":{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","title":"Team Id","type":"string"},"role":{"enum":["member","reviewer"],"title":"Role","type":"string"}},"required":["team_id","role"],"title":"TeamGrant","type":"object"},"maxItems":1000,"title":"Teams","type":"array"},"knowledge_base_grants":{"items":{"additionalProperties":false,"properties":{"kb_id":{"pattern":"^[0-9a-f]{32}$","title":"Kb Id","type":"string"},"permissions":{"items":{"enum":["read","write","confirm"],"type":"string"},"maxItems":3,"minItems":1,"title":"Permissions","type":"array"}},"required":["kb_id","permissions"],"title":"KnowledgeGrant","type":"object"},"maxItems":1000,"title":"Knowledge Base Grants","type":"array"}},"required":["subject_id","authorization_revision","enabled","teams","knowledge_base_grants"],"title":"ActorContext","type":"object"},"memory_id":{"oneOf":[{"pattern":"^[0-9a-f]{32}$","type":"string"},{"type":"null"}],"title":"Memory Id"},"owner_scope":{"default":"personal","enum":["personal","team"],"title":"Owner Scope","type":"string"},"team_id":{"oneOf":[{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","type":"string"},{"type":"null"}],"title":"Team Id"},"type":{"enum":["preference","background","ongoing","knowledge"],"title":"Type","type":"string"},"content":{"maxLength":100000,"minLength":1,"title":"Content","type":"string"},"valid_from":{"oneOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Valid From"},"valid_to":{"oneOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Valid To"},"temporal_condition":{"oneOf":[{"maxLength":100000,"minLength":1,"type":"string"},{"type":"null"}],"title":"Temporal Condition"},"edit_reason":{"maxLength":1000,"minLength":1,"title":"Edit Reason","type":"string"},"invalidate_previous":{"default":false,"title":"Invalidate Previous","type":"boolean"},"restore_from":{"oneOf":[{"pattern":"^[0-9a-f]{32}$","type":"string"},{"type":"null"}],"title":"Restore From"},"action":{"const":"save","title":"Action","type":"string"}},"required":["actor_context","type","content","edit_reason","action"],"title":"SaveRequest","type":"object"},{"additionalProperties":false,"properties":{"actor_context":{"additionalProperties":false,"properties":{"subject_id":{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","title":"Subject Id","type":"string"},"authorization_revision":{"exclusiveMaximum":4611686018427387904,"minimum":1,"title":"Authorization Revision","type":"integer"},"enabled":{"title":"Enabled","type":"boolean"},"teams":{"items":{"additionalProperties":false,"properties":{"team_id":{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","title":"Team Id","type":"string"},"role":{"enum":["member","reviewer"],"title":"Role","type":"string"}},"required":["team_id","role"],"title":"TeamGrant","type":"object"},"maxItems":1000,"title":"Teams","type":"array"},"knowledge_base_grants":{"items":{"additionalProperties":false,"properties":{"kb_id":{"pattern":"^[0-9a-f]{32}$","title":"Kb Id","type":"string"},"permissions":{"items":{"enum":["read","write","confirm"],"type":"string"},"maxItems":3,"minItems":1,"title":"Permissions","type":"array"}},"required":["kb_id","permissions"],"title":"KnowledgeGrant","type":"object"},"maxItems":1000,"title":"Knowledge Base Grants","type":"array"}},"required":["subject_id","authorization_revision","enabled","teams","knowledge_base_grants"],"title":"ActorContext","type":"object"},"source":{"additionalProperties":false,"properties":{"kb_id":{"pattern":"^[0-9a-f]{32}$","title":"Kb Id","type":"string"},"snapshot_id":{"pattern":"^[0-9a-f]{32}$","title":"Snapshot Id","type":"string"},"evidence_ids":{"items":{"pattern":"^[0-9a-f]{32}$","type":"string"},"maxItems":100,"minItems":1,"title":"Evidence Ids","type":"array"},"qa_refs":{"items":{"additionalProperties":false,"properties":{"id":{"pattern":"^[0-9a-f]{32}$","title":"Id","type":"string"},"revision":{"exclusiveMaximum":4611686018427387904,"minimum":1,"title":"Revision","type":"integer"}},"required":["id","revision"],"title":"QaReference","type":"object"},"maxItems":100,"title":"Qa Refs","type":"array"},"kind":{"const":"knowledge_answer","title":"Kind","type":"string"}},"required":["kb_id","snapshot_id","evidence_ids","kind"],"title":"KnowledgeAnswerSource","type":"object"},"question":{"maxLength":100000,"minLength":1,"title":"Question","type":"string"},"answer":{"maxLength":100000,"minLength":1,"title":"Answer","type":"string"},"owner_scope":{"default":"personal","enum":["personal","team"],"title":"Owner Scope","type":"string"},"team_id":{"oneOf":[{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","type":"string"},{"type":"null"}],"title":"Team Id"},"valid_from":{"oneOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Valid From"},"valid_to":{"oneOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Valid To"},"restore_from":{"oneOf":[{"pattern":"^[0-9a-f]{32}$","type":"string"},{"type":"null"}],"title":"Restore From"},"memory_id":{"oneOf":[{"pattern":"^[0-9a-f]{32}$","type":"string"},{"type":"null"}],"title":"Memory Id"},"type":{"const":"knowledge","default":"knowledge","title":"Type","type":"string"},"edit_reason":{"maxLength":1000,"minLength":1,"title":"Edit Reason","type":"string"},"action":{"const":"save","title":"Action","type":"string"}},"required":["actor_context","source","question","answer","edit_reason","action"],"title":"SaveKnowledgeRequest","type":"object"},{"additionalProperties":false,"properties":{"actor_context":{"additionalProperties":false,"properties":{"subject_id":{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","title":"Subject Id","type":"string"},"authorization_revision":{"exclusiveMaximum":4611686018427387904,"minimum":1,"title":"Authorization Revision","type":"integer"},"enabled":{"title":"Enabled","type":"boolean"},"teams":{"items":{"additionalProperties":false,"properties":{"team_id":{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","title":"Team Id","type":"string"},"role":{"enum":["member","reviewer"],"title":"Role","type":"string"}},"required":["team_id","role"],"title":"TeamGrant","type":"object"},"maxItems":1000,"title":"Teams","type":"array"},"knowledge_base_grants":{"items":{"additionalProperties":false,"properties":{"kb_id":{"pattern":"^[0-9a-f]{32}$","title":"Kb Id","type":"string"},"permissions":{"items":{"enum":["read","write","confirm"],"type":"string"},"maxItems":3,"minItems":1,"title":"Permissions","type":"array"}},"required":["kb_id","permissions"],"title":"KnowledgeGrant","type":"object"},"maxItems":1000,"title":"Knowledge Base Grants","type":"array"}},"required":["subject_id","authorization_revision","enabled","teams","knowledge_base_grants"],"title":"ActorContext","type":"object"},"source":{"additionalProperties":false,"properties":{"kind":{"const":"memory_feedback","title":"Kind","type":"string"},"kb_id":{"pattern":"^[0-9a-f]{32}$","title":"Kb Id","type":"string"},"feedback_id":{"pattern":"^[0-9a-f]{32}$","title":"Feedback Id","type":"string"},"revision":{"exclusiveMaximum":4611686018427387904,"minimum":1,"title":"Revision","type":"integer"}},"required":["kind","kb_id","feedback_id","revision"],"title":"FeedbackMemorySource","type":"object"},"memory_id":{"oneOf":[{"pattern":"^[0-9a-f]{32}$","type":"string"},{"type":"null"}],"title":"Memory Id"},"type":{"const":"knowledge","default":"knowledge","title":"Type","type":"string"},"owner_scope":{"default":"personal","enum":["personal","team"],"title":"Owner Scope","type":"string"},"team_id":{"oneOf":[{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","type":"string"},{"type":"null"}],"title":"Team Id"},"valid_from":{"oneOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Valid From"},"valid_to":{"oneOf":[{"format":"date-time","type":"string"},{"type":"null"}],"title":"Valid To"},"restore_from":{"oneOf":[{"pattern":"^[0-9a-f]{32}$","type":"string"},{"type":"null"}],"title":"Restore From"},"edit_reason":{"maxLength":1000,"minLength":1,"title":"Edit Reason","type":"string"},"action":{"const":"save","title":"Action","type":"string"}},"required":["actor_context","source","edit_reason","action"],"title":"SaveFeedbackRequest","type":"object"},{"additionalProperties":false,"properties":{"actor_context":{"additionalProperties":false,"properties":{"subject_id":{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","title":"Subject Id","type":"string"},"authorization_revision":{"exclusiveMaximum":4611686018427387904,"minimum":1,"title":"Authorization Revision","type":"integer"},"enabled":{"title":"Enabled","type":"boolean"},"teams":{"items":{"additionalProperties":false,"properties":{"team_id":{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","title":"Team Id","type":"string"},"role":{"enum":["member","reviewer"],"title":"Role","type":"string"}},"required":["team_id","role"],"title":"TeamGrant","type":"object"},"maxItems":1000,"title":"Teams","type":"array"},"knowledge_base_grants":{"items":{"additionalProperties":false,"properties":{"kb_id":{"pattern":"^[0-9a-f]{32}$","title":"Kb Id","type":"string"},"permissions":{"items":{"enum":["read","write","confirm"],"type":"string"},"maxItems":3,"minItems":1,"title":"Permissions","type":"array"}},"required":["kb_id","permissions"],"title":"KnowledgeGrant","type":"object"},"maxItems":1000,"title":"Knowledge Base Grants","type":"array"}},"required":["subject_id","authorization_revision","enabled","teams","knowledge_base_grants"],"title":"ActorContext","type":"object"},"memory_id":{"pattern":"^[0-9a-f]{32}$","title":"Memory Id","type":"string"},"refresh_basis":{"const":true,"title":"Refresh Basis","type":"boolean"},"edit_reason":{"maxLength":1000,"minLength":1,"title":"Edit Reason","type":"string"},"action":{"const":"save","title":"Action","type":"string"}},"required":["actor_context","memory_id","refresh_basis","edit_reason","action"],"title":"RefreshMemoryRequest","type":"object"},{"additionalProperties":false,"properties":{"actor_context":{"additionalProperties":false,"properties":{"subject_id":{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","title":"Subject Id","type":"string"},"authorization_revision":{"exclusiveMaximum":4611686018427387904,"minimum":1,"title":"Authorization Revision","type":"integer"},"enabled":{"title":"Enabled","type":"boolean"},"teams":{"items":{"additionalProperties":false,"properties":{"team_id":{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","title":"Team Id","type":"string"},"role":{"enum":["member","reviewer"],"title":"Role","type":"string"}},"required":["team_id","role"],"title":"TeamGrant","type":"object"},"maxItems":1000,"title":"Teams","type":"array"},"knowledge_base_grants":{"items":{"additionalProperties":false,"properties":{"kb_id":{"pattern":"^[0-9a-f]{32}$","title":"Kb Id","type":"string"},"permissions":{"items":{"enum":["read","write","confirm"],"type":"string"},"maxItems":3,"minItems":1,"title":"Permissions","type":"array"}},"required":["kb_id","permissions"],"title":"KnowledgeGrant","type":"object"},"maxItems":1000,"title":"Knowledge Base Grants","type":"array"}},"required":["subject_id","authorization_revision","enabled","teams","knowledge_base_grants"],"title":"ActorContext","type":"object"},"action":{"const":"get","title":"Action","type":"string"},"memory_id":{"pattern":"^[0-9a-f]{32}$","title":"Memory Id","type":"string"},"revision":{"oneOf":[{"exclusiveMaximum":4611686018427387904,"minimum":1,"type":"integer"},{"type":"null"}],"title":"Revision"}},"required":["actor_context","action","memory_id"],"title":"GetMemory","type":"object"},{"additionalProperties":false,"properties":{"actor_context":{"additionalProperties":false,"properties":{"subject_id":{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","title":"Subject Id","type":"string"},"authorization_revision":{"exclusiveMaximum":4611686018427387904,"minimum":1,"title":"Authorization Revision","type":"integer"},"enabled":{"title":"Enabled","type":"boolean"},"teams":{"items":{"additionalProperties":false,"properties":{"team_id":{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","title":"Team Id","type":"string"},"role":{"enum":["member","reviewer"],"title":"Role","type":"string"}},"required":["team_id","role"],"title":"TeamGrant","type":"object"},"maxItems":1000,"title":"Teams","type":"array"},"knowledge_base_grants":{"items":{"additionalProperties":false,"properties":{"kb_id":{"pattern":"^[0-9a-f]{32}$","title":"Kb Id","type":"string"},"permissions":{"items":{"enum":["read","write","confirm"],"type":"string"},"maxItems":3,"minItems":1,"title":"Permissions","type":"array"}},"required":["kb_id","permissions"],"title":"KnowledgeGrant","type":"object"},"maxItems":1000,"title":"Knowledge Base Grants","type":"array"}},"required":["subject_id","authorization_revision","enabled","teams","knowledge_base_grants"],"title":"ActorContext","type":"object"},"cursor":{"default":"","maxLength":1024,"title":"Cursor","type":"string"},"limit":{"default":20,"maximum":100,"minimum":1,"title":"Limit","type":"integer"},"action":{"const":"list","title":"Action","type":"string"},"owner_scope":{"default":"personal","enum":["personal","team"],"title":"Owner Scope","type":"string"},"team_id":{"oneOf":[{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","type":"string"},{"type":"null"}],"title":"Team Id"},"state":{"oneOf":[{"enum":["proposed","active","conflicting","needs_review","expired","withdrawn"],"type":"string"},{"type":"null"}],"title":"State"}},"required":["actor_context","action"],"title":"ListMemories","type":"object"},{"additionalProperties":false,"properties":{"actor_context":{"additionalProperties":false,"properties":{"subject_id":{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","title":"Subject Id","type":"string"},"authorization_revision":{"exclusiveMaximum":4611686018427387904,"minimum":1,"title":"Authorization Revision","type":"integer"},"enabled":{"title":"Enabled","type":"boolean"},"teams":{"items":{"additionalProperties":false,"properties":{"team_id":{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","title":"Team Id","type":"string"},"role":{"enum":["member","reviewer"],"title":"Role","type":"string"}},"required":["team_id","role"],"title":"TeamGrant","type":"object"},"maxItems":1000,"title":"Teams","type":"array"},"knowledge_base_grants":{"items":{"additionalProperties":false,"properties":{"kb_id":{"pattern":"^[0-9a-f]{32}$","title":"Kb Id","type":"string"},"permissions":{"items":{"enum":["read","write","confirm"],"type":"string"},"maxItems":3,"minItems":1,"title":"Permissions","type":"array"}},"required":["kb_id","permissions"],"title":"KnowledgeGrant","type":"object"},"maxItems":1000,"title":"Knowledge Base Grants","type":"array"}},"required":["subject_id","authorization_revision","enabled","teams","knowledge_base_grants"],"title":"ActorContext","type":"object"},"memory_id":{"pattern":"^[0-9a-f]{32}$","title":"Memory Id","type":"string"},"memory_revision":{"exclusiveMaximum":4611686018427387904,"minimum":1,"title":"Memory Revision","type":"integer"},"team_id":{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","title":"Team Id","type":"string"},"shared_content":{"maxLength":100000,"minLength":1,"title":"Shared Content","type":"string"},"edit_reason":{"maxLength":1000,"minLength":1,"title":"Edit Reason","type":"string"},"action":{"const":"submit_team","title":"Action","type":"string"}},"required":["actor_context","memory_id","memory_revision","team_id","shared_content","edit_reason","action"],"title":"SubmitTeam","type":"object"},{"additionalProperties":false,"properties":{"actor_context":{"additionalProperties":false,"properties":{"subject_id":{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","title":"Subject Id","type":"string"},"authorization_revision":{"exclusiveMaximum":4611686018427387904,"minimum":1,"title":"Authorization Revision","type":"integer"},"enabled":{"title":"Enabled","type":"boolean"},"teams":{"items":{"additionalProperties":false,"properties":{"team_id":{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","title":"Team Id","type":"string"},"role":{"enum":["member","reviewer"],"title":"Role","type":"string"}},"required":["team_id","role"],"title":"TeamGrant","type":"object"},"maxItems":1000,"title":"Teams","type":"array"},"knowledge_base_grants":{"items":{"additionalProperties":false,"properties":{"kb_id":{"pattern":"^[0-9a-f]{32}$","title":"Kb Id","type":"string"},"permissions":{"items":{"enum":["read","write","confirm"],"type":"string"},"maxItems":3,"minItems":1,"title":"Permissions","type":"array"}},"required":["kb_id","permissions"],"title":"KnowledgeGrant","type":"object"},"maxItems":1000,"title":"Knowledge Base Grants","type":"array"}},"required":["subject_id","authorization_revision","enabled","teams","knowledge_base_grants"],"title":"ActorContext","type":"object"},"action":{"const":"confirm","title":"Action","type":"string"},"memory_id":{"pattern":"^[0-9a-f]{32}$","title":"Memory Id","type":"string"},"candidate_revision":{"exclusiveMaximum":4611686018427387904,"minimum":1,"title":"Candidate Revision","type":"integer"},"reason":{"maxLength":1000,"minLength":1,"title":"Reason","type":"string"}},"required":["actor_context","action","memory_id","candidate_revision","reason"],"title":"ConfirmMemory","type":"object"},{"additionalProperties":false,"properties":{"actor_context":{"additionalProperties":false,"properties":{"subject_id":{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","title":"Subject Id","type":"string"},"authorization_revision":{"exclusiveMaximum":4611686018427387904,"minimum":1,"title":"Authorization Revision","type":"integer"},"enabled":{"title":"Enabled","type":"boolean"},"teams":{"items":{"additionalProperties":false,"properties":{"team_id":{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","title":"Team Id","type":"string"},"role":{"enum":["member","reviewer"],"title":"Role","type":"string"}},"required":["team_id","role"],"title":"TeamGrant","type":"object"},"maxItems":1000,"title":"Teams","type":"array"},"knowledge_base_grants":{"items":{"additionalProperties":false,"properties":{"kb_id":{"pattern":"^[0-9a-f]{32}$","title":"Kb Id","type":"string"},"permissions":{"items":{"enum":["read","write","confirm"],"type":"string"},"maxItems":3,"minItems":1,"title":"Permissions","type":"array"}},"required":["kb_id","permissions"],"title":"KnowledgeGrant","type":"object"},"maxItems":1000,"title":"Knowledge Base Grants","type":"array"}},"required":["subject_id","authorization_revision","enabled","teams","knowledge_base_grants"],"title":"ActorContext","type":"object"},"action":{"const":"forget","title":"Action","type":"string"},"memory_id":{"pattern":"^[0-9a-f]{32}$","title":"Memory Id","type":"string"},"reason":{"maxLength":1000,"minLength":1,"title":"Reason","type":"string"}},"required":["actor_context","action","memory_id","reason"],"title":"ForgetMemory","type":"object"},{"additionalProperties":false,"properties":{"actor_context":{"additionalProperties":false,"properties":{"subject_id":{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","title":"Subject Id","type":"string"},"authorization_revision":{"exclusiveMaximum":4611686018427387904,"minimum":1,"title":"Authorization Revision","type":"integer"},"enabled":{"title":"Enabled","type":"boolean"},"teams":{"items":{"additionalProperties":false,"properties":{"team_id":{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","title":"Team Id","type":"string"},"role":{"enum":["member","reviewer"],"title":"Role","type":"string"}},"required":["team_id","role"],"title":"TeamGrant","type":"object"},"maxItems":1000,"title":"Teams","type":"array"},"knowledge_base_grants":{"items":{"additionalProperties":false,"properties":{"kb_id":{"pattern":"^[0-9a-f]{32}$","title":"Kb Id","type":"string"},"permissions":{"items":{"enum":["read","write","confirm"],"type":"string"},"maxItems":3,"minItems":1,"title":"Permissions","type":"array"}},"required":["kb_id","permissions"],"title":"KnowledgeGrant","type":"object"},"maxItems":1000,"title":"Knowledge Base Grants","type":"array"}},"required":["subject_id","authorization_revision","enabled","teams","knowledge_base_grants"],"title":"ActorContext","type":"object"},"action":{"const":"get_process","title":"Action","type":"string"},"process_id":{"pattern":"^[0-9a-f]{32}$","title":"Process Id","type":"string"}},"required":["actor_context","action","process_id"],"title":"GetProcess","type":"object"},{"additionalProperties":false,"properties":{"actor_context":{"additionalProperties":false,"properties":{"subject_id":{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","title":"Subject Id","type":"string"},"authorization_revision":{"exclusiveMaximum":4611686018427387904,"minimum":1,"title":"Authorization Revision","type":"integer"},"enabled":{"title":"Enabled","type":"boolean"},"teams":{"items":{"additionalProperties":false,"properties":{"team_id":{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","title":"Team Id","type":"string"},"role":{"enum":["member","reviewer"],"title":"Role","type":"string"}},"required":["team_id","role"],"title":"TeamGrant","type":"object"},"maxItems":1000,"title":"Teams","type":"array"},"knowledge_base_grants":{"items":{"additionalProperties":false,"properties":{"kb_id":{"pattern":"^[0-9a-f]{32}$","title":"Kb Id","type":"string"},"permissions":{"items":{"enum":["read","write","confirm"],"type":"string"},"maxItems":3,"minItems":1,"title":"Permissions","type":"array"}},"required":["kb_id","permissions"],"title":"KnowledgeGrant","type":"object"},"maxItems":1000,"title":"Knowledge Base Grants","type":"array"}},"required":["subject_id","authorization_revision","enabled","teams","knowledge_base_grants"],"title":"ActorContext","type":"object"},"action":{"const":"retry_process","title":"Action","type":"string"},"process_id":{"pattern":"^[0-9a-f]{32}$","title":"Process Id","type":"string"}},"required":["actor_context","action","process_id"],"title":"RetryProcess","type":"object"},{"additionalProperties":false,"properties":{"actor_context":{"additionalProperties":false,"properties":{"subject_id":{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","title":"Subject Id","type":"string"},"authorization_revision":{"exclusiveMaximum":4611686018427387904,"minimum":1,"title":"Authorization Revision","type":"integer"},"enabled":{"title":"Enabled","type":"boolean"},"teams":{"items":{"additionalProperties":false,"properties":{"team_id":{"maxLength":128,"minLength":1,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$","title":"Team Id","type":"string"},"role":{"enum":["member","reviewer"],"title":"Role","type":"string"}},"required":["team_id","role"],"title":"TeamGrant","type":"object"},"maxItems":1000,"title":"Teams","type":"array"},"knowledge_base_grants":{"items":{"additionalProperties":false,"properties":{"kb_id":{"pattern":"^[0-9a-f]{32}$","title":"Kb Id","type":"string"},"permissions":{"items":{"enum":["read","write","confirm"],"type":"string"},"maxItems":3,"minItems":1,"title":"Permissions","type":"array"}},"required":["kb_id","permissions"],"title":"KnowledgeGrant","type":"object"},"maxItems":1000,"title":"Knowledge Base Grants","type":"array"}},"required":["subject_id","authorization_revision","enabled","teams","knowledge_base_grants"],"title":"ActorContext","type":"object"},"action":{"const":"sync_subject","title":"Action","type":"string"}},"required":["actor_context","action"],"title":"SyncSubject","type":"object"}],"title":"RootModel[Union[RecallRequest, SaveRequest, SaveKnowledgeRequest, SaveFeedbackRequest, RefreshMemoryRequest, GetMemory, ListMemories, SubmitTeam, ConfirmMemory, ForgetMemory, GetProcess, RetryProcess, SyncSubject]]"}}}}}},"/open/v1/public-agents":{"get":{"tags":["1. 智能体目录"],"summary":"列出所有已发布且处于当前版本的公开智能体","description":"返回笃语本地知识读模型中已发布且处于当前版本的智能体摘要。查询范围由 API Key 的 Document Space 服务端绑定。","operationId":"listPublicAgents","responses":{"200":{"description":"请求已成功处理","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"required":["agents"],"properties":{"agents":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["id","name","summary"],"properties":{"id":{"type":"integer","minimum":1},"name":{"type":"string","minLength":1,"maxLength":256},"summary":{"type":["string","null"],"maxLength":2000}}}}}},"error":{"type":"null"}}}]}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"500":{"description":"服务内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"502":{"description":"上游服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"504":{"description":"上游服务超时","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"viewScene","x-stability":"stable"}},"/open/v1/documents:reuse":{"post":{"tags":["2. 文档准备"],"summary":"按原始文件内容 SHA-256 复用当前 Document Space 的已有文档","description":"调用方提交原始文件字节的 SHA-256。只在当前 API Key 绑定的 Document Space 内查询；未命中返回 HTTP 404，且不会创建文档。","operationId":"reuseDocument","requestBody":{"content":{"application/json":{"schema":{"properties":{"content_sha256":{"type":"string","pattern":"^[0-9a-f]{64}$"}},"additionalProperties":false,"type":"object","required":["content_sha256"]},"example":{"content_sha256":"0000000000000000000000000000000000000000000000000000000000000000"}}},"required":true},"responses":{"200":{"description":"请求已成功处理","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"properties":{"success":{"const":true},"data":{"properties":{"doc_id":{"type":"integer","minimum":1.0},"status":{"const":"reused"}},"additionalProperties":false,"type":"object","required":["doc_id","status"]},"error":{"type":"null"}},"type":"object"}]}}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"413":{"description":"请求体过大","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"415":{"description":"请求媒体类型不支持","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"500":{"description":"服务内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"502":{"description":"上游服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"504":{"description":"上游服务超时","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"addDocument","x-stability":"stable"}},"/open/v1/audit-profiles:resolve":{"post":{"tags":["3. 知识库"],"summary":"把平台智能体的类别与审核规则解析成 createAudit 可直接使用的审核档案","description":"确定性翻译，不调模型：类别（含指标）→ categories，每条规则的模型审核节点 → audit_graph 节点（指标型取指标型提示词，语义型取语义型提示词与定位句），并给出可读的 rules 清单与 warnings。给了 agent 且唯一命中时 resolved=true 并返回 profile；否则 resolved=false 并返回 candidates。查询范围由 API Key 的 Document Space 服务端绑定。","operationId":"resolveAuditProfile","requestBody":{"content":{"application/json":{"schema":{"properties":{"agent":{"properties":{"id":{"type":"integer","minimum":1.0},"code":{"type":"string","maxLength":128,"minLength":1},"name":{"type":"string","maxLength":256,"minLength":1}},"additionalProperties":false,"type":"object","description":"按 id / code / name 精确定位已发布且当前版本的智能体；三者给一个即可。"},"query":{"type":"string","maxLength":2000,"minLength":1,"description":"按业务描述查候选智能体（词面匹配智能体名称与类别名），只返回候选，不替调用方选。"},"doc_names":{"items":{"type":"string","maxLength":512,"minLength":1},"type":"array","maxItems":50,"description":"待审文档的文件名，按名称里出现的类别名匹配候选智能体。"},"limit":{"type":"integer","maximum":10.0,"minimum":1.0,"default":5}},"additionalProperties":false,"type":"object","required":[]},"example":{"agent":{"name":"个人买贷-二级经销商放款审核智能体"}}}},"required":true},"responses":{"200":{"description":"请求已成功处理","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"required":["resolved","candidates"],"properties":{"resolved":{"type":"boolean"},"profile":{"oneOf":[{"type":"object","additionalProperties":false,"required":["agent","categories","audit_graph","rules","warnings"],"properties":{"agent":{"type":"object","additionalProperties":false,"required":["name"],"properties":{"id":{"type":["integer","null"]},"name":{"type":"string"},"code":{"type":["string","null"]},"description":{"type":["string","null"]},"version":{"type":["string","null"]}}},"categories":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["code","name","indicators"],"properties":{"code":{"type":"string","minLength":1,"maxLength":128},"name":{"type":"string","minLength":1,"maxLength":256},"description":{"type":"string","maxLength":2000},"indicators":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","additionalProperties":false,"required":["name","type","description"],"properties":{"name":{"type":"string","minLength":1,"maxLength":256},"type":{"type":"string","enum":["text","number","span","section","list","entity","obj_list"]},"description":{"type":"string","minLength":1,"maxLength":2000},"attrs":{"type":"array","minItems":1,"items":{"type":"object","additionalProperties":false,"required":["name","type","description"],"properties":{"name":{"type":"string","minLength":1,"maxLength":256},"type":{"type":"string","enum":["text","number","span","section","list","entity","obj_list"]},"description":{"type":"string","minLength":1,"maxLength":2000}}}},"retrieval_context":{"type":["object","null"],"additionalProperties":false,"required":["scope"],"properties":{"scope":{"type":"string","enum":["document","sections"]},"section_hints":{"type":"array","minItems":1,"maxItems":20,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":128}},"similar_text":{"type":["string","null"],"maxLength":4000}}}}}}}}},"audit_graph":{"type":"object","additionalProperties":false,"required":["nodes","adjacency"],"properties":{"nodes":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","additionalProperties":false,"required":["id","name","rule","type","comment_required","category_codes","indicator_names"],"properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z][A-Za-z0-9_.:-]{0,63}$"},"name":{"type":"string","minLength":1,"maxLength":256},"rule":{"type":"string","minLength":1,"maxLength":12000},"type":{"type":"integer","minimum":1,"maximum":4},"comment_required":{"type":"boolean"},"category_codes":{"type":"array","minItems":1,"maxItems":50,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":128}},"indicator_names":{"type":"array","minItems":0,"maxItems":100,"uniqueItems":true,"description":"节点消费的指标名称；必须来自请求提供的指标闭集，且在每个适用类别里都存在。空数组表示适用类别的全部指标（跨类别规则各类别指标集不同时用这个）。","items":{"type":"string","minLength":1,"maxLength":256}},"predicate":{"type":"object","description":"判定式（可选）：规则编译成的封闭 JSON 表达式，给出时该节点由代码确定性执行、不调模型，结论为 pass / fail / insufficient（引用字段缺失即证据不足）。语法：op 为 and/or/not、forall/exists（var、category、可选 where、assert）、eq/ne/contains/in/gt/ge/lt/le（left、right、mode 为 text/number/date）、present（arg）；取值为 {doc, field}、{business: 路径，列表用 标的物[].出厂编号}、{const}。只能引用请求里的类别与该类别的指标。"}}}},"adjacency":{"type":"object","description":"邻接表：键为前置节点 ID，值为其直接后继节点 ID 列表。","additionalProperties":{"type":"array","uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":64}}}}},"rules":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["node_id","name","type","type_label","mode","category_codes","category_names","rule"],"properties":{"node_id":{"type":"string"},"rule_id":{"type":["integer","string","null"]},"name":{"type":"string"},"type":{"type":"integer","minimum":1,"maximum":4},"type_label":{"type":"string"},"mode":{"type":"string","enum":["indicator","semantic"]},"category_codes":{"type":"array","items":{"type":"string"}},"category_names":{"type":"array","items":{"type":"string"}},"indicator_names":{"type":"array","items":{"type":"string"}},"rule":{"type":"string"},"description":{"type":["string","null"]},"comment_required":{"type":"boolean"}}}},"warnings":{"type":"array","items":{"type":"string"}}}},{"type":"null"}]},"candidates":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["id","name","categories","rule_count"],"properties":{"id":{"type":["integer","null"]},"name":{"type":"string"},"code":{"type":["string","null"]},"description":{"type":["string","null"]},"categories":{"type":"array","items":{"type":"string"}},"rule_count":{"type":"integer","minimum":0},"score":{"type":"integer"},"matched":{"type":"array","items":{"type":"string"}}}}}}},"error":{"type":"null"}}}]}}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"413":{"description":"请求体过大","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"415":{"description":"请求媒体类型不支持","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"500":{"description":"服务内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"502":{"description":"上游服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"504":{"description":"上游服务超时","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"viewKnowledge","x-stability":"preview"}},"/open/v1/documents":{"post":{"tags":["2. 文档准备"],"summary":"上传单个文档","description":"上传、服务端计算哈希并在同一 Document Space 和 owner_ref 内复用。 可用JSON source_url登记服务端授权的私有MinIO原件，原件不永久复制；与multipart文件输入互斥。来源关闭时仍支持原文件上传。支持UTF-8 TXT本地解析。\n\n**动态知识库关联边界**\n\n动态资料先复用此入口接收单文件和UTF-8 TXT；返回宿主doc_id不等于已加入动态库。原上传/文档读取权限独立检查，随后构造Source引用{source_id:\"aiservice-documents\",file_id:\"十进制doc_id\"}提交materials/import；来源读取持续要求document.read及当前Space。上传成功不表示正文就绪、业务已发布或完成向量化。\n\n完整说明：/swagger-ui/open-v1/docs/dynamic-knowledge","operationId":"createDocument","responses":{"201":{"description":"文件上传成功；请保存响应中的 doc_id","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"required":["doc_id","disposition"],"properties":{"doc_id":{"type":"integer","minimum":1},"disposition":{"type":"string","enum":["created","reused"]}}},"error":{"type":"null"}}}]}}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"409":{"description":"幂等键、任务状态或资源状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"413":{"description":"请求体过大","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"415":{"description":"请求媒体类型不支持","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"500":{"description":"服务内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"502":{"description":"上游服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"504":{"description":"上游服务超时","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"document.write","x-stability":"stable","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","additionalProperties":false,"required":["file","client_request_id"],"properties":{"file":{"type":"string","format":"binary"},"defer_parsing":{"type":"boolean"},"client_request_id":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$","description":"调用方生成的幂等请求标识；相同调用方重试时保持不变。"},"owner_ref":{"type":"string","maxLength":128},"busi_id":{"type":"string","maxLength":128,"description":"外部渠道业务标识（可选，P0-3）。"}}}},"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["source_url","client_request_id"],"properties":{"source_url":{"type":"string","minLength":1,"maxLength":8192,"description":"私有MinIO对象地址，只允许当前Space服务端绑定的endpoint、桶和前缀；禁止凭据、query及fragment。"},"file_name":{"type":"string","minLength":1,"maxLength":255},"client_request_id":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$","description":"调用方生成的幂等请求标识；相同调用方重试时保持不变。"},"owner_ref":{"type":"string","maxLength":128},"busi_id":{"type":"string","maxLength":128},"defer_parsing":{"type":"boolean"},"parse_provider":{"type":"string","maxLength":64}}}}}}},"get":{"tags":["2. 文档准备"],"summary":"列出当前 Document Space 的文档","operationId":"listDocuments","responses":{"200":{"description":"请求已成功处理","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"required":["items","offset","limit","total"],"properties":{"items":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["doc_id","name","extension","size","sha256","owner_ref","total_pages","doc_type","created_at","directory_id"],"properties":{"doc_id":{"type":"integer","minimum":1},"name":{"type":"string","minLength":1,"maxLength":255},"extension":{"type":["string","null"],"maxLength":32},"size":{"type":["integer","null"],"minimum":0},"sha256":{"type":["string","null"],"pattern":"^[0-9a-f]{64}$"},"owner_ref":{"type":["string","null"],"maxLength":128},"total_pages":{"type":"integer","minimum":0},"doc_type":{"type":["string","null"],"maxLength":32,"description":"单证形态类型(平台封闭枚举,如 vat_invoice/id_card;null=未判定,按 general 处理)。"},"created_at":{"type":["string","null"],"format":"date-time"},"directory_id":{"type":["integer","null"],"minimum":1},"busi_id":{"type":["string","null"],"maxLength":128,"description":"外部渠道业务标识（可选，P0-3 恢复按 busi_id 查询链路）。"}}}},"offset":{"type":"integer","minimum":0},"limit":{"type":"integer","minimum":1,"maximum":200},"total":{"type":"integer","minimum":0}}},"error":{"type":"null"}}}]}}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"500":{"description":"服务内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"502":{"description":"上游服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"504":{"description":"上游服务超时","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"document.read","x-stability":"stable","parameters":[{"name":"owner_ref","in":"query","required":false,"schema":{"type":"string","maxLength":128}},{"name":"name","in":"query","required":false,"schema":{"type":"string","maxLength":255}},{"name":"busi_id","in":"query","required":false,"schema":{"type":"string","maxLength":128,"description":"按外部渠道业务标识精确过滤（P0-3）。"}},{"name":"extensions","in":"query","required":false,"schema":{"type":"string","maxLength":512,"description":"逗号分隔的包含扩展名，不带前导点；与 exclude_extensions 互斥。"}},{"name":"exclude_extensions","in":"query","required":false,"schema":{"type":"string","maxLength":512,"description":"逗号分隔的排除扩展名，不带前导点；与 extensions 互斥。"}},{"name":"directory_id","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"目录 ID 筛选。"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50}}]}},"/open/v1/document-uploads":{"post":{"tags":["2. 文档准备"],"summary":"创建不排队的文档上传任务","description":"上传不进入异步 worker 队列。服务端在全局与调用方并发额度内直接创建 running/awaiting_content 任务；超限返回 429 和 Retry-After。随后将原始文件字节 PUT 到 `/open/v1/document-uploads/{job_id}/content`，并可并行轮询统一 Job 接口观察字节进度与持久化结果。","operationId":"createDocumentUpload","requestBody":{"content":{"application/json":{"schema":{"properties":{"file_name":{"type":"string","maxLength":512,"minLength":1},"content_type":{"type":"string","maxLength":255,"minLength":1},"content_length":{"type":"integer","minimum":1.0},"content_sha256":{"type":"string","pattern":"^[0-9a-f]{64}$"},"client_request_id":{"type":"string","maxLength":128,"minLength":1,"pattern":"^[A-Za-z0-9._:-]+$","description":"调用方生成的幂等请求标识；相同调用方重试时保持不变。"},"owner_ref":{"type":"string","maxLength":128},"busi_id":{"type":"string","maxLength":128},"parse_provider":{"type":"string","enum":["auto","docparse","tencent","local","mineru"],"description":"解析 Provider 策略。auto 按服务端启用列表和顺序执行；MinerU 默认禁用；指定 Provider 时严格执行该 Provider，不静默切换。","default":"auto"},"defer_parsing":{"type":"boolean","description":"仅保存文件，不启动预解析；调用方随后显式选择解析引擎。默认 false。"}},"additionalProperties":false,"type":"object","required":["file_name","content_type","content_length","client_request_id"]},"example":{"file_name":"contract.pdf","content_type":"application/pdf","content_length":102400,"client_request_id":"upload-20260824-001"}}},"required":true},"responses":{"201":{"description":"上传任务已创建；请向 content 地址写入文件字节","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"required":["job_id","operation","status","phase","progress","progress_detail","sequence","attempt","poll_after_ms","result_ref","error","created_at","updated_at","finished_at"],"properties":{"job_id":{"type":"string","minLength":32,"maxLength":32,"pattern":"^[a-f0-9]{32}$","description":"异步任务唯一 ID；刷新页面或跨请求查询时保持不变。"},"operation":{"type":"string","description":"任务类型；当前主要为 upload、parse 或 extract。"},"status":{"type":"string","description":"queued=排队中，running=处理中，succeeded=已完成，failed/cancelled/unknown=终态异常。","enum":["queued","running","succeeded","failed","cancelled","unknown"]},"phase":{"type":["string","null"],"description":"当前处理阶段；服务未提供细分阶段时为 null。"},"progress":{"type":["integer","null"],"minimum":0,"maximum":100,"description":"0 到 100 的处理进度；无法计算时为 null。"},"progress_detail":{"oneOf":[{"type":"object","additionalProperties":false,"required":["unit","current","total"],"properties":{"unit":{"type":"string","enum":["bytes","documents","items","pages"]},"current":{"type":"integer","minimum":0},"total":{"type":"integer","minimum":1}}},{"type":"null"}],"description":"可核验的真实进度分子、分母；无法度量时为 null。"},"sequence":{"type":"integer","minimum":0,"description":"状态事件单调序号；客户端用它丢弃乱序轮询结果。"},"attempt":{"type":"integer","minimum":0,"description":"worker 执行尝试次数；上传直接执行时固定为 1。"},"poll_after_ms":{"type":"integer","minimum":100,"description":"服务端建议的下次轮询间隔。"},"result_ref":{"type":["string","null"],"description":"任务成功后的结果引用，通常为 /open/v1/job/{job_id}/result。"},"owner_ref":{"type":"string","maxLength":128,"description":"上传任务创建时固化的业务归属；非上传任务通常不返回。"},"error":{"oneOf":[{"type":"object","additionalProperties":false,"required":["code","message","retryable"],"properties":{"code":{"type":"string","enum":["conversion_failed","embedding_access_denied","embedding_output_invalid","embedding_unavailable","feature_disabled","forbidden","index_config_conflict","index_incomplete","input_invalid","input_too_large","internal_error","method_not_allowed","model_access_denied","model_output_invalid","model_unavailable","not_acceptable","not_found","payload_too_large","precondition_failed","precondition_required","processor_budget","processor_failed","processor_invalid_response","processor_rejected","processor_timeout","processor_unauthorized","processor_unavailable","queue_capacity_exceeded","rate_limited","resource_conflict","resource_not_found","semantic_unavailable","service_unavailable","source_ambiguous","source_changed","source_invalid","source_unavailable","source_writeback_unavailable","unauthorized","unsupported_media_type","upstream_rejected","upstream_timeout","upstream_unavailable"]},"message":{"type":"string","minLength":1},"retryable":{"type":"boolean"}}},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"finished_at":{"type":["string","null"],"format":"date-time"},"document_parse_diagnostics_v1":{"type":"object","additionalProperties":false,"required":["schema_version","requested_provider","requested_mode","result_source","pipeline_stage","worker_attempt_count","fallback_occurred","isolation_used","attempts","attempts_truncated","warnings"],"properties":{"schema_version":{"const":"document_parse_diagnostics_v1"},"requested_provider":{"type":"string","enum":["auto","docparse","tencent","local","mineru"],"default":"auto","description":"解析 Provider 策略。auto 按服务端启用列表和顺序执行；MinerU 默认禁用；指定 Provider 时严格执行该 Provider，不静默切换。"},"requested_mode":{"type":"string","enum":["standard","high_accuracy","structure_preserving"]},"result_source":{"type":"string","enum":["fresh","reused"]},"pipeline_stage":{"type":"string","enum":["completed","failed"]},"worker_attempt_count":{"type":"integer","minimum":1},"fallback_occurred":{"type":"boolean"},"isolation_used":{"type":"boolean"},"attempts":{"type":"array","maxItems":32,"items":{"type":"object","additionalProperties":false,"required":["provider","status","scope"],"properties":{"provider":{"type":"string","enum":["docparse","tencent","local","mineru","unknown"]},"status":{"type":"string","enum":["succeeded","failed","unknown"]},"scope":{"type":"string","enum":["group","page","isolation","unknown"]},"page_count":{"type":"integer","minimum":0},"duration_ms":{"type":"integer","minimum":0},"safe_error_code":{"type":"string","maxLength":64},"retryable":{"type":"boolean"},"fallback_allowed":{"type":"boolean"}}}},"attempts_truncated":{"type":"boolean"},"page_summary":{"type":"object","additionalProperties":false,"required":["total","ready","degraded","by_provider"],"properties":{"total":{"type":"integer","minimum":0},"ready":{"type":"integer","minimum":0},"degraded":{"type":"integer","minimum":0},"by_provider":{"type":"object","additionalProperties":false,"required":[],"properties":{"docparse":{"type":"integer","minimum":0},"tencent":{"type":"integer","minimum":0},"local":{"type":"integer","minimum":0}}}}},"warnings":{"type":"object","additionalProperties":false,"required":["count","codes"],"properties":{"count":{"type":"integer","minimum":0},"codes":{"type":"array","maxItems":32,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":64}}}},"source_format":{"type":"string","minLength":1,"maxLength":32},"canonicalized":{"type":"boolean"},"content_version":{"type":"string","minLength":1,"maxLength":128},"failure_stage":{"type":"string","enum":["precondition","source_read","convert","split","provider_parse","persist","unknown"]}}}}},"error":{"type":"null"}}}]}}},"headers":{"Location":{"description":"任务状态查询地址","schema":{"type":"string","example":"/open/v1/job/0123456789abcdef0123456789abcdef"}}},"links":{"查询任务进度":{"operationId":"getJob","parameters":{"job_id":"$response.body#/data/job_id"},"description":"使用本次返回的 job_id 查询任务进度。"},"读取任务结果":{"operationId":"getJobResult","parameters":{"job_id":"$response.body#/data/job_id"},"description":"任务 succeeded 后读取结构化结果。"}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"409":{"description":"幂等键、任务状态或资源状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"413":{"description":"请求体过大","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"415":{"description":"请求媒体类型不支持","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"429":{"description":"队列或模型并发额度已满，请稍后重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"500":{"description":"服务内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"502":{"description":"上游服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"504":{"description":"上游服务超时","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"document.write","x-stability":"stable"}},"/open/v1/documents:convert-to-pdf":{"post":{"tags":["2. 文档准备"],"summary":"将 Office、图片或 HTML 转换为 PDF","description":"HTML 支持中文h1-h6、段落、显式编号、强调和基础表格，以文件字段file上传；行内样式支持字号、对齐、字重、斜体、下划线、删除线、颜色、段距和行距。不执行脚本，不加载URL或本地路径，不支持图片、样式表和嵌套表格；不支持的输入明确400。HTML最多1000000字节、5000节点、32层、100页；沿用addDocument权限，无独立准入开关。转换不重排条款编号，不保存正式文档；直接返回二进制。Office 文档使用笃语服务端 LibreOffice 转换;图片按 1px=1pt 包装为单页 PDF,与平台解析影像所用转换完全一致。直接返回 PDF 二进制。为保证页码与 bbox 坐标一致，调用方必须将本接口返回的同一份 PDF 用于后续上传、解析、抽取和页面展示，不能再用原 Office 文件单独解析。确认文件本身无法转换(转换器报告无法载入,且服务端按字节确认文件被截断、不完整)时返回 422 `conversion_failed`(retryable=false):同一份内容重传结论不变，调用方可按内容哈希记住，改为另存 PDF 后上传。其余转换失败(含转换进程异常退出、无法确认是文件问题的情形)仍是 500 `internal_error`,不代表文件有问题,不应缓存。 支持JSON source_url读取服务端授权的私有MinIO输入，与原file上传互斥；转换不创建文档或永久原件副本。","operationId":"convertToPdf","requestBody":{"content":{"multipart/form-data":{"schema":{"properties":{"file":{"type":"string","format":"binary","description":"支持 doc、docx、xls、xlsx、ppt、pptx、odt、rtf,以及 jpg、jpeg、png、bmp、tif、tiff、webp 图片；新增UTF-8 html、htm。"}},"additionalProperties":false,"type":"object","required":["file"]}},"application/json":{"schema":{"properties":{"source_url":{"type":"string","maxLength":8192,"minLength":1,"description":"私有MinIO对象地址，只允许当前Space服务端绑定的endpoint、桶和前缀；禁止凭据、query及fragment。"},"file_name":{"type":"string","maxLength":255,"minLength":1}},"additionalProperties":false,"type":"object","required":["source_url"]}}},"required":true},"responses":{"200":{"description":"PDF 转换成功；该响应文件应作为后续解析和展示的统一坐标基准","headers":{"Content-Disposition":{"description":"转换后的下载文件名","schema":{"type":"string"}}},"content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"409":{"description":"幂等键、任务状态或资源状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"413":{"description":"请求体过大","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"415":{"description":"请求媒体类型不支持","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"422":{"description":"文件内容无法转换(已确认文件被截断、不完整,重传无效)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"500":{"description":"服务内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"502":{"description":"上游服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"504":{"description":"上游服务超时","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"addDocument","x-stability":"stable"}},"/open/v1/documents:convert-to-word":{"post":{"tags":["2. 文档准备"],"summary":"将 HTML 转换为可编辑 Word 文档","description":"同步返回可编辑DOCX二进制。与HTML转PDF共用输入校验和样式范围，支持中文正文、h1-h6、段落、显式条款编号、加粗、斜体、下划线、删除线、上下标及基础表格和有界单元格合并。字号8至36pt，对齐、颜色、段距和行距见接入说明；不自动生成或重排编号。Word的head/title元信息最多255个字符，超限在渲染前返回400；正文标题不会截断。不调用模型，不上传到第三方，不保存业务对象。禁止脚本、事件属性、外部资源、样式表和本地路径；图片、嵌套表格及任意HTML/CSS不在支持范围，不支持的元素或样式明确400，不静默丢失正文。最多1000000字节、5000节点、32层；表格最多200行20列、单元格合并1至20。沿用addDocument权限，无独立准入开关。 支持JSON source_url读取服务端授权的私有MinIO输入，与原file上传互斥；转换不创建文档或永久原件副本。","operationId":"convertToWord","requestBody":{"content":{"multipart/form-data":{"schema":{"properties":{"file":{"type":"string","format":"binary","description":"已组装的UTF-8 html或htm文件，支持行内样式；只传一个file字段。"}},"additionalProperties":false,"type":"object","required":["file"]}},"application/json":{"schema":{"properties":{"source_url":{"type":"string","maxLength":8192,"minLength":1,"description":"私有MinIO对象地址，只允许当前Space服务端绑定的endpoint、桶和前缀；禁止凭据、query及fragment。"},"file_name":{"type":"string","maxLength":255,"minLength":1}},"additionalProperties":false,"type":"object","required":["source_url"]}}},"required":true},"responses":{"200":{"description":"可编辑DOCX转换成功","headers":{"Content-Disposition":{"description":"转换后的下载文件名","schema":{"type":"string"}}},"content":{"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"409":{"description":"幂等键、任务状态或资源状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"413":{"description":"请求体过大","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"415":{"description":"请求媒体类型不支持","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"422":{"description":"文件内容无法转换(已确认文件被截断、不完整,重传无效)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"500":{"description":"服务内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"502":{"description":"上游服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"504":{"description":"上游服务超时","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"addDocument","x-stability":"preview"}},"/open/v1/documents:merge":{"post":{"tags":["2. 文档准备"],"summary":"按指定顺序把多份 PDF 合并为一份并生成书签","description":"合并只做确定性操作,不重排版、不压缩、不 OCR。源文件加密、损坏或没有页面时整单失败,不会产出缺页的半成品。产物落成新文档并返回 doc_id,可直接进入解析、抽取等后续能力;Job 结果里的 merge_manifest 记录每份源文件在合并件中的页码区间与书签结构。","operationId":"mergePdfDocuments","requestBody":{"content":{"application/json":{"schema":{"properties":{"doc_ids":{"items":{"type":"integer","minimum":1.0},"type":"array","maxItems":50,"minItems":2,"description":"按此顺序合并;order=by_file_name 时改按文件名自然序。"},"client_request_id":{"type":"string","maxLength":128,"minLength":1,"pattern":"^[A-Za-z0-9._:-]+$","description":"调用方生成的幂等请求标识；相同调用方重试时保持不变。"},"file_name":{"type":"string","maxLength":200,"description":"输出文件名,必须以 .pdf 结尾;默认「合并文档.pdf」。"},"order":{"type":"string","enum":["as_given","by_file_name"],"default":"as_given"},"bookmarks":{"type":"string","enum":["none","source_name","source_toc"],"description":"source_name:每份源文件一个一级书签;source_toc:再把源文件自带目录下挂一级。","default":"source_name"},"owner_ref":{"type":"string","maxLength":128}},"additionalProperties":false,"type":"object","required":["doc_ids","client_request_id"]}}},"required":true},"responses":{"202":{"description":"任务已受理；请使用 job_id 查询进度和结果","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"required":["job_id","operation","status","phase","progress","progress_detail","sequence","attempt","poll_after_ms","result_ref","error","created_at","updated_at","finished_at"],"properties":{"job_id":{"type":"string","minLength":32,"maxLength":32,"pattern":"^[a-f0-9]{32}$","description":"异步任务唯一 ID；刷新页面或跨请求查询时保持不变。"},"operation":{"type":"string","description":"任务类型；当前主要为 upload、parse 或 extract。"},"status":{"type":"string","description":"queued=排队中，running=处理中，succeeded=已完成，failed/cancelled/unknown=终态异常。","enum":["queued","running","succeeded","failed","cancelled","unknown"]},"phase":{"type":["string","null"],"description":"当前处理阶段；服务未提供细分阶段时为 null。"},"progress":{"type":["integer","null"],"minimum":0,"maximum":100,"description":"0 到 100 的处理进度；无法计算时为 null。"},"progress_detail":{"oneOf":[{"type":"object","additionalProperties":false,"required":["unit","current","total"],"properties":{"unit":{"type":"string","enum":["bytes","documents","items","pages"]},"current":{"type":"integer","minimum":0},"total":{"type":"integer","minimum":1}}},{"type":"null"}],"description":"可核验的真实进度分子、分母；无法度量时为 null。"},"sequence":{"type":"integer","minimum":0,"description":"状态事件单调序号；客户端用它丢弃乱序轮询结果。"},"attempt":{"type":"integer","minimum":0,"description":"worker 执行尝试次数；上传直接执行时固定为 1。"},"poll_after_ms":{"type":"integer","minimum":100,"description":"服务端建议的下次轮询间隔。"},"result_ref":{"type":["string","null"],"description":"任务成功后的结果引用，通常为 /open/v1/job/{job_id}/result。"},"owner_ref":{"type":"string","maxLength":128,"description":"上传任务创建时固化的业务归属；非上传任务通常不返回。"},"error":{"oneOf":[{"type":"object","additionalProperties":false,"required":["code","message","retryable"],"properties":{"code":{"type":"string","enum":["conversion_failed","embedding_access_denied","embedding_output_invalid","embedding_unavailable","feature_disabled","forbidden","index_config_conflict","index_incomplete","input_invalid","input_too_large","internal_error","method_not_allowed","model_access_denied","model_output_invalid","model_unavailable","not_acceptable","not_found","payload_too_large","precondition_failed","precondition_required","processor_budget","processor_failed","processor_invalid_response","processor_rejected","processor_timeout","processor_unauthorized","processor_unavailable","queue_capacity_exceeded","rate_limited","resource_conflict","resource_not_found","semantic_unavailable","service_unavailable","source_ambiguous","source_changed","source_invalid","source_unavailable","source_writeback_unavailable","unauthorized","unsupported_media_type","upstream_rejected","upstream_timeout","upstream_unavailable"]},"message":{"type":"string","minLength":1},"retryable":{"type":"boolean"}}},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"finished_at":{"type":["string","null"],"format":"date-time"},"document_parse_diagnostics_v1":{"type":"object","additionalProperties":false,"required":["schema_version","requested_provider","requested_mode","result_source","pipeline_stage","worker_attempt_count","fallback_occurred","isolation_used","attempts","attempts_truncated","warnings"],"properties":{"schema_version":{"const":"document_parse_diagnostics_v1"},"requested_provider":{"type":"string","enum":["auto","docparse","tencent","local","mineru"],"default":"auto","description":"解析 Provider 策略。auto 按服务端启用列表和顺序执行；MinerU 默认禁用；指定 Provider 时严格执行该 Provider，不静默切换。"},"requested_mode":{"type":"string","enum":["standard","high_accuracy","structure_preserving"]},"result_source":{"type":"string","enum":["fresh","reused"]},"pipeline_stage":{"type":"string","enum":["completed","failed"]},"worker_attempt_count":{"type":"integer","minimum":1},"fallback_occurred":{"type":"boolean"},"isolation_used":{"type":"boolean"},"attempts":{"type":"array","maxItems":32,"items":{"type":"object","additionalProperties":false,"required":["provider","status","scope"],"properties":{"provider":{"type":"string","enum":["docparse","tencent","local","mineru","unknown"]},"status":{"type":"string","enum":["succeeded","failed","unknown"]},"scope":{"type":"string","enum":["group","page","isolation","unknown"]},"page_count":{"type":"integer","minimum":0},"duration_ms":{"type":"integer","minimum":0},"safe_error_code":{"type":"string","maxLength":64},"retryable":{"type":"boolean"},"fallback_allowed":{"type":"boolean"}}}},"attempts_truncated":{"type":"boolean"},"page_summary":{"type":"object","additionalProperties":false,"required":["total","ready","degraded","by_provider"],"properties":{"total":{"type":"integer","minimum":0},"ready":{"type":"integer","minimum":0},"degraded":{"type":"integer","minimum":0},"by_provider":{"type":"object","additionalProperties":false,"required":[],"properties":{"docparse":{"type":"integer","minimum":0},"tencent":{"type":"integer","minimum":0},"local":{"type":"integer","minimum":0}}}}},"warnings":{"type":"object","additionalProperties":false,"required":["count","codes"],"properties":{"count":{"type":"integer","minimum":0},"codes":{"type":"array","maxItems":32,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":64}}}},"source_format":{"type":"string","minLength":1,"maxLength":32},"canonicalized":{"type":"boolean"},"content_version":{"type":"string","minLength":1,"maxLength":128},"failure_stage":{"type":"string","enum":["precondition","source_read","convert","split","provider_parse","persist","unknown"]}}}}},"error":{"type":"null"}}}]}}},"headers":{"Location":{"description":"任务状态查询地址","schema":{"type":"string","example":"/open/v1/job/0123456789abcdef0123456789abcdef"}}},"links":{"查询任务进度":{"operationId":"getJob","parameters":{"job_id":"$response.body#/data/job_id"},"description":"使用本次返回的 job_id 查询任务进度。"},"读取任务结果":{"operationId":"getJobResult","parameters":{"job_id":"$response.body#/data/job_id"},"description":"任务 succeeded 后读取结构化结果。"}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"409":{"description":"幂等键、任务状态或资源状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"413":{"description":"请求体过大","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"415":{"description":"请求媒体类型不支持","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"429":{"description":"队列或模型并发额度已满，请稍后重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"500":{"description":"服务内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"502":{"description":"上游服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"504":{"description":"上游服务超时","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"document.write","x-stability":"preview"}},"/open/v1/documents:split":{"post":{"tags":["2. 文档准备"],"summary":"按规则或语义规划把一份 PDF 拆成多份","description":"原四种规则保持原行为。semantic 需服务端开启，先 plan 自动识别材料或章节边界，再 execute 提交确认范围；低把握边界返回 needs_confirmation，不静默丢弃空白页。语义执行绑定规划和源文件摘要，批量发布分件；不保证原 PDF 数字签名在分件中有效。每份拆分件落成新文档并返回 doc_id;任何一份失败整单失败,不产半套产物。Job 结果里的 split_manifest 记录每份的起止页、拆分依据、doc_id 与状态;另返回 duration_ms。加密、损坏、规则无效、关键词零命中均为 input_invalid。","operationId":"splitPdfDocument","requestBody":{"content":{"application/json":{"schema":{"properties":{"doc_id":{"type":"integer","minimum":1.0},"rule":{"type":"string","enum":["page_ranges","fixed_pages","bookmarks","keyword","semantic"]},"action":{"type":"string","enum":["plan","execute"],"description":"semantic 专用，必须显式指定规划或执行阶段。"},"split_goal":{"type":"string","enum":["documents","chapters"],"description":"规划目标：独立材料或顶层章节；执行时沿用规划值。","default":"documents"},"plan_job_id":{"type":"string","pattern":"^[a-f0-9]{32}$","description":"execute 必填，同身份、同 Space 的已完成规划 Job。"},"plan_sha256":{"type":"string","pattern":"^[a-f0-9]{64}$","description":"execute 必填，规划结果返回的版本摘要。"},"confirmed_page_ranges":{"items":{"items":{"type":"integer","minimum":1.0},"type":"array","maxItems":2,"minItems":2},"type":"array","minItems":1,"description":"execute 必填；确认或调整后的完整范围，必须原序、无漏页、无重页。"},"page_ranges":{"items":{"items":{"type":"integer","minimum":1.0},"type":"array","maxItems":2,"minItems":2},"type":"array","minItems":1,"description":"rule=page_ranges 时必填:[[起,止],…],1 基闭区间,不得重叠。"},"fixed_pages":{"type":"integer","minimum":1.0,"description":"rule=fixed_pages 时必填:每份页数。"},"bookmark_level":{"type":"integer","minimum":1.0,"description":"rule=bookmarks 时按该层级的书签切。","default":1},"keyword":{"type":"string","maxLength":200,"description":"rule=keyword 时必填:关键词首次出现的页开新份;需文本层。"},"file_name_prefix":{"type":"string","maxLength":80,"description":"拆分件文件名前缀,默认取原文件名。"},"client_request_id":{"type":"string","maxLength":128,"minLength":1,"pattern":"^[A-Za-z0-9._:-]+$","description":"调用方生成的幂等请求标识；相同调用方重试时保持不变。"},"owner_ref":{"type":"string","maxLength":128}},"additionalProperties":false,"type":"object","required":["doc_id","rule","client_request_id"]}}},"required":true},"responses":{"202":{"description":"任务已受理；请使用 job_id 查询进度和结果","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"required":["job_id","operation","status","phase","progress","progress_detail","sequence","attempt","poll_after_ms","result_ref","error","created_at","updated_at","finished_at"],"properties":{"job_id":{"type":"string","minLength":32,"maxLength":32,"pattern":"^[a-f0-9]{32}$","description":"异步任务唯一 ID；刷新页面或跨请求查询时保持不变。"},"operation":{"type":"string","description":"任务类型；当前主要为 upload、parse 或 extract。"},"status":{"type":"string","description":"queued=排队中，running=处理中，succeeded=已完成，failed/cancelled/unknown=终态异常。","enum":["queued","running","succeeded","failed","cancelled","unknown"]},"phase":{"type":["string","null"],"description":"当前处理阶段；服务未提供细分阶段时为 null。"},"progress":{"type":["integer","null"],"minimum":0,"maximum":100,"description":"0 到 100 的处理进度；无法计算时为 null。"},"progress_detail":{"oneOf":[{"type":"object","additionalProperties":false,"required":["unit","current","total"],"properties":{"unit":{"type":"string","enum":["bytes","documents","items","pages"]},"current":{"type":"integer","minimum":0},"total":{"type":"integer","minimum":1}}},{"type":"null"}],"description":"可核验的真实进度分子、分母；无法度量时为 null。"},"sequence":{"type":"integer","minimum":0,"description":"状态事件单调序号；客户端用它丢弃乱序轮询结果。"},"attempt":{"type":"integer","minimum":0,"description":"worker 执行尝试次数；上传直接执行时固定为 1。"},"poll_after_ms":{"type":"integer","minimum":100,"description":"服务端建议的下次轮询间隔。"},"result_ref":{"type":["string","null"],"description":"任务成功后的结果引用，通常为 /open/v1/job/{job_id}/result。"},"owner_ref":{"type":"string","maxLength":128,"description":"上传任务创建时固化的业务归属；非上传任务通常不返回。"},"error":{"oneOf":[{"type":"object","additionalProperties":false,"required":["code","message","retryable"],"properties":{"code":{"type":"string","enum":["conversion_failed","embedding_access_denied","embedding_output_invalid","embedding_unavailable","feature_disabled","forbidden","index_config_conflict","index_incomplete","input_invalid","input_too_large","internal_error","method_not_allowed","model_access_denied","model_output_invalid","model_unavailable","not_acceptable","not_found","payload_too_large","precondition_failed","precondition_required","processor_budget","processor_failed","processor_invalid_response","processor_rejected","processor_timeout","processor_unauthorized","processor_unavailable","queue_capacity_exceeded","rate_limited","resource_conflict","resource_not_found","semantic_unavailable","service_unavailable","source_ambiguous","source_changed","source_invalid","source_unavailable","source_writeback_unavailable","unauthorized","unsupported_media_type","upstream_rejected","upstream_timeout","upstream_unavailable"]},"message":{"type":"string","minLength":1},"retryable":{"type":"boolean"}}},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"finished_at":{"type":["string","null"],"format":"date-time"},"document_parse_diagnostics_v1":{"type":"object","additionalProperties":false,"required":["schema_version","requested_provider","requested_mode","result_source","pipeline_stage","worker_attempt_count","fallback_occurred","isolation_used","attempts","attempts_truncated","warnings"],"properties":{"schema_version":{"const":"document_parse_diagnostics_v1"},"requested_provider":{"type":"string","enum":["auto","docparse","tencent","local","mineru"],"default":"auto","description":"解析 Provider 策略。auto 按服务端启用列表和顺序执行；MinerU 默认禁用；指定 Provider 时严格执行该 Provider，不静默切换。"},"requested_mode":{"type":"string","enum":["standard","high_accuracy","structure_preserving"]},"result_source":{"type":"string","enum":["fresh","reused"]},"pipeline_stage":{"type":"string","enum":["completed","failed"]},"worker_attempt_count":{"type":"integer","minimum":1},"fallback_occurred":{"type":"boolean"},"isolation_used":{"type":"boolean"},"attempts":{"type":"array","maxItems":32,"items":{"type":"object","additionalProperties":false,"required":["provider","status","scope"],"properties":{"provider":{"type":"string","enum":["docparse","tencent","local","mineru","unknown"]},"status":{"type":"string","enum":["succeeded","failed","unknown"]},"scope":{"type":"string","enum":["group","page","isolation","unknown"]},"page_count":{"type":"integer","minimum":0},"duration_ms":{"type":"integer","minimum":0},"safe_error_code":{"type":"string","maxLength":64},"retryable":{"type":"boolean"},"fallback_allowed":{"type":"boolean"}}}},"attempts_truncated":{"type":"boolean"},"page_summary":{"type":"object","additionalProperties":false,"required":["total","ready","degraded","by_provider"],"properties":{"total":{"type":"integer","minimum":0},"ready":{"type":"integer","minimum":0},"degraded":{"type":"integer","minimum":0},"by_provider":{"type":"object","additionalProperties":false,"required":[],"properties":{"docparse":{"type":"integer","minimum":0},"tencent":{"type":"integer","minimum":0},"local":{"type":"integer","minimum":0}}}}},"warnings":{"type":"object","additionalProperties":false,"required":["count","codes"],"properties":{"count":{"type":"integer","minimum":0},"codes":{"type":"array","maxItems":32,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":64}}}},"source_format":{"type":"string","minLength":1,"maxLength":32},"canonicalized":{"type":"boolean"},"content_version":{"type":"string","minLength":1,"maxLength":128},"failure_stage":{"type":"string","enum":["precondition","source_read","convert","split","provider_parse","persist","unknown"]}}}}},"error":{"type":"null"}}}]}}},"headers":{"Location":{"description":"任务状态查询地址","schema":{"type":"string","example":"/open/v1/job/0123456789abcdef0123456789abcdef"}}},"links":{"查询任务进度":{"operationId":"getJob","parameters":{"job_id":"$response.body#/data/job_id"},"description":"使用本次返回的 job_id 查询任务进度。"},"读取任务结果":{"operationId":"getJobResult","parameters":{"job_id":"$response.body#/data/job_id"},"description":"任务 succeeded 后读取结构化结果。"}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"409":{"description":"幂等键、任务状态或资源状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"413":{"description":"请求体过大","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"415":{"description":"请求媒体类型不支持","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"429":{"description":"队列或模型并发额度已满，请稍后重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"500":{"description":"服务内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"502":{"description":"上游服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"504":{"description":"上游服务超时","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"document.write","x-stability":"preview"}},"/open/v1/documents:render-sheets":{"post":{"tags":["2. 文档准备"],"summary":"把 Excel 的每个工作表渲染成 PNG 图片","description":"整本经笃语服务端 LibreOffice 转 PDF(公式显示计算结果、保留字体/颜色/边框/合并单元格),按工作表书签切页后逐页渲染 PNG;内容较宽或较长的表按打印分页输出多张。隐藏表与空表跳过并在清单里标注原因。每张图片落成新文档并返回 doc_id;Job 结果里的 render_manifest 记录工作表名、顺序、每张图尺寸与状态,另返回 duration_ms。readable 模式另返回 layout.font_diagnostics:status 为 checked/partial/unavailable,仅核对可见单元格字体族;sheets 中 unlisted_families(name/cell_count)提示替换风险,unresolved_cells记录未解析数。checked不代表无缺字或无截断。include_layout_diagnostics=true另返回layout.height_diagnostics，basis=source_workbook；只检查可见换行/多行单元格高度，旋转和缩小适应等保留未检查。状态checked/partial/unavailable不证明全图无截断。诊断请求的图片整批发布，失败不发布部分产物；省略或false沿用原行为。readable保留原打印选区，layout.adjustments每表增加print_area_diagnostics，报告声明打印范围外的可见单元格和跨边界合并区域；不据行高修复推断整表已输出。转换失败时 Job 的 error 按原因区分:`input_invalid` 只在服务端确认是这份工作簿本身的问题时返回(损坏/加密、超出单元格或续行预算、含不支持的布局),同一份内容重传结论不变;转换进程被终止或资源耗尽与文件内容无关,返回 `internal_error` 且 retryable=true,稍后重试可能成功;没有转出来但服务端无法判断原因时返回 `internal_error` 且 retryable=false,不代表文件有问题;转换超时为 `upstream_timeout`,转换依赖不可用为 `upstream_unavailable`。","operationId":"renderExcelSheets","requestBody":{"content":{"application/json":{"schema":{"properties":{"doc_id":{"type":"integer","minimum":1.0},"sheets":{"items":{"type":"string","maxLength":128},"type":"array","description":"只转这些工作表;缺省转全部有效工作表。"},"layout_mode":{"type":"string","enum":["preserve","readable"],"description":"preserve 保留原打印布局;readable 在临时副本按实际字体排版调整换行与行高,恢复100%打印缩放并按原字号分页,需要服务端开启。隐藏内容仍保持隐藏。","default":"preserve"},"include_layout_diagnostics":{"type":"boolean","description":"显式请求原工作簿的高度风险诊断，需服务端独立开启。两种布局模式均支持；不修改图片，未检查或不可用不能视为无截断。","default":false},"dpi":{"type":"integer","maximum":300.0,"minimum":72.0,"default":150},"client_request_id":{"type":"string","maxLength":128,"minLength":1,"pattern":"^[A-Za-z0-9._:-]+$","description":"调用方生成的幂等请求标识；相同调用方重试时保持不变。"},"owner_ref":{"type":"string","maxLength":128}},"additionalProperties":false,"type":"object","required":["doc_id","client_request_id"]}}},"required":true},"responses":{"202":{"description":"任务已受理；请使用 job_id 查询进度和结果","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"required":["job_id","operation","status","phase","progress","progress_detail","sequence","attempt","poll_after_ms","result_ref","error","created_at","updated_at","finished_at"],"properties":{"job_id":{"type":"string","minLength":32,"maxLength":32,"pattern":"^[a-f0-9]{32}$","description":"异步任务唯一 ID；刷新页面或跨请求查询时保持不变。"},"operation":{"type":"string","description":"任务类型；当前主要为 upload、parse 或 extract。"},"status":{"type":"string","description":"queued=排队中，running=处理中，succeeded=已完成，failed/cancelled/unknown=终态异常。","enum":["queued","running","succeeded","failed","cancelled","unknown"]},"phase":{"type":["string","null"],"description":"当前处理阶段；服务未提供细分阶段时为 null。"},"progress":{"type":["integer","null"],"minimum":0,"maximum":100,"description":"0 到 100 的处理进度；无法计算时为 null。"},"progress_detail":{"oneOf":[{"type":"object","additionalProperties":false,"required":["unit","current","total"],"properties":{"unit":{"type":"string","enum":["bytes","documents","items","pages"]},"current":{"type":"integer","minimum":0},"total":{"type":"integer","minimum":1}}},{"type":"null"}],"description":"可核验的真实进度分子、分母；无法度量时为 null。"},"sequence":{"type":"integer","minimum":0,"description":"状态事件单调序号；客户端用它丢弃乱序轮询结果。"},"attempt":{"type":"integer","minimum":0,"description":"worker 执行尝试次数；上传直接执行时固定为 1。"},"poll_after_ms":{"type":"integer","minimum":100,"description":"服务端建议的下次轮询间隔。"},"result_ref":{"type":["string","null"],"description":"任务成功后的结果引用，通常为 /open/v1/job/{job_id}/result。"},"owner_ref":{"type":"string","maxLength":128,"description":"上传任务创建时固化的业务归属；非上传任务通常不返回。"},"error":{"oneOf":[{"type":"object","additionalProperties":false,"required":["code","message","retryable"],"properties":{"code":{"type":"string","enum":["conversion_failed","embedding_access_denied","embedding_output_invalid","embedding_unavailable","feature_disabled","forbidden","index_config_conflict","index_incomplete","input_invalid","input_too_large","internal_error","method_not_allowed","model_access_denied","model_output_invalid","model_unavailable","not_acceptable","not_found","payload_too_large","precondition_failed","precondition_required","processor_budget","processor_failed","processor_invalid_response","processor_rejected","processor_timeout","processor_unauthorized","processor_unavailable","queue_capacity_exceeded","rate_limited","resource_conflict","resource_not_found","semantic_unavailable","service_unavailable","source_ambiguous","source_changed","source_invalid","source_unavailable","source_writeback_unavailable","unauthorized","unsupported_media_type","upstream_rejected","upstream_timeout","upstream_unavailable"]},"message":{"type":"string","minLength":1},"retryable":{"type":"boolean"}}},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"finished_at":{"type":["string","null"],"format":"date-time"},"document_parse_diagnostics_v1":{"type":"object","additionalProperties":false,"required":["schema_version","requested_provider","requested_mode","result_source","pipeline_stage","worker_attempt_count","fallback_occurred","isolation_used","attempts","attempts_truncated","warnings"],"properties":{"schema_version":{"const":"document_parse_diagnostics_v1"},"requested_provider":{"type":"string","enum":["auto","docparse","tencent","local","mineru"],"default":"auto","description":"解析 Provider 策略。auto 按服务端启用列表和顺序执行；MinerU 默认禁用；指定 Provider 时严格执行该 Provider，不静默切换。"},"requested_mode":{"type":"string","enum":["standard","high_accuracy","structure_preserving"]},"result_source":{"type":"string","enum":["fresh","reused"]},"pipeline_stage":{"type":"string","enum":["completed","failed"]},"worker_attempt_count":{"type":"integer","minimum":1},"fallback_occurred":{"type":"boolean"},"isolation_used":{"type":"boolean"},"attempts":{"type":"array","maxItems":32,"items":{"type":"object","additionalProperties":false,"required":["provider","status","scope"],"properties":{"provider":{"type":"string","enum":["docparse","tencent","local","mineru","unknown"]},"status":{"type":"string","enum":["succeeded","failed","unknown"]},"scope":{"type":"string","enum":["group","page","isolation","unknown"]},"page_count":{"type":"integer","minimum":0},"duration_ms":{"type":"integer","minimum":0},"safe_error_code":{"type":"string","maxLength":64},"retryable":{"type":"boolean"},"fallback_allowed":{"type":"boolean"}}}},"attempts_truncated":{"type":"boolean"},"page_summary":{"type":"object","additionalProperties":false,"required":["total","ready","degraded","by_provider"],"properties":{"total":{"type":"integer","minimum":0},"ready":{"type":"integer","minimum":0},"degraded":{"type":"integer","minimum":0},"by_provider":{"type":"object","additionalProperties":false,"required":[],"properties":{"docparse":{"type":"integer","minimum":0},"tencent":{"type":"integer","minimum":0},"local":{"type":"integer","minimum":0}}}}},"warnings":{"type":"object","additionalProperties":false,"required":["count","codes"],"properties":{"count":{"type":"integer","minimum":0},"codes":{"type":"array","maxItems":32,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":64}}}},"source_format":{"type":"string","minLength":1,"maxLength":32},"canonicalized":{"type":"boolean"},"content_version":{"type":"string","minLength":1,"maxLength":128},"failure_stage":{"type":"string","enum":["precondition","source_read","convert","split","provider_parse","persist","unknown"]}}}}},"error":{"type":"null"}}}]}}},"headers":{"Location":{"description":"任务状态查询地址","schema":{"type":"string","example":"/open/v1/job/0123456789abcdef0123456789abcdef"}}},"links":{"查询任务进度":{"operationId":"getJob","parameters":{"job_id":"$response.body#/data/job_id"},"description":"使用本次返回的 job_id 查询任务进度。"},"读取任务结果":{"operationId":"getJobResult","parameters":{"job_id":"$response.body#/data/job_id"},"description":"任务 succeeded 后读取结构化结果。"}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"409":{"description":"幂等键、任务状态或资源状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"413":{"description":"请求体过大","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"415":{"description":"请求媒体类型不支持","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"429":{"description":"队列或模型并发额度已满，请稍后重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"500":{"description":"服务内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"502":{"description":"上游服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"504":{"description":"上游服务超时","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"document.write","x-stability":"preview"}},"/open/v1/documents:classify-images":{"post":{"tags":["4. 文档异步任务"],"summary":"按调用方提供的候选分类用视觉模型判定图片类别","description":"每张图一次视觉模型调用。结果必须来自候选闭集:模型给出不在候选内的类别一律判 none,不就近取。判定看 decision(matched / uncertain / none);confidence 为模型自报且未校准,仅供参考。返回每张图的分类、判定、依据与模型用量。服务端未配置视觉模型时返回 upstream_unavailable。","operationId":"classifyImages","requestBody":{"content":{"application/json":{"schema":{"properties":{"doc_ids":{"items":{"type":"integer","minimum":1.0},"type":"array","maxItems":20,"minItems":1,"description":"已上传的图片文档(jpg/jpeg/png/bmp/webp)。"},"candidates":{"items":{"properties":{"code":{"type":"string","maxLength":128,"minLength":1},"name":{"type":"string","maxLength":256,"minLength":1},"description":{"type":"string","maxLength":2000}},"additionalProperties":false,"type":"object","required":["code","name"]},"type":"array","minItems":1},"max_side":{"type":"integer","maximum":4096.0,"minimum":256.0,"description":"送模型前图片最长边像素。","default":1280},"client_request_id":{"type":"string","maxLength":128,"minLength":1,"pattern":"^[A-Za-z0-9._:-]+$","description":"调用方生成的幂等请求标识；相同调用方重试时保持不变。"}},"additionalProperties":false,"type":"object","required":["doc_ids","candidates","client_request_id"]}}},"required":true},"responses":{"202":{"description":"任务已受理；请使用 job_id 查询进度和结果","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"required":["job_id","operation","status","phase","progress","progress_detail","sequence","attempt","poll_after_ms","result_ref","error","created_at","updated_at","finished_at"],"properties":{"job_id":{"type":"string","minLength":32,"maxLength":32,"pattern":"^[a-f0-9]{32}$","description":"异步任务唯一 ID；刷新页面或跨请求查询时保持不变。"},"operation":{"type":"string","description":"任务类型；当前主要为 upload、parse 或 extract。"},"status":{"type":"string","description":"queued=排队中，running=处理中，succeeded=已完成，failed/cancelled/unknown=终态异常。","enum":["queued","running","succeeded","failed","cancelled","unknown"]},"phase":{"type":["string","null"],"description":"当前处理阶段；服务未提供细分阶段时为 null。"},"progress":{"type":["integer","null"],"minimum":0,"maximum":100,"description":"0 到 100 的处理进度；无法计算时为 null。"},"progress_detail":{"oneOf":[{"type":"object","additionalProperties":false,"required":["unit","current","total"],"properties":{"unit":{"type":"string","enum":["bytes","documents","items","pages"]},"current":{"type":"integer","minimum":0},"total":{"type":"integer","minimum":1}}},{"type":"null"}],"description":"可核验的真实进度分子、分母；无法度量时为 null。"},"sequence":{"type":"integer","minimum":0,"description":"状态事件单调序号；客户端用它丢弃乱序轮询结果。"},"attempt":{"type":"integer","minimum":0,"description":"worker 执行尝试次数；上传直接执行时固定为 1。"},"poll_after_ms":{"type":"integer","minimum":100,"description":"服务端建议的下次轮询间隔。"},"result_ref":{"type":["string","null"],"description":"任务成功后的结果引用，通常为 /open/v1/job/{job_id}/result。"},"owner_ref":{"type":"string","maxLength":128,"description":"上传任务创建时固化的业务归属；非上传任务通常不返回。"},"error":{"oneOf":[{"type":"object","additionalProperties":false,"required":["code","message","retryable"],"properties":{"code":{"type":"string","enum":["conversion_failed","embedding_access_denied","embedding_output_invalid","embedding_unavailable","feature_disabled","forbidden","index_config_conflict","index_incomplete","input_invalid","input_too_large","internal_error","method_not_allowed","model_access_denied","model_output_invalid","model_unavailable","not_acceptable","not_found","payload_too_large","precondition_failed","precondition_required","processor_budget","processor_failed","processor_invalid_response","processor_rejected","processor_timeout","processor_unauthorized","processor_unavailable","queue_capacity_exceeded","rate_limited","resource_conflict","resource_not_found","semantic_unavailable","service_unavailable","source_ambiguous","source_changed","source_invalid","source_unavailable","source_writeback_unavailable","unauthorized","unsupported_media_type","upstream_rejected","upstream_timeout","upstream_unavailable"]},"message":{"type":"string","minLength":1},"retryable":{"type":"boolean"}}},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"finished_at":{"type":["string","null"],"format":"date-time"},"document_parse_diagnostics_v1":{"type":"object","additionalProperties":false,"required":["schema_version","requested_provider","requested_mode","result_source","pipeline_stage","worker_attempt_count","fallback_occurred","isolation_used","attempts","attempts_truncated","warnings"],"properties":{"schema_version":{"const":"document_parse_diagnostics_v1"},"requested_provider":{"type":"string","enum":["auto","docparse","tencent","local","mineru"],"default":"auto","description":"解析 Provider 策略。auto 按服务端启用列表和顺序执行；MinerU 默认禁用；指定 Provider 时严格执行该 Provider，不静默切换。"},"requested_mode":{"type":"string","enum":["standard","high_accuracy","structure_preserving"]},"result_source":{"type":"string","enum":["fresh","reused"]},"pipeline_stage":{"type":"string","enum":["completed","failed"]},"worker_attempt_count":{"type":"integer","minimum":1},"fallback_occurred":{"type":"boolean"},"isolation_used":{"type":"boolean"},"attempts":{"type":"array","maxItems":32,"items":{"type":"object","additionalProperties":false,"required":["provider","status","scope"],"properties":{"provider":{"type":"string","enum":["docparse","tencent","local","mineru","unknown"]},"status":{"type":"string","enum":["succeeded","failed","unknown"]},"scope":{"type":"string","enum":["group","page","isolation","unknown"]},"page_count":{"type":"integer","minimum":0},"duration_ms":{"type":"integer","minimum":0},"safe_error_code":{"type":"string","maxLength":64},"retryable":{"type":"boolean"},"fallback_allowed":{"type":"boolean"}}}},"attempts_truncated":{"type":"boolean"},"page_summary":{"type":"object","additionalProperties":false,"required":["total","ready","degraded","by_provider"],"properties":{"total":{"type":"integer","minimum":0},"ready":{"type":"integer","minimum":0},"degraded":{"type":"integer","minimum":0},"by_provider":{"type":"object","additionalProperties":false,"required":[],"properties":{"docparse":{"type":"integer","minimum":0},"tencent":{"type":"integer","minimum":0},"local":{"type":"integer","minimum":0}}}}},"warnings":{"type":"object","additionalProperties":false,"required":["count","codes"],"properties":{"count":{"type":"integer","minimum":0},"codes":{"type":"array","maxItems":32,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":64}}}},"source_format":{"type":"string","minLength":1,"maxLength":32},"canonicalized":{"type":"boolean"},"content_version":{"type":"string","minLength":1,"maxLength":128},"failure_stage":{"type":"string","enum":["precondition","source_read","convert","split","provider_parse","persist","unknown"]}}}}},"error":{"type":"null"}}}]}}},"headers":{"Location":{"description":"任务状态查询地址","schema":{"type":"string","example":"/open/v1/job/0123456789abcdef0123456789abcdef"}}},"links":{"查询任务进度":{"operationId":"getJob","parameters":{"job_id":"$response.body#/data/job_id"},"description":"使用本次返回的 job_id 查询任务进度。"},"读取任务结果":{"operationId":"getJobResult","parameters":{"job_id":"$response.body#/data/job_id"},"description":"任务 succeeded 后读取结构化结果。"}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"409":{"description":"幂等键、任务状态或资源状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"413":{"description":"请求体过大","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"415":{"description":"请求媒体类型不支持","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"429":{"description":"队列或模型并发额度已满，请稍后重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"500":{"description":"服务内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"502":{"description":"上游服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"504":{"description":"上游服务超时","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"viewCategory","x-stability":"preview"}},"/open/v1/audio:analyze":{"post":{"tags":["4. 文档异步任务"],"summary":"解析录音的转写、说话人分段及关键词","description":"接收已上传的 WAV、MP3、M4A 文档，异步返回转写、匿名说话人编号及带原文证据的关键词。服务端默认关闭，模型与预算由服务端配置。目标覆盖最长两小时录音；当前仅配置同步转写路径，超过服务端同步时长预算的录音因私有存储未就绪而失败，不会截短或将分段识别冒充全程说话人一致性。","operationId":"analyzeAudio","requestBody":{"content":{"application/json":{"schema":{"properties":{"doc_id":{"type":"integer","minimum":1.0},"client_request_id":{"type":"string","maxLength":128,"minLength":1,"pattern":"^[A-Za-z0-9._:-]+$","description":"调用方生成的幂等请求标识；相同调用方重试时保持不变。"},"vocabulary":{"items":{"properties":{"text":{"type":"string","minLength":1},"weight":{"type":"integer","maximum":5.0,"minimum":1.0}},"additionalProperties":false,"type":"object","required":["text","weight"]},"type":"array","maxItems":2000,"description":"可选领域词表，仅用于ASR识别偏好，不替换转写文本。词语不得重复；含非ASCII字符总长不超过15，纯ASCII按空格分段不超过7段；普通权重1至5，由调用方提供。需服务端所配置模型支持即时热词。省略或空数组保持旧行为。"}},"additionalProperties":false,"type":"object","required":["doc_id","client_request_id"]}}},"required":true},"responses":{"202":{"description":"任务已受理；请使用 job_id 查询进度和结果","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"required":["job_id","operation","status","phase","progress","progress_detail","sequence","attempt","poll_after_ms","result_ref","error","created_at","updated_at","finished_at"],"properties":{"job_id":{"type":"string","minLength":32,"maxLength":32,"pattern":"^[a-f0-9]{32}$","description":"异步任务唯一 ID；刷新页面或跨请求查询时保持不变。"},"operation":{"type":"string","description":"任务类型；当前主要为 upload、parse 或 extract。"},"status":{"type":"string","description":"queued=排队中，running=处理中，succeeded=已完成，failed/cancelled/unknown=终态异常。","enum":["queued","running","succeeded","failed","cancelled","unknown"]},"phase":{"type":["string","null"],"description":"当前处理阶段；服务未提供细分阶段时为 null。"},"progress":{"type":["integer","null"],"minimum":0,"maximum":100,"description":"0 到 100 的处理进度；无法计算时为 null。"},"progress_detail":{"oneOf":[{"type":"object","additionalProperties":false,"required":["unit","current","total"],"properties":{"unit":{"type":"string","enum":["bytes","documents","items","pages"]},"current":{"type":"integer","minimum":0},"total":{"type":"integer","minimum":1}}},{"type":"null"}],"description":"可核验的真实进度分子、分母；无法度量时为 null。"},"sequence":{"type":"integer","minimum":0,"description":"状态事件单调序号；客户端用它丢弃乱序轮询结果。"},"attempt":{"type":"integer","minimum":0,"description":"worker 执行尝试次数；上传直接执行时固定为 1。"},"poll_after_ms":{"type":"integer","minimum":100,"description":"服务端建议的下次轮询间隔。"},"result_ref":{"type":["string","null"],"description":"任务成功后的结果引用，通常为 /open/v1/job/{job_id}/result。"},"owner_ref":{"type":"string","maxLength":128,"description":"上传任务创建时固化的业务归属；非上传任务通常不返回。"},"error":{"oneOf":[{"type":"object","additionalProperties":false,"required":["code","message","retryable"],"properties":{"code":{"type":"string","enum":["conversion_failed","embedding_access_denied","embedding_output_invalid","embedding_unavailable","feature_disabled","forbidden","index_config_conflict","index_incomplete","input_invalid","input_too_large","internal_error","method_not_allowed","model_access_denied","model_output_invalid","model_unavailable","not_acceptable","not_found","payload_too_large","precondition_failed","precondition_required","processor_budget","processor_failed","processor_invalid_response","processor_rejected","processor_timeout","processor_unauthorized","processor_unavailable","queue_capacity_exceeded","rate_limited","resource_conflict","resource_not_found","semantic_unavailable","service_unavailable","source_ambiguous","source_changed","source_invalid","source_unavailable","source_writeback_unavailable","unauthorized","unsupported_media_type","upstream_rejected","upstream_timeout","upstream_unavailable"]},"message":{"type":"string","minLength":1},"retryable":{"type":"boolean"}}},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"finished_at":{"type":["string","null"],"format":"date-time"},"document_parse_diagnostics_v1":{"type":"object","additionalProperties":false,"required":["schema_version","requested_provider","requested_mode","result_source","pipeline_stage","worker_attempt_count","fallback_occurred","isolation_used","attempts","attempts_truncated","warnings"],"properties":{"schema_version":{"const":"document_parse_diagnostics_v1"},"requested_provider":{"type":"string","enum":["auto","docparse","tencent","local","mineru"],"default":"auto","description":"解析 Provider 策略。auto 按服务端启用列表和顺序执行；MinerU 默认禁用；指定 Provider 时严格执行该 Provider，不静默切换。"},"requested_mode":{"type":"string","enum":["standard","high_accuracy","structure_preserving"]},"result_source":{"type":"string","enum":["fresh","reused"]},"pipeline_stage":{"type":"string","enum":["completed","failed"]},"worker_attempt_count":{"type":"integer","minimum":1},"fallback_occurred":{"type":"boolean"},"isolation_used":{"type":"boolean"},"attempts":{"type":"array","maxItems":32,"items":{"type":"object","additionalProperties":false,"required":["provider","status","scope"],"properties":{"provider":{"type":"string","enum":["docparse","tencent","local","mineru","unknown"]},"status":{"type":"string","enum":["succeeded","failed","unknown"]},"scope":{"type":"string","enum":["group","page","isolation","unknown"]},"page_count":{"type":"integer","minimum":0},"duration_ms":{"type":"integer","minimum":0},"safe_error_code":{"type":"string","maxLength":64},"retryable":{"type":"boolean"},"fallback_allowed":{"type":"boolean"}}}},"attempts_truncated":{"type":"boolean"},"page_summary":{"type":"object","additionalProperties":false,"required":["total","ready","degraded","by_provider"],"properties":{"total":{"type":"integer","minimum":0},"ready":{"type":"integer","minimum":0},"degraded":{"type":"integer","minimum":0},"by_provider":{"type":"object","additionalProperties":false,"required":[],"properties":{"docparse":{"type":"integer","minimum":0},"tencent":{"type":"integer","minimum":0},"local":{"type":"integer","minimum":0}}}}},"warnings":{"type":"object","additionalProperties":false,"required":["count","codes"],"properties":{"count":{"type":"integer","minimum":0},"codes":{"type":"array","maxItems":32,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":64}}}},"source_format":{"type":"string","minLength":1,"maxLength":32},"canonicalized":{"type":"boolean"},"content_version":{"type":"string","minLength":1,"maxLength":128},"failure_stage":{"type":"string","enum":["precondition","source_read","convert","split","provider_parse","persist","unknown"]}}}}},"error":{"type":"null"}}}]}}},"headers":{"Location":{"description":"任务状态查询地址","schema":{"type":"string","example":"/open/v1/job/0123456789abcdef0123456789abcdef"}}},"links":{"查询任务进度":{"operationId":"getJob","parameters":{"job_id":"$response.body#/data/job_id"},"description":"使用本次返回的 job_id 查询任务进度。"},"读取任务结果":{"operationId":"getJobResult","parameters":{"job_id":"$response.body#/data/job_id"},"description":"任务 succeeded 后读取结构化结果。"}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"409":{"description":"幂等键、任务状态或资源状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"413":{"description":"请求体过大","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"415":{"description":"请求媒体类型不支持","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"429":{"description":"队列或模型并发额度已满，请稍后重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"500":{"description":"服务内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"502":{"description":"上游服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"504":{"description":"上游服务超时","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"document.read","x-stability":"preview"}},"/open/v1/images:remove-watermark":{"post":{"tags":["4. 文档异步任务"],"summary":"去除图片水印并提供待复核产物","description":"仅处理已上传 JPG/PNG 及其中的表格图像。保留原件，候选图与实际变更掩膜整批保存。未检测到水印返回 no_watermark；生成式产物或无法安全处理的图片返回 needs_review，产物可能为空，不代表原文已可靠恢复，不自动作为审核输入。服务端默认关闭，模型、OCR、下载主机和预算不接收客户端覆盖。","operationId":"removeImageWatermark","requestBody":{"content":{"application/json":{"schema":{"properties":{"doc_id":{"type":"integer","minimum":1.0},"client_request_id":{"type":"string","maxLength":128,"minLength":1,"pattern":"^[A-Za-z0-9._:-]+$","description":"调用方生成的幂等请求标识；相同调用方重试时保持不变。"},"mask_doc_id":{"type":"integer","minimum":1.0,"description":"可选限制掩膜文档。须为同Space、与原文件像素尺寸相同且无EXIF旋转的二值灰度PNG；白色仅允许处理服务端确认的水印区域，黑色保持原图。不能扩大服务端允许区域。"},"owner_ref":{"type":"string","maxLength":128}},"additionalProperties":false,"type":"object","required":["doc_id","client_request_id"]}}},"required":true},"responses":{"202":{"description":"任务已受理；请使用 job_id 查询进度和结果","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"required":["job_id","operation","status","phase","progress","progress_detail","sequence","attempt","poll_after_ms","result_ref","error","created_at","updated_at","finished_at"],"properties":{"job_id":{"type":"string","minLength":32,"maxLength":32,"pattern":"^[a-f0-9]{32}$","description":"异步任务唯一 ID；刷新页面或跨请求查询时保持不变。"},"operation":{"type":"string","description":"任务类型；当前主要为 upload、parse 或 extract。"},"status":{"type":"string","description":"queued=排队中，running=处理中，succeeded=已完成，failed/cancelled/unknown=终态异常。","enum":["queued","running","succeeded","failed","cancelled","unknown"]},"phase":{"type":["string","null"],"description":"当前处理阶段；服务未提供细分阶段时为 null。"},"progress":{"type":["integer","null"],"minimum":0,"maximum":100,"description":"0 到 100 的处理进度；无法计算时为 null。"},"progress_detail":{"oneOf":[{"type":"object","additionalProperties":false,"required":["unit","current","total"],"properties":{"unit":{"type":"string","enum":["bytes","documents","items","pages"]},"current":{"type":"integer","minimum":0},"total":{"type":"integer","minimum":1}}},{"type":"null"}],"description":"可核验的真实进度分子、分母；无法度量时为 null。"},"sequence":{"type":"integer","minimum":0,"description":"状态事件单调序号；客户端用它丢弃乱序轮询结果。"},"attempt":{"type":"integer","minimum":0,"description":"worker 执行尝试次数；上传直接执行时固定为 1。"},"poll_after_ms":{"type":"integer","minimum":100,"description":"服务端建议的下次轮询间隔。"},"result_ref":{"type":["string","null"],"description":"任务成功后的结果引用，通常为 /open/v1/job/{job_id}/result。"},"owner_ref":{"type":"string","maxLength":128,"description":"上传任务创建时固化的业务归属；非上传任务通常不返回。"},"error":{"oneOf":[{"type":"object","additionalProperties":false,"required":["code","message","retryable"],"properties":{"code":{"type":"string","enum":["conversion_failed","embedding_access_denied","embedding_output_invalid","embedding_unavailable","feature_disabled","forbidden","index_config_conflict","index_incomplete","input_invalid","input_too_large","internal_error","method_not_allowed","model_access_denied","model_output_invalid","model_unavailable","not_acceptable","not_found","payload_too_large","precondition_failed","precondition_required","processor_budget","processor_failed","processor_invalid_response","processor_rejected","processor_timeout","processor_unauthorized","processor_unavailable","queue_capacity_exceeded","rate_limited","resource_conflict","resource_not_found","semantic_unavailable","service_unavailable","source_ambiguous","source_changed","source_invalid","source_unavailable","source_writeback_unavailable","unauthorized","unsupported_media_type","upstream_rejected","upstream_timeout","upstream_unavailable"]},"message":{"type":"string","minLength":1},"retryable":{"type":"boolean"}}},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"finished_at":{"type":["string","null"],"format":"date-time"},"document_parse_diagnostics_v1":{"type":"object","additionalProperties":false,"required":["schema_version","requested_provider","requested_mode","result_source","pipeline_stage","worker_attempt_count","fallback_occurred","isolation_used","attempts","attempts_truncated","warnings"],"properties":{"schema_version":{"const":"document_parse_diagnostics_v1"},"requested_provider":{"type":"string","enum":["auto","docparse","tencent","local","mineru"],"default":"auto","description":"解析 Provider 策略。auto 按服务端启用列表和顺序执行；MinerU 默认禁用；指定 Provider 时严格执行该 Provider，不静默切换。"},"requested_mode":{"type":"string","enum":["standard","high_accuracy","structure_preserving"]},"result_source":{"type":"string","enum":["fresh","reused"]},"pipeline_stage":{"type":"string","enum":["completed","failed"]},"worker_attempt_count":{"type":"integer","minimum":1},"fallback_occurred":{"type":"boolean"},"isolation_used":{"type":"boolean"},"attempts":{"type":"array","maxItems":32,"items":{"type":"object","additionalProperties":false,"required":["provider","status","scope"],"properties":{"provider":{"type":"string","enum":["docparse","tencent","local","mineru","unknown"]},"status":{"type":"string","enum":["succeeded","failed","unknown"]},"scope":{"type":"string","enum":["group","page","isolation","unknown"]},"page_count":{"type":"integer","minimum":0},"duration_ms":{"type":"integer","minimum":0},"safe_error_code":{"type":"string","maxLength":64},"retryable":{"type":"boolean"},"fallback_allowed":{"type":"boolean"}}}},"attempts_truncated":{"type":"boolean"},"page_summary":{"type":"object","additionalProperties":false,"required":["total","ready","degraded","by_provider"],"properties":{"total":{"type":"integer","minimum":0},"ready":{"type":"integer","minimum":0},"degraded":{"type":"integer","minimum":0},"by_provider":{"type":"object","additionalProperties":false,"required":[],"properties":{"docparse":{"type":"integer","minimum":0},"tencent":{"type":"integer","minimum":0},"local":{"type":"integer","minimum":0}}}}},"warnings":{"type":"object","additionalProperties":false,"required":["count","codes"],"properties":{"count":{"type":"integer","minimum":0},"codes":{"type":"array","maxItems":32,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":64}}}},"source_format":{"type":"string","minLength":1,"maxLength":32},"canonicalized":{"type":"boolean"},"content_version":{"type":"string","minLength":1,"maxLength":128},"failure_stage":{"type":"string","enum":["precondition","source_read","convert","split","provider_parse","persist","unknown"]}}}}},"error":{"type":"null"}}}]}}},"headers":{"Location":{"description":"任务状态查询地址","schema":{"type":"string","example":"/open/v1/job/0123456789abcdef0123456789abcdef"}}},"links":{"查询任务进度":{"operationId":"getJob","parameters":{"job_id":"$response.body#/data/job_id"},"description":"使用本次返回的 job_id 查询任务进度。"},"读取任务结果":{"operationId":"getJobResult","parameters":{"job_id":"$response.body#/data/job_id"},"description":"任务 succeeded 后读取结构化结果。"}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"409":{"description":"幂等键、任务状态或资源状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"413":{"description":"请求体过大","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"415":{"description":"请求媒体类型不支持","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"429":{"description":"队列或模型并发额度已满，请稍后重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"500":{"description":"服务内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"502":{"description":"上游服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"504":{"description":"上游服务超时","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"document.write","x-stability":"preview"}},"/open/v1/images:segment-documents":{"post":{"tags":["4. 文档异步任务"],"summary":"识别并裁切图片中的多个证件、证照或票据","description":"仅接收已上传的 JPG/PNG。先规整 EXIF 方向，再识别材料外边缘，使用原分辨率裁切；返回原图像素边界坐标、方向规整矩阵及原图到产物的变换矩阵。重叠、遮挡、边界不清的实例返回 needs_review，不补全缺失内容；没有目标返回 no_targets。可裁切实例以一个事务发布新文档，原件不覆盖。顺序按几何位置稳定排列，不推断正反面配对或业务顺序。新能力默认关闭，需服务端配置视觉模型并开启。","operationId":"segmentImageDocuments","requestBody":{"content":{"application/json":{"schema":{"properties":{"doc_id":{"type":"integer","minimum":1.0},"rectify":{"type":"boolean","description":"是否按四边形透视纠偏；缺省按外接矩形裁切，保留原始分辨率。","default":false},"file_name_prefix":{"type":"string","maxLength":80,"minLength":1},"client_request_id":{"type":"string","maxLength":128,"minLength":1,"pattern":"^[A-Za-z0-9._:-]+$","description":"调用方生成的幂等请求标识；相同调用方重试时保持不变。"},"owner_ref":{"type":"string","maxLength":128}},"additionalProperties":false,"type":"object","required":["doc_id","client_request_id"]}}},"required":true},"responses":{"202":{"description":"任务已受理；请使用 job_id 查询进度和结果","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"required":["job_id","operation","status","phase","progress","progress_detail","sequence","attempt","poll_after_ms","result_ref","error","created_at","updated_at","finished_at"],"properties":{"job_id":{"type":"string","minLength":32,"maxLength":32,"pattern":"^[a-f0-9]{32}$","description":"异步任务唯一 ID；刷新页面或跨请求查询时保持不变。"},"operation":{"type":"string","description":"任务类型；当前主要为 upload、parse 或 extract。"},"status":{"type":"string","description":"queued=排队中，running=处理中，succeeded=已完成，failed/cancelled/unknown=终态异常。","enum":["queued","running","succeeded","failed","cancelled","unknown"]},"phase":{"type":["string","null"],"description":"当前处理阶段；服务未提供细分阶段时为 null。"},"progress":{"type":["integer","null"],"minimum":0,"maximum":100,"description":"0 到 100 的处理进度；无法计算时为 null。"},"progress_detail":{"oneOf":[{"type":"object","additionalProperties":false,"required":["unit","current","total"],"properties":{"unit":{"type":"string","enum":["bytes","documents","items","pages"]},"current":{"type":"integer","minimum":0},"total":{"type":"integer","minimum":1}}},{"type":"null"}],"description":"可核验的真实进度分子、分母；无法度量时为 null。"},"sequence":{"type":"integer","minimum":0,"description":"状态事件单调序号；客户端用它丢弃乱序轮询结果。"},"attempt":{"type":"integer","minimum":0,"description":"worker 执行尝试次数；上传直接执行时固定为 1。"},"poll_after_ms":{"type":"integer","minimum":100,"description":"服务端建议的下次轮询间隔。"},"result_ref":{"type":["string","null"],"description":"任务成功后的结果引用，通常为 /open/v1/job/{job_id}/result。"},"owner_ref":{"type":"string","maxLength":128,"description":"上传任务创建时固化的业务归属；非上传任务通常不返回。"},"error":{"oneOf":[{"type":"object","additionalProperties":false,"required":["code","message","retryable"],"properties":{"code":{"type":"string","enum":["conversion_failed","embedding_access_denied","embedding_output_invalid","embedding_unavailable","feature_disabled","forbidden","index_config_conflict","index_incomplete","input_invalid","input_too_large","internal_error","method_not_allowed","model_access_denied","model_output_invalid","model_unavailable","not_acceptable","not_found","payload_too_large","precondition_failed","precondition_required","processor_budget","processor_failed","processor_invalid_response","processor_rejected","processor_timeout","processor_unauthorized","processor_unavailable","queue_capacity_exceeded","rate_limited","resource_conflict","resource_not_found","semantic_unavailable","service_unavailable","source_ambiguous","source_changed","source_invalid","source_unavailable","source_writeback_unavailable","unauthorized","unsupported_media_type","upstream_rejected","upstream_timeout","upstream_unavailable"]},"message":{"type":"string","minLength":1},"retryable":{"type":"boolean"}}},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"finished_at":{"type":["string","null"],"format":"date-time"},"document_parse_diagnostics_v1":{"type":"object","additionalProperties":false,"required":["schema_version","requested_provider","requested_mode","result_source","pipeline_stage","worker_attempt_count","fallback_occurred","isolation_used","attempts","attempts_truncated","warnings"],"properties":{"schema_version":{"const":"document_parse_diagnostics_v1"},"requested_provider":{"type":"string","enum":["auto","docparse","tencent","local","mineru"],"default":"auto","description":"解析 Provider 策略。auto 按服务端启用列表和顺序执行；MinerU 默认禁用；指定 Provider 时严格执行该 Provider，不静默切换。"},"requested_mode":{"type":"string","enum":["standard","high_accuracy","structure_preserving"]},"result_source":{"type":"string","enum":["fresh","reused"]},"pipeline_stage":{"type":"string","enum":["completed","failed"]},"worker_attempt_count":{"type":"integer","minimum":1},"fallback_occurred":{"type":"boolean"},"isolation_used":{"type":"boolean"},"attempts":{"type":"array","maxItems":32,"items":{"type":"object","additionalProperties":false,"required":["provider","status","scope"],"properties":{"provider":{"type":"string","enum":["docparse","tencent","local","mineru","unknown"]},"status":{"type":"string","enum":["succeeded","failed","unknown"]},"scope":{"type":"string","enum":["group","page","isolation","unknown"]},"page_count":{"type":"integer","minimum":0},"duration_ms":{"type":"integer","minimum":0},"safe_error_code":{"type":"string","maxLength":64},"retryable":{"type":"boolean"},"fallback_allowed":{"type":"boolean"}}}},"attempts_truncated":{"type":"boolean"},"page_summary":{"type":"object","additionalProperties":false,"required":["total","ready","degraded","by_provider"],"properties":{"total":{"type":"integer","minimum":0},"ready":{"type":"integer","minimum":0},"degraded":{"type":"integer","minimum":0},"by_provider":{"type":"object","additionalProperties":false,"required":[],"properties":{"docparse":{"type":"integer","minimum":0},"tencent":{"type":"integer","minimum":0},"local":{"type":"integer","minimum":0}}}}},"warnings":{"type":"object","additionalProperties":false,"required":["count","codes"],"properties":{"count":{"type":"integer","minimum":0},"codes":{"type":"array","maxItems":32,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":64}}}},"source_format":{"type":"string","minLength":1,"maxLength":32},"canonicalized":{"type":"boolean"},"content_version":{"type":"string","minLength":1,"maxLength":128},"failure_stage":{"type":"string","enum":["precondition","source_read","convert","split","provider_parse","persist","unknown"]}}}}},"error":{"type":"null"}}}]}}},"headers":{"Location":{"description":"任务状态查询地址","schema":{"type":"string","example":"/open/v1/job/0123456789abcdef0123456789abcdef"}}},"links":{"查询任务进度":{"operationId":"getJob","parameters":{"job_id":"$response.body#/data/job_id"},"description":"使用本次返回的 job_id 查询任务进度。"},"读取任务结果":{"operationId":"getJobResult","parameters":{"job_id":"$response.body#/data/job_id"},"description":"任务 succeeded 后读取结构化结果。"}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"409":{"description":"幂等键、任务状态或资源状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"413":{"description":"请求体过大","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"415":{"description":"请求媒体类型不支持","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"429":{"description":"队列或模型并发额度已满，请稍后重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"500":{"description":"服务内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"502":{"description":"上游服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"504":{"description":"上游服务超时","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"document.write","x-stability":"preview"}},"/open/v1/document":{"post":{"tags":["2. 文档准备"],"summary":"上传文件并返回可跨后续请求复用的全局 doc_id","description":"选择本地文件上传。成功后保存响应中的 `data.doc_id`，分类、抽取、分析、比对和审核接口都通过该 ID 复用文件。同一 Document Space 重复上传相同内容时返回原 `doc_id`，并将 `data.reused` 设为 true。 可用JSON source_url登记服务端授权的私有MinIO原件，原件不永久复制；与multipart文件输入互斥。来源关闭时仍支持原文件上传。支持UTF-8 TXT本地解析。","operationId":"uploadDocument","requestBody":{"content":{"multipart/form-data":{"schema":{"properties":{"file":{"type":"string","format":"binary"},"defer_parsing":{"type":"boolean"}},"additionalProperties":false,"type":"object","required":["file"]}},"application/json":{"schema":{"properties":{"source_url":{"type":"string","maxLength":8192,"minLength":1,"description":"私有MinIO对象地址，只允许当前Space服务端绑定的endpoint、桶和前缀；禁止凭据、query及fragment。"},"file_name":{"type":"string","maxLength":255,"minLength":1},"client_request_id":{"type":"string","maxLength":128,"minLength":1,"pattern":"^[A-Za-z0-9._:-]+$","description":"调用方生成的幂等请求标识；相同调用方重试时保持不变。"},"owner_ref":{"type":"string","maxLength":128},"busi_id":{"type":"string","maxLength":128},"defer_parsing":{"type":"boolean"},"parse_provider":{"type":"string","maxLength":64}},"additionalProperties":false,"type":"object","required":["source_url"]}}},"required":true},"responses":{"201":{"description":"文件上传成功；请保存响应中的 doc_id","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"properties":{"success":{"const":true},"data":{"properties":{"doc_id":{"type":"integer","minimum":1.0},"status":{"const":"uploaded"},"reused":{"type":"boolean"}},"additionalProperties":false,"type":"object","required":["doc_id","status","reused"]},"error":{"type":"null"}},"type":"object"}]}}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"409":{"description":"幂等键、任务状态或资源状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"413":{"description":"请求体过大","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"415":{"description":"请求媒体类型不支持","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"500":{"description":"服务内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"502":{"description":"上游服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"504":{"description":"上游服务超时","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"addDocument","x-stability":"stable"}},"/open/v1/document-parsing":{"post":{"tags":["2. 文档准备"],"summary":"解析已上传文档或一次性直传文件，已有结果同步返回、新解析返回 job","description":"推荐先调用上传接口取得 `doc_id`，再使用 JSON 请求解析。已有解析结果时同步返回 HTTP 200；需要新解析时返回 HTTP 202。\n\n该接口采用异步处理。成功提交返回 HTTP 202，响应体 `data.job_id` 和响应头 `Location` 指向任务。随后通过 `getJob` 查询进度；状态为 `succeeded` 后，通过 `getJobResult` 获取最终结果。 支持source_url登记并解析服务端授权的私有MinIO原件，与doc_id及file互斥。","operationId":"parseDocument","requestBody":{"content":{"application/json":{"schema":{"oneOf":[{"required":["doc_id"]},{"required":["file"]},{"required":["source_url"]}],"properties":{"doc_id":{"type":"integer","minimum":1.0},"file":{"type":"string","format":"binary"},"client_request_id":{"type":"string","maxLength":128,"minLength":1,"pattern":"^[A-Za-z0-9._:-]+$","description":"调用方生成的幂等请求标识；相同调用方重试时保持不变。"},"parse_provider":{"type":"string","enum":["auto","docparse","tencent","local","mineru"],"description":"解析 Provider 策略。auto 按服务端启用列表和顺序执行；MinerU 默认禁用；指定 Provider 时严格执行该 Provider，不静默切换。","default":"auto"},"include_diagnostics":{"type":"boolean","description":"为 true 时在同步解析结果或异步 Job 状态中返回有界的解析诊断；默认关闭，不触发额外解析、存储读取或外部调用。","default":false},"source_url":{"type":"string","maxLength":8192,"minLength":1,"description":"私有MinIO对象地址，只允许当前Space服务端绑定的endpoint、桶和前缀；禁止凭据、query及fragment。"},"file_name":{"type":"string","maxLength":255,"minLength":1}},"additionalProperties":false,"type":"object","required":["client_request_id"]},"example":{"doc_id":1001,"client_request_id":"swagger-parse-001"}},"multipart/form-data":{"schema":{"oneOf":[{"required":["doc_id"]},{"required":["file"]}],"properties":{"doc_id":{"type":"integer","minimum":1.0},"file":{"type":"string","format":"binary"},"client_request_id":{"type":"string","maxLength":128,"minLength":1,"pattern":"^[A-Za-z0-9._:-]+$","description":"调用方生成的幂等请求标识；相同调用方重试时保持不变。"},"parse_provider":{"type":"string","enum":["auto","docparse","tencent","local","mineru"],"description":"解析 Provider 策略。auto 按服务端启用列表和顺序执行；MinerU 默认禁用；指定 Provider 时严格执行该 Provider，不静默切换。","default":"auto"},"include_diagnostics":{"type":"boolean","description":"为 true 时在同步解析结果或异步 Job 状态中返回有界的解析诊断；默认关闭，不触发额外解析、存储读取或外部调用。","default":false}},"additionalProperties":false,"type":"object","required":["client_request_id"]}}},"required":true},"responses":{"200":{"description":"请求已成功处理","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"properties":{"success":{"const":true},"data":{"properties":{"doc_id":{"type":"integer","minimum":1.0},"status":{"const":"ready"},"text":{"type":"string"},"page_count":{"type":"integer","minimum":0.0},"document_parse_diagnostics_v1":{"properties":{"schema_version":{"const":"document_parse_diagnostics_v1"},"requested_provider":{"type":"string","enum":["auto","docparse","tencent","local","mineru"],"description":"解析 Provider 策略。auto 按服务端启用列表和顺序执行；MinerU 默认禁用；指定 Provider 时严格执行该 Provider，不静默切换。","default":"auto"},"requested_mode":{"type":"string","enum":["standard","high_accuracy","structure_preserving"]},"result_source":{"type":"string","enum":["fresh","reused"]},"pipeline_stage":{"type":"string","enum":["completed","failed"]},"worker_attempt_count":{"type":"integer","minimum":1.0},"fallback_occurred":{"type":"boolean"},"isolation_used":{"type":"boolean"},"attempts":{"items":{"properties":{"provider":{"type":"string","enum":["docparse","tencent","local","mineru","unknown"]},"status":{"type":"string","enum":["succeeded","failed","unknown"]},"scope":{"type":"string","enum":["group","page","isolation","unknown"]},"page_count":{"type":"integer","minimum":0.0},"duration_ms":{"type":"integer","minimum":0.0},"safe_error_code":{"type":"string","maxLength":64},"retryable":{"type":"boolean"},"fallback_allowed":{"type":"boolean"}},"additionalProperties":false,"type":"object","required":["provider","status","scope"]},"type":"array","maxItems":32},"attempts_truncated":{"type":"boolean"},"page_summary":{"properties":{"total":{"type":"integer","minimum":0.0},"ready":{"type":"integer","minimum":0.0},"degraded":{"type":"integer","minimum":0.0},"by_provider":{"properties":{"docparse":{"type":"integer","minimum":0.0},"tencent":{"type":"integer","minimum":0.0},"local":{"type":"integer","minimum":0.0}},"additionalProperties":false,"type":"object","required":[]}},"additionalProperties":false,"type":"object","required":["total","ready","degraded","by_provider"]},"warnings":{"properties":{"count":{"type":"integer","minimum":0.0},"codes":{"items":{"type":"string","maxLength":64,"minLength":1},"type":"array","maxItems":32,"uniqueItems":true}},"additionalProperties":false,"type":"object","required":["count","codes"]},"source_format":{"type":"string","maxLength":32,"minLength":1},"canonicalized":{"type":"boolean"},"content_version":{"type":"string","maxLength":128,"minLength":1},"failure_stage":{"type":"string","enum":["precondition","source_read","convert","split","provider_parse","persist","unknown"]}},"additionalProperties":false,"type":"object","required":["schema_version","requested_provider","requested_mode","result_source","pipeline_stage","worker_attempt_count","fallback_occurred","isolation_used","attempts","attempts_truncated","warnings"]}},"additionalProperties":false,"type":"object","required":["doc_id","status","text","page_count"]},"error":{"type":"null"}},"type":"object"}]}}}},"202":{"description":"任务已受理；请使用 job_id 查询进度和结果","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"required":["job_id","operation","status","phase","progress","progress_detail","sequence","attempt","poll_after_ms","result_ref","error","created_at","updated_at","finished_at"],"properties":{"job_id":{"type":"string","minLength":32,"maxLength":32,"pattern":"^[a-f0-9]{32}$","description":"异步任务唯一 ID；刷新页面或跨请求查询时保持不变。"},"operation":{"type":"string","description":"任务类型；当前主要为 upload、parse 或 extract。"},"status":{"type":"string","description":"queued=排队中，running=处理中，succeeded=已完成，failed/cancelled/unknown=终态异常。","enum":["queued","running","succeeded","failed","cancelled","unknown"]},"phase":{"type":["string","null"],"description":"当前处理阶段；服务未提供细分阶段时为 null。"},"progress":{"type":["integer","null"],"minimum":0,"maximum":100,"description":"0 到 100 的处理进度；无法计算时为 null。"},"progress_detail":{"oneOf":[{"type":"object","additionalProperties":false,"required":["unit","current","total"],"properties":{"unit":{"type":"string","enum":["bytes","documents","items","pages"]},"current":{"type":"integer","minimum":0},"total":{"type":"integer","minimum":1}}},{"type":"null"}],"description":"可核验的真实进度分子、分母；无法度量时为 null。"},"sequence":{"type":"integer","minimum":0,"description":"状态事件单调序号；客户端用它丢弃乱序轮询结果。"},"attempt":{"type":"integer","minimum":0,"description":"worker 执行尝试次数；上传直接执行时固定为 1。"},"poll_after_ms":{"type":"integer","minimum":100,"description":"服务端建议的下次轮询间隔。"},"result_ref":{"type":["string","null"],"description":"任务成功后的结果引用，通常为 /open/v1/job/{job_id}/result。"},"owner_ref":{"type":"string","maxLength":128,"description":"上传任务创建时固化的业务归属；非上传任务通常不返回。"},"error":{"oneOf":[{"type":"object","additionalProperties":false,"required":["code","message","retryable"],"properties":{"code":{"type":"string","enum":["conversion_failed","embedding_access_denied","embedding_output_invalid","embedding_unavailable","feature_disabled","forbidden","index_config_conflict","index_incomplete","input_invalid","input_too_large","internal_error","method_not_allowed","model_access_denied","model_output_invalid","model_unavailable","not_acceptable","not_found","payload_too_large","precondition_failed","precondition_required","processor_budget","processor_failed","processor_invalid_response","processor_rejected","processor_timeout","processor_unauthorized","processor_unavailable","queue_capacity_exceeded","rate_limited","resource_conflict","resource_not_found","semantic_unavailable","service_unavailable","source_ambiguous","source_changed","source_invalid","source_unavailable","source_writeback_unavailable","unauthorized","unsupported_media_type","upstream_rejected","upstream_timeout","upstream_unavailable"]},"message":{"type":"string","minLength":1},"retryable":{"type":"boolean"}}},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"finished_at":{"type":["string","null"],"format":"date-time"},"document_parse_diagnostics_v1":{"type":"object","additionalProperties":false,"required":["schema_version","requested_provider","requested_mode","result_source","pipeline_stage","worker_attempt_count","fallback_occurred","isolation_used","attempts","attempts_truncated","warnings"],"properties":{"schema_version":{"const":"document_parse_diagnostics_v1"},"requested_provider":{"type":"string","enum":["auto","docparse","tencent","local","mineru"],"default":"auto","description":"解析 Provider 策略。auto 按服务端启用列表和顺序执行；MinerU 默认禁用；指定 Provider 时严格执行该 Provider，不静默切换。"},"requested_mode":{"type":"string","enum":["standard","high_accuracy","structure_preserving"]},"result_source":{"type":"string","enum":["fresh","reused"]},"pipeline_stage":{"type":"string","enum":["completed","failed"]},"worker_attempt_count":{"type":"integer","minimum":1},"fallback_occurred":{"type":"boolean"},"isolation_used":{"type":"boolean"},"attempts":{"type":"array","maxItems":32,"items":{"type":"object","additionalProperties":false,"required":["provider","status","scope"],"properties":{"provider":{"type":"string","enum":["docparse","tencent","local","mineru","unknown"]},"status":{"type":"string","enum":["succeeded","failed","unknown"]},"scope":{"type":"string","enum":["group","page","isolation","unknown"]},"page_count":{"type":"integer","minimum":0},"duration_ms":{"type":"integer","minimum":0},"safe_error_code":{"type":"string","maxLength":64},"retryable":{"type":"boolean"},"fallback_allowed":{"type":"boolean"}}}},"attempts_truncated":{"type":"boolean"},"page_summary":{"type":"object","additionalProperties":false,"required":["total","ready","degraded","by_provider"],"properties":{"total":{"type":"integer","minimum":0},"ready":{"type":"integer","minimum":0},"degraded":{"type":"integer","minimum":0},"by_provider":{"type":"object","additionalProperties":false,"required":[],"properties":{"docparse":{"type":"integer","minimum":0},"tencent":{"type":"integer","minimum":0},"local":{"type":"integer","minimum":0}}}}},"warnings":{"type":"object","additionalProperties":false,"required":["count","codes"],"properties":{"count":{"type":"integer","minimum":0},"codes":{"type":"array","maxItems":32,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":64}}}},"source_format":{"type":"string","minLength":1,"maxLength":32},"canonicalized":{"type":"boolean"},"content_version":{"type":"string","minLength":1,"maxLength":128},"failure_stage":{"type":"string","enum":["precondition","source_read","convert","split","provider_parse","persist","unknown"]}}}}},"error":{"type":"null"}}}]}}},"headers":{"Location":{"description":"任务状态查询地址","schema":{"type":"string","example":"/open/v1/job/0123456789abcdef0123456789abcdef"}}},"links":{"查询任务进度":{"operationId":"getJob","parameters":{"job_id":"$response.body#/data/job_id"},"description":"使用本次返回的 job_id 查询任务进度。"},"读取任务结果":{"operationId":"getJobResult","parameters":{"job_id":"$response.body#/data/job_id"},"description":"任务 succeeded 后读取结构化结果。"}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"409":{"description":"幂等键、任务状态或资源状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"413":{"description":"请求体过大","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"415":{"description":"请求媒体类型不支持","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"429":{"description":"队列或模型并发额度已满，请稍后重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"500":{"description":"服务内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"502":{"description":"上游服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"504":{"description":"上游服务超时","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"viewExtractDocument","x-stability":"stable"}},"/open/v1/document-parsing:parse-bytes":{"post":{"tags":["2. 文档准备"],"summary":"同步解析原始字节并返回 legacy Document JSON","description":"一次性同步解析：PDF 原样提交，图片由服务端包装为单页 PDF。内部封装 docparse 任务的提交/轮询/取结果，直接返回 legacy Document JSON（与文档解析页结果同构）。不持久化文档、不产生 job。供制度审核等按原始字节逐页解析的内部链路使用。请求链路（含上游代理）必须允许至少 9 MiB JSON 请求体。 可用source_url替代content_base64；URL输入同样遵守解码后文件上限，不持久保存原件。","operationId":"parseDocumentBytes","requestBody":{"content":{"application/json":{"schema":{"oneOf":[{"properties":{"file_name":{"type":"string","maxLength":512,"minLength":1,"description":"原始文件名（仅取扩展名判断类型）。"},"content_base64":{"type":"string","maxLength":8388608,"description":"PDF 或单张图片的严格标准 Base64；解码后最多 6 MiB。"},"parse_provider":{"type":"string","enum":["auto","docparse","tencent","local","mineru"],"description":"解析 Provider 策略。auto 按服务端启用列表和顺序执行；MinerU 默认禁用；指定 Provider 时严格执行该 Provider，不静默切换。","default":"auto"}},"additionalProperties":false,"type":"object","required":["file_name","content_base64"]},{"properties":{"source_url":{"type":"string","maxLength":8192,"minLength":1,"description":"私有MinIO对象地址，只允许当前Space服务端绑定的endpoint、桶和前缀；禁止凭据、query及fragment。"},"file_name":{"type":"string","maxLength":255,"minLength":1},"parse_provider":{"type":"string","enum":["auto","docparse","tencent","local","mineru"],"description":"解析 Provider 策略。auto 按服务端启用列表和顺序执行；MinerU 默认禁用；指定 Provider 时严格执行该 Provider，不静默切换。","default":"auto"}},"additionalProperties":false,"type":"object","required":["source_url"]}]}}},"required":true},"responses":{"200":{"description":"请求已成功处理","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"properties":{"success":{"const":true},"data":{"type":"object","description":"legacy Document JSON（pages/paragraphs/textPara 等骆驼命名字段）。"},"error":{"type":"null"}},"type":"object"}]}}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"409":{"description":"幂等键、任务状态或资源状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"413":{"description":"请求体过大","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"415":{"description":"请求媒体类型不支持","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"500":{"description":"服务内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"502":{"description":"上游服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"504":{"description":"上游服务超时","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"document.parse","x-stability":"stable"}},"/open/v1/classifications":{"post":{"tags":["4. 文档异步任务"],"summary":"按调用方显式提供的类别闭集逐文件分类","description":"该接口采用异步处理。成功提交返回 HTTP 202，响应体 `data.job_id` 和响应头 `Location` 指向任务。随后通过 `getJob` 查询进度；状态为 `succeeded` 后，通过 `getJobResult` 获取最终结果。","operationId":"classifyDocuments","requestBody":{"content":{"application/json":{"schema":{"properties":{"input_mode":{"type":"string","enum":["legacy","auto"],"description":"缺省沿用正文分类。auto 自动按原文件和页面内容选择正文/视觉分类，覆盖所有页与分段，返回 unified_classification_v1 结果；需要服务端开启。","default":"legacy"},"doc_ids":{"items":{"type":"integer","minimum":1.0},"type":"array","minItems":1,"uniqueItems":true},"candidates":{"items":{"properties":{"code":{"type":"string","maxLength":128,"minLength":1},"name":{"type":"string","maxLength":256,"minLength":1},"description":{"type":"string","maxLength":2000}},"additionalProperties":false,"type":"object","required":["code","name"]},"type":"array","minItems":1},"client_request_id":{"type":"string","maxLength":128,"minLength":1,"pattern":"^[A-Za-z0-9._:-]+$","description":"调用方生成的幂等请求标识；相同调用方重试时保持不变。"}},"additionalProperties":false,"type":"object","required":["doc_ids","candidates","client_request_id"]},"example":{"doc_ids":[1001],"candidates":[{"code":"invoice","name":"发票","description":"增值税发票及电子发票"},{"code":"contract","name":"合同","description":"双方或多方签订的合同文件"}],"client_request_id":"swagger-classify-001"}}},"required":true},"responses":{"202":{"description":"任务已受理；请使用 job_id 查询进度和结果","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"required":["job_id","operation","status","phase","progress","progress_detail","sequence","attempt","poll_after_ms","result_ref","error","created_at","updated_at","finished_at"],"properties":{"job_id":{"type":"string","minLength":32,"maxLength":32,"pattern":"^[a-f0-9]{32}$","description":"异步任务唯一 ID；刷新页面或跨请求查询时保持不变。"},"operation":{"type":"string","description":"任务类型；当前主要为 upload、parse 或 extract。"},"status":{"type":"string","description":"queued=排队中，running=处理中，succeeded=已完成，failed/cancelled/unknown=终态异常。","enum":["queued","running","succeeded","failed","cancelled","unknown"]},"phase":{"type":["string","null"],"description":"当前处理阶段；服务未提供细分阶段时为 null。"},"progress":{"type":["integer","null"],"minimum":0,"maximum":100,"description":"0 到 100 的处理进度；无法计算时为 null。"},"progress_detail":{"oneOf":[{"type":"object","additionalProperties":false,"required":["unit","current","total"],"properties":{"unit":{"type":"string","enum":["bytes","documents","items","pages"]},"current":{"type":"integer","minimum":0},"total":{"type":"integer","minimum":1}}},{"type":"null"}],"description":"可核验的真实进度分子、分母；无法度量时为 null。"},"sequence":{"type":"integer","minimum":0,"description":"状态事件单调序号；客户端用它丢弃乱序轮询结果。"},"attempt":{"type":"integer","minimum":0,"description":"worker 执行尝试次数；上传直接执行时固定为 1。"},"poll_after_ms":{"type":"integer","minimum":100,"description":"服务端建议的下次轮询间隔。"},"result_ref":{"type":["string","null"],"description":"任务成功后的结果引用，通常为 /open/v1/job/{job_id}/result。"},"owner_ref":{"type":"string","maxLength":128,"description":"上传任务创建时固化的业务归属；非上传任务通常不返回。"},"error":{"oneOf":[{"type":"object","additionalProperties":false,"required":["code","message","retryable"],"properties":{"code":{"type":"string","enum":["conversion_failed","embedding_access_denied","embedding_output_invalid","embedding_unavailable","feature_disabled","forbidden","index_config_conflict","index_incomplete","input_invalid","input_too_large","internal_error","method_not_allowed","model_access_denied","model_output_invalid","model_unavailable","not_acceptable","not_found","payload_too_large","precondition_failed","precondition_required","processor_budget","processor_failed","processor_invalid_response","processor_rejected","processor_timeout","processor_unauthorized","processor_unavailable","queue_capacity_exceeded","rate_limited","resource_conflict","resource_not_found","semantic_unavailable","service_unavailable","source_ambiguous","source_changed","source_invalid","source_unavailable","source_writeback_unavailable","unauthorized","unsupported_media_type","upstream_rejected","upstream_timeout","upstream_unavailable"]},"message":{"type":"string","minLength":1},"retryable":{"type":"boolean"}}},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"finished_at":{"type":["string","null"],"format":"date-time"},"document_parse_diagnostics_v1":{"type":"object","additionalProperties":false,"required":["schema_version","requested_provider","requested_mode","result_source","pipeline_stage","worker_attempt_count","fallback_occurred","isolation_used","attempts","attempts_truncated","warnings"],"properties":{"schema_version":{"const":"document_parse_diagnostics_v1"},"requested_provider":{"type":"string","enum":["auto","docparse","tencent","local","mineru"],"default":"auto","description":"解析 Provider 策略。auto 按服务端启用列表和顺序执行；MinerU 默认禁用；指定 Provider 时严格执行该 Provider，不静默切换。"},"requested_mode":{"type":"string","enum":["standard","high_accuracy","structure_preserving"]},"result_source":{"type":"string","enum":["fresh","reused"]},"pipeline_stage":{"type":"string","enum":["completed","failed"]},"worker_attempt_count":{"type":"integer","minimum":1},"fallback_occurred":{"type":"boolean"},"isolation_used":{"type":"boolean"},"attempts":{"type":"array","maxItems":32,"items":{"type":"object","additionalProperties":false,"required":["provider","status","scope"],"properties":{"provider":{"type":"string","enum":["docparse","tencent","local","mineru","unknown"]},"status":{"type":"string","enum":["succeeded","failed","unknown"]},"scope":{"type":"string","enum":["group","page","isolation","unknown"]},"page_count":{"type":"integer","minimum":0},"duration_ms":{"type":"integer","minimum":0},"safe_error_code":{"type":"string","maxLength":64},"retryable":{"type":"boolean"},"fallback_allowed":{"type":"boolean"}}}},"attempts_truncated":{"type":"boolean"},"page_summary":{"type":"object","additionalProperties":false,"required":["total","ready","degraded","by_provider"],"properties":{"total":{"type":"integer","minimum":0},"ready":{"type":"integer","minimum":0},"degraded":{"type":"integer","minimum":0},"by_provider":{"type":"object","additionalProperties":false,"required":[],"properties":{"docparse":{"type":"integer","minimum":0},"tencent":{"type":"integer","minimum":0},"local":{"type":"integer","minimum":0}}}}},"warnings":{"type":"object","additionalProperties":false,"required":["count","codes"],"properties":{"count":{"type":"integer","minimum":0},"codes":{"type":"array","maxItems":32,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":64}}}},"source_format":{"type":"string","minLength":1,"maxLength":32},"canonicalized":{"type":"boolean"},"content_version":{"type":"string","minLength":1,"maxLength":128},"failure_stage":{"type":"string","enum":["precondition","source_read","convert","split","provider_parse","persist","unknown"]}}}}},"error":{"type":"null"}}}]}}},"headers":{"Location":{"description":"任务状态查询地址","schema":{"type":"string","example":"/open/v1/job/0123456789abcdef0123456789abcdef"}}},"links":{"查询任务进度":{"operationId":"getJob","parameters":{"job_id":"$response.body#/data/job_id"},"description":"使用本次返回的 job_id 查询任务进度。"},"读取任务结果":{"operationId":"getJobResult","parameters":{"job_id":"$response.body#/data/job_id"},"description":"任务 succeeded 后读取结构化结果。"}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"409":{"description":"幂等键、任务状态或资源状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"413":{"description":"请求体过大","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"415":{"description":"请求媒体类型不支持","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"429":{"description":"队列或模型并发额度已满，请稍后重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"500":{"description":"服务内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"502":{"description":"上游服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"504":{"description":"上游服务超时","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"viewCategory","x-stability":"stable"}},"/open/v1/extractions":{"post":{"tags":["4. 文档异步任务"],"summary":"按调用方显式指标表逐文件抽取结构化字段","description":"该接口采用异步处理。成功提交返回 HTTP 202，响应体 `data.job_id` 和响应头 `Location` 指向任务。随后通过 `getJob` 查询进度；状态为 `succeeded` 后，通过 `getJobResult` 获取最终结果。","operationId":"extractDocumentFields","responses":{"202":{"description":"任务已受理；请使用 job_id 查询进度和结果","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"required":["job_id","operation","status","phase","progress","progress_detail","sequence","attempt","poll_after_ms","result_ref","error","created_at","updated_at","finished_at"],"properties":{"job_id":{"type":"string","minLength":32,"maxLength":32,"pattern":"^[a-f0-9]{32}$","description":"异步任务唯一 ID；刷新页面或跨请求查询时保持不变。"},"operation":{"type":"string","description":"任务类型；当前主要为 upload、parse 或 extract。"},"status":{"type":"string","description":"queued=排队中，running=处理中，succeeded=已完成，failed/cancelled/unknown=终态异常。","enum":["queued","running","succeeded","failed","cancelled","unknown"]},"phase":{"type":["string","null"],"description":"当前处理阶段；服务未提供细分阶段时为 null。"},"progress":{"type":["integer","null"],"minimum":0,"maximum":100,"description":"0 到 100 的处理进度；无法计算时为 null。"},"progress_detail":{"oneOf":[{"type":"object","additionalProperties":false,"required":["unit","current","total"],"properties":{"unit":{"type":"string","enum":["bytes","documents","items","pages"]},"current":{"type":"integer","minimum":0},"total":{"type":"integer","minimum":1}}},{"type":"null"}],"description":"可核验的真实进度分子、分母；无法度量时为 null。"},"sequence":{"type":"integer","minimum":0,"description":"状态事件单调序号；客户端用它丢弃乱序轮询结果。"},"attempt":{"type":"integer","minimum":0,"description":"worker 执行尝试次数；上传直接执行时固定为 1。"},"poll_after_ms":{"type":"integer","minimum":100,"description":"服务端建议的下次轮询间隔。"},"result_ref":{"type":["string","null"],"description":"任务成功后的结果引用，通常为 /open/v1/job/{job_id}/result。"},"owner_ref":{"type":"string","maxLength":128,"description":"上传任务创建时固化的业务归属；非上传任务通常不返回。"},"error":{"oneOf":[{"type":"object","additionalProperties":false,"required":["code","message","retryable"],"properties":{"code":{"type":"string","enum":["conversion_failed","embedding_access_denied","embedding_output_invalid","embedding_unavailable","feature_disabled","forbidden","index_config_conflict","index_incomplete","input_invalid","input_too_large","internal_error","method_not_allowed","model_access_denied","model_output_invalid","model_unavailable","not_acceptable","not_found","payload_too_large","precondition_failed","precondition_required","processor_budget","processor_failed","processor_invalid_response","processor_rejected","processor_timeout","processor_unauthorized","processor_unavailable","queue_capacity_exceeded","rate_limited","resource_conflict","resource_not_found","semantic_unavailable","service_unavailable","source_ambiguous","source_changed","source_invalid","source_unavailable","source_writeback_unavailable","unauthorized","unsupported_media_type","upstream_rejected","upstream_timeout","upstream_unavailable"]},"message":{"type":"string","minLength":1},"retryable":{"type":"boolean"}}},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"finished_at":{"type":["string","null"],"format":"date-time"},"document_parse_diagnostics_v1":{"type":"object","additionalProperties":false,"required":["schema_version","requested_provider","requested_mode","result_source","pipeline_stage","worker_attempt_count","fallback_occurred","isolation_used","attempts","attempts_truncated","warnings"],"properties":{"schema_version":{"const":"document_parse_diagnostics_v1"},"requested_provider":{"type":"string","enum":["auto","docparse","tencent","local","mineru"],"default":"auto","description":"解析 Provider 策略。auto 按服务端启用列表和顺序执行；MinerU 默认禁用；指定 Provider 时严格执行该 Provider，不静默切换。"},"requested_mode":{"type":"string","enum":["standard","high_accuracy","structure_preserving"]},"result_source":{"type":"string","enum":["fresh","reused"]},"pipeline_stage":{"type":"string","enum":["completed","failed"]},"worker_attempt_count":{"type":"integer","minimum":1},"fallback_occurred":{"type":"boolean"},"isolation_used":{"type":"boolean"},"attempts":{"type":"array","maxItems":32,"items":{"type":"object","additionalProperties":false,"required":["provider","status","scope"],"properties":{"provider":{"type":"string","enum":["docparse","tencent","local","mineru","unknown"]},"status":{"type":"string","enum":["succeeded","failed","unknown"]},"scope":{"type":"string","enum":["group","page","isolation","unknown"]},"page_count":{"type":"integer","minimum":0},"duration_ms":{"type":"integer","minimum":0},"safe_error_code":{"type":"string","maxLength":64},"retryable":{"type":"boolean"},"fallback_allowed":{"type":"boolean"}}}},"attempts_truncated":{"type":"boolean"},"page_summary":{"type":"object","additionalProperties":false,"required":["total","ready","degraded","by_provider"],"properties":{"total":{"type":"integer","minimum":0},"ready":{"type":"integer","minimum":0},"degraded":{"type":"integer","minimum":0},"by_provider":{"type":"object","additionalProperties":false,"required":[],"properties":{"docparse":{"type":"integer","minimum":0},"tencent":{"type":"integer","minimum":0},"local":{"type":"integer","minimum":0}}}}},"warnings":{"type":"object","additionalProperties":false,"required":["count","codes"],"properties":{"count":{"type":"integer","minimum":0},"codes":{"type":"array","maxItems":32,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":64}}}},"source_format":{"type":"string","minLength":1,"maxLength":32},"canonicalized":{"type":"boolean"},"content_version":{"type":"string","minLength":1,"maxLength":128},"failure_stage":{"type":"string","enum":["precondition","source_read","convert","split","provider_parse","persist","unknown"]}}}}},"error":{"type":"null"}}}]}}},"headers":{"Location":{"description":"任务状态查询地址","schema":{"type":"string","example":"/open/v1/job/0123456789abcdef0123456789abcdef"}}},"links":{"查询任务进度":{"operationId":"getJob","parameters":{"job_id":"$response.body#/data/job_id"},"description":"使用本次返回的 job_id 查询任务进度。"},"读取任务结果":{"operationId":"getJobResult","parameters":{"job_id":"$response.body#/data/job_id"},"description":"任务 succeeded 后读取结构化结果。"}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"409":{"description":"幂等键、任务状态或资源状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"413":{"description":"请求体过大","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"415":{"description":"请求媒体类型不支持","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"429":{"description":"队列或模型并发额度已满，请稍后重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"500":{"description":"服务内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"502":{"description":"上游服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"504":{"description":"上游服务超时","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"viewExtractDocument","x-stability":"stable","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["doc_ids","indicators","client_request_id"],"properties":{"doc_ids":{"type":"array","minItems":1,"uniqueItems":true,"items":{"type":"integer","minimum":1}},"strategy":{"type":"string","enum":["standard","retrieval"],"default":"standard"},"result_format":{"type":"string","enum":["legacy","evidence_v1"],"default":"legacy"},"indicators":{"type":"array","minItems":1,"items":{"type":"object","additionalProperties":false,"required":["name","type","description"],"properties":{"name":{"type":"string","minLength":1,"maxLength":256},"type":{"type":"string","enum":["text","number","span","section","list","entity","obj_list"]},"description":{"type":"string","minLength":1,"maxLength":2000},"attrs":{"type":"array","minItems":1,"items":{"type":"object","additionalProperties":false,"required":["name","type","description"],"properties":{"name":{"type":"string","minLength":1,"maxLength":256},"type":{"type":"string","enum":["text","number","span","section","list","entity","obj_list"]},"description":{"type":"string","minLength":1,"maxLength":2000}}}},"retrieval_context":{"type":["object","null"],"additionalProperties":false,"required":["scope"],"properties":{"scope":{"type":"string","enum":["document","sections"]},"section_hints":{"type":"array","minItems":1,"maxItems":20,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":128}},"similar_text":{"type":["string","null"],"maxLength":4000}}}}}},"client_request_id":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$","description":"调用方生成的幂等请求标识；相同调用方重试时保持不变。"}}},"example":{"doc_ids":[1001],"strategy":"retrieval","result_format":"evidence_v1","indicators":[{"name":"发票号码","type":"text","description":"抽取发票上的号码字段","retrieval_context":{"scope":"document"}},{"name":"价税合计","type":"number","description":"抽取价税合计金额"}],"client_request_id":"swagger-extract-001"}}}}}},"/open/v1/analysis":{"post":{"tags":["4. 文档异步任务"],"summary":"按自然语言指令分析受检文档，并可引用独立参考件集合","description":"该接口采用异步处理。成功提交返回 HTTP 202，响应体 `data.job_id` 和响应头 `Location` 指向任务。随后通过 `getJob` 查询进度；状态为 `succeeded` 后，通过 `getJobResult` 获取最终结果。","operationId":"createAnalysis","requestBody":{"content":{"application/json":{"schema":{"properties":{"documents":{"items":{"type":"integer","minimum":1.0},"type":"array","uniqueItems":true},"references":{"items":{"type":"integer","minimum":1.0},"type":"array","uniqueItems":true},"instruction":{"type":"string","maxLength":12000,"minLength":1},"document_contexts":{"items":{"properties":{"doc_id":{"type":"integer","minimum":1.0},"slot":{"type":"string","maxLength":128,"minLength":1},"fields":{"additionalProperties":true,"type":"object","maxProperties":200}},"additionalProperties":false,"type":"object","required":["doc_id"]},"type":"array"},"allowed_categories":{"items":{"type":"string","maxLength":256,"minLength":1},"type":"array","maxItems":100,"uniqueItems":true},"client_request_id":{"type":"string","maxLength":128,"minLength":1,"pattern":"^[A-Za-z0-9._:-]+$","description":"调用方生成的幂等请求标识；相同调用方重试时保持不变。"}},"additionalProperties":false,"type":"object","required":["documents","references","instruction","client_request_id"]},"example":{"documents":[1001],"references":[],"instruction":"概括文档要点，并列出需要关注的风险。","client_request_id":"swagger-analysis-001"}}},"required":true},"responses":{"202":{"description":"任务已受理；请使用 job_id 查询进度和结果","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"required":["job_id","operation","status","phase","progress","progress_detail","sequence","attempt","poll_after_ms","result_ref","error","created_at","updated_at","finished_at"],"properties":{"job_id":{"type":"string","minLength":32,"maxLength":32,"pattern":"^[a-f0-9]{32}$","description":"异步任务唯一 ID；刷新页面或跨请求查询时保持不变。"},"operation":{"type":"string","description":"任务类型；当前主要为 upload、parse 或 extract。"},"status":{"type":"string","description":"queued=排队中，running=处理中，succeeded=已完成，failed/cancelled/unknown=终态异常。","enum":["queued","running","succeeded","failed","cancelled","unknown"]},"phase":{"type":["string","null"],"description":"当前处理阶段；服务未提供细分阶段时为 null。"},"progress":{"type":["integer","null"],"minimum":0,"maximum":100,"description":"0 到 100 的处理进度；无法计算时为 null。"},"progress_detail":{"oneOf":[{"type":"object","additionalProperties":false,"required":["unit","current","total"],"properties":{"unit":{"type":"string","enum":["bytes","documents","items","pages"]},"current":{"type":"integer","minimum":0},"total":{"type":"integer","minimum":1}}},{"type":"null"}],"description":"可核验的真实进度分子、分母；无法度量时为 null。"},"sequence":{"type":"integer","minimum":0,"description":"状态事件单调序号；客户端用它丢弃乱序轮询结果。"},"attempt":{"type":"integer","minimum":0,"description":"worker 执行尝试次数；上传直接执行时固定为 1。"},"poll_after_ms":{"type":"integer","minimum":100,"description":"服务端建议的下次轮询间隔。"},"result_ref":{"type":["string","null"],"description":"任务成功后的结果引用，通常为 /open/v1/job/{job_id}/result。"},"owner_ref":{"type":"string","maxLength":128,"description":"上传任务创建时固化的业务归属；非上传任务通常不返回。"},"error":{"oneOf":[{"type":"object","additionalProperties":false,"required":["code","message","retryable"],"properties":{"code":{"type":"string","enum":["conversion_failed","embedding_access_denied","embedding_output_invalid","embedding_unavailable","feature_disabled","forbidden","index_config_conflict","index_incomplete","input_invalid","input_too_large","internal_error","method_not_allowed","model_access_denied","model_output_invalid","model_unavailable","not_acceptable","not_found","payload_too_large","precondition_failed","precondition_required","processor_budget","processor_failed","processor_invalid_response","processor_rejected","processor_timeout","processor_unauthorized","processor_unavailable","queue_capacity_exceeded","rate_limited","resource_conflict","resource_not_found","semantic_unavailable","service_unavailable","source_ambiguous","source_changed","source_invalid","source_unavailable","source_writeback_unavailable","unauthorized","unsupported_media_type","upstream_rejected","upstream_timeout","upstream_unavailable"]},"message":{"type":"string","minLength":1},"retryable":{"type":"boolean"}}},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"finished_at":{"type":["string","null"],"format":"date-time"},"document_parse_diagnostics_v1":{"type":"object","additionalProperties":false,"required":["schema_version","requested_provider","requested_mode","result_source","pipeline_stage","worker_attempt_count","fallback_occurred","isolation_used","attempts","attempts_truncated","warnings"],"properties":{"schema_version":{"const":"document_parse_diagnostics_v1"},"requested_provider":{"type":"string","enum":["auto","docparse","tencent","local","mineru"],"default":"auto","description":"解析 Provider 策略。auto 按服务端启用列表和顺序执行；MinerU 默认禁用；指定 Provider 时严格执行该 Provider，不静默切换。"},"requested_mode":{"type":"string","enum":["standard","high_accuracy","structure_preserving"]},"result_source":{"type":"string","enum":["fresh","reused"]},"pipeline_stage":{"type":"string","enum":["completed","failed"]},"worker_attempt_count":{"type":"integer","minimum":1},"fallback_occurred":{"type":"boolean"},"isolation_used":{"type":"boolean"},"attempts":{"type":"array","maxItems":32,"items":{"type":"object","additionalProperties":false,"required":["provider","status","scope"],"properties":{"provider":{"type":"string","enum":["docparse","tencent","local","mineru","unknown"]},"status":{"type":"string","enum":["succeeded","failed","unknown"]},"scope":{"type":"string","enum":["group","page","isolation","unknown"]},"page_count":{"type":"integer","minimum":0},"duration_ms":{"type":"integer","minimum":0},"safe_error_code":{"type":"string","maxLength":64},"retryable":{"type":"boolean"},"fallback_allowed":{"type":"boolean"}}}},"attempts_truncated":{"type":"boolean"},"page_summary":{"type":"object","additionalProperties":false,"required":["total","ready","degraded","by_provider"],"properties":{"total":{"type":"integer","minimum":0},"ready":{"type":"integer","minimum":0},"degraded":{"type":"integer","minimum":0},"by_provider":{"type":"object","additionalProperties":false,"required":[],"properties":{"docparse":{"type":"integer","minimum":0},"tencent":{"type":"integer","minimum":0},"local":{"type":"integer","minimum":0}}}}},"warnings":{"type":"object","additionalProperties":false,"required":["count","codes"],"properties":{"count":{"type":"integer","minimum":0},"codes":{"type":"array","maxItems":32,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":64}}}},"source_format":{"type":"string","minLength":1,"maxLength":32},"canonicalized":{"type":"boolean"},"content_version":{"type":"string","minLength":1,"maxLength":128},"failure_stage":{"type":"string","enum":["precondition","source_read","convert","split","provider_parse","persist","unknown"]}}}}},"error":{"type":"null"}}}]}}},"headers":{"Location":{"description":"任务状态查询地址","schema":{"type":"string","example":"/open/v1/job/0123456789abcdef0123456789abcdef"}}},"links":{"查询任务进度":{"operationId":"getJob","parameters":{"job_id":"$response.body#/data/job_id"},"description":"使用本次返回的 job_id 查询任务进度。"},"读取任务结果":{"operationId":"getJobResult","parameters":{"job_id":"$response.body#/data/job_id"},"description":"任务 succeeded 后读取结构化结果。"}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"409":{"description":"幂等键、任务状态或资源状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"413":{"description":"请求体过大","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"415":{"description":"请求媒体类型不支持","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"429":{"description":"队列或模型并发额度已满，请稍后重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"500":{"description":"服务内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"502":{"description":"上游服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"504":{"description":"上游服务超时","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"checkAudit","x-stability":"stable"}},"/open/v1/comparison":{"post":{"tags":["4. 文档异步任务"],"summary":"对两份文档执行确定性逐条差异比对","description":"该接口采用异步处理。成功提交返回 HTTP 202，响应体 `data.job_id` 和响应头 `Location` 指向任务。随后通过 `getJob` 查询进度；状态为 `succeeded` 后，通过 `getJobResult` 获取最终结果。 提供knowledge_base_id及知识版本时执行固定版本比较，要求dkWrite；与原documents分支互斥。显式input_mode=direct时提交left_text/right_text（每侧至多5000个Unicode字符，可为空）及原options，无需上传、解析或建库，要求checkAudit；仅支持text_v1结果，始终返回202并沿Job读取。位置单位UTF-16 code unit、区间[start,end)，不产生页码、bbox或合规结论。直接文本分支沿用checkAudit权限，无独立准入开关。\n\n**动态知识库关联边界**\n\n显式input_mode=direct时传left_text/right_text及options，每侧最多5000个Unicode字符（可为空），result_format为text_v1；要求checkAudit，读取任务要求viewTask，返回202后沿原job/result查询。无需上传、解析、建库或模型。segments含equal/insert/delete/replace、两侧原文及UTF-16 code unit位置，区间[start,end)；忽略选项沿用旧字符匹配语义，不改变输出原文，不编造页码/bbox。直接文本分支沿用checkAudit权限，无独立准入开关。原documents及动态知识版本分支保持；动态分支显式传knowledge_base_id，要求dkWrite及Idempotency-Key，与直接文本互斥。from/to代表旧/新固定版本，结果经原job/result读取，明细用impacts/get_comparison及独立分页。所有分支只说明文字差异，不发布制度、不确认修改原因、不自动生成或保存新版本。\n\n完整说明：/swagger-ui/open-v1/docs/dynamic-knowledge","operationId":"createComparison","responses":{"202":{"description":"任务已受理；请使用 job_id 查询进度和结果","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"oneOf":[{"type":"object","additionalProperties":false,"required":["job_id","operation","status","phase","progress","progress_detail","sequence","attempt","poll_after_ms","result_ref","error","created_at","updated_at","finished_at"],"properties":{"job_id":{"type":"string","minLength":32,"maxLength":32,"pattern":"^[a-f0-9]{32}$","description":"异步任务唯一 ID；刷新页面或跨请求查询时保持不变。"},"operation":{"type":"string","description":"任务类型；当前主要为 upload、parse 或 extract。"},"status":{"type":"string","description":"queued=排队中，running=处理中，succeeded=已完成，failed/cancelled/unknown=终态异常。","enum":["queued","running","succeeded","failed","cancelled","unknown"]},"phase":{"type":["string","null"],"description":"当前处理阶段；服务未提供细分阶段时为 null。"},"progress":{"type":["integer","null"],"minimum":0,"maximum":100,"description":"0 到 100 的处理进度；无法计算时为 null。"},"progress_detail":{"oneOf":[{"type":"object","additionalProperties":false,"required":["unit","current","total"],"properties":{"unit":{"type":"string","enum":["bytes","documents","items","pages"]},"current":{"type":"integer","minimum":0},"total":{"type":"integer","minimum":1}}},{"type":"null"}],"description":"可核验的真实进度分子、分母；无法度量时为 null。"},"sequence":{"type":"integer","minimum":0,"description":"状态事件单调序号；客户端用它丢弃乱序轮询结果。"},"attempt":{"type":"integer","minimum":0,"description":"worker 执行尝试次数；上传直接执行时固定为 1。"},"poll_after_ms":{"type":"integer","minimum":100,"description":"服务端建议的下次轮询间隔。"},"result_ref":{"type":["string","null"],"description":"任务成功后的结果引用，通常为 /open/v1/job/{job_id}/result。"},"owner_ref":{"type":"string","maxLength":128,"description":"上传任务创建时固化的业务归属；非上传任务通常不返回。"},"error":{"oneOf":[{"type":"object","additionalProperties":false,"required":["code","message","retryable"],"properties":{"code":{"type":"string","enum":["conversion_failed","embedding_access_denied","embedding_output_invalid","embedding_unavailable","feature_disabled","forbidden","index_config_conflict","index_incomplete","input_invalid","input_too_large","internal_error","method_not_allowed","model_access_denied","model_output_invalid","model_unavailable","not_acceptable","not_found","payload_too_large","precondition_failed","precondition_required","processor_budget","processor_failed","processor_invalid_response","processor_rejected","processor_timeout","processor_unauthorized","processor_unavailable","queue_capacity_exceeded","rate_limited","resource_conflict","resource_not_found","semantic_unavailable","service_unavailable","source_ambiguous","source_changed","source_invalid","source_unavailable","source_writeback_unavailable","unauthorized","unsupported_media_type","upstream_rejected","upstream_timeout","upstream_unavailable"]},"message":{"type":"string","minLength":1},"retryable":{"type":"boolean"}}},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"finished_at":{"type":["string","null"],"format":"date-time"},"document_parse_diagnostics_v1":{"type":"object","additionalProperties":false,"required":["schema_version","requested_provider","requested_mode","result_source","pipeline_stage","worker_attempt_count","fallback_occurred","isolation_used","attempts","attempts_truncated","warnings"],"properties":{"schema_version":{"const":"document_parse_diagnostics_v1"},"requested_provider":{"type":"string","enum":["auto","docparse","tencent","local","mineru"],"default":"auto","description":"解析 Provider 策略。auto 按服务端启用列表和顺序执行；MinerU 默认禁用；指定 Provider 时严格执行该 Provider，不静默切换。"},"requested_mode":{"type":"string","enum":["standard","high_accuracy","structure_preserving"]},"result_source":{"type":"string","enum":["fresh","reused"]},"pipeline_stage":{"type":"string","enum":["completed","failed"]},"worker_attempt_count":{"type":"integer","minimum":1},"fallback_occurred":{"type":"boolean"},"isolation_used":{"type":"boolean"},"attempts":{"type":"array","maxItems":32,"items":{"type":"object","additionalProperties":false,"required":["provider","status","scope"],"properties":{"provider":{"type":"string","enum":["docparse","tencent","local","mineru","unknown"]},"status":{"type":"string","enum":["succeeded","failed","unknown"]},"scope":{"type":"string","enum":["group","page","isolation","unknown"]},"page_count":{"type":"integer","minimum":0},"duration_ms":{"type":"integer","minimum":0},"safe_error_code":{"type":"string","maxLength":64},"retryable":{"type":"boolean"},"fallback_allowed":{"type":"boolean"}}}},"attempts_truncated":{"type":"boolean"},"page_summary":{"type":"object","additionalProperties":false,"required":["total","ready","degraded","by_provider"],"properties":{"total":{"type":"integer","minimum":0},"ready":{"type":"integer","minimum":0},"degraded":{"type":"integer","minimum":0},"by_provider":{"type":"object","additionalProperties":false,"required":[],"properties":{"docparse":{"type":"integer","minimum":0},"tencent":{"type":"integer","minimum":0},"local":{"type":"integer","minimum":0}}}}},"warnings":{"type":"object","additionalProperties":false,"required":["count","codes"],"properties":{"count":{"type":"integer","minimum":0},"codes":{"type":"array","maxItems":32,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":64}}}},"source_format":{"type":"string","minLength":1,"maxLength":32},"canonicalized":{"type":"boolean"},"content_version":{"type":"string","minLength":1,"maxLength":128},"failure_stage":{"type":"string","enum":["precondition","source_read","convert","split","provider_parse","persist","unknown"]}}}}},{"type":"object","properties":{"job_id":{"type":"string"},"status":{"const":"queued"},"status_url":{"type":"string","pattern":"^/open/v1/job/","description":"查询任务状态，成功后在该地址追加 /result 读取结果。"},"etag":{"type":"string"},"comparison_id":{"type":"string"}},"required":["job_id","status","status_url","comparison_id"]}]},"error":{"type":"null"}}}]}}},"headers":{"Location":{"description":"任务状态查询地址","schema":{"type":"string","example":"/open/v1/job/0123456789abcdef0123456789abcdef"}}},"links":{"查询任务进度":{"operationId":"getJob","parameters":{"job_id":"$response.body#/data/job_id"},"description":"使用本次返回的 job_id 查询任务进度。"},"读取任务结果":{"operationId":"getJobResult","parameters":{"job_id":"$response.body#/data/job_id"},"description":"任务 succeeded 后读取结构化结果。"}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"409":{"description":"幂等键、任务状态或资源状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"412":{"description":"资源修订已变化，请重新读取后提交","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"413":{"description":"请求体过大","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"415":{"description":"请求媒体类型不支持","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"428":{"description":"缺少资源修订前置条件 If-Match","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"429":{"description":"队列或模型并发额度已满，请稍后重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"500":{"description":"服务内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"502":{"description":"上游服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"504":{"description":"上游服务超时","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"checkAudit","x-stability":"stable","x-alternative-scopes":["dkWrite"],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string"},"description":"知识版本比较分支必填。"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","additionalProperties":false,"required":["documents","options","client_request_id"],"properties":{"documents":{"type":"array","minItems":2,"maxItems":2,"uniqueItems":true,"items":{"type":"integer","minimum":1}},"result_format":{"type":"string","enum":["legacy","structured_v1","structured_v2"],"default":"legacy"},"async":{"type":"boolean","default":true,"description":"是否走异步 Job 执行（默认 true）；显式传 false 时回退为单次同步执行"},"options":{"type":"object","additionalProperties":false,"required":["ignore_punctuation","ignore_full_half_width","ignore_case"],"properties":{"ignore_punctuation":{"type":"boolean"},"ignore_full_half_width":{"type":"boolean"},"ignore_case":{"type":"boolean"}}},"client_request_id":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$","description":"调用方生成的幂等请求标识；相同调用方重试时保持不变。"}}},{"additionalProperties":false,"properties":{"from_version_id":{"title":"From Version Id","type":"string"},"to_version_id":{"title":"To Version Id","type":"string"},"from_content_revision_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From Content Revision Id"},"to_content_revision_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"To Content Revision Id"},"knowledge_base_id":{"maxLength":32,"minLength":1,"title":"Knowledge Base Id","type":"string"}},"required":["from_version_id","to_version_id","knowledge_base_id"],"title":"KnowledgeComparison","type":"object"},{"type":"object","additionalProperties":false,"required":["input_mode","left_text","right_text","options","client_request_id"],"properties":{"input_mode":{"const":"direct"},"left_text":{"type":"string","maxLength":5000},"right_text":{"type":"string","maxLength":5000},"result_format":{"const":"text_v1","default":"text_v1"},"options":{"type":"object","additionalProperties":false,"required":["ignore_punctuation","ignore_full_half_width","ignore_case"],"properties":{"ignore_punctuation":{"type":"boolean"},"ignore_full_half_width":{"type":"boolean"},"ignore_case":{"type":"boolean"}}},"client_request_id":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$","description":"调用方生成的幂等请求标识；相同调用方重试时保持不变。"},"async":{"type":"boolean","default":true,"description":"兼容字段；直接文本模式始终返回202，沿既有Job读取结果。"}}}]},"examples":{"documents":{"summary":"原文档ID比对","value":{"documents":[1001,1002],"result_format":"structured_v2","options":{"ignore_punctuation":true,"ignore_full_half_width":true,"ignore_case":true},"client_request_id":"swagger-comparison-001"}},"direct_text":{"summary":"直接传入两段文本，不调用AI","value":{"input_mode":"direct","left_text":"采购由部门负责人审批，档案保存十年。","right_text":"采购由集团负责人审批，档案保存十年。","result_format":"text_v1","options":{"ignore_punctuation":false,"ignore_full_half_width":false,"ignore_case":false},"client_request_id":"text-comparison-001"}}}}}}}},"/open/v1/audit-rule-graph":{"post":{"tags":["4. 文档异步任务"],"summary":"根据规则材料和分类指标上下文生成带拓扑关系的审核节点","description":"该接口采用异步处理。成功提交返回 HTTP 202，响应体 `data.job_id` 和响应头 `Location` 指向任务。随后通过 `getJob` 查询进度；状态为 `succeeded` 后，通过 `getJobResult` 获取最终结果。","operationId":"generateAuditRuleGraph","responses":{"202":{"description":"任务已受理；请使用 job_id 查询进度和结果","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"required":["job_id","operation","status","phase","progress","progress_detail","sequence","attempt","poll_after_ms","result_ref","error","created_at","updated_at","finished_at"],"properties":{"job_id":{"type":"string","minLength":32,"maxLength":32,"pattern":"^[a-f0-9]{32}$","description":"异步任务唯一 ID；刷新页面或跨请求查询时保持不变。"},"operation":{"type":"string","description":"任务类型；当前主要为 upload、parse 或 extract。"},"status":{"type":"string","description":"queued=排队中，running=处理中，succeeded=已完成，failed/cancelled/unknown=终态异常。","enum":["queued","running","succeeded","failed","cancelled","unknown"]},"phase":{"type":["string","null"],"description":"当前处理阶段；服务未提供细分阶段时为 null。"},"progress":{"type":["integer","null"],"minimum":0,"maximum":100,"description":"0 到 100 的处理进度；无法计算时为 null。"},"progress_detail":{"oneOf":[{"type":"object","additionalProperties":false,"required":["unit","current","total"],"properties":{"unit":{"type":"string","enum":["bytes","documents","items","pages"]},"current":{"type":"integer","minimum":0},"total":{"type":"integer","minimum":1}}},{"type":"null"}],"description":"可核验的真实进度分子、分母；无法度量时为 null。"},"sequence":{"type":"integer","minimum":0,"description":"状态事件单调序号；客户端用它丢弃乱序轮询结果。"},"attempt":{"type":"integer","minimum":0,"description":"worker 执行尝试次数；上传直接执行时固定为 1。"},"poll_after_ms":{"type":"integer","minimum":100,"description":"服务端建议的下次轮询间隔。"},"result_ref":{"type":["string","null"],"description":"任务成功后的结果引用，通常为 /open/v1/job/{job_id}/result。"},"owner_ref":{"type":"string","maxLength":128,"description":"上传任务创建时固化的业务归属；非上传任务通常不返回。"},"error":{"oneOf":[{"type":"object","additionalProperties":false,"required":["code","message","retryable"],"properties":{"code":{"type":"string","enum":["conversion_failed","embedding_access_denied","embedding_output_invalid","embedding_unavailable","feature_disabled","forbidden","index_config_conflict","index_incomplete","input_invalid","input_too_large","internal_error","method_not_allowed","model_access_denied","model_output_invalid","model_unavailable","not_acceptable","not_found","payload_too_large","precondition_failed","precondition_required","processor_budget","processor_failed","processor_invalid_response","processor_rejected","processor_timeout","processor_unauthorized","processor_unavailable","queue_capacity_exceeded","rate_limited","resource_conflict","resource_not_found","semantic_unavailable","service_unavailable","source_ambiguous","source_changed","source_invalid","source_unavailable","source_writeback_unavailable","unauthorized","unsupported_media_type","upstream_rejected","upstream_timeout","upstream_unavailable"]},"message":{"type":"string","minLength":1},"retryable":{"type":"boolean"}}},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"finished_at":{"type":["string","null"],"format":"date-time"},"document_parse_diagnostics_v1":{"type":"object","additionalProperties":false,"required":["schema_version","requested_provider","requested_mode","result_source","pipeline_stage","worker_attempt_count","fallback_occurred","isolation_used","attempts","attempts_truncated","warnings"],"properties":{"schema_version":{"const":"document_parse_diagnostics_v1"},"requested_provider":{"type":"string","enum":["auto","docparse","tencent","local","mineru"],"default":"auto","description":"解析 Provider 策略。auto 按服务端启用列表和顺序执行；MinerU 默认禁用；指定 Provider 时严格执行该 Provider，不静默切换。"},"requested_mode":{"type":"string","enum":["standard","high_accuracy","structure_preserving"]},"result_source":{"type":"string","enum":["fresh","reused"]},"pipeline_stage":{"type":"string","enum":["completed","failed"]},"worker_attempt_count":{"type":"integer","minimum":1},"fallback_occurred":{"type":"boolean"},"isolation_used":{"type":"boolean"},"attempts":{"type":"array","maxItems":32,"items":{"type":"object","additionalProperties":false,"required":["provider","status","scope"],"properties":{"provider":{"type":"string","enum":["docparse","tencent","local","mineru","unknown"]},"status":{"type":"string","enum":["succeeded","failed","unknown"]},"scope":{"type":"string","enum":["group","page","isolation","unknown"]},"page_count":{"type":"integer","minimum":0},"duration_ms":{"type":"integer","minimum":0},"safe_error_code":{"type":"string","maxLength":64},"retryable":{"type":"boolean"},"fallback_allowed":{"type":"boolean"}}}},"attempts_truncated":{"type":"boolean"},"page_summary":{"type":"object","additionalProperties":false,"required":["total","ready","degraded","by_provider"],"properties":{"total":{"type":"integer","minimum":0},"ready":{"type":"integer","minimum":0},"degraded":{"type":"integer","minimum":0},"by_provider":{"type":"object","additionalProperties":false,"required":[],"properties":{"docparse":{"type":"integer","minimum":0},"tencent":{"type":"integer","minimum":0},"local":{"type":"integer","minimum":0}}}}},"warnings":{"type":"object","additionalProperties":false,"required":["count","codes"],"properties":{"count":{"type":"integer","minimum":0},"codes":{"type":"array","maxItems":32,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":64}}}},"source_format":{"type":"string","minLength":1,"maxLength":32},"canonicalized":{"type":"boolean"},"content_version":{"type":"string","minLength":1,"maxLength":128},"failure_stage":{"type":"string","enum":["precondition","source_read","convert","split","provider_parse","persist","unknown"]}}}}},"error":{"type":"null"}}}]}}},"headers":{"Location":{"description":"任务状态查询地址","schema":{"type":"string","example":"/open/v1/job/0123456789abcdef0123456789abcdef"}}},"links":{"查询任务进度":{"operationId":"getJob","parameters":{"job_id":"$response.body#/data/job_id"},"description":"使用本次返回的 job_id 查询任务进度。"},"读取任务结果":{"operationId":"getJobResult","parameters":{"job_id":"$response.body#/data/job_id"},"description":"任务 succeeded 后读取结构化结果。"}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"409":{"description":"幂等键、任务状态或资源状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"413":{"description":"请求体过大","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"415":{"description":"请求媒体类型不支持","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"429":{"description":"队列或模型并发额度已满，请稍后重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"500":{"description":"服务内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"502":{"description":"上游服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"504":{"description":"上游服务超时","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"checkAudit","x-stability":"stable","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["documents","requirement","categories","current_rules","client_request_id"],"properties":{"documents":{"type":"array","maxItems":20,"uniqueItems":true,"items":{"type":"integer","minimum":1}},"requirement":{"type":"string","minLength":1,"maxLength":12000},"categories":{"type":"array","minItems":1,"maxItems":50,"items":{"type":"object","additionalProperties":false,"required":["code","name","indicators"],"properties":{"code":{"type":"string","minLength":1,"maxLength":128},"name":{"type":"string","minLength":1,"maxLength":256},"description":{"type":"string","maxLength":2000},"indicators":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","additionalProperties":false,"required":["name","type","description"],"properties":{"name":{"type":"string","minLength":1,"maxLength":256},"type":{"type":"string","enum":["text","number","span","section","list","entity","obj_list"]},"description":{"type":"string","minLength":1,"maxLength":2000},"attrs":{"type":"array","minItems":1,"items":{"type":"object","additionalProperties":false,"required":["name","type","description"],"properties":{"name":{"type":"string","minLength":1,"maxLength":256},"type":{"type":"string","enum":["text","number","span","section","list","entity","obj_list"]},"description":{"type":"string","minLength":1,"maxLength":2000}}}},"retrieval_context":{"type":["object","null"],"additionalProperties":false,"required":["scope"],"properties":{"scope":{"type":"string","enum":["document","sections"]},"section_hints":{"type":"array","minItems":1,"maxItems":20,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":128}},"similar_text":{"type":["string","null"],"maxLength":4000}}}}}}}}},"current_rules":{"type":"array","maxItems":100,"items":{"type":"object","additionalProperties":false,"required":["name","rule"],"properties":{"name":{"type":"string","minLength":1,"maxLength":256},"rule":{"type":"string","minLength":1,"maxLength":12000}}}},"client_request_id":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$","description":"调用方生成的幂等请求标识；相同调用方重试时保持不变。"}}},"example":{"documents":[],"requirement":"先核验金额，再根据金额核验审批权限。","categories":[{"code":"invoice","name":"发票","description":"发票类文件","indicators":[{"name":"价税合计","type":"number","description":"发票价税合计金额"}]}],"current_rules":[],"client_request_id":"swagger-rule-graph-001"}}}}}},"/open/v1/audit":{"post":{"tags":["4. 文档异步任务"],"summary":"依次执行文档分类、按类别抽取指标和按拓扑审核","description":"该接口采用异步处理。成功提交返回 HTTP 202，响应体 `data.job_id` 和响应头 `Location` 指向任务。随后通过 `getJob` 查询进度；状态为 `succeeded` 后，通过 `getJobResult` 获取最终结果。","operationId":"createAudit","responses":{"202":{"description":"任务已受理；请使用 job_id 查询进度和结果","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"required":["job_id","operation","status","phase","progress","progress_detail","sequence","attempt","poll_after_ms","result_ref","error","created_at","updated_at","finished_at"],"properties":{"job_id":{"type":"string","minLength":32,"maxLength":32,"pattern":"^[a-f0-9]{32}$","description":"异步任务唯一 ID；刷新页面或跨请求查询时保持不变。"},"operation":{"type":"string","description":"任务类型；当前主要为 upload、parse 或 extract。"},"status":{"type":"string","description":"queued=排队中，running=处理中，succeeded=已完成，failed/cancelled/unknown=终态异常。","enum":["queued","running","succeeded","failed","cancelled","unknown"]},"phase":{"type":["string","null"],"description":"当前处理阶段；服务未提供细分阶段时为 null。"},"progress":{"type":["integer","null"],"minimum":0,"maximum":100,"description":"0 到 100 的处理进度；无法计算时为 null。"},"progress_detail":{"oneOf":[{"type":"object","additionalProperties":false,"required":["unit","current","total"],"properties":{"unit":{"type":"string","enum":["bytes","documents","items","pages"]},"current":{"type":"integer","minimum":0},"total":{"type":"integer","minimum":1}}},{"type":"null"}],"description":"可核验的真实进度分子、分母；无法度量时为 null。"},"sequence":{"type":"integer","minimum":0,"description":"状态事件单调序号；客户端用它丢弃乱序轮询结果。"},"attempt":{"type":"integer","minimum":0,"description":"worker 执行尝试次数；上传直接执行时固定为 1。"},"poll_after_ms":{"type":"integer","minimum":100,"description":"服务端建议的下次轮询间隔。"},"result_ref":{"type":["string","null"],"description":"任务成功后的结果引用，通常为 /open/v1/job/{job_id}/result。"},"owner_ref":{"type":"string","maxLength":128,"description":"上传任务创建时固化的业务归属；非上传任务通常不返回。"},"error":{"oneOf":[{"type":"object","additionalProperties":false,"required":["code","message","retryable"],"properties":{"code":{"type":"string","enum":["conversion_failed","embedding_access_denied","embedding_output_invalid","embedding_unavailable","feature_disabled","forbidden","index_config_conflict","index_incomplete","input_invalid","input_too_large","internal_error","method_not_allowed","model_access_denied","model_output_invalid","model_unavailable","not_acceptable","not_found","payload_too_large","precondition_failed","precondition_required","processor_budget","processor_failed","processor_invalid_response","processor_rejected","processor_timeout","processor_unauthorized","processor_unavailable","queue_capacity_exceeded","rate_limited","resource_conflict","resource_not_found","semantic_unavailable","service_unavailable","source_ambiguous","source_changed","source_invalid","source_unavailable","source_writeback_unavailable","unauthorized","unsupported_media_type","upstream_rejected","upstream_timeout","upstream_unavailable"]},"message":{"type":"string","minLength":1},"retryable":{"type":"boolean"}}},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"finished_at":{"type":["string","null"],"format":"date-time"},"document_parse_diagnostics_v1":{"type":"object","additionalProperties":false,"required":["schema_version","requested_provider","requested_mode","result_source","pipeline_stage","worker_attempt_count","fallback_occurred","isolation_used","attempts","attempts_truncated","warnings"],"properties":{"schema_version":{"const":"document_parse_diagnostics_v1"},"requested_provider":{"type":"string","enum":["auto","docparse","tencent","local","mineru"],"default":"auto","description":"解析 Provider 策略。auto 按服务端启用列表和顺序执行；MinerU 默认禁用；指定 Provider 时严格执行该 Provider，不静默切换。"},"requested_mode":{"type":"string","enum":["standard","high_accuracy","structure_preserving"]},"result_source":{"type":"string","enum":["fresh","reused"]},"pipeline_stage":{"type":"string","enum":["completed","failed"]},"worker_attempt_count":{"type":"integer","minimum":1},"fallback_occurred":{"type":"boolean"},"isolation_used":{"type":"boolean"},"attempts":{"type":"array","maxItems":32,"items":{"type":"object","additionalProperties":false,"required":["provider","status","scope"],"properties":{"provider":{"type":"string","enum":["docparse","tencent","local","mineru","unknown"]},"status":{"type":"string","enum":["succeeded","failed","unknown"]},"scope":{"type":"string","enum":["group","page","isolation","unknown"]},"page_count":{"type":"integer","minimum":0},"duration_ms":{"type":"integer","minimum":0},"safe_error_code":{"type":"string","maxLength":64},"retryable":{"type":"boolean"},"fallback_allowed":{"type":"boolean"}}}},"attempts_truncated":{"type":"boolean"},"page_summary":{"type":"object","additionalProperties":false,"required":["total","ready","degraded","by_provider"],"properties":{"total":{"type":"integer","minimum":0},"ready":{"type":"integer","minimum":0},"degraded":{"type":"integer","minimum":0},"by_provider":{"type":"object","additionalProperties":false,"required":[],"properties":{"docparse":{"type":"integer","minimum":0},"tencent":{"type":"integer","minimum":0},"local":{"type":"integer","minimum":0}}}}},"warnings":{"type":"object","additionalProperties":false,"required":["count","codes"],"properties":{"count":{"type":"integer","minimum":0},"codes":{"type":"array","maxItems":32,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":64}}}},"source_format":{"type":"string","minLength":1,"maxLength":32},"canonicalized":{"type":"boolean"},"content_version":{"type":"string","minLength":1,"maxLength":128},"failure_stage":{"type":"string","enum":["precondition","source_read","convert","split","provider_parse","persist","unknown"]}}}}},"error":{"type":"null"}}}]}}},"headers":{"Location":{"description":"任务状态查询地址","schema":{"type":"string","example":"/open/v1/job/0123456789abcdef0123456789abcdef"}}},"links":{"查询任务进度":{"operationId":"getJob","parameters":{"job_id":"$response.body#/data/job_id"},"description":"使用本次返回的 job_id 查询任务进度。"},"读取任务结果":{"operationId":"getJobResult","parameters":{"job_id":"$response.body#/data/job_id"},"description":"任务 succeeded 后读取结构化结果。"}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"409":{"description":"幂等键、任务状态或资源状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"413":{"description":"请求体过大","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"415":{"description":"请求媒体类型不支持","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"429":{"description":"队列或模型并发额度已满，请稍后重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"500":{"description":"服务内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"502":{"description":"上游服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"504":{"description":"上游服务超时","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"checkAudit","x-stability":"stable","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["documents","categories","audit_graph","client_request_id"],"properties":{"documents":{"type":"array","minItems":1,"maxItems":50,"uniqueItems":true,"items":{"type":"integer","minimum":1}},"categories":{"type":"array","minItems":1,"maxItems":50,"items":{"type":"object","additionalProperties":false,"required":["code","name","indicators"],"properties":{"code":{"type":"string","minLength":1,"maxLength":128},"name":{"type":"string","minLength":1,"maxLength":256},"description":{"type":"string","maxLength":2000},"indicators":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","additionalProperties":false,"required":["name","type","description"],"properties":{"name":{"type":"string","minLength":1,"maxLength":256},"type":{"type":"string","enum":["text","number","span","section","list","entity","obj_list"]},"description":{"type":"string","minLength":1,"maxLength":2000},"attrs":{"type":"array","minItems":1,"items":{"type":"object","additionalProperties":false,"required":["name","type","description"],"properties":{"name":{"type":"string","minLength":1,"maxLength":256},"type":{"type":"string","enum":["text","number","span","section","list","entity","obj_list"]},"description":{"type":"string","minLength":1,"maxLength":2000}}}},"retrieval_context":{"type":["object","null"],"additionalProperties":false,"required":["scope"],"properties":{"scope":{"type":"string","enum":["document","sections"]},"section_hints":{"type":"array","minItems":1,"maxItems":20,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":128}},"similar_text":{"type":["string","null"],"maxLength":4000}}}}}}}}},"audit_graph":{"type":"object","additionalProperties":false,"required":["nodes","adjacency"],"properties":{"nodes":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","additionalProperties":false,"required":["id","name","rule","type","comment_required","category_codes","indicator_names"],"properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z][A-Za-z0-9_.:-]{0,63}$"},"name":{"type":"string","minLength":1,"maxLength":256},"rule":{"type":"string","minLength":1,"maxLength":12000},"type":{"type":"integer","minimum":1,"maximum":4},"comment_required":{"type":"boolean"},"category_codes":{"type":"array","minItems":1,"maxItems":50,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":128}},"indicator_names":{"type":"array","minItems":0,"maxItems":100,"uniqueItems":true,"description":"节点消费的指标名称；必须来自请求提供的指标闭集，且在每个适用类别里都存在。空数组表示适用类别的全部指标（跨类别规则各类别指标集不同时用这个）。","items":{"type":"string","minLength":1,"maxLength":256}},"predicate":{"type":"object","description":"判定式（可选）：规则编译成的封闭 JSON 表达式，给出时该节点由代码确定性执行、不调模型，结论为 pass / fail / insufficient（引用字段缺失即证据不足）。语法：op 为 and/or/not、forall/exists（var、category、可选 where、assert）、eq/ne/contains/in/gt/ge/lt/le（left、right、mode 为 text/number/date）、present（arg）；取值为 {doc, field}、{business: 路径，列表用 标的物[].出厂编号}、{const}。只能引用请求里的类别与该类别的指标。"}}}},"adjacency":{"type":"object","description":"邻接表：键为前置节点 ID，值为其直接后继节点 ID 列表。","additionalProperties":{"type":"array","uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":64}}}}},"business_context":{"type":"object","maxProperties":200,"description":"业务申请信息（可选）：调用方业务系统里与本次审核相关的申请数据，如客户名称、经销商名称与信用代码、标的物清单。原样作为「业务申请信息」进入每个规则节点的关键信息，供引用业务字段的规则比对；不参与分类与抽取。"},"result_format":{"type":"string","enum":["legacy","evidence_v1"],"default":"legacy","description":"evidence_v1 为每个指标保留全部证据、内容版本与已校准坐标。"},"async":{"type":"boolean","default":true,"description":"是否走异步 Job 执行（默认 true）；显式传 false 时回退为单次同步执行"},"client_request_id":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$","description":"调用方生成的幂等请求标识；相同调用方重试时保持不变。"}}},"example":{"documents":[1001],"categories":[{"code":"invoice","name":"发票","description":"发票类文件","indicators":[{"name":"价税合计","type":"number","description":"发票价税合计金额"}]}],"audit_graph":{"nodes":[{"id":"amount_check","name":"金额检查","rule":"价税合计必须大于零。","type":1,"comment_required":true,"category_codes":["invoice"],"indicator_names":["价税合计"]}],"adjacency":{"amount_check":[]}},"client_request_id":"swagger-audit-001"}}}}}},"/open/v1/audit-rules:compile":{"post":{"tags":["4. 文档异步任务"],"summary":"把审核规则原文编译成判定式,供 createAudit 由代码确定性执行","description":"该接口采用异步处理。成功提交返回 HTTP 202，响应体 `data.job_id` 和响应头 `Location` 指向任务。随后通过 `getJob` 查询进度；状态为 `succeeded` 后，通过 `getJobResult` 获取最终结果。 每条规则返回 status:compiled(附 predicate 与代码生成的中文读法 predicate_text)、semantic(需要语义判断,应继续由模型判定,附原因)或 error(本条编译调用失败,可重试)。编译结果按规则原文、类别与指标清单、业务字段清单缓存,同一条规则永远拿到同一个判定式。","operationId":"compileAuditRulePredicates","responses":{"202":{"description":"任务已受理；请使用 job_id 查询进度和结果","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"required":["job_id","operation","status","phase","progress","progress_detail","sequence","attempt","poll_after_ms","result_ref","error","created_at","updated_at","finished_at"],"properties":{"job_id":{"type":"string","minLength":32,"maxLength":32,"pattern":"^[a-f0-9]{32}$","description":"异步任务唯一 ID；刷新页面或跨请求查询时保持不变。"},"operation":{"type":"string","description":"任务类型；当前主要为 upload、parse 或 extract。"},"status":{"type":"string","description":"queued=排队中，running=处理中，succeeded=已完成，failed/cancelled/unknown=终态异常。","enum":["queued","running","succeeded","failed","cancelled","unknown"]},"phase":{"type":["string","null"],"description":"当前处理阶段；服务未提供细分阶段时为 null。"},"progress":{"type":["integer","null"],"minimum":0,"maximum":100,"description":"0 到 100 的处理进度；无法计算时为 null。"},"progress_detail":{"oneOf":[{"type":"object","additionalProperties":false,"required":["unit","current","total"],"properties":{"unit":{"type":"string","enum":["bytes","documents","items","pages"]},"current":{"type":"integer","minimum":0},"total":{"type":"integer","minimum":1}}},{"type":"null"}],"description":"可核验的真实进度分子、分母；无法度量时为 null。"},"sequence":{"type":"integer","minimum":0,"description":"状态事件单调序号；客户端用它丢弃乱序轮询结果。"},"attempt":{"type":"integer","minimum":0,"description":"worker 执行尝试次数；上传直接执行时固定为 1。"},"poll_after_ms":{"type":"integer","minimum":100,"description":"服务端建议的下次轮询间隔。"},"result_ref":{"type":["string","null"],"description":"任务成功后的结果引用，通常为 /open/v1/job/{job_id}/result。"},"owner_ref":{"type":"string","maxLength":128,"description":"上传任务创建时固化的业务归属；非上传任务通常不返回。"},"error":{"oneOf":[{"type":"object","additionalProperties":false,"required":["code","message","retryable"],"properties":{"code":{"type":"string","enum":["conversion_failed","embedding_access_denied","embedding_output_invalid","embedding_unavailable","feature_disabled","forbidden","index_config_conflict","index_incomplete","input_invalid","input_too_large","internal_error","method_not_allowed","model_access_denied","model_output_invalid","model_unavailable","not_acceptable","not_found","payload_too_large","precondition_failed","precondition_required","processor_budget","processor_failed","processor_invalid_response","processor_rejected","processor_timeout","processor_unauthorized","processor_unavailable","queue_capacity_exceeded","rate_limited","resource_conflict","resource_not_found","semantic_unavailable","service_unavailable","source_ambiguous","source_changed","source_invalid","source_unavailable","source_writeback_unavailable","unauthorized","unsupported_media_type","upstream_rejected","upstream_timeout","upstream_unavailable"]},"message":{"type":"string","minLength":1},"retryable":{"type":"boolean"}}},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"finished_at":{"type":["string","null"],"format":"date-time"},"document_parse_diagnostics_v1":{"type":"object","additionalProperties":false,"required":["schema_version","requested_provider","requested_mode","result_source","pipeline_stage","worker_attempt_count","fallback_occurred","isolation_used","attempts","attempts_truncated","warnings"],"properties":{"schema_version":{"const":"document_parse_diagnostics_v1"},"requested_provider":{"type":"string","enum":["auto","docparse","tencent","local","mineru"],"default":"auto","description":"解析 Provider 策略。auto 按服务端启用列表和顺序执行；MinerU 默认禁用；指定 Provider 时严格执行该 Provider，不静默切换。"},"requested_mode":{"type":"string","enum":["standard","high_accuracy","structure_preserving"]},"result_source":{"type":"string","enum":["fresh","reused"]},"pipeline_stage":{"type":"string","enum":["completed","failed"]},"worker_attempt_count":{"type":"integer","minimum":1},"fallback_occurred":{"type":"boolean"},"isolation_used":{"type":"boolean"},"attempts":{"type":"array","maxItems":32,"items":{"type":"object","additionalProperties":false,"required":["provider","status","scope"],"properties":{"provider":{"type":"string","enum":["docparse","tencent","local","mineru","unknown"]},"status":{"type":"string","enum":["succeeded","failed","unknown"]},"scope":{"type":"string","enum":["group","page","isolation","unknown"]},"page_count":{"type":"integer","minimum":0},"duration_ms":{"type":"integer","minimum":0},"safe_error_code":{"type":"string","maxLength":64},"retryable":{"type":"boolean"},"fallback_allowed":{"type":"boolean"}}}},"attempts_truncated":{"type":"boolean"},"page_summary":{"type":"object","additionalProperties":false,"required":["total","ready","degraded","by_provider"],"properties":{"total":{"type":"integer","minimum":0},"ready":{"type":"integer","minimum":0},"degraded":{"type":"integer","minimum":0},"by_provider":{"type":"object","additionalProperties":false,"required":[],"properties":{"docparse":{"type":"integer","minimum":0},"tencent":{"type":"integer","minimum":0},"local":{"type":"integer","minimum":0}}}}},"warnings":{"type":"object","additionalProperties":false,"required":["count","codes"],"properties":{"count":{"type":"integer","minimum":0},"codes":{"type":"array","maxItems":32,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":64}}}},"source_format":{"type":"string","minLength":1,"maxLength":32},"canonicalized":{"type":"boolean"},"content_version":{"type":"string","minLength":1,"maxLength":128},"failure_stage":{"type":"string","enum":["precondition","source_read","convert","split","provider_parse","persist","unknown"]}}}}},"error":{"type":"null"}}}]}}},"headers":{"Location":{"description":"任务状态查询地址","schema":{"type":"string","example":"/open/v1/job/0123456789abcdef0123456789abcdef"}}},"links":{"查询任务进度":{"operationId":"getJob","parameters":{"job_id":"$response.body#/data/job_id"},"description":"使用本次返回的 job_id 查询任务进度。"},"读取任务结果":{"operationId":"getJobResult","parameters":{"job_id":"$response.body#/data/job_id"},"description":"任务 succeeded 后读取结构化结果。"}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"409":{"description":"幂等键、任务状态或资源状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"413":{"description":"请求体过大","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"415":{"description":"请求媒体类型不支持","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"429":{"description":"队列或模型并发额度已满，请稍后重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"500":{"description":"服务内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"502":{"description":"上游服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"504":{"description":"上游服务超时","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"checkAudit","x-stability":"preview","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["categories","rules","client_request_id"],"properties":{"categories":{"type":"array","minItems":1,"maxItems":50,"items":{"type":"object","additionalProperties":false,"required":["code","name","indicators"],"properties":{"code":{"type":"string","minLength":1,"maxLength":128},"name":{"type":"string","minLength":1,"maxLength":256},"description":{"type":"string","maxLength":2000},"indicators":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","additionalProperties":false,"required":["name","type","description"],"properties":{"name":{"type":"string","minLength":1,"maxLength":256},"type":{"type":"string","enum":["text","number","span","section","list","entity","obj_list"]},"description":{"type":"string","minLength":1,"maxLength":2000},"attrs":{"type":"array","minItems":1,"items":{"type":"object","additionalProperties":false,"required":["name","type","description"],"properties":{"name":{"type":"string","minLength":1,"maxLength":256},"type":{"type":"string","enum":["text","number","span","section","list","entity","obj_list"]},"description":{"type":"string","minLength":1,"maxLength":2000}}}},"retrieval_context":{"type":["object","null"],"additionalProperties":false,"required":["scope"],"properties":{"scope":{"type":"string","enum":["document","sections"]},"section_hints":{"type":"array","minItems":1,"maxItems":20,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":128}},"similar_text":{"type":["string","null"],"maxLength":4000}}}}}}}}},"rules":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","additionalProperties":false,"required":["id","rule"],"properties":{"id":{"type":"string","minLength":1,"maxLength":64},"name":{"type":"string","maxLength":256},"rule":{"type":"string","minLength":1,"maxLength":12000}}}},"business_fields":{"type":"array","maxItems":200,"description":"业务申请信息里可引用的字段名;列表内字段写成 标的物[].出厂编号。","items":{"type":"string","minLength":1,"maxLength":256}},"client_request_id":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$","description":"调用方生成的幂等请求标识；相同调用方重试时保持不变。"}}}}}}}},"/open/v1/jobs":{"get":{"tags":["5. 任务进度与结果"],"summary":"列出指定动态知识库的任务","description":"首期仅发现当前Principal、Space及指定动态知识库中的任务，不聚合宿主任务数据库。先核当前库与来源权限再分页；游标为本身份本库的任务锚点，不授予权限。受扫描预算影响可返回短页及next_cursor，请继续翻页；不返回问题正文、文件名或结果。状态和结果继续使用getJob/getJobResult，刷新列表不重新执行任务。\n\n**动态知识库关联边界**\n\n共享任务发现入口GET /open/v1/jobs，knowledge_base_id必填，要求dkRead；仅列当前Principal、Space及指定库内仍可读取的动态任务，不聚合宿主任务。limit默认20、最大100；按next_cursor翻页，授权过滤及扫描预算可能产生短页，不以items为空判断结束。游标只在当前身份与库内有效。只返回操作、状态、阶段、进度和真实时间，不返回问题、文件名或结果；权限依赖异常503不能当作无任务。列表不重新执行任务，具体状态和结果仍通过getJob/getJobResult复核。\n\n完整说明：/swagger-ui/open-v1/docs/dynamic-knowledge","operationId":"listJobs","responses":{"200":{"description":"请求已成功处理","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"required":["items","next_cursor"],"properties":{"items":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["job_id","operation","status","phase","progress","created_at","updated_at","finished_at"],"properties":{"job_id":{"type":"string","minLength":32,"maxLength":32,"pattern":"^[a-f0-9]{32}$","description":"异步任务唯一 ID；刷新页面或跨请求查询时保持不变。"},"operation":{"type":"string","description":"任务类型；当前主要为 upload、parse 或 extract。"},"status":{"type":"string","description":"queued=排队中，running=处理中，succeeded=已完成，failed/cancelled/unknown=终态异常。","enum":["queued","running","succeeded","failed","cancelled","unknown"]},"phase":{"type":["string","null"],"description":"当前处理阶段；服务未提供细分阶段时为 null。"},"progress":{"type":["integer","null"],"minimum":0,"maximum":100,"description":"0 到 100 的处理进度；无法计算时为 null。"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"finished_at":{"type":["string","null"],"format":"date-time"}}}},"next_cursor":{"type":["string","null"]}}},"error":{"type":"null"}}}]}}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"429":{"description":"队列或模型并发额度已满，请稍后重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"dkRead","x-stability":"preview","parameters":[{"name":"knowledge_base_id","in":"query","required":true,"schema":{"type":"string","minLength":1}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","pattern":"^[a-f0-9]{32}$"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":20}}]}},"/open/v1/documents/directories/{directory_id}/entries":{"get":{"tags":["2. 文档准备"],"summary":"列出目录内容","operationId":"listDocumentDirectoryEntries","responses":{"200":{"description":"请求已成功处理","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"required":["directory_id","items"],"properties":{"directory_id":{"type":"integer","minimum":1},"items":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["directory_id","name","parent_id","owner_ref","kind","doc_id","created_at"],"properties":{"directory_id":{"type":"integer","minimum":1},"name":{"type":["string","null"],"maxLength":255},"parent_id":{"type":["integer","null"],"minimum":1},"owner_ref":{"type":["string","null"],"maxLength":128},"kind":{"type":"string","enum":["directory","document"]},"doc_id":{"type":["integer","null"],"minimum":1},"created_at":{"type":["string","null"],"format":"date-time"},"document":{"type":"object","additionalProperties":false,"required":["doc_id","name","extension","size","sha256","owner_ref","total_pages","doc_type","created_at","directory_id"],"properties":{"doc_id":{"type":"integer","minimum":1},"name":{"type":"string","minLength":1,"maxLength":255},"extension":{"type":["string","null"],"maxLength":32},"size":{"type":["integer","null"],"minimum":0},"sha256":{"type":["string","null"],"pattern":"^[0-9a-f]{64}$"},"owner_ref":{"type":["string","null"],"maxLength":128},"total_pages":{"type":"integer","minimum":0},"doc_type":{"type":["string","null"],"maxLength":32,"description":"单证形态类型(平台封闭枚举,如 vat_invoice/id_card;null=未判定,按 general 处理)。"},"created_at":{"type":["string","null"],"format":"date-time"},"directory_id":{"type":["integer","null"],"minimum":1},"busi_id":{"type":["string","null"],"maxLength":128,"description":"外部渠道业务标识（可选，P0-3 恢复按 busi_id 查询链路）。"}}}}}}}},"error":{"type":"null"}}}]}}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"500":{"description":"服务内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"502":{"description":"上游服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"504":{"description":"上游服务超时","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"document.read","x-stability":"preview","parameters":[{"name":"directory_id","in":"path","required":true,"schema":{"type":"integer","minimum":1}}]}},"/open/v1/document-uploads/{job_id}/content":{"put":{"tags":["2. 文档准备"],"summary":"向已创建的上传任务写入原始文件内容","description":"直接流式接收文件，不排队。文件长度和可选 SHA-256 必须与创建任务时声明一致；请求处理期间 `getJob` 会展示 receiving/persisting 阶段及真实 bytes 进度，完成后通过 `getJobResult` 读取 doc_id。","operationId":"putDocumentUploadContent","responses":{"200":{"description":"文件已接收并持久化；请读取任务结果中的 doc_id","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"required":["job_id","operation","status","phase","progress","progress_detail","sequence","attempt","poll_after_ms","result_ref","error","created_at","updated_at","finished_at"],"properties":{"job_id":{"type":"string","minLength":32,"maxLength":32,"pattern":"^[a-f0-9]{32}$","description":"异步任务唯一 ID；刷新页面或跨请求查询时保持不变。"},"operation":{"type":"string","description":"任务类型；当前主要为 upload、parse 或 extract。"},"status":{"type":"string","description":"queued=排队中，running=处理中，succeeded=已完成，failed/cancelled/unknown=终态异常。","enum":["queued","running","succeeded","failed","cancelled","unknown"]},"phase":{"type":["string","null"],"description":"当前处理阶段；服务未提供细分阶段时为 null。"},"progress":{"type":["integer","null"],"minimum":0,"maximum":100,"description":"0 到 100 的处理进度；无法计算时为 null。"},"progress_detail":{"oneOf":[{"type":"object","additionalProperties":false,"required":["unit","current","total"],"properties":{"unit":{"type":"string","enum":["bytes","documents","items","pages"]},"current":{"type":"integer","minimum":0},"total":{"type":"integer","minimum":1}}},{"type":"null"}],"description":"可核验的真实进度分子、分母；无法度量时为 null。"},"sequence":{"type":"integer","minimum":0,"description":"状态事件单调序号；客户端用它丢弃乱序轮询结果。"},"attempt":{"type":"integer","minimum":0,"description":"worker 执行尝试次数；上传直接执行时固定为 1。"},"poll_after_ms":{"type":"integer","minimum":100,"description":"服务端建议的下次轮询间隔。"},"result_ref":{"type":["string","null"],"description":"任务成功后的结果引用，通常为 /open/v1/job/{job_id}/result。"},"owner_ref":{"type":"string","maxLength":128,"description":"上传任务创建时固化的业务归属；非上传任务通常不返回。"},"error":{"oneOf":[{"type":"object","additionalProperties":false,"required":["code","message","retryable"],"properties":{"code":{"type":"string","enum":["conversion_failed","embedding_access_denied","embedding_output_invalid","embedding_unavailable","feature_disabled","forbidden","index_config_conflict","index_incomplete","input_invalid","input_too_large","internal_error","method_not_allowed","model_access_denied","model_output_invalid","model_unavailable","not_acceptable","not_found","payload_too_large","precondition_failed","precondition_required","processor_budget","processor_failed","processor_invalid_response","processor_rejected","processor_timeout","processor_unauthorized","processor_unavailable","queue_capacity_exceeded","rate_limited","resource_conflict","resource_not_found","semantic_unavailable","service_unavailable","source_ambiguous","source_changed","source_invalid","source_unavailable","source_writeback_unavailable","unauthorized","unsupported_media_type","upstream_rejected","upstream_timeout","upstream_unavailable"]},"message":{"type":"string","minLength":1},"retryable":{"type":"boolean"}}},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"finished_at":{"type":["string","null"],"format":"date-time"},"document_parse_diagnostics_v1":{"type":"object","additionalProperties":false,"required":["schema_version","requested_provider","requested_mode","result_source","pipeline_stage","worker_attempt_count","fallback_occurred","isolation_used","attempts","attempts_truncated","warnings"],"properties":{"schema_version":{"const":"document_parse_diagnostics_v1"},"requested_provider":{"type":"string","enum":["auto","docparse","tencent","local","mineru"],"default":"auto","description":"解析 Provider 策略。auto 按服务端启用列表和顺序执行；MinerU 默认禁用；指定 Provider 时严格执行该 Provider，不静默切换。"},"requested_mode":{"type":"string","enum":["standard","high_accuracy","structure_preserving"]},"result_source":{"type":"string","enum":["fresh","reused"]},"pipeline_stage":{"type":"string","enum":["completed","failed"]},"worker_attempt_count":{"type":"integer","minimum":1},"fallback_occurred":{"type":"boolean"},"isolation_used":{"type":"boolean"},"attempts":{"type":"array","maxItems":32,"items":{"type":"object","additionalProperties":false,"required":["provider","status","scope"],"properties":{"provider":{"type":"string","enum":["docparse","tencent","local","mineru","unknown"]},"status":{"type":"string","enum":["succeeded","failed","unknown"]},"scope":{"type":"string","enum":["group","page","isolation","unknown"]},"page_count":{"type":"integer","minimum":0},"duration_ms":{"type":"integer","minimum":0},"safe_error_code":{"type":"string","maxLength":64},"retryable":{"type":"boolean"},"fallback_allowed":{"type":"boolean"}}}},"attempts_truncated":{"type":"boolean"},"page_summary":{"type":"object","additionalProperties":false,"required":["total","ready","degraded","by_provider"],"properties":{"total":{"type":"integer","minimum":0},"ready":{"type":"integer","minimum":0},"degraded":{"type":"integer","minimum":0},"by_provider":{"type":"object","additionalProperties":false,"required":[],"properties":{"docparse":{"type":"integer","minimum":0},"tencent":{"type":"integer","minimum":0},"local":{"type":"integer","minimum":0}}}}},"warnings":{"type":"object","additionalProperties":false,"required":["count","codes"],"properties":{"count":{"type":"integer","minimum":0},"codes":{"type":"array","maxItems":32,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":64}}}},"source_format":{"type":"string","minLength":1,"maxLength":32},"canonicalized":{"type":"boolean"},"content_version":{"type":"string","minLength":1,"maxLength":128},"failure_stage":{"type":"string","enum":["precondition","source_read","convert","split","provider_parse","persist","unknown"]}}}}},"error":{"type":"null"}}}]}}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"409":{"description":"幂等键、任务状态或资源状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"413":{"description":"请求体过大","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"415":{"description":"请求媒体类型不支持","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"429":{"description":"队列或模型并发额度已满，请稍后重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"500":{"description":"服务内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"502":{"description":"上游服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"504":{"description":"上游服务超时","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"document.write","x-stability":"stable","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","minLength":32,"maxLength":32,"pattern":"^[a-f0-9]{32}$"}}],"requestBody":{"required":true,"content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}}}},"/open/v1/documents/{doc_id}/content":{"get":{"tags":["2. 文档准备"],"summary":"读取解析正文","description":"外部原件版本或哈希变化返回409，不能用覆盖后的新内容冒充旧原件。","operationId":"getDocumentContent","responses":{"200":{"description":"请求已成功处理","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"required":["doc_id","text","page_count"],"properties":{"doc_id":{"type":"integer","minimum":1},"text":{"type":"string"},"page_count":{"type":"integer","minimum":0}}},"error":{"type":"null"}}}]}}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"409":{"description":"幂等键、任务状态或资源状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"500":{"description":"服务内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"502":{"description":"上游服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"504":{"description":"上游服务超时","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"document.read","x-stability":"stable","parameters":[{"name":"doc_id","in":"path","required":true,"schema":{"type":"integer","minimum":1}},{"name":"text_mode","in":"query","required":false,"schema":{"type":"string","enum":["parsed","source_preferred"],"default":"parsed","description":"正文投影方式；source_preferred 优先直接读取原文件文字层，无法直读时回退已完成的页级解析正文。"}},{"name":"max_chars","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":20000,"description":"可选的正文最大字符数。"}}]}},"/open/v1/documents/{doc_id}/original":{"get":{"tags":["2. 文档准备"],"summary":"流式读取文档原件","description":"外部原件版本或哈希变化返回409，不能用覆盖后的新内容冒充旧原件。","operationId":"getDocumentOriginal","responses":{"200":{"description":"文档二进制资源读取成功","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"409":{"description":"幂等键、任务状态或资源状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"500":{"description":"服务内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"502":{"description":"上游服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"504":{"description":"上游服务超时","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"document.read","x-stability":"stable","parameters":[{"name":"doc_id","in":"path","required":true,"schema":{"type":"integer","minimum":1}}]}},"/open/v1/documents/{doc_id}/pages":{"get":{"tags":["2. 文档准备"],"summary":"列出文档页","operationId":"listDocumentPages","responses":{"200":{"description":"请求已成功处理","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"required":["doc_id","items"],"properties":{"doc_id":{"type":"integer","minimum":1},"items":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["page_id","page_no","status","direction"],"properties":{"page_id":{"type":"integer","minimum":1},"page_no":{"type":"integer","minimum":1},"status":{"type":"string","enum":["pending","ready","failed"]},"direction":{"type":"integer","enum":[0,90,180,270]}}}}}},"error":{"type":"null"}}}]}}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"500":{"description":"服务内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"502":{"description":"上游服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"504":{"description":"上游服务超时","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"document.read","x-stability":"stable","parameters":[{"name":"doc_id","in":"path","required":true,"schema":{"type":"integer","minimum":1}}]}},"/open/v1/documents/{doc_id}/page-geometries":{"get":{"tags":["2. 文档准备"],"summary":"批量读取文档页坐标映射","operationId":"getDocumentPageGeometries","responses":{"200":{"description":"请求已成功处理","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"required":["doc_id","content_version","items"],"properties":{"doc_id":{"type":"integer","minimum":1},"content_version":{"type":"string","minLength":1,"maxLength":128},"items":{"type":"array","items":{"oneOf":[{"type":"object","additionalProperties":false,"required":["schema_version","content_version","page_id","page_no","source","canonical","preview","canonical_asset","canonical_asset_href","status","source_to_canonical","canonical_to_preview","reason"],"properties":{"schema_version":{"const":"page_geometry_v2"},"content_version":{"type":"string","minLength":1,"maxLength":128},"page_id":{"type":"integer","minimum":1},"page_no":{"type":"integer","minimum":1},"source":{"type":"object","additionalProperties":false,"required":["space_id","width","height","origin","unit"],"properties":{"space_id":{"const":"docparse_canvas"},"width":{"type":"number","exclusiveMinimum":0},"height":{"type":"number","exclusiveMinimum":0},"origin":{"const":"top_left"},"unit":{"const":"pixel"}}},"canonical":{"type":"object","additionalProperties":false,"required":["space_id","width","height","origin","unit"],"properties":{"space_id":{"const":"canonical_pdf_points"},"width":{"type":"number","exclusiveMinimum":0},"height":{"type":"number","exclusiveMinimum":0},"origin":{"const":"top_left"},"unit":{"const":"point"}}},"preview":{"type":"object","additionalProperties":false,"required":["space_id","width","height","origin","unit"],"properties":{"space_id":{"const":"preview_pixels"},"width":{"type":"number","exclusiveMinimum":0},"height":{"type":"number","exclusiveMinimum":0},"origin":{"const":"top_left"},"unit":{"const":"pixel"}}},"canonical_asset":{"const":"pdf"},"canonical_asset_href":{"type":"string","pattern":"^/open/v1/document-pages/[1-9][0-9]*/assets/pdf$"},"status":{"type":"string","enum":["ready","unavailable"]},"source_to_canonical":{"type":["array","null"],"minItems":6,"maxItems":6,"items":{"type":"number"}},"canonical_to_preview":{"type":["array","null"],"minItems":6,"maxItems":6,"items":{"type":"number"}},"reason":{"type":["string","null"],"maxLength":128}}},{"type":"object","additionalProperties":false,"required":["schema_version","provider_id","content_version","page_id","page_no","source","canonical","preview","canonical_asset","canonical_asset_href","status","source_to_canonical","canonical_to_preview","reason"],"properties":{"schema_version":{"const":"page_geometry_v3"},"provider_id":{"type":"string","enum":["docparse","tencent","local","mineru"]},"content_version":{"type":"string","minLength":1,"maxLength":128},"page_id":{"type":"integer","minimum":1},"page_no":{"type":"integer","minimum":1},"source":{"type":"object","additionalProperties":false,"required":["space_id","width","height","origin","unit"],"properties":{"space_id":{"type":"string","pattern":"^provider:(docparse|tencent|local|mineru):canvas$"},"width":{"type":"number","exclusiveMinimum":0},"height":{"type":"number","exclusiveMinimum":0},"origin":{"const":"top_left"},"unit":{"type":"string","enum":["pixel","point"]}}},"canonical":{"type":"object","additionalProperties":false,"required":["space_id","width","height","origin","unit"],"properties":{"space_id":{"const":"canonical_pdf_points"},"width":{"type":"number","exclusiveMinimum":0},"height":{"type":"number","exclusiveMinimum":0},"origin":{"const":"top_left"},"unit":{"const":"point"}}},"preview":{"type":"object","additionalProperties":false,"required":["space_id","width","height","origin","unit"],"properties":{"space_id":{"const":"preview_pixels"},"width":{"type":"number","exclusiveMinimum":0},"height":{"type":"number","exclusiveMinimum":0},"origin":{"const":"top_left"},"unit":{"const":"pixel"}}},"canonical_asset":{"const":"pdf"},"canonical_asset_href":{"type":"string","pattern":"^/open/v1/document-pages/[1-9][0-9]*/assets/pdf$"},"status":{"type":"string","enum":["ready","unavailable"]},"source_to_canonical":{"type":["array","null"],"minItems":6,"maxItems":6,"items":{"type":"number"}},"canonical_to_preview":{"type":["array","null"],"minItems":6,"maxItems":6,"items":{"type":"number"}},"reason":{"type":["string","null"],"maxLength":128}}}]}}}},"error":{"type":"null"}}}]}}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"500":{"description":"服务内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"502":{"description":"上游服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"504":{"description":"上游服务超时","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"document.read","x-stability":"stable","parameters":[{"name":"doc_id","in":"path","required":true,"schema":{"type":"integer","minimum":1}},{"name":"content_version","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":128,"description":"文档内容版本乐观锁；一次返回该版本全部页矩阵。"}}]}},"/open/v1/documents/{doc_id}/parse-result":{"post":{"tags":["2. 文档准备"],"summary":"整体替换文档解析产物","operationId":"replaceDocumentParseResult","responses":{"200":{"description":"请求已成功处理","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"required":["doc_id","page_count","status"],"properties":{"doc_id":{"type":"integer","minimum":1},"page_count":{"type":"integer","minimum":0},"status":{"type":"string","enum":["updated"]}}},"error":{"type":"null"}}}]}}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"409":{"description":"幂等键、任务状态或资源状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"413":{"description":"请求体过大","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"415":{"description":"请求媒体类型不支持","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"429":{"description":"队列或模型并发额度已满，请稍后重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"500":{"description":"服务内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"502":{"description":"上游服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"504":{"description":"上游服务超时","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"document.manage","x-stability":"preview","parameters":[{"name":"doc_id","in":"path","required":true,"schema":{"type":"integer","minimum":1}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["document"],"properties":{"document":{"type":"object"}}}}}}}},"/open/v1/documents/{doc_id}/parsing":{"post":{"tags":["2. 文档准备"],"summary":"启动文档解析","description":"该接口采用异步处理。成功提交返回 HTTP 202，响应体 `data.job_id` 和响应头 `Location` 指向任务。随后通过 `getJob` 查询进度；状态为 `succeeded` 后，通过 `getJobResult` 获取最终结果。","operationId":"startDocumentParsing","responses":{"200":{"description":"请求已成功处理","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"required":["doc_id","status","text","page_count"],"properties":{"doc_id":{"type":"integer","minimum":1},"status":{"const":"ready"},"text":{"type":"string"},"page_count":{"type":"integer","minimum":0},"document_parse_diagnostics_v1":{"type":"object","additionalProperties":false,"required":["schema_version","requested_provider","requested_mode","result_source","pipeline_stage","worker_attempt_count","fallback_occurred","isolation_used","attempts","attempts_truncated","warnings"],"properties":{"schema_version":{"const":"document_parse_diagnostics_v1"},"requested_provider":{"type":"string","enum":["auto","docparse","tencent","local","mineru"],"default":"auto","description":"解析 Provider 策略。auto 按服务端启用列表和顺序执行；MinerU 默认禁用；指定 Provider 时严格执行该 Provider，不静默切换。"},"requested_mode":{"type":"string","enum":["standard","high_accuracy","structure_preserving"]},"result_source":{"type":"string","enum":["fresh","reused"]},"pipeline_stage":{"type":"string","enum":["completed","failed"]},"worker_attempt_count":{"type":"integer","minimum":1},"fallback_occurred":{"type":"boolean"},"isolation_used":{"type":"boolean"},"attempts":{"type":"array","maxItems":32,"items":{"type":"object","additionalProperties":false,"required":["provider","status","scope"],"properties":{"provider":{"type":"string","enum":["docparse","tencent","local","mineru","unknown"]},"status":{"type":"string","enum":["succeeded","failed","unknown"]},"scope":{"type":"string","enum":["group","page","isolation","unknown"]},"page_count":{"type":"integer","minimum":0},"duration_ms":{"type":"integer","minimum":0},"safe_error_code":{"type":"string","maxLength":64},"retryable":{"type":"boolean"},"fallback_allowed":{"type":"boolean"}}}},"attempts_truncated":{"type":"boolean"},"page_summary":{"type":"object","additionalProperties":false,"required":["total","ready","degraded","by_provider"],"properties":{"total":{"type":"integer","minimum":0},"ready":{"type":"integer","minimum":0},"degraded":{"type":"integer","minimum":0},"by_provider":{"type":"object","additionalProperties":false,"required":[],"properties":{"docparse":{"type":"integer","minimum":0},"tencent":{"type":"integer","minimum":0},"local":{"type":"integer","minimum":0}}}}},"warnings":{"type":"object","additionalProperties":false,"required":["count","codes"],"properties":{"count":{"type":"integer","minimum":0},"codes":{"type":"array","maxItems":32,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":64}}}},"source_format":{"type":"string","minLength":1,"maxLength":32},"canonicalized":{"type":"boolean"},"content_version":{"type":"string","minLength":1,"maxLength":128},"failure_stage":{"type":"string","enum":["precondition","source_read","convert","split","provider_parse","persist","unknown"]}}}}},"error":{"type":"null"}}}]}}}},"202":{"description":"任务已受理；请使用 job_id 查询进度和结果","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"required":["job_id","operation","status","phase","progress","progress_detail","sequence","attempt","poll_after_ms","result_ref","error","created_at","updated_at","finished_at"],"properties":{"job_id":{"type":"string","minLength":32,"maxLength":32,"pattern":"^[a-f0-9]{32}$","description":"异步任务唯一 ID；刷新页面或跨请求查询时保持不变。"},"operation":{"type":"string","description":"任务类型；当前主要为 upload、parse 或 extract。"},"status":{"type":"string","description":"queued=排队中，running=处理中，succeeded=已完成，failed/cancelled/unknown=终态异常。","enum":["queued","running","succeeded","failed","cancelled","unknown"]},"phase":{"type":["string","null"],"description":"当前处理阶段；服务未提供细分阶段时为 null。"},"progress":{"type":["integer","null"],"minimum":0,"maximum":100,"description":"0 到 100 的处理进度；无法计算时为 null。"},"progress_detail":{"oneOf":[{"type":"object","additionalProperties":false,"required":["unit","current","total"],"properties":{"unit":{"type":"string","enum":["bytes","documents","items","pages"]},"current":{"type":"integer","minimum":0},"total":{"type":"integer","minimum":1}}},{"type":"null"}],"description":"可核验的真实进度分子、分母；无法度量时为 null。"},"sequence":{"type":"integer","minimum":0,"description":"状态事件单调序号；客户端用它丢弃乱序轮询结果。"},"attempt":{"type":"integer","minimum":0,"description":"worker 执行尝试次数；上传直接执行时固定为 1。"},"poll_after_ms":{"type":"integer","minimum":100,"description":"服务端建议的下次轮询间隔。"},"result_ref":{"type":["string","null"],"description":"任务成功后的结果引用，通常为 /open/v1/job/{job_id}/result。"},"owner_ref":{"type":"string","maxLength":128,"description":"上传任务创建时固化的业务归属；非上传任务通常不返回。"},"error":{"oneOf":[{"type":"object","additionalProperties":false,"required":["code","message","retryable"],"properties":{"code":{"type":"string","enum":["conversion_failed","embedding_access_denied","embedding_output_invalid","embedding_unavailable","feature_disabled","forbidden","index_config_conflict","index_incomplete","input_invalid","input_too_large","internal_error","method_not_allowed","model_access_denied","model_output_invalid","model_unavailable","not_acceptable","not_found","payload_too_large","precondition_failed","precondition_required","processor_budget","processor_failed","processor_invalid_response","processor_rejected","processor_timeout","processor_unauthorized","processor_unavailable","queue_capacity_exceeded","rate_limited","resource_conflict","resource_not_found","semantic_unavailable","service_unavailable","source_ambiguous","source_changed","source_invalid","source_unavailable","source_writeback_unavailable","unauthorized","unsupported_media_type","upstream_rejected","upstream_timeout","upstream_unavailable"]},"message":{"type":"string","minLength":1},"retryable":{"type":"boolean"}}},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"finished_at":{"type":["string","null"],"format":"date-time"},"document_parse_diagnostics_v1":{"type":"object","additionalProperties":false,"required":["schema_version","requested_provider","requested_mode","result_source","pipeline_stage","worker_attempt_count","fallback_occurred","isolation_used","attempts","attempts_truncated","warnings"],"properties":{"schema_version":{"const":"document_parse_diagnostics_v1"},"requested_provider":{"type":"string","enum":["auto","docparse","tencent","local","mineru"],"default":"auto","description":"解析 Provider 策略。auto 按服务端启用列表和顺序执行；MinerU 默认禁用；指定 Provider 时严格执行该 Provider，不静默切换。"},"requested_mode":{"type":"string","enum":["standard","high_accuracy","structure_preserving"]},"result_source":{"type":"string","enum":["fresh","reused"]},"pipeline_stage":{"type":"string","enum":["completed","failed"]},"worker_attempt_count":{"type":"integer","minimum":1},"fallback_occurred":{"type":"boolean"},"isolation_used":{"type":"boolean"},"attempts":{"type":"array","maxItems":32,"items":{"type":"object","additionalProperties":false,"required":["provider","status","scope"],"properties":{"provider":{"type":"string","enum":["docparse","tencent","local","mineru","unknown"]},"status":{"type":"string","enum":["succeeded","failed","unknown"]},"scope":{"type":"string","enum":["group","page","isolation","unknown"]},"page_count":{"type":"integer","minimum":0},"duration_ms":{"type":"integer","minimum":0},"safe_error_code":{"type":"string","maxLength":64},"retryable":{"type":"boolean"},"fallback_allowed":{"type":"boolean"}}}},"attempts_truncated":{"type":"boolean"},"page_summary":{"type":"object","additionalProperties":false,"required":["total","ready","degraded","by_provider"],"properties":{"total":{"type":"integer","minimum":0},"ready":{"type":"integer","minimum":0},"degraded":{"type":"integer","minimum":0},"by_provider":{"type":"object","additionalProperties":false,"required":[],"properties":{"docparse":{"type":"integer","minimum":0},"tencent":{"type":"integer","minimum":0},"local":{"type":"integer","minimum":0}}}}},"warnings":{"type":"object","additionalProperties":false,"required":["count","codes"],"properties":{"count":{"type":"integer","minimum":0},"codes":{"type":"array","maxItems":32,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":64}}}},"source_format":{"type":"string","minLength":1,"maxLength":32},"canonicalized":{"type":"boolean"},"content_version":{"type":"string","minLength":1,"maxLength":128},"failure_stage":{"type":"string","enum":["precondition","source_read","convert","split","provider_parse","persist","unknown"]}}}}},"error":{"type":"null"}}}]}}},"headers":{"Location":{"description":"任务状态查询地址","schema":{"type":"string","example":"/open/v1/job/0123456789abcdef0123456789abcdef"}}},"links":{"查询任务进度":{"operationId":"getJob","parameters":{"job_id":"$response.body#/data/job_id"},"description":"使用本次返回的 job_id 查询任务进度。"},"读取任务结果":{"operationId":"getJobResult","parameters":{"job_id":"$response.body#/data/job_id"},"description":"任务 succeeded 后读取结构化结果。"}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"409":{"description":"幂等键、任务状态或资源状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"413":{"description":"请求体过大","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"415":{"description":"请求媒体类型不支持","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"429":{"description":"队列或模型并发额度已满，请稍后重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"500":{"description":"服务内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"502":{"description":"上游服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"504":{"description":"上游服务超时","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"document.parse","x-stability":"stable","parameters":[{"name":"doc_id","in":"path","required":true,"schema":{"type":"integer","minimum":1}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["client_request_id"],"properties":{"client_request_id":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$","description":"调用方生成的幂等请求标识；相同调用方重试时保持不变。"},"mode":{"type":"string","enum":["standard","high_accuracy","structure_preserving"]},"parse_provider":{"type":"string","enum":["auto","docparse","tencent","local","mineru"],"default":"auto","description":"解析 Provider 策略。auto 按服务端启用列表和顺序执行；MinerU 默认禁用；指定 Provider 时严格执行该 Provider，不静默切换。"},"include_diagnostics":{"type":"boolean","default":false,"description":"为 true 时在同步解析结果或异步 Job 状态中返回有界的解析诊断；默认关闭，不触发额外解析、存储读取或外部调用。"}}}}}}},"get":{"tags":["2. 文档准备"],"summary":"读取文档解析状态","operationId":"getDocumentParsing","responses":{"200":{"description":"请求已成功处理","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"required":["doc_id","status","total_pages","ready_pages","failed_pages"],"properties":{"doc_id":{"type":"integer","minimum":1},"status":{"type":"string","enum":["pending","parsing","ready","failed"]},"total_pages":{"type":"integer","minimum":0},"ready_pages":{"type":"integer","minimum":0},"failed_pages":{"type":"integer","minimum":0}}},"error":{"type":"null"}}}]}}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"500":{"description":"服务内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"502":{"description":"上游服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"504":{"description":"上游服务超时","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"document.read","x-stability":"stable","parameters":[{"name":"doc_id","in":"path","required":true,"schema":{"type":"integer","minimum":1}}]}},"/open/v1/documents/{doc_id}/structure":{"get":{"tags":["2. 文档准备"],"summary":"读取文档结构化投影","operationId":"getDocumentStructure","responses":{"200":{"description":"请求已成功处理","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"required":["schema_version","doc_id","content_version","coordinate_system","offset","limit","total","has_more","pages"],"properties":{"schema_version":{"type":"string","enum":["document_structure_v1"]},"doc_id":{"type":"integer","minimum":1},"content_version":{"type":"string","minLength":1,"maxLength":128},"coordinate_system":{"type":"object","additionalProperties":false,"required":["origin","unit","bbox_format"],"properties":{"origin":{"type":"string","enum":["top_left"]},"unit":{"type":"string","enum":["page_native"]},"bbox_format":{"type":"string","enum":["left_top_right_bottom"]}}},"offset":{"type":"integer","minimum":0},"limit":{"type":"integer","minimum":1,"maximum":200},"total":{"type":"integer","minimum":0},"has_more":{"type":"boolean"},"pages":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["page_id","page_no","width","height","direction","status","blocks"],"properties":{"page_id":{"type":"integer","minimum":1},"page_no":{"type":"integer","minimum":1},"width":{"type":["number","null"]},"height":{"type":["number","null"]},"direction":{"type":"integer","enum":[0,90,180,270]},"status":{"type":"string","enum":["pending","ready","failed"]},"blocks":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["block_id","kind","reading_order","text","bbox","segments","table"],"properties":{"block_id":{"type":"string","minLength":1,"maxLength":128},"kind":{"type":"string","enum":["paragraph","table"]},"reading_order":{"type":"integer","minimum":0},"para_type":{"type":"string","enum":["text","title","hf"]},"text":{"type":"string"},"bbox":{"type":["array","null"],"minItems":4,"maxItems":4,"items":{"type":"number"}},"segments":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["segment_id","order","text","bbox"],"properties":{"segment_id":{"type":"string","minLength":1,"maxLength":128},"order":{"type":"integer","minimum":0},"text":{"type":"string"},"bbox":{"type":["array","null"],"minItems":4,"maxItems":4,"items":{"type":"number"}}}}},"table":{"oneOf":[{"type":"object","additionalProperties":false,"required":["rows"],"properties":{"rows":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["row_index","cells"],"properties":{"row_index":{"type":"integer","minimum":0},"cells":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["cell_id","row_index","column_index","row_span","column_span","text","bbox","segments"],"properties":{"cell_id":{"type":"string","minLength":1,"maxLength":128},"row_index":{"type":"integer","minimum":0},"column_index":{"type":"integer","minimum":0},"row_span":{"type":"integer","minimum":1},"column_span":{"type":"integer","minimum":1},"text":{"type":"string"},"bbox":{"type":["array","null"],"minItems":4,"maxItems":4,"items":{"type":"number"}},"segments":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["segment_id","order","text","bbox"],"properties":{"segment_id":{"type":"string","minLength":1,"maxLength":128},"order":{"type":"integer","minimum":0},"text":{"type":"string"},"bbox":{"type":["array","null"],"minItems":4,"maxItems":4,"items":{"type":"number"}}}}}}}}}}}}},{"type":"null"}]}}}}}}}}},"error":{"type":"null"}}}]}}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"500":{"description":"服务内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"502":{"description":"上游服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"504":{"description":"上游服务超时","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"413":{"description":"请求体过大","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"document.read","x-stability":"stable","parameters":[{"name":"doc_id","in":"path","required":true,"schema":{"type":"integer","minimum":1}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"description":"页偏移，从 0 开始。"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50,"description":"每页返回页数。"}},{"name":"content_version","in":"query","required":false,"schema":{"type":["string","null"],"maxLength":128,"description":"可选内容版本乐观锁。"}}]}},"/open/v1/documents/{doc_id}/handwriting-ocr":{"post":{"tags":["2. 文档准备"],"summary":"启动指定手写页高精度 OCR","description":"该接口采用异步处理。成功提交返回 HTTP 202，响应体 `data.job_id` 和响应头 `Location` 指向任务。随后通过 `getJob` 查询进度；状态为 `succeeded` 后，通过 `getJobResult` 获取最终结果。","operationId":"startDocumentHandwritingOcr","responses":{"202":{"description":"任务已受理；请使用 job_id 查询进度和结果","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"required":["job_id","operation","status","phase","progress","progress_detail","sequence","attempt","poll_after_ms","result_ref","error","created_at","updated_at","finished_at"],"properties":{"job_id":{"type":"string","minLength":32,"maxLength":32,"pattern":"^[a-f0-9]{32}$","description":"异步任务唯一 ID；刷新页面或跨请求查询时保持不变。"},"operation":{"type":"string","description":"任务类型；当前主要为 upload、parse 或 extract。"},"status":{"type":"string","description":"queued=排队中，running=处理中，succeeded=已完成，failed/cancelled/unknown=终态异常。","enum":["queued","running","succeeded","failed","cancelled","unknown"]},"phase":{"type":["string","null"],"description":"当前处理阶段；服务未提供细分阶段时为 null。"},"progress":{"type":["integer","null"],"minimum":0,"maximum":100,"description":"0 到 100 的处理进度；无法计算时为 null。"},"progress_detail":{"oneOf":[{"type":"object","additionalProperties":false,"required":["unit","current","total"],"properties":{"unit":{"type":"string","enum":["bytes","documents","items","pages"]},"current":{"type":"integer","minimum":0},"total":{"type":"integer","minimum":1}}},{"type":"null"}],"description":"可核验的真实进度分子、分母；无法度量时为 null。"},"sequence":{"type":"integer","minimum":0,"description":"状态事件单调序号；客户端用它丢弃乱序轮询结果。"},"attempt":{"type":"integer","minimum":0,"description":"worker 执行尝试次数；上传直接执行时固定为 1。"},"poll_after_ms":{"type":"integer","minimum":100,"description":"服务端建议的下次轮询间隔。"},"result_ref":{"type":["string","null"],"description":"任务成功后的结果引用，通常为 /open/v1/job/{job_id}/result。"},"owner_ref":{"type":"string","maxLength":128,"description":"上传任务创建时固化的业务归属；非上传任务通常不返回。"},"error":{"oneOf":[{"type":"object","additionalProperties":false,"required":["code","message","retryable"],"properties":{"code":{"type":"string","enum":["conversion_failed","embedding_access_denied","embedding_output_invalid","embedding_unavailable","feature_disabled","forbidden","index_config_conflict","index_incomplete","input_invalid","input_too_large","internal_error","method_not_allowed","model_access_denied","model_output_invalid","model_unavailable","not_acceptable","not_found","payload_too_large","precondition_failed","precondition_required","processor_budget","processor_failed","processor_invalid_response","processor_rejected","processor_timeout","processor_unauthorized","processor_unavailable","queue_capacity_exceeded","rate_limited","resource_conflict","resource_not_found","semantic_unavailable","service_unavailable","source_ambiguous","source_changed","source_invalid","source_unavailable","source_writeback_unavailable","unauthorized","unsupported_media_type","upstream_rejected","upstream_timeout","upstream_unavailable"]},"message":{"type":"string","minLength":1},"retryable":{"type":"boolean"}}},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"finished_at":{"type":["string","null"],"format":"date-time"},"document_parse_diagnostics_v1":{"type":"object","additionalProperties":false,"required":["schema_version","requested_provider","requested_mode","result_source","pipeline_stage","worker_attempt_count","fallback_occurred","isolation_used","attempts","attempts_truncated","warnings"],"properties":{"schema_version":{"const":"document_parse_diagnostics_v1"},"requested_provider":{"type":"string","enum":["auto","docparse","tencent","local","mineru"],"default":"auto","description":"解析 Provider 策略。auto 按服务端启用列表和顺序执行；MinerU 默认禁用；指定 Provider 时严格执行该 Provider，不静默切换。"},"requested_mode":{"type":"string","enum":["standard","high_accuracy","structure_preserving"]},"result_source":{"type":"string","enum":["fresh","reused"]},"pipeline_stage":{"type":"string","enum":["completed","failed"]},"worker_attempt_count":{"type":"integer","minimum":1},"fallback_occurred":{"type":"boolean"},"isolation_used":{"type":"boolean"},"attempts":{"type":"array","maxItems":32,"items":{"type":"object","additionalProperties":false,"required":["provider","status","scope"],"properties":{"provider":{"type":"string","enum":["docparse","tencent","local","mineru","unknown"]},"status":{"type":"string","enum":["succeeded","failed","unknown"]},"scope":{"type":"string","enum":["group","page","isolation","unknown"]},"page_count":{"type":"integer","minimum":0},"duration_ms":{"type":"integer","minimum":0},"safe_error_code":{"type":"string","maxLength":64},"retryable":{"type":"boolean"},"fallback_allowed":{"type":"boolean"}}}},"attempts_truncated":{"type":"boolean"},"page_summary":{"type":"object","additionalProperties":false,"required":["total","ready","degraded","by_provider"],"properties":{"total":{"type":"integer","minimum":0},"ready":{"type":"integer","minimum":0},"degraded":{"type":"integer","minimum":0},"by_provider":{"type":"object","additionalProperties":false,"required":[],"properties":{"docparse":{"type":"integer","minimum":0},"tencent":{"type":"integer","minimum":0},"local":{"type":"integer","minimum":0}}}}},"warnings":{"type":"object","additionalProperties":false,"required":["count","codes"],"properties":{"count":{"type":"integer","minimum":0},"codes":{"type":"array","maxItems":32,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":64}}}},"source_format":{"type":"string","minLength":1,"maxLength":32},"canonicalized":{"type":"boolean"},"content_version":{"type":"string","minLength":1,"maxLength":128},"failure_stage":{"type":"string","enum":["precondition","source_read","convert","split","provider_parse","persist","unknown"]}}}}},"error":{"type":"null"}}}]}}},"headers":{"Location":{"description":"任务状态查询地址","schema":{"type":"string","example":"/open/v1/job/0123456789abcdef0123456789abcdef"}}},"links":{"查询任务进度":{"operationId":"getJob","parameters":{"job_id":"$response.body#/data/job_id"},"description":"使用本次返回的 job_id 查询任务进度。"},"读取任务结果":{"operationId":"getJobResult","parameters":{"job_id":"$response.body#/data/job_id"},"description":"任务 succeeded 后读取结构化结果。"}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"409":{"description":"幂等键、任务状态或资源状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"413":{"description":"请求体过大","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"415":{"description":"请求媒体类型不支持","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"429":{"description":"队列或模型并发额度已满，请稍后重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"500":{"description":"服务内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"502":{"description":"上游服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"504":{"description":"上游服务超时","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"document.parse","x-stability":"preview","parameters":[{"name":"doc_id","in":"path","required":true,"schema":{"type":"integer","minimum":1}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["page_numbers","client_request_id"],"properties":{"page_numbers":{"type":"array","minItems":1,"maxItems":200,"uniqueItems":true,"items":{"type":"integer","minimum":1}},"client_request_id":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$","description":"调用方生成的幂等请求标识；相同调用方重试时保持不变。"},"expected_content_version":{"type":["string","null"],"minLength":1,"maxLength":128}}}}}}}},"/open/v1/documents/directories/{directory_id}":{"get":{"tags":["2. 文档准备"],"summary":"读取文档目录","operationId":"getDocumentDirectory","responses":{"200":{"description":"请求已成功处理","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"required":["directory_id","name","parent_id","owner_ref","kind","doc_id","created_at"],"properties":{"directory_id":{"type":"integer","minimum":1},"name":{"type":["string","null"],"maxLength":255},"parent_id":{"type":["integer","null"],"minimum":1},"owner_ref":{"type":["string","null"],"maxLength":128},"kind":{"type":"string","enum":["directory","document"]},"doc_id":{"type":["integer","null"],"minimum":1},"created_at":{"type":["string","null"],"format":"date-time"}}},"error":{"type":"null"}}}]}}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"500":{"description":"服务内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"502":{"description":"上游服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"504":{"description":"上游服务超时","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"document.read","x-stability":"preview","parameters":[{"name":"directory_id","in":"path","required":true,"schema":{"type":"integer","minimum":1}}]},"patch":{"tags":["2. 文档准备"],"summary":"重命名或移动文档目录","operationId":"updateDocumentDirectory","responses":{"200":{"description":"请求已成功处理","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"required":["directory_id","name","parent_id","owner_ref","kind","doc_id","created_at"],"properties":{"directory_id":{"type":"integer","minimum":1},"name":{"type":["string","null"],"maxLength":255},"parent_id":{"type":["integer","null"],"minimum":1},"owner_ref":{"type":["string","null"],"maxLength":128},"kind":{"type":"string","enum":["directory","document"]},"doc_id":{"type":["integer","null"],"minimum":1},"created_at":{"type":["string","null"],"format":"date-time"}}},"error":{"type":"null"}}}]}}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"409":{"description":"幂等键、任务状态或资源状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"413":{"description":"请求体过大","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"415":{"description":"请求媒体类型不支持","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"429":{"description":"队列或模型并发额度已满，请稍后重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"500":{"description":"服务内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"502":{"description":"上游服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"504":{"description":"上游服务超时","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"document.manage","x-stability":"preview","parameters":[{"name":"directory_id","in":"path","required":true,"schema":{"type":"integer","minimum":1}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":[],"properties":{"name":{"type":"string","minLength":1,"maxLength":255},"parent_id":{"type":["integer","null"],"minimum":1}},"minProperties":1}}}}},"delete":{"tags":["2. 文档准备"],"summary":"删除文档目录","operationId":"deleteDocumentDirectory","responses":{"200":{"description":"请求已成功处理","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"required":["deleted"],"properties":{"deleted":{"const":true}}},"error":{"type":"null"}}}]}}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"409":{"description":"幂等键、任务状态或资源状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"413":{"description":"请求体过大","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"415":{"description":"请求媒体类型不支持","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"429":{"description":"队列或模型并发额度已满，请稍后重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"500":{"description":"服务内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"502":{"description":"上游服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"504":{"description":"上游服务超时","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"document.manage","x-stability":"preview","parameters":[{"name":"directory_id","in":"path","required":true,"schema":{"type":"integer","minimum":1}},{"name":"recursive","in":"query","required":false,"schema":{"type":"boolean","default":false}}]}},"/open/v1/documents/{doc_id}":{"get":{"tags":["2. 文档准备"],"summary":"读取文档元数据","operationId":"getDocument","responses":{"200":{"description":"请求已成功处理","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"required":["doc_id","name","extension","size","sha256","owner_ref","total_pages","doc_type","created_at","directory_id"],"properties":{"doc_id":{"type":"integer","minimum":1},"name":{"type":"string","minLength":1,"maxLength":255},"extension":{"type":["string","null"],"maxLength":32},"size":{"type":["integer","null"],"minimum":0},"sha256":{"type":["string","null"],"pattern":"^[0-9a-f]{64}$"},"owner_ref":{"type":["string","null"],"maxLength":128},"total_pages":{"type":"integer","minimum":0},"doc_type":{"type":["string","null"],"maxLength":32,"description":"单证形态类型(平台封闭枚举,如 vat_invoice/id_card;null=未判定,按 general 处理)。"},"created_at":{"type":["string","null"],"format":"date-time"},"directory_id":{"type":["integer","null"],"minimum":1},"busi_id":{"type":["string","null"],"maxLength":128,"description":"外部渠道业务标识（可选，P0-3 恢复按 busi_id 查询链路）。"}}},"error":{"type":"null"}}}]}}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"500":{"description":"服务内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"502":{"description":"上游服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"504":{"description":"上游服务超时","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"document.read","x-stability":"stable","parameters":[{"name":"doc_id","in":"path","required":true,"schema":{"type":"integer","minimum":1}}]},"patch":{"tags":["2. 文档准备"],"summary":"重命名或移动文档","operationId":"updateDocument","responses":{"200":{"description":"请求已成功处理","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"required":["doc_id","name","extension","size","sha256","owner_ref","total_pages","doc_type","created_at","directory_id"],"properties":{"doc_id":{"type":"integer","minimum":1},"name":{"type":"string","minLength":1,"maxLength":255},"extension":{"type":["string","null"],"maxLength":32},"size":{"type":["integer","null"],"minimum":0},"sha256":{"type":["string","null"],"pattern":"^[0-9a-f]{64}$"},"owner_ref":{"type":["string","null"],"maxLength":128},"total_pages":{"type":"integer","minimum":0},"doc_type":{"type":["string","null"],"maxLength":32,"description":"单证形态类型(平台封闭枚举,如 vat_invoice/id_card;null=未判定,按 general 处理)。"},"created_at":{"type":["string","null"],"format":"date-time"},"directory_id":{"type":["integer","null"],"minimum":1},"busi_id":{"type":["string","null"],"maxLength":128,"description":"外部渠道业务标识（可选，P0-3 恢复按 busi_id 查询链路）。"}}},"error":{"type":"null"}}}]}}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"409":{"description":"幂等键、任务状态或资源状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"413":{"description":"请求体过大","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"415":{"description":"请求媒体类型不支持","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"429":{"description":"队列或模型并发额度已满，请稍后重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"500":{"description":"服务内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"502":{"description":"上游服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"504":{"description":"上游服务超时","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"document.manage","x-stability":"stable","parameters":[{"name":"doc_id","in":"path","required":true,"schema":{"type":"integer","minimum":1}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":[],"properties":{"name":{"type":"string","minLength":1,"maxLength":255},"directory_id":{"type":["integer","null"],"minimum":1}},"minProperties":1}}}}},"delete":{"tags":["2. 文档准备"],"summary":"删除文档","operationId":"deleteDocument","responses":{"200":{"description":"请求已成功处理","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"required":["deleted"],"properties":{"deleted":{"const":true}}},"error":{"type":"null"}}}]}}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"409":{"description":"幂等键、任务状态或资源状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"413":{"description":"请求体过大","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"415":{"description":"请求媒体类型不支持","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"429":{"description":"队列或模型并发额度已满，请稍后重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"500":{"description":"服务内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"502":{"description":"上游服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"504":{"description":"上游服务超时","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"document.manage","x-stability":"preview","parameters":[{"name":"doc_id","in":"path","required":true,"schema":{"type":"integer","minimum":1}}]}},"/open/v1/document-pages/{page_id}":{"get":{"tags":["2. 文档准备"],"summary":"按页 ID 读取文档页","operationId":"getDocumentPage","responses":{"200":{"description":"请求已成功处理","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"required":["page_id","doc_id","page_no","status","direction"],"properties":{"page_id":{"type":"integer","minimum":1},"doc_id":{"type":"integer","minimum":1},"page_no":{"type":"integer","minimum":1},"status":{"type":"string","enum":["pending","ready","failed"]},"direction":{"type":"integer","enum":[0,90,180,270]}}},"error":{"type":"null"}}}]}}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"500":{"description":"服务内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"502":{"description":"上游服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"504":{"description":"上游服务超时","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"document.read","x-stability":"preview","parameters":[{"name":"page_id","in":"path","required":true,"schema":{"type":"integer","minimum":1}}]}},"/open/v1/document-pages/{page_id}/assets/{asset}":{"get":{"tags":["2. 文档准备"],"summary":"按页 ID 流式读取文档页资源","operationId":"getDocumentPageAssetByPageId","responses":{"200":{"description":"文档二进制资源读取成功","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"500":{"description":"服务内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"502":{"description":"上游服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"504":{"description":"上游服务超时","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"document.read","x-stability":"stable","parameters":[{"name":"page_id","in":"path","required":true,"schema":{"type":"integer","minimum":1}},{"name":"asset","in":"path","required":true,"schema":{"type":"string","enum":["page","preview","pdf"]}}]}},"/open/v1/documents/{doc_id}/pages/{page_id}":{"patch":{"tags":["2. 文档准备"],"summary":"旋转文档页","operationId":"rotateDocumentPage","responses":{"200":{"description":"请求已成功处理","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"required":["page_id","page_no","status","direction"],"properties":{"page_id":{"type":"integer","minimum":1},"page_no":{"type":"integer","minimum":1},"status":{"type":"string","enum":["pending","ready","failed"]},"direction":{"type":"integer","enum":[0,90,180,270]}}},"error":{"type":"null"}}}]}}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"409":{"description":"幂等键、任务状态或资源状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"413":{"description":"请求体过大","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"415":{"description":"请求媒体类型不支持","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"429":{"description":"队列或模型并发额度已满，请稍后重试","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"500":{"description":"服务内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"502":{"description":"上游服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"504":{"description":"上游服务超时","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"document.manage","x-stability":"preview","parameters":[{"name":"doc_id","in":"path","required":true,"schema":{"type":"integer","minimum":1}},{"name":"page_id","in":"path","required":true,"schema":{"type":"integer","minimum":1}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["direction"],"properties":{"direction":{"type":"integer","enum":[0,90,180,270]}}}}}}}},"/open/v1/documents/{doc_id}/pages/{page_id}/assets/{asset}":{"get":{"tags":["2. 文档准备"],"summary":"流式读取文档页资源","operationId":"getDocumentPageAsset","responses":{"200":{"description":"文档二进制资源读取成功","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"500":{"description":"服务内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"502":{"description":"上游服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"504":{"description":"上游服务超时","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"document.read","x-stability":"preview","parameters":[{"name":"doc_id","in":"path","required":true,"schema":{"type":"integer","minimum":1}},{"name":"page_id","in":"path","required":true,"schema":{"type":"integer","minimum":1}},{"name":"asset","in":"path","required":true,"schema":{"type":"string","enum":["page","preview","pdf"]}}]}},"/open/v1/job/{job_id}":{"get":{"tags":["5. 任务进度与结果"],"summary":"查询异步能力的统一 job 状态与结果引用","description":"输入异步提交返回的 32 位 `job_id`。`queued`/`running` 表示仍在处理，`succeeded` 后可读取结果。 动态任务按dkRead、当前知识库和来源权限校验；viewTask不授予知识读取权限。\n\n**动态知识库关联边界**\n\n动态任务要求dkRead并复核当前库/来源；viewTask只够原宿主任务，不额外授予动态库权限。只读状态不新建任务，遵循poll_after_ms及本地超时。succeeded不是“答案存在”，还须读取结果业务状态；未知/不可见任务不暴露其他Space信息。\n\n完整说明：/swagger-ui/open-v1/docs/dynamic-knowledge","operationId":"getJob","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","minLength":32,"maxLength":32,"pattern":"^[a-f0-9]{32}$"}}],"responses":{"200":{"description":"任务状态查询成功","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"required":["job_id","operation","status","phase","progress","progress_detail","sequence","attempt","poll_after_ms","result_ref","error","created_at","updated_at","finished_at"],"properties":{"job_id":{"type":"string","minLength":32,"maxLength":32,"pattern":"^[a-f0-9]{32}$","description":"异步任务唯一 ID；刷新页面或跨请求查询时保持不变。"},"operation":{"type":"string","description":"任务类型；当前主要为 upload、parse 或 extract。"},"status":{"type":"string","description":"queued=排队中，running=处理中，succeeded=已完成，failed/cancelled/unknown=终态异常。","enum":["queued","running","succeeded","failed","cancelled","unknown"]},"phase":{"type":["string","null"],"description":"当前处理阶段；服务未提供细分阶段时为 null。"},"progress":{"type":["integer","null"],"minimum":0,"maximum":100,"description":"0 到 100 的处理进度；无法计算时为 null。"},"progress_detail":{"oneOf":[{"type":"object","additionalProperties":false,"required":["unit","current","total"],"properties":{"unit":{"type":"string","enum":["bytes","documents","items","pages"]},"current":{"type":"integer","minimum":0},"total":{"type":"integer","minimum":1}}},{"type":"null"}],"description":"可核验的真实进度分子、分母；无法度量时为 null。"},"sequence":{"type":"integer","minimum":0,"description":"状态事件单调序号；客户端用它丢弃乱序轮询结果。"},"attempt":{"type":"integer","minimum":0,"description":"worker 执行尝试次数；上传直接执行时固定为 1。"},"poll_after_ms":{"type":"integer","minimum":100,"description":"服务端建议的下次轮询间隔。"},"result_ref":{"type":["string","null"],"description":"任务成功后的结果引用，通常为 /open/v1/job/{job_id}/result。"},"owner_ref":{"type":"string","maxLength":128,"description":"上传任务创建时固化的业务归属；非上传任务通常不返回。"},"error":{"oneOf":[{"type":"object","additionalProperties":false,"required":["code","message","retryable"],"properties":{"code":{"type":"string","enum":["conversion_failed","embedding_access_denied","embedding_output_invalid","embedding_unavailable","feature_disabled","forbidden","index_config_conflict","index_incomplete","input_invalid","input_too_large","internal_error","method_not_allowed","model_access_denied","model_output_invalid","model_unavailable","not_acceptable","not_found","payload_too_large","precondition_failed","precondition_required","processor_budget","processor_failed","processor_invalid_response","processor_rejected","processor_timeout","processor_unauthorized","processor_unavailable","queue_capacity_exceeded","rate_limited","resource_conflict","resource_not_found","semantic_unavailable","service_unavailable","source_ambiguous","source_changed","source_invalid","source_unavailable","source_writeback_unavailable","unauthorized","unsupported_media_type","upstream_rejected","upstream_timeout","upstream_unavailable"]},"message":{"type":"string","minLength":1},"retryable":{"type":"boolean"}}},{"type":"null"}]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"finished_at":{"type":["string","null"],"format":"date-time"},"document_parse_diagnostics_v1":{"type":"object","additionalProperties":false,"required":["schema_version","requested_provider","requested_mode","result_source","pipeline_stage","worker_attempt_count","fallback_occurred","isolation_used","attempts","attempts_truncated","warnings"],"properties":{"schema_version":{"const":"document_parse_diagnostics_v1"},"requested_provider":{"type":"string","enum":["auto","docparse","tencent","local","mineru"],"default":"auto","description":"解析 Provider 策略。auto 按服务端启用列表和顺序执行；MinerU 默认禁用；指定 Provider 时严格执行该 Provider，不静默切换。"},"requested_mode":{"type":"string","enum":["standard","high_accuracy","structure_preserving"]},"result_source":{"type":"string","enum":["fresh","reused"]},"pipeline_stage":{"type":"string","enum":["completed","failed"]},"worker_attempt_count":{"type":"integer","minimum":1},"fallback_occurred":{"type":"boolean"},"isolation_used":{"type":"boolean"},"attempts":{"type":"array","maxItems":32,"items":{"type":"object","additionalProperties":false,"required":["provider","status","scope"],"properties":{"provider":{"type":"string","enum":["docparse","tencent","local","mineru","unknown"]},"status":{"type":"string","enum":["succeeded","failed","unknown"]},"scope":{"type":"string","enum":["group","page","isolation","unknown"]},"page_count":{"type":"integer","minimum":0},"duration_ms":{"type":"integer","minimum":0},"safe_error_code":{"type":"string","maxLength":64},"retryable":{"type":"boolean"},"fallback_allowed":{"type":"boolean"}}}},"attempts_truncated":{"type":"boolean"},"page_summary":{"type":"object","additionalProperties":false,"required":["total","ready","degraded","by_provider"],"properties":{"total":{"type":"integer","minimum":0},"ready":{"type":"integer","minimum":0},"degraded":{"type":"integer","minimum":0},"by_provider":{"type":"object","additionalProperties":false,"required":[],"properties":{"docparse":{"type":"integer","minimum":0},"tencent":{"type":"integer","minimum":0},"local":{"type":"integer","minimum":0}}}}},"warnings":{"type":"object","additionalProperties":false,"required":["count","codes"],"properties":{"count":{"type":"integer","minimum":0},"codes":{"type":"array","maxItems":32,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":64}}}},"source_format":{"type":"string","minLength":1,"maxLength":32},"canonicalized":{"type":"boolean"},"content_version":{"type":"string","minLength":1,"maxLength":128},"failure_stage":{"type":"string","enum":["precondition","source_read","convert","split","provider_parse","persist","unknown"]}}}}},"error":{"type":"null"}}}]}}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"500":{"description":"服务内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"502":{"description":"上游服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"504":{"description":"上游服务超时","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"viewTask","x-stability":"stable","x-alternative-scopes":["dkRead"]}},"/open/v1/job/{job_id}/result":{"get":{"tags":["5. 任务进度与结果"],"summary":"读取已成功异步任务的结构化结果","description":"仅在任务状态为 `succeeded` 后调用；任务未完成时返回 HTTP 409。 动态任务按dkRead、当前知识库和来源权限校验；viewTask不授予知识读取权限。\n\n**动态知识库关联边界**\n\n仅在任务完成后读原结果；未完成通常409，失败应读getJob.error而非不断重提。动态结果result_type=dynamic_knowledge并携带原快照/引用/业务状态；当前来源撤权后即使任务曾成功也可能404，无法核实503。answer/answer_notice可null、citations可空；succeeded和HTTP200不保证answered。不得用浏览器旧缓存替代服务端复核。\n\n完整说明：/swagger-ui/open-v1/docs/dynamic-knowledge","operationId":"getJobResult","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","minLength":32,"maxLength":32,"pattern":"^[a-f0-9]{32}$"}}],"responses":{"200":{"description":"任务结果读取成功","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"oneOf":[{"allOf":[{"oneOf":[{"type":"object","additionalProperties":false,"required":["doc_id","disposition"],"properties":{"doc_id":{"type":"integer","minimum":1},"disposition":{"type":"string","enum":["created","reused"]}}},{"type":"object","additionalProperties":false,"required":["items"],"properties":{"items":{"type":"array","minItems":1,"items":{"type":"object","additionalProperties":false,"required":["doc_id","name","sha256","disposition"],"properties":{"doc_id":{"type":["integer","null"],"minimum":1},"name":{"type":"string","minLength":1,"maxLength":255},"sha256":{"type":"string","pattern":"^[0-9a-f]{64}$"},"disposition":{"type":"string","enum":["created","reused","rejected"]},"reason":{"type":"string","minLength":1,"maxLength":128}}}}}},{"oneOf":[{"type":"object","additionalProperties":false,"required":["doc_id","status","text","page_count"],"properties":{"doc_id":{"type":"integer","minimum":1},"status":{"const":"ready"},"text":{"type":"string"},"page_count":{"type":"integer","minimum":0},"document_parse_diagnostics_v1":{"type":"object","additionalProperties":false,"required":["schema_version","requested_provider","requested_mode","result_source","pipeline_stage","worker_attempt_count","fallback_occurred","isolation_used","attempts","attempts_truncated","warnings"],"properties":{"schema_version":{"const":"document_parse_diagnostics_v1"},"requested_provider":{"type":"string","enum":["auto","docparse","tencent","local","mineru"],"default":"auto","description":"解析 Provider 策略。auto 按服务端启用列表和顺序执行；MinerU 默认禁用；指定 Provider 时严格执行该 Provider，不静默切换。"},"requested_mode":{"type":"string","enum":["standard","high_accuracy","structure_preserving"]},"result_source":{"type":"string","enum":["fresh","reused"]},"pipeline_stage":{"type":"string","enum":["completed","failed"]},"worker_attempt_count":{"type":"integer","minimum":1},"fallback_occurred":{"type":"boolean"},"isolation_used":{"type":"boolean"},"attempts":{"type":"array","maxItems":32,"items":{"type":"object","additionalProperties":false,"required":["provider","status","scope"],"properties":{"provider":{"type":"string","enum":["docparse","tencent","local","mineru","unknown"]},"status":{"type":"string","enum":["succeeded","failed","unknown"]},"scope":{"type":"string","enum":["group","page","isolation","unknown"]},"page_count":{"type":"integer","minimum":0},"duration_ms":{"type":"integer","minimum":0},"safe_error_code":{"type":"string","maxLength":64},"retryable":{"type":"boolean"},"fallback_allowed":{"type":"boolean"}}}},"attempts_truncated":{"type":"boolean"},"page_summary":{"type":"object","additionalProperties":false,"required":["total","ready","degraded","by_provider"],"properties":{"total":{"type":"integer","minimum":0},"ready":{"type":"integer","minimum":0},"degraded":{"type":"integer","minimum":0},"by_provider":{"type":"object","additionalProperties":false,"required":[],"properties":{"docparse":{"type":"integer","minimum":0},"tencent":{"type":"integer","minimum":0},"local":{"type":"integer","minimum":0}}}}},"warnings":{"type":"object","additionalProperties":false,"required":["count","codes"],"properties":{"count":{"type":"integer","minimum":0},"codes":{"type":"array","maxItems":32,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":64}}}},"source_format":{"type":"string","minLength":1,"maxLength":32},"canonicalized":{"type":"boolean"},"content_version":{"type":"string","minLength":1,"maxLength":128},"failure_stage":{"type":"string","enum":["precondition","source_read","convert","split","provider_parse","persist","unknown"]}}}}},{"type":"array","minItems":1,"items":{"type":"object","additionalProperties":false,"required":["doc_id","status","text","page_count"],"properties":{"doc_id":{"type":"integer","minimum":1},"status":{"const":"ready"},"text":{"type":"string"},"page_count":{"type":"integer","minimum":0},"document_parse_diagnostics_v1":{"type":"object","additionalProperties":false,"required":["schema_version","requested_provider","requested_mode","result_source","pipeline_stage","worker_attempt_count","fallback_occurred","isolation_used","attempts","attempts_truncated","warnings"],"properties":{"schema_version":{"const":"document_parse_diagnostics_v1"},"requested_provider":{"type":"string","enum":["auto","docparse","tencent","local","mineru"],"default":"auto","description":"解析 Provider 策略。auto 按服务端启用列表和顺序执行；MinerU 默认禁用；指定 Provider 时严格执行该 Provider，不静默切换。"},"requested_mode":{"type":"string","enum":["standard","high_accuracy","structure_preserving"]},"result_source":{"type":"string","enum":["fresh","reused"]},"pipeline_stage":{"type":"string","enum":["completed","failed"]},"worker_attempt_count":{"type":"integer","minimum":1},"fallback_occurred":{"type":"boolean"},"isolation_used":{"type":"boolean"},"attempts":{"type":"array","maxItems":32,"items":{"type":"object","additionalProperties":false,"required":["provider","status","scope"],"properties":{"provider":{"type":"string","enum":["docparse","tencent","local","mineru","unknown"]},"status":{"type":"string","enum":["succeeded","failed","unknown"]},"scope":{"type":"string","enum":["group","page","isolation","unknown"]},"page_count":{"type":"integer","minimum":0},"duration_ms":{"type":"integer","minimum":0},"safe_error_code":{"type":"string","maxLength":64},"retryable":{"type":"boolean"},"fallback_allowed":{"type":"boolean"}}}},"attempts_truncated":{"type":"boolean"},"page_summary":{"type":"object","additionalProperties":false,"required":["total","ready","degraded","by_provider"],"properties":{"total":{"type":"integer","minimum":0},"ready":{"type":"integer","minimum":0},"degraded":{"type":"integer","minimum":0},"by_provider":{"type":"object","additionalProperties":false,"required":[],"properties":{"docparse":{"type":"integer","minimum":0},"tencent":{"type":"integer","minimum":0},"local":{"type":"integer","minimum":0}}}}},"warnings":{"type":"object","additionalProperties":false,"required":["count","codes"],"properties":{"count":{"type":"integer","minimum":0},"codes":{"type":"array","maxItems":32,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":64}}}},"source_format":{"type":"string","minLength":1,"maxLength":32},"canonicalized":{"type":"boolean"},"content_version":{"type":"string","minLength":1,"maxLength":128},"failure_stage":{"type":"string","enum":["precondition","source_read","convert","split","provider_parse","persist","unknown"]}}}}}}]},{"type":"object","additionalProperties":false,"required":["results"],"properties":{"results":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["doc_id","state","matched_code","reason"],"properties":{"doc_id":{"type":"integer","minimum":1},"state":{"type":"string","enum":["matched","out_of_scope","uncertain"]},"matched_code":{"type":["string","null"]},"reason":{"type":"string","minLength":1},"confidence":{"type":["number","null"],"minimum":0,"maximum":1}}}}}},{"type":"object","additionalProperties":false,"required":["schema_version","input_mode","items","usage"],"properties":{"schema_version":{"const":"unified_classification_v1"},"input_mode":{"const":"auto"},"items":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["doc_id","source_sha256","page_count","models","decision","category","category_name","multiple_materials","observed_categories","evidence"],"properties":{"doc_id":{"type":"integer","minimum":1},"source_sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"},"page_count":{"type":"integer","minimum":1},"models":{"type":"array","items":{"type":"string"}},"decision":{"type":"string","enum":["matched","uncertain","none"]},"category":{"type":["string","null"]},"category_name":{"type":["string","null"]},"multiple_materials":{"type":"boolean"},"observed_categories":{"type":"array","items":{"type":"string"}},"evidence":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["page_no","segment","modality","decision","category","reason","multiple_materials"],"properties":{"page_no":{"type":"integer","minimum":1},"segment":{"type":"integer","minimum":1},"modality":{"type":"string","enum":["vision","text"]},"decision":{"type":"string","enum":["matched","uncertain","none"]},"category":{"type":["string","null"]},"reason":{"type":"string","minLength":1,"maxLength":1000},"multiple_materials":{"type":"boolean"}}}}}}},"usage":{"type":"object","additionalProperties":false,"required":["model_calls","input_tokens","output_tokens"],"properties":{"model_calls":{"type":"integer","minimum":0},"input_tokens":{"type":["integer","null"],"minimum":0},"output_tokens":{"type":["integer","null"],"minimum":0}}}}},{"type":"object","additionalProperties":false,"required":["rule","source_doc_id","source_sha256","plan_sha256","split_goal","warnings","schema_version","action","space_id","source_page_count","models","status","page_ranges","boundaries"],"properties":{"rule":{"const":"semantic"},"source_doc_id":{"type":"integer","minimum":1},"source_sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"},"plan_sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"},"split_goal":{"type":"string","enum":["documents","chapters"]},"warnings":{"type":"array","items":{"type":"string"}},"schema_version":{"const":"semantic_split_plan_v1"},"action":{"const":"plan"},"space_id":{"type":"integer","minimum":1},"source_page_count":{"type":"integer","minimum":1},"models":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["proposed","needs_confirmation"]},"page_ranges":{"type":"array","minItems":1,"items":{"type":"array","minItems":2,"maxItems":2,"items":{"type":"integer","minimum":1}}},"boundaries":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["before_page","decision","reason","context_pages"],"properties":{"before_page":{"type":"integer","minimum":2},"decision":{"type":"string","enum":["split","continue","uncertain"]},"reason":{"type":"string","minLength":1,"maxLength":1000},"context_pages":{"type":"array","minItems":2,"items":{"type":"integer","minimum":1}}}}}}},{"type":"object","additionalProperties":false,"required":["rule","source_doc_id","source_sha256","plan_sha256","split_goal","warnings","schema_version","action","plan_job_id","part_count","doc_ids","parts"],"properties":{"rule":{"const":"semantic"},"source_doc_id":{"type":"integer","minimum":1},"source_sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"},"plan_sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"},"split_goal":{"type":"string","enum":["documents","chapters"]},"warnings":{"type":"array","items":{"type":"string"}},"schema_version":{"const":"semantic_split_result_v1"},"action":{"const":"execute"},"plan_job_id":{"type":"string","pattern":"^[a-f0-9]{32}$"},"part_count":{"type":"integer","minimum":1},"doc_ids":{"type":"array","minItems":1,"items":{"type":"integer","minimum":1}},"parts":{"type":"array","minItems":1,"items":{"type":"object","additionalProperties":false,"required":["index","page_start","page_end","page_count","file_name","sha256","size_bytes","doc_id"],"properties":{"index":{"type":"integer","minimum":1},"page_start":{"type":"integer","minimum":1},"page_end":{"type":"integer","minimum":1},"page_count":{"type":"integer","minimum":1},"size_bytes":{"type":"integer","minimum":1},"doc_id":{"type":"integer","minimum":1},"file_name":{"type":"string"},"sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"}}}}}},{"type":"object","additionalProperties":false,"required":["schema_version","source_doc_id","source_sha256","status","reason","model","coordinate_system","raw_width","raw_height","oriented_width","oriented_height","raw_to_oriented","region_count","output_count","regions"],"properties":{"schema_version":{"const":"document_segmentation_v1"},"source_doc_id":{"type":"integer","minimum":1},"boundary_method":{"type":"string","enum":["model","pixel"]},"source_sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"},"status":{"type":"string","enum":["completed","needs_review","no_targets"]},"reason":{"type":"string","minLength":1,"maxLength":1000},"model":{"type":"string"},"coordinate_system":{"const":"raw_pixel_edges"},"raw_width":{"type":"integer","minimum":1},"raw_height":{"type":"integer","minimum":1},"oriented_width":{"type":"integer","minimum":1},"oriented_height":{"type":"integer","minimum":1},"raw_to_oriented":{"type":"array","minItems":3,"maxItems":3,"items":{"type":"array","minItems":3,"maxItems":3,"items":{"type":"number"}}},"region_count":{"type":"integer","minimum":0},"output_count":{"type":"integer","minimum":0},"regions":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["index","status","reason","review_reasons","doc_id","file_name","polygon","oriented_polygon","crop_polygon","raw_to_output","width","height","rectified","angle_degrees","sha256","size_bytes"],"properties":{"index":{"type":"integer","minimum":1},"status":{"type":"string","enum":["cropped","needs_review"]},"reason":{"type":"string","minLength":1,"maxLength":1000},"review_reasons":{"type":"array","items":{"type":"string","enum":["detection_uncertain","boundary_uncertain","overlapping_regions","boundary_component_missing","boundary_component_fragmented","boundary_component_shared","boundary_background_candidate","boundary_component_touches_frame","boundary_contour_ambiguous","boundary_contour_degenerate","boundary_fit_outside_image","boundary_corner_correspondence_ambiguous","boundary_not_straight_sided","boundary_refinement_not_converged","boundary_initialization_disagreement","boundary_confirmation_budget_exhausted"]}},"doc_id":{"type":["integer","null"],"minimum":1},"file_name":{"type":["string","null"]},"polygon":{"type":"array","minItems":4,"maxItems":4,"items":{"type":"array","minItems":2,"maxItems":2,"items":{"type":"number","minimum":0}}},"oriented_polygon":{"type":"array","minItems":4,"maxItems":4,"items":{"type":"array","minItems":2,"maxItems":2,"items":{"type":"number","minimum":0}}},"detection_polygon":{"type":"array","minItems":4,"maxItems":4,"items":{"type":"array","minItems":2,"maxItems":2,"items":{"type":"number","minimum":0}}},"crop_polygon":{"type":["array","null"],"minItems":4,"maxItems":4,"items":{"type":"array","minItems":2,"maxItems":2,"items":{"type":"number","minimum":0}}},"raw_to_output":{"type":["array","null"],"minItems":3,"maxItems":3,"items":{"type":"array","minItems":3,"maxItems":3,"items":{"type":"number"}}},"width":{"type":["integer","null"],"minimum":1},"height":{"type":["integer","null"],"minimum":1},"size_bytes":{"type":["integer","null"],"minimum":1},"rectified":{"type":["boolean","null"]},"angle_degrees":{"type":["number","null"],"minimum":-180,"maximum":180},"sha256":{"type":["string","null"],"pattern":"^[a-f0-9]{64}$"}}}}}},{"type":"object","additionalProperties":false,"required":["schema_version","source_doc_id","source_sha256","duration_ms","language","status","text","segments","speakers","keywords","usage"],"properties":{"schema_version":{"type":"string","const":"audio_analysis_v1"},"source_doc_id":{"type":"integer","minimum":1},"source_sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"},"duration_ms":{"type":"integer","minimum":1},"language":{"type":["string","null"],"description":"供应方未提供可核验语言信息时为 null，不按文字猜测语言。"},"status":{"type":"string","enum":["completed","needs_review","no_speech"]},"text":{"type":"string"},"speakers":{"type":"array","items":{"type":"string","pattern":"^speaker_[1-9][0-9]*$"}},"segments":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["index","start_ms","end_ms","provider_start_ms","provider_end_ms","review_reasons","text","speaker_id"],"properties":{"index":{"type":"integer","minimum":1},"start_ms":{"type":"integer","minimum":0},"end_ms":{"type":"integer","minimum":0},"provider_start_ms":{"type":"integer","minimum":0},"provider_end_ms":{"type":"integer","minimum":0},"review_reasons":{"type":"array","items":{"type":"string","enum":["unknown_speaker","timestamp_outside_audio"]}},"text":{"type":"string"},"speaker_id":{"type":["string","null"],"pattern":"^speaker_[1-9][0-9]*$"}}}},"keywords":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["text","evidence"],"properties":{"text":{"type":"string"},"evidence":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["segment_index","start_ms","end_ms","char_start","char_end","time_granularity"],"properties":{"segment_index":{"type":"integer","minimum":1},"start_ms":{"type":"integer","minimum":0},"end_ms":{"type":"integer","minimum":0},"char_start":{"type":"integer","minimum":0},"char_end":{"type":"integer","minimum":0},"time_granularity":{"type":"string","const":"segment"}}}}}}},"keywords_status":{"type":"string","enum":["completed","not_applicable","unavailable"]},"keywords_error":{"type":["string","null"]},"usage":{"type":"object","additionalProperties":false,"required":["transcription","keywords"],"properties":{"transcription":{"type":"object","additionalProperties":false,"required":["duration","input_tokens","output_tokens"],"properties":{"duration":{"type":["integer","null"],"minimum":0},"input_tokens":{"type":["integer","null"],"minimum":0},"output_tokens":{"type":["integer","null"],"minimum":0}}},"keywords":{"oneOf":[{"type":"object","additionalProperties":false,"required":[],"properties":{"model":{"type":"string"},"input_tokens":{"type":["integer","null"],"minimum":0},"output_tokens":{"type":["integer","null"],"minimum":0},"duration_ms":{"type":["integer","null"],"minimum":0}}},{"type":"null"}]}}}}},{"type":"object","additionalProperties":false,"required":["schema_version","source_doc_id","source_sha256","status","review_required","artifacts","checks"],"properties":{"schema_version":{"type":"string","const":"watermark_removal_v1"},"source_doc_id":{"type":"integer","minimum":1},"source_sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"},"status":{"type":"string","enum":["no_watermark","needs_review"]},"review_required":{"type":"boolean"},"result_type":{"type":"string","enum":["review_candidate","reconstruction_preview","no_artifact"],"description":"纯照片重建预览可能改变五官或背景，不代表保真恢复；必须结合warnings人工确认。历史结果可省略。"},"warnings":{"type":"array","items":{"type":"string"}},"review_reasons":{"type":"array","description":"未发布候选或已有候选的风险原因；不包含原图文字或模型原始响应。历史结果可省略。","items":{"type":"string","enum":["detection_uncertain","protection_incomplete","protected_mark_overlap","localization_inconsistent","restriction_has_no_editable_pixels","blend_budget_exceeded","boundary_blend_unavailable","editor_unavailable","protected_pixels_changed","text_fidelity_failed","table_fidelity_failed","no_pixels_changed","residual_review_failed","candidate_unavailable","photo_scope_unconfirmed","photo_reconstruction","photo_fidelity_unverified"]}},"artifacts":{"oneOf":[{"type":"array","maxItems":0,"items":{"type":"object","additionalProperties":false,"required":["kind","doc_id","file_name","sha256","size_bytes","width","height"],"properties":{"kind":{"type":"string","enum":["candidate","reconstruction_preview","change_mask"]},"doc_id":{"type":"integer","minimum":1},"file_name":{"type":"string"},"sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"},"size_bytes":{"type":"integer","minimum":1},"width":{"type":"integer","minimum":1},"height":{"type":"integer","minimum":1}}}},{"type":"array","minItems":2,"maxItems":2,"items":{"type":"object","additionalProperties":false,"required":["kind","doc_id","file_name","sha256","size_bytes","width","height"],"properties":{"kind":{"type":"string","enum":["candidate","reconstruction_preview","change_mask"]},"doc_id":{"type":"integer","minimum":1},"file_name":{"type":"string"},"sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"},"size_bytes":{"type":"integer","minimum":1},"width":{"type":"integer","minimum":1},"height":{"type":"integer","minimum":1}}}}]},"checks":{"type":"object","additionalProperties":false,"required":["text","tables","residual"],"properties":{"photos":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["verdict"],"properties":{"verdict":{"type":"string","enum":["preserved","changed","uncertain"]}}}},"text":{"oneOf":[{"type":"null"},{"type":"object","additionalProperties":false,"required":["matched_words","reasons","source_indices","candidate_indices"],"properties":{"matched_words":{"type":"integer","minimum":0},"reasons":{"type":"array","items":{"type":"string"}},"source_indices":{"type":"array","items":{"type":"integer","minimum":0}},"candidate_indices":{"type":"array","items":{"type":"integer","minimum":0}},"watermark_source_indices":{"type":"array","items":{"type":"integer","minimum":0}},"unchanged_source_indices":{"type":"array","items":{"type":"integer","minimum":0}}}}]},"tables":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["source_tables","table_fidelity","issues"],"properties":{"source_tables":{"type":"string","enum":["present","none","uncertain"]},"table_fidelity":{"type":"string","enum":["preserved","changed","uncertain","not_applicable"]},"issues":{"type":"array","items":{"type":"string"}}}}},"residual":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["coverage","elements"],"properties":{"coverage":{"type":"string","enum":["complete","uncertain"]},"elements":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["kind","box"],"properties":{"kind":{"type":"string","enum":["watermark_text","watermark_corner","watermark_graphic","watermark_fragment","stamp","signature","photo","logo","uncertain"]},"box":{"type":"array","minItems":4,"maxItems":4,"items":{"type":"integer","minimum":0,"maximum":1000}}}}}}}}}}}},{"type":"object","additionalProperties":false,"required":["results"],"properties":{"results":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["doc_id","fields"],"properties":{"doc_id":{"type":"integer","minimum":1},"fields":{"type":"object","additionalProperties":{"type":"object","additionalProperties":false,"required":["value","source"],"properties":{"value":{},"source":{"type":"object","additionalProperties":false,"required":["doc_id","page","quote","bbox"],"properties":{"doc_id":{"type":"integer","minimum":1},"page":{"type":["integer","null"],"minimum":1},"quote":{"type":["string","null"]},"bbox":{"type":["array","null"],"minItems":4,"maxItems":4,"items":{"type":"number"}},"segment_id":{"type":"string","minLength":1,"maxLength":128},"space_id":{"type":["string","null"],"enum":["canonical_pdf_points",null]},"content_version":{"type":["string","null"],"minLength":1,"maxLength":128},"calibration_status":{"type":"string","enum":["ready","unavailable"]},"calibration_reason":{"type":["string","null"],"minLength":1,"maxLength":128},"asset":{"oneOf":[{"type":"object","additionalProperties":false,"required":["kind","page_id","href","content_version"],"properties":{"kind":{"const":"page_pdf"},"page_id":{"type":"integer","minimum":1},"href":{"type":"string","pattern":"^/open/v1/document-pages/[1-9][0-9]*/assets/pdf$"},"content_version":{"type":"string","minLength":1,"maxLength":128}}},{"type":"null"}]}}}}}}}}}}},{"type":"object","additionalProperties":false,"required":["schema_version","results"],"properties":{"schema_version":{"type":"string","enum":["extraction_evidence_v1"]},"results":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["doc_id","fields"],"properties":{"doc_id":{"type":"integer","minimum":1},"fields":{"type":"object","additionalProperties":{"type":"object","additionalProperties":false,"required":["value","source","evidence"],"properties":{"value":{},"source":{"type":"object","additionalProperties":false,"required":["doc_id","page","quote","bbox","segment_id","space_id","content_version","calibration_status","calibration_reason","asset"],"properties":{"doc_id":{"type":"integer","minimum":1},"page":{"type":["integer","null"],"minimum":1},"quote":{"type":["string","null"]},"bbox":{"type":["array","null"],"minItems":4,"maxItems":4,"items":{"type":"number"}},"segment_id":{"type":"string","minLength":1,"maxLength":128},"space_id":{"type":["string","null"],"enum":["canonical_pdf_points",null]},"content_version":{"type":["string","null"],"minLength":1,"maxLength":128},"calibration_status":{"type":"string","enum":["ready","unavailable"]},"calibration_reason":{"type":["string","null"],"minLength":1,"maxLength":128},"asset":{"oneOf":[{"type":"object","additionalProperties":false,"required":["kind","page_id","href","content_version"],"properties":{"kind":{"const":"page_pdf"},"page_id":{"type":"integer","minimum":1},"href":{"type":"string","pattern":"^/open/v1/document-pages/[1-9][0-9]*/assets/pdf$"},"content_version":{"type":"string","minLength":1,"maxLength":128}}},{"type":"null"}]}}},"evidence":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["value_path","doc_id","page","quote","bbox","segment_id","space_id","content_version","calibration_status","calibration_reason","asset"],"properties":{"value_path":{"type":"string","pattern":"^(?:/(?:~[01]|[^~/])*)*$"},"doc_id":{"type":"integer","minimum":1},"page":{"type":["integer","null"],"minimum":1},"quote":{"type":["string","null"]},"bbox":{"type":["array","null"],"minItems":4,"maxItems":4,"items":{"type":"number"}},"segment_id":{"type":"string","minLength":1,"maxLength":128},"space_id":{"type":["string","null"],"enum":["canonical_pdf_points",null]},"content_version":{"type":["string","null"],"minLength":1,"maxLength":128},"calibration_status":{"type":"string","enum":["ready","unavailable"]},"calibration_reason":{"type":["string","null"],"minLength":1,"maxLength":128},"asset":{"oneOf":[{"type":"object","additionalProperties":false,"required":["kind","page_id","href","content_version"],"properties":{"kind":{"const":"page_pdf"},"page_id":{"type":"integer","minimum":1},"href":{"type":"string","pattern":"^/open/v1/document-pages/[1-9][0-9]*/assets/pdf$"},"content_version":{"type":"string","minLength":1,"maxLength":128}}},{"type":"null"}]}}}}}}}}}}}},{"type":"object","additionalProperties":false,"required":["text","files"],"properties":{"degraded":{"type":"boolean"},"degraded_reason":{"type":["string","null"]},"text":{"type":"string","minLength":1},"files":{"type":"array","minItems":0,"items":{"type":"object","additionalProperties":true,"required":["doc_id","name"],"properties":{"doc_id":{"type":"integer","minimum":1},"name":{"type":"string"}}}}}},{"type":"object","additionalProperties":false,"required":["left","right","options","diff_count","diffs"],"properties":{"left":{"type":"object","additionalProperties":false,"required":["doc_id","name"],"properties":{"doc_id":{"type":"integer","minimum":1},"name":{"type":"string"}}},"right":{"type":"object","additionalProperties":false,"required":["doc_id","name"],"properties":{"doc_id":{"type":"integer","minimum":1},"name":{"type":"string"}}},"options":{"type":"object","additionalProperties":false,"required":["ignore_punctuation","ignore_full_half_width","ignore_case"],"properties":{"ignore_punctuation":{"type":"boolean"},"ignore_full_half_width":{"type":"boolean"},"ignore_case":{"type":"boolean"}}},"diff_count":{"type":"integer","minimum":0},"diffs":{"type":"array","items":{"type":"object","additionalProperties":true}}}},{"type":"object","additionalProperties":false,"required":["schema_version","left","right","options","diff_count","diffs"],"properties":{"schema_version":{"type":"string","enum":["comparison_structured_v1"]},"left":{"type":"object","additionalProperties":false,"required":["doc_id","name","content_version"],"properties":{"doc_id":{"type":"integer","minimum":1},"name":{"type":"string"},"content_version":{"type":"string","minLength":1,"maxLength":128}}},"right":{"type":"object","additionalProperties":false,"required":["doc_id","name","content_version"],"properties":{"doc_id":{"type":"integer","minimum":1},"name":{"type":"string"},"content_version":{"type":"string","minLength":1,"maxLength":128}}},"options":{"type":"object","additionalProperties":false,"required":["ignore_punctuation","ignore_full_half_width","ignore_case"],"properties":{"ignore_punctuation":{"type":"boolean"},"ignore_full_half_width":{"type":"boolean"},"ignore_case":{"type":"boolean"}}},"diff_count":{"type":"integer","minimum":0},"diffs":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["diff_id","type","operation","left","right"],"properties":{"diff_id":{"type":"string","minLength":1,"maxLength":32},"type":{"type":"string","enum":["text","table"]},"operation":{"type":"string","enum":["differ","insert","delete"]},"left":{"oneOf":[{"type":"object","additionalProperties":false,"required":["doc_id","text","runs","locations","table"],"properties":{"doc_id":{"type":"integer","minimum":1},"text":{"type":"string"},"runs":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["operation","text"],"properties":{"operation":{"type":"string","enum":["equal","insert","delete"]},"text":{"type":"string"}}}},"locations":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["page","segment_id","bbox"],"properties":{"page":{"type":["integer","null"],"minimum":1},"segment_id":{"type":["string","null"],"minLength":1,"maxLength":128},"bbox":{"type":["array","null"],"minItems":4,"maxItems":4,"items":{"type":"number"}}}}},"table":{"oneOf":[{"type":"object","additionalProperties":false,"required":["rows"],"properties":{"rows":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["row_index","cells"],"properties":{"row_index":{"type":"integer","minimum":0},"cells":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["row_index","column_index","row_span","column_span","text","runs","location"],"properties":{"row_index":{"type":"integer","minimum":0},"column_index":{"type":"integer","minimum":0},"row_span":{"type":"integer","minimum":1},"column_span":{"type":"integer","minimum":1},"text":{"type":"string"},"runs":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["operation","text"],"properties":{"operation":{"type":"string","enum":["equal","insert","delete"]},"text":{"type":"string"}}}},"location":{"type":"object","additionalProperties":false,"required":["page","segment_id","bbox"],"properties":{"page":{"type":["integer","null"],"minimum":1},"segment_id":{"type":["string","null"],"minLength":1,"maxLength":128},"bbox":{"type":["array","null"],"minItems":4,"maxItems":4,"items":{"type":"number"}}}}}}}}}}}},{"type":"null"}]}}},{"type":"null"}]},"right":{"oneOf":[{"type":"object","additionalProperties":false,"required":["doc_id","text","runs","locations","table"],"properties":{"doc_id":{"type":"integer","minimum":1},"text":{"type":"string"},"runs":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["operation","text"],"properties":{"operation":{"type":"string","enum":["equal","insert","delete"]},"text":{"type":"string"}}}},"locations":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["page","segment_id","bbox"],"properties":{"page":{"type":["integer","null"],"minimum":1},"segment_id":{"type":["string","null"],"minLength":1,"maxLength":128},"bbox":{"type":["array","null"],"minItems":4,"maxItems":4,"items":{"type":"number"}}}}},"table":{"oneOf":[{"type":"object","additionalProperties":false,"required":["rows"],"properties":{"rows":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["row_index","cells"],"properties":{"row_index":{"type":"integer","minimum":0},"cells":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["row_index","column_index","row_span","column_span","text","runs","location"],"properties":{"row_index":{"type":"integer","minimum":0},"column_index":{"type":"integer","minimum":0},"row_span":{"type":"integer","minimum":1},"column_span":{"type":"integer","minimum":1},"text":{"type":"string"},"runs":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["operation","text"],"properties":{"operation":{"type":"string","enum":["equal","insert","delete"]},"text":{"type":"string"}}}},"location":{"type":"object","additionalProperties":false,"required":["page","segment_id","bbox"],"properties":{"page":{"type":["integer","null"],"minimum":1},"segment_id":{"type":["string","null"],"minLength":1,"maxLength":128},"bbox":{"type":["array","null"],"minItems":4,"maxItems":4,"items":{"type":"number"}}}}}}}}}}}},{"type":"null"}]}}},{"type":"null"}]}}}}}},{"type":"object","additionalProperties":false,"required":["schema_version","left","right","options","diff_count","diffs"],"properties":{"schema_version":{"type":"string","enum":["comparison_structured_v2"]},"left":{"type":"object","additionalProperties":false,"required":["doc_id","name","content_version"],"properties":{"doc_id":{"type":"integer","minimum":1},"name":{"type":"string"},"content_version":{"type":"string","minLength":1,"maxLength":128}}},"right":{"type":"object","additionalProperties":false,"required":["doc_id","name","content_version"],"properties":{"doc_id":{"type":"integer","minimum":1},"name":{"type":"string"},"content_version":{"type":"string","minLength":1,"maxLength":128}}},"options":{"type":"object","additionalProperties":false,"required":["ignore_punctuation","ignore_full_half_width","ignore_case"],"properties":{"ignore_punctuation":{"type":"boolean"},"ignore_full_half_width":{"type":"boolean"},"ignore_case":{"type":"boolean"}}},"diff_count":{"type":"integer","minimum":0},"diffs":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["diff_id","type","operation","left","right"],"properties":{"diff_id":{"type":"string","minLength":1,"maxLength":32},"type":{"type":"string","enum":["text","table"]},"operation":{"type":"string","enum":["differ","insert","delete"]},"left":{"oneOf":[{"type":"object","additionalProperties":false,"required":["doc_id","text","runs","locations","table"],"properties":{"doc_id":{"type":"integer","minimum":1},"text":{"type":"string"},"runs":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["operation","text"],"properties":{"operation":{"type":"string","enum":["equal","insert","delete"]},"text":{"type":"string"}}}},"locations":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["page","segment_id","kind","granularity","localization_quality","space_id","bbox","primary","calibration_status","calibration_reason","asset"],"properties":{"page":{"type":"integer","minimum":1},"segment_id":{"type":"string","minLength":1,"maxLength":128},"kind":{"type":"string","enum":["content","anchor"]},"granularity":{"type":"string","enum":["segment","line","block","page"]},"localization_quality":{"type":"string","enum":["authoritative","container","anchor"]},"space_id":{"const":"canonical_pdf_points"},"bbox":{"type":["array","null"],"minItems":4,"maxItems":4,"items":{"type":"number"}},"primary":{"type":"boolean"},"calibration_status":{"type":"string","enum":["ready","unavailable"]},"calibration_reason":{"type":["string","null"],"maxLength":128},"asset":{"oneOf":[{"type":"object","additionalProperties":false,"required":["kind","page_id","href","content_version"],"properties":{"kind":{"const":"page_pdf"},"page_id":{"type":"integer","minimum":1},"href":{"type":"string","pattern":"^/open/v1/document-pages/[1-9][0-9]*/assets/pdf$"},"content_version":{"type":"string","minLength":1,"maxLength":128}}},{"type":"null"}]}}}},"table":{"oneOf":[{"type":"object","additionalProperties":false,"required":["rows"],"properties":{"rows":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["row_index","cells"],"properties":{"row_index":{"type":"integer","minimum":0},"cells":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["row_index","column_index","row_span","column_span","text","runs","location"],"properties":{"row_index":{"type":"integer","minimum":0},"column_index":{"type":"integer","minimum":0},"row_span":{"type":"integer","minimum":1},"column_span":{"type":"integer","minimum":1},"text":{"type":"string"},"runs":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["operation","text"],"properties":{"operation":{"type":"string","enum":["equal","insert","delete"]},"text":{"type":"string"}}}},"location":{"type":"object","additionalProperties":false,"required":["page","segment_id","kind","granularity","localization_quality","space_id","bbox","primary","calibration_status","calibration_reason","asset"],"properties":{"page":{"type":"integer","minimum":1},"segment_id":{"type":"string","minLength":1,"maxLength":128},"kind":{"type":"string","enum":["content","anchor"]},"granularity":{"type":"string","enum":["segment","line","block","page"]},"localization_quality":{"type":"string","enum":["authoritative","container","anchor"]},"space_id":{"const":"canonical_pdf_points"},"bbox":{"type":["array","null"],"minItems":4,"maxItems":4,"items":{"type":"number"}},"primary":{"type":"boolean"},"calibration_status":{"type":"string","enum":["ready","unavailable"]},"calibration_reason":{"type":["string","null"],"maxLength":128},"asset":{"oneOf":[{"type":"object","additionalProperties":false,"required":["kind","page_id","href","content_version"],"properties":{"kind":{"const":"page_pdf"},"page_id":{"type":"integer","minimum":1},"href":{"type":"string","pattern":"^/open/v1/document-pages/[1-9][0-9]*/assets/pdf$"},"content_version":{"type":"string","minLength":1,"maxLength":128}}},{"type":"null"}]}}}}}}}}}}},{"type":"null"}]}}},{"type":"null"}]},"right":{"oneOf":[{"type":"object","additionalProperties":false,"required":["doc_id","text","runs","locations","table"],"properties":{"doc_id":{"type":"integer","minimum":1},"text":{"type":"string"},"runs":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["operation","text"],"properties":{"operation":{"type":"string","enum":["equal","insert","delete"]},"text":{"type":"string"}}}},"locations":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["page","segment_id","kind","granularity","localization_quality","space_id","bbox","primary","calibration_status","calibration_reason","asset"],"properties":{"page":{"type":"integer","minimum":1},"segment_id":{"type":"string","minLength":1,"maxLength":128},"kind":{"type":"string","enum":["content","anchor"]},"granularity":{"type":"string","enum":["segment","line","block","page"]},"localization_quality":{"type":"string","enum":["authoritative","container","anchor"]},"space_id":{"const":"canonical_pdf_points"},"bbox":{"type":["array","null"],"minItems":4,"maxItems":4,"items":{"type":"number"}},"primary":{"type":"boolean"},"calibration_status":{"type":"string","enum":["ready","unavailable"]},"calibration_reason":{"type":["string","null"],"maxLength":128},"asset":{"oneOf":[{"type":"object","additionalProperties":false,"required":["kind","page_id","href","content_version"],"properties":{"kind":{"const":"page_pdf"},"page_id":{"type":"integer","minimum":1},"href":{"type":"string","pattern":"^/open/v1/document-pages/[1-9][0-9]*/assets/pdf$"},"content_version":{"type":"string","minLength":1,"maxLength":128}}},{"type":"null"}]}}}},"table":{"oneOf":[{"type":"object","additionalProperties":false,"required":["rows"],"properties":{"rows":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["row_index","cells"],"properties":{"row_index":{"type":"integer","minimum":0},"cells":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["row_index","column_index","row_span","column_span","text","runs","location"],"properties":{"row_index":{"type":"integer","minimum":0},"column_index":{"type":"integer","minimum":0},"row_span":{"type":"integer","minimum":1},"column_span":{"type":"integer","minimum":1},"text":{"type":"string"},"runs":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["operation","text"],"properties":{"operation":{"type":"string","enum":["equal","insert","delete"]},"text":{"type":"string"}}}},"location":{"type":"object","additionalProperties":false,"required":["page","segment_id","kind","granularity","localization_quality","space_id","bbox","primary","calibration_status","calibration_reason","asset"],"properties":{"page":{"type":"integer","minimum":1},"segment_id":{"type":"string","minLength":1,"maxLength":128},"kind":{"type":"string","enum":["content","anchor"]},"granularity":{"type":"string","enum":["segment","line","block","page"]},"localization_quality":{"type":"string","enum":["authoritative","container","anchor"]},"space_id":{"const":"canonical_pdf_points"},"bbox":{"type":["array","null"],"minItems":4,"maxItems":4,"items":{"type":"number"}},"primary":{"type":"boolean"},"calibration_status":{"type":"string","enum":["ready","unavailable"]},"calibration_reason":{"type":["string","null"],"maxLength":128},"asset":{"oneOf":[{"type":"object","additionalProperties":false,"required":["kind","page_id","href","content_version"],"properties":{"kind":{"const":"page_pdf"},"page_id":{"type":"integer","minimum":1},"href":{"type":"string","pattern":"^/open/v1/document-pages/[1-9][0-9]*/assets/pdf$"},"content_version":{"type":"string","minLength":1,"maxLength":128}}},{"type":"null"}]}}}}}}}}}}},{"type":"null"}]}}},{"type":"null"}]}}}}}},{"type":"object","additionalProperties":false,"required":["nodes","adjacency","entry_node_ids","execution_levels"],"properties":{"nodes":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["id","name","rule","type","comment_required","category_codes","indicator_names"],"properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z][A-Za-z0-9_.:-]{0,63}$"},"name":{"type":"string","minLength":1,"maxLength":256},"rule":{"type":"string","minLength":1,"maxLength":12000},"type":{"type":"integer","minimum":1,"maximum":4},"comment_required":{"type":"boolean"},"category_codes":{"type":"array","minItems":1,"maxItems":50,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":128}},"indicator_names":{"type":"array","minItems":0,"maxItems":100,"uniqueItems":true,"description":"节点消费的指标名称；必须来自请求提供的指标闭集，且在每个适用类别里都存在。空数组表示适用类别的全部指标（跨类别规则各类别指标集不同时用这个）。","items":{"type":"string","minLength":1,"maxLength":256}},"predicate":{"type":"object","description":"判定式（可选）：规则编译成的封闭 JSON 表达式，给出时该节点由代码确定性执行、不调模型，结论为 pass / fail / insufficient（引用字段缺失即证据不足）。语法：op 为 and/or/not、forall/exists（var、category、可选 where、assert）、eq/ne/contains/in/gt/ge/lt/le（left、right、mode 为 text/number/date）、present（arg）；取值为 {doc, field}、{business: 路径，列表用 标的物[].出厂编号}、{const}。只能引用请求里的类别与该类别的指标。"}}}},"adjacency":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"entry_node_ids":{"type":"array","items":{"type":"string"}},"execution_levels":{"type":"array","items":{"type":"array","items":{"type":"string"}}}}},{"type":"object","additionalProperties":false,"required":["passed","documents","node_results","execution_levels"],"properties":{"degraded":{"type":"boolean"},"degraded_reason":{"type":["string","null"]},"passed":{"type":"boolean"},"documents":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["doc_id","name","classification_state","category_code","classification_reason","classification_confidence","fields"],"properties":{"doc_id":{"type":"integer","minimum":1},"name":{"type":"string"},"classification_state":{"type":"string","enum":["matched","out_of_scope","uncertain"]},"category_code":{"type":["string","null"]},"classification_reason":{"type":"string","minLength":1},"classification_confidence":{"type":["number","null"],"minimum":0,"maximum":1},"fields":{"type":"object","additionalProperties":{"oneOf":[{"type":"object","additionalProperties":false,"required":["value","source"],"properties":{"value":{},"source":{"type":"object","additionalProperties":false,"required":["doc_id","page","quote","bbox"],"properties":{"doc_id":{"type":"integer","minimum":1},"page":{"type":["integer","null"],"minimum":1},"quote":{"type":["string","null"]},"bbox":{"type":["array","null"],"minItems":4,"maxItems":4,"items":{"type":"number"}},"segment_id":{"type":"string","minLength":1,"maxLength":128},"space_id":{"type":["string","null"],"enum":["canonical_pdf_points",null]},"content_version":{"type":["string","null"],"minLength":1,"maxLength":128},"calibration_status":{"type":"string","enum":["ready","unavailable"]},"calibration_reason":{"type":["string","null"],"minLength":1,"maxLength":128},"asset":{"oneOf":[{"type":"object","additionalProperties":false,"required":["kind","page_id","href","content_version"],"properties":{"kind":{"const":"page_pdf"},"page_id":{"type":"integer","minimum":1},"href":{"type":"string","pattern":"^/open/v1/document-pages/[1-9][0-9]*/assets/pdf$"},"content_version":{"type":"string","minLength":1,"maxLength":128}}},{"type":"null"}]}}}}},{"type":"object","additionalProperties":false,"required":["value","source","evidence"],"properties":{"value":{},"source":{"type":"object","additionalProperties":false,"required":["doc_id","page","quote","bbox","segment_id","space_id","content_version","calibration_status","calibration_reason","asset"],"properties":{"doc_id":{"type":"integer","minimum":1},"page":{"type":["integer","null"],"minimum":1},"quote":{"type":["string","null"]},"bbox":{"type":["array","null"],"minItems":4,"maxItems":4,"items":{"type":"number"}},"segment_id":{"type":"string","minLength":1,"maxLength":128},"space_id":{"type":["string","null"],"enum":["canonical_pdf_points",null]},"content_version":{"type":["string","null"],"minLength":1,"maxLength":128},"calibration_status":{"type":"string","enum":["ready","unavailable"]},"calibration_reason":{"type":["string","null"],"minLength":1,"maxLength":128},"asset":{"oneOf":[{"type":"object","additionalProperties":false,"required":["kind","page_id","href","content_version"],"properties":{"kind":{"const":"page_pdf"},"page_id":{"type":"integer","minimum":1},"href":{"type":"string","pattern":"^/open/v1/document-pages/[1-9][0-9]*/assets/pdf$"},"content_version":{"type":"string","minLength":1,"maxLength":128}}},{"type":"null"}]}}},"evidence":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["value_path","doc_id","page","quote","bbox","segment_id","space_id","content_version","calibration_status","calibration_reason","asset"],"properties":{"value_path":{"type":"string","pattern":"^(?:/(?:~[01]|[^~/])*)*$"},"doc_id":{"type":"integer","minimum":1},"page":{"type":["integer","null"],"minimum":1},"quote":{"type":["string","null"]},"bbox":{"type":["array","null"],"minItems":4,"maxItems":4,"items":{"type":"number"}},"segment_id":{"type":"string","minLength":1,"maxLength":128},"space_id":{"type":["string","null"],"enum":["canonical_pdf_points",null]},"content_version":{"type":["string","null"],"minLength":1,"maxLength":128},"calibration_status":{"type":"string","enum":["ready","unavailable"]},"calibration_reason":{"type":["string","null"],"minLength":1,"maxLength":128},"asset":{"oneOf":[{"type":"object","additionalProperties":false,"required":["kind","page_id","href","content_version"],"properties":{"kind":{"const":"page_pdf"},"page_id":{"type":"integer","minimum":1},"href":{"type":"string","pattern":"^/open/v1/document-pages/[1-9][0-9]*/assets/pdf$"},"content_version":{"type":"string","minLength":1,"maxLength":128}}},{"type":"null"}]}}}}}}]}}}}},"node_results":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["node_id","name","status","passed","reason","depends_on"],"properties":{"node_id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["completed","skipped","failed"],"description":"completed 已得出结论;skipped 没有可审的文档或指标;failed 调用失败、未得出结论(passed 为 false 仅表示不能算通过)。"},"passed":{"type":"boolean"},"reason":{"type":"string","minLength":1},"error_code":{"type":"string","description":"仅 status=failed 时出现,失败的错误码。"},"verdict":{"type":"string","enum":["pass","fail","insufficient"],"description":"判定式节点的三值结论;insufficient 表示引用的字段缺失、证据不足。"},"evaluation":{"type":"string","enum":["predicate","model"],"description":"结论由谁得出:predicate 判定式代码执行;缺省为模型判定。"},"predicate_text":{"type":"string","description":"判定式的中文读法,由代码从判定式生成,即实际执行的内容。"},"trace":{"type":"array","items":{"type":"object"},"description":"判定式执行记录:每一步比较的两侧取值与出处(文档、字段)。"},"depends_on":{"type":"array","items":{"type":"string"}}}}},"execution_levels":{"type":"array","items":{"type":"array","items":{"type":"string"}}}}},{"type":"object","additionalProperties":false,"required":["predicates","language","compiler"],"properties":{"predicates":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["id","status","reason","cached"],"properties":{"id":{"type":"string"},"status":{"type":"string","enum":["compiled","semantic","error"]},"predicate":{"type":["object","null"]},"predicate_text":{"type":["string","null"]},"reason":{"type":"string"},"error_code":{"type":"string"},"cached":{"type":"boolean"},"cache_key":{"type":"string"}}}},"language":{"type":"string"},"compiler":{"type":"string"}}},{"type":"object","additionalProperties":false,"required":["schema_version","order"],"properties":{"schema_version":{"type":"string","enum":["document_archive_images_order_v1"]},"order":{"type":"array","minItems":2,"maxItems":200,"items":{"type":"integer","minimum":0}}}},{"type":"object","additionalProperties":false,"required":["input_mode","result_format","offset_unit","interval","options","left_text","right_text","diff_count","segments"],"properties":{"input_mode":{"const":"direct"},"result_format":{"const":"text_v1"},"offset_unit":{"const":"utf16_code_unit"},"interval":{"const":"[start,end)"},"options":{"type":"object","additionalProperties":false,"required":["ignore_punctuation","ignore_full_half_width","ignore_case"],"properties":{"ignore_punctuation":{"type":"boolean"},"ignore_full_half_width":{"type":"boolean"},"ignore_case":{"type":"boolean"}}},"left_text":{"type":"string"},"right_text":{"type":"string"},"diff_count":{"type":"integer","minimum":0},"segments":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["type","left","right"],"properties":{"type":{"enum":["equal","insert","delete","replace"]},"left":{"type":"object","additionalProperties":false,"required":["text","start","end"],"properties":{"text":{"type":"string"},"start":{"type":"integer","minimum":0},"end":{"type":"integer","minimum":0}}},"right":{"type":"object","additionalProperties":false,"required":["text","start","end"],"properties":{"text":{"type":"string"},"start":{"type":"integer","minimum":0},"end":{"type":"integer","minimum":0}}}}}}}}]},{"not":{"required":["result_type"],"properties":{"result_type":{"const":"dynamic_knowledge"}}}}]},{"type":"object","properties":{"advice":{"type":"object","properties":{"standards":{"type":"array","items":{"type":"object"}},"actions":{"type":"array","items":{"type":"object"}},"risks":{"type":"array","items":{"type":"object"}},"cases":{"type":"array","items":{"type":"object"}},"clarification_questions":{"type":"array","items":{"type":"string"}},"gaps":{"type":"array","items":{"type":"string"}}},"required":[]},"case_notice":{"type":"string"},"case_search":{"type":"object"},"status":{"type":"string"},"answer":{"type":["string","null"]},"answer_notice":{"type":["string","null"]},"snapshot_id":{"type":["string","null"]},"pending_updates":{"type":"boolean"},"retrieval_mode":{"type":"string"},"import_id":{"type":"string"},"version_id":{"type":"string"},"comparison_id":{"type":"string"},"note_id":{"type":"string"},"publication_id":{"type":"string"},"answer_claims":{"type":"array","items":{"type":"object"}},"resolved_documents":{"type":"array","items":{"type":"object"}},"resolved_versions":{"type":"array","items":{"type":"object"}},"changes":{"type":"array","items":{"type":"object"}},"reasons":{"type":"array","items":{"type":"object"}},"query_comparisons":{"type":"array","items":{"type":"object"}},"source_conflicts":{"type":"array","items":{"type":"object"}},"citations":{"type":"array","items":{"type":"object","properties":{"evidence_id":{"type":"string"},"object_id":{"type":"string"},"source_kind":{"type":"string"},"block_id":{"type":"string"},"title":{"type":"string"},"text":{"type":"string"},"snapshot_id":{"type":"string"},"document_id":{"type":["string","null"]},"version_id":{"type":["string","null"]},"revision":{"type":"integer"},"anchor":{"type":"object"},"section_path":{"type":"array","items":{"type":"string"}},"table_cells":{"type":"array","items":{"type":"object"}}},"required":["evidence_id","object_id","revision","source_kind","text","anchor"]}},"coverage":{"type":"object"},"gaps":{"type":"array","items":{"type":"string"}},"ambiguities":{"type":"array","items":{"type":"string"}},"warnings":{"type":"array","items":{"type":"string"}},"ready_items":{"type":"integer"},"failed_items":{"type":"integer"},"input_mode":{"const":"direct"},"baseline_id":{"type":"string"},"operations":{"items":{"additionalProperties":false,"properties":{"id":{"maxLength":128,"minLength":1,"title":"Id","type":"string"},"operation":{"enum":["replace","delete","insert_after"],"title":"Operation","type":"string"},"block_id":{"maxLength":128,"minLength":1,"title":"Block Id","type":"string"},"before_text":{"maxLength":100000,"title":"Before Text","type":"string"},"text":{"default":"","maxLength":100000,"title":"Text","type":"string"},"rationale":{"maxLength":4000,"minLength":1,"title":"Rationale","type":"string"},"citations":{"items":{"additionalProperties":false,"properties":{"reference_id":{"maxLength":128,"minLength":1,"title":"Reference Id","type":"string"},"block_id":{"maxLength":128,"minLength":1,"title":"Block Id","type":"string"},"quote":{"maxLength":100000,"minLength":1,"title":"Quote","type":"string"}},"required":["reference_id","block_id","quote"],"title":"DraftCitation","type":"object"},"maxItems":100,"minItems":1,"title":"Citations","type":"array"},"decision":{"default":"pending","enum":["pending","accepted","rejected","needs_verification"],"title":"Decision","type":"string"}},"required":["id","operation","block_id","before_text","rationale","citations"],"title":"DraftOperation","type":"object"},"maxItems":1000,"title":"Operations","type":"array"},"versions":{"type":"array","items":{"type":"object","properties":{"version_id":{"type":"string"},"etag":{"type":"string"},"document_id":{"type":"string"}},"required":["version_id","etag"]}},"result_type":{"const":"dynamic_knowledge"}},"required":["result_type"],"description":"按任务 operation 返回导入、版本、比较、发布或问答结果。问答核对 status、answer、citations 和 gaps；answered 表示证据支持回答，其他状态须查看缺口或澄清项。直接修订任务返回input_mode=direct、baseline_id、operations和gaps；operations均待人工审阅，引用reference_id来自本次提交的依据，引用block_id固定为text；不产生知识库draft_id。"}]},"error":{"type":"null"}}}]}}}},"400":{"description":"请求参数无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"401":{"description":"API Key 无效","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"403":{"description":"API Key 无权限","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"404":{"description":"文档、任务或其他资源不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"409":{"description":"幂等键、任务状态或资源状态冲突","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"500":{"description":"服务内部异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"502":{"description":"上游服务异常","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"503":{"description":"能力暂不可用","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}},"504":{"description":"上游服务超时","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiResponseEnvelope"}}}}},"security":[{"OpenApiKey":[]}],"x-required-scope":"viewTask","x-stability":"stable","x-alternative-scopes":["dkRead"]}},"/open/v1/me/operations":{"get":{"tags":["0. Key 与授权"],"summary":"查询当前 Key 可调用的接口","description":"用请求头中的 Key 本身鉴权，任何有效 Key 均可调用，不需要额外 scope。返回该 Key 的有效 scope 和已授权的公开接口；include=all 时同时列出未授权接口，并以 authorized=false 标出。授权判断与网关实际准入使用同一规则，不返回 Key 明文、哈希或其他 Key 的信息。","operationId":"describeKeyOperations","responses":{"200":{"description":"当前 Key 的授权视图","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OpenApiResponseEnvelope"},{"type":"object","properties":{"success":{"const":true},"data":{"type":"object","additionalProperties":false,"required":["catalog_version","key","operations"],"properties":{"catalog_version":{"type":"string"},"key":{"type":"object","additionalProperties":false,"required":["key_id","name","scopes"],"properties":{"key_id":{"type":"string"},"name":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"},"description":"有效 scope;历史遗留 scope 已归一化去除。"}}},"operations":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["operation_id","method","path","summary","scope","alternative_scopes","stability","authorized","doc_url"],"properties":{"operation_id":{"type":"string"},"method":{"type":"string"},"path":{"type":"string"},"summary":{"type":"string"},"scope":{"type":"string"},"alternative_scopes":{"type":"array","items":{"type":"string"}},"stability":{"type":"string","enum":["stable","preview"]},"authorized":{"type":"boolean"},"doc_url":{"type":"string"}}}}}}}}]}}}},"400":{"description":"include 参数不合法"},"401":{"description":"缺少、无效或已吊销的 Key"},"503":{"description":"身份库暂不可用"}},"security":[{"OpenApiKey":[]}],"x-stability":"preview","parameters":[{"name":"include","in":"query","required":false,"schema":{"type":"string","enum":["authorized","all"],"default":"authorized"},"description":"authorized 只列已授权接口；all 同时列出未授权接口。"}]}}},"components":{"securitySchemes":{"OpenApiKey":{"type":"apiKey","in":"header","name":"X-Aistrong-Key","description":"管理员签发的 OpenAPI Key，不是登录 JWT。"}},"schemas":{"OpenApiError":{"type":"object","additionalProperties":false,"required":["code","message","retryable"],"properties":{"code":{"type":"string","enum":["conversion_failed","embedding_access_denied","embedding_output_invalid","embedding_unavailable","feature_disabled","forbidden","index_config_conflict","index_incomplete","input_invalid","input_too_large","internal_error","method_not_allowed","model_access_denied","model_output_invalid","model_unavailable","not_acceptable","not_found","payload_too_large","precondition_failed","precondition_required","processor_budget","processor_failed","processor_invalid_response","processor_rejected","processor_timeout","processor_unauthorized","processor_unavailable","queue_capacity_exceeded","rate_limited","resource_conflict","resource_not_found","semantic_unavailable","service_unavailable","source_ambiguous","source_changed","source_invalid","source_unavailable","source_writeback_unavailable","unauthorized","unsupported_media_type","upstream_rejected","upstream_timeout","upstream_unavailable"]},"message":{"type":"string","minLength":1},"retryable":{"type":"boolean"}}},"OpenApiResponseEnvelope":{"type":"object","additionalProperties":false,"required":["success","data","error","request_id"],"properties":{"success":{"type":"boolean"},"data":{},"error":{"oneOf":[{"type":"object","additionalProperties":false,"required":["code","message","retryable"],"properties":{"code":{"type":"string","enum":["conversion_failed","embedding_access_denied","embedding_output_invalid","embedding_unavailable","feature_disabled","forbidden","index_config_conflict","index_incomplete","input_invalid","input_too_large","internal_error","method_not_allowed","model_access_denied","model_output_invalid","model_unavailable","not_acceptable","not_found","payload_too_large","precondition_failed","precondition_required","processor_budget","processor_failed","processor_invalid_response","processor_rejected","processor_timeout","processor_unauthorized","processor_unavailable","queue_capacity_exceeded","rate_limited","resource_conflict","resource_not_found","semantic_unavailable","service_unavailable","source_ambiguous","source_changed","source_invalid","source_unavailable","source_writeback_unavailable","unauthorized","unsupported_media_type","upstream_rejected","upstream_timeout","upstream_unavailable"]},"message":{"type":"string","minLength":1},"retryable":{"type":"boolean"}}},{"type":"null"}]},"metering":{"oneOf":[{"type":"object","additionalProperties":false,"required":["status","models","ocr","timing"],"properties":{"status":{"type":"string","enum":["pending","reported","partial","unavailable","not_applicable"]},"job_id":{"type":["string","null"],"pattern":"^[a-f0-9]{32}$"},"metered_request_id":{"type":["string","null"]},"document_page_count":{"type":["integer","null"],"minimum":0},"models":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["provider","model_type","model_id","model_id_source","input_tokens","output_tokens","call_count","duration_ms","usage_status"],"properties":{"provider":{"type":["string","null"]},"model_type":{"type":"string","enum":["chat","embedding","rerank","vision"]},"model_id":{"type":["string","null"]},"model_id_source":{"type":"string","enum":["provider","configured","unavailable"]},"input_tokens":{"type":["integer","null"],"minimum":0},"output_tokens":{"type":["integer","null"],"minimum":0},"call_count":{"type":"integer","minimum":1},"duration_ms":{"type":["integer","null"],"minimum":0},"usage_status":{"type":"string","enum":["reported","partial","unavailable"]}}}},"ocr":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["provider","service","page_count","call_count","cache_hit_count","duration_ms","usage_status"],"properties":{"provider":{"type":"string"},"service":{"type":"string"},"page_count":{"type":["integer","null"],"minimum":0},"call_count":{"type":"integer","minimum":1},"cache_hit_count":{"type":"integer","minimum":0},"duration_ms":{"type":["integer","null"],"minimum":0},"usage_status":{"type":"string","enum":["reported","partial","unavailable"]}}}},"audio":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["provider","model_id","call_count","unknown_call_count","audio_duration_seconds","input_tokens","output_tokens","usage_status"],"properties":{"provider":{"type":"string"},"model_id":{"type":"string"},"call_count":{"type":"integer","minimum":1},"unknown_call_count":{"type":"integer","minimum":0},"audio_duration_seconds":{"type":["integer","null"],"minimum":0},"input_tokens":{"type":["integer","null"],"minimum":0},"output_tokens":{"type":["integer","null"],"minimum":0},"usage_status":{"type":"string","enum":["reported","partial","unavailable"]}}}},"image_generation":{"type":"object","additionalProperties":false,"required":["attempt_count","unknown_result_count","image_count","usage_status"],"properties":{"attempt_count":{"type":"integer","minimum":1},"unknown_result_count":{"type":"integer","minimum":0},"image_count":{"type":["integer","null"],"minimum":0},"usage_status":{"type":"string","enum":["reported","partial","unavailable"]}}},"timing":{"type":"object","additionalProperties":false,"required":["gateway_ms","execution_ms","total_ms"],"properties":{"gateway_ms":{"type":["integer","null"],"minimum":0},"execution_ms":{"type":["integer","null"],"minimum":0},"total_ms":{"type":["integer","null"],"minimum":0}}}}},{"type":"null"}]},"request_id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9_-]+$"}}}}},"x-open-api-catalog-version":"1.75.0","tags":[{"name":"1. 智能体目录","description":"读取本地知识读模型中的公开智能体目录。"},{"name":"2. 文档准备","description":"上传文档并取得可复用的 doc_id,或发起文档解析。"},{"name":"3. 知识库","description":"查询、同步和统计笃语内置知识库。"},{"name":"4. 文档异步任务","description":"提交分类、抽取、分析、比对和审核等异步任务。"},{"name":"5. 任务进度与结果","description":"使用异步响应中的 job_id 查询进度并读取结果。"},{"name":"6. 用量与计量","description":"查询当前 API Key 的模型、OCR 和耗时计量。"},{"name":"7. 动态知识库","description":"11项业务入口，按action读取、维护、确认和恢复；上传、问答、单独比对与任务查询复用原接口。"}]}