You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The pattern only allows a single-segment prefix. A hyphen is a word boundary, so when prose mentions a multi-segment id, the regex matches the id's suffix instead of the id. That gives two failures:
False positive. synth has both TR-001 and CM-TR-001. Prose in CM-TR-002 that says "as CM-TR-001" produced:
WARN: [CM-TR-002] prose mentions 'TR-001' but no typed link to it; add a link in `links:` or remove the mention
False negative. An id like CM-TR-001 or CM-VER-001 is never matched whole, so a real prose mention with no typed link is never reported.
Repro
In any project with artifacts TR-001 and CM-TR-001 where both types allow a link type between them: put the text see CM-TR-001 in the description of a third artifact with no links, then run rivet validate. You get a warning naming TR-001 and none naming CM-TR-001.
Measured in synth: adding "as CM-TR-001" to three artifacts and "See CM-VER-001" to one moved warnings from 439 to 443. All four new warnings named the suffix (TR-001, VER-001).
Suggested shape
Match the longest id-shaped token, e.g. \b[A-Z][A-Z0-9]*(?:-[A-Z0-9]+)*-[0-9]+\b, then resolve it against the store. A test pairing TR-001 and CM-TR-001 pins both directions: no suffix warning, and the whole id is detected.
Found while working in synth (RQ-68-ORACLEABI, pulseengine/synth#1277), rivet 0.32.0; the regex is unchanged on main at v0.37.0.
What happens
rivet-core/src/validate.rs:116:The pattern only allows a single-segment prefix. A hyphen is a word boundary, so when prose mentions a multi-segment id, the regex matches the id's suffix instead of the id. That gives two failures:
TR-001andCM-TR-001. Prose inCM-TR-002that says "as CM-TR-001" produced:TR-001) would create a false trace to an unrelated requirement. Friction marking requirements implemented in a real project (rivet 0.13.3): silent file-skip, validate baseline noise, loop-modify no-op #353's suppression was added to prevent exactly that.CM-TR-001orCM-VER-001is never matched whole, so a real prose mention with no typed link is never reported.Repro
In any project with artifacts
TR-001andCM-TR-001where both types allow a link type between them: put the textsee CM-TR-001in the description of a third artifact with no links, then runrivet validate. You get a warning namingTR-001and none namingCM-TR-001.Measured in synth: adding "as CM-TR-001" to three artifacts and "See CM-VER-001" to one moved warnings from 439 to 443. All four new warnings named the suffix (
TR-001,VER-001).Suggested shape
Match the longest id-shaped token, e.g.
\b[A-Z][A-Z0-9]*(?:-[A-Z0-9]+)*-[0-9]+\b, then resolve it against the store. A test pairingTR-001andCM-TR-001pins both directions: no suffix warning, and the whole id is detected.