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

@ -504,3 +504,32 @@ test("the truncation guard spans a multiline plain scalar", () => {
assert.deepEqual(ok.errors, []);
assert.equal(ok.description, "Covers boards and the option-deletion hazard.");
});
test("the truncation guard ignores anchors and tags, which are not `#`", () => {
// YAML strips presentation syntax from the parsed value, so `&anchor` and
// `!!tag` make the raw scalar legitimately longer than what it parses to.
// A bare length comparison called those truncation and blamed a `#` that was
// nowhere in the text.
const mk = (value) =>
[
"---",
"name: alpha",
`description: ${value}`,
"disable-model-invocation: false",
"---",
"body",
].join("\n");
const anchored = parseSkill("alpha", mk("&copy Some valid text."));
assert.deepEqual(anchored.errors, []);
assert.equal(anchored.description, "Some valid text.");
const tagged = parseSkill("alpha", mk("!!str Some tagged text."));
assert.deepEqual(tagged.errors, []);
// The real case must still fail, so the gate is not simply disarmed.
assert.match(
parseSkill("alpha", mk("Covers board #28 (v2).")).errors.join(" "),
/`description` is truncated/,
);
});