Starter: new sites don't inherit the reference site's temporary silences

Merge follow-up for doctor + starter (both fine alone; three tests failed
together):
- generate.ts: an inherited ipal-doctor.json rule with `until` is a temporary
  follow-up of the reference site itself (the four live-seo silences until
  2026-11-30); a new site starts with those checks on. Permanent, reasoned
  exceptions (i18n-literals, audit:collections-present) are still inherited.
- reference/src/instrumentation.ts: the doctor's cookieCrawl header comment is
  wrapped in @starter:if crawl, so a site without crawl doesn't mention it.
- docs/agent/reference-site/INDEX.md regenerated (the merge-time copy repeated
  the ipal-doctor.json section).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Radosław Smoliński
2026-10-29 16:20:36 +01:00
co-authored by Claude Opus 5.5
parent 6d7d39bc95
commit aa88e4ea39
3 changed files with 9 additions and 154 deletions
+5 -2
View File
@@ -180,12 +180,15 @@ type DoctorRule = { [key: string]: unknown; off?: boolean; reason: string; until
/**
* ipal-doctor.json: the domain, not launched yet, and every deliberate difference silenced with its reason —
* the reference site's own silences (`inherited`, from its ipal-doctor.json) while the files they cover are in
* the site, CSP report-only for 28 days, and each module the owner turned off.
* the site, CSP report-only for 28 days, and each module the owner turned off. A temporary silence of the
* reference site (one with `until`, a follow-up of its own) is not inherited: a new site starts with that check on.
*/
export function renderDoctorConfig(a: StarterAnswers, ctx: SiteContext, inherited: Record<string, DoctorRule> = {}): string {
const until = new Date(`${ctx.date}T00:00:00Z`)
until.setUTCDate(until.getUTCDate() + 28)
const kept = Object.entries(inherited).filter(([id]) => id !== 'audit:collections-present' || a.content.collections.length > 0)
const kept = Object.entries(inherited)
.filter(([, rule]) => !rule.until)
.filter(([id]) => id !== 'audit:collections-present' || a.content.collections.length > 0)
const rules: Record<string, DoctorRule> = {
...Object.fromEntries(kept),
csp: { off: true, reason: 'report-only at the start; switch to enforce once the [csp] reports are clean (security.md → ROLL OUT CSP)', until: until.toISOString().slice(0, 10) },