Skip to content

Commit 766e6b7

Browse files
TMHSDigitalclaude
andcommitted
site: V13 value spellings, V14 active entries are settled (batch B)
- V13: within formats, and within subcategories, two values that differ only by case or punctuation are rejected. Would have caught the 4 format clashes batch A fixed. Plurals and word variants are deliberately not folded, so batch A's subcategory pairs were a hand fix, not something this check would have found. - V14: an active entry may not carry unknown in license, commercial or attribution_required. Would have caught vroid-studio before batch C. Evidence presence on active entries was already enforced in validate.mjs. - 7 new fixture assertions (51 across 14 checks). Both checks were also proved against real entries by mutation: reverting vroid's attribution and material-maker's PNG each fails the validator. - CONTRIBUTING states both rules. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Wc67NX9MM964uaVGn4bpZJ
1 parent e420bdc commit 766e6b7

4 files changed

Lines changed: 104 additions & 2 deletions

File tree

‎CONTRIBUTING.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ One new markdown file is enough — the website rebuilds from frontmatter on dep
4747
- `formats`: file formats and engine targets in their usual spelling: extensions upper case (`PNG`, `FBX`, `JSON`, `VOX`), product names as the product writes them (`glTF`, `Godot`), and lower-case kebab-case for package types (`godot-addon`, `blender-extension`). Reuse the spelling already in the catalog.
4848
- `grid_dimensions` / `camera_perspective` / `hardware_tags`: optional 2D/UI metadata.
4949
- `verified`: ISO date (`YYYY-MM-DD`) of your last license check.
50-
- `status`: `active` | `needs-review` | `deprecated`.
50+
- `status`: `active` | `needs-review` | `deprecated`. `active` means the licence, the commercial stance and the credit requirement are all settled: an `unknown` in `license`, `commercial` or `attribution_required` keeps an entry at `needs-review`. The validator enforces this (V14), and rejects `formats` or `subcategories` values that differ only by case or punctuation from one already in use (V13).
5151

5252
## License verification checklist
5353

‎site/checks.mjs‎

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,57 @@ export function checkTaxonomyValues(rel, meta) {
244244
return errors;
245245
}
246246

