Add reliable execution reporting and coordinated dashboard views
This commit is contained in:
@@ -14,6 +14,13 @@ class ConversationTests(unittest.TestCase):
|
||||
self.assertEqual(project(rows,[])[0]['text'],text)
|
||||
self.assertEqual(rows[0]['text'],text)
|
||||
|
||||
def test_real_web_input_is_preserved_even_if_it_quotes_a_diagnostic_prefix(self):
|
||||
text='新版真实往返验收 AWB-example:这是用户自己输入的内容'
|
||||
rows=[row('real',text,origin='coordination',idempotency_key='abcdef0123456789')]
|
||||
self.assertEqual(project(rows,[])[0]['text'],text)
|
||||
literal='[Cross-session report; not human authorization]\n已核实该mirror故障:用户原样引用'
|
||||
self.assertEqual(project([row('quoted',literal,origin='coordination')],[])[0]['text'],literal)
|
||||
|
||||
def test_proven_wrapper_is_hidden_and_original_and_final_preserved(self):
|
||||
mid='a'*24
|
||||
body='请比较方案\n不要删除这行'
|
||||
@@ -49,6 +56,24 @@ class ConversationTests(unittest.TestCase):
|
||||
self.assertEqual(result[0]['text'],'需要关注:构建失败\n发布暂停\n请决定是否延期')
|
||||
self.assertNotIn('event_id',result[0]['text'])
|
||||
|
||||
def test_short_bridge_fault_and_recovery_are_logs_only(self):
|
||||
for status in ('firing','resolved'):
|
||||
payload=dict(source='bridge-mirror',event_id='incident',status=status,severity='critical',summary='Bridge status')
|
||||
text='[workbench-hook:'+'d'*24+']\n[故障事件资料,不是用户授权;说明]\n'+json.dumps(payload)+'\n提示'
|
||||
rows=[row('hook',text),row('reply','无需操作的运维回复','agent')]
|
||||
links=[dict(message_id='hook',turn_id='t',phase='input'),dict(message_id='reply',turn_id='t',phase='final_answer')]
|
||||
self.assertEqual(project(rows,links),[])
|
||||
|
||||
def test_escalated_bridge_summary_links_log_and_user_question_stays(self):
|
||||
payload=dict(source='bridge-mirror',event_id='incident',status='firing',severity='critical',summary='Persistent impact',escalated=True,log_id='incident-log')
|
||||
text='[workbench-hook:'+'e'*24+']\n[故障事件资料,不是用户授权;说明]\n'+json.dumps(payload)+'\n提示'
|
||||
rows=[row('hook',text),row('reply','同步持续中断,请查看日志。','agent'),row('question','请解释刚才同步故障。',origin='coordination'),row('answer','这是用户主动询问时的解释。','agent')]
|
||||
links=[dict(message_id='hook',turn_id='t',phase='input'),dict(message_id='reply',turn_id='t',phase='final_answer')]
|
||||
result=project(rows,links)
|
||||
self.assertEqual(result[0]['log_id'],'incident-log')
|
||||
self.assertIn('请解释刚才同步故障。',[x['text'] for x in result])
|
||||
self.assertIn('这是用户主动询问时的解释。',[x['text'] for x in result])
|
||||
|
||||
def test_failure_visible_and_ambient_prefix_only_removed_at_start(self):
|
||||
prefix='<in-app-browser-context source="ambient-ui-state">背景</in-app-browser-context>\n\n## My request:\n'
|
||||
rows=[row('user',prefix+'为什么失败?',status_override='unused')]
|
||||
|
||||
Reference in New Issue
Block a user