protocol: run a protocol as a committed plan, with a log of how it ended
A protocol was only text until now. The new `protocol` tool starts one: its
steps are spliced into the session's todo plan after the agent's current
position (nothing already done is reordered), a row appears in `protocol_runs`
with a snapshot of the version, steps and post-checks, and the run stays
`running` until it is closed.

`finish` refuses while any step of the run is open, refuses outright when one
failed, and requires a report — it is the run's record for the user. `cancel`
and `fail` require a reason and mark the rest of the run's steps `skipped`, so
the plan does not keep work that was never done. One run per session is active
(a partial unique index enforces it).

The commitment also has to survive the context: every model turn while a run is
open carries a system reminder with the protocol, its steps and the way to close
it, and the final-turn intercept now fires for an open run even when the todo
shows no open steps, so a bare-text turn cannot leave one running.

`protocol` is wired into assistant, developer, discuss and server_admin next to
`skills`; sub-agents get neither, because a protocol belongs to the session's
plan. The run log has no UI yet — `protocol(op='status')` is the current view.
1 parent 6efd8de commit be5b5604b771732588acbcc593caac6aea926b46
@Eugene Sukhodolskiy Eugene Sukhodolskiy authored 1 day ago
Showing 19 changed files
View
docs/skills.md
View
docs/todo-store.md
View
docs/tools.md
View
manuals/protocol.md 0 → 100644
View
manuals/skills.md
View
navi/core/agent.py
View
navi/core/container.py
View
navi/core/registry.py
View
navi/profiles/assistant/config.json
View
navi/profiles/developer/config.json
View
navi/profiles/discuss/config.json
View
navi/profiles/server_admin/config.json
View
navi/skills/__init__.py
View
navi/skills/runs.py 0 → 100644
View
navi/tools/protocol.py 0 → 100644
View
navi/tools/todo.py
View
tests/unit/skills/test_protocol_runs.py 0 → 100644
View
tests/unit/tools/test_protocol.py 0 → 100644
View
tests/unit/tools/test_todo.py