* fix(#1905): normalize hand-authored backstop marker so it can't degrade to green A hand-authored non-inferable `backstop` truth with a stray trailing space (or surrounding quotes) silently graded {status:green} instead of abstaining — the exact #1154 false-pass. `truthVerification` returned null for any value != 'backstop'/'explicit', and the frontmatter continuation-KV parser preserved the stray whitespace captured inside the quotes. Normalize the marker before comparison (Postel) AND trim the continuation-KV value at the parser (durable root cause; also cleans the sibling check_target path). Regression: a trailing-space/quoted backstop truth now abstains (insufficient_spec), end-to-end from a hand-authored must_haves.truths block (#1820 rail). Refs #1905, epic #1904. * chore(changeset): Fixed fragment for #1909 (backstop marker normalize)
This commit is contained in:
@@ -366,6 +366,22 @@ Body content.`;
|
||||
assert.strictEqual(result[1], 'Coverage exceeds 80%');
|
||||
});
|
||||
|
||||
test('trims a continuation-KV value so a quoted trailing space does not survive (#1905, root cause of the #1154 false-pass)', () => {
|
||||
// A quoted value like `"backstop "` captures the inner trailing space in group 2; left untrimmed,
|
||||
// a hand-authored non-inferable `backstop` marker (#1820 spec-optional rail) degrades to `'backstop '`,
|
||||
// which `truthVerification` no longer recognizes → the truth silently grades green instead of abstaining.
|
||||
// Whitespace is never semantic in a scalar KV value, so the parser must trim it.
|
||||
const content = `---
|
||||
must_haves:
|
||||
truths:
|
||||
- statement: user data is never logged
|
||||
verification: "backstop "
|
||||
---
|
||||
Body.`;
|
||||
const result = parseMustHavesBlock(content, 'truths');
|
||||
assert.strictEqual(result[0].verification, 'backstop', 'the captured value is trimmed, not left as "backstop "');
|
||||
});
|
||||
|
||||
test('extracts artifacts as object array', () => {
|
||||
const content = `---
|
||||
phase: 01
|
||||
|
||||
Reference in New Issue
Block a user