A2A switchboard (pair cards), Secretary/PM task access + closed over-permission hole, MegaTask conventions fix (#298)

* feat(tasks): Secretary full task access; PM lighter editing — and a closed over-permission hole

Secretary: the CEO-gated edit directive covers the full content surface
(title/description/AC/priority/team/complexity/nature + claim-aware
reassignment through the real reassign paths, enum coercion, slug or
UUID assignees), and read_task returns full detail (notes, plan,
bounded progress, PR refs). The submit_directive tool docs never
mentioned edit at all — fixed, it was undiscoverable.

PMs: scouted the PATCH route and found has_higher_perms gave PM
identities UNRESTRICTED admin (ASSIGN is not team-scoped) — wider than
'not that much'. Now: cell PMs hard-403 outside their team, and both PM
roles are capped to the content allowlist (title/description/AC/
priority) with zero status changes via this surface. CEO/Board/Auditor
keep full admin. Built subagent-driven (Sonnet 5), reviewed.

* feat(a2a): the switchboard — org-chart pair cards with live activity

70 permission-matrix-derived pair cards (cells/pm-chain/board/cross),
lighting on either direction's a2a.message frames with a 45s fade —
A2A only, never verbs, per CEO ruling. Click-through reuses the v1
transcript + chime-in drawer; v1 list stays as the mobile fallback.
One CEO-gated /a2a/chat/admin/pairs route joins the static matrix
against conversations in a single bulk query. Built subagent-driven
(Sonnet 5), reviewed; pre-existing agent-utils slug-map gap flagged.

* fix(runtime): conventions ambient covers the MegaTask project_ids scope

_resolve_intake_ambient forwarded project_ids only to the history-digest
resolver — a MegaTask intake got no architectural-conventions block even
with the flag on. The conventions resolver now takes project_ids first
(mirroring the history resolver), both share one order-preserving
_projects_by_ids helper, and a regression test pins the threading to
both sub-resolvers. Built subagent-driven (Sonnet 5), reviewed.

---------

Co-authored-by: Renn F <rennf93@users.noreply.github.com>
This commit is contained in:
Renzo F
2026-07-03 01:58:38 +02:00
committed by GitHub
co-authored by Renn F
parent da563487b8
commit 876e19b389
30 changed files with 2734 additions and 67 deletions
+66
View File
@@ -103,6 +103,29 @@ export interface AdminConversationListResponse {
total: number;
}
/**
* One pair card for the CEO's A2A switchboard (org-chart view) — the static
* can_a2a_direct matrix joined with the pair's representative conversation
* stats when one exists.
*/
export interface AdminPairSummary {
agent_a: string;
role_a: string;
team_a: string;
agent_b: string;
role_b: string;
team_b: string;
group_key: string;
conversation_id: string | null;
last_message_at: string | null;
message_count: number;
}
export interface AdminPairListResponse {
items: AdminPairSummary[];
total: number;
}
export interface AdminMessageListResponse {
items: A2AChatMessage[];
total: number;
@@ -322,6 +345,49 @@ export const a2aApi = {
return data;
},
/**
* List the org-chart switchboard's pair cards (CEO-only): every agent pair
* allowed to A2A directly, joined with each pair's representative
* conversation stats when one exists.
*/
listAdminPairs: async (): Promise<AdminPairListResponse> => {
if (isMockMode()) {
return {
items: [
{
agent_a: "be-dev-1",
role_a: "developer",
team_a: "backend",
agent_b: "be-qa",
role_b: "qa",
team_b: "backend",
group_key: "cell-backend",
conversation_id: "mock-conversation-1",
last_message_at: new Date().toISOString(),
message_count: 3,
},
{
agent_a: "auditor",
role_a: "auditor",
team_a: "board",
agent_b: "product-owner",
role_b: "product_owner",
team_b: "board",
group_key: "board",
conversation_id: null,
last_message_at: null,
message_count: 0,
},
],
total: 2,
};
}
const { data } = await api.get<AdminPairListResponse>(
"/a2a/chat/admin/pairs",
);
return data;
},
/**
* Send a CEO reply. Lands in the CEO<->to_agent pairwise conversation (the
* A2A model is strictly pairwise), NOT inside the watched transcript.