A working advisor/reviewer skill: field report and lessons for a native advisor #1924
pcarielo
started this conversation in
Feature requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
A working advisor/reviewer skill: field report and lessons for a native advisor
Category: Feature requests | prime-agent 0.8.1 | Linux
Summary
We wanted the /advisor behavior Claude Code has: a stronger reviewer model that
sees the whole session and tells you the approach is wrong before it hardens.
0.8.1 already ships the primitives (recursive sub-agents, kernel Python
skills, agent messaging), so we built it as a skill instead of waiting for a
native feature.
Then we made the reviewer review its own skill, adversarially, over five
rounds. Every round found a real bug until the last one, which came back
sound. The result ships with a 41-check regression suite. Both the private
deployment and this exact model-agnostic variant (loaded via
--skill <path>) were smoked end to end in fresh root sessions: native load,spawn, reply retrieval through
latest(handle), cleanup.Why post this: there is a related closed architecture proposal (#1448, an
outside contributor's unmerged PR with zero maintainer reviews; read-only
reviewer subruntime, severity routing, terminal-triggered reviews). We have no
insight into maintainer intent for it. What we can report is that the concept
works well in practice from the skill layer, and where the skill layer had to
fight the runtime to get there.
What the skill does
It builds a compact transcript from the current session log (roles labelled
[USER]/[AGENT]/[TOOL x]/[RESULT x]/[AGENT MESSAGE x], openingtask kept, recent tail within a character budget), spawns a reviewer child with
a reviewer persona plus the transcript plus the focus question, and the reply
arrives as an ordinary agent message.
latest(handle)returns the reply ofthat exact child, matched by session UUID.
What five adversarial rounds taught us
approach is about to harden: before substantive work, before declaring done
(deliverable made durable first), when stuck, when changing approach. Short
reactive tasks do not need it.
agent_message records in the PARENT session log, so matching by name returns
a deleted predecessor's advice after a name reuse. We match the child's
session UUID (from
rlm-subagent.json, falling back to the newest*.jsonlin that child's session dir) against the
From: <name>, active <id>, session <uuid>envelope. Unresolvable identity returns None. Never a name fallback.cut in half by a clip boundary slips past length-threshold redaction
patterns. Redact every block before clipping, then redact the assembled
transcript again.
found X, you suggested Y, which constraint breaks the tie?") need to see the
previous critique without manual summarization.
another reviewer, recursively, until the depth limit. The persona forbids
it.
/ VERIFY keeps critiques actionable and machine-checkable. It maps cleanly
onto the severity routing sketched in docs(coding-agent): advisor, prompt-settlement, and ask-user architecture docs #1448, and terminal-triggered review
is exactly the before-declaring-done consult.
Where the skill layer had to fight the runtime
documented (
session-format.md), but a skill must locate its own session log(we derive it from
RLM_SESSION_DIR's basename and fail closed when thatexact path cannot be resolved; in one fresh root session that basename did
not even match the session log filename, and the skill refused until given
transcript_path=, which is the correct failure mode) and parse internalslike the
custom_message/agent_messageenvelope. Arlm.session_log()host request, or a rendered transcript, would remove thewhole class of format-drift risk.
rlm.run()is admission-only bydesign and replies arrive on later turns. For consult flows we parsed the
parent log's agent_message records.
handle.latest_reply()oragent_message.latest(handle)would make the consult pattern first-class.rlm-subagent.jsonappearsshortly after admission. A
latest(handle)called in the same breath as thespawn cannot resolve identity yet. Registry-before-return, or the session
UUID on the spawn handle, would close the race.
native advisor will forward conversation content to another model. Pre-clip
redaction and a documented stance belong in the design from day one.
One further runtime observation (forkserver template caching skill preimports
for children of older sessions) is now a bug report with a reproduction:
#1925
A second observation about scheduled refinement timing could not be
reproduced reliably and is not reported.
What we can offer
Happy to contribute when invited, per CONTRIBUTING. No unsolicited PR. The
skill works as a built-in candidate or as a documented recipe; it is
model-agnostic (free model selection by default,
ADVISOR_MODELandADVISOR_ALLOWED_MODELSfor pinning and fleet policy), the regression suitecomes with it, and the transcript renderer plus reply matcher is a ready-made
reference implementation for the client side of a native feature.
All reactions