@customize-agent/server 4.61.12 → 4.61.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +2 -2
  3. package/.next/prerender-manifest.json +3 -3
  4. package/.next/required-server-files.json +1 -1
  5. package/.next/routes-manifest.json +1 -1
  6. package/.next/server/chunks/3239.js +5 -5
  7. package/.next/server/chunks/5037.js +7 -7
  8. package/.next/server/chunks/5763.js +2 -2
  9. package/.next/server/chunks/6355.js +1 -1
  10. package/.next/server/chunks/8176.js +1 -1
  11. package/.next/server/chunks/9688.js +2 -2
  12. package/.next/server/pages/404.html +1 -1
  13. package/.next/server/pages/500.html +1 -1
  14. package/.next/server/pages/documents.html +1 -1
  15. package/.next/server/pages/generation/[id].html +1 -1
  16. package/.next/server/pages/generation.html +1 -1
  17. package/.next/server/pages/jobs.html +1 -1
  18. package/.next/server/pages/knowledge/file-detail.html +1 -1
  19. package/.next/server/pages/knowledge/files.html +1 -1
  20. package/.next/server/pages/knowledge/manage.html +1 -1
  21. package/.next/server/pages/knowledge/source-preview.html +1 -1
  22. package/.next/server/pages/knowledge.html +1 -1
  23. package/.next/server/pages/models.html +1 -1
  24. package/.next/server/pages/settings.html +1 -1
  25. package/.next/server/pages/skills/[id]/edit.html +1 -1
  26. package/.next/server/pages/skills/[id].html +1 -1
  27. package/.next/server/pages/skills/new.html +1 -1
  28. package/.next/server/pages/skills.html +1 -1
  29. package/.next/server/pages-manifest.json +26 -26
  30. package/package.json +1 -1
  31. /package/.next/static/{e3dcea53eae4dbb392eb88d397a74c0cf2738d891e5c7e0f87052a0d4a83fedb → 01f41449956d297ad9d13efb79679749ab34d2e077a7942a82ce78508c40472e}/_buildManifest.js +0 -0
  32. /package/.next/static/{e3dcea53eae4dbb392eb88d397a74c0cf2738d891e5c7e0f87052a0d4a83fedb → 01f41449956d297ad9d13efb79679749ab34d2e077a7942a82ce78508c40472e}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- "use strict";exports.id=6355,exports.ids=[6355],exports.modules={34933:(a,b,c)=>{c.d(b,{x:()=>f});var d=c(77598),e=c(49584);function f(a){let b=(0,e.modelConfigurationForRun)(a),c=b.models.active,f=c&&b.models.list.find(a=>a.name===c.name&&a.provider===c.provider),g=f?b.providers[f.provider]:void 0;return(0,d.createHash)("sha256").update(JSON.stringify({version:"single-selected-model-v1",active:c,selected:f?{name:f.name,provider:f.provider,thinking:f.thinking??"follow-task"}:null,endpointHash:g?(0,d.createHash)("sha256").update(JSON.stringify([g.baseUrl,g.protocol,g.directEndpoint])).digest("hex"):null})).digest("hex")}},46355:(a,b,c)=>{c.r(b),c.d(b,{APPLICABILITY_REVIEW_SCHEMA:()=>N,TENDER_OBLIGATION_EXTRACTION_VERSION:()=>K,TENDER_OBLIGATION_SCHEMA:()=>U,TENDER_ORIGINAL_FORM_PROPOSAL_SCHEMA:()=>S,extractTenderObligationsWithAgent:()=>ah,materiallyUncoveredNamedOutputs:()=>ae,reconcileNamedTenderOutputCoverage:()=>af,tenderReferenceParentRoleFacts:()=>ag});var d=c(745),e=c(76760),f=c.n(e),g=c(77598);function h(a,b,c,d,e,f=[]){if(!Array.isArray(a))return{resolved:[],errors:[`${e} 必须是选择数组`]};let g=[],i=[];for(let[h,j]of a.entries()){if(j&&"object"==typeof j&&!Array.isArray(j)&&Object.keys(j).some(a=>!["from","through",...f].includes(a))){i.push(`${e}[${h}]:TENDER_EVIDENCE_SELECTION_SHAPE;只能填from/through${f.length?`与${f.join("/")}`:""}`);continue}let a=j&&"object"==typeof j&&!Array.isArray(j)?{from:j.from,...Object.hasOwn(j,"through")?{through:j.through}:{}}:j;try{let e=d.resolve(b,c,a);g.push({sourceFile:e.sourceFile,quote:e.quote,start:e.start,end:e.end})}catch(a){i.push(`${e}[${h}]:${a instanceof Error?a.message:String(a)};只能使用该候选目录中的from/through,不得改写quote、sourceFile或位置`)}}return{resolved:g,errors:i}}function i(a,b){let c;if(!a||"object"!=typeof a||Array.isArray(a))return{errors:["审查结论必须是对象"]};if("string"!=typeof a.candidateId||"string"!=typeof a.candidateHash||"string"!=typeof a.reason||!["accepted","disputed","unmeasured"].includes(String(a.status))||"technical-content"!==a.target&&"output-delivery"!==a.target)return{errors:["审查结论缺少当前candidateId/candidateHash/target/status/reason"]};let d=h(a.evidence,a.candidateId,a.candidateHash,b,"evidence");if(d.errors.length)return{errors:d.errors};if(void 0!==a.contentScope){let d=a.contentScope;if(!d||"object"!=typeof d||Array.isArray(d))return{errors:["contentScope 必须是对象"]};let e=h(d.technical,a.candidateId,a.candidateHash,b,"contentScope.technical",["response"]),f=h(d.excluded,a.candidateId,a.candidateHash,b,"contentScope.excluded",["reason"]);if(e.errors.length||f.errors.length)return{errors:[...e.errors,...f.errors]};let g=Array.isArray(d.technical)?d.technical:[],i=Array.isArray(d.excluded)?d.excluded:[];c={technical:e.resolved.map((a,b)=>({...a,response:"string"==typeof g[b]?.response?g[b].response:""})),excluded:f.resolved.map((a,b)=>({...a,reason:"string"==typeof i[b]?.reason?i[b].reason:""}))}}return{resolved:{candidateId:a.candidateId,candidateHash:a.candidateHash,target:a.target,status:a.status,reason:a.reason,...!0===a.headingOnly?{headingOnly:!0}:{},evidence:d.resolved,...c?{contentScope:c}:{}},errors:[]}}var j=c(69977);let k="tender-evidence-selection-v1";function l(a,b){let c=new Map(a.files.map(a=>[a.filePath,a.text]));if(c.size!==a.files.length||a.files.some(a=>(0,d.Fu)(a.text)!==a.sourceTextHash)||(0,d.Fu)(a.files.map(a=>[a.filePath,a.sourceTextHash]).sort((a,b)=>a[0].localeCompare(b[0])))!==a.sourceHash)throw Error("TENDER_EVIDENCE_SELECTION_SOURCE_IDENTITY");if(new Set(b.map(a=>a.candidateId)).size!==b.length||b.some(a=>!a.candidateId.trim()))throw Error("TENDER_EVIDENCE_SELECTION_CANDIDATE_IDENTITY");let e=b.map(({candidateId:b,applicability:c})=>{let{bindingHash:e,...f}=c;if(c.version!==j.q$||e!==(0,d.Fu)(f))throw Error("TENDER_EVIDENCE_SELECTION_CANDIDATE_BINDING");let{review:g,bindingHash:h,...i}=c,k={...i,status:"unresolved",bindingHash:""};k.bindingHash=(0,d.Fu)((({bindingHash:a,...b})=>b)(k));let l=[...(0,j.N3)(k,a.files,void 0,a).issues,...c.issues],m=[];if(!l.length)for(let a of[{anchor:c.source,origin:"source"},...c.basisRefs.map(a=>({anchor:a,origin:`basis:${a.refId}`}))]){let b=m.find(b=>b.anchor.sourceFile===a.anchor.sourceFile&&b.anchor.start===a.anchor.start&&b.anchor.end===a.anchor.end);if(b)b.origins.push(a.origin);else{let{nodeId:b,sourceFile:c,start:d,end:e,quote:f}=a.anchor;m.push({anchor:{nodeId:b,sourceFile:c,start:d,end:e,quote:f},origins:[a.origin]})}}return{candidateId:b,candidateHash:(0,j.DB)(c),target:(0,j.Vc)(c),issues:l,anchors:m}}),f=(0,d.Fu)([k,a.sourceHash,e]),g=new Map,h=a=>{let b=`e${f.slice(0,24)}:${g.size}`;return g.set(b,{...a}),b},i=e.map(a=>({candidateId:a.candidateId,candidateHash:a.candidateHash,target:a.target,issues:[...a.issues],groups:a.anchors.map(({anchor:b,origins:c},d)=>{let e={candidateId:a.candidateId,candidateHash:a.candidateHash,sourceFile:b.sourceFile,group:d};return{ref:h({...e,start:b.start,end:b.end,whole:!0,ordinal:-1}),sourceFile:b.sourceFile,start:b.start,end:b.end,quote:b.quote,origins:[...c],parts:(function(a){let b=[],c=0,d=d=>{let e=a.quote.slice(c,d),f=e.trim();if(f){let d=c+e.length-e.trimStart().length;b.push({start:a.start+d,end:a.start+d+f.length,quote:f})}c=d};for(let b of a.quote.matchAll(/[,,;;。!?!?]/gu))d(b.index+b[0].length);return d(a.quote.length),b})(b).map((a,b)=>({...a,ref:h({...e,start:a.start,end:a.end,whole:!1,ordinal:b})}))}})})),l=new Map(e.map(a=>[a.candidateId,a.candidateHash])),m={version:k,sourceHash:a.sourceHash,bindingHash:f,instructions:"目录只列当前候选已绑定source/basis的冻结原字。evidence/contentScope每项只填from(连续片段可加through,含末片段),只能同一候选同一组按顺序选择,整组ref只能单独选择。程序按ref恢复原字与位置;不得抄写或改写quote、sourceFile、位置或parentNodeId。选择不等于批准,仍须独立业务审查;没有可选目录时保持未决。",candidates:i};return{directory:m,modelDirectory:a=>{let b=a?new Set(a):void 0;if(b){for(let a of b)if(!i.some(b=>b.candidateId===a))throw Error("TENDER_EVIDENCE_SELECTION_UNKNOWN_CANDIDATE")}return{version:m.version,sourceHash:m.sourceHash,bindingHash:m.bindingHash,instructions:m.instructions,candidates:i.filter(a=>!b||b.has(a.candidateId)).map(a=>({candidateId:a.candidateId,groups:a.groups.map(a=>({ref:a.ref,origins:[...a.origins],quote:a.quote,parts:a.parts.map(a=>({ref:a.ref,quote:a.quote}))}))}))}},resolve(a,b,e){var f;if(!l.has(a)||l.get(a)!==b)throw Error("TENDER_EVIDENCE_SELECTION_STALE_CANDIDATE");if(!e||"object"!=typeof e||Array.isArray(e)||Object.keys(e).some(a=>"from"!==a&&"through"!==a))throw Error("TENDER_EVIDENCE_SELECTION_SHAPE");let{from:h,through:i}=e;if("string"!=typeof h||void 0!==i&&"string"!=typeof i)throw Error("TENDER_EVIDENCE_SELECTION_SHAPE");let j=g.get(h),k=g.get(i??h);if(!j||!k)throw Error("TENDER_EVIDENCE_SELECTION_UNKNOWN_REFERENCE");let m=function(a,b,c,d,e,f){if(![e,f].every(c=>c.candidateId===a&&c.candidateHash===b))return`当前候选=${a};from=${c} 属于候选=${e.candidateId};${void 0===d?"未提供through":`through=${d} 属于候选=${f.candidateId}`};即使原字相同也不能跨候选借用ref。程序不会自动换ref或补basis;须按当前候选已绑定目录重新审查,无依据则保留真实未决,不得删掉范围后继续accepted`}(a,b,h,i,j,k);if(m)throw Error(`TENDER_EVIDENCE_SELECTION_FOREIGN_CANDIDATE:${m}`);let n=(f=void 0!==i,j.group!==k.group||j.sourceFile!==k.sourceFile?"两个端点属于不同证据组,不能跨组或跨文件组成范围":f&&(j.whole||k.whole)?`from为${j.whole?"整组":"片段"}引用,through为${k.whole?"整组":"片段"}引用;整组只能单独填from并省略through(即使两者相同也不合法);片段范围必须由同一组parts中的首末ref组成。须自行重新选择,程序不会删去through或替换端点`:j.ordinal>k.ordinal||j.start>k.start?"片段端点倒序;from必须先于或等于through,程序不会自动调序":void 0);if(n)throw Error(`TENDER_EVIDENCE_SELECTION_INVALID_RANGE:from=${h},through=${i??"未提供"};${n}`);let o=c.get(j.sourceFile).slice(j.start,k.end);return{sourceFile:j.sourceFile,start:j.start,end:k.end,quote:o,nodeId:`tender-source:${(0,d.Fu)([j.sourceFile,j.start,o]).slice(0,24)}`}}}}var m=c(68515),n=c(98943),o=c(13380),p=c(36980),q=c(62369);let r=JSON.parse('{"version":"construction-requirement-taxonomy-v1","description":"通用招标要求语义分类(领域基线,不是项目条款位置):只用于在任意招标/补疑/答疑原文中发现要求类条款;条款号、页码、章节位置一律由文档索引动态确定。","requirementHints":["应","须","必须","不得","严禁","按照","满足","编制","提交","采用","执行","设置","配备","验收","评分","评审","要求","规定","标准","清单","专项施工方案","表格","图件","图表","附表","附图"],"strongRequirementHints":["必须","不得","严禁","要求","规定","标准","清单","专项施工方案","评分","评审","验收","提交","编制","采用","设置","配备","表格","图件","图表","附表","附图"],"categories":[{"id":"dangerous-works","label":"危险性较大的分部分项工程","priority":10,"terms":["危险性较大","危大工程","危大","超过一定规模"],"addAsContent":true},{"id":"major-construction-method","label":"主要施工方法/施工方案","priority":9,"terms":["主要施工方法","主要施工方案","施工方法","施工方案","施工工艺","施工顺序","施工部署","流水施工","特殊工艺","专项施工方案","工法"],"addAsContent":true},{"id":"evaluation","label":"评标/评分/评审因素","priority":8,"terms":["评标","评分","评审因素","评分标准","评审标准","技术文件评分"],"addAsContent":false},{"id":"technical-requirement","label":"技术标准/技术规格/施工要求","priority":7,"terms":["技术标准","技术规格","技术要求","施工要求","技术条件"],"addAsContent":true},{"id":"quality","label":"质量/验收/创优","priority":6,"terms":["质量目标","质量要求","质量验收","质量标准","创优","检验批","标准化工地"],"addAsContent":true},{"id":"safety-environment","label":"安全/文明/环保/绿色施工","priority":6,"terms":["安全生产","安全管理","安全文明","文明施工","环保","绿色施工","职业健康","扬尘","噪声"],"addAsContent":true},{"id":"schedule","label":"工期/进度/节点","priority":5,"terms":["工期要求","工期目标","进度计划","节点目标","开竣工","赶工","里程碑"],"addAsContent":true},{"id":"resources","label":"人材机/分包/甲供乙供","priority":5,"terms":["劳动力计划","材料供应","机械设备","专业分包","甲供","乙供","暂估"],"addAsContent":true},{"id":"bid-format","label":"投标文件格式/技术文件编制","priority":6,"terms":["投标文件格式","技术文件","施工组织设计","图表","页数","暗标","编制要求"],"addAsContent":false},{"id":"contract","label":"合同条款/变更/索赔/保修/移交","priority":4,"terms":["合同条款","专用合同条款","通用合同条款","变更","索赔","保修","移交"],"addAsContent":false},{"id":"site-condition","label":"现场条件/地勘/水文/周边/季节","priority":4,"terms":["现场条件","地勘","地质","水文","周边环境","交通组织","临水临电","雨季","冬季施工"],"addAsContent":true},{"id":"technology","label":"新技术/新工艺/知识产权/深化设计","priority":5,"terms":["新技术","新工艺","知识产权","深化设计","BIM","智慧工地","信息化"],"addAsContent":true},{"id":"handover","label":"验收/移交/竣工资料","priority":4,"terms":["竣工验收","移交","竣工资料","档案","保修"],"addAsContent":false}]}'),s=a=>a.replace(/\s+/gu,"").normalize("NFKC").replace(/[“”‘’"'`]/gu,""),t=a=>(0,g.createHash)("sha256").update(a).digest("hex").slice(0,24),u=/PDF\s*第\s*(\d+)\s*页/gu,v=/^\s*(?:第[一二三四五六七八九十百零〇\d]+[章节条款]|[一二三四五六七八九十]+、|([一二三四五六七八九十\d]+)|\d+(?:[..]\d+)*[、..]?\s+)/u,w=/^\s*\|/u;function x(a){let b=a.search(/[::]/u);if(b<0)return[];let c=a.slice(b+1).trim().replace(/[。;;]\s*$/u,"").replace(/等\s*$/u,"");if(/[。\n\r]/u.test(c))return[];let d=c.split(/[,,、;;]/u).map(a=>a.trim().replace(/^[((]?[一二三四五六七八九十\d]+[))、..]\s*/u,"")).filter(a=>a.length>=2&&a.length<=32);return d.length<2||d.length>12?[]:[...new Set(d)]}let y=/[。!?!?]/u;function z(a,b){if(!b?.length||/[\r\n]/u.test(a)||y.test(a.trim().replace(/[。!?!?]+$/u,"")))return[];let c=s(a),d=[];for(let a of b){let b=a.trim();!(b.length<2||b.length>32||y.test(b)||/[\r\n]/u.test(b))&&c.includes(s(b))&&(d.includes(b)||d.push(b))}return d.length>1?d:[]}function A(a,b){let c=s(a);return!!r.strongRequirementHints.some(a=>c.includes(s(a)))||b.some(a=>a.priority>=7)&&r.requirementHints.some(a=>c.includes(s(a)))}let B=JSON.parse('{"version":"construction-output-obligation-terms-v2","rules":[{"context":"投标文件格式|项目管理机构|人员组成|附件|合同条款","terms":["组织机构图","人员组成表","机械设备表"]},{"context":"施工组织设计|技术文件|进度计划|施工部署|总平面|平面布置","terms":["横道图","网络图","施工总平面布置图","平面布置图","劳动力计划表","材料进场计划"]}],"deliveryVerbs":["应附","提交","提供","包括","编制","报送","格式","装订","加盖","填写","附"],"skipContextPatterns":["目录"]}'),C="tender-source-discovery-v1",D=a=>a.replace(/\s+/gu,"").normalize("NFKC").replace(/[“”‘’"'`]/gu,"");function E(a,b,c){if(!a||"object"!=typeof a||!Array.isArray(a.evidenceRequests))return["evidenceRequests 必须是数组"];let d=a.evidenceRequests,e=d.length>4?["evidenceRequests 每批最多4项"]:[];return d.forEach((a,d)=>{let f=`evidenceRequests[${d}]`;if(!a||"object"!=typeof a)return void e.push(`${f} 必须是对象`);b.some(b=>b.candidateId===a.candidateId&&b.candidateHash===a.candidateHash)||e.push(`${f} candidateId/candidateHash 不属于当前批次`),c.files.some(b=>b.filePath===a.sourceFile)||e.push(`${f} sourceFile 不属于冻结目录`),Object.hasOwn(a,"quote")===Object.hasOwn(a,"queryTerms")?e.push(`${f} 必须且只能选择逐字quote或发现queryTerms`):Object.hasOwn(a,"quote")?("string"!=typeof a.quote||D(a.quote).length<2)&&e.push(`${f} quote 必须包含至少2个有效字符`):F(a.queryTerms)||e.push(`${f} queryTerms 须为1至4个不同检索词,每词2至120字符`)}),e}function F(a){return Array.isArray(a)&&a.length>=1&&a.length<=4&&a.every(a=>"string"==typeof a&&a.length<=120&&D(a).length>=2)&&new Set(a.map(D)).size===a.length}var G=c(68011),H=c(34933),I=c(49584),J=c(19045);let K="construction-tender-obligation-extraction-v1",L=(a,b)=>({type:"object",additionalProperties:!1,required:a,properties:b}),M=L(["technicalContent","delivery","reason","basisRefs"],{technicalContent:{type:"string",enum:["required-response","technical-constraint","reference","not-applicable","unresolved"]},delivery:L(["requirement","location","originalForm","stage","conditions"],{requirement:{type:"string",enum:["required","recommended","not-required","unresolved"]},location:{type:"string",enum:["technical-body","technical-appendix","business-file","contract-performance","construction-submission","unresolved"]},originalForm:{type:"string",enum:["required","adaptable","not-required","unresolved"]},stage:{type:"string",enum:["bid","contract","construction","multiple","unresolved"]},stages:{type:"array",items:{type:"string",enum:["bid","contract","construction"]}},conditions:{type:"array",items:{type:"string"}}}),reason:{type:"string",minLength:1},parentNodeId:{type:"string"},basisQuote:{type:"string"},basisRefs:{type:"array",items:L(["refId","sourceFile","quote","relation","explanation","linkedTo"],{refId:{type:"string",minLength:1},sourceFile:{type:"string",minLength:1},quote:{type:"string",minLength:1},parentNodeId:{type:"string"},relation:{type:"string",enum:["includes","constrains","overrides","shared-delivery","scope","refers-to"]},explanation:{type:"string",minLength:1},linkedTo:{type:"array",items:{type:"string"}}})}}),N=L(["decisions"],{decisions:{type:"array",items:L(["candidateId","candidateHash","target","status","reason","headingOnly","evidence"],{candidateId:{type:"string",minLength:1},candidateHash:{type:"string",minLength:1},target:{type:"string",enum:["technical-content","output-delivery"]},status:{type:"string",enum:["accepted","disputed","unmeasured"]},reason:{type:"string",minLength:1},headingOnly:{type:"boolean",description:"必须显式返回 true/false,不得省略。仅当原句本身只是章节标题/引导句、没有独立技术响应内容时为 true;冒号结尾但有对象/措施/责任/验收要求时必须为 false。"},evidence:{type:"array",items:L(["from"],{from:{type:"string",minLength:1},through:{type:"string",minLength:1}})},contentScope:L(["technical","excluded"],{technical:{type:"array",items:L(["from","response"],{from:{type:"string",minLength:1},through:{type:"string",minLength:1},response:{type:"string",minLength:1}})},excluded:{type:"array",items:L(["from","reason"],{from:{type:"string",minLength:1},through:{type:"string",minLength:1},reason:{type:"string",minLength:1}})}})})}}),O=L(["decisions"],{decisions:{type:"array",items:L(["candidateId","candidateHash","applicability"],{candidateId:{type:"string",minLength:1},candidateHash:{type:"string",minLength:1},applicability:M})}}),P=L(["decisions","evidenceRequests"],{decisions:O.properties.decisions,evidenceRequests:{type:"array",maxItems:4,items:L(["candidateId","candidateHash","sourceFile"],{candidateId:{type:"string",minLength:1},candidateHash:{type:"string",minLength:1},sourceFile:{type:"string",minLength:1},quote:{type:"string",minLength:2,description:"与queryTerms二选一:已知原文的逐字查询;不会改为模糊查找"},queryTerms:{type:"array",minItems:1,maxItems:4,description:"与quote二选一:资料发现检索词,同一窗口须含全部词;结果不是已绑定证据",items:{type:"string",minLength:2,maxLength:120}}})}}),Q=L(["repairs"],{repairs:{type:"array",items:L(["candidateId","candidateHash","source","basisRefs"],{candidateId:{type:"string",minLength:1},candidateHash:{type:"string",minLength:1},source:L([],{parentNodeId:{type:"string"}}),basisRefs:{type:"array",items:L(["index","refId","sourceFile","quote","linkedTo"],{index:{type:"integer",minimum:0},refId:{type:"string",minLength:1},sourceFile:{type:"string",minLength:1},quote:{type:"string",minLength:1},parentNodeId:{type:"string"},linkedTo:{type:"array",items:{type:"string"}}})}})}}),R={type:"array",items:L(["sourceFile","quote"],{sourceFile:{type:"string",minLength:1},quote:{type:"string",minLength:1},parentNodeId:{type:"string"}})},S=L(["sourceRefs","fields","rowGroups","instructions","formatRules"],{sourceRefs:R,fields:{type:"array",items:L(["id","label","headerPath","order","presence","valueRequired","conditions","basisRefs"],{id:{type:"string",minLength:1},label:{type:"string",minLength:1},headerPath:{type:"array",items:{type:"string",minLength:1}},order:{type:"integer",minimum:0},presence:{type:"string",enum:["required","conditional","optional"]},valueRequired:{type:"boolean"},conditions:{type:"array",items:{type:"string"}},unit:{type:"string"},basisRefs:R,condition:L(["status","reason","basisRefs"],{status:{type:"string",enum:["applies","not-applicable","unresolved"]},reason:{type:"string",minLength:1},basisRefs:R})})},rowGroups:{type:"array",items:L(["id","label","order","fixedRows","basisRefs"],{id:{type:"string",minLength:1},label:{type:"string",minLength:1},order:{type:"integer",minimum:0},basisRefs:R,fixedRows:{type:"array",items:L(["id","label","labelFieldId","required","repeatable"],{id:{type:"string",minLength:1},label:{type:"string",minLength:1},labelFieldId:{type:"string",minLength:1},required:{type:"boolean"},repeatable:{type:"boolean"}})}})},instructions:{type:"array",items:L(["id","text","targets","basisRefs"],{id:{type:"string",minLength:1},text:{type:"string",minLength:1},targets:{type:"array",items:{type:"string"}},basisRefs:R})},formatRules:{type:"array",items:L(["id","kind","text","targets","sourceRefs"],{id:{type:"string",minLength:1},kind:{type:"string",enum:["column-order","row-group-order","merged-header","fixed-text","diagram-area","description-area","visual-layout"]},text:{type:"string",minLength:1},targets:{type:"array",items:{type:"string"}},sourceRefs:R})}}),T=L(["candidateHash","status","reason","evidence"],{candidateHash:{type:"string",minLength:1},status:{type:"string",enum:["accepted","disputed","unmeasured"]},reason:{type:"string",minLength:1},evidence:R}),U=L(["contentObligations","outputObligations","unresolved"],{contentObligations:{type:"array",items:L(["text","kind","quote","sourceFile","applicability"],{clause:{type:"string"},text:{type:"string",minLength:1},kind:{type:"string",enum:["content","procedure"]},quote:{type:"string",minLength:1},sourceFile:{type:"string",minLength:1},page:{type:"string"},items:{type:"array",items:{type:"string",minLength:1}},applicability:M})},outputObligations:{type:"array",items:L(["form","element","quote","sourceFile","applicability"],{clause:{type:"string",minLength:1},form:{type:"string",minLength:1},element:{type:"string",minLength:1},quote:{type:"string",minLength:1},sourceFile:{type:"string",minLength:1},applicability:M})},unresolved:{type:"array",items:L(["question"],{question:{type:"string",minLength:2},sourceFile:{type:"string"}})}}),V=L(["outputObligations"],{outputObligations:{type:"array",items:L(["form","element","quote","sourceFile","applicability"],{form:{type:"string",minLength:1},element:{type:"string",minLength:1},quote:{type:"string",minLength:1},sourceFile:{type:"string",minLength:1},applicability:M})}}),W="你是施工组织设计投标策划智能体。你只从给定的冻结招标/补疑/答疑原文中提取**明确要求**。\n不得凭经验补条款,不得把其他项目的义务带进来,不得改写原文。\n按当前JSON接口提交完整结构;不调用未提供的工具,不返回自由文本或markdown。",X="你是施工组织设计投标策划智能体。只补提取给定原文句中明确点名的图表输出,不补造名称。",Y="你是适用性提案编制者,仅补全已有候选的多维解释,不承担独立审查。",Z="你是与义务提取分开的独立适用性审查者。以冻结原文、上下文与交叉引用逐项审查,禁止按父域自动排除或收录。",$="你是原格式母版提案者。只能读取冻结依据建立可验收模板,不自报审查通过。",_="你是与模板提案分开的独立原格式审查者。冻结原文定位不等于格式解释正确;逐项审查母版完整性。",aa=a=>{let b=a.trim().toLowerCase(),c={表:"table",表格:"table",图:"figure",图件:"figure",示意图:"diagram",框图:"diagram",组织机构图:"org_chart",organization_chart:"org_chart",organizational_chart:"org_chart",bar_chart:"chart",pie_chart:"chart",曲线:"chart",图表:"chart"};return c[b]?c[b]:/org|组织|机构/u.test(b)?"org_chart":/网络图|横道图|进度图|平面布置|流程|示意|框图|diagram/u.test(b)?"diagram":/曲线|chart|柱状|饼图/u.test(b)?"chart":/表|table/u.test(b)?"table":/图|figure|image/u.test(b)?"figure":void 0};function ab(a){return a.replace(/\s+/gu,"").normalize("NFKC").replace(/[“”‘’"'`]/gu,"")}function ac(a,b){let c=[...a.slice(0,Math.max(0,b)).matchAll(/PDF\s*第\s*(\d+)\s*页/gu)];return c.at(-1)?.[1]}function ad(a){let b=RegExp(B.deliveryVerbs.map(a=>a.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&")).join("|"),"u"),c=(B.skipContextPatterns??[]).map(a=>RegExp(a,"u")),d=new Map;for(let e of a)for(let a of e.text.matchAll(/[^。;\n]+/gu)){let f=a[0],g=a.index;if(b.test(f)){for(let a of B.rules)if(RegExp(a.context,"u").test(f))for(let b of a.terms){if(!f.includes(b))continue;let a=function(a,b){let c=a.lastIndexOf("\n",b)+1,d=a.indexOf("\n",b),e=a.slice(c,-1===d?a.length:d),f=/^\s{0,3}#{1,6}\s+.+?\s*#*\s*$/u.test(e),g=[...a.slice(0,f?-1===d?a.length:d:b).matchAll(/^\s{0,3}(#{1,6})\s+(.+?)\s*#*\s*$/gmu)].map(a=>({level:a[1].length,title:a[2].replace(/\s+/gu,"").trim(),index:a.index})).filter(a=>a.index<=b);if(!g.length)return"";let h=[];for(let a of g){for(;h.length&&h[h.length-1].level>=a.level;)h.pop();h.push(a)}return h.map(a=>a.title).join("\0")}(e.text,g);if(c.some(b=>b.test(a)))continue;let h={term:b,filePath:e.filePath,start:g,end:g+f.length,excerpt:f.trim(),context:a};d.set(JSON.stringify([e.filePath,g,b]),h)}}}return[...d.values()]}function ae(a){let b=new Set(a.occurrences.filter(a=>a.witnesses.some(a=>!0===a.accepted||a.review?.status==="accepted")).map(a=>`${a.term}\u0000${a.filePath}\u0000${a.context}`));return a.uncovered.filter(a=>!b.has(`${a.term}\u0000${a.filePath}\u0000${a.context}`))}function af(a){let b=(0,j.ML)(a.sourceFiles),c=(a,b)=>a.sourceFile===b.filePath&&a.start<b.end&&a.end>b.start,e=a.outputs.map((e,f)=>{let g=e.applicability,h=g&&g.sourceHash===b.sourceHash&&g.sourceTextHash===b.files.find(a=>a.filePath===e.sourceFile)?.sourceTextHash&&"output"===g.subject.kind&&g.subject.element===e.element&&g.source.sourceFile===e.sourceFile&&ab(g.source.quote)===ab(e.quote)&&(a=>{let c=b.files.find(b=>b.filePath===a.sourceFile);return c&&a.start>=0&&a.end===a.start+a.quote.length&&c.text.slice(a.start,a.end)===a.quote&&a.nodeId===`tender-source:${(0,d.Fu)([a.sourceFile,a.start,a.quote]).slice(0,24)}`})(g.source),i=g&&(0,j.xL)(e)&&(0,j.N3)(g,a.sourceFiles,{kind:"output",sourceFile:e.sourceFile,quote:e.quote,element:e.element},b).valid,k=new Set(["source"]);if(g&&i){for(let a of g.basisRefs)c(a,{filePath:g.source.sourceFile,start:g.source.start,end:g.source.end})&&k.add(a.refId);let a=!0;for(;a;)for(let b of(a=!1,g.basisRefs))for(let c of b.linkedTo)(k.has(b.refId)||k.has(c))&&(k.has(b.refId)&&k.has(c)||(a=!0),k.add(b.refId),k.add(c))}return{output:e,scope:g,sourceBound:h,accepted:i,connected:k,candidateId:`output-${f}`}}),f=ad(a.sourceFiles).map(a=>{let b=[];for(let{output:d,scope:f,sourceBound:g,accepted:h,connected:i,candidateId:j}of e)if(f&&(d.element.includes(a.term)||a.term.includes(d.element))&&(g&&c(f.source,a)&&b.push({candidateId:j,type:"primary-found",anchor:f.source,applicabilityBindingHash:f.bindingHash,accepted:h}),h))for(let e of f.basisRefs)["includes","shared-delivery"].includes(e.relation)&&i.has(e.refId)&&ab(e.quote).includes(ab(d.element))&&c(e,a)&&b.push({candidateId:j,type:"independently-reviewed-basis",anchor:e,applicabilityBindingHash:f.bindingHash,basisRefId:e.refId,relation:e.relation,review:{candidateHash:f.review.candidateHash,sourceHash:f.review.sourceHash,inputHash:f.review.inputHash,status:"accepted"}});return{...a,witnesses:b}});return{occurrences:f,uncovered:f.filter(a=>!a.witnesses.length).map(({witnesses:a,...b})=>b)}}function ag(a){if(!(a.length<2)&&a.some(a=>a.parents.some(b=>b.nodeId===a.match.nodeId)))return{rule:"节点是否具有父角色只看该处冻结parents;真实heading可同时是match和parent,允许选用;不在parents的普通原句节点仍不能作parent。共同父节点如仍命中多处,不能完成消歧。",occurrences:a.map(b=>({match:b.match,parents:b.parents.map(c=>({node:c,alsoMatchedHeading:c.nodeId===b.match.nodeId,matchingOccurrences:a.filter(a=>a.parents.some(a=>a.nodeId===c.nodeId)).length}))}))}}async function ah(a){let b;if(!a.sourceFiles.length)throw Error("TENDER_OBLIGATION_SOURCE_MISSING:没有冻结招标/补疑/答疑原文,不能提取义务");let c=a.maxExcerptCharsPerBatch??m.NX.$,e=new Map(a.sourceFiles.map(a=>[a.filePath,a.text])),k=a.sourceFiles,y=(0,j.ML)(a.sourceFiles),B=(a,b)=>{let c=e.get(a);if(!c||!b)return 0;let d=0,f=c.indexOf(b);for(;f>=0;)d+=1,f=c.indexOf(b,f+b.length);return d},L=a=>{if(!a)return!1;let b=e.get(a.sourceFile);return!!(b&&a.start>=0&&a.end===a.start+a.quote.length&&b.slice(a.start,a.end)===a.quote&&a.nodeId===`tender-source:${(0,d.Fu)([a.sourceFile,a.start,a.quote]).slice(0,24)}`)},M=(0,g.randomUUID)(),R=`tender-extraction-inputs-${M}.json`,ae=a.diagnostics&&(0,I.frozenModelConfigurationForRun)(a.diagnostics),ah=ae?{status:"recorded",sha256:(0,H.x)(a.diagnostics)}:{status:"unavailable",reason:"no-frozen-model-configuration"},ai=a.artifactDir&&ae?(0,G.G)(f().join(a.artifactDir,"tender-obligation-response-cache"),a.diagnostics,"tender-obligation-response-v1",a.runId):void 0,aj=(a,b)=>{let c=b===N?function(a,b){let c=a.candidates,e=a.evidenceSelectionDirectory;if(!Array.isArray(c)||!e?.candidates||new Set(c.map(a=>a.candidateId)).size!==c.length)throw Error("TENDER_REVIEW_WIRE_INPUT");let f=new Map(c.map(a=>[a.candidateId,{candidateId:a.candidateId,candidateHash:a.candidateHash,target:a.target}])),g=new Map,h=new Map,i=c.map((a,b)=>{let c=e.candidates.find(b=>b.candidateId===a.candidateId);if(!c||!a.candidateHash||!a.target)throw Error("TENDER_REVIEW_WIRE_IDENTITY");let d=new Map,f=[],i=a=>{let c=`c${b+1}e${f.length+1}`;if(g.has(a))throw Error("TENDER_REVIEW_WIRE_DUPLICATE_REFERENCE");return g.set(a,c),d.set(c,a),f.push(c),c},j=c.groups.map(a=>({...a,ref:i(a.ref),parts:a.parts.map(a=>({...a,ref:i(a.ref)}))}));return h.set(a.candidateId,d),{candidateId:c.candidateId,groups:j}}),j=b.properties.decisions.items,k=a=>{let b=a.properties&&Object.fromEntries(Object.entries(a.properties).filter(([a])=>!["candidateId","candidateHash","target"].includes(a)).map(([a,b])=>[a,k(b)]));return{...a,...Array.isArray(a.required)?{required:a.required.filter(a=>!["candidateId","candidateHash","target"].includes(a))}:{},...b?{properties:b}:{},...a.items?{items:k(a.items)}:{}}},l=`^(?:${c.map(a=>a.candidateId.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&")).join("|")})$`,m={type:"object",additionalProperties:!1,required:["decisions"],properties:{decisions:{type:"object",additionalProperties:!1,required:c.map(a=>a.candidateId),patternProperties:{[l]:k(j)}}}},n=a=>Array.isArray(a)?a.map(n):a&&"object"==typeof a?Object.fromEntries(Object.entries(a).filter(([a])=>"candidateHash"!==a).map(([a,b])=>[a,["from","through","ref"].includes(a)&&"string"==typeof b?g.get(b)??b:n(b)])):a;return{payload:{...n(a),reviewReplyProtocol:{version:"tender-review-bound-reply-v1",instructions:"decisions是按当前candidateId为键的对象,每键一个结论。值只写status/reason/headingOnly/evidence/contentScope;headingOnly 必须显式返回 true/false,不得省略:仅当原句本身只是标题/引导句、无独立技术响应内容时为 true,冒号结尾但有实质要求必须为 false;不返回candidateId/candidateHash/target,身份及审查目标由本次请求绑定。证据仅选择本候选给出的短ref,不能跨候选借用。此封装不产生语义批准。"},evidenceSelectionDirectory:{...e,candidates:i}},schema:m,binding:{version:"tender-review-bound-reply-v1",requestBindingHash:(0,d.Fu)([e.bindingHash,[...f.values()],i]),candidates:[...f.values()],references:[...h].map(([a,b])=>({candidateId:a,refs:[...b]}))},restore(a){if(!a||"object"!=typeof a||Array.isArray(a))throw Error("TENDER_REVIEW_WIRE_SHAPE");if(!a.decisions||"object"!=typeof a.decisions||Array.isArray(a.decisions)||Object.keys(a).some(a=>"decisions"!==a))throw Error("TENDER_REVIEW_WIRE_SHAPE:decisions必须为按当前候选键索引的对象");let b=a.decisions;if(Object.keys(b).some(a=>!f.has(a)))throw Error("TENDER_REVIEW_WIRE_CANDIDATES:不接受额外或旧候选");return{decisions:Object.keys(b).map(a=>{let c=f.get(a),d=b[a];if(!d||"object"!=typeof d||Array.isArray(d)||["candidateId","candidateHash","target"].some(a=>Object.hasOwn(d,a)))throw Error("TENDER_REVIEW_WIRE_IDENTITY:身份由本次请求绑定,不允许模型覆盖");let e=b=>Array.isArray(b)?b.map(e):b&&"object"==typeof b?Object.fromEntries(Object.entries(b).map(([b,c])=>{if("from"!==b&&"through"!==b)return[b,e(c)];let d="string"==typeof c?h.get(a).get(c):void 0;if(!d)throw Error(`TENDER_REVIEW_WIRE_FOREIGN_REFERENCE:${a}.${b}必须选择本候选短ref,实际=${String(c)};合法选项=${[...h.get(a).keys()].join(",")}`);return[b,d]})):b;return{...e(d),...c}})}}}}(a,b):void 0,e=(0,j.El)(c?.payload??a,y),f={...e,restoreResponse:a=>{let b=e.restoreResponse(a);return void 0===b?void 0:c?c.restore(b):b}},g=a=>({...a,...a.properties?{properties:Object.fromEntries(Object.entries(a.properties).filter(([a])=>"parentNodeId"!==a||f.parentReferences.length).map(([a,b])=>[a,"parentNodeId"===a?{...b,enum:f.parentReferences}:g(b)]))}:{},...a.items&&!Array.isArray(a.items)?{items:g(a.items)}:{}});return{projection:f,...c?{wireBinding:c.binding}:{},schema:c?.schema??(b===N?{...b,properties:g(b).properties}:b)}},ak=(a,b,c)=>{let d=aj(b,c);return(0,n.documentJsonSystemPrompt)(a,d.schema).length+JSON.stringify(d.projection.prompt).length},al=[],am=[],an=[],ao=[],ap=[],aq=(a,b,c,e,f)=>{let g=aj(c,e);return am.push({stage:a,modelInputChars:ak(b,c,e),inputHash:(0,d.Fu)([(0,n.documentJsonSystemPrompt)(b,g.schema),JSON.stringify(g.projection.prompt)]),reason:f}),f},ar=0,as=(b,d=!1)=>{let e=d?R.replace(/\.json$/u,`-snapshot-${++ar}.json`):R;a.artifactDir&&a.runId&&(0,o.tv)(a.artifactDir,e,{version:"tender-extraction-inputs-v1",invocationId:M,inputBudgetChars:c,unit:"utf16-code-units",qualification:"logical-request-input-not-provider-attempt-usage",frozenModelIdentity:ah,...b?{blockedWindow:b}:{},calls:al,blockedInputs:am,referenceRepairs:an,applicabilityReviews:ao,semanticRevisions:ap},a.runId)},at=b=>{a.artifactDir&&a.runId&&(0,o.tv)(a.artifactDir,`tender-extraction-input-${M}-${String(b.ordinal).padStart(6,"0")}-${b.status}.json`,{version:"tender-extraction-input-v1",invocationId:M,qualification:"logical-request-input-not-provider-attempt-usage",inputBudgetChars:c,unit:"utf16-code-units",frozenModelIdentity:ah,...b},a.runId)},au=async(b,e,f,g,i)=>{let j=aj(f,g),k=j.projection;g=j.schema;let l=JSON.stringify(k.prompt),m=(0,n.documentJsonSystemPrompt)(e,g);if(m.length+l.length>c)throw Error(aq(b,e,f,g,`TENDER_OBLIGATION_INPUT_OVERSIZE:${b} 实际消息 ${m.length+l.length} 字符超过 ${c},未派发`));let p={ordinal:al.length+1,stage:b,status:"invoked",systemChars:m.length,promptChars:l.length,..."string"==typeof f.version?{operation:f.version}:{},schemaChars:JSON.stringify(g).length,modelInputChars:m.length+l.length,inputHash:(0,d.Fu)([m,l]),payloadFields:Object.fromEntries(Object.entries(k.prompt).map(([a,b])=>[a,JSON.stringify(b).length]))};if(Array.isArray(f.files)){let a=f.files;p.sourceChars=a.reduce((a,b)=>a+b.excerpts.reduce((a,b)=>a+b.length,0),0),p.sourceContextChars=a.reduce((a,b)=>a+JSON.stringify(b.sourceContext).length,0),p.sourceRanges=a.flatMap(a=>a.ranges.map(b=>({filePath:a.filePath,...b})))}p.sourceProjectionChars=JSON.stringify(k.prompt.sourceProtocol).length,Array.isArray(k.prompt.data.files)&&(p.sourceContextReferenceChars=k.prompt.data.files.reduce((a,b)=>a+JSON.stringify(b.sourceContext).length,0)),al.push(p),at(p),j.wireBinding&&a.artifactDir&&a.runId&&(0,o.tv)(a.artifactDir,`tender-review-wire-${M}-${p.ordinal}.json`,{inputHash:p.inputHash,...j.wireBinding},a.runId);try{var q;let d=await a.caller(e,l,{schema:g,diagnostics:a.diagnostics,signal:a.signal,validateProtocol:c=>{let d=k.restoreResponse(c);return[..."tender-applicability-review"===b?function(a,b,c){let d=a&&"object"==typeof a&&"decisions"in a?a.decisions:void 0;if(!Array.isArray(d))return["decisions 必须是当前候选的审查数组"];let e=[],f=new Map(b.map(a=>[a.candidateId,a])),g=new Map;for(let[a,b]of d.entries()){let d=`decisions[${a}]`;if(!b||"object"!=typeof b){e.push(`${d} 必须是审查对象`);continue}let h="string"==typeof b.candidateId?b.candidateId:"",i=f.get(h);if(!i){e.push(`${d}.candidateId 不属于本批当前候选`);continue}if(g.set(h,(g.get(h)??0)+1),b.candidateHash!==i.candidateHash&&e.push(`${d}(${h}).candidateHash 必须原样为 ${i.candidateHash},不能使用其它候选的 hash`),b.target!==i.target&&e.push(`${d}(${h}).target 必须为 ${i.target}`),c&&"technical-content"===i.target&&"accepted"===b.status){let a=b.contentScope;a&&Array.isArray(a.technical)&&Array.isArray(a.excluded)||e.push(`${d}(${h}).contentScope:accepted 的 technical-content 必须提供 technical/excluded 数组;reason 不能代替范围。若尚无依据,保留真实 disputed/unmeasured,不得编造批准。`)}}for(let a of b)1!==g.get(a.candidateId)&&e.push(`候选 ${a.candidateId} 必须恰有一个当前独审结论;依据不足可返回 unmeasured,不得漏项或重复`);return e}(d,f.candidates,!!a.requireContentScope):[],..."tender-applicability-review"===b&&i?function(a,b){let c=function(a){if(!a||"object"!=typeof a||!("decisions"in a))return;let b=a.decisions;return Array.isArray(b)?b:void 0}(a);if(!c)return[];let d=new Map(b.directory.candidates.map(a=>[a.candidateId,a])),e=[];for(let[a,f]of c.entries()){if(!f||"object"!=typeof f)continue;let c="string"==typeof f.candidateId?f.candidateId:"",g=d.get(c);if(!g||f.candidateHash!==g.candidateHash)continue;let i=`decisions[${a}](${c})`;void 0!==f.evidence&&e.push(...h(f.evidence,c,g.candidateHash,b,`${i}.evidence`).errors);let j=f.contentScope;if(j&&"object"==typeof j&&!Array.isArray(j))for(let a of["technical","excluded"]){let d=j[a];void 0!==d&&e.push(...h(d,c,g.candidateHash,b,`${i}.contentScope.${a}`,["technical"===a?"response":"reason"]).errors)}}return e}(d,i):[],..."tender-applicability-revision-v2"===f.version?E(d,f.candidates,y):[]]},onAttempt:c=>{if(c.raw)try{k.restoreResponse(JSON.parse(c.raw))}catch(d){if(d instanceof SyntaxError||!a.artifactDir||!a.runId)return;(0,o.tv)(a.artifactDir,`tender-source-reference-failure-${M}-${p.ordinal}-${c.ordinal}.json`,{version:"tender-source-reference-failure-v1",stage:b,inputHash:p.inputHash,raw:c.raw,reason:d instanceof Error?d.message:String(d),reusedAsValidResponse:!1},a.runId)}},maxInputChars:c,temperature:0,taskKind:(q=String(f.version??""),"tender-applicability-reference-repair-v1"===q&&"1"===process.env.DOCUMENT_BINDING_SELECTION_LOW_REASONING?"binding-selection":"reasoning"),callKind:b,prefixKey:`tender:${b}`,...ai?{responseCache:ai,onResponseCache:a=>{"hit"===a.event?p.cache={requestKey:a.requestKey,responseSha256:a.responseSha256,originRunId:a.originRunId}:p.cacheErrors=a.errors}}:{}}),j=k.restoreResponse(d);if(void 0!==j&&"tender-applicability-revision-v2"===f.version){let a=E(j,f.candidates,y);if(a.length)throw Error(a.join(";"))}return p.status=p.cache?"cache-hit":void 0===d?"failed":"completed",j}catch(a){throw p.status="failed",p.error=a instanceof Error?a.message:String(a),a}finally{at(p)}},av=a=>({...a,sourceContext:a.excerpts.map((b,c)=>{let d=a.ranges[c];return(0,j.rP)(y,a.filePath,b).filter(a=>a.start===d.start&&a.end===d.end).map(a=>({...a,parents:a.parents.map(a=>({nodeId:a.nodeId,start:a.start,end:a.end,sourceDomain:a.sourceDomain,...a.start>=d.start&&a.end<=d.end?{}:{quote:a.quote}})),boundaries:a.boundaries.map(a=>({nodeId:a.nodeId,start:a.start,end:a.end,sourceDomain:a.sourceDomain}))}))})}),aw=new WeakMap,ax=(a,b)=>{let c=structuredClone(b.applicability??{}),d=(0,j.IG)({index:y,sourceFile:b.sourceFile,quote:b.quote,kind:a,...b.element?{element:b.element}:{},requested:c});return aw.set(d,c),d},ay=[],az=(a,b)=>{let c=ab(b);if(!c)return;let d=e.get(a);if(d){let e=d.indexOf(b);if(e>=0||ab(d).includes(c))return{filePath:a,...ac(d,Math.max(0,e))?{page:ac(d,Math.max(0,e))}:{}}}for(let a of k){let d=a.text.indexOf(b);if(d>=0||ab(a.text).includes(c))return{filePath:a.filePath,...ac(a.text,Math.max(0,d))?{page:ac(a.text,Math.max(0,d))}:{}}}},aA=a=>{let b=a.trim();if(!b)return;let c=/表|图|框图|曲线|网络图|横道图|平面布置|组织机构|人员组成|机械设备|附件/u;if(c.test(b))for(let a of k){let d=a.text.indexOf(b);if(d<0)continue;let e=Math.max(a.text.lastIndexOf("。",d),a.text.lastIndexOf(";",d),a.text.lastIndexOf("\n",d))+1,f=[a.text.indexOf("。",d),a.text.indexOf(";",d),a.text.indexOf("\n",d)].filter(a=>a>=0),g=f.length?Math.min(...f)+1:a.text.length,h=a.text.slice(e,g).trim();if(h&&c.test(h))return{filePath:a.filePath,quote:h,...ac(a.text,d)?{page:ac(a.text,d)}:{}}}},aB=[],aC=[],aD=[],aE=(a,b,c)=>({task:"从冻结招标原文提取施工组织设计的内容义务与明确输出要求",batch:{index:b+1,count:c},rules:["本次只处理给定原字窗口;ranges记录连续页与原窗口区间,不要假设其他页没有条件。来源标题的结构引用指向excerpts内原字,范围未明确时保留unresolved,不按分页断口解释适用性。","只提取原文明确要求的内容;原文没有的,不补。","**评审因素/评分标准不是内容义务**:它们由章节响应承载,不要作为 contentObligations 返回;**纯提交/修改/期限/份数等程序要求**也不要返回,除非它直接决定正文必须包含什么。","补疑/答疑中明确要求施工组织设计包含或编制的内容(如专项施工方案、深化设计、专项措施)**必须提取**;是否单独成节由规划决定,不要因为“可能另行报审”而排除。","contentObligations:招标/合同条款要求施工组织设计必须包括、说明或提交的内容。按**原子项**拆分(每项只表达一个可落实的义务),text 用简短名词短语,quote 逐字摘录包含该义务的连续原文(保持原文完整语义,不得改写、拼接或截断到失去条件)。","**逐项列举必须拆开**:同一句原文用“(1)(2)…”“① ② ③”“第一、第二”或顿号/分号列出多个可执行类别时,必须在同一义务的 `items` 中逐项列出(如危大工程的模板工程、起重吊装、脚手架、拆除、钢结构安装);不得合并成一条摘要,也不得只保留前几项。","kind=content 表示正文必须落实的工程/管理内容;kind=procedure 表示提交、修改、期限、确认等程序要求。","outputObligations:原文**点名具体名称**的表格、图件、网络图、横道图、平面布置图、组织机构图、人员组成表、机械设备表、曲线等。form 按实际形态选择;element 用原文名称;quote 逐字摘录包含该要求的连续原文。","sourceContext中的sourceDomain与父链仅是原文定位元数据,不能决定适用性:合同、附录、商务载体可能含本技术方案的最低人员、机械、工期、质量、深化设计等真实约束,必须完整保留并逐项判断,不能按父域或表名排除。","每个content/output必须给applicability独立维度:technicalContent判断required-response/technical-constraint/reference/not-applicable/unresolved;delivery分别判断强制程度requirement、交付文件location、是否必须原格式originalForm、阶段stage和conditions。technicalContent要求响应不等于本技术正文必须提交该原表;建议不能升级必出,施工阶段专项成果不等于投标时完整成果。","reason解释原句与跨引用;basisRefs可来自多个给定冻结文件,逐项给refId/sourceFile/quote/relation/explanation/linkedTo(可链接source或其他refId);parentNodeId只用于消歧。来源原句不必包含“施工组织设计”字眼,不能依关键词当语义证明。stage=multiple须在stages明确列出bid/contract/construction,不能只写自然语言条件。","同一条款可同时有技术内容约束和另一文件/阶段原表义务,分别保留content与output;匿名岗位配置可响应技术资源要求,但去姓名不自动等于完整具名表履约;共享附件与补疑覆盖须保留可核交叉引用。主提取不得自行提供review/verified,全部决定(含排除)需后续独立scope审查。","补疑中的工程技术责任可作为content响应,不因没有“施工组织设计”字样而删除;但施工期独立编制报审的专项成果,不能自动作为本篇必出表图。归属未能裁决时保留typed unresolved;自由文本unresolved不能代替条目的applicability。","纯商务、资格或报价原表不等于技术必出;但表类名称不决定去留,有技术交叉引用或共享附件时保留独立内容约束与原表交付记录,分别给出多维解释,不按名称删除。实际要求暗标时另核身份约束,不借匿名化改写原表归属。","泛称“文字并结合图表形式编制”不单独作为一项输出;只有点名具体图表名称时才提取。","不要从“评审因素/评分标准”里推断输出形式;只提取原文明确点名的输出。","sourceFile 必须使用 sourceProtocol.files 给出的 fileRef;服务端恢复规范文件路径。page 可不填,程序会按 quote 定位。","同一 quote 可以支撑多条义务;不同义务不要重复。","有歧义时写入 unresolved,不要猜。"],files:a.map(av),outputProtocol:"严格遵循system中的当前JSON schema与全部枚举;每条content/output的applicability必须完整。basisRefs/reason属于applicability,不是外层义务;originalForm是枚举字符串,不能填boolean;不用mandatory、bid-technical-file或中文自造枚举。"});try{b=(0,p.tenderObligationExcerptBatches)(a.sourceFiles,c,a=>ak(W,aE(a,Number.MAX_SAFE_INTEGER-1,Number.MAX_SAFE_INTEGER),U))}catch(a){throw as(a instanceof Error?a.message:String(a)),a}let{batches:aF,windowsTotal:aG,charsTotal:aH,pagesTotal:aI}=b;if(!aF.length)throw Error("TENDER_OBLIGATION_EXCERPTS_EMPTY:冻结招标来源全文为空,不能提取义务");let aJ=async(a,b)=>{let c,d=[],e=[],f=[],g=[],h=0;try{c=await au("tender-obligation-extraction",W,aE(b,a,aF.length),U)}catch(b){throw Error(`TENDER_OBLIGATION_EXTRACTION_FAILED:第 ${a+1}/${aF.length} 批失败:${b instanceof Error?b.message:String(b)}`,{cause:b})}if(!c||"object"!=typeof c)throw Error(`TENDER_OBLIGATION_EXTRACTION_FAILED:第 ${a+1}/${aF.length} 批模型未返回 JSON 结果`);let i=c;for(let a of i.contentObligations??[]){let b=String(a?.text??"").trim(),c=String(a?.quote??"").trim();if(!b||!c)continue;let e=az(String(a?.sourceFile??""),c);if(!e){g.push({kind:"content",text:b,reason:"quote 不在冻结原文中逐字存在",quote:c});continue}let f=[...new Set((Array.isArray(a?.items)?a.items:[]).map(a=>String(a??"").trim()).filter(Boolean))],i=z(c,f);h+=Math.max(0,f.length-i.length),d.push({text:b,kind:a?.kind==="procedure"?"procedure":"content",quote:c,sourceFile:e.filePath,...a?.clause?.trim()?{clause:a.clause.trim()}:{},...e.page?{page:e.page}:{},...i.length?{items:i}:{},applicability:ax("content",{...a,quote:c,sourceFile:e.filePath})})}for(let a of i.outputObligations??[]){let b=String(a?.element??"").trim(),c=String(a?.quote??"").trim(),d=aa(String(a?.form??"").trim());if(!b||!c||!d)continue;let f=az(String(a?.sourceFile??""),c);if(!f){let a=aA(b);if(!a){g.push({kind:"output",text:b,reason:"quote 不在冻结原文中逐字存在,且原文未点名该输出",quote:c});continue}e.push({form:d,element:b,quote:a.quote,sourceFile:a.filePath,applicability:ax("output",{element:b,quote:a.quote,sourceFile:a.filePath})});continue}e.push({form:d,element:b,quote:c,sourceFile:f.filePath,applicability:ax("output",{...a,element:b,quote:c,sourceFile:f.filePath})})}for(let a of i.unresolved??[]){let b=String(a?.question??"").trim();b&&f.push({question:b,...a?.sourceFile?.trim()?{sourceFile:a.sourceFile.trim()}:{}})}return{content:d,outputs:e,questions:f,rejected:g,itemsRejected:h}},aK=Math.max(1,Math.floor(m.N6?.obligationBatches??2)),aL=await (0,q.W)(aF,aK,(a,b)=>aJ(b,a)),aM=0;for(let a of aL)aB.push(...a.content),aC.push(...a.outputs),aD.push(...a.questions),ay.push(...a.rejected),aM+=a.itemsRejected;let aN=(a,b)=>{let c=new Set;return a.filter(a=>{let d=b(a);return!c.has(d)&&(c.add(d),!0)})},aO=a=>`${a.sourceFile}|${a.applicability?.source.nodeId}|${a.form}|${a.element}|${ab(a.quote)}`,aP=aN(aB,a=>`${a.sourceFile}|${a.applicability?.source.nodeId}|${a.clause??""}|${a.text}|${ab(a.quote)}`),aQ=aN(aC,aO),aR=aN(aD,a=>a.question),aS=a=>{let b=new Set;for(let c of ad(k)){let{term:d,filePath:e,start:f,end:g,excerpt:h}=c;a.some(a=>a.sourceFile===e&&(a.element.includes(d)||d.includes(a.element))&&a.applicability&&a.applicability.source.start<=g&&a.applicability.source.end>=f)||b.add(JSON.stringify({term:d,filePath:e,start:f,excerpt:h}))}return b},aT=aS(aQ),aU=[],aV=[];if(aT.size){let b=[...aT].map(a=>{try{let b=JSON.parse(a),c=String(b.term??""),d=String(b.filePath??""),e=b.excerpt??"";return{term:c,filePath:d,excerpt:e,sourceContext:(0,j.rP)(y,d,e)}}catch{return{term:"",filePath:"",excerpt:""}}}).filter(a=>a.term&&a.excerpt),d=a=>({task:"补提取原文点名的图表输出,逐项完整返回当前schema中的applicability;分别解释技术内容、交付位置、阶段、强制程度与原格式,不按父域自动排除或升级",rules:["**quote 必须逐字等于输入 focus 中对应项的 excerpt**(照抄触发句,不含首尾空白),sourceFile 照抄该项的 filePath;不得改写、缩写或另选原文句子——引文逐字可核是这条义务成立的前提。"],focus:a}),e=[],f=[];for(let a of b){if(ak(X,d([a]),V)>c){aq("tender-output-recall",X,d([a]),V,"单个点名输出与完整来源上下文超过输入预算,保留原句与后续局部待核");continue}f.length&&ak(X,d([...f,a]),V)>c&&(e.push(f),f=[]),f.push(a)}for(let b of(f.length&&e.push(f),e))try{let a=(await au("tender-output-recall",X,d(b),V)??{}).outputObligations??[];for(let c of(aU.push({batchTerms:b.map(a=>a.term),returned:a.map(a=>({element:String(a.element??""),quote:String(a.quote??""),form:String(a.form??"")})),status:"completed"}),a)){let a=String(c.element??"").trim(),b=String(c.quote??"").trim(),d=aa(String(c.form??""));if(!a||!b||!d)continue;let e=az(String(c.sourceFile??""),b);e&&aC.push({form:d,element:a,quote:b,sourceFile:e.filePath,applicability:ax("output",{...c,element:a,quote:b,sourceFile:e.filePath})})}aQ=aN(aC,aO);let c=aS(aQ);for(let a of(aT.clear(),c))aT.add(a)}catch(c){aU.push({batchTerms:b.map(a=>a.term),status:"failed",error:c instanceof Error?c.message:String(c)}),a.signal?.throwIfAborted()}for(let a of[...aT])try{let b=JSON.parse(a),c=String(b.term??""),d=String(b.filePath??""),e=b.excerpt,f=/表/u.test(c)?"table":/图/u.test(c)?"figure":void 0;if(c&&e&&f){let a={form:f,element:c,quote:e,sourceFile:d,applicability:ax("output",{element:c,quote:e,sourceFile:d})};aC.push(a),aV.push({term:c,filePath:d,form:f,quoteChars:e.length,anchorReal:L(a.applicability.source),quoteOccurrences:B(d,e)})}else aV.push({term:c,filePath:d,form:f,skipped:!0})}catch(a){aV.push({status:"failed",error:a instanceof Error?a.message:String(a)})}let g=aS(aQ=aN(aC,aO));for(let a of(aT.clear(),g))aT.add(a)}let aW=function(a){let b=function(a){let b=[],c=[],d=0,e=new Set;for(let f of a)for(let a of function(a){let b=[...a.matchAll(u)];if(!b.length)return[{text:a}];let c=[],d=0;for(let[e,f]of b.entries()){let g=f.index??0;g>d&&c.push({text:a.slice(d,g)});let h=b[e+1]?.index??a.length;c.push({page:f[1],text:a.slice(g,h)}),d=h}return d<a.length&&c.push({text:a.slice(d)}),c}(f.text))for(let g of function(a,b=!1){let c=[],d,e=[],f=[],g=!1,h=/^\s*#{1,6}(?:\s|$)/u,i=/^\s*第[一二三四五六七八九十百零〇\d]+[章节条款]/u,j=a=>v.test(a)||/^\d+(?:[..]\d+)+(?=[^\d..])/u.test(a)||w.test(a)||h.test(a)||/PDF\s*第\s*\d+\s*页/u.test(a),k=()=>{let a=e.join("").trim();a&&c.push({...d?{heading:d}:{},text:a}),e=[],f=[],g=!1};for(let c of a.match(/[^\r\n]*(?:\r?\n|$)/gu)??[]){if(!c)continue;let a=c.trim();if(!a){f.push(c);continue}if(f.length){let c=e.at(-1)?.trim()??"";!b||g||!c||/[。!?!?;;::.][”’」』)》】〕))\]]*$/u.test(c)||w.test(c)||h.test(c)||i.test(c)||/PDF\s*第\s*\d+\s*页/u.test(c)||j(a)?k():e.push(...f),f=[]}v.test(a)&&a.length<=100&&!w.test(a)&&(k(),d=a),e.push(c),g||=w.test(a)}return k(),c}(a.text,void 0!==a.page)){if(g.text.length<8||g.heading===g.text&&g.text.length<36&&!/[::]/u.test(g.text)&&0===x(g.text).length)continue;let h=function(a){let b=s(a);return r.categories.filter(a=>a.terms.some(a=>b.includes(s(a)))).sort((a,b)=>b.priority-a.priority||a.id.localeCompare(b.id))}(g.text);if(!h.length){A(g.text,h)&&(d+=1,c.length<50&&c.push({filePath:f.filePath,...a.page?{page:a.page}:{},text:g.text.slice(0,500)}));continue}if(!A(g.text,h))continue;let i=`requirement-clause:${t(`${f.filePath}\u0000${a.page??""}\u0000${s(g.text)}`)}`;e.has(i)||(e.add(i),b.push({id:i,filePath:f.filePath,...a.page?{page:a.page}:{},...g.heading?{heading:g.heading}:{},text:g.text,categoryIds:h.map(a=>a.id),categoryLabels:h.map(a=>a.label),items:x(g.text),covered:!1}))}return{clauses:b,unclassified:c,unclassifiedCount:d}}(a.sourceFiles),c=a.extraction.contentObligations.map(({items:a,...b})=>({...b,...a?{items:[...a]}:{}})),d=0,e=0,f=0,g=[];for(let h of b.clauses){let b=s(h.text),i=a.applicabilityResolver?.({sourceFile:h.filePath,quote:h.text}),j=a=>{if(a.sourceFile!==h.filePath)return!1;if(!i)return!0;let b=a.applicability?.source,c=i.source;return b&&b.sourceFile===c.sourceFile&&b.start>=0&&c.start>=0&&b.start<=c.start&&b.end>=c.end},k=c.find(a=>{if(!j(a))return!1;let c=s(a.quote);return c.length>=8&&c.includes(b)});if(k){if(h.items.length&&!k.items?.length){let a=z(k.quote,h.items);a.length&&(k.items=a)}k.categories=[...new Set([...k.categories??[],...h.categoryIds])],k.origin=k.origin??"agent-extraction",h.covered=!0,h.coveredBy=k.text,e+=1;continue}if(!h.categoryIds.map(a=>r.categories.find(b=>b.id===a)).filter(a=>a.addAsContent).sort((a,b)=>b.priority-a.priority).length){h.covered=!1,f+=1,g.length<50&&g.push({filePath:h.filePath,...h.page?{page:h.page}:{},categories:[...h.categoryIds],text:h.text.slice(0,500)});continue}c.push({text:h.text,kind:"content",quote:h.text,sourceFile:h.filePath,...h.page?{page:h.page}:{},...h.heading?{clause:h.heading}:{},...h.items.length?{items:h.items}:{},origin:"requirement-clause",categories:[...h.categoryIds],...i?{applicability:i}:{}}),h.covered=!0,d+=1}return{extraction:{...a.extraction,contentObligations:c},coverage:{version:r.version,clauses:b.clauses.length,classified:b.clauses.length,covered:e,added:d,unclassified:b.unclassifiedCount,unclassifiedSamples:b.unclassified,deferred:f,deferredSamples:g,requirementClauses:b.clauses}}}({sourceFiles:a.sourceFiles,applicabilityResolver:a=>ax("content",a),extraction:{applicabilityVersion:j.q$,contentObligations:aP,outputObligations:aQ,unresolved:aR}}),aX=aW.extraction;for(let b of a.chapterPoints??[]){if(aX.contentObligations.some(a=>a.sourceFile===b.sourceFile&&ab(a.quote)===ab(b.quote)))continue;let a=ax("content",b);if(!L(a.source))throw Error(`TENDER_CHAPTER_POINT_SOURCE_INVALID:${b.text} 没有唯一的冻结原文依据(${b.sourceFile})`);aX.contentObligations.push({...b,kind:"content",applicability:a})}await a_(aX);let aY=af({sourceFiles:a.sourceFiles,outputs:aX.outputObligations});a.artifactDir&&a.runId&&(0,o.tv)(a.artifactDir,"tender-named-output-coverage.json",{version:"tender-named-output-coverage-v1",runId:a.runId,occurrences:aY.occurrences.map(a=>({term:a.term,filePath:a.filePath,context:a.context,start:a.start,witnesses:a.witnesses.map(a=>({type:a.type,candidateId:a.candidateId,accepted:a.accepted??null,review:a.review??null}))})),uncovered:aY.uncovered.map(a=>({term:a.term,filePath:a.filePath,context:a.context,start:a.start})),recallLog:aU,fallbackLog:aV},a.runId),await a$(aX),as();let aZ={version:K,applicabilityVersion:j.q$,extraction:aX,rejected:ay,counts:{content:aX.contentObligations.length,output:aQ.length,unresolved:aR.length,rejected:ay.length,uncovered:aY.uncovered.length,itemsRejected:aM},uncoveredOutputs:aY.uncovered.map(a=>`${a.term}(${a.filePath}@${a.start})`),namedOutputCoverage:aY,excerptChars:aH,promptVersion:`${K}-batched-v7-lossless-source-references`,inputLedgerArtifact:R,coverage:{windowsTotal:aG,windowsRead:aG,windowsUnread:0,batches:aF.length,charsTotal:aH,pages:aI},requirementCoverage:aW.coverage};if(a.artifactDir&&a.runId){let{inputLedgerArtifact:b,...c}=aZ;(0,o.tv)(a.artifactDir,"tender-obligation-extraction.json",c,a.runId)}return aZ;async function a$(b){for(let e of b.outputObligations){let b,f;if(!(0,j.oY)(e)||"required"!==e.applicability.delivery.originalForm)continue;let g=e.applicability,h=[g.source,...g.basisRefs],i=[],k=(a,b,c)=>{let d=y.files.find(b=>b.filePath===a),e=Math.max(0,b-1800),f=Math.min(d.text.length,c+3600);if(i.some(b=>b.sourceFile===a&&b.start<=e&&b.end>=f))return;for(let b=i.length-1;b>=0;b--){let c=i[b];c.sourceFile!==a||c.end<e||c.start>f||(e=Math.min(e,c.start),f=Math.max(f,c.end),i.splice(b,1))}let g=d.text.slice(e,f);i.push({sourceFile:a,sourceTextHash:d.sourceTextHash,start:e,end:f,text:g,parents:(0,j.rP)(y,a,g)})};for(let a of h)k(a.sourceFile,a.start,a.end);for(let a of y.files)for(let b of a.text.matchAll(RegExp(e.element.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&"),"gu")))k(a.filePath,b.index,b.index+e.element.length);let l={...{version:"tender-original-form-proposal-v1",task:"从已核原格式必交义务的冻结母版提案字段、表头、分组、固定行、说明与格式规则;不自行审查",output:{form:e.form,element:e.element,applicability:g},sourceHash:y.sourceHash,sourceCatalog:y.files.map(a=>({sourceFile:a.filePath,sourceTextHash:a.sourceTextHash,chars:a.text.length})),rules:["只提取本输出对应母版,不能混入同页相邻表、同名另一来源或页码。sourceRefs与每项依据均逐字给sourceFile/quote,parentNodeId只作消歧。","fields保持实际字段标签、单位、分组表头headerPath及列序;包含原表序号列,不得去姓名/改名冒充原具名表。presence指原表字段是否必留,valueRequired须区分空白模板与实际交付必填,不能无依据禁止原表允许的空白。","conditional字段必须在condition逐项给出applies/not-applicable/unresolved、解释及冻结basisRefs;本项目条件已核成立或不成立才可作对应决定,不能默认永久未测,也不能无依据填not-applicable。固定原表保留表头但允许空值时用valueRequired=false,不能删列;仅原文明示条件不成立可不列的字段才用conditional/not-applicable。","rowGroups保持组名与组序;有明确岗位/固定行才列fixedRows并给labelFieldId及是否可重复,数组顺序即原行序。空白占位行数量不等于必须填同样数量资源。instructions逐字保留说明。","表头多层合并由headerPath表达。只有冻结原文明确支持的合并/固定布局才可主张;扁平OCR不足以判断视觉分组时给visual-layout未测约束,不能猜合并、尺寸、节点层级或声称像素一致。","图框/说明框只证明相应diagram-area/description-area区域;没有源要求不得编造组织层级或固定节点;必须精确布局且无法用常规图件表达的规则保留visual-layout。fixed-text规则的text必须是实际须保留的逐字文本,不能填规则解释。","上下文仅是所列窗口,sourceCatalog不表示全文已读;不自带review/verified,模板必须再由独立caller审查。"]},sourceWindows:i},m={sourceRefs:[],fields:[],rowGroups:[],instructions:[],formatRules:[]};if(ak($,l,S)>c)b=aq("tender-original-form-proposal",$,l,S,"原格式关联母版窗口与完整协议超过单次输入预算,未截断、未读取,保持本输出待核");else try{m=await au("tender-original-form-proposal",$,l,S)}catch(c){a.signal?.throwIfAborted(),b=`原格式提案未完成:${c instanceof Error?c.message:String(c)}`}let n=(0,J.Y8)({sourceFiles:a.sourceFiles,applicability:g,kind:"table"===e.form?"table":"figure",proposal:m}),o={version:"tender-original-form-review-v1",task:"独立复核原格式母版契约是否忠实完整,不核作者表格内容",sourceHash:y.sourceHash,candidateHash:(0,J.tL)(n),contract:n,sourceWindows:i,rules:["核当前已独审scope、母版身份、每字段/单位/必填条件/表头层级/列序/分组固定行顺序/说明及格式规则,禁止仅凭表名或quote存在认定语义完整。","不能把匿名技术资源响应认作具名原表完成,不能混入相邻表;空白行不是固定资源数量,未读或扁平OCR无法判断的视觉约束保持unmeasured,不能猜测。","accepted只接受当前candidateHash的模板契约;任何关键字段/说明/条件缺漏或误配disputed,依据/可读信息不足unmeasured。另有实际单元内容独审,不可由本模板结论提前认证实际数据。"]};if(!b&&ak(_,o,T)>c&&(b=aq("tender-original-form-review",_,o,T,"原格式独立审查、当前协议与完整母版窗口超过输入预算,保持本输出待核")),!b)try{f=await au("tender-original-form-review",_,o,T)}catch(c){a.signal?.throwIfAborted(),b=`原格式独立审查未完成:${c instanceof Error?c.message:String(c)}`}e.originalForm=n=(0,J.Q0)({contract:n,sourceFiles:a.sourceFiles,inputHash:(0,d.Fu)(o),result:f?.candidateHash===o.candidateHash&&"string"==typeof f.reason&&Array.isArray(f.evidence)&&["accepted","disputed","unmeasured"].includes(f.status)?f:{status:"unmeasured",reason:b??"原格式独立审查缺少唯一当前模板结论",evidence:[]}})}}async function a_(b){let e=[...b.contentObligations.map((a,b)=>({candidateId:`content-${b}`,kind:"content",item:a})),...b.outputObligations.map((a,b)=>({candidateId:`output-${b}`,kind:"output",item:a}))],f=a=>{let b=a.item.applicability??ax(a.kind,a.item);a.item.applicability=b;let c=aw.get(b);if(!c)throw Error("TENDER_APPLICABILITY_RAW_PROPOSAL_MISSING:本次候选原始引用记录缺失,不能从清洗后的scope重建");let d=(0,j.dY)({index:y,sourceFile:a.item.sourceFile,quote:a.item.quote,requested:c}),e=(0,j.r8)(y,a.item.sourceFile,a.item.quote),f=(c.basisRefs??[]).map((a,b)=>({index:b,refId:a.refId,relation:a.relation,linkedTo:a.linkedTo??[],contexts:(0,j.r8)(y,a.sourceFile,a.quote)})),g=ag(e),h=f.flatMap(a=>{let b=ag(a.contexts);return b?[{index:a.index,...b}]:[]});return{candidate:a,payload:{candidateId:a.candidateId,candidateHash:(0,j.DB)(b),kind:a.kind,text:"text"in a.item?a.item.text:a.item.element,scope:b,sourceContexts:e,basisContext:f,...g||h.length?{parentRoleEvidence:{...g?{source:g}:{},basisRefs:h}}:{},...d.length?{referenceIssues:d,requestedReferences:{source:{parentWasProvided:!!c.parentNodeId},basisRefs:(c.basisRefs??[]).map((a,b)=>{let{parentNodeId:c,...d}=a;return{index:b,...d,parentWasProvided:!!c}})}}:{}}}},g=a=>{let b=[],c=new Map,e=a=>a.map(a=>{let e=(0,d.Fu)(a),f=c.get(e);if(void 0!==f){if(JSON.stringify(b[f])!==JSON.stringify(a))throw Error("TENDER_SOURCE_CONTEXT_DIRECTORY_COLLISION");return f}let g=b.length;return c.set(e,g),b.push(a),g});return{sourceContextDirectory:b,candidates:a.map(a=>({...a,sourceContexts:e(a.sourceContexts),basisContext:a.basisContext.map(({contexts:a,...b})=>({...b,contextRefs:e(a)}))}))}},h=e.map(f).filter(a=>{let b=a.candidate.item.applicability;return b.issues.length>0||("content"===b.subject.kind?"unresolved"===b.technicalContent:Object.values(b.delivery).some(a=>"unresolved"===a)||"multiple"===b.delivery.stage&&!b.delivery.stages?.length)}),k={version:"tender-applicability-proposal-v1",task:"只补全当前候选缺失/未决的多维适用性提案,不改义务文本或原文、不自审",sourceHash:y.sourceHash,sourceCatalog:y.files.map(a=>({sourceFile:a.filePath,sourceTextHash:a.sourceTextHash,chars:a.text.length})),rules:["sourceDomain只作定位,合同/附录/商务内也可能含技术约束;保留最低配置、合同约定的施工组织内容、深化设计等正例。","报价、费用计取、支付台账与保险费用属于商务交付,不因被提作章节要点就变成技术义务;混合原句保留其中实际技术措施与约束,不能把费用管理一并纳入技术正文。","根据原句、上下文与跨引用分别判断technicalContent、delivery的requirement/location/originalForm/stage/conditions;建议不变必出,施工期成果不移到投标原表。","basisContext提供实际关联原句及父链;sourceCatalog只是全量引用目录,不等于已读全文。跨文件依据用basisRefs逐字引用并用linkedTo解释关联,没读到的关联依据仍填unresolved。","sourceContextDirectory按完整实际命中/邻文/父链身份去重原字;candidate.sourceContexts为其零基索引,basisContext每个原basis索引用contextRefs列全部实际位置,引用关系不合并。parentNodeId只能选对应目录项的parents,不能选scope.source或match原句节点冒充父角色;唯一原句省略,多处按实际父链消歧。","类别或候选主题只是召回标签,按完整quote独立判断,不能因主题与原句不符排除真实最低配置或其他要求,也不能无实际candidateId和已覆盖原句就声称别的候选承接。□/●等选项保持原意,未勾选的资格选项不得硬化。","同一原句可混合技术最低人数/资格与商务具名、证书、社保提交责任;技术资源约束与原表/证明材料交付须分维度解释,不把商务身份材料搬入匿名技术正文,也不因此排除技术配置要求。","保持candidateId/candidateHash,不得提供review/verified;本次只是提案,随后由另一次独立scope审查接受或质疑。"]},n=a=>({...k,...g(a.map(a=>a.payload))}),o=[],p=[];for(let a of h){if(ak(Y,n([a]),O)>c){aq("tender-applicability-proposal",Y,n([a]),O,"单个适用性候选及其完整依据超过输入预算,维持局部待核");continue}p.length&&ak(Y,n([...p,a]),O)>c&&(o.push(p),p=[]),p.push(a)}p.length&&o.push(p);let r=Math.max(1,Math.floor(Number(m.N6?.applicabilityBatches??3)));await (0,q.W)(o,r,async b=>{let c=n(b);try{let a=await au("tender-applicability-proposal",Y,c,O),d=a?.decisions??[];for(let a of b){let b=d.filter(b=>b.candidateId===a.payload.candidateId);1===b.length&&b[0].candidateHash===a.payload.candidateHash&&b[0].applicability&&(a.candidate.item.applicability=ax(a.candidate.kind,{...a.candidate.item,applicability:b[0].applicability}))}}catch{a.signal?.throwIfAborted()}}),await M();let s=e.map(f),t=l(y,s.map(a=>({candidateId:a.payload.candidateId,applicability:a.candidate.item.applicability}))),u={task:"独立复核每一项技术内容、交付文件、阶段与原表形式裁决;不是重新提取或自行补造义务",version:"tender-applicability-review-v3",sourceHash:y.sourceHash,...a.requireContentScope?{contentScopeVersion:"tender-content-scope-v1"}:{},rules:["sourceDomain与父链只说明来源位置,不决定适用性;合同、附录、商务载体内的技术责任与最低配置仍可约束本技术方案。","逐项区分technicalContent和delivery:人员/机械/工期等技术响应,不等于必须在本技术文件提交具名原表;建议不升强制;施工阶段方案不等于投标完整成果。","核原句、上下文、跨文件basisRefs/basisContext及linkedTo,保留限制条件和补疑覆盖;无需“施工组织设计”字眼才认可技术约束。关联原文未完整读取不能宣称语义已核。","sourceContextDirectory只对同一完整实际命中/邻文/父链去重;sourceContexts/contextRefs为其零基索引,全部位置及每原basis身份/关联均保留。不能把未定位源当文件开头;独审证据与范围只填目录from/through,程序按实际位置确定父链,不再提交parentNodeId。referenceIssues不能由独审修写或忽略,未解决只能unmeasured。","类别或候选主题只是召回标签,必须按完整quote逐项核验;不能因主题错配排除真实最低配置,也不能无具体candidateId和实际覆盖原句就臆称其他候选承接。□/●选项保持原意,不把未勾选的B证等资格选项硬化为项目要求。","原句混合技术最低配置/资格与商务具名、证书或社保提交时,逐维度区分技术资源响应和证明材料交付;完整quote不是全文逐字硬化入匿名正文的许可,也不能按商务材料归宿排除技术最低配置。","每项含排除决定都必须独立判断;accepted仅表示当前subject相关解释有原文支持,不能凭quote存在就接受语义。content审technicalContent,独立原表delivery未决不妨碍保留已核技术约束,不能因此伪填not-required;output另审交付强度/文件/原形式/阶段。当前subject所需维度错误或冲突disputed,依据不足或未决unmeasured。","按server给定target审查;回复身份和target由当前请求绑定,不需要抄写。technical-content只裁technicalContent、真实阶段/conditions和解释,不裁未提供的原表强度/位置/原格式;output-delivery只裁完整delivery,不因未提供的technicalContent改判。canonical完整值由server留存,current candidateHash绑定全体原值,本次接受不声称审过另一目标。","报价构成、费用计取范围、计取口径、调差边界、金额、费用保障、费用包含范围、费用综合考虑及费用台账/凭证管理属于商务或合同交付内容,不进入技术标正文:此类义务按technicalContent=not-applicable(content)或delivery.location=business-file(output)裁决。技术正文不得出现金额;费用类管理责任(台账/凭证)同样不在技术响应范围。","不得补填或改写候选维度,不得把disputed或unmeasured自行改成接受;以当前candidateId为decisions对象键,不在值中返回身份字段;evidence只从evidenceSelectionDirectory中选择,不得抄写或改写原文。","evidenceSelectionDirectory只列当前候选已绑定source/basis的冻结原字与可选ref;evidence/contentScope每项只填from(连续片段可加through,含末片段),只能同一候选同一组按顺序选择,整组ref只能单独选。程序按ref恢复原字与位置;不得抄写/改写quote、sourceFile、位置或parentNodeId。选择不等于批准。目录没有可选组时保持disputed/unmeasured,不得从邻文或全源补造。","**headingOnly(结构化标题声明,必须显式返回 true/false,不得省略)**:仅当原句本身只是章节标题/引导句、没有独立技术响应内容、具体技术约束在其后要点中时填 true;只要原句含对象、专业、措施、责任、验收或交付要求,即使以冒号结尾也必须显式填 false。它只供章要点投影识别非技术标题,不是批准,不能替代 disputed/unmeasured 判断。",...a.requireContentScope?["对每个accepted的technical-content结论返回contentScope。required-response/technical-constraint须在technical逐项列出本技术正文必须响应的全部技术要求,每项用from/through从该候选目录选择实际子句并给response;混合原文不得整段复制为技术响应。reference仅为可选参考:有可选技术响应时仍须按目录绑定;只有引导、索引等无独立响应内容时可technical为空,但excluded必须保留当前原句及不形成响应的理由,不能为通过校验编造强制技术要求。excluded逐项保存费用、报价、原表或其他文件责任的实际子句与理由。技术项与排除项不能引用重叠原句;不要删除同句里的施工措施、最低配置、工法或验收要求。not-applicable须technical为空且excluded有据;不能只在reason里写“费用不进入正文”却不给可执行范围。output-delivery不填contentScope。"]:[]]},v=a=>({...a.payload,target:(0,j.Vc)(a.candidate.item.applicability),scope:(0,j.Jw)(a.candidate.item.applicability)}),w=(a,b)=>({...u,...g(b.map(v)),evidenceSelectionDirectory:a.modelDirectory(b.map(a=>a.payload.candidateId))}),x=a=>w(t,a),z=a=>({kind:a.candidate.kind,sourceFile:a.candidate.item.sourceFile,quote:a.candidate.item.quote,..."element"in a.candidate.item?{element:a.candidate.item.element}:{}}),A=[],B=new Set,E=(a,b,c)=>{let d=`${a.candidate.candidateId}:${a.payload.candidateHash}`;b?.status!=="accepted"||b.candidateHash!==a.payload.candidateHash||b.target!==(0,j.Vc)(a.candidate.item.applicability)||c.valid||!c.issues.length||c.issues.some(a=>!a.correctable)||B.has(d)||(B.add(d),A.push({item:a,raw:b,issues:c.issues}))},G=(a,b)=>{let c=[...a.payload.sourceContexts,...a.payload.basisContext.flatMap(a=>a.contexts)],d=a=>{let{parentNodeId:b,...d}=a,e=b?c.flatMap(a=>[a.match,...a.parents]).find(a=>a.nodeId===b):void 0;return{...d,parentWasProvided:!!b,...e?{providedParent:e}:{},...b&&!e?{rejectedParent:"不在本候选实际相关命中/父链目录内,不能作为合法引用"}:{}}};return{...b,evidence:b.evidence.map(d),...b.contentScope?{contentScope:{technical:b.contentScope.technical.map(d),excluded:b.contentScope.excluded.map(d)}}:{}}},H=(b,c,d,e,f,g)=>{let h=b.candidate.item.applicability,i=(0,j.Vc)(h),k=c??{status:"unmeasured",target:i,candidateHash:(0,j.DB)(h),reason:f?`独立适用性审查未完成:${f}`:"独立适用性审查缺少唯一当前候选结论",evidence:[]},l=(0,j.RP)({applicability:h,sourceIndex:y,obligation:z(b),target:i,result:k,requireContentScope:a.requireContentScope}),m=(0,j.Oc)({applicability:h,sourceFiles:a.sourceFiles,sourceIndex:y,obligation:z(b),target:i,inputHash:d,result:k,requireContentScope:a.requireContentScope}),n=aw.get(h);return n&&aw.set(m,n),b.candidate.item.applicability=m,ao.push({candidateId:b.candidate.candidateId,candidateHash:(0,j.DB)(h),operation:e,inputHash:d,...c?{raw:structuredClone(c)}:{},...g?{selection:structuredClone(g)}:{},bindingIssues:l.issues,appliedStatus:m.review.status,...f?{error:f}:{}}),l},I=[],J=[];for(let a of s){let b=x([a]);if(ak(Z,b,N)>c){aq("tender-applicability-review",Z,b,N,"单个适用性候选及其完整依据超过审查输入预算,未派发"),H(a,void 0,(0,d.Fu)(b),u.version,"本候选与完整父链/关联原文超过单次审查输入预算,未截断、未读取,保持局部待核");continue}J.length&&ak(Z,x([...J,a]),N)>c&&(I.push(J),J=[]),J.push(a)}async function K(){let b=l(y,A.map(a=>({candidateId:a.item.payload.candidateId,applicability:a.item.candidate.item.applicability}))),e={...u,version:"tender-applicability-evidence-followup-v4",task:"仅对上次真实独审accepted但证据绑定未通过的当前子集重新独立审查;可自由接受、质疑或保持未测,不修改提案",rules:[...u.rules,"previousIndependentConclusion是原独审原始语义结论与引文,bindingFeedback是服务端确定的绑定失败;上次accepted不是应维持的答案。须重新核当前target并自由返回accepted/disputed/unmeasured,不能为通过程序而洗白解释或换用邻文。","原evidence及contentScope父引用以providedParent节点和parentWasProvided保留;该节点仅是原答复引用事实,并不获得合法父角色。应按当前锚域及实际parents选择证据,不能从providedParent推断其合法。只有本次一次补充审查,依据不足保持unmeasured。"]},h=a=>({...e,...g(a.map(a=>{let b=f(a.item.candidate);return{...v(b),previousIndependentConclusion:G(b,a.raw),bindingFeedback:a.issues}})),evidenceSelectionDirectory:b.modelDirectory(a.map(a=>a.item.payload.candidateId))}),j=[],k=[];for(let a of A.splice(0)){let b=h([a]);if(ak(Z,b,N)>c){let c=aq("tender-applicability-review",Z,b,N,"单个绑定失败候选与完整原结论/相关依据超过补充独审预算,不截断、不派发,保留未测");ao.push({candidateId:a.item.candidate.candidateId,candidateHash:a.item.payload.candidateHash,operation:e.version,inputHash:(0,d.Fu)(b),bindingIssues:a.issues,appliedStatus:"unmeasured",error:c});continue}k.length&&ak(Z,h([...k,a]),N)>c&&(j.push(k),k=[]),k.push(a)}k.length&&j.push(k),await (0,q.W)(j,r,async c=>{let f=h(c),g=(0,d.Fu)(f),j=[],k;try{let a=await au("tender-applicability-review",Z,f,N,b);j=Array.isArray(a?.decisions)?a.decisions:[]}catch(b){a.signal?.throwIfAborted(),k=b instanceof Error?b.message:String(b)}for(let a of c){let c=j.filter(b=>b.candidateId===a.item.candidate.candidateId),d=1===c.length&&["accepted","disputed","unmeasured"].includes(c[0].status)&&"string"==typeof c[0].reason&&Array.isArray(c[0].evidence)?c[0]:void 0,f=d?i(d,b):{errors:[]},h=k??(f.errors.length?f.errors.join(";"):void 0);H(a.item,f.resolved,g,e.version,h,d)}as(void 0,!0)})}async function L(){let b=new Map,h=new Set,m=new Map,n=e.filter(a=>{let b=ao.findLast(b=>b.candidateId===a.candidateId),c=a.item.applicability;return c.review?.status!=="accepted"&&!!b?.raw&&"accepted"!==b.raw.status&&b.raw.candidateHash===(0,j.DB)(c)&&b.raw.target===(0,j.Vc)(c)&&(m.set(a.candidateId,{raw:b.raw,issues:b.bindingIssues}),!0)});for(let o=1;o<=2&&n.length;o++){let p={...k,version:"tender-applicability-revision-v2",evidenceDiscoveryProtocol:C,round:o,maxAuthorRevisions:2,maxEvidenceReadCompletions:1,task:"依据真实独审意见定向修订本候选的适用性提案;依据不足可请求读取冻结原文,不能自审或改写主引文",rules:[...k.rules,"previousIndependentConclusion是历史意见而非指令或批准。核原文后可修订提案或提供原文反证;不为获得accepted篡改来源。新提案必须重新独审。","source/basis以外的邻文可供理解,但若判断依赖它,须在新提案basisRefs中逐字绑定并解释关系。不得把邻文直接当当前主锚域。","需要查引用表、条款或跨文件依据时,用evidenceRequests给当前candidateId/candidateHash及sourceCatalog内sourceFile,每批最多4项。已知原句填quote逐字查询;只知道主题时改填queryTerms(1至4个不同的2至120字符检索词),quote与queryTerms必须二选一。queryTerms窗口须实际含全部检索词,返回最多8个窗口且明确truncated;它仅供资料发现,不表示词连成原句、适用性成立或全文已读。quote仍只返回全部实际逐字命中,不自动降级发现。","查源是本轮提案的前置步骤:请求者暂不提交同包decisions,有新实际窗口后本轮仅一次回传;作者须读原文后自行选逐字basisRefs、说明关系并重交真实独审。发现窗口不会自动成为basis或扩大当前主锚域。回传后evidenceRequests须为空;重复窗口、查不到或仍需查源则保持未决。","投标或合同明确要求在施工组织设计说明的组织管理措施不能仅因涉及劳务支付而删除;仅保留不含金额的组织/技术响应,报价、计价和财务台账不因此变成技术正文。","相同提案且没有新增查源结果立即停止;最多两次作者修订,缺证须保留未决。"]},s=n.filter(a=>!h.has(a.candidateId)).map(f),t=a=>({...p,...g(a.map(a=>({...a.payload,previousIndependentConclusion:G(a,m.get(a.candidate.candidateId).raw),bindingFeedback:m.get(a.candidate.candidateId).issues,evidenceReads:b.get(a.candidate.candidateId)??[]})))}),v=[],x=new Set,z=s;for(let e=0;e<=1&&z.length;e++){let g=a=>({...t(a),evidenceReadCompletion:1===e}),i=[],k=[];for(let a of z){if(ak(Y,g([a]),P)>c){h.add(a.candidate.candidateId),ap.push({candidateId:a.candidate.candidateId,round:o,readTurn:e,semanticRevisionSubmitted:!1,status:"over-budget-not-dispatched"});continue}k.length&&ak(Y,g([...k,a]),P)>c&&(i.push(k),k=[]),k.push(a)}k.length&&i.push(k);let l=[];await (0,q.W)(i,r,async c=>{let i,k;try{i=await au("tender-applicability-proposal",Y,g(c),P)}catch(b){a.signal?.throwIfAborted(),k=b instanceof Error?b.message:String(b)}for(let a of c){let c=a.candidate.candidateId,g=a.payload.candidateHash;if(!i){h.add(c),ap.push({candidateId:c,round:o,readTurn:e,beforeHash:g,afterHash:g,semanticRevisionSubmitted:!1,status:k?"author-call-failed-stopped":"author-no-reply-stopped",...k?{error:k}:{},evidenceReads:structuredClone(b.get(c)??[])});continue}let m=(i?.evidenceRequests??[]).slice(0,4).filter(a=>a.candidateId===c&&a.candidateHash===g),n=(i?.decisions??[]).filter(a=>a.candidateId===c&&a.candidateHash===g),p=b.get(c)??[];if(m.length){let f=!1;if(0===e)for(let a of m){let b=(0,d.Fu)([y.sourceHash,a.sourceFile,a.queryTerms?["discovery",a.queryTerms.map(D).sort()]:["exact",a.quote]]);if(p.some(a=>a.requestKey===b))continue;let c=a.queryTerms?function(a,b,c){let d={version:C,sourceHash:a.sourceHash,queryTerms:[...c],status:"not-found",contexts:[],matchingWindows:0,truncated:!1,windowLimit:8,radius:1200,qualification:"discovery-only-not-bound-evidence"};if(!F(c)||!a.files.some(a=>a.filePath===b))return{...d,status:"invalid-request"};let e=c.map(c=>({term:c,contexts:(0,j.r8)(a,b,c,1200)}));if(e.some(a=>!a.contexts.length))return d;let f=[...e].sort((a,b)=>a.contexts.length-b.contexts.length||a.term.localeCompare(b.term))[0],g=new Set;for(let a of f.contexts){let c=e.map(b=>({term:b.term,context:b.contexts.find(b=>b.match.start>=a.start&&b.match.end<=a.end)}));if(c.some(a=>!a.context)||g.has(`${a.start}:${a.end}`)||(g.add(`${a.start}:${a.end}`),d.matchingWindows++,8===d.contexts.length))continue;let{start:f,end:h,quote:i,sourceTextHash:j}=a;d.contexts.push({sourceFile:b,sourceTextHash:j,start:f,end:h,quote:i,termMatches:c.map(a=>({term:a.term,match:a.context.match,parents:a.context.parents}))})}return d.truncated=d.matchingWindows>d.contexts.length,d.status=d.contexts.length?"discovery-windows-only":"not-found",d}(y,a.sourceFile,a.queryTerms):void 0,e=c?.contexts??(0,j.r8)(y,a.sourceFile,a.quote,1200),g=e.some(a=>!p.some(b=>b.contexts.some(b=>b.sourceFile===a.sourceFile&&b.sourceTextHash===a.sourceTextHash&&b.start===a.start&&b.end===a.end&&b.quote===a.quote)));p.push({...c??{query:a.quote,status:e.length?"matched-windows-only":"not-found",contexts:e},sourceFile:a.sourceFile,requestKey:b}),f||=g}b.set(c,p),f?l.push(a):h.add(c),ap.push({candidateId:c,round:o,readTurn:e,beforeHash:g,afterHash:g,semanticRevisionSubmitted:!1,status:f?"evidence-read-awaiting-author":1===e?"evidence-read-limit-stopped":"evidence-read-no-progress-stopped",evidenceRequests:m,deferredDecisions:n,evidenceReads:structuredClone(p)});continue}let q=1===n.length&&n[0].applicability?ax(a.candidate.kind,{...a.candidate.item,applicability:n[0].applicability}):void 0,r=q?(0,j.DB)(q):g;q&&r!==g&&(a.candidate.item.applicability=q,q.issues.length?x.add(c):v.push(f(a.candidate))),r===g&&h.add(c),ap.push({candidateId:c,round:o,readTurn:e,beforeHash:g,afterHash:r,semanticRevisionSubmitted:r!==g,status:r!==g?"revised-awaiting-independent-review":"no-progress-stopped",...q?.issues.length?{validationIssues:q.issues}:{},evidenceReads:structuredClone(p)})}}),as(void 0,!0),z=s.filter(a=>l.includes(a))}let A=[],B=[],I=l(y,v.map(a=>({candidateId:a.payload.candidateId,applicability:a.candidate.item.applicability}))),J=a=>({...w(I,a),version:"tender-applicability-revision-review-v2",rules:[...u.rules,"本轮是作者按历史反馈提交的新提案,只依据当前候选与实际原文独审,不沿用旧接受或质疑。明确要求施组说明的非金额组织管理措施须按原文判断,不按费用类标签整体删除。"]});for(let a of v){if(ak(Z,J([a]),N)>c){H(a,void 0,(0,d.Fu)(J([a])),"tender-applicability-revision-review-v2","完整修订依据超过审查预算,未派发"),h.add(a.candidate.candidateId);continue}B.length&&ak(Z,J([...B,a]),N)>c&&(A.push(B),B=[]),B.push(a)}for(let b of(B.length&&A.push(B),await (0,q.W)(A,r,async b=>{let c,e=J(b);try{c=await au("tender-applicability-review",Z,e,N,I)}catch{a.signal?.throwIfAborted()}for(let a of b){let b=(c?.decisions??[]).filter(b=>b.candidateId===a.candidate.candidateId),f=1===b.length&&["accepted","disputed","unmeasured"].includes(b[0].status)&&"string"==typeof b[0].reason&&Array.isArray(b[0].evidence)?b[0]:void 0,g=f?i(f,I):{errors:[]},h=H(a,g.resolved,(0,d.Fu)(e),"tender-applicability-revision-review-v2",g.errors.length?g.errors.join(";"):void 0,f);E(a,g.resolved,h)}}),as(void 0,!0),await K(),v)){let a=b.candidate.candidateId,c=b.candidate.item.applicability,d=ao.findLast(b=>b.candidateId===a);c.review?.status!=="accepted"&&d?.raw&&"accepted"!==d.raw.status&&d.raw.candidateHash===b.payload.candidateHash&&d.raw.target===(0,j.Vc)(c)?(m.set(a,{raw:d.raw,issues:d.bindingIssues}),x.add(a)):x.delete(a)}n=e.filter(a=>x.has(a.candidateId)&&!h.has(a.candidateId)&&a.item.applicability?.review?.status!=="accepted")}}async function M(){let b=e.map(f).filter(a=>a.payload.referenceIssues?.length),d={version:"tender-applicability-reference-repair-v1",sourceHash:y.sourceHash,task:"仅纠正当前候选确定的引用绑定错误,不重判适用性,不独审,不增删依据",rules:["仅返回给定candidateId/candidateHash的source父引用及按原index定位的basisRefs补丁;technicalContent/delivery/reason及basis的relation/explanation已冻结,不能修改。","source:{}表示省略父引用;唯一原句应省略。sourceContexts/contextRefs是sourceContextDirectory零基索引;目录只去重同一实际命中/邻文/父链,不合并basis身份或关联。多处原句仅按对应目录项parents消歧,match/原句节点不能冒充父角色。所有引用使用当前目录ref。","逐项按referenceIssues纠正非法parent、未定位引文、重复refId或悬空linkedTo。basisRefs索引来自实际原提案,不能增删或合并;未列出的索引保持原值。","引文只可保持原句或修到本次实际相关邻文内的逐字原句;不能凭目录补造未读新依据。linkedTo只能填source或本候选真实refId,不能填表名、主题或义务名。","sourceContexts和basisContext保留全部实际匹配位置,不按第一处猜测;仍无唯一依据时不要编造,服务端保留pending。每候选只有本次有界补丁,随后仍由独立审查判断业务解释。"]},h=a=>({...d,...g(a.map(a=>{let b=ag(a.payload.sourceContexts),c=a.payload.basisContext.flatMap(a=>{let b=ag(a.contexts);return b?[{index:a.index,...b}]:[]});return{candidateId:a.payload.candidateId,candidateHash:a.payload.candidateHash,source:{sourceFile:a.candidate.item.sourceFile,quote:a.candidate.item.quote},references:a.payload.requestedReferences,referenceIssues:a.payload.referenceIssues,sourceContexts:a.payload.sourceContexts,basisContext:a.payload.basisContext,...b||c.length?{parentRoleEvidence:{...b?{source:b}:{},basisRefs:c}}:{}}}))}),i=[],k=[],l=a=>({candidateId:a.payload.candidateId,beforeHash:a.payload.candidateHash,beforeRequested:structuredClone(aw.get(a.candidate.item.applicability)),issuesBefore:a.payload.referenceIssues.map(a=>a.message)});for(let a of b){if(ak(Y,h([a]),Q)>c){let b=aq("tender-applicability-proposal",Y,h([a]),Q,"单候选全部引用错误与实际邻文超过局部纠正预算,未截断/未派发,保留待核");an.push({...l(a),status:"over-budget",error:b});continue}k.length&&ak(Y,h([...k,a]),Q)>c&&(i.push(k),k=[]),k.push(a)}for(let b of(k.length&&i.push(k),i)){let c,d=[];try{let a=await au("tender-applicability-proposal",Y,h(b),Q);d=a?.repairs??[]}catch(b){a.signal?.throwIfAborted(),c=b instanceof Error?b.message:String(b)}for(let a of b){let b=l(a),e=d.filter(a=>a.candidateId===b.candidateId&&a.candidateHash===b.beforeHash);if(1!==e.length){an.push({...b,status:c?"failed":"not-returned",...c?{error:c}:{}});continue}try{let{source:c,basisRefs:d}=e[0],f=(0,j.D)({index:y,sourceFile:a.candidate.item.sourceFile,quote:a.candidate.item.quote,requested:b.beforeRequested,patch:{source:c,basisRefs:d}}),g=ax(a.candidate.kind,{...a.candidate.item,applicability:f});a.candidate.item.applicability=g;let h=(0,j.dY)({index:y,sourceFile:a.candidate.item.sourceFile,quote:a.candidate.item.quote,requested:f}).map(a=>a.message);an.push({...b,afterHash:(0,j.DB)(g),afterRequested:f,issuesAfter:h,status:h.length<b.issuesBefore.length?"repaired":"no-progress"})}catch(a){an.push({...b,status:"failed",error:a instanceof Error?a.message:String(a)})}}}}J.length&&I.push(J),await (0,q.W)(I,r,async b=>{let c=x(b),e=(0,d.Fu)(c),f=[],g,h=e;try{let a=await au("tender-applicability-review",Z,c,N,t);f=Array.isArray(a?.decisions)?a.decisions:[]}catch(b){if(a.signal?.throwIfAborted(),(g=b instanceof Error?b.message:String(b))&&/TENDER_REVIEW_WIRE_FOREIGN_REFERENCE|TENDER_EVIDENCE_SELECTION_/u.test(g)){let b=Array.isArray(c.rules)?c.rules:[],e={...c,rules:[...b,`上次回复因引用协议被拒收:${g}。只能使用当前候选 evidenceSelectionDirectory 中的合法短 ref 重出完整 decisions;不得复用其他候选的 ref,不得改写 quote/sourceFile/位置。`]};try{let a=await au("tender-applicability-review",Z,e,N,t),b=Array.isArray(a?.decisions)?a.decisions:[];b.length&&(f=b,g=void 0,h=(0,d.Fu)(e))}catch(b){a.signal?.throwIfAborted(),g=`${g};引用纠正重审仍失败:${b instanceof Error?b.message:String(b)}`}}}for(let a of b){let b=f.filter(b=>b.candidateId===a.payload.candidateId),c=1===b.length&&["accepted","disputed","unmeasured"].includes(b[0].status)&&"string"==typeof b[0].reason&&Array.isArray(b[0].evidence)?b[0]:void 0,d=c?i(c,t):{errors:[]},e=d.resolved,j=g??(d.errors.length?d.errors.join(";"):void 0),k=H(a,e,h,u.version,j,c);E(a,e,k)}}),as(void 0,!0),await K(),a.requireContentScope&&await L()}}},62369:(a,b,c)=>{c.d(b,{W:()=>d});async function d(a,b,c){let d;if(!Number.isSafeInteger(b)||b<1)throw Error("CONSTRUCTION_PARALLEL_LIMIT_INVALID");let e=Array(a.length),f=0,g=!1,h=Array.from({length:Math.min(b,a.length)},async()=>{for(;;){if(g)return;let b=f;if(f+=1,b>=a.length)return;try{e[b]=await c(a[b],b)}catch(a){g=!0,d=a;return}}});if(await Promise.all(h),g)throw d;return e}},68011:(a,b,c)=>{c.d(b,{G:()=>k});var d=c(73024),e=c.n(d),f=c(76760),g=c.n(f),h=c(77598),i=c(34933);let j=a=>(0,h.createHash)("sha256").update(JSON.stringify(a)).digest("hex");function k(a,b,c,d){let f=(0,i.x)(b),k=a=>{if(!/^[a-f0-9]{64}$/u.test(a))throw Error("当前模型响应缓存输入身份无效");return j({version:c,inputKey:a,model:f})};return{load(b){let d=k(b),f=g().join(a,`${d}.json`);if(!e().existsSync(f))return;let h=JSON.parse(e().readFileSync(f,"utf8"));if(h.version!==c||h.cacheKey!==d||j(h.response)!==h.responseSha256)throw Error("当前模型响应缓存身份或内容校验失败");return{response:h.response,receipt:{cacheKey:d,responseSha256:h.responseSha256,...h.originRunId?{originRunId:h.originRunId}:{}}}},save(b,f){let i=k(b),l=g().join(a,`${i}.json`);e().mkdirSync(a,{recursive:!0});let m=`${l}.${process.pid}.${(0,h.randomUUID)()}.tmp`;try{e().writeFileSync(m,JSON.stringify({version:c,cacheKey:i,responseSha256:j(f),response:f,...d?{originRunId:d}:{}})),e().renameSync(m,l)}finally{e().rmSync(m,{force:!0})}}}}}};
