Skip to content

rules(crawl): sitemap lastmod drifts from the page's own dateModified #107

Closed

Description

@nc9

Part of #103 (V-02).

Separate from the churn case in V-01: here the sitemap does carry varied dates, they are just wrong
relative to what the page itself says. Nothing correlates the two today.

Two production sites, and the two directions were different bugs:

  • A personal blog — sitemap lastmod up to 5,589 days ahead of the page's own dateModified.
    Cause: lastmod took the build date while the page rendered the post's real 2011-2016 date.
  • A consultancy site — sitemap lastmod 433 days behind dateModified on revised posts. Cause: the
    sitemap generator resolved publishedAt ?? updatedAt while the route rendered
    dateModified: updatedAt ?? publishedAt. A precedence inversion — both fields were present and
    valid, so every presence-based check passed.

Worth distinguishing in the output, because they point at different code: ahead means the field is
build-stamped, behind means stale or inverted precedence. Lastmod being older than the page's own
dateModified is the more clearly wrong of the two — it tells crawlers not to bother with a page that
has in fact changed.

Acceptance Criteria

  • New site-scope rule crawl/sitemap-lastmod-drift under packages/rules/src/crawl/, registered in the rules catalog
  • For each crawled page present in the sitemap, compares sitemap lastmod against the page's own strongest date signal (schema dateModified, else dateModified equivalent meta, else visible date)
  • Warns when lastmod is older than the page's dateModified by more than 7 days, reported as a distinct check name from the ahead case
  • Warns when lastmod is newer than the page's dateModified by more than a configurable threshold (default 30 days)
  • Each finding reports the two dates and the delta in days
  • Skips pages with no page-side date signal at all (that is content/freshness territory, not drift)
  • Does NOT warn on same-day or within-threshold differences
  • Passes on a fixture where lastmod tracks dateModified per page
  • Byte-identical output across the legacy and siteQuery paths
  • Rule page added to docs/ and make validate passes there
  • packages/audit-engine/tests/streaming-rules-canonical-golden.test.ts updated: bump v1.findings.length and v1.perRuleTally.length by exactly one each, and add a comment line naming this rule as the cause, matching the convention already used for the six rules above it

Activity

  1. added
    enhancement
    P2
    size: S
    rules
    on Aug 19, 2026
  2. nc9 commented on Aug 19, 2026

    @nc9
    ContributorAuthor

    🐹 hamsterwheel claimed this issue.

    • run: loop-mszws8w9-107
    • branch: loop/107-rules-crawl-sitemap-lastmod-drifts-from-
    • started: 2026-08-19T09:48:19.309Z
  3. nc9 commented on Aug 19, 2026

    @nc9
    ContributorAuthor

    🐹 hamsterwheel claimed this issue.

    • run: loop-mszxc576-107
    • branch: loop/107-rules-crawl-sitemap-lastmod-drifts-from-
    • started: 2026-08-19T10:03:47.259Z
  4. nc9 commented on Aug 19, 2026

    @nc9
    ContributorAuthor

    🐹 PR opened: #114 — running the merge gate (CI · human rules · review · rubric).

  5. nc9 commented on Aug 19, 2026

    @nc9
    ContributorAuthor

    🐹 Merged #114 — CI green · no human rule fired · review clean · rubric passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2enhancementrulessize: S

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions