1 Commits
Author SHA1 Message Date
poli0981andClaude Opus 5 c297c75e64 feat: M2 data layer — schema, registry, 5 seed apps, detail pages
The repository is now the database (docs/02 §1). 43 pages build from 5 JSON
files and a 12-entry category registry: grid, detail and category pages, each
in both locales.

Validation, proven in both directions:
- L1 (Zod, inside astro build) rejects shape errors. Negative-controlled: an
  entry missing `developer` and carrying an unknown key fails the build with
  both violations named, exit 1 - .strict() doing its job.
- L2 (scripts/validate-data.mjs) covers what Zod structurally cannot, because
  it never sees the filename or the filesystem: slug format and length,
  duplicate slug, duplicate name folded diacritic-insensitively, unknown
  category ref, non-https link, flagged-in-main-tree (hard rule 5), missing
  local: logo, updatedAt before addedAt, and quarantine invariants.
  Negative-controlled: one bad fixture tripped 5 rules at once, including
  catching "7-zip" as a duplicate of "7-Zip".
- L3: scripts/extract-urls.mjs feeds lychee; all 14 seed URLs return 200.

Two findings worth the space:

1. The T4 set:html ban had NEVER worked. docs/09 §2 says it is lint-banned,
   but the rule was a hand-rolled no-restricted-syntax selector matching
   JSXAttribute - a node astro-eslint-parser does not produce for template
   directives. Three components used set:html with a clean CI. Replaced with
   eslint-plugin-astro's purpose-built astro/no-set-html-directive, and
   negative-controlled: a fresh file with set:html={evil} now fails lint.

2. unplugin-icons cannot do data-driven icons. It resolves ~icons/set/name
   from a STATIC import specifier, but `logo` is a schema field, so the name
   is only known per entry. src/lib/icon.ts reads the same vendored Iconify
   JSON and inlines the SVG at build time - still zero runtime requests
   (hard rule 7), and still inheriting currentColor, which an <img> data URI
   would lose and which docs/04 §2 and docs/14 §3d both require.
   That needs set:html, so the ban carries exactly one carve-out, scoped to
   three named files rather than a loose disable comment: the only
   data-derived input is a schema-constrained lookup KEY, never interpolated
   markup, and an unknown key throws at build.

Seed entries are 7-Zip, VLC, Firefox, Krita and KeePassXC - all
security.status "unverified", the documented entry state (docs/04 §2). I did
not set "clean": that requires the docs/09 §6 vetting checklist, including a
reputation sweep and VirusTotal, and hard rule 4 forbids clean-by-default.
Licenses and developer names still need the L4 human pass.

Also: the header has linked to /categories since M1 and that route 404'd
until now.

Gate: lint, validate:data, i18n:check, 73 tests, astro check (0 errors),
build - all green.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-28 13:02:54 +07:00