Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Rule Daemon Host Tools Outcomes?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/geniro-io-rule-daemon-host-tools-outcomes)
---
name: rule-daemon-host-tools-outcomes
description: "Host tools — record_outcome (thread and pull-request outcomes), goals, the team-note store, flag_issue, milestone steps and the thread timeline. A repository rule for apps/daemon/src/v1/agents/**/*goals*, apps/daemon/src/v1/agents/**/goal-writers.broker*, apps/daemon/src/v1/agents/**/team-note*, apps/daemon/src/v1/agents/**/chat-team-notes*, apps/daemon/src/v1/agents/**/run-outcome*, apps/daemon/src/v1/agents/**/chat-run-outcomes*, apps/daemon/src/v1/mcp/tools/record-outcome/**, apps/daemon/src/v1/mcp/tools/goals/**, apps/daemon/src/v1/mcp/tools/team-note/**, apps/daemon/src/v1/mcp/tools/team-notes/**, apps/daemon/src/v1/mcp/tools/flag-issue/**, apps/daemon/src/v1/agents/**/flag.broker*, apps/daemon/src/v1/agents/**/agent-flag*, apps/daemon/src/v1/agents/**/host-flag-issue*, apps/daemon/src/v1/mcp/tools/milestone/**, apps/daemon/src/v1/agents/**/milestone*, apps/daemon/src/v1/agents/**/chat-timeline*, apps/daemon/src/v1/agents/**/timeline-events*; read it before editing a file there."
---
<!-- GENERATED by scripts/sync-agent-rules.mjs from .claude/rules/daemon-host-tools-outcomes.md. DO NOT EDIT: edit the source, then run `pnpm sync:agent-rules`. -->
# Host tools — outcomes, goals, team notes, flags, milestones and the thread timeline
- `record_outcome` (`RunOutcomeBroker`, every run: a team pass registers each member's sink, a chat keeps its own past the turn): a general call (`outcome` + `summary`, optionally `needs_you` — one sentence of at most 300 characters on what the user must decide or do, empty for nothing — and `main_page`, an artifact id of the run's page listing, `ChatArtifactsService`, left out with a note in the receipt when it names no page) records how the whole thread ended as an append-only `thread_outcome` row, the newest kept in `Run.threadOutcome` and announced as `run_status.outcome`; a call repeating the newest kind, summary, `needs_you` and main page writes nothing, so one that changes only those is a new finish. Without one the thread's outcome is derived from its goals once none is open (`utils/run-goals.ts` `threadOutcomeOf`: of the goals not dropped, all achieved is success, some partial, none failed; null while a goal is open). The served outcome (`ThreadOutcome`, built only by `threadOutcomeOf`) carries `needsYou` and `mainPage` (optional keys in the stored outcome and the row, so an outcome stored before reads null, as a derived one does), `at`, when the thread finished (the `thread_outcome` row's time, kept in `Run.threadOutcome` since it was added and null for one stored before; for a derived outcome the latest `closedAt` of the goals not dropped), and `divergesFromGoals` (`outcomeDivergesFromGoals`): a RECORDED `success` while a goal not dropped is open or `not_achieved`, read over every goal of the run; the Progress popup and the agents panel's Goals row draw it. `Run.threadOutcome` stores the outcome without it (`StoredThreadOutcomeSchema`). A pull-request call records where one pull request stands (`pr_number`, `pr_url`, `draft`, `review_rounds`, `acceptance`, and an optional `summary` a person reads, kept only on the row) as an append-only `run_outcome` row in its own transcript, filed in the call its conversation answers like a team note. The newest row per pull request (owner/repo/number parsed from `pr_url`, which must name `pr_number`) is the outcome. A call whose draft, review rounds and acceptance equal that newest outcome — read from the rows, never from the `Run.runOutcomes` column, whose write may have failed — writes nothing and answers `unchanged`. Every call, unchanged or not, first catches the column up to the newest row of each pull request it lags on, in one write, and announces each. `questionsAsked` (question `approval_request` rows of the run, matched by every adapter's `questionToolName` plus `HOST_QUESTION_TOOL`, counted by `RunOutcomeHistoryService` — the one counter the broker, the stats ledger, the analysis reader and the panel route share; `Item.payload` is JSON text, parsed before it is read) and the team slug are the daemon's, never the agent's. `GET /v1/chats/:runId/outcomes` serves every outcome per pull request with its history figures (`changesRequestedRounds`, arrivals at `changes_requested`; `msToAccepted`, first outcome to first `accepted`) and each row's questions asked before it, for the agents panel. A row written before the count parsed `Item.payload` keeps its stored `questionsAsked` of 0, which the transcript row and the shelf still draw; the panel, the ledger and the analysis recount it. Ledger copies of runs deleted before that are never recounted, so the history's per-run question average leaves out every copy without its history figures. Writes of one run are serialized; after the row, `Run.runOutcomes` keeps the newest per pull request (keyed case-folded, `pullRequestOutcomeKey`) for the run's wire projection (`DisplayedPullRequest.outcome`), and the list is announced through `PullRequestCaptureService.announceOutcome`, chained on the capture pass's per-run order so neither writer re-sends a list the other has moved; a failure there is logged without refusing the call. Only a pull request on the run's displayed list carries its outcome to the renderer. The stats module copies each row into `usage_activity` (Stats).
- `goals` (`GoalsService`, `run_goals`, teardown-exempt): offered on every endpoint, and the one tool beside the call tools carrying `ALWAYS_LOADED_TOOL_META` — deferred, its own description (set goals at the start of a task) reached a model only after it had already decided to search for the tool. In a team run only the LEAD writes them (user decision 2026-11-12: a member answering a call had replaced the whole run's goals with its own checklist): every write (`set`, `add`, `update`, `remove`, `complete`, `reopen`) passes only where `GoalWritersBroker.canWrite` holds — the sink `TeamExecutorService.registerLeadCardSinks` registers for every member with the lead tools' `offeredTo` (the run's lead, in its own conversation, while its turn runs) — and is otherwise refused when the run has a `teamId` (`GoalsService.isTeamRun`, so a member the executor holds no sink for is refused too), with `goalsLeadOnlyText`; `list` stays open to every member and conversation, and a team member's description says who writes (`goalsInstructions(teamMember)`). A chat registers no sink and writes as before; the user's own edits never pass through the tool. `set` replaces the open goals, `add`, `update` and `remove` (an agent touches open goals only; the user may reword a closed one; a removed goal is soft-deleted, so its number is never handed out again) `complete` (status and evidence, required for every status) and `reopen` (a closed goal back to open, its evidence gone, so a retry closes the same goal rather than a copy that counts twice). The user edits through `/v1/chats/:runId/goals` (add, edit, close, reopen). Writes of one run are serialized; each rewrites `Run.goals` (the wire projection) and announces `run_status.goals` with the outcome. A stage with `requireGoals` refuses `complete` (`GOALS_REQUIRED`) while the run has no goal.
- `team_note` / `team_notes` (`TeamNoteBroker`, team runs only — a chat registers no sink): one run-wide store every agent of the run reads. A note is an append-only `team_note` row in its author's transcript, filed in the call its conversation answers (`callAnsweredBy`); a correction is a newer note naming the old seq in `supersedes`, folded by `utils/team-note-fold.ts` for the tool and for `GET /v1/chats/:runId/team-notes` alike. Writes of one run are serialized so the per-run cap (`TEAM_NOTES_PER_RUN`, counted from the table) holds under racing writes; caps refuse, never truncate. Which notes each conversation was shown is in memory, and only a shown note counts as read, so a narrowed read leaves the rest unread; a superseded note never counts (its replacement is the note to read); a read with no filter (only `limit` allowed) returns just the notes the conversation was not shown and did not write, and `since: 0` reads every note; the shown record is forgotten on a finished main-thread compaction (`forgetShown`), on a changed CLI session id (`sessionOpened`), and when a `team_notes` read may not have reached the conversation — a delegate made it (a claude sub-agent reaches the parent's MCP server under the parent's caller key), its result was an error, or the turn ended with it still open — all from the executor's event handler, and after a restart every other note it did not write counts as unread again (over-reports, never hides). The unread figure rides `team_note` / `team_notes` replies, every call envelope (`unread_team_notes`, beside the envelope, not an arm of it) and the call broker's wake text (`RunCallCapability.unreadTeamNotes`) — never the system prompt or the May-call block, which `sessionKey` hashes.
- `flag_issue` (`FlagBroker`, `agent_flags`, teardown-exempt): offered in every run kind — a chat keeps its sink past the turn (`ChatService.keepHostTools`), a team pass registers each member's (`registerFlagSinks`), and a hidden lessons chat keeps it through `HIDDEN_LESSONS_TOOLS`. Auto-approved in every mode (`isHostFlagIssueCall`, in the chat gate and both of the executor's chains): it writes one row and decides nothing. The row's identity (member, conversation, answered call, agent and model — a chat's from the run) comes from the sink, its thread kind (`agentFlagRunKindOf`), title, team and project from the run, its `seq` is the run's newest row; nothing of it from the arguments. Writes of one run are serialized so the caps hold: `AGENT_FLAGS_PER_CONVERSATION` per conversation (`FLAG_LIMIT`) and one summary per thread, compared case- and spacing-insensitively (`DUPLICATE_FLAG`); a `work` flag needs `minutesLost` (`MINUTES_REQUIRED`). Summary and detail pass `redactSecrets` at the write. Every analysis reads the flags first (`.claude/rules/daemon-thread-analysis.md`).
- Automatic flags (`FlagBroker.raiseAutomatic`, `AgentFlag.automatic` and `autoCause`, `automatic` on the wire): the daemon raises a `work` flag in `geniro_tool` itself, with no sink, when the boot reconcile finds a team run a stop cut off (`TeamExecutorService.flagInterrupted`: `reconcileOrphanedRuns`, both its work-continues and failed paths, and `abandonRestartContinuation`; the interrupted row's seq, minutes from the run's last row to the reconcile), when a geniro tool's call ends with `McpToolResult.failure` (`timeout` or `internal`, error or not) or throws — its member's agent, model and answered call read from that member's `flag_issue` sink when it has one, else the run's — and when one tool answers with an error `AUTO_FLAG_REFUSAL_STREAK` times running on one endpoint (`ToolFailureFlagsService`, fed by `McpServerService`'s call handler; a success ends the streak, a failure is not counted in it, kept in memory). One flag per cause per thread: `autoCause` (`autoFlagCause`: `interrupted:<cause>`, `tool_failure:<tool>`, `tool_refused:<tool>`) is unique per run, soft-deleted rows included. Automatic rows count against no conversation's cap and never make an agent's summary a `DUPLICATE_FLAG` (`summariesOf` leaves them out). `minutesLost` is capped at `AGENT_FLAG_MINUTES_MAX`; for an interrupted run it counts to the reconcile at the restart, also when the run does not continue (user decision). A run-wide automatic flag (no member) carries no `node` in `view=overview`. `raiseAutomatic` never throws; a failed write is logged.
- `milestone` (`MilestoneBroker`, offered wherever `record_outcome` is: a chat keeps its agent's sink past the turn, a team pass registers every call-capable member's — one sink object serves both brokers): an agent records one important step as an append-only `milestone` row (`MilestonePayloadSchema`, twin `chats/milestone-payload.ts`): `text` (one line, `MILESTONE_TEXT_MAX_CHARS` code points, cut not refused), `kind` (`progress` default, `problem`, `done`), and the writer's `nodeId` / `conversationId` / `callId` (`callAnsweredBy`), persisted under the writing member, so a callee's step is filed in its call's card. Writes of one run are serialized; a step equal in text and kind to the same conversation's newest one writes nothing (`unchanged`), and past `MILESTONE_RUN_CAP` rows a step is refused. Auto-approved in every mode (`isHostMilestoneCall`) in all three approval lists: the chat's `autoApproves` (between turns too), the team's in-turn arm and `onBetweenTurnApproval`. It draws a compact transcript row and a timeline event, never a command-center feed row.
- The thread timeline (`ChatTimelineService.read`, `GET /v1/chats/:runId/timeline`): beside the markers, `events` newest first, cut to `TIMELINE_EVENTS_MAX` with `eventsPartialReason` saying so. The sources are read one index walk per kind (`ItemDao.newestRowsOfKinds`: one `UNION ALL` arm per kind on `(run_id, kind, seq)`, one past the cap, a kind most of whose rows are no event narrowed in the read by a payload field — stage moves to complete/skip/reopen/handoff), never a `kind IN (…)` read; a team run's failed calls are the one source read through `RunKindRowsCache` (`CALL_RECORDS`, which every team reader holds already), filtered to `status: error` in memory, since a payload-field filter in SQL walks every `call_result` payload when few failed; an approval is open until an `approval_verdict` or `unanswerable` row names its payload id (`ItemDao.payloadIdsAnsweredBy`); a pull request is dated by the row that reported it (`earliestToolResultTimes`), an achieved goal by its `closedAt` (`seq: null`; a reopened goal is gone); `started` is the first agent row after the user first spoke. The mapping is pure (`utils/timeline-events.ts`); `usage_activity` is never read here.