Add version mismatch warnings and validate component requirements#32
Merged
Add version mismatch warnings and validate component requirements#32
Conversation
…ATCH# prefix Changed warning output to: - Use stderr instead of stdout (appears in red in most terminals) - Add distinctive #FIRE_VERSION_MISMATCH# prefix for easy grepping - Makes warnings stand out from other build warnings Example output: ``` #FIRE_VERSION_MISMATCH# WARNING: velocity_requirements.sysreq.md: Reference to REQ-BRK-001 specifies version=1, but braking_requirements.sysreq.md is at version=2 ``` Benefits: - Easy to find with `grep FIRE_VERSION_MISMATCH` - Stands out visually with red text (stderr) - Distinctive prefix prevents confusion with other warnings 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Changed format to: WARNING: #FIRE_VERSION_MISMATCH# - Added ANSI light red color to WARNING: text (\033[91m) - Keep using stderr for red terminal output - Makes warnings easily greppable and visually distinctive Example output: WARNING: #FIRE_VERSION_MISMATCH# file.md: Reference to REQ-001 specifies version=1, but target.md is at version=2 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Changed from "#FIRE_VERSION_MISMATCH#" to "REQUIREMENT VERSION MISMATCH!" for better readability. Example output: WARNING: REQUIREMENT VERSION MISMATCH! file.md: Reference to REQ-001 specifies version=1, but target.md is at version=2 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Changed warning output from stderr to stdout so Bazel displays them during build/test runs. Bazel suppresses stderr from successful actions, but shows stdout when the action has output. Now warnings appear like this during builds: INFO: From Validating cross-references in vehicle_requirements_validation: WARNING: REQUIREMENT VERSION MISMATCH! file.md: Reference to REQ-001 specifies version=1, but target.md is at version=2 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Previously only system requirements (*.sysreq.md) were validated. Now also validating software component requirements (*.swreq.md): - brake_actuator.swreq.md (5 requirements) - brake_controller.swreq.md (7 requirements) - vehicle_status.swreq.md (5 requirements) This catches 17 additional version mismatch warnings that were previously hidden. Also fixed validation logic to skip bi-directional frontmatter/body consistency checks for multi-requirement documents (those without 'id' in frontmatter). These documents use inline YAML blocks per requirement rather than centralized frontmatter references. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
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.
Summary
Changes
Version Mismatch Warnings
fire/starlark/validate_cross_references.py
?version=Nquery parameters in requirement referencesWARNING: REQUIREMENT VERSION MISMATCH! file.md: Reference to REQ-001 specifies version=1, but target.md is at version=2Component Requirements Validation
examples/BUILD.bazel
component_requirementstarget to validate software component requirementsbrake_actuator.swreq.md,brake_controller.swreq.md,vehicle_status.swreq.mdfire/starlark/validate_cross_references.py
idfield use inline YAML blocks per requirement, not centralized frontmatterImpact
Warnings Now Visible
Before: Version mismatches were silent - no warnings at all
After: 19 version mismatch warnings clearly displayed during builds:
Example output during
bazel build:Requirements Coverage
Before: Only 3 system requirement files validated
After: 6 files validated (3 system + 3 component requirements)
Test Plan
bazel build //examples:allRelated Work
This builds on the cross-reference validation framework and complements:
🤖 Generated with Claude Code