How will Thailand's amnesty bill row end?
Over the past two weeks, a period of relative calm in Thai politics has been shattered.
Tens of thousands of demonstrators have taken to the streets of Bangkok in a striking echo of previous protest movements that, over the last decade, have led to a military coup, the occupation of the main international airport, the court-ordered resignation of two prime ministers and a military operation in Bangkok in 2010 that cost more than 90 lives.
Those years of turmoil surrounding the figure of former Prime Minister Thaksin Shinawatra left Thailand shocked and exhausted in 2010.
For the past three years there has been little appetite for confrontation. Efforts by hard-line royalists to rally demonstrations against the government of Mr Thaksin's sister, Prime Minister Yingluck Shinawatra, went nowhere.
All that changed last month when Mr Thaksin's party, Pheu Thai, suddenly expanded a modest amnesty proposal, which initially covered only ordinary people charged for involvement in past protests, to a sweeping absolution for all convictions related to political conflicts dating back to 2004.
It appeared to overturn not only Mr Thaksin's own 2008 conviction for abuse of power, but also to absolve those responsible for ordering the military to open fire on his supporters in 2010.
Thailand's commission for fighting corruption has estimated that 25,331 cases of corruption might be affected by the proposed amnesty.
Just about the only convictions not covered by the amnesty were the hundreds of people prosecuted under Thailand's severe lese majeste law.
Crucially, it appears to open the door for Mr Thaksin to return from more than five years in exile.
The protests this time have been passionate and wide-ranging. Opposition has come from academics, judges, doctors and nurses, students, office workers, as well as more long-standing Thaksin opponents in the opposition Democrat Party and from the yellow-shirt groups that helped unseat him and his allies between 2006 and 2008.
There have been noisy lunch-break demonstrations in Bangkok's business district, and a sit-in at Democracy Monument in the old royal quarter, as well as many smaller protests.
Even some in the red-shirt movement that has campaigned in support of Mr Thaksin have now come out against this bill.
"This is about much more than party politics. It's about defeating a law that has united the country in opposition to it", said Korn Chatikavanij, a former finance minister who resigned from the deputy-leadership of the Democrat Party so that he could help organise the protests.
Suddenly the Democrats, who have been unable to defeat Pheu Thai in elections or in parliament, have found themselves at the head of a swelling mass movement, much of it calling for the government to be thrown out.
Resolution of the issue, though, still rests with parliament, notwithstanding the deep disenchantment of the government's opponents with Thailand's messy democracy.
Having been rammed through the lower house, comfortably dominated by the Pheu Thai party and its allies, the amnesty bill has now gone to Thailand's much-maligned upper house, or Senate, for approval.
Over the past decade the Senate has done little to fulfil its constitutional role as a check on the actions of the lower house.
Under the governments of Thaksin Shinawatra, from 2001 to 2006, it was a fully elected body.
But the overweening influence of Mr Thaksin's party, and the tendency of powerful political figures to find relatives or proxies to run as Senate candidates, rendered the upper house almost toothless.
After the 2006 coup the new constitution turned the Senate into a semi-appointed body, in the hope of diluting the influence of political parties. But it has still rarely challenged the incumbent government.
Much the same was expected to happen with the amnesty bill. But the Senate president has already announced that most senators will reject the bill in its current form.
Whether this defiance is down to the escalating public opposition to the bill or to the convictions of the senators themselves is not clear. They are due to start debating it on 8 November.
If that happens, the bill must go back to the lower house, which cannot re-present it, or an alternative, for 180 days.
In a statement on 5 November Ms Yingluck said she would leave the bill to the senators' judgement and that the government would respect their verdict.
All the signs are that the Pheu Thai party is heading for a humiliating retreat.
How did a party with a commanding majority in parliament, that has pushed its populist agenda so confidently since coming to office, get this so wrong?
It is clear that this bill was Mr Thaksin's doing. Throughout her premiership Ms Yingluck has been overshadowed by accusations that she is a mere puppet, and that all the key decisions are made by her brother.
Those accusations have not always been justified, and her conciliatory governing style has won her praise even from her opponents.
But on the amnesty, the most contentious and personal issue she has grappled with, she has not even pretended to take decisions.
She chose to be absent from parliament when it approved the bill, and has stated that it is the party, not her, who wanted it.
Meanwhile Mr Thaksin, from exile, has given interviews insisting that such a sweeping amnesty was the best way forward, that it would reset the country back to zero, wiping out all the conflicts that started during his time in office.
The effect has been the opposite. The stark polarisation of Thai society is once again in full view.
And the broad spectrum of opposition to the amnesty, albeit mainly in Bangkok, has uncomfortable similarities to the protests in early 2006 that forced Mr Thaksin, then prime minister, to call an early election, events that led eventually to the September coup.
Back then he badly miscalculated the public reaction to the sale, at great profit to his family, of his company, Shin Corp. It looks like he has overplayed his hand once more.
There are some important differences, though.
This time, the Pheu Thai party has been working hard to build a good relationship with the royalist upper echelons of the military.
The sometimes outspoken army commander General Prayuth Chan-ocha has been conspicuously quiet about the amnesty and the protests. Another coup seems very unlikely.
Nor is the hard-line yellow-shirt movement, the essential core of any long-term street movement to pressure the government, what it was.
It has fragmented, and if government concessions take the steam out of the protests, it is hard to see how they will keep up their momentum.
That, then, will present the Democrat Party, which has been riding high for the past two weeks, with its old dilemma; how to beat Mr Thaksin, whether he is in or out of the country, in a general election.
It is a dilemma to which Thailand's oldest political party still has no answer.