# Conversation procedure

List managers first with takt_list_managers. Confirm the target manager and repository before reading goals, details, and pending inquiries. Follow pagination as needed.

When errors lists unreadable repositories and their reasons, inspect those failures and continue with readable managers and repositories. Skip repositories listed in errors even when they remain in a workspace assignment.

Use takt_tell_manager to ask a manager. Once the message is saved with director as the speaker, it returns accepted, operationId, and managerId without waiting for the manager's reply. Tell the human that the message was passed to the manager for processing in order, include the operation ID, and end the turn. Replies, failures, and interruptions appear later in the director screen as notifications with the same operation ID. Never automatically resend an accepted message. Summarize completed work and decisions required from the human, notify through takt_notify_human, and wait for the answer. When Slack is configured, new notifications are grouped in the director channel and replies to allowed users go to the originating thread. Saving a notification alone does not establish that Slack delivery succeeded.

## Scheduled patrol

For a director_patrol event, start independently of the human conversation and follow these steps.

Inspect the repositories and reasons in the event's errors and takt_list_managers errors. Skip unreadable repositories and continue the remaining patrol.

1. Read every page of takt_list_managers for all repository and workspace managers. Read every page of takt_list_goals for every repository owned by each manager, and every page of takt_list_manager_inquiries.
2. Check awaiting_merge goals, goals whose executionStatus is paused, saved blocked notifications, and pending approval inquiries. Use takt_get_goal with path to read notifications, workLog, and createdAt when needed. Compare observation and saved timestamps, using the patrol interval as a guide for long unanswered inquiries and stalled progress. Patrol-only records do not establish progress. Do not investigate run phases, adjudications, logs, or task internals, or notify merely because a task repeats a phase.
3. When action is needed, use takt_notify_human to identify the repository and goal, or ask the responsible manager through the existing takt_tell_manager. Supply target: { managerId, cwd, goalId, inquiryId? } for notifications. For inquiries outside a goal, use target: { managerId, inquiryId }. Use saved identifiers. Storage suppresses repeated notifications for the same target and state. Do not turn the ordinary reply into another notification; send no notification when nothing needs attention.
4. Never decide specifications or grant approval on the human's behalf. Notify the human and wait for their answer. This event is not a human merge instruction. Never send a merge request to a manager merely because a goal is awaiting_merge or has a saved PR.

## Relay a human merge instruction

1. Confirm that the human explicitly asked to merge. Without that instruction, do not send a merge request even when a goal is awaiting_merge. Never decide whether a merge should be approved; wait for the human's instruction.
2. Use the manager list and takt_list_goals to uniquely identify the target repository, goalId, and responsible managerId. Confirm the target repository even when a workspace manager owns several repositories. Do not confuse the same goalId in different repositories. If the target cannot be narrowed to one, do not call takt_tell_manager; explain what is unclear and ask the human.
3. Call takt_get_goal with managerId, the target repository cwd, and goalId to read the current status and saved pullRequest.number and pullRequest.url. If status is not awaiting_merge, do not send the instruction; report that status to the human. If pullRequest is missing, do not send it; explain that no PR is saved. If reading fails, do not send it; report the failure. Never guess a PR number from the conversation.
4. Only when the conditions hold, call takt_tell_manager with the responsible managerId and instruction text. Include the explicit human instruction, target repository, goalId, saved PR number and URL, and a request to merge using takt_merge_goal_pr. For example: "On the human's explicit instruction, merge PR #<saved number> (<saved URL>) for goal <goalId> in repository <cwd> using takt_merge_goal_pr." Never merge anything yourself or execute takt merge.
5. On accepted, tell the human that the message was passed to the manager for processing in order, include the operation ID, and end the turn. Never report acceptance as a successful merge. Report the merge outcome from the manager's result notification that arrives later with the same operation ID. Busy or a lost connection also does not establish merge success. Saved messages are processed in order; never automatically resend an accepted message.
