Implement configurable document types (#224)#226
Merged
Conversation
Add a YAML-driven configuration system that allows consumers to define custom document types with their own metadata fields and validation rules. - Add default_fire_config.yaml matching the built-in sysreq/swreq/regreq types - Add config_models.py with Pydantic models for config schema (FireConfig, FieldDefinition, DocumentTypeDefinition) and load_config() - Add dynamic_requirement_model.py that builds Pydantic validation models from config at runtime, matching the static models' behaviour - Wire --config into validate_cross_references.py and release_report.py - Add optional config attr to requirement_library() and release_report() rules - Add generate_format_spec.py and format_spec.bzl for auto-generating FORMAT_SPECIFICATION.md from config - Document custom document types in README.md Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Path(__file__).parent does not resolve correctly in Bazel runfiles on Windows. Embed the default FIRE configuration as a Python string constant instead of reading default_fire_config.yaml at runtime. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds a custom_config/ directory to the integration test with: - A fire_config.yaml defining a custom .handbook.md document type - A handbook requirement (HB-001) and a sysreq linking to it - BUILD targets exercising requirement_library(config=...), generate_format_specification(), and release_report(config=...) - Verification in run.sh that the generated format spec contains the custom type and the release report includes the handbook requirement Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The custom fire_config.yaml should be comprehensive — include swreq and regreq alongside the new handbook type, since consumers are expected to define all the document types they need. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
A custom fire_config.yaml fully replaces the built-in configuration, it does not extend it. Updated the wording and example to make this clear. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
MSYS2 (Git Bash on Windows) converts //path arguments to /path, breaking Bazel target labels like //custom_config:target. Set MSYS2_ARG_CONV_EXCL="*" to disable this conversion. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
MSYS2_ARG_CONV_EXCL="*" was too broad and prevented conversion of real file paths like --repository_cache=$HOME/.cache/bazel-repo. Restrict the exclusion to arguments starting with // (Bazel target labels) so that file path arguments are still converted correctly. Co-Authored-By: Claude Opus 4.6 <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
configattribute intorequirement_library(),release_report(), and their Python scriptsgenerate_format_specification()Bazel rule to auto-generate FORMAT_SPECIFICATION.md from configdefault_fire_config.yamlmatching the built-in sysreq/swreq/regreq types (including new PL-a through PL-d values)Implements the design from #225.
New files
fire/starlark/default_fire_config.yamlfire/starlark/config_models.pyload_config()fire/starlark/dynamic_requirement_model.pyfire/starlark/generate_format_spec.pyfire/starlark/format_spec.bzlgenerate_format_specification()Test plan
bazel build //...succeeds🤖 Generated with Claude Code