Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

fix(docs): correct WorkflowScope precedence description

Steven Enamakel0256963facd9
diff --git a/crates/openhuman-core/src/cron/tools/README.md b/crates/openhuman-core/src/cron/tools/README.md
new file mode 100644
index 0000000000..4fc9f6d19b
--- /dev/null
+++ b/crates/openhuman-core/src/cron/tools/README.md
@@ -0,0 +1,73 @@
+# Cron tools
+
+Agent-facing tools over the `cron` domain. Six per-operation tools
+(`add.rs`, `list.rs`, `update.rs`, `remove.rs`, `run.rs`, `runs.rs`) are the
+implementation; `collapsed.rs` wraps them into the single `CronTool` the
+model actually sees. Re-exported wholesale by `crate::tools::mod` (`pub use
+crate::cron::tools::*`).
+
+## Collapsed dispatch (`collapsed.rs`)
+
+`CronTool` (`CRON_TOOL_NAME = "cron"`) advertises one schema with an `action`
+field (`list` / `add` / `update` / `remove` / `run` / `runs`) instead of six
+near-duplicate schemas — four of the six take only `job_id`. Each action
+forwards to the matching per-operation tool via `crate::tools::implementations
+::meta::collapse`, so validation and business logic live in exactly one
+place. `permission_level_with_args` / `external_effect_with_args` resolve the
+real per-action answer once `action` is known; the argument-free
+`permission_level` reports the strictest member (`CronAddTool`'s `Execute`)
+so an unparseable call over-restricts rather than under-.
+
+The six per-operation tools stay registered as `ToolExposure::Hidden`
+(`fn exposure`) — off the wire, but still dispatchable — so a replayed
+transcript or saved skill that names `cron_add` etc. keeps working.
+
+## Per-operation tools
+
+| Tool | Name | Permission | `external_effect` | Delegates to |
+| --- | --- | --- | --- | --- |
+| `CronAddTool` | `cron_add` | `Execute` | `true` | `cron::add_shell_job` / `cron::add_agent_job` |
+| `CronListTool` | `cron_list` | default (read-only) | default (`false`) | `cron::list_jobs` |
+| `CronUpdateTool` | `cron_update` | `Execute` | `true` | `cron::update_job` |
+| `CronRemoveTool` | `cron_remove` | `Write` | `true` | `cron::remove_job` |
+| `CronRunTool` | `cron_run` | `Execute` | `true` | `cron::get_job` + `cron::scheduler::execute_job_now`, then `cron::record_run` / `cron::record_last_run` |
+| `CronRunsTool` | `cron_runs` | default (read-only) | default (`false`) | `cron::list_runs` |
+
+The mutating tools (`add`, `update`, `remove`, `run`) all set
+`external_effect = true` and are gated by the approval flow
+(GHSA-f46p-6vf9-64mm): they persist or immediately execute a stored command
+or agent prompt on the host.
+
+### `CronAddTool` details
+
+- Accepts `schedule` (`cron` / `at` / `every`), `job_type` (`shell` |
+ `agent`, inferred from the presence of `prompt` when omitted), `command` or
+ `prompt`, `session_target`, `model`, `delivery`, and `delete_after_run`.
+- Shell commands are checked against `SecurityPolicy::is_command_allowed`
+ before being scheduled.
+- `delivery` defaults to `DeliveryConfig { mode: "proactive", .. }` for agent
+ jobs. `validate_delivery` enforces that `mode: "announce"` carries both
+ `channel` and `to`, and that `to` is in that channel's configured
+ `allowed_users` — this blocks scheduling a cron whose output is delivered
+ to an arbitrary chat id (see #928).
+- `JobType::Flow` is unreachable through this tool (flow-schedule rows are
+ created internally by `flows::ops::flows_set_enabled` via
+ `cron::add_flow_schedule_job`); the arm returns an explicit error instead of
+ `unreachable!()` in case the `job_type` heuristic above ever changes.
+
+## Related
+
+- `cron` domain: [`../README.md`](../README.md) — job/run model, scheduler,
+ delivery modes, agent-job minimum interval.
+- `crates/openhuman-core/src/tools/impl/system/schedule.rs` — a separate,
+ older one-shot `schedule` tool built on `cron::add_once` /
+ `cron::add_once_at` rather than these six; not part of the collapse above.
+- `crates/openhuman-core/src/tools/implementations/meta/collapse.rs` — the
+ generic action-collapsing helper `collapsed.rs` builds on.
+
+## Tests
+
+`add_tests.rs`, `list_tests.rs`, `update_tests.rs`, `remove_tests.rs`,
+`run_tests.rs`, `runs_tests.rs` cover each per-operation tool;
+`collapsed_tests.rs` covers action dispatch, schema merging, and the
+strictest/resolved permission behavior.
diff --git a/crates/openhuman-core/src/skills/README.md b/crates/openhuman-core/src/skills/README.md
index 4eb997f800..dfb44d0985 100644
--- a/crates/openhuman-core/src/skills/README.md
+++ b/crates/openhuman-core/src/skills/README.md
@@ -48,7 +48,7 @@ Plus the sub-domain namespaces: `skill_registry.*` (`browse`, `search`, `sources
- `crates/openhuman-core/src/config/workspace/ops.rs` — calls `skills::init_workflows_dir` during workspace bootstrap.
- `crates/openhuman-core/src/agent/registry/agents/orchestrator/prompt.rs` — renders the `## Installed Skills` catalog, fed by the skill list on `PromptContext` (`agent/harness/session/turn/context.rs`).
- `crates/openhuman-core/src/agent/prompts/` — renders the `## Available Skills` catalog section.
-- `crates/openhuman-core/src/core/bus.rs` / `crates/openhuman-core/src/core/events.rs` — `bus.rs` subscribes to `DomainEvent` for triggered skills; `ops`/`bus` publish `Workflow{Loaded,Stopped,StartFailed,Executed,sChanged}` on run and catalog changes.
+- `crates/openhuman-core/src/core/bus.rs` / `crates/openhuman-core/src/core/events.rs` — `bus.rs` subscribes to `DomainEvent` for triggered skills; `ops`/`bus` publish `WorkflowLoaded`/`WorkflowStopped`/`WorkflowStartFailed`/`WorkflowExecuted`/`WorkflowsChanged` on run and catalog changes.
- `crates/openhuman-core/src/agent/harness/definition.rs` — `registry.rs` flattens `AgentDefinition` fields from `skill.toml`.
## Called by
@@ -70,4 +70,4 @@ Cross-cutting agent + skill behavior is covered indirectly by `crates/openhuman-
## Notes
- Per AGENTS.md, skill discovery rejects symlinked bundles — copy skills into the `Harness` workspace rather than symlinking them.
-- `WorkflowScope` precedence on name collision, lowest to highest: `Builtin` < `User`/`Project`/`Legacy` < `Profile` (profile-local skills are private to the active agent profile).
+- `WorkflowScope` precedence on name collision, lowest to highest: `Builtin` < `User`/`Project`/`Legacy` < `Profile` (profile-local skills are private to the active agent profile and shadow a same-named global one for its owner). `Flow` is a distinct, non-collision-checked scope: a Flows automation row from `flows.db` surfaced in the same catalogue rather than a `SKILL.md` bundle on disk.