Fork card: depends capped at 8 lines of 1000 characters, 1000 UTF-8 bytes as a rule
Some checks failed
CultMesh QUIC native / Build win32-x64 (pull_request) Has been skipped
CultMesh QUIC native / Build linux-x64 (pull_request) Has been skipped
CultMesh QUIC native / Release native binaries (pull_request) Has been skipped
CultMesh portability and performance / ubuntu-latest reactive semantics and leases (pull_request) Has been cancelled
CultMesh QUIC native / Verify committed binaries match SHA256SUMS (pull_request) Has been cancelled

The card schema was looser than the stored question's depends (up to 8 Lines of
at most 1,000 UTF-8 bytes). The schema now bounds count and characters; the byte
limit is a card rule in both judges. Vectors: nine lines and 1001 characters
(schema), 501 two-byte characters (rule), and a card at both caps (valid).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
soul 2026-11-10 17:06:10 +00:00
commit 14b33d8a6d
6 changed files with 178 additions and 3 deletions

View file

@ -104,6 +104,7 @@ const cardRuleErrors = (c: Card): string[] => {
if (!ids.includes(c.recommendation)) errors.push("recommendation is not an option");
if (c.leans !== null && !ids.includes(c.leans)) errors.push("leans is not an option");
if (new Set(c.deciders).size !== c.deciders.length) errors.push("duplicate deciders");
if (c.depends.some((d) => Buffer.byteLength(d, "utf8") > 1000)) errors.push("a depends line is over 1000 UTF-8 bytes");
if (c.status === "open" && c.ruling !== null) errors.push("an open card names a ruling");
if (c.ruling === null && c.ruled_from.length > 0) errors.push("ruled_from without a ruling");
if (c.options_hash !== optionsHash(c)) errors.push("options_hash is not the hash of the shown members");