Skip to content

feat: add type-map config to ReqIF adapter#7

Merged
avrabe merged 14 commits intomainfrom
feat/reqif-type-map
Mar 10, 2026
Merged

feat: add type-map config to ReqIF adapter#7
avrabe merged 14 commits intomainfrom
feat/reqif-type-map

Conversation

@avrabe
Copy link
Contributor

@avrabe avrabe commented Mar 10, 2026

Summary

  • Add type-map.* config support to the ReqIF import adapter
  • Allows remapping artifact types during import (e.g. requirementsw-req)
  • Unmapped types pass through unchanged
  • Config threaded through parse_reqif() and import_reqif_directory()

Motivation

StrictDoc ReqIF exports use generic types (REQUIREMENT, SECTION, TEXT) that don't match ASPICE schema types (sw-req, system-req). This feature lets projects remap types at import time:

sources:
  - path: upstream.reqif
    format: reqif
    config:
      type-map.requirement: sw-req
      type-map.section: documentation

Test plan

  • New unit test test_type_map_remaps_artifact_types — verifies mapping and passthrough
  • All existing ReqIF tests pass (roundtrip, minimal, duplicate attrs, StrictDoc integration)
  • Fuzz target updated for new signature
  • Integration test updated for new signature

🤖 Generated with Claude Code

avrabe and others added 4 commits March 9, 2026 19:55
Comprehensive audit covering source-ref integrity (20 refs, 1 fixed),
test coverage (151 tests across 6 levels), benchmark coverage (19 cases
in 7 groups), fuzz/mutation testing status (not yet implemented), and
traceability (85 artifacts, 0 broken links, 0 orphans).

Fix DD-002 source-ref from non-existent graph.rs to links.rs.

Overall quality score: 73% — strong foundation with gaps in fuzz
testing, mutation testing, and benchmark coverage for newer modules.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add 4 fuzz targets (cargo-fuzz/libfuzzer) for untrusted-input boundaries:
- fuzz_yaml_artifact: YAML artifact deserialization
- fuzz_schema_merge: schema parsing and merge operations
- fuzz_reqif_import: ReqIF XML import parsing
- fuzz_document_parse: markdown frontmatter parsing

Add 3 new benchmark groups (9 cases) to core_benchmarks.rs:
- diff: ArtifactDiff::compute at 100/1000/10000 scale
- query: query::execute filtering at 100/1000/10000 scale
- document_parse: Document::parse at 10/100/1000 sections

Update pre-commit hooks:
- rivet validate --strict (dogfood on artifact/schema changes)
- cargo bench --no-run (compile check, pre-push)
- cargo mutants smoke run (pre-push)

Add CI jobs:
- mutants: cargo-mutants on rivet-core (informational, non-blocking)
- fuzz: 30s per target on push to main (informational, non-blocking)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…s, ReqIF.ForeignID)

StrictDoc's ReqIF output uses patterns rivet didn't handle:
- ATTRIBUTE-DEFINITION-ENUMERATION interleaved with STRING defs
  (quick-xml failed with "duplicate field"). Fixed by enabling the
  overlapped-lists feature.
- ATTRIBUTE-VALUE-ENUMERATION for enum fields (e.g. TYPE=Functional).
  Added enum value resolution via DATATYPE-DEFINITION-ENUMERATION.
- ReqIF.ForeignID as the human-readable UID (ZEP-SRS-18-1), with
  the XML IDENTIFIER being a UUID. Now used as artifact ID.
- ReqIF.Name / ReqIF.ChapterName as title, ReqIF.Text as description.
- SPECIFICATION-TYPE elements (parsed but ignored).
- Duplicate ATTRIBUTE-DEFINITION-STRING tolerance (first wins).
- UUID-to-resolved-ID mapping for SPEC-RELATION link targets.

Tested with Zephyr RTOS reqmgmt export: 256 artifacts, 223
requirements with ZEP-* IDs, 132 parent links preserved.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Support remapping artifact types during ReqIF import via source config:

  sources:
    - path: upstream.reqif
      format: reqif
      config:
        type-map.requirement: sw-req
        type-map.section: documentation

Keys are matched case-insensitively against the resolved artifact type.
Unmapped types pass through unchanged.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@codecov
Copy link

codecov bot commented Mar 10, 2026

Codecov Report

❌ Patch coverage is 82.96089% with 122 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
rivet-core/src/reqif.rs 70.50% 59 Missing ⚠️
rivet-core/src/commits.rs 92.38% 37 Missing ⚠️
rivet-core/src/formats/aadl.rs 0.00% 20 Missing ⚠️
rivet-core/src/model.rs 0.00% 6 Missing ⚠️

📢 Thoughts on this report? Let us know!

avrabe and others added 10 commits March 10, 2026 20:14
…fooding

Adds `rivet commits` and `rivet commit-msg-check` commands for tracing
git commits to artifacts. Includes trace-exempt-artifacts config for
pre-existing artifacts, pre-commit hook setup, and built-in documentation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…L access

Eliminates /?goto= redirect pattern that caused race conditions, lost
query params and hash fragments. Non-HTMX requests now get full page
layout wrapped around the partial content inline.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… analyses

Bumps spar to rev 5073591, syncs WIT with analyze function and
analysis-diagnostic record, registers 12 new analysis passes
(flow/mode/binding/property rules, EMV2, ARINC653, etc.).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Design covers mesh topology, prefixed IDs, externals config, cache/sync,
distributed baselining, and WASM embedding. 12-task implementation plan
with TDD steps. Also includes commit traceability design/plan.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Bump spar-hir and spar-analysis from rev 5073591 to 84a7363 (latest
origin/main, 0 commits behind). Adds build_wasm_assets() to build.rs
which auto-builds spar WASM assets when missing if spar repo is
available (via SPAR_DIR env var or ../spar default).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Compares local spar repo HEAD against the rev pinned in Cargo.toml
at build time. Warns when they diverge, showing commit distance
and suggesting cargo update command.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Kill and wait child process before panicking in serve_integration test
to avoid zombie processes. Inline unnecessary let binding in serve.rs
git-ref prefix computation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
cargo-mutants no longer accepts --lib directly; pass it after --
as a cargo test argument.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@avrabe avrabe merged commit 3b04f01 into main Mar 10, 2026
14 of 15 checks passed
@avrabe avrabe deleted the feat/reqif-type-map branch March 10, 2026 21:10
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