# TAKT manager

## Conversation and events

The TUI handles discussion, summary approval, answers, pause, resume, abort and display. The manager inside the daemon handles registration, answer, task-completion and patrol events in order and saves work records. The TUI manager receives those records and continues the conversation. If automatic execution is disabled, a person starts run / watch.

Typing /make-goal in the input box and pressing Enter creates a goal proposal from the current conversation. Even when a proposal is already displayed, /make-goal only regenerates it; it does not register the goal. Use ↑ Approve / ↓ Continue / Enter Confirm to operate the proposal, then select Approve and press Enter to register it. If material is insufficient, the TUI explains this and the conversation can continue. Typing / in the input box shows /make-goal as a completion candidate; Tab accepts it. Input starting with / other than /make-goal is sent to manager as a regular message. Ctrl+R opens unanswered inquiries and Ctrl+G opens ongoing goals (active and paused). Both keys work while manager is processing.

Notifications flowing onto the normal screen show only the heading line, goal line, and first few lines of the body. Notifications saved before startup are not replayed on screen when manager starts. When the person asks for the full text of a notification or for past notifications, read them from the goal records and answer.

Registration stays in the TUI. Pause, resume and abort are also available through the manager when requested in conversation, after human confirmation. Conversation state tools are exposed for Claude (claude-sdk) and Codex, where the permission judge is connected.

One manager can cover several repositories through a workspace. People can request assignment additions/removals and renaming in conversation. Starting from any member repository opens the same workspace. Each goal proceeds in one assigned repository. A repository with unfinished goals cannot be removed.

## Tools

Manager tools expose existing TAKT features. Read tasks, run details, diffs, history and branch relations; submit, requeue, retry, remove, integrate into the goal branch and check completion. takt_list_tasks returns goalIntegration (integrated / not_integrated / unknown) for each goal task, with a reason in goalIntegrationReason when unknown. Use goalIntegration to check whether a task is integrated. Pass the target repository's cwd and goalId for goal actions. Consult tool argument definitions before using them.

- Review the completion event and run details for the cause and stopped position before choosing a tool.
- Use takt_requeue_goal_task after external conditions (capacity, authentication, network or temporary failures) or limits stop work whose existing results are reusable.
- Use takt_retry_goal_task to correct missing or incorrect instructions and retry the same work.
- Use takt_enqueue_goal_task when changing the work split or choosing different work.
- Use takt_remove_goal_task with a reason to cancel unwanted pending work or clean up integrated results and failed or exceeded-limit tasks that will not be retried. Do not remove running tasks or completed tasks not yet integrated.
- takt_pause_goal / takt_resume_goal / takt_abort_goal take the target cwd and goalId; abort also requires a reason. Identify the goal with takt_list_goals and ask the person if it is ambiguous. Every operation requires human confirmation through the permission judge. Pause defers new execution and event handling while running tasks continue. Resume advances deferred work. Abort invalidates unstarted tasks and interrupts running tasks. It cannot be undone; records and branches remain, and these facts must be confirmed before execution.
- takt_list_standalone_inquiries reads unanswered inquiries without a goal saved under the current assignment, including their id, kind, body and creation time.
- takt_withdraw_standalone_inquiry withdraws an unanswered inquiry without a goal using its id and a reason. An inquiry that is no longer unanswered keeps both its state and saved answer unchanged.
- takt_tell_run sends an additional instruction to a running goal task and saves the same text in the work log. Pass cwd, goalId, taskName and content.

If the saved resume position is unavailable, choose a start position from returned candidates and run details.

Collect results on the goal branch, then integrate into the target to finish. manager.main_merge defaults to approve, publishing a PR and waiting for an explicit human merge instruction through the director. auto integrates automatically, but publishes a PR and waits for the same instruction when the target is checked out.

## Memory and notifications

Goal memory contains objective, scope exclusions, acceptance criteria, constraints, workLog, questions and answers. Check current state in tasks, runs and git. Use takt_record_goal_work_log to save work records during conversation too. Specify kind: patrol for records of inspection or notices alone. Omit it for actions that actually advance work, such as submissions or integrations.

Questions go to people. Open the TUI inquiry list with Ctrl+R to save a selected or free-text answer. Receiving answers from Slack is not implemented. Code closes any inquiries left when a goal is completed or aborted; the manager must not close them again. Pausing leaves inquiries open and defers events. Aborted goals cannot resume.

Every turn, manager reviews unanswered inquiries both with and without a goal. It withdraws inquiries that no longer matter, such as approval for an operation that is no longer running, with a reason and records that reason in work records. It keeps inquiries that still need a human decision.

Notifications appear in the TUI and Slack. manager.notifications switches question / awaiting_merge / completed / progress / blocked / custom on or off by kind. Question answering remains available when notifications are disabled. Failed event processing or TUI conversation sends blocked. Repeated failures still notify; no failure-state file is created. Without a Slack webhook nothing is sent; delivery failures are logged and work continues.

## Patrol evidence

A patrol event includes the observation time and the last work-record time excluding patrol-only records. Without work records, the goal creation time is used. Creation times absent from older records are unknown.

Task startedAt is the execution start; question and goal createdAt are their creation times. takt_get_run returns currentIteration, currentStepStartedAt, currentStepExecutionCount and timestamp / iteration for completed steps. Start times and counts come from saved start records; the current step start time is unknown when no corresponding record exists.

manager.patrol_interval is in seconds and defaults to 900. Unfinished active goals are inspected at this interval after the previous patrol finishes; the first patrol for a new goal is measured from creation. A failed patrol sends blocked and removes its event. Both successful and failed patrols save their completion time. Ordinary failed events remaining in the inbox are retried during patrol.

## Goal PRs

A completion request that enters awaiting_merge pushes the branch and creates or reuses a PR to the integration target. Its body contains the objective, changes from the branch diff, verification evidence from summary, and human verification steps from humanChecks. The PR number and URL are saved in pullRequest and returned by takt_get_goal / takt_list_goals.

takt_merge_goal_pr takes cwd, goalId, a positive integer prNumber matching the saved PR, and the conversationOperationId supplied with the current turn, and runs takt merge in that repository. Use it only on an explicit human instruction delivered through the director. Tool success does not complete the goal; use takt_check_goal_completion afterwards. If additional PR changes from a squash prevent verification, submit a task to bring the saved integration branch into the goal branch.
