优化:未分类连续维护与柏拉图预汇总,同步已发布修复

This commit is contained in:
2026-11-01 12:40:50 +08:00
parent 572873c6b8
commit 38290f5fec
135 changed files with 17613 additions and 663 deletions
+17 -2
View File
@@ -28,10 +28,15 @@ class NativeAnswerGateTests(unittest.TestCase):
body = json.loads(self.rfile.read(int(self.headers['Content-Length'])))
owner.calls.append(body)
reviewing = body['messages'][0]['content'].startswith('逐句核验证据')
payload = json.loads(body['messages'][1]['content'])
content = ({'reviews': [{'index': 0, 'supported': True}]} if reviewing else
{'blocks': [{'text': '本期正式率低于基期,需要继续核查阶段差异。',
'factIds': ['F1'], 'claimType': 'inference'}],
'summarySelection': {'leadIndex': 0, 'evidenceIndexes': []}})
if 'draftBlocks' in payload:
content = {'reviews': [{'sourceId': block['sourceId'], 'role': 'core',
'factIds': ['F1'], 'supported': True, 'statisticalClaimsSupported': True}
for block in payload['draftBlocks']], 'missingGoalDescriptions': [], 'visualIds': []}
if owner.malformed_synthesis and not reviewing:
content = 'invalid composition'
data = json.dumps({'model': 'fixture-model', 'choices': [{'finish_reason': 'stop',
@@ -70,10 +75,20 @@ class NativeAnswerGateTests(unittest.TestCase):
self.provider.server_close()
self.thread.join(timeout=1)
def synthesize(self):
def synthesize(self, draft=None):
# No mocked opener: the finalizer, HTTP gate and upstream all run.
return synthesize_native(base_url=self.base, api_key='fixture-gate-key', model='fixture-model',
question='解释质量变化', evidence=evidence(), cancel_event=self.cancelled)
question='解释质量变化', evidence=evidence(), cancel_event=self.cancelled, native_answer=draft)
def test_finished_draft_is_reviewed_once_with_same_thinking_and_authorization(self):
result = self.synthesize('综合合格率95.00%,低于基期96.00%。')
self.assertTrue(result['evidenceSufficient'], result['missingEvidence'])
self.assertEqual(len(self.calls), 1)
self.assertEqual(result['compositionDiagnostics']['modelPhases'], ['native_draft_review'])
self.assertEqual(self.calls[0]['thinking'], {'type': 'enabled'})
self.assertEqual(self.calls[0]['reasoning_effort'], 'high')
self.assertEqual(self.gate.rejected_stale_requests, 0)
self.assertEqual({event['phase'] for event in self.events}, {'finalizing'})
def test_synthesis_and_review_use_authorized_finalizing_phase_without_native_marker(self):
result = self.synthesize()