Skip to content
Evergreen Evergreen
Documentation

0033 — Require the retrieval date on every source of every lifecycle record

Status: accepted

Problem

A lifecycle rule already has to carry at least one authoritative source with a title and an https URL, and its provenance.observedAt says when the evidence was last seen. But provenance is a v2-only field: detectors drop it when they build the v1-shaped view, and a finding therefore carries only sources[].title and sources[].url. The per-source accessedAt was optional, and 900 of the 1,162 source entries in registry/ did not carry one. A consumer of a finding could see where a claim came from but not the day that page was read; the only places that recorded a retrieval date were provenance.observedAt inside the registry file and registry/sources.lock.json, which is maintainer tooling and is not published.

Decision

  1. sources[].accessedAt is required in evergreen.registry.v2. The schema and registryV2Issues reject a source without it, and reject a value that is not a real YYYY-MM-DD calendar date. The format version does not change: this tightens the existing v2 contract rather than adding a new one.
  2. Every bundled record records the date. Existing source entries are backfilled from the date the source lock checked that URL, or from the rule’s provenance.observedAt when the lock has no entry. observedAt already means the day the evidence was last seen at its source, so the two agree by construction.
  3. The importer runner owns the date. Like provenance, an importer draft cannot set accessedAt; the runner stamps the run date on every source. A draft that reaches a reviewer is therefore valid v2 without the importer hard-coding a date that would be stale the next time it runs.
  4. Findings carry the date without a contract change. schemas/finding.v1.schema.json already allowed accessedAt on a finding’s sources, so a finding now shows the retrieval day that its rule records. This is an additive change to scan output: a field that was often absent is now always present for registry-backed findings.

Alternatives rejected

  • Derive the date from provenance.observedAt when a finding is built. It would leave the registry record incomplete and make the date depend on a field detectors intentionally discard, so any consumer reading registry/ directly would still have no date.
  • Make provenance available to findings instead. That changes the v1-shaped rule contract detectors consume, and every ecosystem’s rule type, for one field that the source already has a place for.
  • Keep accessedAt optional and backfill only. Optional means the next rule added can omit it, and the validation gate this issue asks for would not exist.
  • Treat the source lock as the published record. It is generated by maintainer tooling, is excluded from the data package, and records the current page rather than the decision behind a specific rule.

Consequences

  • A rule without an access date fails evergreen rules lint and npm run check, with a message naming the source and the day format to add.
  • tools/registry-v1-to-v2.ts stamps the conversion date on every source. The v1 read-back check ignores accessedAt, because the date is new evidence, not a change to what a detector sees.
  • Importers keep their source constants free of dates; tests/importers/* compare drafts after the runner has stamped them.
  • The published data package and the static rule pages now expose a retrieval date per source; the rule pages render it next to the link.
  • Out of scope: per-source freshness targets and disagreement detection between sources (#2166, #2167).