feat(clients/java): wrap execution, verification, calculation, analysis and query in the public API - #388
Draft
devin-ai-integration[bot] wants to merge 1 commit into
Draft
feat(clients/java): wrap execution, verification, calculation, analysis and query in the public API#388devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
…is and query in the public API Model gains executeAction/executeState with exploreAction/exploreState, verifyConstraint/verifyRequirement/verifySatisfaction/validateInstance, evaluateCalc, runAnalysis/exploreAnalysis, query/queryOslc and withEngine; Connection gains listEngines. Each answers an immutable record with no generated protobuf type in the public API. A false verdict is a decided answer, not an exception; ModelException carries a FailureReason and AnalysisException.partial() keeps what a failed analysis computed. The Java conformance runner covers the new RPCs through the public API, rendering results back to protobuf, so 94 of 134 scenarios run per protocol. Unit tests cover the result types and both conversion directions; ApiIntegrationTest runs each operation against the real service binary. Co-Authored-By: jason.han <hanhuijun@gmail.com>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
The Java client stopped at the v1 surface (parse, symbols, eval, instantiate) although the service already serves the runtime RPCs and the generated messages ship in the jar. A JVM host — a modelling tool that wants to run, verify or analyse the model it draws — had no typed way to reach them. This wraps them, keeping the client's contract: immutable records, no generated protobuf type in the public API, unchecked exceptions split between "the call was refused" and "the answer reports a model failure".
Modelgains:and
ConnectiongainsList<EngineInfo> listEngines(). Result records:ActionRun,StateRun,Exploration/Outcome,Verification/Verdict/VerificationVerdict,Satisfaction,Validation,Calculation,Analysis/CaseEvaluation,Standing(engine, strength, bounds),QueryElement,EngineInfo; options:ExecutionOptions,AnalysisOptions,Query/Condition.Semantics worth knowing:
verifyConstraintreturnsholds() == falsewithdecided() == true. Only a verdict the service could not evaluate carrieserrorand aFailureReason(EVALUATION,WRONG_KIND,AMBIGUOUS_SUBJECT; an enum value this client does not know maps toUNKNOWN).ModelExceptionnow carriesfailureReason().runAnalysisthrowsAnalysisException extends ModelExceptionwhosepartial()holds the outputs, verdicts and evaluations computed before the failure; a failure with nothing computed stays a plainModelException.VERIFICATION,VERIFICATION_VERDICTS,CASE_EVALUATIONS,QUERY,OSLC_QUERY,SCHEDULE,SCHEDULE_EXPLORE,PERFORMER,FINAL_TIME,ENGINES) is checked before the call, so an older service fails withCapabilityExceptionrather than a wire error.finalTimeisOptionalDouble.empty()unless the service reportsFINAL_TIME.Protosgains the public → protobuf direction forValue(every variant, including quantities, vectors, tensors, sets, metaobjects) so requests can carry public values.The conformance runner (
opensysml-conformance) covers the ten RPCs through the public API and renders the public results back to protobuf for comparison, so the scenarios test the client's conversions rather than bypass them. A request the public API cannot express (a malformed value the client would itself refuse to read) is recorded as a skip with that reason instead of a transport failure.SuiteTestnow also asserts that no covered RPC is skipped as uncovered and every covered RPC has a passing scenario, so a regression cannot hide as a skip.Docs:
docs/reference/java-api.md,docs/reference/clients.md,docs/guide/09-clients.md,clients/java/README.mdand the README rows describe the new surface and drop the statements that these operations were out of scope; the remaining gaps (edit API,ParseSources,Convert,RunSweep, the document RPCs) are still listed.How it was verified
mvn -f clients/java/pom.xml test -Dopensysml.requireService=true— 200 client tests, 36 conformance tests, includingApiIntegrationTestrunning every new operation against the realbin/sysml-grpc(false-but-decided verdicts, wrong-kind failures, partial and no-data analysis failures, exploration budgets, engine-bound models, structured and OSLC queries).bin/sysml-grpcoverconnectandconnect-json: 134 scenarios per protocol, 94 passed, 0 failed, 40 skipped, 0 in error (was 25 passed / 34 skipped of 59). Mutation runs (perturb-reals,truncate-lists,rewrite-strings) fail scenarios as expected.make build,gofmt -l .,go vet ./...,make lint,make docs-check,go run ./cmd/doc-counts -checkclean. No Go source changes;go test -race -timeout 30m ./...passes.Checklist
make testandmake lintpass locallychanges/unreleased/<slug>.<section>.md, not as an edit toCHANGELOG.mdmake docs-countsrun if a gate count moved (compliance rows need nothing: the census is counted at docs build)F4,K5) in the body, docs, or changelog