Bags of coffee bought from two Washington-area Whole Foods Markets include some sold after their “best by” date. (Goran Kosanovic/For The Washington Post)

The bag of Peruvian coffee from Toms Roasting says the beans are best used by Dec. 3. The bag of Kenyan beans from Allegro Coffee Roasters indicates they are good through Sept. 19, while the bag of Rwandan beans from One Village Coffee notes they were “roasted to perfection” on May 26.

These coffees were among dozens sitting on the shelves in mid-July at two randomly selected Whole Foods Market stores in the Washington area. The dates stamped on these bags whisper promises to shoppers: that the freshly roasted coffee beans, or at least some of them, will taste the same months from now, maybe even half a year from now.

The promises are, in all likelihood, hollow. Specialty roasters — the people who buy and roast the highest-grade beans in the world — will tell you that only coffees sold in special packaging, such as nitrogen-flushed bags that prevent oxidation, can survive on the shelf for months. Otherwise, after about 30 days, those coffee beans will be about as flavorful as summertime peaches in October.

“We continue to give the basic recommendation that, if you really want to enjoy the coffee, buy it within a week of the roast, buy it locally and drink it within a week of purchasing it,” says Ric Rhinehart, executive director of the Specialty Coffee Association .

Supermarkets have historically been poor places to find good beans. They tend to favor blends, so customers can have a consistent cup every time. They lean toward darker roasts, so the coffee’s flavors won’t diminish much as the beans degrade. And they tend to treat their coffees more like canned goods than fresh produce, sometimes leaving bags on the shelves for weeks after their “best by” dates.

A Whole Foods Market in Manhattan. (Carlo Allegri/Reuters)

But Whole Foods, the organic grocer that Amazon is set to purchase later this year, raised the bar for supermarket coffee, especially after the chain bought the respected roaster Allegro Coffee in 1997. (Amazon founder and chief executive Jeffrey P. Bezos owns The Washington Post.) ­Colorado-based Allegro became, for all practical purposes, the house roaster for Whole Foods, but regional stores also supplemented Allegro products with coffees from specialty roasters in their area, offering customers a robust selection of blends, single-origin and espresso beans. Whole Foods seemed to be making a pledge: We’ll be a friend to specialty coffee.

To some in the trade, Whole Foods’ commitment to freshness in other parts of the store — to selling produce at its peak, for example — ends at the coffee aisle. Ask Chris Vigilante, founder of Vigilante Coffee, a roaster based in Hyattsville, Md. He says he stopped selling to a pair of Whole Foods stores in the Washington area in late 2015 after finding his beans on sale months after their roast date. Vigilante says his beans are best brewed within a 30-day window after the roast.

Vigilante started selling coffee to the Friendship Heights Whole Foods in Chevy Chase in March 2015. The store’s initial purchase was 120 bags, a large order from a roaster still relatively unknown outside specialty circles. “Over the course of four or five months, the same coffees were still sitting there,” Vigilante says.

Chris Vigilante at his roastery and coffee shop in 2015 in Hyattsville. (Amanda Voisard/For The Washington Post)

One day, Vigilante took matters into his own hands. He walked into the Friendship Heights store, grabbed a cart and bought all the remaining stale coffee on the shelf. “I cleared like 50 bags,” he says. He figured taking a bath on the coffee was better than taking a hit to his young company’s reputation.

Vigilante sold only about 330 bags before pulling the plug on his relationship with Whole Foods stores in Friendship Heights and Tysons Corner. But then last year, out of nowhere, he got an order from a Whole Foods store in Chicago. He turned down the request, but then felt compelled to write a blog post about his brief, frustrating time with Whole Foods. He never published the piece, but he shared it with The Post. Among other complaints, he wrote, “their ordering techniques are designed to sell products over a span of months, not weeks or days.”

Whole Foods declined to comment for this story, other than to provide background information about its commitment to local suppliers in general, not coffee roasters in particular. Whole Foods has a low-interest loan program to help innovative suppliers grow, and the chain will provide the tools and feedback to help suppliers succeed. If they do succeed and have ample capacity, suppliers can expand from a single store to national distribution, a plum for just about any producer.

Rhinehart of the Special Coffee Association is sympathetic to roasters’ concerns about freshness, but he says there’s always a trade-off when selling to large grocery chains, even Whole Foods. For the convenience of offering products in the same place where shoppers can buy dozens of other household items, Rhinehart says, roasters should expect certain sacrifices in quality.

This bag of Red Rooster Coffee Roaster Funky Chicken was still on the shelf at a Whole Foods Market in Silver Spring in early July, even though it should have been removed on May 12, a month after it was roasted, according to the roaster’s co-owner, Haden Polseno-Hensley. (Goran Kosanovic/For The Washington Post)

“I don’t think that roasters that sell coffee to Whole Foods can have it both ways,” Rhinehart says. “They’re like, ‘I’d like you to pay me a premium price, give me great distribution, give me access to your customers, promote my product, and, oh, by the way, if it doesn’t sell, it’s your problem.’ This is not a way to have a long-term relationship with Whole Foods or any grocery store, frankly.”

