RAGE #260: Python hooks and advice registry #303

Open
nsaspy wants to merge 0 commits from rage/260-python-hooks-advice into master
Owner

Continues issue #260 from exact master 89e6fbc6f17df0a86083b5e66dd1496c89555daf after the Prolog hook/config seam merged.

Current state: TDD RED.

This bounded iteration establishes the Python lifecycle customization contract around the existing canonical run_conversation_loop without replacing the runtime yet.

Research/design decisions:

  • one per-runtime owner-aware advice registry; no global second agent loop;
  • closed kinds: before, after, around, override;
  • deterministic priority/sequence ordering and owner cleanup;
  • around is override-capable because it can suppress its continuation, so both around and override require [hooks].enabled=true and [hooks].allow_override=true;
  • disabled hooks are inert;
  • registry itself reads no user file/secrets and grants no tool authorization;
  • future hooks.py loader will reuse mutable XDG config ownership rather than Nix/Git state;
  • no android/** changes; sibling Android PR #284 remains separately owned.

RED head: f2a9c09da861890e161bc30a7f01e8b3c13c350a.
t/test_agent_hooks.py intentionally imports the not-yet-existing zara.agent.hooks registry. Exact-head CI is expected to fail at collection for that missing production seam. Do not merge until implementation, integration RED/GREEN, full repository/Nix/build gates, and exact-head CI all pass.

Evidence:

  • rage/260-hooks-prolog-config.org iteration 3
  • rage/260-python-hooks-advice-research.org
  • rage/260-python-hooks-advice-design.org
  • t/test_agent_hooks.py

Issue #260 remains open after this registry slice; user hooks.py, AgentManager integration, backend registry, Prolog command advice/override, plugin lifecycle cleanup, diagnostics and wiki still remain.

Continues issue #260 from exact master `89e6fbc6f17df0a86083b5e66dd1496c89555daf` after the Prolog hook/config seam merged. Current state: **TDD RED**. This bounded iteration establishes the Python lifecycle customization contract around the existing canonical `run_conversation_loop` without replacing the runtime yet. Research/design decisions: - one per-runtime owner-aware advice registry; no global second agent loop; - closed kinds: `before`, `after`, `around`, `override`; - deterministic priority/sequence ordering and owner cleanup; - `around` is override-capable because it can suppress its continuation, so both `around` and `override` require `[hooks].enabled=true` and `[hooks].allow_override=true`; - disabled hooks are inert; - registry itself reads no user file/secrets and grants no tool authorization; - future `hooks.py` loader will reuse mutable XDG config ownership rather than Nix/Git state; - no `android/**` changes; sibling Android PR #284 remains separately owned. RED head: `f2a9c09da861890e161bc30a7f01e8b3c13c350a`. `t/test_agent_hooks.py` intentionally imports the not-yet-existing `zara.agent.hooks` registry. Exact-head CI is expected to fail at collection for that missing production seam. Do not merge until implementation, integration RED/GREEN, full repository/Nix/build gates, and exact-head CI all pass. Evidence: - `rage/260-hooks-prolog-config.org` iteration 3 - `rage/260-python-hooks-advice-research.org` - `rage/260-python-hooks-advice-design.org` - `t/test_agent_hooks.py` Issue #260 remains open after this registry slice; user `hooks.py`, AgentManager integration, backend registry, Prolog command advice/override, plugin lifecycle cleanup, diagnostics and wiki still remain.
Some checks failed
CI / test (pull_request) Failing after 7s
CI / android skeleton gate (pull_request) Failing after 5s
CI / shared mic / Arch Linux (pull_request) Failing after 3m16s
CI / shared mic / Ubuntu 24.04 (pull_request) Has been cancelled
This branch is already included in the target branch. There is nothing to merge.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin rage/260-python-hooks-advice:rage/260-python-hooks-advice
git switch rage/260-python-hooks-advice

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch master
git merge --no-ff rage/260-python-hooks-advice
git switch rage/260-python-hooks-advice
git rebase master
git switch master
git merge --ff-only rage/260-python-hooks-advice
git switch rage/260-python-hooks-advice
git rebase master
git switch master
git merge --no-ff rage/260-python-hooks-advice
git switch master
git merge --squash rage/260-python-hooks-advice
git switch master
git merge --ff-only rage/260-python-hooks-advice
git switch master
git merge rage/260-python-hooks-advice
git push origin master
Sign in to join this conversation.
No description provided.