The truth, the whole truth, and nothing but the truth. These are mighty words. They are hardwired into our very notion of justice. Telling the truth is the central pillar of the scientific and rational order, on which we depend. Without it, tyrants will rule, fraudsters prosper, and fake news will triumph. But is telling the whole truth invariably the right course to follow?

This uncomfortable question is posed in JB Priestley’s debut play, Dangerous Corner, written in 1932, which I saw recently. When the curtain rises, three prosperous middle-class English couples are listening to the end of a radio play called The Sleeping Dog. As they relax over post-dinner drinks, one of the characters makes a casual remark. This apparently innocuous comment triggers a whole succession of revelations. By the play’s end, it has caused everyone’s relationships to unravel in spectacular and sometimes violent fashion. Beneath the characters’ apparently settled and successful lives, it turns out, there is their own sleeping dog: the truth.

The peace process has been made possible by a deliberate reluctance to reveal the truth when it suits a larger interest

Priestley’s message is unsettling. His play is partly an attempt to expose the veneer of contentment and prosperity that overlay middle-class life in the traumatised post-first world war England in which he wrote. But it is also a reminder that this is an enduringly difficult subject, and that in some respects the Bible may have got things wrong. In many circumstances, the truth can indeed set you free. In others, however, it can make life impossible.

This is a hard thought for liberals. Liberal societies have always passionately embraced the virtue of revealing the unvarnished truth, especially if it has been buried away beneath the surface of events. The modern era’s more highly developed awareness of the traumatic impact on survivors and families has added to that passion for openness and the casting of light on present and past events.

As a result, ours is the era of freedom of information, of public inquiries into contemporary and historic tragedies, of cathartic truth-finding and the celebration of the truth teller. After such outrages as the Hillsborough disaster, Stephen Lawrence’s murder, Jimmy Savile’s child abuse and the Grenfell Tower fire, we rightly demand that the facts come out, the truth be established and justice be done.

Overwhelmingly, that is the right course. But here is the difficult bit. That’s not always the case in all circumstances. Sometimes there are exceptions. And maybe the exceptions are justified too.

Few people would dispute that, for all its frailties, the Northern Ireland peace process was and remains a great and necessary public achievement. The leaders and officials who devised it and brought it into being are rightly esteemed for their vision, their ingenuity and their dedication. Ordinary life in Northern Ireland and across these islands is unquestionably the better for it. An understanding that the peace process is too precious to be allowed to fall apart lies at the heart of the unresolved Brexit argument about the Irish border.

Facing up to the truth, including the truth about the past, was indeed a difficult task during the Troubles. The failure to do it helped to feed the conflict. Learning to face up to the truth therefore played a great part in the 1998 peace deal. The setting up of the Bloody Sunday inquiry, under Lord Saville, for example, was the pivotal public precondition for the wider process that then came to fruition in the Good Friday agreement. Saville’s vindication, in 2010, of the nationalist case against the British army on Bloody Sunday was itself a major political event. It showed that the inquiry’s painstaking openness and thoroughness had been able to reach a truth that had been denied and covered up during the Troubles themselves.

Yet at the same time the peace process has also been made possible by a deliberate reluctance to reveal the truth when it suits some larger interest, such as peace and order. Ideally, of course, this would not happen. Liberals will be uncomfortable with the thought that it might ever happen. And it should be conceded that the fact such exceptions are sometimes made means the edifice of agreement is weakened by their exclusion. Yet some sleeping dogs can be a price worth paying.

Anyone walking towards the Conservative party conference secure zone earlier this month will have encountered a protest, which has grown larger over the years that such conferences have been taking place in Birmingham. The protest’s target is the failure to bring charges against IRA bombers who killed 21 local people in the city in two massive explosions in November 1974. The Birmingham bombings were the worst act of terrorism in Britain since 1945. But history and politics – including the judicial debacle of the wrongful conviction of the Birmingham Six after the explosions – have conspired to leave the true bombers unpunished and government unresponsive to calls to bring the right people to justice. On one level, this is a moral disgrace. But from another, more worldly, perspective it is the sort of grubby exception that may have to happen.

A ‘precious union’? The Brexiters don’t care about Northern Ireland | Fintan O’Toole Read more

This week, Theresa May has been faced with a powerful lobby from a very different direction on a very similar issue. The pressure this time comes from Conservative parliamentarians and newspapers campaigning against plans to investigate criminal allegations against British soldiers serving in Northern Ireland and other past conflicts, including Iraq. More than 150 Tory MPs and peers want May to drop the government’s commitment – itself partly the product of the peace process – to investigate such crimes. The issue came up again at prime minister’s questions today.

So, which is the right course of action? Is it right that every last British soldier who ever acted illegally in Northern Ireland a generation or more ago should be chased down by due process and held to account in their retirement? The nationalist side says justice requires it; the veterans say it is against all justice. But is it right that every former IRA active service unit member who shot a soldier or a Protestant for no reason other than they were a soldier or a Protestant must be brought to court in the same way? Yes, say the victims; no, say the republicans.

In the end, we have to put up with the best version of the truth that we can manage. Some dogs may be allowed to sleep on. It’s not virtuous or tidy that this has to be permitted. But history cannot be rewritten. With luck, we can learn from it and avoid some of the mistakes of the past. It is a lot easier for a playwright, such as Priestley. In a brilliant trick at the end of Dangerous Corner, the stage lights dim, then come back up to disclose the same characters back in their original after-dinner setting. This time, however, the fateful casual remark is overtaken by a radio music programme. As the curtain falls, the characters are not destroying one another. This time, they are dancing. Unfortunately, politics is not like that.

• Martin Kettle is a Guardian columnist