diff --git a/architecture.json b/architecture.json index 72b0a367..2f03f810 100644 --- a/architecture.json +++ b/architecture.json @@ -134,7 +134,7 @@ {"crate": "strata-control", "file": "src/env_settings.rs", "ratchet": "env-read", "reason": "the one reader of the process environment of the crate: every variable is parsed here into a typed value (number, path, flag, mode)"}, {"crate": "leleka-deploy", "file": "src/env_settings.rs", "ratchet": "env-read", "reason": "the one reader of the process environment of the crate: every variable is parsed here into a typed value (path, flag, text)"}, {"crate": "strata-desktop-core", "file": "src/env_settings.rs", "ratchet": "env-read", "reason": "the one reader of the process environment of the crate and its binaries: credentials by name, the evaluation switches, the inherited child variables"}, - {"crate": "leleka-gateway-text", "file": "src/env_settings.rs", "ratchet": "env-read", "reason": "the one reader of the process environment of the crate: the two prompt rendering switches"}, + {"crate": "leleka-gateway-text", "file": "src/prompt/env_settings.rs", "ratchet": "env-read", "reason": "the one reader of the process environment of the crate: the two prompt rendering switches"}, {"crate": "leleka-npu-service", "file": "src/env_settings.rs", "ratchet": "env-read", "reason": "the one reader of the process environment of the crate: the profile report switch"}, {"crate": "strata-control", "file": "src/adapters/system_clock.rs", "ratchet": "instant-now", "reason": "the production Clock adapter: the one place that reads the runtime clock for the injected Clock port"}, {"crate": "strata-control", "file": "src/ports/fakes/clock.rs", "ratchet": "instant-now", "reason": "test fixture: the manual clock needs one base instant to count from and never moves by itself"}, diff --git a/crates/gateway-text/src/lib.rs b/crates/gateway-text/src/lib.rs index 0ff1ec92..d897a0e9 100644 --- a/crates/gateway-text/src/lib.rs +++ b/crates/gateway-text/src/lib.rs @@ -4,7 +4,6 @@ //! through `#[path]`. They need only `minijinja`, `serde`, `serde_json`, `sha2`, `regex` and `hex`, so they are a leaf //! crate that both hosts use. -mod env_settings; pub mod prompt; pub mod response_tools; pub mod tool_output; diff --git a/crates/gateway-text/src/prompt.rs b/crates/gateway-text/src/prompt.rs index 4a73b975..de408ed0 100644 --- a/crates/gateway-text/src/prompt.rs +++ b/crates/gateway-text/src/prompt.rs @@ -109,6 +109,8 @@ pub enum Effort { #[path = "prompt/tests.rs"] mod tests; +#[path = "prompt/env_settings.rs"] +mod env_settings; #[path = "prompt/json.rs"] mod json; pub use json::*; diff --git a/crates/gateway-text/src/env_settings.rs b/crates/gateway-text/src/prompt/env_settings.rs similarity index 100% rename from crates/gateway-text/src/env_settings.rs rename to crates/gateway-text/src/prompt/env_settings.rs diff --git a/crates/gateway-text/src/prompt/python_json.rs b/crates/gateway-text/src/prompt/python_json.rs index a4976f5c..6405904e 100644 --- a/crates/gateway-text/src/prompt/python_json.rs +++ b/crates/gateway-text/src/prompt/python_json.rs @@ -3,7 +3,7 @@ //! used to drop completed empty assistant turns from the history. use super::{Error, ErrorKind, Json, Kwargs, State, Value, ValueKind, py_space, python_float}; -use crate::env_settings::keep_empty_turns; +use super::env_settings::keep_empty_turns; pub(super) fn json_string(text: &str, ensure_ascii: bool, out: &mut String) { out.push('"'); diff --git a/crates/gateway-text/src/prompt/template_render.rs b/crates/gateway-text/src/prompt/template_render.rs index 0c7fa083..75de15df 100644 --- a/crates/gateway-text/src/prompt/template_render.rs +++ b/crates/gateway-text/src/prompt/template_render.rs @@ -5,7 +5,7 @@ use super::{ ChatInput, Effort, Json, Message, Part, Plain, Role, chat_tool, pinned, render_native, }; -use crate::env_settings::{keep_empty_turns, reference_render}; +use super::env_settings::{keep_empty_turns, reference_render}; /// The typed counterpart of [`without_empty_assistant_turns`]. pub(super) fn without_empty_turns<'a>(messages: &[Message<'a>]) -> Vec> {