docs: address Copilot review round 6 on #2203

The truncation guard rejected valid frontmatter. It assumed the only way
a raw scalar can exceed its parsed value is a comment, but YAML also
strips presentation syntax, so `description: &copy Some text` and
`description: !!str Some text` were both reported as truncated — naming
an unquoted `#` the value does not contain.

The length check is now gated on an actual comment marker: `#` at the
start of the scalar or preceded by whitespace, which is where YAML begins
a comment. Anchors and tags fall out before the length is consulted.
Regression cases cover both, and assert the genuine `#` case still fails
so the fix cannot pass by disarming the guard.

Also corrects the checklist, which still said an unquoted `#` lets every
check pass. That predated the verifier; verify:skills rejects it now, and
the sentence was telling authors the gate is blind to something it
catches.

No skill description or eval case changed, so skills:eval is unchanged
from round 4's 63/63. local:gate passes, 34/34. 391/391 script tests.

Signed-off-by: cliffhall <cliff@futurescale.com>
This commit is contained in:
cliffhall 2026-09-01 11:44:57 -04:00
commit 5d3571597a

View file

@ -192,6 +192,14 @@ export function parseSkill(dirName, text) {
const collapse = (s) => s.replace(/\s+/g, " ").trim();
const rawText = collapse(parts.join(" "));
const keptText = collapse(parsed);
// A raw scalar can legitimately be longer than the parsed value without any
// text being lost: YAML strips presentation syntax such as an anchor
// (`&name`) or a tag (`!!str`) from the value. Comparing lengths alone
// reported those as truncation, with a message blaming a `#` that is not
// there. Only look at the length when the scalar actually contains a comment
// marker — a `#` at the start or preceded by whitespace, which is precisely
// where YAML begins a comment (Copilot).
if (!/(^|\s)#/.test(rawText)) continue;
if (rawText.length > keptText.length) {
errors.push(
"`" +