feat: add cross-file reference validator to CI pipeline#1490
Closed
arcaven wants to merge 1 commit intobmad-code-org:mainfrom
Closed
feat: add cross-file reference validator to CI pipeline#1490arcaven wants to merge 1 commit intobmad-code-org:mainfrom
arcaven wants to merge 1 commit intobmad-code-org:mainfrom
Conversation
Add tools/validate-file-refs.js that validates cross-file references
in BMAD source files (agents, workflows, tasks, steps). Catches broken
file paths, missing referenced files, wrong extensions, and absolute
path leaks before they reach users.
Addresses broken-file-ref and path-handling bug classes which account
for 25% of all historical bugs (59 closed issues, 129+ comments).
- Scans src/ for YAML, markdown, and XML files
- Validates {project-root}/_bmad/ references against source tree
- Checks relative path references, exec attributes, invoke-task tags
- Detects absolute path leaks (/Users/, /home/, C:\)
- Adds validate:refs npm script and CI step in quality.yaml
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Add
tools/validate-file-refs.js— a CI validator that checks cross-file references in BMAD source files (agents, workflows, tasks, steps) and detects absolute path leaks.Why
Analysis of all 422 closed issues shows broken file references and path handling account for 59 bugs (25% of all bugs) and 129+ maintainer/user comments. These two categories have zero existing automated prevention — no validator, no CI check, no pre-commit hook catches them today. When files are renamed, moved, or have extensions changed (e.g.,
.yaml→.mdmigration), stale references are left behind and only discovered by users post-release.On first run against the current
mainbranch, the validator immediately finds 6 genuine broken references including wrong extensions (.yamlvs.md), missing files, and incorrect relative paths — confirming the ongoing need.How
src/for YAML, markdown, and XML files (~212 files, ~480 references){project-root}/_bmad/references by mapping to source tree paths./,../),execattributes,<invoke-task>tags, step metadata, and Load directives/Users/,/home/,C:\)validate:refsnpm script and step inquality.yamlvalidate jobnode:fs,node:path, andyaml(existing dep)validate-doc-links.jsscan→extract→resolve→report patternTesting
npm run validate:refs(currently finds 6 pre-existing broken refs onmain)test:schemas,test:install,validate:schemas, lint, format)