Skip to content

feat(rules): add content/date-agreement (#108) - #120

Merged
nc9 merged 1 commit into
mainfrom
loop/108-rules-content-date-agreement-visible-byl
Aug 20, 2026
Merged

nc9 merged 1 commit into
mainfrom
loop/108-rules-content-date-agreement-visible-byl

Conversation

@nc9

@nc9 nc9 commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Closes #108

New page-scope rule content/date-agreement: the disagreement BETWEEN a page's date signals is the
defect, and no rule looked for it. content/freshness passes as soon as any one signal exists and
eeat/content-dates reports coverage, so squirrelscan.com's own site passed both while broken in
two opposite directions (/blog/* 2025 byline vs 2026 schema; /learn/* Article dates the reader
never saw).

Four page-side signals are extracted and reported on every finding: visible byline date, schema
document date, URL/title year, Last-Modified. Last-Modified never raises a warning on its own —
origins stamp it at deploy time far more often than at content-change time.

Checks

Check Fires when
byline-vs-schema-date Visible date and schema document date more than tolerance_days (default 1) apart — both values named
visible-date-missing An Article-family node states dates and main content prints no date at all
url-title-year The URL year, else the title year, matches neither schema document date
schema-date-source Info: the page shows a date but its only schema date sits on a node that does not describe the page

False-positive guards (both #108 traps are fixtures)

  • Schema dates are read ONLY from document-describing @types; an Article node wins over the
    generic WebPage beside it, and a date on a sitewide SoftwareApplication / Product /
    Organization is reported with its node type noted and can never raise a disagreement.
  • A byline is a position: candidates must sit in the top zone of main content (chrome skipped) and
    be byline-shaped — a <time>, byline/entry-meta markup, or a short line saying nothing but the
    date. An anchor's own text never counts, so prose and outbound citations are not bylines.
  • visible-date-missing only when main content prints no date-shaped string anywhere.
  • A page-level node plus several visible dates is an index/archive, so nothing is compared.

Acceptance criteria

  • New page-scope rule content/date-agreement under packages/rules/src/content/, registered in the rules catalog
  • Extracts up to four page-side signals: visible byline date, schema document date, URL/title date, Last-Modified header
  • Warns when the visible byline date and the schema document date disagree by more than 1 day, naming both values
  • Warns when a page emits schema document dates but shows the reader no visible date
  • Warns when a URL or title contains a year that disagrees with the schema document date
  • Schema dates are read ONLY from document-describing @type nodes; a date taken from any other node is reported with its source noted (schema-date-source, info) and never used to raise a disagreement warning on its own
  • Fixture: page with an Article node plus a sitewide SoftwareApplication whose datePublished differs — no warning
  • Fixture: page whose body prose contains a date unrelated to publication (INP replaced FID on March 12, 2024) — no warning
  • Fixture: page whose only date-shaped string is inside an outbound citation link — no warning
  • Fixture: visible 2025 byline against schema 2026 — warns
  • Passes on a page whose visible, schema, and header dates agree
  • Rule page added to docs/ (docs/rules/content/date-agreement.mdx, listed in docs.json and the Content index)
  • streaming-rules-canonical-golden.test.ts updated with a comment line naming this rule as the cause, matching the convention used for the rules above it

One deviation, called out

The golden pin moves perRuleTally.length 275 -> 276 but leaves findings.length at 98218, not
98219. The canonical fixture emits no JSON-LD at all, and this rule speaks only when a page
carries a date on a document-describing schema node — so, exactly like schema/rating-scope above
it, it contributes a tally key without a single finding. Writing 98219 would have pinned a number
the fixture cannot produce. The comment in the test says so.

Verification

Local bun / node execution was blocked by this session's command policy, so tests and typecheck
were NOT run locally — CI (bun test, root typecheck, docs:check) is the gate. bun test at the
repo root picks up packages/rules/tests/content-date-agreement.test.ts (23 cases) and the
canonical golden pin.

Both existing date rules are presence checks: content/freshness passes on
any one signal, eeat/content-dates reports coverage. A page whose signals
contradict each other passes both — squirrelscan.com's own /blog/* showed
a 2025 byline against a 2026 schema date, /learn/* emitted Article dates
the reader never saw.

New page rule compares four page-side signals: visible byline date, schema
document date, URL/title year, Last-Modified. Warns on byline vs schema
disagreement beyond tolerance_days, on schema dates a reader cannot see,
and on a URL/title year that contradicts the schema.

False-positive guards (the two traps that cost an audit pass two re-runs):
- schema dates come ONLY from document-describing @type nodes; a date on a
  sitewide SoftwareApplication/Product/Organization node is reported with
  its node type noted and never raises a disagreement
- a byline is a position: candidates must sit near the top of main content
  and be byline-shaped; anchor text never counts, so prose and outbound
  citations are not read as publication dates
- "no visible date" only when main content prints no date at all
- a page-level node plus several visible dates is a listing, not a defect

Last-Modified is reported but never warns on its own (deploy stamps).

Golden canonical pin: perRuleTally 275 -> 276; findings unmoved (the
fixture emits no JSON-LD, so the rule stays silent on every page).

Signed-off-by: Nik Cubrilovic <[email protected]>
@nc9
nc9 merged commit eb761b7 into main Aug 20, 2026
14 checks passed
@nc9
nc9 deleted the loop/108-rules-content-date-agreement-visible-byl branch August 20, 2026 02:56
nc9 added a commit that referenced this pull request Aug 20, 2026
The public README carries the count TWICE — a features bullet ("N Rules, N
Categories") and the table total — and the earlier pass updated only the total.
The Crawlability card in the docs rules index states its own per-category count
and was still at 18 against a live 20.

Both are checked by the #483/#1156 guards in the private repo, which is what
found them: the gitlink bump for v0.0.86 failed on exactly these two.

Rebasing onto main pulled in content/date-agreement (#120), so the live total is
276, not the 275 this branch was written for, and content is 18 not 17. Rather
than patch the surfaces CI names, every count is now swept against
loadAllRules(): the README table row by row, prose totals in README,
docs/index.mdx and docs/rules/index.mdx, and each per-category card. That found
four more stale numbers in docs/index.mdx that neither guard covers.

Signed-off-by: Nik Cubrilovic <[email protected]>
nc9 added a commit that referenced this pull request Aug 20, 2026
…119)

The public README carries the count TWICE — a features bullet ("N Rules, N
Categories") and the table total — and the earlier pass updated only the total.
The Crawlability card in the docs rules index states its own per-category count
and was still at 18 against a live 20.

Both are checked by the #483/#1156 guards in the private repo, which is what
found them: the gitlink bump for v0.0.86 failed on exactly these two.

Rebasing onto main pulled in content/date-agreement (#120), so the live total is
276, not the 275 this branch was written for, and content is 18 not 17. Rather
than patch the surfaces CI names, every count is now swept against
loadAllRules(): the README table row by row, prose totals in README,
docs/index.mdx and docs/rules/index.mdx, and each per-category card. That found
four more stale numbers in docs/index.mdx that neither guard covers.

Signed-off-by: Nik Cubrilovic <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rules(content): date agreement — visible byline vs schema vs URL vs Last-Modified

1 participant