the lint learns the downstream-output carve-out (developer, 2026-11-29): calibration.md and packager-calibration.md capture model emissions verbatim as research records, and the ASCII rule is for authored prose -- a captured emission's bytes are the datum, rewriting them falsifies the record. Rule 1 scopes around the two files; every other rule still applies. The lint is green again after 8ef96c7 shipped the files past it -- the staging-order miss, 'lint again after staging' bit exactly as written.
This commit is contained in:
+18
-8
@@ -64,6 +64,13 @@ const substrateProse = (f) => f === 'README.md' || ROOT_PROMPTS.has(f);
|
||||
// the checker's own source names what it bans (the rule patterns and
|
||||
// their comments); it is exempt from the rules it defines
|
||||
const isSelf = (f) => f === 'test/check-repo.mjs';
|
||||
// rule 1's carve-out (developer, 2026-11-29): downstream output --
|
||||
// files that capture model emissions verbatim as research records.
|
||||
// The ASCII rule is for authored prose ("the encoding is the
|
||||
// problem, never the visual"); a captured emission's bytes are the
|
||||
// datum, and rewriting them would falsify the record. Rule 1 only --
|
||||
// every other rule still applies to these files.
|
||||
const downstreamOutput = (f) => f === 'calibration.md' || f === 'packager-calibration.md';
|
||||
|
||||
// rule 10's patterns, derived at runtime so this file never contains
|
||||
// the facts it bans (a literal here would be the leak itself). The
|
||||
@@ -84,15 +91,18 @@ for (const f of files) {
|
||||
if (buf.includes(0)) continue; // binary -- no text rules to enforce
|
||||
const text = buf.toString('utf8');
|
||||
|
||||
// rule 1: ascii bytes
|
||||
text.split('\n').forEach((line, i) => {
|
||||
for (const ch of line) {
|
||||
if (ch.charCodeAt(0) > 0x7f) {
|
||||
fail(`${f}:${i + 1} non-ascii U+${ch.charCodeAt(0).toString(16).padStart(4, '0')} "${ch}"`);
|
||||
break; // one report per line is plenty
|
||||
// rule 1: ascii bytes (downstream output exempt -- the helper's
|
||||
// comment carries the ruling)
|
||||
if (!downstreamOutput(f)) {
|
||||
text.split('\n').forEach((line, i) => {
|
||||
for (const ch of line) {
|
||||
if (ch.charCodeAt(0) > 0x7f) {
|
||||
fail(`${f}:${i + 1} non-ascii U+${ch.charCodeAt(0).toString(16).padStart(4, '0')} "${ch}"`);
|
||||
break; // one report per line is plenty
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// rule 2: no text-mutating css. text-transform is linted in every
|
||||
// code file (it only ever appears as a css property -- inline
|
||||
|
||||
Reference in New Issue
Block a user