User report
In source view:
doc-id: SDV-BCM-SWR-001
requirement-ids: "ALA-PAA / ALA-RSS / ALA-PPA (Alarms)"
the doc id can be wrongly interpreted if we have one req which is part of another requirement. e.g. SWR-001 and SDV-BCM-SWR-001.
Assessment (verified against code)
Confirmed. rivet-cli/src/render/source.rs matches artifact ids into source lines with str::contains:
- line ~841:
let has_artifact = artifact_ids.iter().any(|id| line.contains(id.as_str()));
- line ~856:
.filter(|id| line.contains(id.as_str()))
So if both SWR-001 and SDV-BCM-SWR-001 exist in the store, a line mentioning SDV-BCM-SWR-001 also matches SWR-001 as a substring — a phantom trace edge, which for a traceability tool is a correctness bug.
Suggested fix
Whole-token match: an id matches only when delimited by non-[A-Za-z0-9-] characters (ids contain hyphens, so - is part of the token, not a delimiter). A line containing SDV-BCM-SWR-001 must not link a shorter substring id SWR-001, while an exact, delimited SWR-001 still links.
Tracked as rivet artifact REQ-144. Will fix with a regression test covering the substring-vs-whole-token case.
User report
Assessment (verified against code)
Confirmed.
rivet-cli/src/render/source.rsmatches artifact ids into source lines withstr::contains:let has_artifact = artifact_ids.iter().any(|id| line.contains(id.as_str()));.filter(|id| line.contains(id.as_str()))So if both
SWR-001andSDV-BCM-SWR-001exist in the store, a line mentioningSDV-BCM-SWR-001also matchesSWR-001as a substring — a phantom trace edge, which for a traceability tool is a correctness bug.Suggested fix
Whole-token match: an id matches only when delimited by non-
[A-Za-z0-9-]characters (ids contain hyphens, so-is part of the token, not a delimiter). A line containingSDV-BCM-SWR-001must not link a shorter substring idSWR-001, while an exact, delimitedSWR-001still links.Tracked as rivet artifact REQ-144. Will fix with a regression test covering the substring-vs-whole-token case.