Skip to content

fix(externals): resolve refs with a hyphenated (kebab) prefix (REQ-143)#384

Merged
avrabe merged 1 commit into
mainfrom
fix/external-prefix-hyphen
Jun 2, 2026
Merged

fix(externals): resolve refs with a hyphenated (kebab) prefix (REQ-143)#384
avrabe merged 1 commit into
mainfrom
fix/external-prefix-hyphen

Conversation

@avrabe
Copy link
Copy Markdown
Contributor

@avrabe avrabe commented Jun 2, 2026

User report (0.14.0)

/artifacts/linc-mesh:A-AVTP-STREAM → Not Found. Artifact linc-mesh:A-AVTP-STREAM does not exist. …even though i browsed it and i know it is there. …generally still the external artifacts are not to be found.

Root cause

externals::parse_artifact_ref required the prefix to be purely is_ascii_lowercase() — no hyphens (the old doc-comment even said so). A kebab-case project slug like linc-mesh failed that check, so linc-mesh:A-AVTP-STREAM fell through to ArtifactRef::Local(...) and was looked up as a local id → 404.

The kicker: externals are stored as <prefix>:<id> using that same hyphenated prefix (ProjectContext does artifact.id = format!("{}:{}", ext.prefix, artifact.id)), so the parser no longer round-tripped its own output. Every external whose prefix contained a hyphen was unreachable in:

  • the serve detail view (render_artifact_detailparse_artifact_ref), and
  • document link resolution (same function).

One shared gate, so one fix restores both surfaces.

Fix

Accept a kebab-case slug prefix: leading lowercase letter, then lowercase letters / digits / hyphens. Requiring a leading letter keeps an ordinary local id with a colon (e.g. H-1:2) from being misread as a cross-repo ref.

Verification

  • New tests: linc-mesh:A-AVTP-STREAM and linc2:REQ-1External; H-1:2 and -bad:REQ-1Local. The existing H-1.2 and rivet:REQ-001 cases still pass. All 28 externals::tests green.
  • Kani round-trip proof updated to the new prefix contract.
  • clippy --all-targets + fmt clean; rivet validate PASS.

Also in this iteration (triaged, filed, not yet fixed)

Two more user reports filed as draft REQs to work next:

  • REQ-144 — source-view links match substrings (SWR-001 wrongly linked inside SDV-BCM-SWR-001); render/source.rs uses str::contains, needs whole-token match.
  • REQ-145 — JUnit import should honor a per-testcase rivet_tc_id property instead of classname.name.

Fixes: REQ-143

🤖 Generated with Claude Code

User-reported (0.14.0): `/artifacts/linc-mesh:A-AVTP-STREAM` in serve
returned "Artifact does not exist", and external `prefix:ID` refs with a
kebab-case prefix were unresolved in document rendering, although the
artifact existed in the external project.

Root cause: `parse_artifact_ref` required the prefix to be purely
`is_ascii_lowercase()` — no hyphens — so a project slug like `linc-mesh`
fell through to `ArtifactRef::Local("linc-mesh:A-AVTP-STREAM")` and was
looked up as a local id (404). But externals are stored as
`<prefix>:<id>` with that same hyphenated prefix, so the parser no longer
round-tripped its own stored form. Every external whose prefix contained
a hyphen was unreachable in the serve detail view and in document link
resolution (both delegate to this one function).

Fix: accept a kebab-case slug prefix — leading lowercase letter, then
lowercase letters / digits / hyphens. Updated the Kani round-trip proof
to the new contract. Regression tests: `linc-mesh:A-AVTP-STREAM` and
`linc2:REQ-1` parse as External; non-slug `H-1:2` / `-bad:REQ-1` stay
Local; all 28 externals tests pass.

Also files REQ-144 (source-view substring mis-link) and REQ-145
(test-results `rivet_tc_id` property) — two more user reports triaged
this iteration, draft, to be worked next.

Fixes: REQ-143
Refs: REQ-085, REQ-144, REQ-145

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

📐 Rivet artifact delta

Change Count
Added 3
Removed 0
Modified 0
Downstream impacted (depth ≤ 5) 0

Graph

graph LR
  REQ_143["REQ-143"]:::added
  REQ_144["REQ-144"]:::added
  REQ_145["REQ-145"]:::added
  classDef added fill:#d4edda,stroke:#28a745,color:#155724
  classDef removed fill:#f8d7da,stroke:#dc3545,color:#721c24
  classDef modified fill:#fff3cd,stroke:#ffc107,color:#856404
  classDef overflow fill:#e2e3e5,stroke:#6c757d,color:#495057,stroke-dasharray: 3 3
Loading
Added
  • REQ-143
  • REQ-144
  • REQ-145

📎 Full HTML dashboard attached as workflow artifact rivet-delta-pr-384download from the workflow run.

Posted by rivet-delta workflow. The graph shows only changed artifacts; open the HTML dashboard (above) for full context.

@avrabe avrabe merged commit 7965e6d into main Jun 2, 2026
18 of 38 checks passed
@avrabe avrabe deleted the fix/external-prefix-hyphen branch June 2, 2026 05:59
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 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