They are the Cinderellas of law enforcement.

Trading standards officers have on the front line of keeping Scots safe from everything from rip-off builders to gangsters peddling legal highs.

But the increasingly endangered species of professionals does so with nothing like the resources enjoyed by their police allies in the war on organised crime.

Two years ago Audit Scotland pointed the finger for the decline of their service - seen as vital to the operation of a free and fair market - on local councillors.

The watchdog said trading standards had "a low profile among councillors and senior managers and have experienced greater than average staff reductions in the last four years".

Scroll forward to 2015 and the service has faced even more cutbacks and neglect. Yet suddenly it has the attention of councillors and officials. Why? Because there is a coming "bunfight", says sources, over who should be responsible for them.

Trading standards used to come under the old regional councils, each of which was able to field significant resources. Split up in the nineties, they ended up in some very small single-tier authorities. The result? Some cross-border co-operation but a pretty incoherent and inconsistent system of local service for a retail and service industry that ceased to be local decades before. Glasgow, for example, did not want to "subsidise" suburban consumers ripped off in city stores by dealing with their complaints. And who do you complain to if you are cheated online? A local service geared to local shops.

Ahead of the independence referendum, the SNP Government came up with a plan for a national consumer protection and competition agency. Which was, of course, exactly what an independent Scotland would need. Then there was talk of devolving more powers to Scotland on consumer rights. But that isn't going to happen.

Cue Cosla concern that the SNP will centralise powers they currently have. A briefing paper prepared for the umbrella group for councils was explicit about what it sees as a risk. "Left with the commitment to an agency with potentially limited powers, there has to be the possibility that the government seeks to suck powers from elsewhere," it author said. True, the Cosla paper acknowledges that the SNP hasn't yet suggested what it called the "extreme" option of a national service.

But it admits things can't stay the same as they are. Because the service isn't working. Insiders confess they can't even carry out simple surveillance on rogue traders. Over time, they say, crooked business people will become more and more brazen. Some trading standards experts do believe in a national one-stop shop to stop the rot.

However, SCOTTS, which represents trading standard chiefs, is recommending something of a return to the old regional model. But that would mean councils agreeing on staffing, funding and locations.

Peter Adamson, deputy chairman of SCOTSS, acknowledge problems with this. "We recognise that there are significant barriers to setting up shared services and that several previous ad-hoc attempts have failed.

"Any future attempts to share services are only likely to succeed through a coordinated approach with collective support from local authorities and other stakeholders."

Mr Adamson, who runs trading standards in Moray, stressed the value of the service.

He said: "The work is often unseen and can be taken for granted.

"For example, motorists assume they get the correct measure when filling up. Failure to maintain the service may go unnoticed for a while; however, in the longer term the criminal and reckless minority of traders will prosper at the expense of consumers and legitimate traders."

Trading standards departments often offer consumer advice service too - almost all of the legislation for which comes from the EU. It was Euroepan rules that forced the Conservatives to upgrade consumer law in the 1980s. But enforcement and advice infrastructure has been ad-hoc ever since. A Scottish Government spokesman insisted a single consumer agency would put consumers first.

He said: “We will create a single consumer body to provide high quality, efficient and consumer-friendly advice and protection, taking Scottish specific issues into account in a way that the current fragmented UK arrangements have failed to.

"We will also establish a robust system of consumer redress that is comprehensive, effective and widely used, so that when things do go wrong, Scottish consumers are able to seek appropriate remedy."

That response did not say that council trading standards would be merged in to the new agency. Asked if the government was satisfied Scotland had enough such officers, the spokesman replied: "We will continue to work with local authorities to ensure there are adequate levels of trading standard officers in Scotland."