Repo automation, the config changes Kokone asked for, and a full error pass.
Kokone's asks:
- LEGAL_VERSION -> 2026-07-28, the H6 approval date. Anyone who accepted the
pre-approval wording sees the gate once more; that is intended, they agreed
to different text.
- X-Robots-Tag: noindex REMOVED. It existed only while the dataset was empty,
where an indexed blank site can linger as "Crawled - currently not indexed".
With real entries, legal pages and a sitemap live, that objection is gone.
- The existing favicon.svg is now the PWA manifest icon, sizes "any" with
purpose "any maskable". One scalable asset covers every size, and browsers
without SVG-manifest support fall back to the favicon - strictly better than
the empty icons array that shipped in M5 and suppressed the install prompt.
The www deletion, diagnosed: a `www` DNS record added by hand is not part of
the Worker's trigger list, so `wrangler deploy` reconciles triggers and can
remove it - the redirect then dies silently. Declaring www.softharbor.net as a
second custom_domain makes wrangler CREATE and KEEP the record, so it survives
deploys and reproduces from a fresh clone instead of depending on a manual
step. www still never SERVES the site: Redirect Rule R1 runs before Workers
and 301s it to apex. That rule is now a documented hard prerequisite, because
without it www would serve a duplicate - the exact hazard docs/16 N1/N2 exist
to prevent.
CI/CD (docs/12): ci.yml with the two-job split the reusable workflow forces,
plus codeql, notify, deploy, preview, quarantine and link-check. Also
renovate.json - which pins TypeScript below 7 and flags Astro/Vite/Tailwind
majors for a fresh S1 - CODEOWNERS on the three highest-risk paths, and the
remaining issue templates.
quarantine.mjs implements hard rule 5 mechanically, and I tested it rather
than assuming: flagging VLC and running the sweep removed it from the detail
page, the grid, the API export, the RSS feed AND the search index - all five
surfaces - then restored cleanly.
Error sweep found real things:
- Two exactOptionalPropertyTypes violations. Under that flag `foo?: string`
means "absent or string", not "may be passed undefined", and both props came
from optional lookups. Object.fromEntries also widens to { [k: string]: … }
and no longer satisfies Record<Locale, …>.
- ShProbe.svelte was still in the tree - a dead S1 leftover sitting in
islands/ where docs/02 §5 caps the count at six.
- Five unused exports and an unused PWA type reference.
knip now passes clean, so the next dead export is visible instead of buried.
Gate: lint, i18n:check, validate:data, 99 tests, astro check (0 errors), knip,
build (55 pages) - all green.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
64 lines
2.1 KiB
JavaScript
64 lines
2.1 KiB
JavaScript
// SPDX-License-Identifier: GPL-3.0-only
|
|
// Copyright (C) 2026 poli0981 (SkullMute)
|
|
/**
|
|
* Quarantine sweep — docs/03 §5, docs/12 §4. Enforces hard rule 5
|
|
* mechanically: a flagged entry never survives in the live tree.
|
|
*
|
|
* Moves every `src/data/apps/*.json` with security.status === "flagged" into
|
|
* `data/quarantine/`, which sits OUTSIDE the content glob, so the entry stops
|
|
* rendering on the next build.
|
|
*
|
|
* MOVE, never delete: the file keeps its schema so restoring is a plain
|
|
* `git mv` plus a status edit, and the reason lives in the tracking issue and
|
|
* the commit message. History is the audit trail.
|
|
*
|
|
* Idempotent; exits 0 when there is nothing to do. Writes the moved slugs to
|
|
* the `moved` GitHub output so the workflow can open a PR and one issue each.
|
|
*/
|
|
import {
|
|
appendFileSync,
|
|
existsSync,
|
|
mkdirSync,
|
|
readFileSync,
|
|
readdirSync,
|
|
renameSync,
|
|
} from 'node:fs';
|
|
import { join } from 'node:path';
|
|
|
|
const APPS_DIR = join(process.cwd(), 'src/data/apps');
|
|
const QUARANTINE_DIR = join(process.cwd(), 'data/quarantine');
|
|
|
|
const moved = [];
|
|
|
|
if (existsSync(APPS_DIR)) {
|
|
for (const file of readdirSync(APPS_DIR).filter((f) => f.endsWith('.json'))) {
|
|
const path = join(APPS_DIR, file);
|
|
let app;
|
|
try {
|
|
app = JSON.parse(readFileSync(path, 'utf8'));
|
|
} catch (e) {
|
|
// A malformed file is L1/L2's problem, not ours — never move blindly.
|
|
console.error(`quarantine: skipping unparseable ${file}: ${e.message}`);
|
|
continue;
|
|
}
|
|
if (app?.security?.status !== 'flagged') continue;
|
|
|
|
mkdirSync(QUARANTINE_DIR, { recursive: true });
|
|
const dest = join(QUARANTINE_DIR, file);
|
|
if (existsSync(dest)) {
|
|
console.error(`quarantine: ${file} already in quarantine — leaving both for review`);
|
|
continue;
|
|
}
|
|
renameSync(path, dest);
|
|
moved.push(file.replace(/\.json$/, ''));
|
|
console.log(`quarantine: moved ${file} → data/quarantine/`);
|
|
}
|
|
}
|
|
|
|
if (moved.length === 0) console.log('quarantine: nothing flagged');
|
|
|
|
// Space-separated, consumed by .github/workflows/quarantine.yml.
|
|
if (process.env['GITHUB_OUTPUT']) {
|
|
appendFileSync(process.env['GITHUB_OUTPUT'], `moved=${moved.join(' ')}\n`);
|
|
}
|