Skip to content

fix: STPA traceability chain + stpa-dev bridge#111

Merged
avrabe merged 1 commit intomainfrom
fix/traceability-chain
Apr 2, 2026
Merged

fix: STPA traceability chain + stpa-dev bridge#111
avrabe merged 1 commit intomainfrom
fix/traceability-chain

Conversation

@avrabe
Copy link
Copy Markdown
Contributor

@avrabe avrabe commented Apr 2, 2026

Summary

Fixes the end-to-end traceability chain so rivet tracks its own STPA analysis:

  • STPA adapter handles arbitrary filenames via content-based dispatch
  • STPA adapter accepts links: field alongside legacy shorthand (hazards:, losses:)
  • stpa-dev.bridge.yaml — connects system-constraints to requirements
  • Fixed link types in STPA analysis files
  • 548 artifacts, 99.8% coverage

Bigger issue identified

The STPA adapter (formats/stpa.rs) is ~700 lines of hardcoded serde structs duplicating what the schema already defines. This needs a schema-driven refactor — next PR.

🤖 Generated with Claude Code

The STPA YAML adapter now:
- Scans directories for non-standard filenames (content-based dispatch)
- Accepts optional 'links' field alongside legacy shorthand fields
  (hazards, losses) so STPA files can use the standard link format
- hazards and system-constraints fields are now optional (default empty)

Also:
- Fixed stpa-sec source format in rivet.yaml
- Added stpa-dev.bridge.yaml for constraint → requirement traceability
- Fixed link types in STPA analysis files (enforces → prevents)

Result: 548 artifacts, 99.8% coverage
@avrabe avrabe merged commit aba9c5f into main Apr 2, 2026
@avrabe avrabe deleted the fix/traceability-chain branch April 2, 2026 02:33
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 2, 2026

Codecov Report

❌ Patch coverage is 71.15385% with 30 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
rivet-core/src/formats/stpa.rs 71.15% 30 Missing ⚠️

📢 Thoughts on this report? Let us know!

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