compound-engineering-plugin icon indicating copy to clipboard operation
compound-engineering-plugin copied to clipboard

ce-compound: Phase 2 step 8 `scripts/validate-frontmatter.py` resolves against project root, not the skill dir → frontmatter validation silently skipped

Open Neikan-BSN opened this issue 6 months ago • 0 comments

Summary

ce-compound Phase 2 step 8 instructs the agent to:

Run python3 scripts/validate-frontmatter.py <output-path> to catch silent-corruption parser-safety issues …

That path is repo-relative. But validate-frontmatter.py does not exist in user repos — it ships inside the skill bundle at skills/ce-compound/scripts/validate-frontmatter.py (and an identical copy under skills/ce-compound-refresh/scripts/). So an agent reading scripts/… as project-root-relative looks in <repo>/scripts/, finds nothing, and silently skips the parser-safety validation step — the doc gets written and committed unvalidated.

Confirmed absent from scripts/ in 7 separate consuming repos; present only in the plugin bundle.

This is a recurring class, already fixed for sibling skills

Same defect, previously reported and closed for other skills:

  • #764 — ce-worktree: script path resolves against project root instead of plugin directory
  • #811 — ce-code-review resolve-base helper path resolves against project root

ce-compound's validate-frontmatter.py is another instance that slipped through the same fix.

Why it matters (and an irony)

The validator exists specifically to prevent the silent-YAML-data-loss class from #606 (/ce-compound emits invalid YAML frontmatter when symptoms[] item starts with backtick). Because step 8's invocation path is broken, the protection added for #606 doesn't actually run in normal usage — the exact silent-corruption it guards against can ship undetected.

Repro

  1. Run /ce-compound (Full mode) in any repo that doesn't happen to have its own scripts/validate-frontmatter.py.
  2. At Phase 2 step 8, python3 scripts/validate-frontmatter.py <doc> → No such file or directory.
  3. The agent (reasonably) treats the step as N/A and proceeds. No validation occurs.

Environment

  • Plugin: compound-engineering@compound-engineering-plugin v3.9.4 (gitCommitSha 422ffc77d1c8d269b9c7b400ad90d3929f1859f8)
  • Script confirmed stdlib-only (no PyYAML dep), so it runs fine once invoked at the right path.

Suggested fix

  1. In ce-compound Phase 2 step 8 (and ce-compound-refresh if it shares the pattern), resolve the script from the skill base directory, not project-root-relative — mirroring the #764/#811 fixes. The skill already surfaces its base dir at load (Base directory for this skill: <path>), so the instruction can point there, e.g. invoke <skill-base>/scripts/validate-frontmatter.py.
  2. The skill's Support Files section lists references/ and assets/ but not scripts/ — add it so the bundled helper is part of the documented contract.
  3. Keep the script skill-bundled (do not instruct users to copy it per-repo — that would drift from the canonical copy on plugin upgrades).

Happy to send a PR if useful.

Neikan-BSN avatar Jun 02 '26 10:06 Neikan-BSN