From 5b80f305e99338d9471d517f2d89147bdad58d8c Mon Sep 17 00:00:00 2001 From: Defame1297 Date: Mon, 31 Aug 2026 08:28:25 +0000 Subject: [PATCH] test(kyberforge): pin the provenance checker's three new behaviours 27a7669 changed validate-provenance.sh in three ways and tested none of them: the bullet-form parser returning None rather than [] on unparsable input, the source_keys: [] house-authored declaration, and the stripping of section annotations off a Research doc path. All three are checks that previously failed by staying silent, which is the failure mode this repo keeps rediscovering. Shipping them untested left nothing to catch a regression back to silence. The 22 cases assert consequences rather than return values -- that check 8 runs on an unparsable block, that an unresolvable path emits an INFO naming its slug -- and each was verified against a deliberate mutation of the behaviour it covers. Addresses #111. --- .../tests/validate-provenance.bats | 473 ++++++++++++++++++ 1 file changed, 473 insertions(+) diff --git a/plugins/kyberforge/.apm/skills/skill-audit/tests/validate-provenance.bats b/plugins/kyberforge/.apm/skills/skill-audit/tests/validate-provenance.bats index 58dc65e..7b0df0c 100644 --- a/plugins/kyberforge/.apm/skills/skill-audit/tests/validate-provenance.bats +++ b/plugins/kyberforge/.apm/skills/skill-audit/tests/validate-provenance.bats @@ -64,6 +64,43 @@ EOF - **Contributing files:** ${contrib} - **Research doc:** ${research} - **Status:** \`extracted\` +EOF + } + + # Helper: create a fake repo (a .git marker makes find_repo_root stop there) + # holding one skill whose single sources.md slug points at the given + # Research doc value. Checks 7 and 8 only run for a skill inside a checkout, + # so every upstream case needs this shape; the research doc itself is + # written per test into "$repo/docs/research/my-research.md". + make_upstream_skill() { + local repo="$1" + local research="${2:-docs/research/my-research.md}" + local skill="$repo/my-skill" + mkdir -p "$skill/references" "$repo/docs/research" + touch "$repo/.git" + cat > "$skill/SKILL.md" < "$skill/references/sources.md" < "$fake_repo/docs/research/my-research.md" < "$fake_repo/docs/research/my-research.md" < "$fake_repo/docs/research/my-research.md" < "$fake_repo/docs/research/my-research.md" < "$fake_repo/docs/research/my-research.md" < "$skill/references/sources.md" < "$fake_repo/docs/research/my-research.md" < "$fake_repo/docs/research/my-research.md" < "$skill/references/extra.md" < "$skill/references/extra.md" < "$skill/references/extra.md" < "$skill/references/extra.md" < "$fake_repo/docs/research/my-research.md" < "$fake_repo/docs/research/my-research.md" < "$fake_repo/docs/research/my-research.md" < "$fake_repo/docs/research/my-research.md" <