A remarkable "wag the dog" situation has lately developed on Wall Street regarding two companies we've all grown to know well over the last year. The two are Martha Stewart Living Omnimedia Inc. (MSO), whose chairwoman, Main Mama Martha, is now back in the news for reasons we'll get to in a minute; and Michigan-based Kmart Corp. (KMRTQ), which is Mama's main business partner and, as such, finds itself back in the news as well.

Thanks to a little-noticed clause in an 18-month-old licensing contract between them, the two companies are now joined at the hip in ways that neither one could have imagined only a few months ago.

That one clause, which appears as a redacted, or blacked out, paragraph in an attachment to an MSO financial filing in November 2001, obligates Kmart to pay the Stewart company annually escalating royalty payments for its merchandise sales through Kmart - whether or not Kmart actually sells more merchandise for Mama Martha.

As such, the clause - negotiated as part of a revised licensing deal between the two companies long before either one faced the troubles that have since engulfed them - now stands in effect as a shared bulwark for both.

THE clause means Martha Stewart Living Omnimedia's own bottom-line profitability will not be threatened by Kmart's woes, no matter how many stores the discount retailer closes in its struggle to return from Chapter 11 bankruptcy. Last week Kmart announced the closure of another 326 stores, bringing the total to 609, or nearly a third of its previous total, since filing for Chapter 11 a year ago.

This means MSO has a guaranteed income stream of essentially free money that currently looks to be running in excess of $28 million per year.

But the clause also means Martha could instantly be transformed from Kmart's biggest asset into one of its largest and costliest liabilities - particularly if she winds up being formally charged in the ImClone insider trading scandal and Kmart has to go on forking over ever-larger amounts of cash as royalty payments for Martha-branded merchandise sales that wind up collapsing.

This is where things start to get confusing because, for all her troubles, Mama Martha remains Kmart's main merchandising asset - Joe Boxer notwithstanding. And that, in turn, means her indictment in the ImClone case could easily chill the willingness of lenders to help pull Kmart out of bankruptcy. And if Kmart doesn't recover from Chapter 11, it's adios for Mama's business, too.

ON Wall Street they call these sorts of situations arbitrage opportunities. But just like dogs with wagging tails, arbitrage opportunities are creatures with many moving parts, which makes keeping track of the action rather a challenge. In this situation, the moving parts include not just the two companies themselves, but two separate and parallel investigations by the Securities and Exchange Commission and the Department of Justice, as well as all the individual targets of both probes.

As a result, there's not a card counter anywhere who seems willing to stand up and proclaim with confidence which of these two companies should properly be viewed as the dog's wagging tail.

Kmart's future is certainly unsettled enough already. The company tried its best to put a positive spin on its latest round of store closings last week, saying it expects to be back out of bankruptcy by the end of April, and that it has already lined up $2 billion in "exit financing." But the loan package simply replaces a similar-sized "debtor in possession" credit line that has enabled the company to survive during its year-long bankruptcy.

Though the terms of the bankruptcy reorganization have not been released, the latest round of store closings is going to cost the company, by its own estimate, at least $1.7 billion more in charges. That means that, one way or another, a large chunk of either the debtor-in-possession credit or the exit financing has effectively been spent already - and the company is not yet even out of bankruptcy.

Last week, the company announced that it had turned profitable in December, with net income of $349 million on monthly sales of $4.7 billion. But this looks to have been a one-time fluke caused by the Christmas shopping season having been largely compressed into the month of December alone.

What's more, Kmart's sales for the month were themselves down 5.7 percent from December 2001, which was itself depressed as a result of 9/11. And, most important of all, the company didn't have to pay interest charges because it had already stiffed its bondholders via the Chapter 11 bankruptcy filing.

In short, given enough time - and probably not a whole lot of time, either - Kmart will be piling on the debt all over again, and all its previous problems could quickly reappear.

The outlook for Martha Stewart Living Omnimedia seems, if anything, even murkier. In recent days stories have once again begun to circulate that Martha is about to be charged by either prosecutors or the SEC, or perhaps both, for offenses related to the ImClone insider trading affair.

MUCH of this speculation centers on the government's handling of her East Hampton pal, Sam ("The Weasel") Waksal, the ex-head of ImClone Systems and the man who got her in this jam in the first place. Waksal has pleaded guilty to massive insider selling in his own company's shares 13 months ago, and some of Martha's own behavior has raised questions about whether she might have been involved as well.

Waksal's sentencing had originally been set for later this month, but it has now been pushed back to March, raising questions as to whether prosecutors are pressuring him to implicate others in his activity before he is actually sentenced. Over this past weekend, there was an intense buzz among observers that the whole situation was coming to a head, and that charges could be filed as early as this week. (Of course, charges could also be months or years off - if they are in fact brought at all.)

Meanwhile, Mama's stock price - having recovered from its lows of last October - has begun to slip again. Last week it declined another 7 percent, to a Friday closing price of $9.70 per share, which is where things stood back in July as the ImClone scandal and her rumored involvement in it became America's summer-long obsession.

IN fact, Martha Stewart Living Omnimedia has basic business problems that Mama's entanglements with The Weasel have only made worse. The company's magazine business is doing well, but most of the rest of the business - with the exception of the money flowing in from the revised Kmart royalty deal - ranges from weak to horrid.

The company's TV business has stagnated and is now easing into decline. And the catalog and Internet businesses have become a collective black hole, racking up $7 million in combined losses for the quarter ended Sept. 30.

Wall Street's analysts expect the company to earn 41 cents per share this year, and to grow by more than 15.5 percent annually over the next half-decade, which translates into a rich year-ahead price-to-earnings multiple of 24. But investors probably aren't looking at the company's earnings potential. More likely, they're eyeing the company's balance sheet assets of $4.20 per share in cash and receivables, and figuring another $5.50 per share is a reasonable bet that the company will continue as a going concern even if its chairman is devoured by her legal problems.

A good bet? Only if you think Kmart won't pack it in first - in which case Mama's entire operation becomes a money loser and its stock price will almost certainly decline to a small premium over the cash and receivables on its balance sheet.

So who's the dog in this deal, and who's the tail? Maybe the better question is, aren't these two troubled companies really the same animal?