It was a welcome move, yet a surprise one, when Narendra Modi invited Nawaz Sharif, along with other heads of SAARC states, to his swearing in as India's 14th prime minister on 26 May 2014.
Nawaz Sharif's 2014 visit, which included a bilateral meeting, was a signal that Modi wanted to start on a fresh note as India's prime minister, and have an engagement. This signalled, it seemed, a break from Modi's past of being hawkish on Pakistan.
Since then, Modi's Pakistan policy has appeared confused, as if it was a matter of policy to not have a policy. There's another way to read it: to maintain an element of surprise.
Thursday morning's "surgical strike" -- a cross-LoC raid against terrorists -- was another such surprise move. For about ten days after the terrorist attack in Uri, Modi had appeared to bring down tensions, exploring strong diplomatic options and bringing down public expectations of an all-out war.
True, he kept saying the army would give a befitting reply for Uri, but he appeared to be selling strategic restraint at the same time when he said the war was economic, and India was already winning it.
It may well be that that was a deliberate smokescreen to add an element of surprise to the Thursday morning strike by paratroopers inside Pakistan-held territory.
After the invitation to Sharif in May 2014, Modi surprisingly went cold on Pakistan as cross-LoC firing increased. It was the time of the Jammu & Kashmir elections, and the BJP did not want to be seen as being reconciliatory towards Pakistan. That would have impeded their efforts to win votes in Hindu-dominated areas of the Jammu region.
At the SAARC summit in Kathmandu in November 2014, the two leaders barely shook hands, but journalist Barkha Dutt revealed later in her book that they had met privately. Modi again took everyone by surprise by restarting talks with Pakistan in Ufa in July 2015, on the sidelines of the SCO summit.
As terror attacks continued, one in Gurdaspur made India cancel NSA-level talks in July 2015. In August, Pakistan's NSA Sartaj Aziz was to visit Delhi but the Modi government sprung another surprise. It said the talks would not take place if Aziz met Kashmiri separatists. This was a new red line the government was drawing.
Visiting Pakistani officials had always had the ritual meeting with Kashmiri separatists before holding talks with the Indian government. Aziz cancelled his visit. After Pakistan's high commissioner Abdul Basit met Kashmiri separatist leaders, New Delhi also called off secretary-level talks.
Doval and Aziz then met in Bangkok in December 2015. Thereafter, Sushma Swaraj met Sharif and Aziz in Islamabad ahead of the Heart of Asia conference. On 25 December, Modi sprung another surprise, visiting Lahore on his way back from Kabul, to attend the wedding of Nawaz Sharif's grand-daughter.
Usually it is terrorism from Pakistan that acts as an unpredictable, surprise element, halting talks at will. But Modi's attitude towards dealing with Pakistan has been to avoid being dictated by the Pakistani establishment, and trying to seize charge of the relationship.
Modi's Lahore visit was followed by a terrorist strike in Pathankot exactly a week later, but New Delhi didn't go into its usual huddle of suspending talks. As Sharif condemned the attack and offered co-operation in investigation, the Modi government took it up. Talks formally collapsed only in April when Pakistan refused to allow India's National Investigation Agency to visit Pakistan to pursue the investigation.
When militant Burhan Wani was killed in Kashmir, a popular uprising was forcefully put down by India. Pakistan's noises over human rights violations in Kahsmir made India react strongly. The Uri attack, coming after this background of unrest in Kashmir, finally became the moment of truth for Modi. He was now in the same situation in which Indian prime ministers have often found themselves in. Military action against Pakistan seems impossible without escalation, and no action discredits the prime minister before the media.
Seeking to de-escalate tensions in Kozhikode while special forces were planning a cross-LoC raid on terrorists in Kahsmir, was another one of Modi's surprises. It's very likely there will be more.