Add Rust Anneal playground - #3510
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3510 +/- ##
=======================================
Coverage 91.85% 91.85%
=======================================
Files 20 20
Lines 6093 6093
=======================================
Hits 5597 5597
Misses 496 496 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f5ce70a402
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| @@ -0,0 +1,32 @@ | |||
| [package] | |||
There was a problem hiding this comment.
Opt the nested UI crate out of the parent workspace
In this repository this manifest sits below anneal/v1/Cargo.toml, which declares a workspace, but the new playground UI crate is neither listed as a workspace member/exclude nor declared as its own workspace. As a result, Cargo aborts before building (cargo check --manifest-path anneal/v1/playground/rust-anneal-playground/ui/Cargo.toml --locked reports that the package believes it is in a workspace when it is not), which breaks the documented cd ui && cargo run backend path unless the playground is copied out of the repo. Add an empty [workspace] here or update the parent workspace membership/excludes; the same applies to other standalone manifests such as top-crates.
Useful? React with 👍 / 👎.
| (dispatch, getState) => { | ||
| const state = getState(); | ||
| const sequenceNumber = currentExecutionSequenceNumberSelector(state); | ||
| if (sequenceNumber) { |
There was a problem hiding this comment.
Treat sequence number 0 as active
When the first WebSocket execution is active, currentExecutionSequenceNumberSelector returns 0 because the sequence generator starts at zero, so this truthiness check suppresses every action built by dispatchWhenSequenceNumber (wsExecuteStdin, stdin close, and Kill). The observer uses the same zero check for its auto-kill path, so the first long-running Run/Anneal request cannot be killed or fed stdin from the UI until it exits or the socket disconnects; check for undefined/null instead of truthiness.
Useful? React with 👍 / 👎.
| - name: Checkout code | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| ref: "${{ github.event.pull_request.head.sha }}" |
There was a problem hiding this comment.
Avoid running PR head code under pull_request_target
Because this workflow is triggered by pull_request_target and then checks out github.event.pull_request.head.sha, a labeled external PR controls the repository contents used by later steps, including the local composite action after the GHCR secret login. In that scenario a PR can modify .github/actions/build-and-push-image/action.yml (or other checked-out scripts) to execute arbitrary commands with the workflow token/secrets once a maintainer applies CI: approved; run untrusted PR code under pull_request without secrets, or keep pull_request_target on trusted base-repo code only.
Useful? React with 👍 / 👎.
| const ANNEAL_CARGO_TOML_CONTENT: &str = r#"[package] | ||
| name = "anneal-submission" | ||
| version = "0.0.0" | ||
| edition = "2021" | ||
|
|
There was a problem hiding this comment.
Preserve the selected edition for Anneal submissions
Anneal requests carry ExecuteRequest.edition, but this static Cargo.toml always writes edition = "2021" and should_modify_cargo_toml skips the normal edition update for Anneal. When the UI default/selected edition is 2024 and the submitted code uses 2024-only syntax, Verify with Anneal will compile it as 2021 and fail even though the same editor configuration is valid; generate this value from self.edition instead of hard-coding it.
Useful? React with 👍 / 👎.
| .init(); | ||
|
|
||
| let config = Config::from_env(); | ||
| server_axum::serve(config); |
There was a problem hiding this comment.
server_axum::serve is an async fn, so this call only constructs and immediately drops the future; no Tokio runtime is entered and the backend process exits after configuration instead of binding the listener. This breaks both local cargo run and the deployed systemd service because the server never starts; make main a Tokio async main and await serve(config).
Useful? React with 👍 / 👎.
Import the Rust Anneal playground source under anneal/v1/playground so it can live alongside the Anneal implementation.
f5ce70a to
a8482f4
Compare
This is an imported playground subtree retaining its existing licensing.