feat: yaml-section schema metadata for schema-driven parsing#112
Merged
Conversation
Schema-declared metadata for format-specific parsing:
- yaml-section: maps a top-level YAML key to an artifact type
(e.g., 'losses' → type 'loss')
- shorthand-links: maps shorthand array fields to link types
(e.g., 'hazards: [H-1]' → links: [{type: prevents, target: H-1}])
Added to STPA schema types: loss, hazard, sub-hazard,
system-constraint, controller, controlled-process, control-action, uca.
This is the foundation for schema-driven parsing that will replace
the hardcoded STPA adapter (stpa.rs).
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
Foundation for schema-driven YAML parsing (#93, #22):
Adds
yaml-sectionandshorthand-linksfields toArtifactTypeDef:yaml-section: losses— tells parser "thelosses:key contains artifacts of typeloss"shorthand-links: {hazards: leads-to-loss}— tells parser "converthazards: [H-1]to links"Applied to all STPA schema types. This metadata will allow a single schema-driven parser to replace the 700-line hardcoded
stpa.rsadapter.Rowan YAML parser is next step — will use this metadata for extraction.
Refs #22, #93.
🤖 Generated with Claude Code