Repository navigation
Fix all 38 Harness code review findings #88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
9ef64a0
Validate wire_name letter start and preserve render schemas
vinniefalco 00a6dbc
Mark session::refuse unsafe and join load causes
vinniefalco 2a104dc
Contain broker models panics and fix early startup exits
vinniefalco 205ebf5
Reconcile cancel, withdrawn, and stop in effect_loop
vinniefalco 2e10b92
Replace Waker::noop in Flights::landed_now with WakeFlag loop
vinniefalco f58e335
Wrap plugin-mcp HTTP transport for no redirects and cleanup
vinniefalco ab459aa
Bound MCP tools/list pagination and enforce outer call timeout
vinniefalco 1bd9024
Tighten plugin-mcp trust, config validation, and install checks
vinniefalco 7791bda
Bound gateway diagnostics, catalog scan, and duplicate-id errors
vinniefalco 385cfe0
Type RunSetup::selected_model as ModelId and drop display_chain
vinniefalco 7c1e90e
Return PluginReport from insert_plugin_dir and wrap client config
vinniefalco f6600d3
Pin merged runvil-plugin-sys and close SSE cancel gap
vinniefalco File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| //! Adapter wrappers over `gateway_client`'s endpoint and secret types so | ||
| //! every public constructor reports failures as universal [`runvil::Error`]. | ||
|
|
||
| use std::fmt; | ||
|
|
||
| use runvil::Error; | ||
|
|
||
| use crate::convert::IntoEngine; | ||
|
|
||
| /// Validated API root URL of a Runvil Gateway (the `/v1` path), wrapped so | ||
| /// construction failures report as [`runvil::Error`]. | ||
| #[derive(Clone, Debug, PartialEq, Eq)] | ||
| pub struct GatewayEndpoint(gateway_client::GatewayEndpoint); | ||
|
|
||
| impl GatewayEndpoint { | ||
| /// Parses and validates a Gateway API root URL. | ||
| /// | ||
| /// # Errors | ||
| /// Returns an [`InvalidValue`](runvil::ErrorCode::InvalidValue) error when | ||
| /// `url` is not a valid `http://` or `https://` endpoint URL or carries | ||
| /// embedded credentials, query parameters, or a fragment. | ||
| pub fn new(url: &str) -> Result<GatewayEndpoint, Error> { | ||
| gateway_client::GatewayEndpoint::new(url) | ||
| .map(GatewayEndpoint) | ||
| .map_err(IntoEngine::into_engine) | ||
| } | ||
|
|
||
| /// The normalized API root URL string. | ||
| #[must_use] | ||
| pub fn url(&self) -> &str { | ||
| self.0.url() | ||
| } | ||
|
|
||
| /// Whether the endpoint targets a loopback address. | ||
| #[must_use] | ||
| pub fn is_loopback(&self) -> bool { | ||
| self.0.is_loopback() | ||
| } | ||
|
|
||
| pub(crate) fn into_inner(self) -> gateway_client::GatewayEndpoint { | ||
| self.0 | ||
| } | ||
| } | ||
|
|
||
| impl TryFrom<&str> for GatewayEndpoint { | ||
| type Error = Error; | ||
|
|
||
| fn try_from(url: &str) -> Result<Self, Self::Error> { | ||
| GatewayEndpoint::new(url) | ||
| } | ||
| } | ||
|
|
||
| /// Non-empty bearer key redacted in [`fmt::Debug`] and [`fmt::Display`], | ||
| /// wrapped so construction failures report as [`runvil::Error`]. | ||
| #[derive(Clone)] | ||
| pub struct SecretString(gateway_client::SecretString); | ||
|
|
||
| impl SecretString { | ||
| /// Wraps a non-empty secret string. | ||
| /// | ||
| /// # Errors | ||
| /// Returns an [`InvalidValue`](runvil::ErrorCode::InvalidValue) error when | ||
| /// `secret` is empty. | ||
| pub fn new(secret: impl Into<String>) -> Result<SecretString, Error> { | ||
| gateway_client::SecretString::new(secret) | ||
| .map(SecretString) | ||
| .map_err(IntoEngine::into_engine) | ||
| } | ||
|
|
||
| pub(crate) fn inner(&self) -> &gateway_client::SecretString { | ||
| &self.0 | ||
| } | ||
|
|
||
| pub(crate) fn into_inner(self) -> gateway_client::SecretString { | ||
| self.0 | ||
| } | ||
| } | ||
|
|
||
| impl fmt::Debug for SecretString { | ||
| fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { | ||
| fmt::Debug::fmt(&self.0, f) | ||
| } | ||
| } | ||
|
|
||
| impl fmt::Display for SecretString { | ||
| fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { | ||
| fmt::Display::fmt(&self.0, f) | ||
| } | ||
| } |
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the wall-clock deadline from the correctness test.
If the test process pauses for more than two seconds after
started, this assertion fails even whencatalog_fromreturns the correct catalog. This can cause intermittent test failures on shared CI workers. A single duration measurement also does not establish linear complexity.Keep the count assertion. Measure performance separately from the correctness gate.
Based on learnings, “Gate on yes/no properties, never on a score threshold that ordinary work edits.”
Source: Learnings