# 002.0-DEV-FETCH-VERSION-AGES: Fetch Version Ages for Outdated Packages

## Release Goal

**Release 0.1: Foundation**

For each outdated package, get the list of available versions and their publish dates so we can filter by age.

## How This Story Contributes

Builds on npm outdated by adding age information. This is the data needed to implement the 7-day maturity rule.

## User Story

**Format**: So that I can see how old each available version is, as a developer, I want dry-aged-deps to fetch publish dates for all versions newer than my current version.

**INVEST Criteria Compliance**:

- **Independent**: Depends only on 001.0 (npm outdated results)
- **Negotiable**: Could fetch all versions or just newer ones
- **Valuable**: Provides the age data needed for filtering
- **Estimable**: Clear scope - API calls for version dates
- **Small**: Single iteration
- **Testable**: Can verify dates are fetched correctly

## Acceptance Criteria

- [ ] **Core Functionality**: For each outdated package, fetch all versions and their publish dates
- [ ] **Calculate Age**: Calculate days since publication for each version
- [ ] **Display Ages**: Show age alongside each version
- [ ] **Smart Fetching**: Only fetch versions newer than current (optimization)

## Requirements (Current Implementation or To Be Implemented)

- **REQ-NPM-VIEW**: Use `npm view <package> time --json` to get publish dates
- **REQ-AGE-CALC**: Calculate `currentDate - publishDate` in days
- **REQ-OPTIMIZATION**: Only fetch/check versions newer than current

## Dependencies

- **001.0-DEV-RUN-NPM-OUTDATED**: Must have list of outdated packages

## Story Notes

**Gall's Law Compliance**: Adds age data to the working npm outdated output.

**Next Evolution**: Story 003.0 will filter versions to only show mature ones (>= 7 days old).
