Skip to content

fix(sitemap): stop emitting a lastModified that is always the build time - #574

Merged
hivecommons-hive[bot] merged 2 commits into
mainfrom
scanner/fix-573
Nov 1, 2026
Merged

hivecommons-hive[bot] merged 2 commits into
mainfrom
scanner/fix-573

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

The prebuild sync scripts rewrite every synced page unconditionally before the build, so file mtimes equal the build time. Additionally, git checkouts do not preserve mtimes, so even pages not rewritten carry the checkout time—also the build time.

This means all lastModified values in the sitemap are identical and equal the latest deploy, which is the inaccurate-lastmod pattern that search engines ignore and penalize.

Drop lastModified and the getLastModified helper from sitemap entries. MetadataRoute.Sitemap makes the field optional, and omitting <lastmod> is documented behavior when reliable dates are unavailable.

Closes #573

— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

The prebuild sync scripts rewrite every synced page unconditionally before the build, so file mtimes equal the build time. Additionally, git checkouts do not preserve mtimes, so even pages that are not rewritten carry the checkout time (which is also the build time). This means all lastModified values are identical and equal the latest deploy, which is the inaccurate-lastmod pattern that search engines ignore and penalize.

Drop lastModified and the getLastModified helper from sitemap entries—MetadataRoute.Sitemap makes the field optional, and omitting <lastmod> is the documented behavior when reliable dates are unavailable. Update the tests accordingly.

Closes #573

Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@kubestellar-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign clubanderson for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@netlify

netlify Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for hivecommons-docs canceled.

Name Link
🔨 Latest commit 3b61844
🔍 Latest deploy log https://app.netlify.com/projects/hivecommons-docs/deploys/6ae7cdebe739a350565d10a4

@hivecommons-hive

hivecommons-hive Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor Author

Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor.

hive/awaiting-ci: CI pending — sweep will merge when green.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

Review findings from reviewer (folded here because this head already carries its hive review):

Read src/app/sitemap.ts, src/app/docs/page-map.ts, and the prebuild sync scripts at the PR head (3b61844). Looks correct to me.

Premise checks out. scripts/sync-hive-docs.ts:262 and scripts/sync-sibling-docs.ts:515,605 call fs.writeFileSync on every synced file with no content comparison, so in a fresh CI/Netlify checkout every mtime the old getLastModified() read was the build time. Dropping <lastmod> is the right call; MetadataRoute.Sitemap already types it optional, so no type change was needed.

Nothing left dangling. docsContentPath is still exported and used by page-map.ts:358; contentPath is still returned at page-map.ts:468 for other consumers. The removed test (falls back to the current time when a linked file cannot be stat'ed) only covered the deleted helper, so deleting it is correct rather than a coverage loss.

Locally at the PR head: vitest run src/__tests__/sitemap.test.ts 8/8 pass, tsc --noEmit and eslint on the touched files are clean. Changelog fragment name follows <category>-<slug>.md.

Only check still pending is tide; everything else is green. Nothing blocking from my side.

Evidence bundle `#5743b61844` sha256:a416f0e32856b464efbf4f346d44e61a6f35c85e33325805fea51caea5fa5c42 — download from the dashboard or `hivectl review evidence #574`.

Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@hivecommons-hive hivecommons-hive Bot added author/hive This repository's own hive (the App or one of its agent lanes) authored this PR dco All commits are DCO signed-off role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Nov 1, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks correct to me. Read the tree at 3b61844, not just the diff:

  • The premise holds: scripts/sync-hive-docs.ts:262 and scripts/sync-sibling-docs.ts:605 call fs.writeFileSync on every synced page with no content-compare or skip, so every mtime is the build time and <lastmod> carried no information.
  • src/app/sitemap.ts is now self-contained (lines 50–81); fs/path/docsContentPath/contentPath imports were removed cleanly and the remaining docsContentPath consumers (api/healthz, api/search, docs/[...slug]/page.tsx) are untouched.
  • No other lastModified/lastmod emitters or operator docs reference the field, so nothing else needs to change.
  • npx vitest run src/__tests__/sitemap.test.ts → 8 passed on the PR head; the updated assertion (expect(arch).not.toHaveProperty("lastModified")) would fail against main.

One note, not a blocker: with <lastmod> gone, changeFrequency: "weekly" is the only freshness hint left, which is fine — it's a hint crawlers already weight lightly.

— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author
3b61844

ℹ️ Sentinel notice — informational; author is trusted (hive agent), merge is not blocked

Hive flagged this PR (author @hivecommons-hive[bot], head 3b61844c459b) because it matches behaviors that can override security controls, escalate privileges or damage the codebase. This is a heuristic, not an accusation — a maintainer should confirm the change is intended before it merges.

  • test_removal — removes 32 test lines while adding 3 (Deletes test files or guts test coverage)
    • src/__tests__/sitemap.test.ts

Hive did not add the sentinel-alert label because this author is trusted. The finding remains recorded for audit and the dashboard Security tab; set sentinel.trusted_authors_block: true to require the blocking label for trusted authors too.

@hivecommons-hive
hivecommons-hive Bot merged commit 8d2e2ae into main Nov 1, 2026
10 of 11 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the scanner/fix-573 branch November 1, 2026 23:49
@hivecommons-hive hivecommons-hive Bot removed role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/hive This repository's own hive (the App or one of its agent lanes) authored this PR dco All commits are DCO signed-off dco-signoff: yes size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[scanner] sitemap.xml lastModified is always the build time (prebuild sync rewrites every page)

0 participants