Nonetheless, the grocery chain aims high with so many of its foods — organic produce, sustainable seafood, naturally raised meat — that its commitment to specialty coffee can strike roasters as lukewarm. A July walk through the Whole Foods in Silver Spring conducted several days after the aforementioned random trips, would appear to validate this notion: At least three bags were available after their best-by dates had expired. One bag of Funky Chicken, a certified organic decaf blend from Red Rooster Coffee in Floyd, Va., said it was roasted on April 12. It wasn’t packaged in a nitrogen-flushed bag.

This is an ordering issue, says Haden Polseno-Hensley, co-owner of Red Rooster. Buyers at individual Whole Foods stores will sometimes place orders for coffee that Polseno-Hensley knows will sit on the shelves for months, like that decaf blend. “I’m never really sure how to address it when a company might order a coffee that doesn’t sell as well as the other coffees.”

One argument among specialty roasters goes something like this: Their beans are an agricultural product that degrades in quality in a matter of weeks, not unlike heartier fruits and vegetables, such as apples and onions. So why doesn’t a place like Whole Foods treat coffee beans more like produce and rotate out the older beans?

The problem with this logic, says SCA’s Rhinehart, is that coffee beans can still be consumed well past their best-by date. Unlike some produce and meats, old coffee beans don’t grow mold or become contaminated with bacteria, which could lead to illness or even death. The beans may not even smell bad, unless they were roasted so dark their surface oils have turned rancid.

In many grocery stores, coffee is more akin to dried legumes, Rhinehart says. At supermarkets, consumers don’t expect managers to toss, say, dried kidney beans that have been on the shelf for a year because everyone knows those beans are still edible when rehydrated, seasoned and slowly cooked.

“That, in some sense, is the same with coffee,” Rhinehart says. “There’s a marked difference in quality between freshly roasted and four months old, but it won’t kill you. It’s consumable. It will taste like coffee, probably not great coffee.”

This single-origin coffee from Thailand, roasted by Allegro, was sitting on a Whole Foods Market shelf more than a month after its “best if used by” date of June 9. Whole Foods owns Allegro. (Goran Kosanovic/For The Washington Post)

Some specialty roasters, such as One Village Coffee, have developed ways of working within the Whole Foods system. The Souderton, Pa., roaster, for instance, has employees who manually fill each bag with nitrogen, which flushes out most of the oxygen and extends the shelf life of the coffee. Victoria Perez, director of sales and marketing for One Village, says Whole Foods allows ­nitrogen-flushed bags to remain on the shelves for 120 days vs. 30 days for those without the gas.

Then again, One Village has the motivation to find solutions. The company has no retail stores or cafes of its own and relies exclusively on supermarkets for sales. “The grocery is our focus, and it’s not the focus of many specialty roasters,” Perez says.

The Alexandria-based Swing’s Coffee also has found ways to work with Whole Foods that benefit the roaster. For starters, says owner Mark Warmuth, Swing’s sells small quantities to each of 20-plus Whole Foods stores that offer its coffee, “to make sure it’s turning over.” The roaster will then conduct in-store brewing demonstrations two to three times a week to market its products. And, lastly, Swing’s doesn’t push its seasonal, single-origin coffees on Whole Foods, to better differentiate itself from the Allegro products. Some Washingtonians, after all, may have a lifelong relationship with Swing’s blends, some of which date back decades.

This single-origin Dominican coffee from Cafe Kreyol is in a nitrogen-flushed bag, which means the beans will lose some flavor but are actually good for six months, not the three months listed on the package, says Joey Stazzone, owner of the Manassas, Va.-based roaster. (Goran Kosanovic/For The Washington Post)

“We shy away from ­single-origins,” Warmuth says. “That’s intentional, just knowing what the Allegro brand is trying to represent and what’s going to move for us.”

No one seems to have a clue whether Amazon’s ownership will change the coffee program at Whole Foods, even though the online behemoth is based in ­Seattle, the unofficial coffee capital of the United States. Polseno-Hensley of Red Rooster says he already thinks Whole Foods is “always trying to adapt to a changing market in coffee,” while Vigilante says it won’t matter to him what Amazon does. He doesn’t plan to sell to grocery stores again. They can never treat his product as well as he does.

Rhinehart says he hopes Amazon lets Allegro, the Whole Foods subsidiary, focus on what it does best: source, roast and package great coffee. “They’ve underutilized this incredible resource that they’ve owned for all these years,” he says. “They’ve never managed to capitalize on what could be the value of that.”

Beyond that, Rhinehart says he hopes Amazon will improve freshness in the coffee aisles at Whole Foods.

“Amazon is extraordinarily good at distribution, and I don’t know if that will translate into something very positive for the consumer, a chance to use those distribution skills to move very good, very fresh coffee out very quickly,” Rhinehart says. “Or whether coffee will not rise to the level of importance for Amazon that it should.”