Start a stand-in backend from the recording when a website build begins (R3.11) #2160
All Vouch review confidence checks passed
Residual risk 0.30 = Change Risk (0.52) × (1 − Review Confidence (0.43)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #2160"
general
weight: 0.35
mansur-akhmadi
Roadmap item: R3.11, "Start a stand-in backend from a recording automatically when a build begins" (claimed in the first commit).
What changed:
capture/holds a recording (capture/original.har, else the first.harby name) builds a stand-in from it intocapture/standin/and serves it before the builder's turn, through the sameweb_standin_build/web_standin_starttools a builder would call. The feed says where it answers.craft.json(standin_port, optional, so the format version stays). The next build asks for that port first. If it's busy, the stand-in takes a free one and the feed says so. Only a listen failure falls back, including a saved port refused with a permission error.web_standin_startmarks it in its error details (reason: listen_failed). Any other error isn't retried.standin_tools::StandIns::stop), not through the tool. That way the stop waits on neither the session lock nor the session's mode, since a switch to Clean room during the build would makeweb_standin_stoprefuse. The run takes charge of a stand-in it started before any feed callback runs:Worker::call_thenhands over the start's result beforeToolFinished, and the stand-in is stopped if a callback panics before the run holds it. A stand-in that was already serving the same file in the session (one the builder started) is reused and left running.- [ ]lines: Play and the app opened outside the build have no stand-in, and a coding agent's own tool server doesn't list the run's stand-in inweb_standin_show. STATUS row updated,craft.schema.jsonregenerated.Verified:
rebuild::recorded_backend, using real loopback requests. They cover:- the recorded answer being served
- the port being kept
- stopping, including after the session switched to Clean room
- a stand-in already running in the session being left alone
- a busy saved port falling back, and the feed naming it
- an unreadable recording
- Clean room, other targets and no recording getting nothing
- how the recording is chosen
- a feed callback panicking at the start's
ToolFinishedor at the status leaving nothing running, and a reused stand-in surviving it (red before the fix)- only a tagged listen failure falling back (red with the old
FileErrorcheck); the engine's busy-port test checks the tagpicking_up_a_build::a_website_build_serves_the_recorded_backend_while_it_builds): the follow-up message carries the kept port's address, and nothing is left running after a successful or a failed run. Red before the change: with the start disabled the port isn't kept; with the stop disabled the server is still listed after the run.cargo test -p craft-anything-ai -p craft-anything-engine --no-fail-faston macOS. Everything passes except unrelated tests:- three
cli_agentstiming tests failed under machine load and pass when rerun alone;- three macOS-only
apple_runtimescreenshot/accessibility tests time out in this headless session. This change doesn't touch that module, and CI doesn't run those tests.cargo clippy -p craft-anything-ai -p craft-anything-engine -p craft-anything-ui-egui --all-targets -- -D warnings,cargo fmt --all --check,cargo xtask layers,cargo xtask locks,cargo xtask secrets,cargo xtask schemas --check,cargo xtask tools --check.Not verified: no live Deep website build with a real recorded site and a real front end calling the stand-in (the existing "Live-check a Deep website study's recording" line still covers it). Not run on Windows or Linux.
cargo fmt --all --check,cargo clippy -p <crates> --all-targets -- -D warnings,cargo test -p <crates>,cargo xtask layers,cargo xtask secrets- [ ]lines for what's left), STATUS ifwhat works changed,
cargo xtask toolsif tools were added<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
- Deep website rebuilds can start a backend from a recorded capture and share its address with the builder.
- The app can reuse a previously selected port, or choose an available port if that port cannot be used.
- The running backend’s address and relevant instructions are included in later rebuild messages.
- Backends started for a rebuild are stopped when the run ends, including after a build failure.
- Backend startup failures are reported without preventing the rebuild from continuing.
- Rebuild guidance no longer shows stand-in instructions when no recording is available.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->