Repository navigation
Cut Workshop's build dependence on the Gateway - #187
Merged
Merged
Conversation
`crates/workshop/server/tests/fixtures/realtime` now holds the five Realtime protocol examples, and the Workshop relay and UI tests read them from there instead of `crates/gateway/stt/`. `crates/workshop/ui/test/fixtures/replay` holds the 11 snapshot streams plus `ui-baseline.json` and `ui-metrics.json`, which `stt-replay.mjs` writes through `writeJson`. The Gateway's `baseline.json` and `metrics.json` lose their `ui` section, and `replay.rs` drops `ui` from `FOREIGN_SECTIONS`. - The drift check sits in `crates/build-xtask/tests/realtime_wire_conformance.rs`, because a Workshop crate may not depend on a Gateway crate. It compares the two Realtime fixture directories byte for byte and names the file and the first difference. - `docs-claims.mjs` drops the exemption for `crates/gateway/stt/`, so the `engine` and `harness` scan now applies one rule to every file. - The snapshot streams and the `ui` baselines are a frozen copy with no drift check. A Gateway edit to a replay fixture does not fail the Workshop suite.
Workshop obtains its Gateway sidecar from a pinned release or a stub, and builds the Gateway from source only when nothing else supplies one. `gateway-pin/pin.json` records the release, the checksum and size of each asset, and the `min_gateway` floor. `tools/fetch-gateway-sidecar.mjs` downloads, verifies, and stages one target, `--stub` writes a compile-only file, and `cargo workshop` accepts `--gateway-binary` and `RUNVIL_GATEWAY_SIDECAR`. - A sidecar staged by `tools/fetch-gateway-sidecar.mjs` leaves a `.pinned` marker beside it, and `crates/workshop/desktop/build.rs` then leaves the file alone instead of refreshing it from `target/<profile>/runvil-gateway`. - A placeholder pin yields an empty `RUNVIL_MIN_GATEWAY`, which `VersionCheck::compare` reads as `NoMinimumRecorded`. `announce` logs that case at `tracing::info!` and pushes no status line, so an unfilled pin turns the version check off with no visible sign. - `gateway-pin/pin.json` and both committed spec copies still hold `PLACEHOLDER`, so `nightly.yml` and `release-workshop.yml` fail at the fetch until someone runs `node tools/bump-gateway.mjs <tag>` against a published Gateway release.
`announce` now logs the `NoMinimumRecorded` case at `tracing::warn!` and pushes a status line in a release build. The new `Build` type separates a debug build, which reaches this state on every launch while the pin is a placeholder, from a release build, which is what an installer ships. - The split is decided at compile time by `Build::current` from `cfg!(debug_assertions)`, so the build script emits no second value and needs no change. - The status line goes through `push_status_update`, the same call the older-Gateway warning uses, so it reaches the first session through the retained status bus. - The `Satisfied` arm is unchanged and still pushes nothing, so a filled pin that passes the check stays quiet.
The rustdoc on announce named announce_for, which is private, so cargo doc with -D warnings rejected workshop-gateway and the docs job failed. The sentence now names announce_for as plain code instead of a link. - The same text broke twice, as announce and as its re-export announce_version. - cargo doc --workspace --no-deps --all-features, the runvil and harness facade builds, and the runvil-engine private-items build all exit 0 with RUSTDOCFLAGS=-D warnings.
This branch was successfully deployed
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.
Workshop and the Harness should reach the Gateway only through a written API. That means no dependency on a Gateway crate, no test that reads a file the Gateway owns, and no Workshop build step that compiles the Gateway. These commits remove those three couplings. Workshop gets its own copy of the discovery and progress types, its own copies of the fixtures its tests read, and a sidecar that comes from a pinned Gateway release or a stub instead of a source build of the Gateway in this tree.
Give Workshop its own Gateway discovery and progress type
crates/workshop/gateway-discoverynow holds the discovery file reader, the liveness and health probes, and the validated discovery document, all previously reached throughgateway-api-discovery. Thesame_origin_authority_allowedpredicate moved fromshared-loopbackintocrates/workshop/server/src/routes/realtime-origin.rs.The inline copy only narrows visibility, from
pubtopub(super); the body and behavior are unchanged.Give Workshop its own copies of the shared test fixtures
crates/workshop/server/tests/fixtures/realtimeholds the five Realtime protocol examples, and the Workshop relay test and UI suite read them there rather than fromcrates/gateway/stt/.crates/workshop/ui/test/fixtures/replayholds the eleven snapshot streams plusui-baseline.jsonandui-metrics.json, whichstt-replay.mjswrites throughwriteJson. The Gateway'sbaseline.jsonandmetrics.jsondrop theiruisection, andreplay.rsremovesuifromFOREIGN_SECTIONS.A copy drifts, so
crates/build-xtask/tests/realtime_wire_conformance.rscompares the two Realtime fixture directories byte for byte and names the file and the first difference. It lives inbuild-xtaskbecause that is the only crate allowed to read both families; a Workshop crate may not depend on a Gateway crate.docs-claims.mjsalso loses its exemption forcrates/gateway/stt/, so the wording scan now applies one rule to every file.Stage the Gateway sidecar from a pinned release
gateway-pin/pin.jsonrecords the release repository, the tag and version, themin_gatewayfloor, and the checksum and size of each asset.tools/fetch-gateway-sidecar.mjsdownloads one target, verifies its checksum and optionally its attestation, and stages it where Tauri'sexternalBinresolves;--stubwrites a compile-only file instead.The staged file gets a
.pinnedmarker beside it.crates/workshop/desktop/build.rssees that marker throughsidecar_is_pinnedand leaves the file alone instead of refreshing it fromtarget/<profile>/runvil-gateway. Incrates/build-workshop/src/main/pipeline.rs,gateway_sourcereturnsGatewaySource::Staged { stub }orGatewaySource::Given, and falls back toGatewaySource::Buildonly when nothing else supplies a binary.cargo workshopaccepts--gateway-binaryandRUNVIL_GATEWAY_SIDECARfor the given case.The version check ties the running Gateway to the pin.
crates/workshop/gateway/build.rsreadsmin_gatewayand setsRUNVIL_MIN_GATEWAY, whichcrates/workshop/gateway/src/version.rsexposes asMIN_GATEWAY.VersionCheck::comparereads an empty minimum asNoMinimumRecorded, so a placeholder pin switches the check off.crates/workshop/server/src/app/compose.rscallsreport_versionwith the version from the discovery identity when one exists; a config with no discovery file has nothing to compare and skips the check.Warn instead of passing when the Gateway pin is unfilled
An unfilled pin used to produce no signal at all.
announcenow logsNoMinimumRecordedattracing::warn!and pushes a status line in a release build. The newBuildtype separates a developer's debug build, which reaches this state on every launch while the pin is a placeholder, from a release build, which is what an installer ships.Build::currentdecides at compile time fromcfg!(debug_assertions), so the build script emits no second value. The status line goes throughpush_status_update, the same call the older-Gateway warning uses, so it reaches the first session through the retained status bus. TheSatisfiedarm is unchanged and still pushes nothing, so a filled pin that passes stays quiet.Stop linking a public doc to a private function
The rustdoc on
announceincrates/workshop/gateway/src/version.rsnamedannounce_for, which is private.cargo docwithRUSTDOCFLAGS=-D warningsrejectedworkshop-gateway, and thedocsjob failed on the first push of this branch. The sentence now namesannounce_foras plain code instead of a link. The same text broke twice, once asannounceand once as its re-exportannounce_version.What this does not do
No Gateway release exists yet, so
gateway-pin/pin.jsonand both committed spec copies still holdPLACEHOLDER.nightly.ymlandrelease-workshop.ymlwill fail at the fetch step until someone runsnode tools/bump-gateway.mjs <tag>against a published release.Nothing here prevents a release being built from an unfilled pin. The version check warns loudly in a shipped build but does not block it. The
--stubpath exists for compile-only jobs and prints a warning; a build made with it cannot run a Gateway.How this was verified
Run locally at
4cf1430ad:cargo test -p workshop-gateway102 passed, 1 ignoredcargo test -p workshop-server145 passed in the unit tests and 76 in the integration tests, 1 ignored in eachcargo test -p build-workshop25 passed and 1 passedcargo test -p workshop-gateway-discovery75 passedcargo test -p gateway-stt307 passed and 87 passedcargo test -p build-xtask264, 7, and 3 passednode --test tools/*.test.mjs65 passed, 0 failedcargo fmt --all -- --checkcleancargo clippy --workspace --all-targets --lockedcleanThe pre-push hook passed on both pushes, which runs the wording scan, a headless Gateway check, workspace Clippy, and
cargo deny check.On CI, every job passes:
docs,clippy,fmt,msrv,api-surface,supply-chain,test,ui,check-workshop,check-workshop-linux,compile-nsis,pure-stt-state, andplan.check-workshopandcheck-workshop-linuxboth take the stub sidecar path.Reviewer notes
same_origin_authority_allowedinrealtime-origin.rsis byte-identical in behavior to theworkshop_same_origin_authority_allowedfunction it replaced inshared-loopback. Only the visibility narrowed, frompubtopub(super).crates/build-xtask/tests/realtime_wire_conformance.rs. The replay streams are a frozen snapshot with no drift check, so a Gateway edit to a replay fixture will not fail the Workshop suite.crates/workshop/gateway-discovery/src, so a platform fix has to be made in two places.DEADLINEincrates/workshop/agents/tests/it/conversation.rs.