Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 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
6 changes: 2 additions & 4 deletions contracts/hided-ws.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,10 @@
}
},
"daemonInfo": {
"description": "Payload of the daemon frame, sent once after a valid handshake and before the first snapshot: what the Settings General tab shows about the daemon. It never carries the token or environment values other than the paths named here; herdr_bin_path and herdr_socket_path are null when the daemon has none. host_id names this daemon host across restarts (`host-` and 32 hex digits, kept in the state directory's `host-id` file); the web shell files unsaved drafts under it, so a draft written against one Hide host is never opened by another that serves the same browser origin. host_name is the name of the machine the daemon runs on, which Settings names as the owner of every value the daemon stores; null when the system does not report one. The daemon also owns the core's one Settings observation flag: a client's `ai_settings` event with `observing` records only that connection's demand, the flag follows the first observer in and the last one out, and a connection that closes releases its demand.",
"description": "Payload of the daemon frame, sent once after a valid handshake and before the first snapshot: what the Settings General tab shows about the daemon. It never carries the token or environment values other than the paths named here; host_id names this daemon host across restarts (`host-` and 32 hex digits, kept in the state directory's `host-id` file); the web shell files unsaved drafts under it, so a draft written against one Hide host is never opened by another that serves the same browser origin. host_name is the name of the machine the daemon runs on, which Settings names as the owner of every value the daemon stores; null when the system does not report one. The daemon also owns the core's one Settings observation flag: a client's `ai_settings` event with `observing` records only that connection's demand, the flag follows the first observer in and the last one out, and a connection that closes releases its demand.",
"type": "object",
"additionalProperties": false,
"required": ["version", "schema_version", "pid", "host_id", "host_name", "started_at_unix", "state_dir", "core_state_path", "herdr_bin_path", "herdr_socket_path", "keep_alive", "idle_secs", "core_instance"],
"required": ["version", "schema_version", "pid", "host_id", "host_name", "started_at_unix", "state_dir", "core_state_path", "keep_alive", "idle_secs", "core_instance"],
"properties": {
"version": { "type": "string" },
"schema_version": { "type": "integer", "const": 2 },
Expand All @@ -199,8 +199,6 @@
"started_at_unix": { "type": "string" },
"state_dir": { "type": "string" },
"core_state_path": { "type": "string" },
"herdr_bin_path": { "type": ["string", "null"] },
"herdr_socket_path": { "type": ["string", "null"] },
"keep_alive": { "type": "boolean" },
"idle_secs": { "type": "integer" },
"core_instance": {
Expand Down
4 changes: 2 additions & 2 deletions contracts/snapshot-wire-enums.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"kit_check_failure": ["read_failed"],
"kit_refusal_cause": ["unsafe", "record", "busy", "projects", "other"],
"kit_part_cause": ["taken_out", "older_version", "edited", "helper_gone", "route_changed", "other_build", "not_hides", "no_helper", "unreadable", "other_program", "foreign", "agent_absent", "not_created_yet", "program_missing", "unsupported", "update_agent", "ai_folder", "still_in_place", "not_changed", "codex_untrusted", "record_unsaved", "retirement_pending", "other_install", "other"],
"herdr_profile_refusal": ["no_consent", "invalid_target", "discovery_pending", "device_limit"],
"profile_refusal": ["no_consent", "invalid_target", "discovery_pending", "device_limit"],
"agent_action_refusal": ["unsupported", "core_machine_only", "asleep", "working", "waiting_for_you", "unknown_activity", "no_conversation"],
"kit_unavailable": ["standalone", "no_consent", "consent_outdated", "unsupported_platform", "installer_unavailable", "unreadable"],
"kit_state_variable": ["HIDE_STATE_DIR", "XDG_STATE_HOME"],
Expand Down Expand Up @@ -94,7 +94,7 @@
"pr_state": ["failed", "pending", "mergeable", "draft", "merged", "closed"],
"descendant_mark": ["raised", "working"],
"right_panel_section": ["overview", "explorer", "changes", "agent_sessions", "sessions", "memory"],
"strip_tab_kind": ["herdr", "file", "diff", "session"],
"strip_tab_kind": ["engine", "file", "diff", "session"],
"memory_card_kind": ["rule", "decision", "lesson", "fact", "preference"],
"memory_analysis_state": ["idle", "analyzing", "ai_not_ready", "checking", "check_budget_exhausted"],
"memory_promotion_state": ["running", "pr_open", "merged", "failed", "unconfirmed", "building", "unbuilt", "ready"],
Expand Down
6 changes: 3 additions & 3 deletions docs/ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ On that refusal a start reads the name once (`Shell::settle_name`) and sends the
A spawn asked again for the same intent waits while the engine holds the name, types the start once more only after it let go and the shell is alone, and otherwise answers `agent_not_started` (`docs/delivery.md`); a new attempt closes the earlier pane while it still runs the terminal that spawn recorded, which frees the name with it.
The wait is capped at 30 s (`SHELL_WAIT`), the default readiness wait Herdr had; past it nothing was typed (a terminal still in canonical mode is named, with its limit and the line's length, in the failure's detail and in the diagnostic), the start is a failure the task banner offers to retry, and the diagnostic `agent_start` / `shell_wait.timeout` records the pane's last process state.
A shell that held the terminal but never marked its first prompt stopped at a question: its start fails as `shell_starting` with the screen's last line and nothing else of the terminal, which the spawn's answer, the task banner and a Memory card's failed status name.
`agent_reason` is a code, never a sentence (`agent_start.not_installed`, `agent_start.shell_starting`, `agent_start.refused_by_herdr`, `agent_start.unconfirmed`, a session check's own code such as `session_route_unconfirmed`, and the others `worktree_control::AgentFailure` is built with), which every start surface words in the window's language (`web/src/coreError.ts`), a code it does not know as the plain "the agent did not start"; the sentence with the engine's answer or a link error goes to the `task_operation` / `agent.failed` or `agent.unknown` diagnostic, and `agent_line` carries the screen's last line of a `shell_starting` failure, which the screen quotes and no log keeps.
`agent_reason` is a code, never a sentence (`agent_start.not_installed`, `agent_start.shell_starting`, `agent_start.refused_by_engine`, `agent_start.unconfirmed`, a session check's own code such as `session_route_unconfirmed`, and the others `worktree_control::AgentFailure` is built with), which every start surface words in the window's language (`web/src/coreError.ts`), a code it does not know as the plain "the agent did not start"; the sentence with the engine's answer or a link error goes to the `task_operation` / `agent.failed` or `agent.unknown` diagnostic, and `agent_line` carries the screen's last line of a `shell_starting` failure, which the screen quotes and no log keeps.
The answer lands on the task receipt's own axis (`agent_phase`: `starting`, `started`, `failed` or `unknown`, with `agent_reason` and `agent_line`): a failure keeps the worktree and the pane, a provider missing from the PATH of the node that would run it fails before the engine is asked (the `agent_installed` call; a device's own node answers for its PATH), a transport failure is `unknown` because the agent may be running, and only a definite failure is offered again (`task_agent_retry`, which reuses the recorded pane and refuses when it is gone).
The receipt cannot be acknowledged while the agent is still `starting`.
The delete dialog's `remove_worktree` event and an agent's `hide workspace remove` start the one removal (`Runtime::start_git_worktree_removal`): the command answers the dialog's checkboxes from its `--force` and `--delete-branch`, refuses an agent still at work in the worktree and the caller's own checkout, and returns its refusal to the caller instead of the screen; the daemon then reads the removal's record until it ends (`hide_core::worktree_command`, [delivery.md](delivery.md#removing-a-worktree-hide-workspace-remove)).
Expand Down Expand Up @@ -3702,13 +3702,13 @@ Rows are grouped by the resolved `user@host:port`: a second alias of the same ke
A row's added state and its connect's device come from Add device's `ssh_registration`, so a press after a Connect that registered it converges on that device; otherwise it goes through `register_device` as Add device's does, with the press's consent, and the core gives the device its id ([A device's id](#a-devices-id)).
The listing tells an incomplete read (`truncated`: a size, depth or file bound) from one that could not be read (`unreadable`: a config that exists but is not a readable text file); a wildcard Include whose folder could not be listed is unreadable too, while a bound that cut an Include is incomplete; an unreadable config fails the whole read with Retry, an incomplete one keeps the step, and only a missing config is an empty list.
An attempt such a Connect starts is recorded by device and generation (`first_run_attempts`); `first_run_sign_in_withdraw`, which the step sends as it goes away, raises that attempt's `RowSignIn` withdrawal and answers its waiting question Cancelled, so it ends as `sign_in_needed`, and an attempt of a later generation, which the device row or another screen started, is left alone.
A row's id, target, address and connect state remain together in `status.herdr_profiles`; discovery runs no SSH command, status probe, authentication or reconnect, and an unreadable list is a failed read rather than an empty list.
A row's id, target, address and connect state remain together in `status.machine_profiles`; discovery runs no SSH command, status probe, authentication or reconnect, and an unreadable list is a failed read rather than an empty list.
Configuration-only target resolution reads the account's SSH configuration once with the same 16-file, 256 KiB-per-file and four-level include bounds, compares up to 64 existing registrations, and compares the resulting user, hostname and port together, never the label.
Each configuration file opens through the platform's nonblocking regular-file helper, which refuses a pipe, device, directory or symbolic link at the opened name even if it changes during the open; bounded chunks and include processing check one three-second read budget.
Include expansion shares that absolute deadline across every file and pattern, visits at most 1,024 directory entries, spends at most 1,048,576 units on names and iterative wildcard comparisons, accepts patterns up to 4,096 bytes, and keeps at most sixteen matching paths before sorting.
Crossing an Include bound refuses the whole saved-target configuration; Add device reports a truncated listing and resolves no registered extras from that partial read.
Literal hostnames, `user@host`, SSH URIs and IPv6 destinations need no Host entry; a configuration requiring Match or a proxy route the connector cannot apply remains unavailable instead of silently selecting another route.
`herdr_profile_connect` carries only a discovered profile id and explicit helper-installation consent; the core registers the row's Host or WSL distribution through the existing device registry and reuses a device already registered for the same endpoint.
`machine_profile_connect` carries only a discovered profile id and explicit helper-installation consent; the core registers the row's Host or WSL distribution through the existing device registry and reuses a device already registered for the same endpoint.
A refusal (`no_consent`, `invalid_target`, `discovery_pending`, `device_limit`) and a connection attempt stay on the selected row.
The existing first-run kit owner supplies the recorded agent choices when that device reports its onboarding hold.
Copy diagnostics carries versions, paths, states and the core's recent diagnostics, applies the shared diagnostic privacy policy below, and has no terminal output or pane input among its inputs.
Expand Down
2 changes: 1 addition & 1 deletion docs/UI_BEHAVIOR.md
Original file line number Diff line number Diff line change
Expand Up @@ -2451,7 +2451,7 @@ The creator-session action in an output panel opens the same record.

A query finds an agent, project, checkout, device, issue or pull request by name, and an issue or pull request by `#number` (`#273`, or `273`); an exact number match lists first, as its own row, issue and pull request separately.
After them come the agents the core links to a pull request of that number (its session made it or its branch has it; every one the core links, a merged one included, which is more than the agent's PR mark draws), in `Agents` on every device, so `#275` reaches the agent that works on pull request 275 though no word of its row holds the number; an issue's number brings no agent.
An agent is found by its title, by the name the engine knows it by (`hide agent spawn --name`), by its place and by its state sentence; the core carries that name on the agent row (`given_name`, `herdr_name` on the wire), on this machine and on a device alike, and leaves it out when the engine has none or has only a name Hide made up from a pane id (a task's `hide-claude-w9j-p52`, a wake's or a fork's), which would print the id the rule below keeps off every row.
An agent is found by its title, by the name the engine knows it by (`hide agent spawn --name`), by its place and by its state sentence; the core carries that name on the agent row (`given_name` on the wire), on this machine and on a device alike, and leaves it out when the engine has none or has only a name Hide made up from a pane id (a task's `hide-claude-w9j-p52`, a wake's or a fork's), which would print the id the rule below keeps off every row.
A query holding `:`, as every pane's id does (`w9J:p52`, as Copy name and ID carries it or `$HERDR_PANE_ID` gives it), lists first the agents whose id holds it in its case, on every device, the whole id before longer ones (`:p5` lists `w9J:p5`, then `w9J:p52`); without a `:` no id matches, and no row prints the id.
Only digits in the query match a number by substring on other rows.
The rows are `Issues`, `Pull requests`, `Agents`, `Projects`, `Checkouts` and `Devices` (while another device is registered), then `Commands` holding `에이전트 시작…` and `GitHub`; a group stands where its best result ranked and keeps its results in rank order, so grouping never moves the best match off the first row.
Expand Down
4 changes: 2 additions & 2 deletions docs/delivery.md
Original file line number Diff line number Diff line change
Expand Up @@ -574,8 +574,8 @@ The doorbell decides when; the input path submits once, off the runtime lock.
| Answer | Meaning | What follows |
| --- | --- | --- |
| Sent, `typed` | the engine acknowledged submission | the agent's own record decides intake |
| NotYet, `herdr_parameters`, `engine_refused` or `engine_unreachable` | nothing was typed: the request could not be put to the engine, the engine refused, or its machine could not be reached; a refusal is the engine's word that it wrote nothing (`EngineError::Refused`, the node's `HolderError::Refused`), whether the agent's (`agent_blocked`, `agent_not_ready`) or a node's (`pane_input_unavailable`, `pane_input_limit`, `pane_input_cancelled`, `node_busy`) | the doorbell may retry; a brief fails with `brief.prompt_refused` |
| Lost, `herdr_format` or `herdr_call_failed` | an answer that never came or could not be read, so the submission may have arrived | never retry blindly; the agent's record decides, then the composer ([Letters while the agent works](#letters-while-the-agent-works)) |
| NotYet, `engine_parameters`, `engine_refused` or `engine_unreachable` | nothing was typed: the request could not be put to the engine, the engine refused, or its machine could not be reached; a refusal is the engine's word that it wrote nothing (`EngineError::Refused`, the node's `HolderError::Refused`), whether the agent's (`agent_blocked`, `agent_not_ready`) or a node's (`pane_input_unavailable`, `pane_input_limit`, `pane_input_cancelled`, `node_busy`) | the doorbell may retry; a brief fails with `brief.prompt_refused` |
| Lost, `engine_format` or `engine_call_failed` | an answer that never came or could not be read, so the submission may have arrived | never retry blindly; the agent's record decides, then the composer ([Letters while the agent works](#letters-while-the-agent-works)) |

The durable reservation still saves `lost` before sending and records the outcome afterwards.
A save that never lands therefore cannot make a possibly submitted input free to send again (engineering principle 11).
Expand Down
4 changes: 2 additions & 2 deletions hide-core/src/delivery/composer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,8 @@ fn judge(engine: &dyn Engine, read: &Read) -> Reading {
let screen = engine
.read_screen(Wait::Small(READ_TIMEOUT), &read.observed.raw_pane_id)
.map_err(|error| match error {
EngineError::Request(_) => "herdr_parameters",
EngineError::Answer(_) => "herdr_format",
EngineError::Request(_) => "engine_parameters",
EngineError::Answer(_) => "engine_format",
_ => "read_failed",
})?;
// A cut screen may have lost the composer's rows, which no verdict
Expand Down
10 changes: 5 additions & 5 deletions hide-core/src/delivery/doorbell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1446,9 +1446,9 @@ fn record(client: &Client, id: &str, observed: &Observation, rang: Rang) {
/// A delivery call's failure as the code its hold records.
fn call_failure(error: EngineError) -> &'static str {
match error {
EngineError::Request(_) => "herdr_parameters",
EngineError::Answer(_) => "herdr_format",
_ => "herdr_call_failed",
EngineError::Request(_) => "engine_parameters",
EngineError::Answer(_) => "engine_format",
_ => "engine_call_failed",
}
}

Expand Down Expand Up @@ -3425,7 +3425,7 @@ mod tests {
assert_eq!(letter.state, State::Pending);
assert!(!letter.bell_sent);
let failure = letter.bell_failure.as_ref().expect("the failure is kept");
assert_eq!(failure.code, "herdr_call_failed");
assert_eq!(failure.code, "engine_call_failed");
assert!(failure.maybe_typed);
}
*bell.screen.lock().unwrap() = match shown {
Expand Down Expand Up @@ -3487,7 +3487,7 @@ mod tests {
fn a_letter_whose_bells_are_spent_ends_undelivered_and_tells_its_sender_at_once() {
for (error, reason) in [
("pane_input_unavailable", "engine_refused"),
("timeout", "herdr_call_failed"),
("timeout", "engine_call_failed"),
] {
let bell = Bell::with_submission_error(json!({}), Some(error));
{
Expand Down
8 changes: 4 additions & 4 deletions hide-core/src/delivery/ladder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,9 @@ fn answered(target: &InputTarget, rung: &str, answer: Result<(), EngineError>) -
}
None => {
let reason = if matches!(error, EngineError::Answer(_)) {
"herdr_format"
"engine_format"
} else {
"herdr_call_failed"
"engine_call_failed"
};
lost(target, rung, reason, &error);
Delivered::Lost(reason)
Expand All @@ -162,7 +162,7 @@ fn answered(target: &InputTarget, rung: &str, answer: Result<(), EngineError>) -
/// or one that could not be read, may follow a submission that arrived.
fn not_typed(error: &EngineError) -> Option<&'static str> {
match error {
EngineError::Request(_) => Some("herdr_parameters"),
EngineError::Request(_) => Some("engine_parameters"),
EngineError::Refused { .. } => Some("engine_refused"),
EngineError::NotRunning(_) | EngineError::Transport(_) => Some("engine_unreachable"),
EngineError::Unanswered(_) | EngineError::Malformed(_) | EngineError::Answer(_) => None,
Expand Down Expand Up @@ -293,7 +293,7 @@ mod tests {
let uncertain = FakeEngine::start(|_, _| unanswered("the answer never came"));
assert_eq!(
deliver(uncertain.engine().as_ref(), &target, "letter"),
Delivered::Lost("herdr_call_failed"),
Delivered::Lost("engine_call_failed"),
);
}

Expand Down
Loading
Loading