1
+ "use strict";exports.id=6355,exports.ids=[6355],exports.modules={34933:(a,b,c)=>{c.d(b,{x:()=>f});var d=c(77598),e=c(49584);function f(a){let b=(0,e.modelConfigurationForRun)(a),c=b.models.active,f=c&&b.models.list.find(a=>a.name===c.name&&a.provider===c.provider),g=f?b.providers[f.provider]:void 0;return(0,d.createHash)("sha256").update(JSON.stringify({version:"single-selected-model-v1",active:c,selected:f?{name:f.name,provider:f.provider,thinking:f.thinking??"follow-task"}:null,endpointHash:g?(0,d.createHash)("sha256").update(JSON.stringify([g.baseUrl,g.protocol,g.directEndpoint])).digest("hex"):null})).digest("hex")}},46355:(a,b,c)=>{c.r(b),c.d(b,{APPLICABILITY_REVIEW_SCHEMA:()=>N,TENDER_OBLIGATION_EXTRACTION_VERSION:()=>K,TENDER_OBLIGATION_SCHEMA:()=>U,TENDER_ORIGINAL_FORM_PROPOSAL_SCHEMA:()=>S,extractTenderObligationsWithAgent:()=>ah,materiallyUncoveredNamedOutputs:()=>ae,reconcileNamedTenderOutputCoverage:()=>af,tenderReferenceParentRoleFacts:()=>ag});var d=c(745),e=c(76760),f=c.n(e),g=c(77598);function h(a,b,c,d,e,f=[]){if(!Array.isArray(a))return{resolved:[],errors:[`${e} 必须是选择数组`]};let g=[],i=[];for(let[h,j]of a.entries()){if(j&&"object"==typeof j&&!Array.isArray(j)&&Object.keys(j).some(a=>!["from","through",...f].includes(a))){i.push(`${e}[${h}]:TENDER_EVIDENCE_SELECTION_SHAPE;只能填from/through${f.length?`与${f.join("/")}`:""}`);continue}let a=j&&"object"==typeof j&&!Array.isArray(j)?{from:j.from,...Object.hasOwn(j,"through")?{through:j.through}:{}}:j;try{let e=d.resolve(b,c,a);g.push({sourceFile:e.sourceFile,quote:e.quote,start:e.start,end:e.end})}catch(a){i.push(`${e}[${h}]:${a instanceof Error?a.message:String(a)};只能使用该候选目录中的from/through,不得改写quote、sourceFile或位置`)}}return{resolved:g,errors:i}}function i(a,b){let c;if(!a||"object"!=typeof a||Array.isArray(a))return{errors:["审查结论必须是对象"]};if("string"!=typeof a.candidateId||"string"!=typeof a.candidateHash||"string"!=typeof a.reason||!["accepted","disputed","unmeasured"].includes(String(a.status))||"technical-content"!==a.target&&"output-delivery"!==a.target)return{errors:["审查结论缺少当前candidateId/candidateHash/target/status/reason"]};let d=h(a.evidence,a.candidateId,a.candidateHash,b,"evidence");if(d.errors.length)return{errors:d.errors};if(void 0!==a.contentScope){let d=a.contentScope;if(!d||"object"!=typeof d||Array.isArray(d))return{errors:["contentScope 必须是对象"]};let e=h(d.technical,a.candidateId,a.candidateHash,b,"contentScope.technical",["response"]),f=h(d.excluded,a.candidateId,a.candidateHash,b,"contentScope.excluded",["reason"]);if(e.errors.length||f.errors.length)return{errors:[...e.errors,...f.errors]};let g=Array.isArray(d.technical)?d.technical:[],i=Array.isArray(d.excluded)?d.excluded:[];c={technical:e.resolved.map((a,b)=>({...a,response:"string"==typeof g[b]?.response?g[b].response:""})),excluded:f.resolved.map((a,b)=>({...a,reason:"string"==typeof i[b]?.reason?i[b].reason:""}))}}return{resolved:{candidateId:a.candidateId,candidateHash:a.candidateHash,target:a.target,status:a.status,reason:a.reason,...!0===a.headingOnly?{headingOnly:!0}:{},evidence:d.resolved,...c?{contentScope:c}:{}},errors:[]}}var j=c(69977);let k="tender-evidence-selection-v1";function l(a,b){let c=new Map(a.files.map(a=>[a.filePath,a.text]));if(c.size!==a.files.length||a.files.some(a=>(0,d.Fu)(a.text)!==a.sourceTextHash)||(0,d.Fu)(a.files.map(a=>[a.filePath,a.sourceTextHash]).sort((a,b)=>a[0].localeCompare(b[0])))!==a.sourceHash)throw Error("TENDER_EVIDENCE_SELECTION_SOURCE_IDENTITY");if(new Set(b.map(a=>a.candidateId)).size!==b.length||b.some(a=>!a.candidateId.trim()))throw Error("TENDER_EVIDENCE_SELECTION_CANDIDATE_IDENTITY");let e=b.map(({candidateId:b,applicability:c})=>{let{bindingHash:e,...f}=c;if(c.version!==j.q$||e!==(0,d.Fu)(f))throw Error("TENDER_EVIDENCE_SELECTION_CANDIDATE_BINDING");let{review:g,bindingHash:h,...i}=c,k={...i,status:"unresolved",bindingHash:""};k.bindingHash=(0,d.Fu)((({bindingHash:a,...b})=>b)(k));let l=[...(0,j.N3)(k,a.files,void 0,a).issues,...c.issues],m=[];if(!l.length)for(let a of[{anchor:c.source,origin:"source"},...c.basisRefs.map(a=>({anchor:a,origin:`basis:${a.refId}`}))]){let b=m.find(b=>b.anchor.sourceFile===a.anchor.sourceFile&&b.anchor.start===a.anchor.start&&b.anchor.end===a.anchor.end);if(b)b.origins.push(a.origin);else{let{nodeId:b,sourceFile:c,start:d,end:e,quote:f}=a.anchor;m.push({anchor:{nodeId:b,sourceFile:c,start:d,end:e,quote:f},origins:[a.origin]})}}return{candidateId:b,candidateHash:(0,j.DB)(c),target:(0,j.Vc)(c),issues:l,anchors:m}}),f=(0,d.Fu)([k,a.sourceHash,e]),g=new Map,h=a=>{let b=`e${f.slice(0,24)}:${g.size}`;return g.set(b,{...a}),b},i=e.map(a=>({candidateId:a.candidateId,candidateHash:a.candidateHash,target:a.target,issues:[...a.issues],groups:a.anchors.map(({anchor:b,origins:c},d)=>{let e={candidateId:a.candidateId,candidateHash:a.candidateHash,sourceFile:b.sourceFile,group:d};return{ref:h({...e,start:b.start,end:b.end,whole:!0,ordinal:-1}),sourceFile:b.sourceFile,start:b.start,end:b.end,quote:b.quote,origins:[...c],parts:(function(a){let b=[],c=0,d=d=>{let e=a.quote.slice(c,d),f=e.trim();if(f){let d=c+e.length-e.trimStart().length;b.push({start:a.start+d,end:a.start+d+f.length,quote:f})}c=d};for(let b of a.quote.matchAll(/[,,;;。!?!?]/gu))d(b.index+b[0].length);return d(a.quote.length),b})(b).map((a,b)=>({...a,ref:h({...e,start:a.start,end:a.end,whole:!1,ordinal:b})}))}})})),l=new Map(e.map(a=>[a.candidateId,a.candidateHash])),m={version:k,sourceHash:a.sourceHash,bindingHash:f,instructions:"目录只列当前候选已绑定source/basis的冻结原字。evidence/contentScope每项只填from(连续片段可加through,含末片段),只能同一候选同一组按顺序选择,整组ref只能单独选择。程序按ref恢复原字与位置;不得抄写或改写quote、sourceFile、位置或parentNodeId。选择不等于批准,仍须独立业务审查;没有可选目录时保持未决。",candidates:i};return{directory:m,modelDirectory:a=>{let b=a?new Set(a):void 0;if(b){for(let a of b)if(!i.some(b=>b.candidateId===a))throw Error("TENDER_EVIDENCE_SELECTION_UNKNOWN_CANDIDATE")}return{version:m.version,sourceHash:m.sourceHash,bindingHash:m.bindingHash,instructions:m.instructions,candidates:i.filter(a=>!b||b.has(a.candidateId)).map(a=>({candidateId:a.candidateId,groups:a.groups.map(a=>({ref:a.ref,origins:[...a.origins],quote:a.quote,parts:a.parts.map(a=>({ref:a.ref,quote:a.quote}))}))}))}},resolve(a,b,e){var f;if(!l.has(a)||l.get(a)!==b)throw Error("TENDER_EVIDENCE_SELECTION_STALE_CANDIDATE");if(!e||"object"!=typeof e||Array.isArray(e)||Object.keys(e).some(a=>"from"!==a&&"through"!==a))throw Error("TENDER_EVIDENCE_SELECTION_SHAPE");let{from:h,through:i}=e;if("string"!=typeof h||void 0!==i&&"string"!=typeof i)throw Error("TENDER_EVIDENCE_SELECTION_SHAPE");let j=g.get(h),k=g.get(i??h);if(!j||!k)throw Error("TENDER_EVIDENCE_SELECTION_UNKNOWN_REFERENCE");let m=function(a,b,c,d,e,f){if(![e,f].every(c=>c.candidateId===a&&c.candidateHash===b))return`当前候选=${a};from=${c} 属于候选=${e.candidateId};${void 0===d?"未提供through":`through=${d} 属于候选=${f.candidateId}`};即使原字相同也不能跨候选借用ref。程序不会自动换ref或补basis;须按当前候选已绑定目录重新审查,无依据则保留真实未决,不得删掉范围后继续accepted`}(a,b,h,i,j,k);if(m)throw Error(`TENDER_EVIDENCE_SELECTION_FOREIGN_CANDIDATE:${m}`);let n=(f=void 0!==i,j.group!==k.group||j.sourceFile!==k.sourceFile?"两个端点属于不同证据组,不能跨组或跨文件组成范围":f&&(j.whole||k.whole)?`from为${j.whole?"整组":"片段"}引用,through为${k.whole?"整组":"片段"}引用;整组只能单独填from并省略through(即使两者相同也不合法);片段范围必须由同一组parts中的首末ref组成。须自行重新选择,程序不会删去through或替换端点`:j.ordinal>k.ordinal||j.start>k.start?"片段端点倒序;from必须先于或等于through,程序不会自动调序":void 0);if(n)throw Error(`TENDER_EVIDENCE_SELECTION_INVALID_RANGE:from=${h},through=${i??"未提供"};${n}`);let o=c.get(j.sourceFile).slice(j.start,k.end);return{sourceFile:j.sourceFile,start:j.start,end:k.end,quote:o,nodeId:`tender-source:${(0,d.Fu)([j.sourceFile,j.start,o]).slice(0,24)}`}}}}var m=c(68515),n=c(98943),o=c(13380),p=c(36980),q=c(62369);let r=JSON.parse('{"version":"construction-requirement-taxonomy-v1","description":"通用招标要求语义分类(领域基线,不是项目条款位置):只用于在任意招标/补疑/答疑原文中发现要求类条款;条款号、页码、章节位置一律由文档索引动态确定。","requirementHints":["应","须","必须","不得","严禁","按照","满足","编制","提交","采用","执行","设置","配备","验收","评分","评审","要求","规定","标准","清单","专项施工方案","表格","图件","图表","附表","附图"],"strongRequirementHints":["必须","不得","严禁","要求","规定","标准","清单","专项施工方案","评分","评审","验收","提交","编制","采用","设置","配备","表格","图件","图表","附表","附图"],"categories":[{"id":"dangerous-works","label":"危险性较大的分部分项工程","priority":10,"terms":["危险性较大","危大工程","危大","超过一定规模"],"addAsContent":true},{"id":"major-construction-method","label":"主要施工方法/施工方案","priority":9,"terms":["主要施工方法","主要施工方案","施工方法","施工方案","施工工艺","施工顺序","施工部署","流水施工","特殊工艺","专项施工方案","工法"],"addAsContent":true},{"id":"evaluation","label":"评标/评分/评审因素","priority":8,"terms":["评标","评分","评审因素","评分标准","评审标准","技术文件评分"],"addAsContent":false},{"id":"technical-requirement","label":"技术标准/技术规格/施工要求","priority":7,"terms":["技术标准","技术规格","技术要求","施工要求","技术条件"],"addAsContent":true},{"id":"quality","label":"质量/验收/创优","priority":6,"terms":["质量目标","质量要求","质量验收","质量标准","创优","检验批","标准化工地"],"addAsContent":true},{"id":"safety-environment","label":"安全/文明/环保/绿色施工","priority":6,"terms":["安全生产","安全管理","安全文明","文明施工","环保","绿色施工","职业健康","扬尘","噪声"],"addAsContent":true},{"id":"schedule","label":"工期/进度/节点","priority":5,"terms":["工期要求","工期目标","进度计划","节点目标","开竣工","赶工","里程碑"],"addAsContent":true},{"id":"resources","label":"人材机/分包/甲供乙供","priority":5,"terms":["劳动力计划","材料供应","机械设备","专业分包","甲供","乙供","暂估"],"addAsContent":true},{"id":"bid-format","label":"投标文件格式/技术文件编制","priority":6,"terms":["投标文件格式","技术文件","施工组织设计","图表","页数","暗标","编制要求"],"addAsContent":false},{"id":"contract","label":"合同条款/变更/索赔/保修/移交","priority":4,"terms":["合同条款","专用合同条款","通用合同条款","变更","索赔","保修","移交"],"addAsContent":false},{"id":"site-condition","label":"现场条件/地勘/水文/周边/季节","priority":4,"terms":["现场条件","地勘","地质","水文","周边环境","交通组织","临水临电","雨季","冬季施工"],"addAsContent":true},{"id":"technology","label":"新技术/新工艺/知识产权/深化设计","priority":5,"terms":["新技术","新工艺","知识产权","深化设计","BIM","智慧工地","信息化"],"addAsContent":true},{"id":"handover","label":"验收/移交/竣工资料","priority":4,"terms":["竣工验收","移交","竣工资料","档案","保修"],"addAsContent":false}]}'),s=a=>a.replace(/\s+/gu,"").normalize("NFKC").replace(/[“”‘’"'`]/gu,""),t=a=>(0,g.createHash)("sha256").update(a).digest("hex").slice(0,24),u=/PDF\s*第\s*(\d+)\s*页/gu,v=/^\s*(?:第[一二三四五六七八九十百零〇\d]+[章节条款]|[一二三四五六七八九十]+、|([一二三四五六七八九十\d]+)|\d+(?:[..]\d+)*[、..]?\s+)/u,w=/^\s*\|/u;function x(a){let b=a.search(/[::]/u);if(b<0)return[];let c=a.slice(b+1).trim().replace(/[。;;]\s*$/u,"").replace(/等\s*$/u,"");if(/[。\n\r]/u.test(c))return[];let d=c.split(/[,,、;;]/u).map(a=>a.trim().replace(/^[((]?[一二三四五六七八九十\d]+[))、..]\s*/u,"")).filter(a=>a.length>=2&&a.length<=32);return d.length<2||d.length>12?[]:[...new Set(d)]}let y=/[。!?!?]/u;function z(a,b){if(!b?.length||/[\r\n]/u.test(a)||y.test(a.trim().replace(/[。!?!?]+$/u,"")))return[];let c=s(a),d=[];for(let a of b){let b=a.trim();!(b.length<2||b.length>32||y.test(b)||/[\r\n]/u.test(b))&&c.includes(s(b))&&(d.includes(b)||d.push(b))}return d.length>1?d:[]}function A(a,b){let c=s(a);return!!r.strongRequirementHints.some(a=>c.includes(s(a)))||b.some(a=>a.priority>=7)&&r.requirementHints.some(a=>c.includes(s(a)))}let B=JSON.parse('{"version":"construction-output-obligation-terms-v2","rules":[{"context":"投标文件格式|项目管理机构|人员组成|附件|合同条款","terms":["组织机构图","人员组成表","机械设备表"]},{"context":"施工组织设计|技术文件|进度计划|施工部署|总平面|平面布置","terms":["横道图","网络图","施工总平面布置图","平面布置图","劳动力计划表","材料进场计划"]}],"deliveryVerbs":["应附","提交","提供","包括","编制","报送","格式","装订","加盖","填写","附"],"skipContextPatterns":["目录"]}'),C="tender-source-discovery-v1",D=a=>a.replace(/\s+/gu,"").normalize("NFKC").replace(/[“”‘’"'`]/gu,"");function E(a,b,c){if(!a||"object"!=typeof a||!Array.isArray(a.evidenceRequests))return["evidenceRequests 必须是数组"];let d=a.evidenceRequests,e=d.length>4?["evidenceRequests 每批最多4项"]:[];return d.forEach((a,d)=>{let f=`evidenceRequests[${d}]`;if(!a||"object"!=typeof a)return void e.push(`${f} 必须是对象`);b.some(b=>b.candidateId===a.candidateId&&b.candidateHash===a.candidateHash)||e.push(`${f} candidateId/candidateHash 不属于当前批次`),c.files.some(b=>b.filePath===a.sourceFile)||e.push(`${f} sourceFile 不属于冻结目录`),Object.hasOwn(a,"quote")===Object.hasOwn(a,"queryTerms")?e.push(`${f} 必须且只能选择逐字quote或发现queryTerms`):Object.hasOwn(a,"quote")?("string"!=typeof a.quote||D(a.quote).length<2)&&e.push(`${f} quote 必须包含至少2个有效字符`):F(a.queryTerms)||e.push(`${f} queryTerms 须为1至4个不同检索词,每词2至120字符`)}),e}function F(a){return Array.isArray(a)&&a.length>=1&&a.length<=4&&a.every(a=>"string"==typeof a&&a.length<=120&&D(a).length>=2)&&new Set(a.map(D)).size===a.length}var G=c(68011),H=c(34933),I=c(49584),J=c(19045);let K="construction-tender-obligation-extraction-v1",L=(a,b)=>({type:"object",additionalProperties:!1,required:a,properties:b}),M=L(["technicalContent","delivery","reason","basisRefs"],{technicalContent:{type:"string",enum:["required-response","technical-constraint","reference","not-applicable","unresolved"]},delivery:L(["requirement","location","originalForm","stage","conditions"],{requirement:{type:"string",enum:["required","recommended","not-required","unresolved"]},location:{type:"string",enum:["technical-body","technical-appendix","business-file","contract-performance","construction-submission","unresolved"]},originalForm:{type:"string",enum:["required","adaptable","not-required","unresolved"]},stage:{type:"string",enum:["bid","contract","construction","multiple","unresolved"]},stages:{type:"array",items:{type:"string",enum:["bid","contract","construction"]}},conditions:{type:"array",items:{type:"string"}}}),reason:{type:"string",minLength:1},parentNodeId:{type:"string"},basisQuote:{type:"string"},basisRefs:{type:"array",items:L(["refId","sourceFile","quote","relation","explanation","linkedTo"],{refId:{type:"string",minLength:1},sourceFile:{type:"string",minLength:1},quote:{type:"string",minLength:1},parentNodeId:{type:"string"},relation:{type:"string",enum:["includes","constrains","overrides","shared-delivery","scope","refers-to"]},explanation:{type:"string",minLength:1},linkedTo:{type:"array",items:{type:"string"}}})}}),N=L(["decisions"],{decisions:{type:"array",items:L(["candidateId","candidateHash","target","status","reason","headingOnly","evidence"],{candidateId:{type:"string",minLength:1},candidateHash:{type:"string",minLength:1},target:{type:"string",enum:["technical-content","output-delivery"]},status:{type:"string",enum:["accepted","disputed","unmeasured"]},reason:{type:"string",minLength:1},headingOnly:{type:"boolean",description:"必须显式返回 true/false,不得省略。仅当原句本身只是章节标题/引导句、没有独立技术响应内容时为 true;冒号结尾但有对象/措施/责任/验收要求时必须为 false。"},evidence:{type:"array",items:L(["from"],{from:{type:"string",minLength:1},through:{type:"string",minLength:1}})},contentScope:L(["technical","excluded"],{technical:{type:"array",items:L(["from","response"],{from:{type:"string",minLength:1},through:{type:"string",minLength:1},response:{type:"string",minLength:1}})},excluded:{type:"array",items:L(["from","reason"],{from:{type:"string",minLength:1},through:{type:"string",minLength:1},reason:{type:"string",minLength:1}})}})})}}),O=L(["decisions"],{decisions:{type:"array",items:L(["candidateId","candidateHash","applicability"],{candidateId:{type:"string",minLength:1},candidateHash:{type:"string",minLength:1},applicability:M})}}),P=L(["decisions","evidenceRequests"],{decisions:O.properties.decisions,evidenceRequests:{type:"array",maxItems:4,items:L(["candidateId","candidateHash","sourceFile"],{candidateId:{type:"string",minLength:1},candidateHash:{type:"string",minLength:1},sourceFile:{type:"string",minLength:1},quote:{type:"string",minLength:2,description:"与queryTerms二选一:已知原文的逐字查询;不会改为模糊查找"},queryTerms:{type:"array",minItems:1,maxItems:4,description:"与quote二选一:资料发现检索词,同一窗口须含全部词;结果不是已绑定证据",items:{type:"string",minLength:2,maxLength:120}}})}}),Q=L(["repairs"],{repairs:{type:"array",items:L(["candidateId","candidateHash","source","basisRefs"],{candidateId:{type:"string",minLength:1},candidateHash:{type:"string",minLength:1},source:L([],{parentNodeId:{type:"string"}}),basisRefs:{type:"array",items:L(["index","refId","sourceFile","quote","linkedTo"],{index:{type:"integer",minimum:0},refId:{type:"string",minLength:1},sourceFile:{type:"string",minLength:1},quote:{type:"string",minLength:1},parentNodeId:{type:"string"},linkedTo:{type:"array",items:{type:"string"}}})}})}}),R={type:"array",items:L(["sourceFile","quote"],{sourceFile:{type:"string",minLength:1},quote:{type:"string",minLength:1},parentNodeId:{type:"string"}})},S=L(["sourceRefs","fields","rowGroups","instructions","formatRules"],{sourceRefs:R,fields:{type:"array",items:L(["id","label","headerPath","order","presence","valueRequired","conditions","basisRefs"],{id:{type:"string",minLength:1},label:{type:"string",minLength:1},headerPath:{type:"array",items:{type:"string",minLength:1}},order:{type:"integer",minimum:0},presence:{type:"string",enum:["required","conditional","optional"]},valueRequired:{type:"boolean"},conditions:{type:"array",items:{type:"string"}},unit:{type:"string"},basisRefs:R,condition:L(["status","reason","basisRefs"],{status:{type:"string",enum:["applies","not-applicable","unresolved"]},reason:{type:"string",minLength:1},basisRefs:R})})},rowGroups:{type:"array",items:L(["id","label","order","fixedRows","basisRefs"],{id:{type:"string",minLength:1},label:{type:"string",minLength:1},order:{type:"integer",minimum:0},basisRefs:R,fixedRows:{type:"array",items:L(["id","label","labelFieldId","required","repeatable"],{id:{type:"string",minLength:1},label:{type:"string",minLength:1},labelFieldId:{type:"string",minLength:1},required:{type:"boolean"},repeatable:{type:"boolean"}})}})},instructions:{type:"array",items:L(["id","text","targets","basisRefs"],{id:{type:"string",minLength:1},text:{type:"string",minLength:1},targets:{type:"array",items:{type:"string"}},basisRefs:R})},formatRules:{type:"array",items:L(["id","kind","text","targets","sourceRefs"],{id:{type:"string",minLength:1},kind:{type:"string",enum:["column-order","row-group-order","merged-header","fixed-text","diagram-area","description-area","visual-layout"]},text:{type:"string",minLength:1},targets:{type:"array",items:{type:"string"}},sourceRefs:R})}}),T=L(["candidateHash","status","reason","evidence"],{candidateHash:{type:"string",minLength:1},status:{type:"string",enum:["accepted","disputed","unmeasured"]},reason:{type:"string",minLength:1},evidence:R}),U=L(["contentObligations","outputObligations","unresolved"],{contentObligations:{type:"array",items:L(["text","kind","quote","sourceFile","applicability"],{clause:{type:"string"},text:{type:"string",minLength:1},kind:{type:"string",enum:["content","procedure"]},quote:{type:"string",minLength:1},sourceFile:{type:"string",minLength:1},page:{type:"string"},items:{type:"array",items:{type:"string",minLength:1}},applicability:M})},outputObligations:{type:"array",items:L(["form","element","quote","sourceFile","applicability"],{clause:{type:"string",minLength:1},form:{type:"string",minLength:1},element:{type:"string",minLength:1},quote:{type:"string",minLength:1},sourceFile:{type:"string",minLength:1},applicability:M})},unresolved:{type:"array",items:L(["question"],{question:{type:"string",minLength:2},sourceFile:{type:"string"}})}}),V=L(["outputObligations"],{outputObligations:{type:"array",items:L(["form","element","quote","sourceFile","applicability"],{form:{type:"string",minLength:1},element:{type:"string",minLength:1},quote:{type:"string",minLength:1},sourceFile:{type:"string",minLength:1},applicability:M})}}),W="你是施工组织设计投标策划智能体。你只从给定的冻结招标/补疑/答疑原文中提取**明确要求**。\n不得凭经验补条款,不得把其他项目的义务带进来,不得改写原文。\n按当前JSON接口提交完整结构;不调用未提供的工具,不返回自由文本或markdown。",X="你是施工组织设计投标策划智能体。只补提取给定原文句中明确点名的图表输出,不补造名称。",Y="你是适用性提案编制者,仅补全已有候选的多维解释,不承担独立审查。",Z="你是与义务提取分开的独立适用性审查者。以冻结原文、上下文与交叉引用逐项审查,禁止按父域自动排除或收录。",$="你是原格式母版提案者。只能读取冻结依据建立可验收模板,不自报审查通过。",_="你是与模板提案分开的独立原格式审查者。冻结原文定位不等于格式解释正确;逐项审查母版完整性。",aa=a=>{let b=a.trim().toLowerCase(),c={表:"table",表格:"table",图:"figure",图件:"figure",示意图:"diagram",框图:"diagram",组织机构图:"org_chart",organization_chart:"org_chart",organizational_chart:"org_chart",bar_chart:"chart",pie_chart:"chart",曲线:"chart",图表:"chart"};return c[b]?c[b]:/org|组织|机构/u.test(b)?"org_chart":/网络图|横道图|进度图|平面布置|流程|示意|框图|diagram/u.test(b)?"diagram":/曲线|chart|柱状|饼图/u.test(b)?"chart":/表|table/u.test(b)?"table":/图|figure|image/u.test(b)?"figure":void 0};function ab(a){return a.replace(/\s+/gu,"").normalize("NFKC").replace(/[“”‘’"'`]/gu,"")}function ac(a,b){let c=[...a.slice(0,Math.max(0,b)).matchAll(/PDF\s*第\s*(\d+)\s*页/gu)];return c.at(-1)?.[1]}function ad(a){let b=RegExp(B.deliveryVerbs.map(a=>a.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&")).join("|"),"u"),c=(B.skipContextPatterns??[]).map(a=>RegExp(a,"u")),d=new Map;for(let e of a)for(let a of e.text.matchAll(/[^。;\n]+/gu)){let f=a[0],g=a.index;if(b.test(f)){for(let a of B.rules)if(RegExp(a.context,"u").test(f))for(let b of a.terms){if(!f.includes(b))continue;let a=function(a,b){let c=a.lastIndexOf("\n",b)+1,d=a.indexOf("\n",b),e=a.slice(c,-1===d?a.length:d),f=/^\s{0,3}#{1,6}\s+.+?\s*#*\s*$/u.test(e),g=[...a.slice(0,f?-1===d?a.length:d:b).matchAll(/^\s{0,3}(#{1,6})\s+(.+?)\s*#*\s*$/gmu)].map(a=>({level:a[1].length,title:a[2].replace(/\s+/gu,"").trim(),index:a.index})).filter(a=>a.index<=b);if(!g.length)return"";let h=[];for(let a of g){for(;h.length&&h[h.length-1].level>=a.level;)h.pop();h.push(a)}return h.map(a=>a.title).join("\0")}(e.text,g);if(c.some(b=>b.test(a)))continue;let h={term:b,filePath:e.filePath,start:g,end:g+f.length,excerpt:f.trim(),context:a};d.set(JSON.stringify([e.filePath,g,b]),h)}}}return[...d.values()]}function ae(a){let b=new Set(a.occurrences.filter(a=>a.witnesses.some(a=>!0===a.accepted||a.review?.status==="accepted")).map(a=>`${a.term}\u0000${a.filePath}\u0000${a.context}`));return a.uncovered.filter(a=>!b.has(`${a.term}\u0000${a.filePath}\u0000${a.context}`))}function af(a){let b=(0,j.ML)(a.sourceFiles),c=(a,b)=>a.sourceFile===b.filePath&&a.start<b.end&&a.end>b.start,e=a.outputs.map((e,f)=>{let g=e.applicability,h=g&&g.sourceHash===b.sourceHash&&g.sourceTextHash===b.files.find(a=>a.filePath===e.sourceFile)?.sourceTextHash&&"output"===g.subject.kind&&g.subject.element===e.element&&g.source.sourceFile===e.sourceFile&&ab(g.source.quote)===ab(e.quote)&&(a=>{let c=b.files.find(b=>b.filePath===a.sourceFile);return c&&a.start>=0&&a.end===a.start+a.quote.length&&c.text.slice(a.start,a.end)===a.quote&&a.nodeId===`tender-source:${(0,d.Fu)([a.sourceFile,a.start,a.quote]).slice(0,24)}`})(g.source),i=g&&(0,j.xL)(e)&&(0,j.N3)(g,a.sourceFiles,{kind:"output",sourceFile:e.sourceFile,quote:e.quote,element:e.element},b).valid,k=new Set(["source"]);if(g&&i){for(let a of g.basisRefs)c(a,{filePath:g.source.sourceFile,start:g.source.start,end:g.source.end})&&k.add(a.refId);let a=!0;for(;a;)for(let b of(a=!1,g.basisRefs))for(let c of b.linkedTo)(k.has(b.refId)||k.has(c))&&(k.has(b.refId)&&k.has(c)||(a=!0),k.add(b.refId),k.add(c))}return{output:e,scope:g,sourceBound:h,accepted:i,connected:k,candidateId:`output-${f}`}}),f=ad(a.sourceFiles).map(a=>{let b=[];for(let{output:d,scope:f,sourceBound:g,accepted:h,connected:i,candidateId:j}of e)if(f&&(d.element.includes(a.term)||a.term.includes(d.element))&&(g&&c(f.source,a)&&b.push({candidateId:j,type:"primary-found",anchor:f.source,applicabilityBindingHash:f.bindingHash,accepted:h}),h))for(let e of f.basisRefs)["includes","shared-delivery"].includes(e.relation)&&i.has(e.refId)&&ab(e.quote).includes(ab(d.element))&&c(e,a)&&b.push({candidateId:j,type:"independently-reviewed-basis",anchor:e,applicabilityBindingHash:f.bindingHash,basisRefId:e.refId,relation:e.relation,review:{candidateHash:f.review.candidateHash,sourceHash:f.review.sourceHash,inputHash:f.review.inputHash,status:"accepted"}});return{...a,witnesses:b}});return{occurrences:f,uncovered:f.filter(a=>!a.witnesses.length).map(({witnesses:a,...b})=>b)}}function ag(a){if(!(a.length<2)&&a.some(a=>a.parents.some(b=>b.nodeId===a.match.nodeId)))return{rule:"节点是否具有父角色只看该处冻结parents;真实heading可同时是match和parent,允许选用;不在parents的普通原句节点仍不能作parent。共同父节点如仍命中多处,不能完成消歧。",occurrences:a.map(b=>({match:b.match,parents:b.parents.map(c=>({node:c,alsoMatchedHeading:c.nodeId===b.match.nodeId,matchingOccurrences:a.filter(a=>a.parents.some(a=>a.nodeId===c.nodeId)).length}))}))}}async function ah(a){let b;if(!a.sourceFiles.length)throw Error("TENDER_OBLIGATION_SOURCE_MISSING:没有冻结招标/补疑/答疑原文,不能提取义务");let c=a.maxExcerptCharsPerBatch??m.NX.$,e=new Map(a.sourceFiles.map(a=>[a.filePath,a.text])),k=a.sourceFiles,y=(0,j.ML)(a.sourceFiles),B=(a,b)=>{let c=e.get(a);if(!c||!b)return 0;let d=0,f=c.indexOf(b);for(;f>=0;)d+=1,f=c.indexOf(b,f+b.length);return d},L=a=>{if(!a)return!1;let b=e.get(a.sourceFile);return!!(b&&a.start>=0&&a.end===a.start+a.quote.length&&b.slice(a.start,a.end)===a.quote&&a.nodeId===`tender-source:${(0,d.Fu)([a.sourceFile,a.start,a.quote]).slice(0,24)}`)},M=(0,g.randomUUID)(),R=`tender-extraction-inputs-${M}.json`,ae=a.diagnostics&&(0,I.frozenModelConfigurationForRun)(a.diagnostics),ah=ae?{status:"recorded",sha256:(0,H.x)(a.diagnostics)}:{status:"unavailable",reason:"no-frozen-model-configuration"},ai=a.artifactDir&&ae?(0,G.G)(f().join(a.artifactDir,"tender-obligation-response-cache"),a.diagnostics,"tender-obligation-response-v1",a.runId):void 0,aj=(a,b)=>{let c=b===N?function(a,b){let c=a.candidates,e=a.evidenceSelectionDirectory;if(!Array.isArray(c)||!e?.candidates||new Set(c.map(a=>a.candidateId)).size!==c.length)throw Error("TENDER_REVIEW_WIRE_INPUT");let f=new Map(c.map(a=>[a.candidateId,{candidateId:a.candidateId,candidateHash:a.candidateHash,target:a.target}])),g=new Map,h=new Map,i=c.map((a,b)=>{let c=e.candidates.find(b=>b.candidateId===a.candidateId);if(!c||!a.candidateHash||!a.target)throw Error("TENDER_REVIEW_WIRE_IDENTITY");let d=new Map,f=[],i=a=>{let c=`c${b+1}e${f.length+1}`;if(g.has(a))throw Error("TENDER_REVIEW_WIRE_DUPLICATE_REFERENCE");return g.set(a,c),d.set(c,a),f.push(c),c},j=c.groups.map(a=>({...a,ref:i(a.ref),parts:a.parts.map(a=>({...a,ref:i(a.ref)}))}));return h.set(a.candidateId,d),{candidateId:c.candidateId,groups:j}}),j=b.properties.decisions.items,k=a=>{let b=a.properties&&Object.fromEntries(Object.entries(a.properties).filter(([a])=>!["candidateId","candidateHash","target"].includes(a)).map(([a,b])=>[a,k(b)]));return{...a,...Array.isArray(a.required)?{required:a.required.filter(a=>!["candidateId","candidateHash","target"].includes(a))}:{},...b?{properties:b}:{},...a.items?{items:k(a.items)}:{}}},l=`^(?:${c.map(a=>a.candidateId.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&")).join("|")})$`,m={type:"object",additionalProperties:!1,required:["decisions"],properties:{decisions:{type:"object",additionalProperties:!1,required:c.map(a=>a.candidateId),patternProperties:{[l]:k(j)}}}},n=a=>Array.isArray(a)?a.map(n):a&&"object"==typeof a?Object.fromEntries(Object.entries(a).filter(([a])=>"candidateHash"!==a).map(([a,b])=>[a,["from","through","ref"].includes(a)&&"string"==typeof b?g.get(b)??b:n(b)])):a;return{payload:{...n(a),reviewReplyProtocol:{version:"tender-review-bound-reply-v1",instructions:"decisions是按当前candidateId为键的对象,每键一个结论。值只写status/reason/headingOnly/evidence/contentScope;headingOnly 必须显式返回 true/false,不得省略:仅当原句本身只是标题/引导句、无独立技术响应内容时为 true,冒号结尾但有实质要求必须为 false;不返回candidateId/candidateHash/target,身份及审查目标由本次请求绑定。证据仅选择本候选给出的短ref,不能跨候选借用。此封装不产生语义批准。"},evidenceSelectionDirectory:{...e,candidates:i}},schema:m,binding:{version:"tender-review-bound-reply-v1",requestBindingHash:(0,d.Fu)([e.bindingHash,[...f.values()],i]),candidates:[...f.values()],references:[...h].map(([a,b])=>({candidateId:a,refs:[...b]}))},restore(a){if(!a||"object"!=typeof a||Array.isArray(a))throw Error("TENDER_REVIEW_WIRE_SHAPE");if(!a.decisions||"object"!=typeof a.decisions||Array.isArray(a.decisions)||Object.keys(a).some(a=>"decisions"!==a))throw Error("TENDER_REVIEW_WIRE_SHAPE:decisions必须为按当前候选键索引的对象");let b=a.decisions;if(Object.keys(b).some(a=>!f.has(a)))throw Error("TENDER_REVIEW_WIRE_CANDIDATES:不接受额外或旧候选");return{decisions:Object.keys(b).map(a=>{let c=f.get(a),d=b[a];if(!d||"object"!=typeof d||Array.isArray(d)||["candidateId","candidateHash","target"].some(a=>Object.hasOwn(d,a)))throw Error("TENDER_REVIEW_WIRE_IDENTITY:身份由本次请求绑定,不允许模型覆盖");let e=b=>Array.isArray(b)?b.map(e):b&&"object"==typeof b?Object.fromEntries(Object.entries(b).map(([b,c])=>{if("from"!==b&&"through"!==b)return[b,e(c)];let d="string"==typeof c?h.get(a).get(c):void 0;if(!d)throw Error(`TENDER_REVIEW_WIRE_FOREIGN_REFERENCE:${a}.${b}必须选择本候选短ref,实际=${String(c)};合法选项=${[...h.get(a).keys()].join(",")}`);return[b,d]})):b;return{...e(d),...c}})}}}}(a,b):void 0,e=(0,j.El)(c?.payload??a,y),f={...e,restoreResponse:a=>{let b=e.restoreResponse(a);return void 0===b?void 0:c?c.restore(b):b}},g=a=>({...a,...a.properties?{properties:Object.fromEntries(Object.entries(a.properties).filter(([a])=>"parentNodeId"!==a||f.parentReferences.length).map(([a,b])=>[a,"parentNodeId"===a?{...b,enum:f.parentReferences}:g(b)]))}:{},...a.items&&!Array.isArray(a.items)?{items:g(a.items)}:{}});return{projection:f,...c?{wireBinding:c.binding}:{},schema:c?.schema??(b===N?{...b,properties:g(b).properties}:b)}},ak=(a,b,c)=>{let d=aj(b,c);return(0,n.documentJsonSystemPrompt)(a,d.schema).length+JSON.stringify(d.projection.prompt).length},al=[],am=[],an=[],ao=[],ap=[],aq=(a,b,c,e,f)=>{let g=aj(c,e);return am.push({stage:a,modelInputChars:ak(b,c,e),inputHash:(0,d.Fu)([(0,n.documentJsonSystemPrompt)(b,g.schema),JSON.stringify(g.projection.prompt)]),reason:f}),f},ar=0,as=(b,d=!1)=>{let e=d?R.replace(/\.json$/u,`-snapshot-${++ar}.json`):R;a.artifactDir&&a.runId&&(0,o.tv)(a.artifactDir,e,{version:"tender-extraction-inputs-v1",invocationId:M,inputBudgetChars:c,unit:"utf16-code-units",qualification:"logical-request-input-not-provider-attempt-usage",frozenModelIdentity:ah,...b?{blockedWindow:b}:{},calls:al,blockedInputs:am,referenceRepairs:an,applicabilityReviews:ao,semanticRevisions:ap},a.runId)},at=b=>{a.artifactDir&&a.runId&&(0,o.tv)(a.artifactDir,`tender-extraction-input-${M}-${String(b.ordinal).padStart(6,"0")}-${b.status}.json`,{version:"tender-extraction-input-v1",invocationId:M,qualification:"logical-request-input-not-provider-attempt-usage",inputBudgetChars:c,unit:"utf16-code-units",frozenModelIdentity:ah,...b},a.runId)},au=async(b,e,f,g,i)=>{let j=aj(f,g),k=j.projection;g=j.schema;let l=JSON.stringify(k.prompt),p=(0,n.documentJsonSystemPrompt)(e,g);if(p.length+l.length>c)throw Error(aq(b,e,f,g,`TENDER_OBLIGATION_INPUT_OVERSIZE:${b} 实际消息 ${p.length+l.length} 字符超过 ${c},未派发`));let q={ordinal:al.length+1,stage:b,status:"invoked",systemChars:p.length,promptChars:l.length,..."string"==typeof f.version?{operation:f.version}:{},schemaChars:JSON.stringify(g).length,modelInputChars:p.length+l.length,inputHash:(0,d.Fu)([p,l]),payloadFields:Object.fromEntries(Object.entries(k.prompt).map(([a,b])=>[a,JSON.stringify(b).length]))};if(Array.isArray(f.files)){let a=f.files;q.sourceChars=a.reduce((a,b)=>a+b.excerpts.reduce((a,b)=>a+b.length,0),0),q.sourceContextChars=a.reduce((a,b)=>a+JSON.stringify(b.sourceContext).length,0),q.sourceRanges=a.flatMap(a=>a.ranges.map(b=>({filePath:a.filePath,...b})))}q.sourceProjectionChars=JSON.stringify(k.prompt.sourceProtocol).length,Array.isArray(k.prompt.data.files)&&(q.sourceContextReferenceChars=k.prompt.data.files.reduce((a,b)=>a+JSON.stringify(b.sourceContext).length,0)),al.push(q),at(q),j.wireBinding&&a.artifactDir&&a.runId&&(0,o.tv)(a.artifactDir,`tender-review-wire-${M}-${q.ordinal}.json`,{inputHash:q.inputHash,...j.wireBinding},a.runId);try{var r;let d=await a.caller(e,l,{schema:g,diagnostics:a.diagnostics,signal:a.signal,validateProtocol:c=>{let d=k.restoreResponse(c);return[..."tender-applicability-review"===b?function(a,b,c){let d=a&&"object"==typeof a&&"decisions"in a?a.decisions:void 0;if(!Array.isArray(d))return["decisions 必须是当前候选的审查数组"];let e=[],f=new Map(b.map(a=>[a.candidateId,a])),g=new Map;for(let[a,b]of d.entries()){let d=`decisions[${a}]`;if(!b||"object"!=typeof b){e.push(`${d} 必须是审查对象`);continue}let h="string"==typeof b.candidateId?b.candidateId:"",i=f.get(h);if(!i){e.push(`${d}.candidateId 不属于本批当前候选`);continue}if(g.set(h,(g.get(h)??0)+1),b.candidateHash!==i.candidateHash&&e.push(`${d}(${h}).candidateHash 必须原样为 ${i.candidateHash},不能使用其它候选的 hash`),b.target!==i.target&&e.push(`${d}(${h}).target 必须为 ${i.target}`),c&&"technical-content"===i.target&&"accepted"===b.status){let a=b.contentScope;a&&Array.isArray(a.technical)&&Array.isArray(a.excluded)||e.push(`${d}(${h}).contentScope:accepted 的 technical-content 必须提供 technical/excluded 数组;reason 不能代替范围。若尚无依据,保留真实 disputed/unmeasured,不得编造批准。`)}}for(let a of b)1!==g.get(a.candidateId)&&e.push(`候选 ${a.candidateId} 必须恰有一个当前独审结论;依据不足可返回 unmeasured,不得漏项或重复`);return e}(d,f.candidates,!!a.requireContentScope):[],..."tender-applicability-review"===b&&i?function(a,b){let c=function(a){if(!a||"object"!=typeof a||!("decisions"in a))return;let b=a.decisions;return Array.isArray(b)?b:void 0}(a);if(!c)return[];let d=new Map(b.directory.candidates.map(a=>[a.candidateId,a])),e=[];for(let[a,f]of c.entries()){if(!f||"object"!=typeof f)continue;let c="string"==typeof f.candidateId?f.candidateId:"",g=d.get(c);if(!g||f.candidateHash!==g.candidateHash)continue;let i=`decisions[${a}](${c})`;void 0!==f.evidence&&e.push(...h(f.evidence,c,g.candidateHash,b,`${i}.evidence`).errors);let j=f.contentScope;if(j&&"object"==typeof j&&!Array.isArray(j))for(let a of["technical","excluded"]){let d=j[a];void 0!==d&&e.push(...h(d,c,g.candidateHash,b,`${i}.contentScope.${a}`,["technical"===a?"response":"reason"]).errors)}}return e}(d,i):[],..."tender-applicability-revision-v2"===f.version?E(d,f.candidates,y):[]]},onAttempt:c=>{if(c.raw)try{k.restoreResponse(JSON.parse(c.raw))}catch(d){if(d instanceof SyntaxError||!a.artifactDir||!a.runId)return;(0,o.tv)(a.artifactDir,`tender-source-reference-failure-${M}-${q.ordinal}-${c.ordinal}.json`,{version:"tender-source-reference-failure-v1",stage:b,inputHash:q.inputHash,raw:c.raw,reason:d instanceof Error?d.message:String(d),reusedAsValidResponse:!1},a.runId)}},maxInputChars:c,temperature:0,maxTokens:m.ct.y,taskKind:(r=String(f.version??""),"tender-applicability-reference-repair-v1"===r&&"1"===process.env.DOCUMENT_BINDING_SELECTION_LOW_REASONING?"binding-selection":"reasoning"),callKind:b,prefixKey:`tender:${b}`,...ai?{responseCache:ai,onResponseCache:a=>{"hit"===a.event?q.cache={requestKey:a.requestKey,responseSha256:a.responseSha256,originRunId:a.originRunId}:q.cacheErrors=a.errors}}:{}}),j=k.restoreResponse(d);if(void 0!==j&&"tender-applicability-revision-v2"===f.version){let a=E(j,f.candidates,y);if(a.length)throw Error(a.join(";"))}return q.status=q.cache?"cache-hit":void 0===d?"failed":"completed",j}catch(a){throw q.status="failed",q.error=a instanceof Error?a.message:String(a),a}finally{at(q)}},av=a=>({...a,sourceContext:a.excerpts.map((b,c)=>{let d=a.ranges[c];return(0,j.rP)(y,a.filePath,b).filter(a=>a.start===d.start&&a.end===d.end).map(a=>({...a,parents:a.parents.map(a=>({nodeId:a.nodeId,start:a.start,end:a.end,sourceDomain:a.sourceDomain,...a.start>=d.start&&a.end<=d.end?{}:{quote:a.quote}})),boundaries:a.boundaries.map(a=>({nodeId:a.nodeId,start:a.start,end:a.end,sourceDomain:a.sourceDomain}))}))})}),aw=new WeakMap,ax=(a,b)=>{let c=structuredClone(b.applicability??{}),d=(0,j.IG)({index:y,sourceFile:b.sourceFile,quote:b.quote,kind:a,...b.element?{element:b.element}:{},requested:c});return aw.set(d,c),d},ay=[],az=(a,b)=>{let c=ab(b);if(!c)return;let d=e.get(a);if(d){let e=d.indexOf(b);if(e>=0||ab(d).includes(c))return{filePath:a,...ac(d,Math.max(0,e))?{page:ac(d,Math.max(0,e))}:{}}}for(let a of k){let d=a.text.indexOf(b);if(d>=0||ab(a.text).includes(c))return{filePath:a.filePath,...ac(a.text,Math.max(0,d))?{page:ac(a.text,Math.max(0,d))}:{}}}},aA=a=>{let b=a.trim();if(!b)return;let c=/表|图|框图|曲线|网络图|横道图|平面布置|组织机构|人员组成|机械设备|附件/u;if(c.test(b))for(let a of k){let d=a.text.indexOf(b);if(d<0)continue;let e=Math.max(a.text.lastIndexOf("。",d),a.text.lastIndexOf(";",d),a.text.lastIndexOf("\n",d))+1,f=[a.text.indexOf("。",d),a.text.indexOf(";",d),a.text.indexOf("\n",d)].filter(a=>a>=0),g=f.length?Math.min(...f)+1:a.text.length,h=a.text.slice(e,g).trim();if(h&&c.test(h))return{filePath:a.filePath,quote:h,...ac(a.text,d)?{page:ac(a.text,d)}:{}}}},aB=[],aC=[],aD=[],aE=(a,b,c)=>({task:"从冻结招标原文提取施工组织设计的内容义务与明确输出要求",batch:{index:b+1,count:c},rules:["本次只处理给定原字窗口;ranges记录连续页与原窗口区间,不要假设其他页没有条件。来源标题的结构引用指向excerpts内原字,范围未明确时保留unresolved,不按分页断口解释适用性。","只提取原文明确要求的内容;原文没有的,不补。","**评审因素/评分标准不是内容义务**:它们由章节响应承载,不要作为 contentObligations 返回;**纯提交/修改/期限/份数等程序要求**也不要返回,除非它直接决定正文必须包含什么。","补疑/答疑中明确要求施工组织设计包含或编制的内容(如专项施工方案、深化设计、专项措施)**必须提取**;是否单独成节由规划决定,不要因为“可能另行报审”而排除。","contentObligations:招标/合同条款要求施工组织设计必须包括、说明或提交的内容。按**原子项**拆分(每项只表达一个可落实的义务),text 用简短名词短语,quote 逐字摘录包含该义务的连续原文(保持原文完整语义,不得改写、拼接或截断到失去条件)。","**逐项列举必须拆开**:同一句原文用“(1)(2)…”“① ② ③”“第一、第二”或顿号/分号列出多个可执行类别时,必须在同一义务的 `items` 中逐项列出(如危大工程的模板工程、起重吊装、脚手架、拆除、钢结构安装);不得合并成一条摘要,也不得只保留前几项。","kind=content 表示正文必须落实的工程/管理内容;kind=procedure 表示提交、修改、期限、确认等程序要求。","outputObligations:原文**点名具体名称**的表格、图件、网络图、横道图、平面布置图、组织机构图、人员组成表、机械设备表、曲线等。form 按实际形态选择;element 用原文名称;quote 逐字摘录包含该要求的连续原文。","sourceContext中的sourceDomain与父链仅是原文定位元数据,不能决定适用性:合同、附录、商务载体可能含本技术方案的最低人员、机械、工期、质量、深化设计等真实约束,必须完整保留并逐项判断,不能按父域或表名排除。","每个content/output必须给applicability独立维度:technicalContent判断required-response/technical-constraint/reference/not-applicable/unresolved;delivery分别判断强制程度requirement、交付文件location、是否必须原格式originalForm、阶段stage和conditions。technicalContent要求响应不等于本技术正文必须提交该原表;建议不能升级必出,施工阶段专项成果不等于投标时完整成果。","reason解释原句与跨引用;basisRefs可来自多个给定冻结文件,逐项给refId/sourceFile/quote/relation/explanation/linkedTo(可链接source或其他refId);parentNodeId只用于消歧。来源原句不必包含“施工组织设计”字眼,不能依关键词当语义证明。stage=multiple须在stages明确列出bid/contract/construction,不能只写自然语言条件。","同一条款可同时有技术内容约束和另一文件/阶段原表义务,分别保留content与output;匿名岗位配置可响应技术资源要求,但去姓名不自动等于完整具名表履约;共享附件与补疑覆盖须保留可核交叉引用。主提取不得自行提供review/verified,全部决定(含排除)需后续独立scope审查。","补疑中的工程技术责任可作为content响应,不因没有“施工组织设计”字样而删除;但施工期独立编制报审的专项成果,不能自动作为本篇必出表图。归属未能裁决时保留typed unresolved;自由文本unresolved不能代替条目的applicability。","纯商务、资格或报价原表不等于技术必出;但表类名称不决定去留,有技术交叉引用或共享附件时保留独立内容约束与原表交付记录,分别给出多维解释,不按名称删除。实际要求暗标时另核身份约束,不借匿名化改写原表归属。","泛称“文字并结合图表形式编制”不单独作为一项输出;只有点名具体图表名称时才提取。","不要从“评审因素/评分标准”里推断输出形式;只提取原文明确点名的输出。","sourceFile 必须使用 sourceProtocol.files 给出的 fileRef;服务端恢复规范文件路径。page 可不填,程序会按 quote 定位。","同一 quote 可以支撑多条义务;不同义务不要重复。","有歧义时写入 unresolved,不要猜。"],files:a.map(av),outputProtocol:"严格遵循system中的当前JSON schema与全部枚举;每条content/output的applicability必须完整。basisRefs/reason属于applicability,不是外层义务;originalForm是枚举字符串,不能填boolean;不用mandatory、bid-technical-file或中文自造枚举。"});try{b=(0,p.tenderObligationExcerptBatches)(a.sourceFiles,c,a=>ak(W,aE(a,Number.MAX_SAFE_INTEGER-1,Number.MAX_SAFE_INTEGER),U))}catch(a){throw as(a instanceof Error?a.message:String(a)),a}let{batches:aF,windowsTotal:aG,charsTotal:aH,pagesTotal:aI}=b;if(!aF.length)throw Error("TENDER_OBLIGATION_EXCERPTS_EMPTY:冻结招标来源全文为空,不能提取义务");let aJ=async(a,b)=>{let c,d=[],e=[],f=[],g=[],h=0;try{c=await au("tender-obligation-extraction",W,aE(b,a,aF.length),U)}catch(b){throw Error(`TENDER_OBLIGATION_EXTRACTION_FAILED:第 ${a+1}/${aF.length} 批失败:${b instanceof Error?b.message:String(b)}`,{cause:b})}if(!c||"object"!=typeof c)throw Error(`TENDER_OBLIGATION_EXTRACTION_FAILED:第 ${a+1}/${aF.length} 批模型未返回 JSON 结果`);let i=c;for(let a of i.contentObligations??[]){let b=String(a?.text??"").trim(),c=String(a?.quote??"").trim();if(!b||!c)continue;let e=az(String(a?.sourceFile??""),c);if(!e){g.push({kind:"content",text:b,reason:"quote 不在冻结原文中逐字存在",quote:c});continue}let f=[...new Set((Array.isArray(a?.items)?a.items:[]).map(a=>String(a??"").trim()).filter(Boolean))],i=z(c,f);h+=Math.max(0,f.length-i.length),d.push({text:b,kind:a?.kind==="procedure"?"procedure":"content",quote:c,sourceFile:e.filePath,...a?.clause?.trim()?{clause:a.clause.trim()}:{},...e.page?{page:e.page}:{},...i.length?{items:i}:{},applicability:ax("content",{...a,quote:c,sourceFile:e.filePath})})}for(let a of i.outputObligations??[]){let b=String(a?.element??"").trim(),c=String(a?.quote??"").trim(),d=aa(String(a?.form??"").trim());if(!b||!c||!d)continue;let f=az(String(a?.sourceFile??""),c);if(!f){let a=aA(b);if(!a){g.push({kind:"output",text:b,reason:"quote 不在冻结原文中逐字存在,且原文未点名该输出",quote:c});continue}e.push({form:d,element:b,quote:a.quote,sourceFile:a.filePath,applicability:ax("output",{element:b,quote:a.quote,sourceFile:a.filePath})});continue}e.push({form:d,element:b,quote:c,sourceFile:f.filePath,applicability:ax("output",{...a,element:b,quote:c,sourceFile:f.filePath})})}for(let a of i.unresolved??[]){let b=String(a?.question??"").trim();b&&f.push({question:b,...a?.sourceFile?.trim()?{sourceFile:a.sourceFile.trim()}:{}})}return{content:d,outputs:e,questions:f,rejected:g,itemsRejected:h}},aK=Math.max(1,Math.floor(m.N6?.obligationBatches??2)),aL=await (0,q.W)(aF,aK,(a,b)=>aJ(b,a)),aM=0;for(let a of aL)aB.push(...a.content),aC.push(...a.outputs),aD.push(...a.questions),ay.push(...a.rejected),aM+=a.itemsRejected;let aN=(a,b)=>{let c=new Set;return a.filter(a=>{let d=b(a);return!c.has(d)&&(c.add(d),!0)})},aO=a=>`${a.sourceFile}|${a.applicability?.source.nodeId}|${a.form}|${a.element}|${ab(a.quote)}`,aP=aN(aB,a=>`${a.sourceFile}|${a.applicability?.source.nodeId}|${a.clause??""}|${a.text}|${ab(a.quote)}`),aQ=aN(aC,aO),aR=aN(aD,a=>a.question),aS=a=>{let b=new Set;for(let c of ad(k)){let{term:d,filePath:e,start:f,end:g,excerpt:h}=c;a.some(a=>a.sourceFile===e&&(a.element.includes(d)||d.includes(a.element))&&a.applicability&&a.applicability.source.start<=g&&a.applicability.source.end>=f)||b.add(JSON.stringify({term:d,filePath:e,start:f,excerpt:h}))}return b},aT=aS(aQ),aU=[],aV=[];if(aT.size){let b=[...aT].map(a=>{try{let b=JSON.parse(a),c=String(b.term??""),d=String(b.filePath??""),e=b.excerpt??"";return{term:c,filePath:d,excerpt:e,sourceContext:(0,j.rP)(y,d,e)}}catch{return{term:"",filePath:"",excerpt:""}}}).filter(a=>a.term&&a.excerpt),d=a=>({task:"补提取原文点名的图表输出,逐项完整返回当前schema中的applicability;分别解释技术内容、交付位置、阶段、强制程度与原格式,不按父域自动排除或升级",rules:["**quote 必须逐字等于输入 focus 中对应项的 excerpt**(照抄触发句,不含首尾空白),sourceFile 照抄该项的 filePath;不得改写、缩写或另选原文句子——引文逐字可核是这条义务成立的前提。"],focus:a}),e=[],f=[];for(let a of b){if(ak(X,d([a]),V)>c){aq("tender-output-recall",X,d([a]),V,"单个点名输出与完整来源上下文超过输入预算,保留原句与后续局部待核");continue}f.length&&ak(X,d([...f,a]),V)>c&&(e.push(f),f=[]),f.push(a)}for(let b of(f.length&&e.push(f),e))try{let a=(await au("tender-output-recall",X,d(b),V)??{}).outputObligations??[];for(let c of(aU.push({batchTerms:b.map(a=>a.term),returned:a.map(a=>({element:String(a.element??""),quote:String(a.quote??""),form:String(a.form??"")})),status:"completed"}),a)){let a=String(c.element??"").trim(),b=String(c.quote??"").trim(),d=aa(String(c.form??""));if(!a||!b||!d)continue;let e=az(String(c.sourceFile??""),b);e&&aC.push({form:d,element:a,quote:b,sourceFile:e.filePath,applicability:ax("output",{...c,element:a,quote:b,sourceFile:e.filePath})})}aQ=aN(aC,aO);let c=aS(aQ);for(let a of(aT.clear(),c))aT.add(a)}catch(c){aU.push({batchTerms:b.map(a=>a.term),status:"failed",error:c instanceof Error?c.message:String(c)}),a.signal?.throwIfAborted()}for(let a of[...aT])try{let b=JSON.parse(a),c=String(b.term??""),d=String(b.filePath??""),e=b.excerpt,f=/表/u.test(c)?"table":/图/u.test(c)?"figure":void 0;if(c&&e&&f){let a={form:f,element:c,quote:e,sourceFile:d,applicability:ax("output",{element:c,quote:e,sourceFile:d})};aC.push(a),aV.push({term:c,filePath:d,form:f,quoteChars:e.length,anchorReal:L(a.applicability.source),quoteOccurrences:B(d,e)})}else aV.push({term:c,filePath:d,form:f,skipped:!0})}catch(a){aV.push({status:"failed",error:a instanceof Error?a.message:String(a)})}let g=aS(aQ=aN(aC,aO));for(let a of(aT.clear(),g))aT.add(a)}let aW=function(a){let b=function(a){let b=[],c=[],d=0,e=new Set;for(let f of a)for(let a of function(a){let b=[...a.matchAll(u)];if(!b.length)return[{text:a}];let c=[],d=0;for(let[e,f]of b.entries()){let g=f.index??0;g>d&&c.push({text:a.slice(d,g)});let h=b[e+1]?.index??a.length;c.push({page:f[1],text:a.slice(g,h)}),d=h}return d<a.length&&c.push({text:a.slice(d)}),c}(f.text))for(let g of function(a,b=!1){let c=[],d,e=[],f=[],g=!1,h=/^\s*#{1,6}(?:\s|$)/u,i=/^\s*第[一二三四五六七八九十百零〇\d]+[章节条款]/u,j=a=>v.test(a)||/^\d+(?:[..]\d+)+(?=[^\d..])/u.test(a)||w.test(a)||h.test(a)||/PDF\s*第\s*\d+\s*页/u.test(a),k=()=>{let a=e.join("").trim();a&&c.push({...d?{heading:d}:{},text:a}),e=[],f=[],g=!1};for(let c of a.match(/[^\r\n]*(?:\r?\n|$)/gu)??[]){if(!c)continue;let a=c.trim();if(!a){f.push(c);continue}if(f.length){let c=e.at(-1)?.trim()??"";!b||g||!c||/[。!?!?;;::.][”’」』)》】〕))\]]*$/u.test(c)||w.test(c)||h.test(c)||i.test(c)||/PDF\s*第\s*\d+\s*页/u.test(c)||j(a)?k():e.push(...f),f=[]}v.test(a)&&a.length<=100&&!w.test(a)&&(k(),d=a),e.push(c),g||=w.test(a)}return k(),c}(a.text,void 0!==a.page)){if(g.text.length<8||g.heading===g.text&&g.text.length<36&&!/[::]/u.test(g.text)&&0===x(g.text).length)continue;let h=function(a){let b=s(a);return r.categories.filter(a=>a.terms.some(a=>b.includes(s(a)))).sort((a,b)=>b.priority-a.priority||a.id.localeCompare(b.id))}(g.text);if(!h.length){A(g.text,h)&&(d+=1,c.length<50&&c.push({filePath:f.filePath,...a.page?{page:a.page}:{},text:g.text.slice(0,500)}));continue}if(!A(g.text,h))continue;let i=`requirement-clause:${t(`${f.filePath}\u0000${a.page??""}\u0000${s(g.text)}`)}`;e.has(i)||(e.add(i),b.push({id:i,filePath:f.filePath,...a.page?{page:a.page}:{},...g.heading?{heading:g.heading}:{},text:g.text,categoryIds:h.map(a=>a.id),categoryLabels:h.map(a=>a.label),items:x(g.text),covered:!1}))}return{clauses:b,unclassified:c,unclassifiedCount:d}}(a.sourceFiles),c=a.extraction.contentObligations.map(({items:a,...b})=>({...b,...a?{items:[...a]}:{}})),d=0,e=0,f=0,g=[];for(let h of b.clauses){let b=s(h.text),i=a.applicabilityResolver?.({sourceFile:h.filePath,quote:h.text}),j=a=>{if(a.sourceFile!==h.filePath)return!1;if(!i)return!0;let b=a.applicability?.source,c=i.source;return b&&b.sourceFile===c.sourceFile&&b.start>=0&&c.start>=0&&b.start<=c.start&&b.end>=c.end},k=c.find(a=>{if(!j(a))return!1;let c=s(a.quote);return c.length>=8&&c.includes(b)});if(k){if(h.items.length&&!k.items?.length){let a=z(k.quote,h.items);a.length&&(k.items=a)}k.categories=[...new Set([...k.categories??[],...h.categoryIds])],k.origin=k.origin??"agent-extraction",h.covered=!0,h.coveredBy=k.text,e+=1;continue}if(!h.categoryIds.map(a=>r.categories.find(b=>b.id===a)).filter(a=>a.addAsContent).sort((a,b)=>b.priority-a.priority).length){h.covered=!1,f+=1,g.length<50&&g.push({filePath:h.filePath,...h.page?{page:h.page}:{},categories:[...h.categoryIds],text:h.text.slice(0,500)});continue}c.push({text:h.text,kind:"content",quote:h.text,sourceFile:h.filePath,...h.page?{page:h.page}:{},...h.heading?{clause:h.heading}:{},...h.items.length?{items:h.items}:{},origin:"requirement-clause",categories:[...h.categoryIds],...i?{applicability:i}:{}}),h.covered=!0,d+=1}return{extraction:{...a.extraction,contentObligations:c},coverage:{version:r.version,clauses:b.clauses.length,classified:b.clauses.length,covered:e,added:d,unclassified:b.unclassifiedCount,unclassifiedSamples:b.unclassified,deferred:f,deferredSamples:g,requirementClauses:b.clauses}}}({sourceFiles:a.sourceFiles,applicabilityResolver:a=>ax("content",a),extraction:{applicabilityVersion:j.q$,contentObligations:aP,outputObligations:aQ,unresolved:aR}}),aX=aW.extraction;for(let b of a.chapterPoints??[]){if(aX.contentObligations.some(a=>a.sourceFile===b.sourceFile&&ab(a.quote)===ab(b.quote)))continue;let a=ax("content",b);if(!L(a.source))throw Error(`TENDER_CHAPTER_POINT_SOURCE_INVALID:${b.text} 没有唯一的冻结原文依据(${b.sourceFile})`);aX.contentObligations.push({...b,kind:"content",applicability:a})}await a_(aX);let aY=af({sourceFiles:a.sourceFiles,outputs:aX.outputObligations});a.artifactDir&&a.runId&&(0,o.tv)(a.artifactDir,"tender-named-output-coverage.json",{version:"tender-named-output-coverage-v1",runId:a.runId,occurrences:aY.occurrences.map(a=>({term:a.term,filePath:a.filePath,context:a.context,start:a.start,witnesses:a.witnesses.map(a=>({type:a.type,candidateId:a.candidateId,accepted:a.accepted??null,review:a.review??null}))})),uncovered:aY.uncovered.map(a=>({term:a.term,filePath:a.filePath,context:a.context,start:a.start})),recallLog:aU,fallbackLog:aV},a.runId),await a$(aX),as();let aZ={version:K,applicabilityVersion:j.q$,extraction:aX,rejected:ay,counts:{content:aX.contentObligations.length,output:aQ.length,unresolved:aR.length,rejected:ay.length,uncovered:aY.uncovered.length,itemsRejected:aM},uncoveredOutputs:aY.uncovered.map(a=>`${a.term}(${a.filePath}@${a.start})`),namedOutputCoverage:aY,excerptChars:aH,promptVersion:`${K}-batched-v7-lossless-source-references`,inputLedgerArtifact:R,coverage:{windowsTotal:aG,windowsRead:aG,windowsUnread:0,batches:aF.length,charsTotal:aH,pages:aI},requirementCoverage:aW.coverage};if(a.artifactDir&&a.runId){let{inputLedgerArtifact:b,...c}=aZ;(0,o.tv)(a.artifactDir,"tender-obligation-extraction.json",c,a.runId)}return aZ;async function a$(b){for(let e of b.outputObligations){let b,f;if(!(0,j.oY)(e)||"required"!==e.applicability.delivery.originalForm)continue;let g=e.applicability,h=[g.source,...g.basisRefs],i=[],k=(a,b,c)=>{let d=y.files.find(b=>b.filePath===a),e=Math.max(0,b-1800),f=Math.min(d.text.length,c+3600);if(i.some(b=>b.sourceFile===a&&b.start<=e&&b.end>=f))return;for(let b=i.length-1;b>=0;b--){let c=i[b];c.sourceFile!==a||c.end<e||c.start>f||(e=Math.min(e,c.start),f=Math.max(f,c.end),i.splice(b,1))}let g=d.text.slice(e,f);i.push({sourceFile:a,sourceTextHash:d.sourceTextHash,start:e,end:f,text:g,parents:(0,j.rP)(y,a,g)})};for(let a of h)k(a.sourceFile,a.start,a.end);for(let a of y.files)for(let b of a.text.matchAll(RegExp(e.element.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&"),"gu")))k(a.filePath,b.index,b.index+e.element.length);let l={...{version:"tender-original-form-proposal-v1",task:"从已核原格式必交义务的冻结母版提案字段、表头、分组、固定行、说明与格式规则;不自行审查",output:{form:e.form,element:e.element,applicability:g},sourceHash:y.sourceHash,sourceCatalog:y.files.map(a=>({sourceFile:a.filePath,sourceTextHash:a.sourceTextHash,chars:a.text.length})),rules:["只提取本输出对应母版,不能混入同页相邻表、同名另一来源或页码。sourceRefs与每项依据均逐字给sourceFile/quote,parentNodeId只作消歧。","fields保持实际字段标签、单位、分组表头headerPath及列序;包含原表序号列,不得去姓名/改名冒充原具名表。presence指原表字段是否必留,valueRequired须区分空白模板与实际交付必填,不能无依据禁止原表允许的空白。","conditional字段必须在condition逐项给出applies/not-applicable/unresolved、解释及冻结basisRefs;本项目条件已核成立或不成立才可作对应决定,不能默认永久未测,也不能无依据填not-applicable。固定原表保留表头但允许空值时用valueRequired=false,不能删列;仅原文明示条件不成立可不列的字段才用conditional/not-applicable。","rowGroups保持组名与组序;有明确岗位/固定行才列fixedRows并给labelFieldId及是否可重复,数组顺序即原行序。空白占位行数量不等于必须填同样数量资源。instructions逐字保留说明。","表头多层合并由headerPath表达。只有冻结原文明确支持的合并/固定布局才可主张;扁平OCR不足以判断视觉分组时给visual-layout未测约束,不能猜合并、尺寸、节点层级或声称像素一致。","图框/说明框只证明相应diagram-area/description-area区域;没有源要求不得编造组织层级或固定节点;必须精确布局且无法用常规图件表达的规则保留visual-layout。fixed-text规则的text必须是实际须保留的逐字文本,不能填规则解释。","上下文仅是所列窗口,sourceCatalog不表示全文已读;不自带review/verified,模板必须再由独立caller审查。"]},sourceWindows:i},m={sourceRefs:[],fields:[],rowGroups:[],instructions:[],formatRules:[]};if(ak($,l,S)>c)b=aq("tender-original-form-proposal",$,l,S,"原格式关联母版窗口与完整协议超过单次输入预算,未截断、未读取,保持本输出待核");else try{m=await au("tender-original-form-proposal",$,l,S)}catch(c){a.signal?.throwIfAborted(),b=`原格式提案未完成:${c instanceof Error?c.message:String(c)}`}let n=(0,J.Y8)({sourceFiles:a.sourceFiles,applicability:g,kind:"table"===e.form?"table":"figure",proposal:m}),o={version:"tender-original-form-review-v1",task:"独立复核原格式母版契约是否忠实完整,不核作者表格内容",sourceHash:y.sourceHash,candidateHash:(0,J.tL)(n),contract:n,sourceWindows:i,rules:["核当前已独审scope、母版身份、每字段/单位/必填条件/表头层级/列序/分组固定行顺序/说明及格式规则,禁止仅凭表名或quote存在认定语义完整。","不能把匿名技术资源响应认作具名原表完成,不能混入相邻表;空白行不是固定资源数量,未读或扁平OCR无法判断的视觉约束保持unmeasured,不能猜测。","accepted只接受当前candidateHash的模板契约;任何关键字段/说明/条件缺漏或误配disputed,依据/可读信息不足unmeasured。另有实际单元内容独审,不可由本模板结论提前认证实际数据。"]};if(!b&&ak(_,o,T)>c&&(b=aq("tender-original-form-review",_,o,T,"原格式独立审查、当前协议与完整母版窗口超过输入预算,保持本输出待核")),!b)try{f=await au("tender-original-form-review",_,o,T)}catch(c){a.signal?.throwIfAborted(),b=`原格式独立审查未完成:${c instanceof Error?c.message:String(c)}`}e.originalForm=n=(0,J.Q0)({contract:n,sourceFiles:a.sourceFiles,inputHash:(0,d.Fu)(o),result:f?.candidateHash===o.candidateHash&&"string"==typeof f.reason&&Array.isArray(f.evidence)&&["accepted","disputed","unmeasured"].includes(f.status)?f:{status:"unmeasured",reason:b??"原格式独立审查缺少唯一当前模板结论",evidence:[]}})}}async function a_(b){let e=[...b.contentObligations.map((a,b)=>({candidateId:`content-${b}`,kind:"content",item:a})),...b.outputObligations.map((a,b)=>({candidateId:`output-${b}`,kind:"output",item:a}))],f=a=>{let b=a.item.applicability??ax(a.kind,a.item);a.item.applicability=b;let c=aw.get(b);if(!c)throw Error("TENDER_APPLICABILITY_RAW_PROPOSAL_MISSING:本次候选原始引用记录缺失,不能从清洗后的scope重建");let d=(0,j.dY)({index:y,sourceFile:a.item.sourceFile,quote:a.item.quote,requested:c}),e=(0,j.r8)(y,a.item.sourceFile,a.item.quote),f=(c.basisRefs??[]).map((a,b)=>({index:b,refId:a.refId,relation:a.relation,linkedTo:a.linkedTo??[],contexts:(0,j.r8)(y,a.sourceFile,a.quote)})),g=ag(e),h=f.flatMap(a=>{let b=ag(a.contexts);return b?[{index:a.index,...b}]:[]});return{candidate:a,payload:{candidateId:a.candidateId,candidateHash:(0,j.DB)(b),kind:a.kind,text:"text"in a.item?a.item.text:a.item.element,scope:b,sourceContexts:e,basisContext:f,...g||h.length?{parentRoleEvidence:{...g?{source:g}:{},basisRefs:h}}:{},...d.length?{referenceIssues:d,requestedReferences:{source:{parentWasProvided:!!c.parentNodeId},basisRefs:(c.basisRefs??[]).map((a,b)=>{let{parentNodeId:c,...d}=a;return{index:b,...d,parentWasProvided:!!c}})}}:{}}}},g=a=>{let b=[],c=new Map,e=a=>a.map(a=>{let e=(0,d.Fu)(a),f=c.get(e);if(void 0!==f){if(JSON.stringify(b[f])!==JSON.stringify(a))throw Error("TENDER_SOURCE_CONTEXT_DIRECTORY_COLLISION");return f}let g=b.length;return c.set(e,g),b.push(a),g});return{sourceContextDirectory:b,candidates:a.map(a=>({...a,sourceContexts:e(a.sourceContexts),basisContext:a.basisContext.map(({contexts:a,...b})=>({...b,contextRefs:e(a)}))}))}},h=e.map(f).filter(a=>{let b=a.candidate.item.applicability;return b.issues.length>0||("content"===b.subject.kind?"unresolved"===b.technicalContent:Object.values(b.delivery).some(a=>"unresolved"===a)||"multiple"===b.delivery.stage&&!b.delivery.stages?.length)}),k={version:"tender-applicability-proposal-v1",task:"只补全当前候选缺失/未决的多维适用性提案,不改义务文本或原文、不自审",sourceHash:y.sourceHash,sourceCatalog:y.files.map(a=>({sourceFile:a.filePath,sourceTextHash:a.sourceTextHash,chars:a.text.length})),rules:["sourceDomain只作定位,合同/附录/商务内也可能含技术约束;保留最低配置、合同约定的施工组织内容、深化设计等正例。","报价、费用计取、支付台账与保险费用属于商务交付,不因被提作章节要点就变成技术义务;混合原句保留其中实际技术措施与约束,不能把费用管理一并纳入技术正文。","根据原句、上下文与跨引用分别判断technicalContent、delivery的requirement/location/originalForm/stage/conditions;建议不变必出,施工期成果不移到投标原表。","basisContext提供实际关联原句及父链;sourceCatalog只是全量引用目录,不等于已读全文。跨文件依据用basisRefs逐字引用并用linkedTo解释关联,没读到的关联依据仍填unresolved。","sourceContextDirectory按完整实际命中/邻文/父链身份去重原字;candidate.sourceContexts为其零基索引,basisContext每个原basis索引用contextRefs列全部实际位置,引用关系不合并。parentNodeId只能选对应目录项的parents,不能选scope.source或match原句节点冒充父角色;唯一原句省略,多处按实际父链消歧。","类别或候选主题只是召回标签,按完整quote独立判断,不能因主题与原句不符排除真实最低配置或其他要求,也不能无实际candidateId和已覆盖原句就声称别的候选承接。□/●等选项保持原意,未勾选的资格选项不得硬化。","同一原句可混合技术最低人数/资格与商务具名、证书、社保提交责任;技术资源约束与原表/证明材料交付须分维度解释,不把商务身份材料搬入匿名技术正文,也不因此排除技术配置要求。","保持candidateId/candidateHash,不得提供review/verified;本次只是提案,随后由另一次独立scope审查接受或质疑。"]},n=a=>({...k,...g(a.map(a=>a.payload))}),o=[],p=[];for(let a of h){if(ak(Y,n([a]),O)>c){aq("tender-applicability-proposal",Y,n([a]),O,"单个适用性候选及其完整依据超过输入预算,维持局部待核");continue}p.length&&ak(Y,n([...p,a]),O)>c&&(o.push(p),p=[]),p.push(a)}p.length&&o.push(p);let r=Math.max(1,Math.floor(Number(m.N6?.applicabilityBatches??3)));await (0,q.W)(o,r,async b=>{let c=n(b);try{let a=await au("tender-applicability-proposal",Y,c,O),d=a?.decisions??[];for(let a of b){let b=d.filter(b=>b.candidateId===a.payload.candidateId);1===b.length&&b[0].candidateHash===a.payload.candidateHash&&b[0].applicability&&(a.candidate.item.applicability=ax(a.candidate.kind,{...a.candidate.item,applicability:b[0].applicability}))}}catch{a.signal?.throwIfAborted()}}),await M();let s=e.map(f),t=l(y,s.map(a=>({candidateId:a.payload.candidateId,applicability:a.candidate.item.applicability}))),u={task:"独立复核每一项技术内容、交付文件、阶段与原表形式裁决;不是重新提取或自行补造义务",version:"tender-applicability-review-v3",sourceHash:y.sourceHash,...a.requireContentScope?{contentScopeVersion:"tender-content-scope-v1"}:{},rules:["sourceDomain与父链只说明来源位置,不决定适用性;合同、附录、商务载体内的技术责任与最低配置仍可约束本技术方案。","逐项区分technicalContent和delivery:人员/机械/工期等技术响应,不等于必须在本技术文件提交具名原表;建议不升强制;施工阶段方案不等于投标完整成果。","核原句、上下文、跨文件basisRefs/basisContext及linkedTo,保留限制条件和补疑覆盖;无需“施工组织设计”字眼才认可技术约束。关联原文未完整读取不能宣称语义已核。","sourceContextDirectory只对同一完整实际命中/邻文/父链去重;sourceContexts/contextRefs为其零基索引,全部位置及每原basis身份/关联均保留。不能把未定位源当文件开头;独审证据与范围只填目录from/through,程序按实际位置确定父链,不再提交parentNodeId。referenceIssues不能由独审修写或忽略,未解决只能unmeasured。","类别或候选主题只是召回标签,必须按完整quote逐项核验;不能因主题错配排除真实最低配置,也不能无具体candidateId和实际覆盖原句就臆称其他候选承接。□/●选项保持原意,不把未勾选的B证等资格选项硬化为项目要求。","原句混合技术最低配置/资格与商务具名、证书或社保提交时,逐维度区分技术资源响应和证明材料交付;完整quote不是全文逐字硬化入匿名正文的许可,也不能按商务材料归宿排除技术最低配置。","每项含排除决定都必须独立判断;accepted仅表示当前subject相关解释有原文支持,不能凭quote存在就接受语义。content审technicalContent,独立原表delivery未决不妨碍保留已核技术约束,不能因此伪填not-required;output另审交付强度/文件/原形式/阶段。当前subject所需维度错误或冲突disputed,依据不足或未决unmeasured。","按server给定target审查;回复身份和target由当前请求绑定,不需要抄写。technical-content只裁technicalContent、真实阶段/conditions和解释,不裁未提供的原表强度/位置/原格式;output-delivery只裁完整delivery,不因未提供的technicalContent改判。canonical完整值由server留存,current candidateHash绑定全体原值,本次接受不声称审过另一目标。","报价构成、费用计取范围、计取口径、调差边界、金额、费用保障、费用包含范围、费用综合考虑及费用台账/凭证管理属于商务或合同交付内容,不进入技术标正文:此类义务按technicalContent=not-applicable(content)或delivery.location=business-file(output)裁决。技术正文不得出现金额;费用类管理责任(台账/凭证)同样不在技术响应范围。","不得补填或改写候选维度,不得把disputed或unmeasured自行改成接受;以当前candidateId为decisions对象键,不在值中返回身份字段;evidence只从evidenceSelectionDirectory中选择,不得抄写或改写原文。","evidenceSelectionDirectory只列当前候选已绑定source/basis的冻结原字与可选ref;evidence/contentScope每项只填from(连续片段可加through,含末片段),只能同一候选同一组按顺序选择,整组ref只能单独选。程序按ref恢复原字与位置;不得抄写/改写quote、sourceFile、位置或parentNodeId。选择不等于批准。目录没有可选组时保持disputed/unmeasured,不得从邻文或全源补造。","**headingOnly(结构化标题声明,必须显式返回 true/false,不得省略)**:仅当原句本身只是章节标题/引导句、没有独立技术响应内容、具体技术约束在其后要点中时填 true;只要原句含对象、专业、措施、责任、验收或交付要求,即使以冒号结尾也必须显式填 false。它只供章要点投影识别非技术标题,不是批准,不能替代 disputed/unmeasured 判断。",...a.requireContentScope?["对每个accepted的technical-content结论返回contentScope。required-response/technical-constraint须在technical逐项列出本技术正文必须响应的全部技术要求,每项用from/through从该候选目录选择实际子句并给response;混合原文不得整段复制为技术响应。reference仅为可选参考:有可选技术响应时仍须按目录绑定;只有引导、索引等无独立响应内容时可technical为空,但excluded必须保留当前原句及不形成响应的理由,不能为通过校验编造强制技术要求。excluded逐项保存费用、报价、原表或其他文件责任的实际子句与理由。技术项与排除项不能引用重叠原句;不要删除同句里的施工措施、最低配置、工法或验收要求。not-applicable须technical为空且excluded有据;不能只在reason里写“费用不进入正文”却不给可执行范围。output-delivery不填contentScope。"]:[]]},v=a=>({...a.payload,target:(0,j.Vc)(a.candidate.item.applicability),scope:(0,j.Jw)(a.candidate.item.applicability)}),w=(a,b)=>({...u,...g(b.map(v)),evidenceSelectionDirectory:a.modelDirectory(b.map(a=>a.payload.candidateId))}),x=a=>w(t,a),z=a=>({kind:a.candidate.kind,sourceFile:a.candidate.item.sourceFile,quote:a.candidate.item.quote,..."element"in a.candidate.item?{element:a.candidate.item.element}:{}}),A=[],B=new Set,E=(a,b,c)=>{let d=`${a.candidate.candidateId}:${a.payload.candidateHash}`;b?.status!=="accepted"||b.candidateHash!==a.payload.candidateHash||b.target!==(0,j.Vc)(a.candidate.item.applicability)||c.valid||!c.issues.length||c.issues.some(a=>!a.correctable)||B.has(d)||(B.add(d),A.push({item:a,raw:b,issues:c.issues}))},G=(a,b)=>{let c=[...a.payload.sourceContexts,...a.payload.basisContext.flatMap(a=>a.contexts)],d=a=>{let{parentNodeId:b,...d}=a,e=b?c.flatMap(a=>[a.match,...a.parents]).find(a=>a.nodeId===b):void 0;return{...d,parentWasProvided:!!b,...e?{providedParent:e}:{},...b&&!e?{rejectedParent:"不在本候选实际相关命中/父链目录内,不能作为合法引用"}:{}}};return{...b,evidence:b.evidence.map(d),...b.contentScope?{contentScope:{technical:b.contentScope.technical.map(d),excluded:b.contentScope.excluded.map(d)}}:{}}},H=(b,c,d,e,f,g)=>{let h=b.candidate.item.applicability,i=(0,j.Vc)(h),k=c??{status:"unmeasured",target:i,candidateHash:(0,j.DB)(h),reason:f?`独立适用性审查未完成:${f}`:"独立适用性审查缺少唯一当前候选结论",evidence:[]},l=(0,j.RP)({applicability:h,sourceIndex:y,obligation:z(b),target:i,result:k,requireContentScope:a.requireContentScope}),m=(0,j.Oc)({applicability:h,sourceFiles:a.sourceFiles,sourceIndex:y,obligation:z(b),target:i,inputHash:d,result:k,requireContentScope:a.requireContentScope}),n=aw.get(h);return n&&aw.set(m,n),b.candidate.item.applicability=m,ao.push({candidateId:b.candidate.candidateId,candidateHash:(0,j.DB)(h),operation:e,inputHash:d,...c?{raw:structuredClone(c)}:{},...g?{selection:structuredClone(g)}:{},bindingIssues:l.issues,appliedStatus:m.review.status,...f?{error:f}:{}}),l},I=[],J=[];for(let a of s){let b=x([a]);if(ak(Z,b,N)>c){aq("tender-applicability-review",Z,b,N,"单个适用性候选及其完整依据超过审查输入预算,未派发"),H(a,void 0,(0,d.Fu)(b),u.version,"本候选与完整父链/关联原文超过单次审查输入预算,未截断、未读取,保持局部待核");continue}J.length&&ak(Z,x([...J,a]),N)>c&&(I.push(J),J=[]),J.push(a)}async function K(){let b=l(y,A.map(a=>({candidateId:a.item.payload.candidateId,applicability:a.item.candidate.item.applicability}))),e={...u,version:"tender-applicability-evidence-followup-v4",task:"仅对上次真实独审accepted但证据绑定未通过的当前子集重新独立审查;可自由接受、质疑或保持未测,不修改提案",rules:[...u.rules,"previousIndependentConclusion是原独审原始语义结论与引文,bindingFeedback是服务端确定的绑定失败;上次accepted不是应维持的答案。须重新核当前target并自由返回accepted/disputed/unmeasured,不能为通过程序而洗白解释或换用邻文。","原evidence及contentScope父引用以providedParent节点和parentWasProvided保留;该节点仅是原答复引用事实,并不获得合法父角色。应按当前锚域及实际parents选择证据,不能从providedParent推断其合法。只有本次一次补充审查,依据不足保持unmeasured。"]},h=a=>({...e,...g(a.map(a=>{let b=f(a.item.candidate);return{...v(b),previousIndependentConclusion:G(b,a.raw),bindingFeedback:a.issues}})),evidenceSelectionDirectory:b.modelDirectory(a.map(a=>a.item.payload.candidateId))}),j=[],k=[];for(let a of A.splice(0)){let b=h([a]);if(ak(Z,b,N)>c){let c=aq("tender-applicability-review",Z,b,N,"单个绑定失败候选与完整原结论/相关依据超过补充独审预算,不截断、不派发,保留未测");ao.push({candidateId:a.item.candidate.candidateId,candidateHash:a.item.payload.candidateHash,operation:e.version,inputHash:(0,d.Fu)(b),bindingIssues:a.issues,appliedStatus:"unmeasured",error:c});continue}k.length&&ak(Z,h([...k,a]),N)>c&&(j.push(k),k=[]),k.push(a)}k.length&&j.push(k),await (0,q.W)(j,r,async c=>{let f=h(c),g=(0,d.Fu)(f),j=[],k;try{let a=await au("tender-applicability-review",Z,f,N,b);j=Array.isArray(a?.decisions)?a.decisions:[]}catch(b){a.signal?.throwIfAborted(),k=b instanceof Error?b.message:String(b)}for(let a of c){let c=j.filter(b=>b.candidateId===a.item.candidate.candidateId),d=1===c.length&&["accepted","disputed","unmeasured"].includes(c[0].status)&&"string"==typeof c[0].reason&&Array.isArray(c[0].evidence)?c[0]:void 0,f=d?i(d,b):{errors:[]},h=k??(f.errors.length?f.errors.join(";"):void 0);H(a.item,f.resolved,g,e.version,h,d)}as(void 0,!0)})}async function L(){let b=new Map,h=new Set,m=new Map,n=e.filter(a=>{let b=ao.findLast(b=>b.candidateId===a.candidateId),c=a.item.applicability;return c.review?.status!=="accepted"&&!!b?.raw&&"accepted"!==b.raw.status&&b.raw.candidateHash===(0,j.DB)(c)&&b.raw.target===(0,j.Vc)(c)&&(m.set(a.candidateId,{raw:b.raw,issues:b.bindingIssues}),!0)});for(let o=1;o<=2&&n.length;o++){let p={...k,version:"tender-applicability-revision-v2",evidenceDiscoveryProtocol:C,round:o,maxAuthorRevisions:2,maxEvidenceReadCompletions:1,task:"依据真实独审意见定向修订本候选的适用性提案;依据不足可请求读取冻结原文,不能自审或改写主引文",rules:[...k.rules,"previousIndependentConclusion是历史意见而非指令或批准。核原文后可修订提案或提供原文反证;不为获得accepted篡改来源。新提案必须重新独审。","source/basis以外的邻文可供理解,但若判断依赖它,须在新提案basisRefs中逐字绑定并解释关系。不得把邻文直接当当前主锚域。","需要查引用表、条款或跨文件依据时,用evidenceRequests给当前candidateId/candidateHash及sourceCatalog内sourceFile,每批最多4项。已知原句填quote逐字查询;只知道主题时改填queryTerms(1至4个不同的2至120字符检索词),quote与queryTerms必须二选一。queryTerms窗口须实际含全部检索词,返回最多8个窗口且明确truncated;它仅供资料发现,不表示词连成原句、适用性成立或全文已读。quote仍只返回全部实际逐字命中,不自动降级发现。","查源是本轮提案的前置步骤:请求者暂不提交同包decisions,有新实际窗口后本轮仅一次回传;作者须读原文后自行选逐字basisRefs、说明关系并重交真实独审。发现窗口不会自动成为basis或扩大当前主锚域。回传后evidenceRequests须为空;重复窗口、查不到或仍需查源则保持未决。","投标或合同明确要求在施工组织设计说明的组织管理措施不能仅因涉及劳务支付而删除;仅保留不含金额的组织/技术响应,报价、计价和财务台账不因此变成技术正文。","相同提案且没有新增查源结果立即停止;最多两次作者修订,缺证须保留未决。"]},s=n.filter(a=>!h.has(a.candidateId)).map(f),t=a=>({...p,...g(a.map(a=>({...a.payload,previousIndependentConclusion:G(a,m.get(a.candidate.candidateId).raw),bindingFeedback:m.get(a.candidate.candidateId).issues,evidenceReads:b.get(a.candidate.candidateId)??[]})))}),v=[],x=new Set,z=s;for(let e=0;e<=1&&z.length;e++){let g=a=>({...t(a),evidenceReadCompletion:1===e}),i=[],k=[];for(let a of z){if(ak(Y,g([a]),P)>c){h.add(a.candidate.candidateId),ap.push({candidateId:a.candidate.candidateId,round:o,readTurn:e,semanticRevisionSubmitted:!1,status:"over-budget-not-dispatched"});continue}k.length&&ak(Y,g([...k,a]),P)>c&&(i.push(k),k=[]),k.push(a)}k.length&&i.push(k);let l=[];await (0,q.W)(i,r,async c=>{let i,k;try{i=await au("tender-applicability-proposal",Y,g(c),P)}catch(b){a.signal?.throwIfAborted(),k=b instanceof Error?b.message:String(b)}for(let a of c){let c=a.candidate.candidateId,g=a.payload.candidateHash;if(!i){h.add(c),ap.push({candidateId:c,round:o,readTurn:e,beforeHash:g,afterHash:g,semanticRevisionSubmitted:!1,status:k?"author-call-failed-stopped":"author-no-reply-stopped",...k?{error:k}:{},evidenceReads:structuredClone(b.get(c)??[])});continue}let m=(i?.evidenceRequests??[]).slice(0,4).filter(a=>a.candidateId===c&&a.candidateHash===g),n=(i?.decisions??[]).filter(a=>a.candidateId===c&&a.candidateHash===g),p=b.get(c)??[];if(m.length){let f=!1;if(0===e)for(let a of m){let b=(0,d.Fu)([y.sourceHash,a.sourceFile,a.queryTerms?["discovery",a.queryTerms.map(D).sort()]:["exact",a.quote]]);if(p.some(a=>a.requestKey===b))continue;let c=a.queryTerms?function(a,b,c){let d={version:C,sourceHash:a.sourceHash,queryTerms:[...c],status:"not-found",contexts:[],matchingWindows:0,truncated:!1,windowLimit:8,radius:1200,qualification:"discovery-only-not-bound-evidence"};if(!F(c)||!a.files.some(a=>a.filePath===b))return{...d,status:"invalid-request"};let e=c.map(c=>({term:c,contexts:(0,j.r8)(a,b,c,1200)}));if(e.some(a=>!a.contexts.length))return d;let f=[...e].sort((a,b)=>a.contexts.length-b.contexts.length||a.term.localeCompare(b.term))[0],g=new Set;for(let a of f.contexts){let c=e.map(b=>({term:b.term,context:b.contexts.find(b=>b.match.start>=a.start&&b.match.end<=a.end)}));if(c.some(a=>!a.context)||g.has(`${a.start}:${a.end}`)||(g.add(`${a.start}:${a.end}`),d.matchingWindows++,8===d.contexts.length))continue;let{start:f,end:h,quote:i,sourceTextHash:j}=a;d.contexts.push({sourceFile:b,sourceTextHash:j,start:f,end:h,quote:i,termMatches:c.map(a=>({term:a.term,match:a.context.match,parents:a.context.parents}))})}return d.truncated=d.matchingWindows>d.contexts.length,d.status=d.contexts.length?"discovery-windows-only":"not-found",d}(y,a.sourceFile,a.queryTerms):void 0,e=c?.contexts??(0,j.r8)(y,a.sourceFile,a.quote,1200),g=e.some(a=>!p.some(b=>b.contexts.some(b=>b.sourceFile===a.sourceFile&&b.sourceTextHash===a.sourceTextHash&&b.start===a.start&&b.end===a.end&&b.quote===a.quote)));p.push({...c??{query:a.quote,status:e.length?"matched-windows-only":"not-found",contexts:e},sourceFile:a.sourceFile,requestKey:b}),f||=g}b.set(c,p),f?l.push(a):h.add(c),ap.push({candidateId:c,round:o,readTurn:e,beforeHash:g,afterHash:g,semanticRevisionSubmitted:!1,status:f?"evidence-read-awaiting-author":1===e?"evidence-read-limit-stopped":"evidence-read-no-progress-stopped",evidenceRequests:m,deferredDecisions:n,evidenceReads:structuredClone(p)});continue}let q=1===n.length&&n[0].applicability?ax(a.candidate.kind,{...a.candidate.item,applicability:n[0].applicability}):void 0,r=q?(0,j.DB)(q):g;q&&r!==g&&(a.candidate.item.applicability=q,q.issues.length?x.add(c):v.push(f(a.candidate))),r===g&&h.add(c),ap.push({candidateId:c,round:o,readTurn:e,beforeHash:g,afterHash:r,semanticRevisionSubmitted:r!==g,status:r!==g?"revised-awaiting-independent-review":"no-progress-stopped",...q?.issues.length?{validationIssues:q.issues}:{},evidenceReads:structuredClone(p)})}}),as(void 0,!0),z=s.filter(a=>l.includes(a))}let A=[],B=[],I=l(y,v.map(a=>({candidateId:a.payload.candidateId,applicability:a.candidate.item.applicability}))),J=a=>({...w(I,a),version:"tender-applicability-revision-review-v2",rules:[...u.rules,"本轮是作者按历史反馈提交的新提案,只依据当前候选与实际原文独审,不沿用旧接受或质疑。明确要求施组说明的非金额组织管理措施须按原文判断,不按费用类标签整体删除。"]});for(let a of v){if(ak(Z,J([a]),N)>c){H(a,void 0,(0,d.Fu)(J([a])),"tender-applicability-revision-review-v2","完整修订依据超过审查预算,未派发"),h.add(a.candidate.candidateId);continue}B.length&&ak(Z,J([...B,a]),N)>c&&(A.push(B),B=[]),B.push(a)}for(let b of(B.length&&A.push(B),await (0,q.W)(A,r,async b=>{let c,e=J(b);try{c=await au("tender-applicability-review",Z,e,N,I)}catch{a.signal?.throwIfAborted()}for(let a of b){let b=(c?.decisions??[]).filter(b=>b.candidateId===a.candidate.candidateId),f=1===b.length&&["accepted","disputed","unmeasured"].includes(b[0].status)&&"string"==typeof b[0].reason&&Array.isArray(b[0].evidence)?b[0]:void 0,g=f?i(f,I):{errors:[]},h=H(a,g.resolved,(0,d.Fu)(e),"tender-applicability-revision-review-v2",g.errors.length?g.errors.join(";"):void 0,f);E(a,g.resolved,h)}}),as(void 0,!0),await K(),v)){let a=b.candidate.candidateId,c=b.candidate.item.applicability,d=ao.findLast(b=>b.candidateId===a);c.review?.status!=="accepted"&&d?.raw&&"accepted"!==d.raw.status&&d.raw.candidateHash===b.payload.candidateHash&&d.raw.target===(0,j.Vc)(c)?(m.set(a,{raw:d.raw,issues:d.bindingIssues}),x.add(a)):x.delete(a)}n=e.filter(a=>x.has(a.candidateId)&&!h.has(a.candidateId)&&a.item.applicability?.review?.status!=="accepted")}}async function M(){let b=e.map(f).filter(a=>a.payload.referenceIssues?.length),d={version:"tender-applicability-reference-repair-v1",sourceHash:y.sourceHash,task:"仅纠正当前候选确定的引用绑定错误,不重判适用性,不独审,不增删依据",rules:["仅返回给定candidateId/candidateHash的source父引用及按原index定位的basisRefs补丁;technicalContent/delivery/reason及basis的relation/explanation已冻结,不能修改。","source:{}表示省略父引用;唯一原句应省略。sourceContexts/contextRefs是sourceContextDirectory零基索引;目录只去重同一实际命中/邻文/父链,不合并basis身份或关联。多处原句仅按对应目录项parents消歧,match/原句节点不能冒充父角色。所有引用使用当前目录ref。","逐项按referenceIssues纠正非法parent、未定位引文、重复refId或悬空linkedTo。basisRefs索引来自实际原提案,不能增删或合并;未列出的索引保持原值。","引文只可保持原句或修到本次实际相关邻文内的逐字原句;不能凭目录补造未读新依据。linkedTo只能填source或本候选真实refId,不能填表名、主题或义务名。","sourceContexts和basisContext保留全部实际匹配位置,不按第一处猜测;仍无唯一依据时不要编造,服务端保留pending。每候选只有本次有界补丁,随后仍由独立审查判断业务解释。"]},h=a=>({...d,...g(a.map(a=>{let b=ag(a.payload.sourceContexts),c=a.payload.basisContext.flatMap(a=>{let b=ag(a.contexts);return b?[{index:a.index,...b}]:[]});return{candidateId:a.payload.candidateId,candidateHash:a.payload.candidateHash,source:{sourceFile:a.candidate.item.sourceFile,quote:a.candidate.item.quote},references:a.payload.requestedReferences,referenceIssues:a.payload.referenceIssues,sourceContexts:a.payload.sourceContexts,basisContext:a.payload.basisContext,...b||c.length?{parentRoleEvidence:{...b?{source:b}:{},basisRefs:c}}:{}}}))}),i=[],k=[],l=a=>({candidateId:a.payload.candidateId,beforeHash:a.payload.candidateHash,beforeRequested:structuredClone(aw.get(a.candidate.item.applicability)),issuesBefore:a.payload.referenceIssues.map(a=>a.message)});for(let a of b){if(ak(Y,h([a]),Q)>c){let b=aq("tender-applicability-proposal",Y,h([a]),Q,"单候选全部引用错误与实际邻文超过局部纠正预算,未截断/未派发,保留待核");an.push({...l(a),status:"over-budget",error:b});continue}k.length&&ak(Y,h([...k,a]),Q)>c&&(i.push(k),k=[]),k.push(a)}for(let b of(k.length&&i.push(k),i)){let c,d=[];try{let a=await au("tender-applicability-proposal",Y,h(b),Q);d=a?.repairs??[]}catch(b){a.signal?.throwIfAborted(),c=b instanceof Error?b.message:String(b)}for(let a of b){let b=l(a),e=d.filter(a=>a.candidateId===b.candidateId&&a.candidateHash===b.beforeHash);if(1!==e.length){an.push({...b,status:c?"failed":"not-returned",...c?{error:c}:{}});continue}try{let{source:c,basisRefs:d}=e[0],f=(0,j.D)({index:y,sourceFile:a.candidate.item.sourceFile,quote:a.candidate.item.quote,requested:b.beforeRequested,patch:{source:c,basisRefs:d}}),g=ax(a.candidate.kind,{...a.candidate.item,applicability:f});a.candidate.item.applicability=g;let h=(0,j.dY)({index:y,sourceFile:a.candidate.item.sourceFile,quote:a.candidate.item.quote,requested:f}).map(a=>a.message);an.push({...b,afterHash:(0,j.DB)(g),afterRequested:f,issuesAfter:h,status:h.length<b.issuesBefore.length?"repaired":"no-progress"})}catch(a){an.push({...b,status:"failed",error:a instanceof Error?a.message:String(a)})}}}}J.length&&I.push(J),await (0,q.W)(I,r,async b=>{let c=x(b),e=(0,d.Fu)(c),f=[],g,h=e;try{let a=await au("tender-applicability-review",Z,c,N,t);f=Array.isArray(a?.decisions)?a.decisions:[]}catch(b){if(a.signal?.throwIfAborted(),(g=b instanceof Error?b.message:String(b))&&/TENDER_REVIEW_WIRE_FOREIGN_REFERENCE|TENDER_EVIDENCE_SELECTION_/u.test(g)){let b=Array.isArray(c.rules)?c.rules:[],e={...c,rules:[...b,`上次回复因引用协议被拒收:${g}。只能使用当前候选 evidenceSelectionDirectory 中的合法短 ref 重出完整 decisions;不得复用其他候选的 ref,不得改写 quote/sourceFile/位置。`]};try{let a=await au("tender-applicability-review",Z,e,N,t),b=Array.isArray(a?.decisions)?a.decisions:[];b.length&&(f=b,g=void 0,h=(0,d.Fu)(e))}catch(b){a.signal?.throwIfAborted(),g=`${g};引用纠正重审仍失败:${b instanceof Error?b.message:String(b)}`}}}for(let a of b){let b=f.filter(b=>b.candidateId===a.payload.candidateId),c=1===b.length&&["accepted","disputed","unmeasured"].includes(b[0].status)&&"string"==typeof b[0].reason&&Array.isArray(b[0].evidence)?b[0]:void 0,d=c?i(c,t):{errors:[]},e=d.resolved,j=g??(d.errors.length?d.errors.join(";"):void 0),k=H(a,e,h,u.version,j,c);E(a,e,k)}}),as(void 0,!0),await K(),a.requireContentScope&&await L()}}},62369:(a,b,c)=>{c.d(b,{W:()=>d});async function d(a,b,c){let d;if(!Number.isSafeInteger(b)||b<1)throw Error("CONSTRUCTION_PARALLEL_LIMIT_INVALID");let e=Array(a.length),f=0,g=!1,h=Array.from({length:Math.min(b,a.length)},async()=>{for(;;){if(g)return;let b=f;if(f+=1,b>=a.length)return;try{e[b]=await c(a[b],b)}catch(a){g=!0,d=a;return}}});if(await Promise.all(h),g)throw d;return e}},68011:(a,b,c)=>{c.d(b,{G:()=>k});var d=c(73024),e=c.n(d),f=c(76760),g=c.n(f),h=c(77598),i=c(34933);let j=a=>(0,h.createHash)("sha256").update(JSON.stringify(a)).digest("hex");function k(a,b,c,d){let f=(0,i.x)(b),k=a=>{if(!/^[a-f0-9]{64}$/u.test(a))throw Error("当前模型响应缓存输入身份无效");return j({version:c,inputKey:a,model:f})};return{load(b){let d=k(b),f=g().join(a,`${d}.json`);if(!e().existsSync(f))return;let h=JSON.parse(e().readFileSync(f,"utf8"));if(h.version!==c||h.cacheKey!==d||j(h.response)!==h.responseSha256)throw Error("当前模型响应缓存身份或内容校验失败");return{response:h.response,receipt:{cacheKey:d,responseSha256:h.responseSha256,...h.originRunId?{originRunId:h.originRunId}:{}}}},save(b,f){let i=k(b),l=g().join(a,`${i}.json`);e().mkdirSync(a,{recursive:!0});let m=`${l}.${process.pid}.${(0,h.randomUUID)()}.tmp`;try{e().writeFileSync(m,JSON.stringify({version:c,cacheKey:i,responseSha256:j(f),response:f,...d?{originRunId:d}:{}})),e().renameSync(m,l)}finally{e().rmSync(m,{force:!0})}}}}}};