tix-tracker 0.12.0

A terminal issue tracker: markdown + YAML frontmatter issues with a kanban TUI and CLI
Documentation
#[allow(clippy::wildcard_imports)]
use super::*;

#[allow(clippy::too_many_lines)]
pub(super) fn descriptors() -> Vec<ToolDescriptor> {
    vec![
        ToolDescriptor {
            name: "cycle_schedule_list",
            description: "List the repeating cycle schedules defined in `[cycle_schedules.<id>]` (`tix cycle schedule list`), one row per schedule in declaration order: the stable `id`, the mutable display `name`, the lifecycle `state`, the cadence in words, the duration, the anchor `start_date`, the `look_ahead`, the derived `next_sequence` and how many instances exist. Read-only. The identity, the cursor and the diagnostics come from the one `ScheduleIndex` the CLI, the TUI and the refresh warning build (C-008).",
            input_schema: json!({
                "type": "object",
                "additionalProperties": false,
                "properties": {}
            }),
        },
        ToolDescriptor {
            name: "cycle_schedule_show",
            description: "Return one schedule's full state (`tix cycle schedule show`): identity, cadence and its rule in words, duration, anchor, timezone, look-ahead, the derived cursor (`next_sequence`, `next_start`, `last_generated_key`), every generated instance with its state and effective dates, and every identity finding about it. `schedule` is the stable id, or a display name that names exactly one schedule — an ambiguous name is refused rather than guessed. Read-only.",
            input_schema: json!({
                "type": "object",
                "additionalProperties": false,
                "properties": {
                    "schedule": { "type": "string", "description": "Stable schedule id, or a display name that names exactly one schedule." }
                },
                "required": ["schedule"]
            }),
        },
        ToolDescriptor {
            name: "cycle_schedule_create",
            description: "Define a repeating cycle schedule (`tix cycle schedule create`). The whole record is validated before the atomic save, so an invalid definition leaves `tix.toml` exactly as it was. Requires `confirm: true`; without it nothing is written and the refusal names the missing confirmation. A schedule id is never reused: an id already in the registry is refused as `exists`, and an id a stored cycle record **or** a closed-cycle snapshot still claims is refused as `id_spent`, naming whichever holder remains, because re-creating the id would otherwise silently rebind that history to a new definition (C-003/C-007).",
            input_schema: json!({
                "type": "object",
                "additionalProperties": false,
                "properties": {
                    "id": { "type": "string", "description": "Stable schedule id (letters, digits, `-`, `_`, `:`); the registry key, and it is never reused." },
                    "name": { "type": "string", "description": "Display label, unique case-insensitively within the registry." },
                    "cadence": { "type": "string", "description": "Cadence family: `daily`, `weekly`, `monthly` or `interval`. `interval` is the family that carries `unit`; the others refuse one." },
                    "interval": { "type": "integer", "minimum": 1, "description": "How many cadence units between cycle starts (1-1000; absent means 1)." },
                    "unit": { "type": "string", "enum": ["days", "weeks", "months"], "description": "The unit an `interval` cadence counts in." },
                    "duration": { "type": "integer", "minimum": 1, "description": "How long one cycle lasts, as a positive count." },
                    "duration_unit": { "type": "string", "enum": ["days", "weeks", "months"], "description": "The duration's unit." },
                    "start_date": { "type": "string", "description": "The schedule's stable anchor, a `YYYY-MM-DD` calendar date." },
                    "timezone": { "type": "string", "description": "Fixed UTC offset the schedule is expressed in: `UTC` or `±HH:MM` (`-05:00` is accepted). A named IANA zone is refused by the shared validator, which names each field." },
                    "look_ahead": { "type": "integer", "minimum": 0, "description": "How many future cycles to consider beyond the current one (0 when absent)." },
                    "confirm": { "type": "boolean", "description": "Must be true. Without it nothing is written and the refusal names the missing confirmation." }
                },
                "required": ["id", "name", "cadence", "duration", "duration_unit", "start_date", "timezone", "confirm"]
            }),
        },
        ToolDescriptor {
            name: "cycle_schedule_edit",
            description: "Change a schedule's fields, keeping its stable id (`tix cycle schedule edit`). Only the fields you name change; the rest of the record — including the generation cursor and preserved unknown metadata — is carried over, so identity survives a rename (C-002). An `interval`-family cadence edits its `interval`/`unit` in place. Requires `confirm: true`; the whole record is validated before the atomic save, so a refused edit leaves `tix.toml` unchanged.",
            input_schema: json!({
                "type": "object",
                "additionalProperties": false,
                "properties": {
                    "schedule": { "type": "string", "description": "Stable schedule id, or a display name that names exactly one schedule." },
                    "name": { "type": "string", "description": "New display label." },
                    "cadence": { "type": "string", "description": "New cadence family: `daily`, `weekly`, `monthly` or `interval`." },
                    "interval": { "type": "integer", "minimum": 1, "description": "New cadence interval (1-1000)." },
                    "unit": { "type": "string", "enum": ["days", "weeks", "months"], "description": "New cadence unit (only meaningful for the `interval` family)." },
                    "duration": { "type": "integer", "minimum": 1, "description": "New duration count." },
                    "duration_unit": { "type": "string", "enum": ["days", "weeks", "months"], "description": "New duration unit." },
                    "start_date": { "type": "string", "description": "New anchor date, `YYYY-MM-DD`." },
                    "timezone": { "type": "string", "description": "New timezone: `UTC` or `±HH:MM` (a west-of-UTC offset is accepted)." },
                    "look_ahead": { "type": "integer", "minimum": 0, "description": "New look-ahead count." },
                    "confirm": { "type": "boolean", "description": "Must be true. Without it nothing is written and the refusal names the missing confirmation." }
                },
                "required": ["schedule", "confirm"]
            }),
        },
        ToolDescriptor {
            name: "cycle_schedule_delete",
            description: "Delete a schedule's registry entry (`tix cycle schedule delete`). Requires `confirm: true`. The generated instances and their snapshots are **not** deleted: they keep their schedule reference, which then reads as a diagnosable missing schedule, so nothing is destroyed by deleting a definition (C-007). The id stays spent — it is never reused.",
            input_schema: json!({
                "type": "object",
                "additionalProperties": false,
                "properties": {
                    "schedule": { "type": "string", "description": "Stable schedule id, or a display name that names exactly one schedule." },
                    "confirm": { "type": "boolean", "description": "Must be true. Without it nothing is written and the refusal names the missing confirmation." }
                },
                "required": ["schedule", "confirm"]
            }),
        },
        ToolDescriptor {
            name: "cycle_schedule_detect",
            description: "Report the schedule warnings (`tix cycle schedule detect`): every `ended`, `due` and `look-ahead` warning — with the instance or candidate's stable id, its effective dates and the explicit decisions it accepts — plus a `failure` warning for a schedule that cannot be evaluated, field-attributed. Read-only, and non-mutating by contract: detection creates no cycle, moves no cursor, writes no file and appends no History. `date` is the explicit date context; omitted, the boundary resolves today, which is why passing `date` is what makes an answer reproducible. `timezone` rides on the same shared evaluation context; the evaluator's answer is offset-independent (a schedule's own validated offset is the calendar its cadence is expressed in), which is why the CLI's namespace exposes `--date` alone.",
            input_schema: json!({
                "type": "object",
                "additionalProperties": false,
                "properties": {
                    "date": { "type": "string", "description": "Evaluate against this `YYYY-MM-DD` date instead of today." },
                    "timezone": { "type": "string", "description": "The timezone the date context carries, e.g. `+01:00` or `UTC`." }
                }
            }),
        },
        ToolDescriptor {
            name: "cycle_schedule_generate",
            description: "Create the schedule's future cycle instances (`tix cycle schedule generate`). Requires `confirm: true`; without it nothing is written and the refusal names the missing confirmation. Idempotent: a candidate whose stable key is already taken returns `status: \"no-op\"` and writes nothing, never a duplicate. `through` is a horizon selector (`--through`): every candidate starting on or before that date. Omitting it uses the schedule's own configured `look_ahead`, exactly as a confirmation of what detection showed. Every outcome carries the service's own vocabulary (`created`/`no-op`/`rejected`).",
            input_schema: json!({
                "type": "object",
                "additionalProperties": false,
                "properties": {
                    "schedule": { "type": "string", "description": "Stable schedule id, or a display name that names exactly one schedule." },
                    "through": { "type": "string", "description": "Generate every candidate whose start date is on or before this `YYYY-MM-DD` date." },
                    "date": { "type": "string", "description": "The `YYYY-MM-DD` as-of date the request records; omitted, the boundary resolves today. Generation is anchored at the schedule's own dates, so the as-of date never derives an instance." },
                    "timezone": { "type": "string", "description": "The timezone the as-of context carries, e.g. `+01:00`. A zone the crate cannot resolve is reported rather than normalized." },
                    "confirm": { "type": "boolean", "description": "Must be true. Without it nothing is written and the refusal names the missing confirmation." },
                    "actor": { "type": "string", "description": "Who confirmed the pass, for the audit context. Default: the boundary's actor (the git identity)." }
                },
                "required": ["schedule", "confirm"]
            }),
        },
        ToolDescriptor {
            name: "cycle_schedule_close",
            description: "Close one instance (`tix cycle schedule close`): capture its immutable snapshot under `docs/cycle_snapshots/`, mark the record closed and append one History event to the record's own body. Requires `confirm: true` and a `reason` — the service refuses a missing one by name. Idempotent: an already-closed instance returns `status: \"no-op\"` and never appends a second snapshot or event. Name the instance with `cycle` (`<schedule-id>:<sequence>`) or with `from` (its start date).",
            input_schema: json!({
                "type": "object",
                "additionalProperties": false,
                "properties": {
                    "schedule": { "type": "string", "description": "Stable schedule id, or a display name that names exactly one schedule." },
                    "cycle": { "type": "string", "description": "Target instance, `<schedule-id>:<sequence>` (e.g. `cs-sprint:000001`)." },
                    "from": { "type": "string", "description": "Select the instance by its start date, `YYYY-MM-DD`." },
                    "reason": { "type": "string", "description": "Why; recorded in the instance's History. Required by this action." },
                    "actor": { "type": "string", "description": "Who decided, for the History entry. Default: the boundary's actor (the git identity)." },
                    "timestamp": { "type": "string", "description": "The explicit RFC 3339 close instant. Default: the boundary clock, exactly as the CLI resolves it." },
                    "confirm": { "type": "boolean", "description": "Must be true. Without it nothing is written and the refusal names the missing confirmation." }
                },
                "required": ["schedule", "confirm"]
            }),
        },
        ToolDescriptor {
            name: "cycle_schedule_reopen",
            description: "Reopen one closed instance (`tix cycle schedule reopen`): the record's state returns to `active` and exactly one History event is appended, naming the snapshot the close captured. Requires `confirm: true` and a `reason` — the service refuses a missing one by name. It writes **no** snapshot: a closed cycle's capacity evidence is immutable (C-008/NFR-002), so the prior snapshot's bytes are untouched and its `snapshot_id` stays readable after the reopen. Idempotent: an instance that is not closed returns `status: \"no-op\"` and appends no second event. Name the instance with `cycle` (`<schedule-id>:<sequence>`) or with `from` (its start date).",
            input_schema: json!({
                "type": "object",
                "additionalProperties": false,
                "properties": {
                    "schedule": { "type": "string", "description": "Stable schedule id, or a display name that names exactly one schedule." },
                    "cycle": { "type": "string", "description": "Target instance, `<schedule-id>:<sequence>` (e.g. `cs-sprint:000001`)." },
                    "from": { "type": "string", "description": "Select the instance by its start date, `YYYY-MM-DD`." },
                    "reason": { "type": "string", "description": "Why; recorded in the instance's History. Required by this action." },
                    "actor": { "type": "string", "description": "Who decided, for the History entry. Default: the boundary's actor (the git identity)." },
                    "timestamp": { "type": "string", "description": "The explicit RFC 3339 reopen instant. Default: the boundary clock, exactly as the CLI resolves it." },
                    "confirm": { "type": "boolean", "description": "Must be true. Without it nothing is written and the refusal names the missing confirmation." }
                },
                "required": ["schedule", "confirm"]
            }),
        },
        ToolDescriptor {
            name: "cycle_schedule_extend",
            description: "Push one instance's due date out by one cadence period (`tix cycle schedule extend`): the window moves, one History event records the reason and the new dates. Requires `confirm: true` and a `reason`. `by` exists to refuse anything but 1 explicitly — the shared lifecycle extends by exactly one period per action and this surface will not re-derive a multi-period step of its own.",
            input_schema: json!({
                "type": "object",
                "additionalProperties": false,
                "properties": {
                    "schedule": { "type": "string", "description": "Stable schedule id, or a display name that names exactly one schedule." },
                    "cycle": { "type": "string", "description": "Target instance, `<schedule-id>:<sequence>`." },
                    "from": { "type": "string", "description": "Select the instance by its start date, `YYYY-MM-DD`." },
                    "reason": { "type": "string", "description": "Why; recorded in the instance's History. Required by this action." },
                    "by": { "type": "integer", "enum": [1], "description": "How many cadence periods to extend by; the shared lifecycle supports 1, and any other value is refused explicitly." },
                    "actor": { "type": "string", "description": "Who decided, for the History entry. Default: the boundary's actor." },
                    "timestamp": { "type": "string", "description": "The explicit RFC 3339 instant. Default: the boundary clock, exactly as the CLI resolves it." },
                    "confirm": { "type": "boolean", "description": "Must be true. Without it nothing is written and the refusal names the missing confirmation." }
                },
                "required": ["schedule", "confirm"]
            }),
        },
        ToolDescriptor {
            name: "cycle_schedule_skip",
            description: "Record one sequence as skipped (`tix cycle schedule skip`), so it is never regenerated: the instance's state becomes `skipped` and one History event records the reason. Requires `confirm: true` and a `reason`. Idempotent: an already-skipped instance returns `status: \"no-op\"`.",
            input_schema: json!({
                "type": "object",
                "additionalProperties": false,
                "properties": {
                    "schedule": { "type": "string", "description": "Stable schedule id, or a display name that names exactly one schedule." },
                    "cycle": { "type": "string", "description": "Target instance, `<schedule-id>:<sequence>`." },
                    "from": { "type": "string", "description": "Select the instance by its start date, `YYYY-MM-DD`." },
                    "reason": { "type": "string", "description": "Why; recorded in the instance's History. Required by this action." },
                    "actor": { "type": "string", "description": "Who decided, for the History entry. Default: the boundary's actor." },
                    "timestamp": { "type": "string", "description": "The explicit RFC 3339 instant. Default: the boundary clock, exactly as the CLI resolves it." },
                    "confirm": { "type": "boolean", "description": "Must be true. Without it nothing is written and the refusal names the missing confirmation." }
                },
                "required": ["schedule", "confirm"]
            }),
        },
        ToolDescriptor {
            name: "cycle_schedule_pause",
            description: "Pause a schedule and its non-terminal instances (`tix cycle schedule pause`): the schedule's state becomes `paused`, generation is refused until resumed, and one History event records it. Requires `confirm: true`. Idempotent: an already-paused schedule returns `status: \"no-op\"`. Never inferred from detection or a refresh — only a confirmed call applies it (C-004).",
            input_schema: json!({
                "type": "object",
                "additionalProperties": false,
                "properties": {
                    "schedule": { "type": "string", "description": "Stable schedule id, or a display name that names exactly one schedule." },
                    "cycle": { "type": "string", "description": "Target instance, `<schedule-id>:<sequence>`." },
                    "from": { "type": "string", "description": "Select the instance by its start date, `YYYY-MM-DD`." },
                    "actor": { "type": "string", "description": "Who decided, for the History entry. Default: the boundary's actor." },
                    "timestamp": { "type": "string", "description": "The explicit RFC 3339 instant. Default: the boundary clock, exactly as the CLI resolves it." },
                    "confirm": { "type": "boolean", "description": "Must be true. Without it nothing is written and the refusal names the missing confirmation." }
                },
                "required": ["schedule", "confirm"]
            }),
        },
        ToolDescriptor {
            name: "cycle_schedule_resume",
            description: "Resume a paused schedule and its instances (`tix cycle schedule resume`): the schedule's state returns to `active` and one History event records it. Requires `confirm: true`. Idempotent: an already-active schedule returns `status: \"no-op\"`. Never automatic, and an ended schedule stays terminal.",
            input_schema: json!({
                "type": "object",
                "additionalProperties": false,
                "properties": {
                    "schedule": { "type": "string", "description": "Stable schedule id, or a display name that names exactly one schedule." },
                    "cycle": { "type": "string", "description": "Target instance, `<schedule-id>:<sequence>`." },
                    "from": { "type": "string", "description": "Select the instance by its start date, `YYYY-MM-DD`." },
                    "actor": { "type": "string", "description": "Who decided, for the History entry. Default: the boundary's actor." },
                    "timestamp": { "type": "string", "description": "The explicit RFC 3339 instant. Default: the boundary clock, exactly as the CLI resolves it." },
                    "confirm": { "type": "boolean", "description": "Must be true. Without it nothing is written and the refusal names the missing confirmation." }
                },
                "required": ["schedule", "confirm"]
            }),
        },
        ToolDescriptor {
            name: "cycle_schedule_adjust_future",
            description: "Re-derive every future instance's dates from the schedule's own definition and re-derive the cursor (`tix cycle schedule adjust-future`). Requires `confirm: true` and a `reason`: it changes what future cycles are. Closed and skipped instances are historical and are never touched.",
            input_schema: json!({
                "type": "object",
                "additionalProperties": false,
                "properties": {
                    "schedule": { "type": "string", "description": "Stable schedule id, or a display name that names exactly one schedule." },
                    "cycle": { "type": "string", "description": "Target instance, `<schedule-id>:<sequence>`." },
                    "from": { "type": "string", "description": "Select the instance by its start date, `YYYY-MM-DD`." },
                    "reason": { "type": "string", "description": "Why; recorded in the History. Required by this action." },
                    "actor": { "type": "string", "description": "Who decided, for the History entry. Default: the boundary's actor." },
                    "timestamp": { "type": "string", "description": "The explicit RFC 3339 instant. Default: the boundary clock, exactly as the CLI resolves it." },
                    "confirm": { "type": "boolean", "description": "Must be true. Without it nothing is written and the refusal names the missing confirmation." }
                },
                "required": ["schedule", "confirm"]
            }),
        },
        ToolDescriptor {
            name: "cycle_schedule_ignore",
            description: "Close a detection warning without deciding anything (`tix cycle schedule ignore`): the explicit \"no action\" decision, so nothing is written — no snapshot, no cursor move, no History entry. Requires `confirm: true` because it is still a recorded decision, exactly as the CLI requires `--confirm`. The outcome says `applied` only when the warning was there to ignore; an idempotent repeat reports `no-op`.",
            input_schema: json!({
                "type": "object",
                "additionalProperties": false,
                "properties": {
                    "schedule": { "type": "string", "description": "Stable schedule id, or a display name that names exactly one schedule." },
                    "cycle": { "type": "string", "description": "Target instance, `<schedule-id>:<sequence>`." },
                    "from": { "type": "string", "description": "Select the instance by its start date, `YYYY-MM-DD`." },
                    "actor": { "type": "string", "description": "Who decided. Default: the boundary's actor." },
                    "timestamp": { "type": "string", "description": "The explicit RFC 3339 instant. Default: the boundary clock, exactly as the CLI resolves it." },
                    "confirm": { "type": "boolean", "description": "Must be true. Without it nothing changes and the refusal names the missing confirmation." }
                },
                "required": ["schedule", "confirm"]
            }),
        },
        ToolDescriptor {
            name: "cycle_snapshot_list",
            description: "List the immutable closed-cycle snapshots under `docs/cycle_snapshots/`, one entry per file: the stable `cycle_id`, its `schedule_id`, the historical `sequence`, the effective `start_date`/`due_date` at close, `closed_at`/`closed_by`, the state summary, and the preserved `measurements`/`extensions`. Read-only. A snapshot is evidence: it is written once at close and never recomputed from the live schedule, so a later schedule edit cannot change what this returns (C-007).",
            input_schema: json!({
                "type": "object",
                "additionalProperties": false,
                "properties": {}
            }),
        },
    ]
}