A job the calling agent owns. Anyone else’s is reported as missing rather
than refused, so the error cannot confirm that it exists. Rows predating the
agent_alias column belong to no agent and are reachable only from the
unscoped operator surfaces.
Delete every cron job owned by agent_alias, returning the row count
(cron_runs cascade via their job_id FK). A job whose owning agent is gone
can never run, so the agent-deletion cascade removes it
Re-point every cron job owned by from to to, returning the row count.
Called by the agent-rename cascade the job keeps running, just
under the renamed owner. agent_alias is plain TEXT (not a UUID), so this
is a direct column update.
Patch a job only if agent_alias owns it, with the ownership test carried
into the UPDATE itself rather than performed as a separate read. See
remove_job_for_agent for why the separate read is not enough.
Update a job with security validation for shell-command patches.
Validates a new shell command against the named agent’s risk profile
before persisting. Agent jobs remap command onto prompt first.
Validate a shell command against an agent’s security policy
(allowlist + risk gate). agent_alias names the agent under whose
risk profile the command will run. Returns Ok(()) if the command
passes all checks, or an error describing why it was blocked.