Skip to content

feat(driver): add explicit source provider boundary - #247

Merged
Teakowa merged 3 commits into
mainfrom
codex/issue-243-provider-boundary
Sep 2, 2026
Merged

feat(driver): add explicit source provider boundary#247
Teakowa merged 3 commits into
mainfrom
codex/issue-243-provider-boundary

Conversation

@e54-bot

@e54-bot e54-bot commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add a Wright-owned source-provider boundary carrying the selected language, entry path, and invocation cwd
  • route provider-returned canonical Workshop through workshop-rs and preserve explicit provider-artifact provenance
  • surface missing, unsupported, and failed providers as structured diagnostics without native OPY fallback
  • add boundary tests and document the ownership boundary

Validation

  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets --all-features -- -D warnings
  • cargo test --workspace --all-targets --all-features
  • cargo test -p wright-driver --test source_provider -- --nocapture
  • git diff --check

Scope

This implements the Wright-owned boundary for #243. The concrete LPP adapter is intentionally not included: current LPP v1 cannot carry an entry target, and protocol entry/project loading remains tracked by language-provider-protocol#16. Follow-up provider resolution and workflow wiring remain in #244, #245, and #246.

Refs #243

Add a Wright-owned entry and invocation-context seam for provider-backed OPY workflows. Preserve canonical Workshop handoff, structured provider failures, and explicit artifact provenance without a native fallback.

The current LPP v1 cannot carry an entry target, so protocol entry/project loading remains a follow-up before wiring the concrete LPP adapter.

Refs #243

@Teakowa Teakowa left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Major — crates/wright-driver/src/source_provider.rs (SourceCompilation)

The product seam cannot carry the source provenance required by #243. It returns diagnostics + canonical Workshop text + locale only, while Loaded::provenance collapses every provider result to ProviderArtifact and all Wright findings become <provider-artifact>. #243 explicitly owns the canonical Workshop + truthful source-provenance contract that #246 is supposed to consume, so #246 would have to redesign this public seam instead of only wiring lint/analyze. Add the approved provenance/unmapped contract to the boundary before merging.

Major — crates/wright-driver/src/session.rs (load_from_source_provider)

Provider-backed OPY stdin is silently converted into a filesystem entry named <stdin>. input::resolve reads the actual stdin text, but SourceTarget discards it and the provider receives ${cwd}/<stdin>, so this path can never represent the user's source. The approved #243 seam is entry-based; reject provider-backed stdin explicitly with a structured diagnostic rather than fabricating an entry path.

Major — crates/wright-driver/src/session.rs (load_from_source_provider Workshop handoff)

Errors while parsing provider-returned canonical Workshop are passed to workshop_diag(error, resolved). workshop_diag stamps Workshop spans with resolved.display, which is the original OPY entry, so a malformed/generated Workshop artifact is falsely reported at OPY source coordinates. Attribute canonical-artifact parse/validation failures to the provider artifact/unmapped provenance instead of the authored OPY path.

Carry explicit mapped or unmapped provenance through the provider boundary and attribute unmapped canonical-artifact diagnostics to the artifact identity.

Reject provider-backed stdin before input resolution so the provider never receives a fabricated entry path. Add regression coverage for provenance, artifact diagnostics, and stdin refusal.

Refs #243

@Teakowa Teakowa left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Major — crates/wright-driver/src/source_provider.rs (SourceProvenance / SourceCompilation)

The previous provenance finding is only partially fixed. Mapped is a flag, but the seam still carries no mapping from canonical Workshop file/span identities to authored OPY source identities/ranges. Consequently resolve_finding_span_paths treats a Mapped provider artifact as if its Workshop file ids already referred to the original source tree, which the boundary cannot establish. #243 requires sufficient truthful provenance for Wright-owned findings where mapping is supported. Carry the actual mapping contract (or keep the result explicitly unmapped); do not expose a Mapped state that cannot be consumed truthfully.

Remove the unimplemented mapped provenance state so the provider seam cannot claim canonical Workshop spans map to authored OPY ranges without carrying real mapping data.

Refs #243

@Teakowa Teakowa left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@Teakowa
Teakowa merged commit 958e137 into main Sep 2, 2026
14 checks passed
@Teakowa
Teakowa deleted the codex/issue-243-provider-boundary branch September 2, 2026 18:47
@github-project-automation github-project-automation Bot moved this from Backlog to Done in Make Workshop Great Again Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

2 participants