Reconcile proven completed inputs without replay and hide internal fact notices
This commit is contained in:
@@ -204,6 +204,20 @@ class WorkflowTests(unittest.TestCase):
|
||||
self.assertEqual((notice['target'],notice['decision']['session_thread_id']),('decision',THREAD))
|
||||
self.assertEqual(self.store.decision_get('choice')['status'],'open')
|
||||
self.assertFalse(any(e['kind']=='review' for e in self.store.decision_history('choice')['history']))
|
||||
from agent_control.notices import fact_answer_notice
|
||||
text=fact_answer_notice(notice)
|
||||
self.store.mirror(dict(session_id='consult',thread_id=THREAD,items=[
|
||||
dict(id='fact-input',source='human',text=text,turn_id='fact-turn',phase='input'),
|
||||
dict(id='fact-final',source='agent',text='Fact explanation',turn_id='fact-turn',phase='final_answer')]))
|
||||
# ACK does not remove immutable provenance used for history projection.
|
||||
self.store.decision_ack(dict(notification_id=notice['notification_id']))
|
||||
self.assertEqual([r['text'] for r in self.store.conversation('consult')],['Fact explanation'])
|
||||
self.assertEqual(len(self.store.messages('consult')),2)
|
||||
other_thread='00000000-0000-4000-8000-000000000002'
|
||||
self.store.session(dict(id='unrelated',name='Other',thread_id=other_thread))
|
||||
self.store.mirror(dict(session_id='unrelated',thread_id=other_thread,items=[
|
||||
dict(id='literal',source='human',text=text)]))
|
||||
self.assertEqual(self.store.conversation('unrelated')[0]['text'],text)
|
||||
|
||||
def test_queue_health_reads_workflow_outbox_and_submission_markers(self):
|
||||
initial=self.store.queue_health()['decisions']
|
||||
|
||||
Reference in New Issue
Block a user