247+
/* ----------------------------------------------------------------- V13 */
248+
/**
249+
* `formats` and `subcategories` are free-form, so the same value drifts into
250+
* several spellings (`png` beside `PNG`, `field-recording` beside
251+
* `field-recordings`) and search and grouping split on them. Two values that
252+
* differ only by case or punctuation are one value spelt twice. Plurals are
253+
* not folded: `character` and `characters` are a known open question, not
254+
* something this check decides.
255+
*/
256+
export function checkValueSpellings(records, fields = ["formats", "subcategories"]) {
257+
const errors = [];
258+
for (const field of fields) {
259+
const byKey = new Map();
260+
for (const { rel, meta } of records) {
261+
const values = Array.isArray(meta[field]) ? meta[field] : [];
262+
for (const raw of values) {
263+
const v = String(raw);
264+
const key = v.toLowerCase().replace(/[^a-z0-9]/g, "");
265+
if (!key) continue;
266+
if (!byKey.has(key)) byKey.set(key, new Map());
267+
const spellings = byKey.get(key);
268+
if (!spellings.has(v)) spellings.set(v, rel);
269+
}
270+
}
271+
for (const spellings of byKey.values()) {
272+
if (spellings.size < 2) continue;
273+
const listed = [...spellings.entries()].map(([v, rel]) => `"${v}" (${rel})`).join(", ");
274+
errors.push(`${field} spells one value several ways: ${listed}`);
275+
}
276+
}
277+
return errors;
278+
}
279+
280+
/* ----------------------------------------------------------------- V14 */
281+
/**
282+
* `active` tells a reader the licence, the commercial stance and the credit
283+
* requirement are all settled. An `unknown` in any of them means an open
284+
* question, which is what `needs-review` is for. Evidence presence for active
285+
* entries is checked in validate.mjs.
286+
*/
287+
export function checkActiveIsSettled(rel, meta) {
288+
const errors = [];
289+
if (String(meta.status) !== "active") return errors;
290+
for (const field of ["license", "commercial", "attribution_required"]) {
291+
if (String(meta[field]) === "unknown") {
292+
errors.push(`${rel} is active but ${field} is unknown; use needs-review until it is settled`);
293+
}
294+
}
295+
return errors;
296+
}
297+
247298
/* ----------------------------------------------------------------- V11 */
248299
/**
249300
* A category README row must not contradict its entry's frontmatter. The

‎site/checks.test.mjs‎

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import fs from "node:fs";
1010
import path from "node:path";
1111
import { fileURLToPath } from "node:url";
1212
import {
13+
checkActiveIsSettled,
1314
checkAttributionConsistency,
1415
checkCategoryReadmeRows,
1516
checkCountTables,
@@ -19,6 +20,7 @@ import {
1920
checkPublisherConsistency,
2021
checkSpdxConsistency,
2122
checkTaxonomyValues,
23+
checkValueSpellings,
2224
} from "./checks.mjs";
2325

2426
const __dirname = path.dirname(fileURLToPath(import.meta.url));
@@ -454,10 +456,55 @@ accepts(
454456
);
455457
accepts("V12 stays quiet when the optional fields are absent", checkTaxonomyValues("ok.md", {}));
456458

459+
/* V13 ------------------------------------------------------------------- */
460+
rejects(
461+
"V13 rejects a format spelt two ways across entries",
462+
checkValueSpellings([
463+
{ rel: "a.md", meta: { formats: ["PNG", "glTF"] } },
464+
{ rel: "b.md", meta: { formats: ["png"] } },
465+
]),
466+
'formats spells one value several ways: "PNG" (a.md), "png" (b.md)'
467+
);
468+
rejects(
469+
"V13 rejects a subcategory that differs only by punctuation",
470+
checkValueSpellings([
471+
{ rel: "a.md", meta: { subcategories: ["field-recordings"] } },
472+
{ rel: "b.md", meta: { subcategories: ["field_recordings"] } },
473+
]),
474+
"subcategories spells one value several ways"
475+
);
476+
accepts(
477+
"V13 accepts one spelling used many times, and leaves plurals alone",
478+
checkValueSpellings([
479+
{ rel: "a.md", meta: { formats: ["PNG"], subcategories: ["character"] } },
480+
{ rel: "b.md", meta: { formats: ["PNG"], subcategories: ["characters"] } },
481+
])
482+
);
483+
484+
/* V14 ------------------------------------------------------------------- */
485+
rejects(
486+
"V14 rejects an active entry with unknown attribution",
487+
checkActiveIsSettled("bad.md", { status: "active", license: "custom", commercial: true, attribution_required: "unknown" }),
488+
"is active but attribution_required is unknown"
489+
);
490+
rejects(
491+
"V14 rejects an active entry with an unknown licence",
492+
checkActiveIsSettled("bad.md", { status: "active", license: "unknown", commercial: true, attribution_required: false }),
493+
"is active but license is unknown"
494+
);
495+
accepts(
496+
"V14 accepts unknowns on a needs-review entry",
497+
checkActiveIsSettled("ok.md", { status: "needs-review", license: "unknown", commercial: "unknown", attribution_required: "unknown" })
498+
);
499+
accepts(
500+
"V14 accepts a settled active entry",
501+
checkActiveIsSettled("ok.md", { status: "active", license: "MIT", commercial: true, attribution_required: false })
502+
);
503+
457504
/* ----------------------------------------------------------------------- */
458505
if (failures.length) {
459506
console.error(`checks.test failed (${failures.length}):`);
460507
for (const f of failures) console.error(` - ${f}`);
461508
process.exit(1);
462509
}
463-
console.log(`checks.test ok: ${passed} assertions across 12 checks`);
510+
console.log(`checks.test ok: ${passed} assertions across 14 checks`);

‎site/validate.mjs‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import fs from "node:fs";
66
import path from "node:path";
77
import { fileURLToPath } from "node:url";
88
import {
9+
checkActiveIsSettled,
910
checkAttributionConsistency,
1011
checkCategoryReadmeRows,
1112
checkCountTables,
@@ -15,6 +16,7 @@ import {
1516
checkPublisherConsistency,
1617
checkSpdxConsistency,
1718
checkTaxonomyValues,
19+
checkValueSpellings,
1820
} from "./checks.mjs";
1921

2022
const __dirname = path.dirname(fileURLToPath(import.meta.url));
@@ -301,6 +303,7 @@ function main() {
301303
errors.push(...checkEvidenceDates(rel, meta, body, today));
302304
errors.push(...checkDeprecationReason(rel, meta, body, vocab));
303305
errors.push(...checkTaxonomyValues(rel, meta));
306+
errors.push(...checkActiveIsSettled(rel, meta));
304307
if (meta.id) {
305308
const id = String(meta.id);
306309
if (ids.has(id)) errors.push(`duplicate id "${id}": ${ids.get(id)} and ${rel}`);
@@ -336,6 +339,7 @@ function main() {
336339
}
337340

338341
errors.push(...checkPublisherConsistency(records));
342+
errors.push(...checkValueSpellings(records));
339343

340344
const byCategory = new Map();
341345
for (const record of records) {

0 commit comments

Comments
 (0)