Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions rust/contracts/rust-core-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1257,6 +1257,23 @@ answer `"retry"` to repeat the failed transfer with helper bypass, at most three
total attempts. The AskPass C ABI is called only in the child app's early helper
mode. Credential answers are never copied into events or settings.

The helper reaches its invocation's session over a channel that only the same
account can open: on Unix, a socket (mode 0600) in a fresh owner-only directory,
with both ends also checking the peer's user ID; on Windows, a named pipe that
refuses remote clients, whose protected DACL admits only the current user, and
whose owner the helper verifies before writing. Each request also carries a
256-bit session token taken from the child's environment. Core drops a request
before any prompt reaches the host when it comes from another account, carries
another token, is malformed or longer than 16 KiB, asks a prompt longer than
8 KiB, does not arrive within 10 seconds of connecting, would be the session's
seventeenth distinct prompt, or repeats one prompt a fourth time. Each such
drop is logged as `vcs.authentication.request_rejected` with only its `reason`.
A session serves four helpers at a time; later ones wait to be accepted. A
prompt the host leaves unanswered for 180 seconds expires and its helper exits
with status 1, as after a cancel. Core zeroes the token, request frames and
answers when it drops them; copies outside Core, such as the child environment,
the host's JSON strings and operating system buffers, are not covered.

See `rust/fixtures/git/{fetch-plan,execution-events,execution-policy}-v1.json`
and [Git execution and project console](https://github.com/1lck/Lithe-IDEA/blob/main/.agents/notes/implemented/architecture/2026-09-12-git-execution-and-project-console.md).

Expand Down
12 changes: 10 additions & 2 deletions rust/crates/core/src/runtime/helper_failures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,25 +60,33 @@ mod tests {
fn helper_events_have_core_ownership_and_expected_channels() {
install();
install();
let input = [
let failure = [
("stage", json!("test")),
("error", json!("Helper operation failed")),
("error_code", json!("PermissionDenied")),
("error_domain", json!("io")),
];
// Rejections carry only their reason; every other helper event is a failure.
let rejection = [("reason", json!("token"))];
for (events, channel) in [
(lithe_git_host::failure_log::EVENTS, "vcs/git"),
(lithe_ide_host::failure_log::EVENTS, "app"),
(lithe_remote::failure_log::EVENTS, "remote"),
] {
for id in events {
assert_eq!(catalog::event_by_id(id).unwrap().owner, "lithe-core");
let input: &[(&'static str, Value)] =
if *id == "vcs.authentication.request_rejected" {
&rejection
} else {
&failure
};
// Exercise the exact sink conversion/validation into an owned
// queue, so parallel host drains cannot steal this assertion.
let queue = RefCell::new(Vec::new());
dispatch(
id,
&input,
input,
|event, map| {
let prepared = core_events::prepare(event, map, None)?;
queue.borrow_mut().push(prepared);
Expand Down
12 changes: 12 additions & 0 deletions rust/crates/diagnostics/src/catalog_generated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1616,6 +1616,18 @@ pub static EVENTS: &[EventMetadata] = &[
rate: 60,
owner: "Lithe",
},
EventMetadata {
id: "vcs.authentication.request_rejected",
channel: "vcs/git",
level: LogLevel::Warn,
message: "Git authentication request rejected",
fields: &[
FieldMetadata { name: "reason", field_type: FieldType::Token, required: true, description: "Why the AskPass channel refused a request: peer-identity (another account or unverifiable peer), token, malformed, oversized, timeout (no complete request before the deadline), prompt-limit or attempt-limit; never the prompt, token or peer input", reason: None },
],
span: None,
rate: 60,
owner: "lithe-core",
},
EventMetadata {
id: "vcs.authentication.response_failed",
channel: "vcs/git",
Expand Down
3 changes: 2 additions & 1 deletion rust/crates/git-host/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ description = "Native Git process adapter for Lithe hosts"
libc = "0.2"

[target.'cfg(windows)'.dependencies]
windows-sys = { version = "0.61", features = ["Win32_Foundation", "Win32_System_Pipes", "Win32_System_JobObjects", "Win32_System_Diagnostics_ToolHelp", "Win32_System_Threading", "Win32_Security"] }
windows-sys = { version = "0.61", features = ["Win32_Foundation", "Win32_System_Pipes", "Win32_System_JobObjects", "Win32_System_Diagnostics_ToolHelp", "Win32_System_Threading", "Win32_System_IO", "Win32_Security", "Win32_Security_Authorization", "Win32_Storage_FileSystem"] }

[dependencies]
lithe-platform = { path = "../platform" }
rand = "0.8"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
zeroize = "1.9"
Loading
Loading