Two things happened this week that may come to shape Stephen Harper's leadership, both at home and on the world stage, as he gets set to attend this weekend's G20 summit in Australia.

The first happened Wednesday when Finance Minister Joe Oliver confirmed that the federal budget is back in surplus for the first time since 2008, when Harper agreed to run the biggest budget deficit in Canadian history to try to stimulate the economy out of a global recession.

Canada becomes one of the first countries to return to fiscal health, a point of pride and of influence as another conservative prime minister, Tony Abbott of Australia, tries to focus this year's G20 leaders on the path of lowering taxes, eliminating deficits and reducing trade barriers in the hope of boosting economic growth.

These are all Harper values, ones he relentlessly pursued largely without political cost, though every federal agency and many others groups paid a price.

The Conservatives strictly controlled spending across government, in the process reducing and in some cases eliminating funding to agencies and non-profit groups that didn't fit into Harper's agenda.

At the same time, in eliminating the deficit without raising taxes, Ottawa capped but did not cut transfers to the provinces for health, social programs and post-secondary education.

The government also created the Building Canada Fund to sustain investments in crucial infrastructure like roads and bridges.

Is it enough? Provincial and municipal politicians will say no, but that's the nature of the relationship. The fact is there are tens of billions of dollars available in the coming years to do this needed work.

The goalposts shift on climate change

And then there's the other thing that happened this week, a challenge that will be much trickier for Harper to manage because it will play not only a role in defining where he has been as a leader, but where he still has to go heading into an election year.

This week's surprising climate-change deal between the U.S. and China offers Harper a choice.

He can continue, as he always has, to argue that the work to reduce carbon emissions must be done without damaging the fragile economic recovery.

Harper Abbott 20141022

Australia's Tony Abbott and Canada's Stephen Harper in Ottawa in June 2014. No fans of "job-killing carbon taxes" here. (Adrian Wyld / Canadian Press)

On that he has important supporters in Brisbane, including G20 chair Tony Abbott.

Abbott was in Ottawa in June, when he and Harper both ridiculed efforts to put a price on emissions as a "job-killing carbon tax."

The Australian PM has also refused repeated calls from European leaders and others to put climate change on the agenda this weekend, insisting the focus of the summit remain squarely on economic issues and the handful of priorities he's chosen, as if promoting the economy and protecting the environment are inherently contradictory.

But where Abbott is a blunt edge, Harper's crafting of Canada's message probably requires a finer touch.

Canada's economic future depends heavily on the energy sector, in particular continued development of Alberta's oil sands while selling the product in the U.S. and beyond.

Those efforts get a boost with the Republicans about to control both houses of Congress, and with their renewed drive to pass legislation to approve the controversial Keystone XL pipeline from Alberta to American refineries on the Gulf of Mexico.

But the White House has hinted at a veto if Congress pushes ahead on Keystone, and Barack Obama has made climate change a priority of his second term, a factor that no doubt played a huge role in this week's deal with China's Xi Jinping.

Surprise?

For the first time, China has agreed to cap its emissions — by 2030 at the latest — and to diversify its energy supply to include more non-fossil fuels. In turn, Obama is promising the U.S. will reduce its emissions by up to 28 per cent below 2005 levels within the next decade, which is a much greater commitment than Canada's.

For years, the Conservative government has tried to move in lockstep with the U.S. to reduce pollution.

But, unlike the U.S., Canada has yet to bring in standards for its oil and gas sector. And environmentalists are unanimous in saying Canada won't make the more modest emission reduction targets (17 per cent below 2005 levels by 2020) that the U.S. has now trumped.

Earlier this month, French President Francois Hollande chided Harper about Canada's record at a news conference in Ottawa. This U.S.-China deal — between the two biggest polluters on the planet — sets the bar even higher.

So what can Harper do? The prime minister surprised many of his most persistent critics at the 2008 G8 summit in Muskoka by proposing the maternal and child health initiative, which has grown to a multi-billion commitment to reduce the staggering mortality rate among new mothers and infants in the developing world.

That program remained true to Conservative principles. No Canadian money would be used for abortions, progress would be monitored. The UN would be accountable for results.

As for climate change, it isn't on the agenda in Brisbane this weekend, but it's certainly in the news. There will be pressure from leaders and from protesters outside the conference setting for Canada to step up its commitment.

Perhaps it's a chance for Harper to surprise again and set out what Canada can do, while remaining consistent with those Conservative values.