Fiscal framework: deal sealed to cement new powers
And so a deal has been done on the fiscal framework which accompanies planned new tax powers for Holyrood.
At the outset of the day, John Swinney, the finance secretary, had looked and sounded rather gloomy - he would probably say realistic - about the prospects of an agreement.
But, after a day of detailed negotiation behind the scenes, agreement was reached. And Nicola Sturgeon permitted herself a smile as she said that the agreement would not cut a penny from Scotland's budget.
Both sides had an incentive to reach agreement.
The Scottish government, because it might have been hard to explain why they were seemingly rejecting a plan for new Holyrood tax powers.
The UK government, because they favour a narrative which says that Scotland is gaining more responsibility for tax - and, hence, it is implied, reducing any requirement for support from London. An implication naturally rejected by Scottish ministers.
So who has given ground? The Scottish government has had to compromise. They have gained less than they wanted in terms of cash to assist the implementation of the new powers, including welfare powers.
They have been obliged to concede that there will be independent scrutiny of Scotland's fiscal position in the run up to the proposed review which will take place in six years time - five years from next year's deployment of the new tax powers.
That was a key Treasury demand - although perhaps not one that it was particularly hurtful for Mr Swinney to concede.
And the Scottish government has accepted that it will be, technically, the Treasury model which is used for operating the fiscal framework. Albeit that model will be altered so that it generates exactly the same outcome as the Scottish government's favoured approach of Per Capita Index Deduction.
Already Liberal Democrats are saying that is an error by Scottish ministers - that it will be difficult to escape the Treasury model, even the reformed version, once it is in place. That it might, in short, prove costly in the longer term.
In response to which, Scottish ministers point to the concessions made by the Treasury, notably that the review after six years will be conducted between the two governments, based on independent data.
It will not, in sum, involve a presumption of a default to the full, unvarnished Treasury scheme. Scottish ministers had said that would cut some £2.5bn from Scotland's budget over a decade.
The Treasury has also conceded that there will be "no detriment" attaching to Scotland's budget during the six year period.
The gain for the Scottish government? New tax, welfare and borrowing powers for Holyrood - and avoiding any suggestion that they were thwarting the same: which might have been difficult to explain to voters.
The big gain? An end to any immediate suggestion of an automatic cut in Scotland's budget resulting purely from devolution. Cuts there may be - either from further Treasury stringency or from declining Scottish tax revenue. But not from the process of devolution. As Smith specified.
That plus that review formula.
The gain for the UK government? The prime minister can say, with justification, that he has now delivered upon the pre-referendum vow. It might have been politically awkward otherwise.
Secondly, the PM and the Chancellor can now pursue the responsibility narrative noted earlier.
Tonight's deal opens a new phase in Scottish politics. One which will feature substantially during the Holyrood election campaign.