@@ -20,11 +20,17 @@ function call(
2020 } ;
2121}
2222
23- function identity ( prompt = "prompt" ) {
23+ function identity (
24+ prompt = "prompt" ,
25+ profile : { name : string | null ; fingerprint : string | null } = {
26+ name : null ,
27+ fingerprint : null ,
28+ } ,
29+ ) {
2430 return {
2531 prompt,
26- profileName : null ,
27- profileFingerprint : null ,
32+ profileName : profile . name ,
33+ profileFingerprint : profile . fingerprint ,
2834 provider : "codex" as const ,
2935 model : null ,
3036 effort : null ,
@@ -33,6 +39,42 @@ function identity(prompt = "prompt") {
3339 } ;
3440}
3541
42+ {
43+ const replay = createWorkflowReplay ( [
44+ call ( {
45+ callIndex : 0 ,
46+ cacheKey : "profile" ,
47+ profileName : "reviewer" ,
48+ profileFingerprint : "fp-1" ,
49+ } ) ,
50+ ] ) ;
51+ const miss = replay . decide (
52+ 0 ,
53+ "profile-name-changed" ,
54+ identity ( "prompt" , { name : "implementer" , fingerprint : "fp-1" } ) ,
55+ ) . miss ;
56+ assert . equal ( miss ?. reason , "identity_changed" ) ;
57+ assert . deepEqual ( miss ?. changedFields , [ "profileName" ] ) ;
58+ }
59+
60+ {
61+ const replay = createWorkflowReplay ( [
62+ call ( {
63+ callIndex : 0 ,
64+ cacheKey : "profile" ,
65+ profileName : "reviewer" ,
66+ profileFingerprint : "fp-1" ,
67+ } ) ,
68+ ] ) ;
69+ const miss = replay . decide (
70+ 0 ,
71+ "profile-fingerprint-changed" ,
72+ identity ( "prompt" , { name : "reviewer" , fingerprint : "fp-2" } ) ,
73+ ) . miss ;
74+ assert . equal ( miss ?. reason , "identity_changed" ) ;
75+ assert . deepEqual ( miss ?. changedFields , [ "profileFingerprint" ] ) ;
76+ }
77+
3678{
3779 const replay = createWorkflowReplay ( [
3880 call ( { callIndex : 0 , cacheKey : "k0" , returnValueJson : JSON . stringify ( "a" ) } ) ,
0 commit comments