Skip to content

feat(serve): variant source-linkage slices a+b (REQ-265, DD-077)#717

Merged
avrabe merged 1 commit into
mainfrom
feat/req-265-ab-source-linkage
Jul 16, 2026
Merged

feat(serve): variant source-linkage slices a+b (REQ-265, DD-077)#717
avrabe merged 1 commit into
mainfrom
feat/req-265-ab-source-linkage

Conversation

@avrabe

@avrabe avrabe commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

REQ-265 slices a+b — variant source-linkage (v0.29.0)

DD-077 scopes REQ-265 (variant source-linkage completeness) into four
independently-shippable slices. This PR lands the two small, serve-side ones;
(c) and (d) follow, so REQ-265 stays proposed.

Slice (a) — external source links are honest

resolve_source_file fell back to the raw absolute path for an external
artifact (source_file outside the project root), producing a link the
/source path-traversal guard then rejects — a dead link. Now returns
None for out-of-project paths so the UI renders no link instead of a broken
one. (Serving external source from a configured external root is a larger,
security-sensitive follow-on — deferred.)

Slice (b) — variant scope leak

The /artifacts external loop added externals without consulting
variant_scope
, so a variant-scoped view still showed unscoped externals.
An external has no binding to this project's feature model and cannot be
variant-scoped, so under an active variant it is now excluded — mirroring
the existing stats/diagnostics exclusion.

Tests

  • 3 unit tests for resolve_source_file (in-project → relative; external →
    None; absent → None).
  • Serve integration test: origin=all includes the spar: externals, but
    origin=all&variant=minimal-ci excludes every external-origin row.

Verification

New tests pass · clippy --all-targets (1.97.0) clean · rivet validate +
docs check PASS. Serve only — composition core and wasm seam untouched.

Refs: REQ-265, DD-077

🤖 Generated with Claude Code

…s, no scope leak (REQ-265)

DD-077 scopes REQ-265 (variant source-linkage completeness) into four
independently-shippable slices. This lands the two small serve-side ones:

Slice (a) — external source links are honest. `resolve_source_file` fell
back to the raw absolute path for an external artifact (source_file outside
the project root), producing a link the `/source` path-traversal guard then
rejects: a dead link. Return None for out-of-project paths so the UI renders
no link rather than a broken one. (Serving external source from a configured
external root is a larger, security-sensitive follow-on, deferred.)

Slice (b) — variant scope leak. The `/artifacts` external loop added
externals without consulting `variant_scope`, so a variant-scoped view still
showed unscoped externals. An external artifact has no binding to this
project's feature model and cannot be variant-scoped, so under an active
variant it is now excluded — mirroring the existing stats/diagnostics
exclusion.

Tests: three unit tests for `resolve_source_file` (in-project relative,
external None, absent None); a serve integration test asserting `origin=all`
includes the `spar:` externals but `origin=all&variant=minimal-ci` excludes
every external-origin row.

Slices (c) binding source-globs reach serve and (d) `export --variant`
remain; REQ-265 stays proposed until all four land. Confirmed with the new
tests, clippy --all-targets clean, rivet validate + docs check PASS. Serve
only — composition core and wasm seam untouched.

Refs: REQ-265, DD-077

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Rivet Criterion Benchmarks'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.

Benchmark suite Current: 6778e94 Previous: 2ff1c09 Ratio
traceability_matrix/1000 59265 ns/iter (± 506) 44662 ns/iter (± 165) 1.33
query/10000 326469 ns/iter (± 2999) 229887 ns/iter (± 3997) 1.42

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions

Copy link
Copy Markdown

📐 Rivet artifact delta

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

Graph

graph LR
  DD_077["DD-077"]:::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
  • DD-077

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

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

@codecov

codecov Bot commented Jul 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@avrabe
avrabe merged commit 2df2fe4 into main Jul 16, 2026
30 checks passed
@avrabe
avrabe deleted the feat/req-265-ab-source-linkage branch July 16, 2026 19:57
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