You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(hub,adr-030): permission_prompt re-addressing to parent steward (W10, v1.0.683-alpha)
ADR-030 Phase 1 W10 — re-address permission_prompt rows raised by
steward-parented workers. When a worker has a same-project steward
parent, the row lands assigned_tier='project-steward' +
current_assignees_json=[<parent_id>] so the parent steward sees it
in their inbox first. Otherwise the row stays team-wide-addressed
(existing behaviour preserved for orphan workers, non-steward
parents, and binding-drift cases).
mcp_more.go::permissionPromptAddressee:
- Single SQL JOIN with the strict three-clause predicate per
ADR-030 pre-W1 decision #3:
worker.parent_agent_id IS NOT NULL
AND parent.kind LIKE 'steward.%'
AND parent.project_id IS NOT NULL AND = worker.project_id
- Two IS NOT NULL guards defend against SQL's NULL=NULL → NULL
semantics (without them, two unbound rows would accidentally
match)
- Best-effort: DB errors log a warn + return '' so transient
issues degrade to safe (team-wide)
mcpPermissionPrompt:
- Calls the helper before the INSERT
- When steward_id returned: stamps assigned_tier='project-steward'
+ current_assignees_json=[<steward_id>]
- Otherwise: leaves assignees='[]' and assigned_tier=NULL
- INSERT widened to include assigned_tier (the ADR-030 W1 column
previously written only by the propose path)
Tests (6 in mcp_permission_prompt_addressing_test.go):
- same-project steward parent → row addressed to parent
- cross-project steward parent (binding drift) → stays team-wide
(load-bearing regression for v1.0.605-class bug)
- non-steward parent → stays team-wide
- orphan worker (no parent) → stays team-wide
- NULL project_ids both sides → stays team-wide (NULL=NULL guard)
- direct helper test: ghost worker returns ''
Existing TestDecide_PermissionPromptFansOutAttentionReply still
passes — dispatchAttentionReply is untouched. The new addressing
only affects which inbox surfaces the row first; the fan-back
still routes by session_id.
Test fixture note: Write tool is TierRoutine (auto-allow), so
tests use Task (TierSignificant) so the gate doesn't short-circuit
before the INSERT. ctx timeout 100ms so the call returns
ctx-cancelled shortly after the INSERT lands.
Plan W10 rewritten to document the helper shape, 5-conjunct
JOIN, and 6-test coverage. New verify symbol anchor on
permissionPromptAddressee → 23 anchors total.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
0 commit comments