Skip to content

feat: yaml-section schema metadata for schema-driven parsing#112

Merged
avrabe merged 1 commit intomainfrom
feat/schema-driven-parsing
Apr 2, 2026
Merged

feat: yaml-section schema metadata for schema-driven parsing#112
avrabe merged 1 commit intomainfrom
feat/schema-driven-parsing

Conversation

@avrabe
Copy link
Copy Markdown
Contributor

@avrabe avrabe commented Apr 2, 2026

Summary

Foundation for schema-driven YAML parsing (#93, #22):

Adds yaml-section and shorthand-links fields to ArtifactTypeDef:

  • yaml-section: losses — tells parser "the losses: key contains artifacts of type loss"
  • shorthand-links: {hazards: leads-to-loss} — tells parser "convert hazards: [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.rs adapter.

Rowan YAML parser is next step — will use this metadata for extraction.

Refs #22, #93.

🤖 Generated with Claude Code

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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant