Commit Graph

2 Commits

Author SHA1 Message Date
cx-noam-brendel 6bf6a2b6d2 fix: address PR review comments
Changes per reviewer feedback:
- Remove ⚠️ CRITICAL warnings from documentation (per @alexeyv)
- Replace placeholder YAML examples with concrete values
- Simplify validation checklist text

Technical fixes per CodeRabbit:
- Remove .strict() that contradicted .passthrough()
- Add isCoreModule parameter for conditional default_selected validation
- Enforce mutual exclusivity: inherit/prompt and single-select/multi-select
- Use project_root for consistent path reporting
- Harden test runner with guarded access for error.issues
- Move parseTestMetadata inside try/catch block

All tests pass (52 agent + 17 module + 13 installation)
2026-01-26 15:41:45 +02:00
cx-noam-brendel 6dc292c850 fix(bmb): add module.yaml schema validation and fix #1288
- Add Zod schema validation for module.yaml files
- Create test suite for module schema with 17 test fixtures
- Fix create-module workflow to make 'code' field requirements clearer

Fixes #1288 - The create-module workflow could produce module.yaml files
without the required 'code' field or with placeholder text like '{module_code}'.

1. Created tools/schema/module.js with Zod validation for:
   - Required fields: code, name, header, subheader
   - Code format: kebab-case, 2-20 chars, starts with letter
   - Variable definitions with prompt/inherit patterns

2. Created tools/validate-module-schema.js CLI validator

3. Added npm scripts:
   - validate:modules - validates all module.yaml files
   - test:modules - runs module schema test suite

4. Updated BMB workflow instructions with explicit warnings about
   required fields in step-03-config.md and step-03-module-yaml.md

5. Added 17 test fixtures covering:
   - Missing required fields (code, name, header, subheader)
   - Invalid code formats (placeholder, uppercase, underscore, etc.)
   - Variable definitions (prompt, inherit, single-select, multi-select)

- npm run test:modules - 17/17 tests pass
- npm run validate:modules - All 5 existing modules pass
- npm test - Full test suite passes
2026-01-26 15:41:22 +02:00