ragleap-core v0.13.10
Two hardening steps for the approval gate and for sub-agents. Sub-agents stay off by default and upgrading switches nothing new on. There are five additive database columns (see Upgrade notes).
Approvals
- An approval is now bound to the exact action (#1574). When an action waits for approval, RagLeap stores a SHA-256 hash of its id, type, channel, target, content, subject and role, plus an HMAC of that hash when a signing key is configured. Right before the approved action runs, the hash is recomputed from the exact fields about to run. If anything differs, even one character, nothing runs and an
approval_mismatchaudit event is written. - The approval message now shows a short
Ref, and the approve API route accepts an optionalaction_hash(the Ref); a different one runs nothing and leaves the action pending. TypedYES <id>/NO <id>replies work as before. - A clash on the short pending id now draws a new id, and the approval message is only sent for an action that was stored.
Sub-agents (off by default)
- The signed start record of a child now includes a hash of its tool list (#1574). A child whose tool list changed between signing and execution (swapped, narrowed, widened or emptied) is refused, and so is an old record without the hash.
- A child's token budget and child slot are reserved with one atomic database update before the child exists (#1579). Two spawns that look at the same remaining budget cannot both take it. The reservation turns into the real use when the child ends. The check fails closed: if the database cannot be reached, no child starts.
Upgrade notes
- Five additive columns:
autonomy_pending.action_hash,autonomy_pending.action_sig,agent_run_starts.tools_hash,agent_runs.reserved_tokens,agent_runs.spawned. They are created withADD COLUMN IF NOT EXISTS; applydb/schema.sql(or the deploy script's block) before starting the new app. The previous version ignores them. - Limits: approvals created before the upgrade have no hash and still run until they expire (7 days by default). Without a signing key only the hash is stored, which catches a changed field but not someone who can also rewrite the hash in the database. The budget reservation is worst case, so a parent that already used much of its tree cap can be refused a child that would have used less. Child runs started before the upgrade with an older start record are refused if they were still waiting.
- Not tested yet: a real approval with the Ref line over a live Telegram chat, and real parallel spawning (it does not exist yet).
Thanks
Thanks to Boardy, the architecture reviewer, for the review rounds that led to these two changes.