Skip to content

feat(runtime): add provider v1 protocol and graph provenance - #164

Closed
joeykchen wants to merge 5 commits into
goplus:mainfrom
joeykchen:feat/xgo-runtime-provider-spx
Closed

feat(runtime): add provider v1 protocol and graph provenance#164
joeykchen wants to merge 5 commits into
goplus:mainfrom
joeykchen:feat/xgo-runtime-provider-spx

Conversation

@joeykchen

@joeykchen joeykchen commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR adds the goplus/mod language and contract layer for goplus/spx#1741. It defines runtime-provider metadata, resolved graph provenance, and the provider-neutral v1 request protocol.

This layer deliberately contains no XGo command dispatch or SPX-specific runtime policy.

What changed

  • Add runtime <protocol> <provider-package> metadata scoped to the nearest preceding project, with strict protocol and import-path validation.
  • Capture SHA-256 identities for the exact go.mod and gox.mod/gop.mod snapshots consumed during resolution.
  • Represent resolved modules without flattening replacements: the MVS-selected identity remains separate from the source actually read.
  • Add resolved class-graph import that consumes a caller-resolved graph, validates target and declaration snapshots, and attaches provenance and minimum-XGo metadata to class projects.
  • Add the provider-neutral v1 request model and deterministic argv codec for run and transactional build.
  • Validate graph/build policy, project and pack metadata, provider identity, application arguments, and action-specific output fields.
  • Reject unknown, repeated, incomplete, malformed, and action-inapplicable protocol fields.

Compatibility and boundaries

The existing class import path remains available. Built-in projects remain provenance-free, and projects without runtime metadata keep their current behavior.

ResolvedClassGraph validates and consumes an effective graph supplied by XGo; it does not independently run MVS or resolve a second graph. Filesystem identity checks that require live provider inputs remain the provider's responsibility.

This is the first repository in the coordinated release order. XGo must update to the released goplus/mod version before runtime-provider support can be published.

Verification

  • GOWORK=off go test -count=1 ./...
  • GOWORK=off go vet ./...
  • git diff --check

Part of goplus/spx#1741. Published SPX mode and the coordinated release remain follow-up work.

Companion PRs

Add validated runtime metadata, deterministic provider argv encoding, and provenance-bearing resolved module identities. Load class projects from the effective Go graph without flattening replacements.
Share canonical graph and build flag validation, keep resolved-module checks focused, and place cloning beside its import flow without changing error contracts.
@codecov

codecov Bot commented Aug 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.01596% with 45 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.45%. Comparing base (f4300a7) to head (9fb832b).

Files with missing lines Patch % Lines
xgomod/resolved.go 89.55% 13 Missing and 13 partials ⚠️
xgomod/classfile.go 86.44% 8 Missing and 8 partials ⚠️
driverprotocol/protocol.go 98.62% 1 Missing and 1 partial ⚠️
modload/module.go 96.29% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #164      +/-   ##
==========================================
+ Coverage   81.34%   87.45%   +6.10%     
==========================================
  Files          10       13       +3     
  Lines         906     1650     +744     
==========================================
+ Hits          737     1443     +706     
- Misses        150      169      +19     
- Partials       19       38      +19     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@joeykchen
joeykchen force-pushed the feat/xgo-runtime-provider-spx branch from 61f36d9 to 308b7e8 Compare August 18, 2026 10:35
@joeykchen joeykchen closed this Aug 20, 2026
@joeykchen
joeykchen deleted the feat/xgo-runtime-provider-spx branch August 20, 2026 12:13
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