Go client: no typed RunSweep wrapper — the sweep RPC is unreachable and the parity doc claims RPC coverage

Đang mở
#2,336 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
58/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
go
Lĩnh vực
api, backend

Hướng nghiên cứu

Read client/opensysml/client.go and client/opensysml/runs.go, then compare their request and response conversions with api/proto/sysml.proto and the handler in internal/frontend/grpc/sweep.go. Implement the typed client wrapper and preserve the response fields listed in the issue. Done means callers can invoke the sweep RPC through the Go client and receive its table and metadata; update docs/reference/client-parity.md to resolve its contradictory coverage claims.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Disclaimer, this issue was detected and written by an AI

Summary

The service has a RunSweep RPC that answers a table of run rows for a parameter
sweep. Every other client wraps it. client/opensysml has no RunSweep method at
all; a caller can only reach a sweep indirectly through RecordRun.

docs/reference/client-parity.md contradicts itself: "Every client exposes all 31
RPCs ... as typed calls", while the Open gaps table says "the package has no typed
RunSweep wrapper at all" (estimate about one day).

Service contract (already implemented)

api/proto/sysml.proto:

RunSweepRequest: model_hash, symbol_id (FQN of an analysis case or calc,
definition or usage), subject_symbol_id, positional arguments, named
named_arguments, ranges (SweepRange: parameter, start, end, step),
samples (draw uniformly; 0 steps; above 0 needs a seed and refuses a range with
a step), seed, engine.

RunSweepResponse: rows (SweepRow: inputs, outputs, verdicts,
elapsed_micros, error, failure_reason, evaluations), parameters,
sampled, seed, error, diagnostics, failure_reason, instances,
engine, strength, bounds.

The handler is internal/frontend/grpc/sweep.go:29; it requires
CapabilityVerification (not runs), and already checks ctx.Err() per
table at :143. A pre-run failure is a 200 with RunSweepResponse.error +
failure_reason; a failed row is a row, not a table error.

Current client state

  • client/opensysml/client.go Client: RunAction/RunMonteCarlo (RunRuns)
    but no RunSweep.
  • client/opensysml/runs.go:284 — runRowsFromProto already decodes
    []*pb.SweepRow, but only Inputs, Outputs, Verdicts, Error
    (RunRow at runs.go:37). elapsed_micros, failure_reason and
    evaluations are dropped.
  • runs.go:439 — RecordRange(parameter, start, end, step) already builds a
    pb.SweepRange, so the range/value conversion exists.
  • runs.go:517 — Recording.Sweep uses the same decoder.

Required API

// SweepRange is one parameter stepped (or drawn) from start to end.
type SweepRange struct {
    Parameter string
    Start, End, Step Value // Step is nil for a sampled sweep
}

// Sweep is what a sweep answers: the table and the parameters it covered.
type Sweep struct {
    Rows        []RunRow
    Parameters  []string
    Sampled     bool
    Seed        uint64
    Diagnostics []Diagnostic
    Instances   []*Instance // when the type already maps (analysis.go)
    Engine      string
    Strength    string
    Bounds      []Bound
}

type SweepOption func(*sweepOptions)

func SweepSubject(symbolID string) SweepOption
func SweepArguments(values ...Value) SweepOption
func SweepArgument(name string, value Value) SweepOption
func SweepSamples(rows int64) SweepOption
func SweepSeed(seed uint64) SweepOption
func SweepEngine(name string) SweepOption

// Sweep runs the analysis case or calc over the ranges and answers one row per
// run, in the service's order. Requires the verification capability.
func (c *client) Sweep(ctx context.Context, model *Model, symbolID string,
    ranges []SweepRange, opts ...SweepOption) (*Sweep, error)
Ngôn ngữ chính
Go
Star
59
Fork
20
Merge trung bình
10 giờ 23 phút
Pull request đã merge (30 ngày)
897

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Open-MBEE/OpenSysML

Tất cả issue của Open-MBEE/OpenSysML

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.