In my
experience, the bigger the seed the longer it keeps. Beans, peas, lentils (pretty much all the pulses) are good over the long haul as long as you are keeping out humidity and bugs...3-4 years at least. Corn is probably the best of the grains, with the flint types the champs. Wheat, barley, oats and rice usually start to taste a little "tired" to me if they go beyond 12 months. Germination tests are one way of assessing how these are holding up. If they still have high viability, then the nutrient content is probably still good as well.
As the oil content in the seed goes up, its shelf life goes down. Sunflower, pumpkin, sesame and similar seeds seem to go 6-12 months max for us. Raw nuts vary...walnuts, macadamias and hazels still taste pretty good a year after harvest if we leave them in the shells, but shelled nuts go rancid a lot faster. Roasted nuts don't go rancid as fast as raw ones.
Milling really shortens the life of grains. Wheat keeps well for a year or more easily, but whole wheat flour starts to get unappealing after a few weeks.