Repository navigation
feat(grpc): trace and events for ExecuteAction - #1778
Merged
Merged
Conversation
ExecuteActionRequest takes trace and events, ExecuteActionResponse carries the run's trace as DocumentEvent records: the action executor records each token step, wait, accept, decision, assignment and the completion as typed records that print no line, and events are posted to the performer in turn as the run waits, as the REPL's %send does. The gRPC service and the wasm engine advertise the action_trace capability. Co-Authored-By: jason.han <hanhuijun@gmail.com>
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
…d Python clients Regenerates the protobuf stubs for the request and response fields. Co-Authored-By: jason.han <hanhuijun@gmail.com>
…and Java clients Co-Authored-By: jason.han <hanhuijun@gmail.com>
…and MATLAB clients and the MCP tool Co-Authored-By: jason.han <hanhuijun@gmail.com>
… client and the reference docs Co-Authored-By: jason.han <hanhuijun@gmail.com>
…nce example Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
…ve-compatible token decoding; lint Co-Authored-By: jason.han <hanhuijun@gmail.com>
…feat/execute-action-trace-events Co-Authored-By: jason.han <hanhuijun@gmail.com> # Conflicts: # internal/exec/runtime/context.go # internal/frontend/engine/engine.go # internal/frontend/engine/json.go # internal/frontend/grpc/run_options.go # internal/frontend/grpc/service.go
6 tasks done
…n-trace-events Co-Authored-By: jason.han <hanhuijun@gmail.com> # Conflicts: # client/rust/opensysml/src/operations.rs
…alues, forward Rust/Java action options ExecuteActionWithEvents lets go of a performance it started when the run fails, as a plain run does; the assign record carries the value the target holds once written; the Rust conformance adapter forwards trace and events and keeps a failed run's partial trace; Rust and Java state runs refuse RunOptions/ExecutionOptions events, which are an action run's. Co-Authored-By: jason.han <hanhuijun@gmail.com>
…ecord A qualified target is not read back, since a nearer local of the name would answer instead. Co-Authored-By: jason.han <hanhuijun@gmail.com>
The assign record of a qualified target reads the feature as a reader of the qualifier would — the frame of a run of the owner, else the performing object — so a shaped write is recorded as held and a local sharing the name cannot answer for it. Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
devin-ai-integration Bot
added a commit
that referenced
this pull request
Oct 31, 2026
….0 record Name develop df2bc17 as the candidate of the 0.12.0 performance record and account for each merge after e022cbc: #1793, #1794, #1787, #1788, #1752 and #1775 Go-neutral by diff; #1792 re-probed on the export rows at 86fa09e (neutral); #1795 and #1791 measured at a37809a on every row set (load and runtime rows unchanged, BatchSatisfy one allocation per assertion, export rows +0.1 %); Co-Authored-By: jason.han <hanhuijun@gmail.com> #1778 measured at df2bc17 on the runtime and gRPC rows (unchanged).
3 of 6 tasks
HuiJun
added a commit
that referenced
this pull request
Oct 31, 2026
* docs(perf): account for every merge up to develop df2bc17 in the 0.12.0 record Name develop df2bc17 as the candidate of the 0.12.0 performance record and account for each merge after e022cbc: #1793, #1794, #1787, #1788, #1752 and #1775 Go-neutral by diff; #1792 re-probed on the export rows at 86fa09e (neutral); #1795 and #1791 measured at a37809a on every row set (load and runtime rows unchanged, BatchSatisfy one allocation per assertion, export rows +0.1 %); Co-Authored-By: jason.han <hanhuijun@gmail.com> #1778 measured at df2bc17 on the runtime and gRPC rows (unchanged). * docs(perf): account for #1797 and #1785 in the 0.12.0 record, candidate develop d16ca71 Co-Authored-By: jason.han <hanhuijun@gmail.com> --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: jason.han <hanhuijun@gmail.com>
devin-ai-integration Bot
added a commit
that referenced
this pull request
Nov 1, 2026
Resolves the Node client conflicts with the client-parity and action-trace work (#1766, #1786, #1778): ParseOptions keeps strictConformance alone, ParseSourcesOptions extends it, connection.ts and model.ts read options.strictConformance directly without the removed strictConformanceOf, and the sources test of the removed strict alias becomes a strictConformance test (an OpenSysML-only notation is a warning by default, an error strictly). The merged tree's remaining references to the removed names (the sysml REPL testing skill, a conversion.ts comment) are updated. Co-Authored-By: jason.han <hanhuijun@gmail.com>
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
ExecuteActiongains a run trace and mid-run events, mirroring whatExecuteStatealready has, so a client (and the homepage hero's coming action scene) can watch an action run step by step and send a signal to an accept that is waiting for it.Protocol (
api/proto/sysml.proto, bindings regenerated for Go, Python, Node, Java, Rust, Julia)ExecuteActionRequest.trace(bool, field 10) asks for the run's trace;ExecuteActionResponse.trace(repeated DocumentEvent, field 9) andtrace_dropped(field 10) answer it, bounded as the state trace is. A run that fails or deadlocks still returns the records it produced up to the failure.ExecuteActionRequest.events(repeated string, field 11) are the signals posted to the performing object in order. The interleaving is the REPL's%send: the run goes until it completes or every token waits, the next event is posted, the waiting accept takes it on the next step, and so on; an event no accept waits for, or one posted after completion, is an error. Events needperformer_symbol_id(INVALID_ARGUMENT otherwise); an explore schedule rejects both trace and events.DocumentEventgainstoken(14),step(15),feature(16) andvalue(17), used by the new action record kinds.action_trace, advertised by the service and the wasm module; a service without it refusestrace: truewith UNIMPLEMENTED naming the capability (internal/frontend/grpc/action_trace_test.go, as thestate_tracerefusal is pinned; the conformance harness has no way to withhold a capability, so the traced run and the event delivered to a waiting accept are the conformance fixtures:execute_action_trace,execute_action_events_accept,execute_action_events_waiting).Runtime (
internal/exec/runtime)TraceKinds recorded by the action executor at its real steps, never reconstructed afterwards:step(a token arriving at a node, with token id, executor step and clock instant),wait(an accept waiting, naming the event),accept(the one it took),decide(the alternatives and the branch taken, likechoice),assign(the feature and the value the engine wrote),complete.TraceRecord.Text()renders them;Line()reports them as unprinted, so-trace/%traceoutput is unchanged.Context.ExecuteActionWithEventsandContext.DeliverEventsimplement the event interleaving; with feat(engine): run state machines and actions on the clock (advance), with a clocked hero scene #1777's clocked runs merged,ExecuteActionAdvancedBy/startActionAdvancedBytake the events too and post them before the clock advances.Service, engine, clients
sysml-grpc(run_options.go,service.go) and the in-browser engine (engine.go,json.go:trace,events,trace/traceDroppedon the JSON mirrors) honour the new fields with the same validation.trace/eventson its ExecuteAction surface, checksaction_tracebefore asking for a trace, decodes the newDocumentEventfields and reports the partial trace on failure: Go (client/opensysml), Python, Node (incl. the wasm transport), Java, Rust, Julia, MATLAB; the MCPexecute_actiontool takestrace/eventsand prints the records.docs/reference/*describe the fields everywhereclock_stepwas documented.Mission check (
internal/frontend/grpc/mission_sequence_test.go, overexamples/runtime-showcase/mission-sequence.sysml):LunarMissiononapollo11traced without events stops waiting atawaitGoforGoForDescent(reported as a deadlock with the partial trace, not as success); withevents: ["GoForDescent"]it completes withlanded = true,returned = true,remaining = 480 [m/s];apollo8takes thetransEarthInjectionbranch.LunarMissionUnorderedcompletes legally on today's runtime rather than failing at initialization — the test pins what the engine does, and the hero scene will show the engine's actual answer.Landing order. #1777 (
feat/engine-state-advance, now indevelop) was merged into this branch as a merge commit (no rebase) with the resolution its body describes (events threaded through the advance-aware runs,runActionchoosing byadvance);developis merged in up to #1777/#1779/#1740, so the diff is this PR's own changes. Earlier, thedevelopmerge (with #1773) the one conflict was the Rust client's capability import list, resolved as the union, and the protobuf stubs were regenerated on the merged tree (make proto-buf python-proto proto-ts proto-rust), which changed nothing. #1782 builds the homepage hero's Apollo 11 action scene on this surface and lands after this one.How it was verified
On the merged head (this branch with #1777's head and
developmerged in) the whole matrix was re-run:go build ./... && go vet ./... && gofmt -l .— clean,gofmtprints nothing.go test ./...— all 124 packagesokon the feat(engine): run state machines and actions on the clock (advance), with a clocked hero scene #1777 merge (cmd/sysmlalone takes ~4.5 min here, so the run used-timeout 40m); after mergingdevelop, every runtime, frontend, queryexec,tests/grpc,tests/wasmandclient/opensysmlpackage re-runok.cd client/node && rm -rf build/wasm build/service && npm run build && npm test— 473 pass, 0 fail (lint and typecheck clean).cargo fmt --all -- --check && cargo clippy --all-targets -- -D warnings && cargo test --workspaceagainst asysml-grpcbuilt from the tree (RUST_MIN_STACKraised for the pre-existing deep-nesting test) — all 13 test binaries pass; Pythonpytest— 1575 passed, 141 skipped (the twotest_versionchecks fail only because this machine's editable install points at another checkout); Javamvn -B -q -f client/java/pom.xml test— 356 tests green on JDK 21; JuliaPkg.test— green.tests/grpc), the wasm JSON surface (tests/wasm), the runtime trace-kind and robustness tests (internal/exec/runtime), the service tests (internal/frontend/grpc, incl.mission_sequence_test.go) and the MCP tool tests all pass on the merged head.examples/ortests/testdatafile changed, so the pilot differential baselines did not move.MATLAB: Octave is not installed here; the client change is covered by CI's MATLAB/Octave job (the
string()call that job rejected is fixed).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 changelogLink to Devin session: https://nasa-jpl-demo.devinenterprise.com/sessions/ea449771e507498985e128186c5ad7e5
Open in Devin Desktop: https://nasa-jpl-demo.devinenterprise.com/desktop/session/ea449771e507498985e128186c5ad7e5?variant=devin
Requested by: @HuiJun