# Agentification

**iKAgent → Agentification** (it was Observification; old links still open it) shows how agents
check each task at five gates before it can be marked Done. **Verification:** each gate, how much of
the work it saw and what it caught. **To fix:** the risks that hold a task back from Done, and the
bugs found after Done. **Validation time:** where checking time goes, and what runs by itself.
**What agent did:** each agent run, step by step. A task's risks also show on the task page, in its
**Check critic** card.

Every number on the page counts real, distinct things, from the day its gate first ran for your
team, and shows its last 8 weeks, so you can see whether it gets better.

## Verification

- **Control gates** (below) opens the tab.
- **Two cards under it:** **Caught by a gate** counts each risk the check critic found once (a risk
  a newer review filed again is not counted again) and every stale reading the cache guard stopped;
  **Got past every gate** counts the bugs found after Done, and its line says how many of the tasks marked Done they hit (a task with two bugs counts once; plan tasks the Roadmap sync closed are not counted). Both cover the last 30 days. **See the
  risks** and **See the bugs** open that list on To fix.
- **Banner:** names each task that can't be marked Done yet, with its number of open
  risks. **See the risks** opens them on To fix. It turns green when every task can be marked Done.
- **Control gates:** the five checks between the work and Done, in the order they run, for the last
  30 days. Each gate has a ring: the share of the work that went
  through it, green from 80%, orange from 30%, red below, grey with nothing to measure yet. Under it:
  what the gate found in a few words, its last 8 weeks as a line, the day it first ran for your team
  ("since"), and a button for the next step. The **?** next to the title names each gate and what each
  colour means.

| Gate | When | The ring | The button |
|---|---|---|---|
| Critic before the build | before coding | runner runs with a check critic review before coding, counted from the first run that had one | See the runs: the runs that started coding with no review, listed in the gate |
| Claim audit | before Done | claims proven, of the claims checked in each task's latest review | Open the claims: To fix with only the unproven claims still open (**Show all risks** goes back) |
| Check critic | before Done | reviews by another agent than the builder | Pick another agent (Agent settings → Runners) |
| Cache guard · intent check | after deploy | the number of deploys checked (no share: the page does not know every deploy) | Turn it on: Agent settings → Pipelines → Deploy check (below) |
| Missed-bug test | after Done | bugs found after Done that name their test | See the bugs |

## To fix

**Search**, beside the team picker, finds a task key, a task title or a word in a risk or bug. The
**Risks / Bugs** switch, beside the tabs, shows one list at a time. Each list shows 4 task cards a page, with **Previous**, the page
numbers and **Next** under it. A card shows its first 2 risks or bugs; **Show N more** opens the rest.

- **Open risks:** one card per task. Under the task: the check critic that found the risks, how many
  must be fixed before Done, how many are advice, and when. Each risk opens with one line; **Show
  more** opens the rest and how to check it. A red **Must fix before Done** risk keeps the task from
  being marked Done; an orange **Advice · doesn't block Done** risk, found before coding, does not.
  **Mark as fixed** (or the tick) asks how you fixed or checked it; **Accept risk** (owner or admin
  only) asks why it is fine to leave. The risk strikes through and leaves; the task's Check critic
  card keeps what you wrote. Each new review that finds a risk replaces the open risks of the task's
  older reviews of the same stage and the same kind ("Filed again by a newer review"): the task shows
  what its latest review still finds. When a review before Done files a risk, the task's open advice
  risks close by themselves too ("Checked again by the before-Done review"). A review that finds
  nothing closes nothing: an older risk then needs Mark as fixed or Accept risk.
- **Bugs found after Done:** what was wrong, the test that would have caught it, and where it was
  found (dev, prod, a customer, or *Where not said*). A bug the runner or a bug task recorded says
  so. **Remove** takes a wrong record out of the count; the person who recorded it, a workspace
  owner or an admin sees it. **Tasks marked Done per day** shows the last 91 days, darker for
  more tasks, with a red dot on a day a bug was found after Done.
- The tab's name carries the count of open risks and bugs found after Done in the last 30 days.

## Validation time

- **Time spent checking work:** minutes in the last 30 days; **See the runs** opens What agent did. **Waiting for CI and deploys** comes
  from Pipelines: each CI run counts once, and a stage counts at most 90 minutes (a held or stuck
  stage is not waiting on checks). **Checking in the browser**, **Running tests** and **Writing guides
  and reports** come from recorded agent runs (writing counts the time since the agent's previous
  step, at most 15 minutes, because the edit itself takes only milliseconds), and say "not recorded
  yet" until a run is recorded.
- **What ran by itself:** the checks of the last 30 days that no person had to start: test and lint
  runs and browser steps by agents (from What agent did), CI, build, deploy and smoke stages (from
  Pipelines, each run once), and bugs found after Done that recorded themselves. Each row links to
  where you see them.

## The check critic

An agent that did not build the work reviews it without reading the builder's conclusion. It is the
`ikanban-check-critic` kit skill, or MCP `record_critic_review` (the API calls its risks gaps). It runs twice:

| When | What it checks | Effect |
|---|---|---|
| before coding (`before_build`) | the task's tests and checks | its risks become checks in the plan; they never block Done |
| before Done (`before_done`) | the finished work | on Pro and Pro+, each open risk keeps the task from being marked Done |

**Which agent reviews:** you pick it in **Agent settings → Runners → Which agent reviews**, because
it depends on the agent subscriptions you pay for. **Auto** (the default) uses another agent than the
builder when Claude or Copilot has finished a run on that laptop, else the builder's own agent in a
fresh session. **Same as the builder**, **Claude**, **Copilot** or **Antigravity** names one. Antigravity
follows its own allow and deny rules, not the runner's read-only ones. If the picked agent files no
review, the builder's agent reviews. In another app, such as Claude Desktop, the
`ikanban-check-critic` kit skill does the same review.

**Copilot as the check critic needs MCP allowed.** Copilot files its review with iKanban's MCP
tools. If your GitHub organisation's Copilot policy turns off MCP servers from outside GitHub,
Copilot can't reach them (the CLI says *Third-party MCP servers are disabled by your organization's
Copilot policy*), files no review, and the builder's agent reviews instead. An organisation owner
turns it on in GitHub: the organisation's **Settings → Copilot → Policies → MCP servers in
Copilot**.

On the task's **Check critic** card, any member marks a risk as fixed and says how. An owner or
admin may **accept** a risk with a reason instead; the reason and who accepted are kept.

**On the runner it runs by itself.** When a task runs on your laptop runner, the runner starts a
fresh session of the same agent before coding and another after a build that ended well. Neither
session sees the builder's conversation, neither may change, commit or push a file, and each stops
after 15 minutes. The task's activity says when each review starts and how many risks it found. A
follow-up, a Wiki run, a security scan and a turn with customer feedback get no review. Turn it off
in **Agent settings → Runners → Check critic**; it adds two agent sessions to each task run.

**The builder's own list.** With the same switch on, every build turn (a follow-up too, not a Wiki
run, a security scan or a turn with customer feedback) ends with a *Not done / not proved* list. The
runner files each line, at most 20, as a risk marked **Not done** on the Check critic card; an
answer without the list is one risk, *the builder did not say what it left undone*. A Check critic
review never closes these; a newer list from the builder replaces the older one.

**One fix round.** When risks found before Done are open after the review, the runner gives the
builder's own conversation one more turn, with the same Risky actions mode and permissions as the
build, to fix them, push to the same branch and close each fixed risk with its proof. It stops after
30 minutes. Then the review runs once more. There is no second round: a risk still open waits for a
person. The task's activity says *Fix round* when it starts, or why it was skipped.

**The verifier.** With the same switch on, before the review before Done, the runner itself reruns
the test and command criteria of the task's plan in a fresh clone of the PR branch's head. It runs a
command only when it is one known test command (`cargo test`, `cargo nextest run`, `pnpm test`,
`pnpm vitest`, `pnpm exec vitest`, `npm test`, `node --test`, `pytest`, `uv run pytest`, `go test`;
pnpm with `--filter <name>` or `-C <folder>`, npm with `--prefix <folder>`), optionally after
`cd <folder> &&` and the settings `SQLX_OFFLINE`, `CI`, `RUST_BACKTRACE`, `RUST_LOG`, `NODE_ENV` or
`TZ` written as `NAME=value` (letters, digits and `. _ : -` only). It refuses `npx`, flags that load
other code (`-exec`, `-toolexec`, `--script-shell`, `--import`, `--require`, `--loader`, `-r`) and any
path that leads out of the clone, a committed link too. It runs with no shell, without the runner's
keys, for at most 10 minutes each, 30 minutes and 20 criteria in all, clone and setup included.

- A failed rerun is a risk marked **Verifier**. So is a rerun that ran out of time or could not
  start, when the plan's evidence says it passed.
- A pnpm or npm script runs only when the clone has `node_modules`: list the install in
  `.iKanban/runner-setup.json`. Cargo builds into one cache per repository in the runner's folder.
- Each command it does not rerun is named in the activity line *Verifier: X of Y checks rerun at PR
  head …*. An older Verifier risk it did not settle is filed again as *still open*.
- After the fix round it reruns the commands of its risks as they were, even if the plan changed
  them. It closes one of its own risks only when that same command passes with more than 0 tests in
  the runner's summary, and never with a flag that skips tests or when two criteria share an id.
- It does not run when **Risky actions** is set to deny, or when the commit is not pushed to the
  task's branch; the activity says why.

**Marking Done.** While a risk found before Done is open, moving the task to Done is refused
everywhere: the board, the task page, MCP `update_task`, the AI chat, a Roadmap plan sync and
automations. The refusal (409) says how many risks are open. On Starter the check critic still
reports its risks, and the task can still be marked Done.

## Bugs found after Done

When a person or an agent finds a bug in work whose tests passed, the `ikanban-missed-bug` kit
skill (or MCP `record_missed_bug`) records what was wrong, the test that would have caught it, who
found it (person or agent) and where (dev, prod or a customer). That test then joins the feature's
map.

A person reports one from the task itself: on a done task, **Report a bug found after Done** asks
what was wrong, the test that would have caught it and where you found it. It also opens the fix
task (type bug), in the same project and feature, assigned to you.

Three things also record one by themselves, so the count does not depend on someone remembering:

| What happens | What is recorded | When it does not record |
|---|---|---|
| A Done task moves back (to any status but Done) | the task page asks **Was it a bug the tests missed?** **Yes, record it** opens the report; **No, not a bug** closes the ask | a bug was already recorded for that task since it moved back |
| A task of type bug is created under a Done task, or its description says "fixes IKA-123" for a Done task | a bug on the Done task, from the bug task's title; *Where not said* | the named task is not Done |
| The runner starts a new run on a Done task | a bug on that task, from the prompt; *Where not said*; the run's progress says so | a follow-up in the same conversation, a Wiki or security-scan run, or the same run again |

Each one records once per reopen, bug task or run. If it was not a bug, select **Remove** on
Verification. A bug recorded by itself has no test yet: its row says **Test not named yet**, and
**Name the test** saves the test that would have caught it. The check critic also names one on its
next run on that task.

## What agent did

Each agent run, step by step. A tile per plan and phase adds up its runs: time, tool uses and
errors, tokens and cost; click a tile to show only its runs, and click it again to show all. Each
run card shows the task, the agent and model, who recorded it (the runner or the laptop hook), a
badge when the run did not pass (Failed, Stopped or running), time, tool uses and errors, and tokens in and out; its bar is its tool uses, red for the
ones that failed. The line under the task is the first line of the agent's last reply, so the card
says what the run did. Errors are failed tool uses and the agent's own error messages; npm's log
lines ("npm notice", "npm warn") are not errors. A failed step says why it failed (the tool's
answer, or why it was refused or timed out). Filter by outcome, and by agent when the team has more than one. The runs show 6 a page, with page
numbers under the list. The newest run
opens by default; click another run (or press Enter or Space on it) to open it. **Where the time
went** draws one bar per tool the agent used, from start to finish, on the run's own time scale, red
when it failed. Below it, every step in order (tool uses, tool outputs, replies, errors); a long
step shows two lines, and **Show all** opens the rest.

- **Who records it:** the laptop runner, or the kit's trace hook for a Claude Code, Antigravity CLI, Gemini CLI or
  Copilot CLI session on your laptop. The hook is off until you run `node .iKanban/hooks/trace.js --on`
  in the repository and add it to the agent's hook settings: `npx ikanban hooks install --trace` (CLI 0.5.3 or later) adds
  it for each agent, or copy the lines from the kit's README. Never the model: each trace has a write token that only the recorder holds, kept outside
  the repository. The check critic's runs are recorded too, marked *check critic before coding* or
  *check critic before Done*.
- **What a step produced:** a step that made a commit shows the commit id; a step that recorded a
  check (a review, a closed or accepted risk, a test run) or a bug found after Done links to
  Verification.
- **What is kept:** step text is scrubbed of secrets (a key keeps its first 4 characters) and cut
  at 8 KB per step.
- **How long:** 30 days on Pro, 90 days on Pro+. What agent did is not on Starter.
- **A restarted session reads back where it was:** while the trace hook is on, it also keeps each step
  in a file on your laptop, `~/.ikanban/traces/<session>.steps.jsonl`: the tool's name, ok or failed,
  the time and, for a file tool only, the file path with keys masked. Never a tool's other input or output, and it never goes
  to iKanban. When Claude Code resumes or compacts that session, it reads its newest steps back, up to
  9,000 characters, marked as data. The file holds at most 256 KB (then the oldest half goes), and a
  file past 30 days is deleted. Nothing reads it back for other agents yet, a session on another
  machine finds no steps, and an older install needs `npx ikanban hooks install --trace` run again with CLI 0.5.3 or later, because older versions do not wire this.
- **Export:** **Download trace** on a run downloads the run as OpenTelemetry OTLP JSON (GenAI
  semantic conventions: one `invoke_agent` span, an `execute_tool` span per tool call, a `chat` span
  with the run's tokens and cost, replies as events). Post the file as it is to a collector's `/v1/traces`, or have iKanban send each run: see
  [Copy to Langfuse](#copy-to-langfuse). Agents get the same with MCP `get_agent_trace` and `format: "otlp"`.
- **MCP:** `list_agent_traces`, `get_agent_trace`, `get_verification`.

## Copy to Langfuse

iKanban keeps each run in What agent did. A team can also send a copy of each run to its own
[Langfuse](https://langfuse.com), when the run ends. It is off until an owner or admin turns it on.

**Turn it on.** Agent settings → Runners → **Langfuse**, one card per team. Each card starts folded: click the arrow to open it. Workspace owners and admins
change it, in a browser: an API key cannot. Members see it. Runs are recorded on Pro and up, so Starter
cannot turn it on.

1. In Langfuse, open your project's settings and create an API key pair.
2. Fill in **Host**, **Public key** and **Secret key**, and click **Save**.
3. Click **Test connection**. It tries the saved host and keys, and says what happened.
4. Turn on **Send runs to Langfuse** and click **Save**.

- **What the copy holds:** the same text as **Download trace**: tool inputs and outputs, replies and
  errors. It can hold code and command output. iKanban masks only the key shapes it knows, so any other
  secret in a step goes to Langfuse too. Turn it on only for a Langfuse you trust with that text.
- **How it reads in Langfuse:** the session is the task key and the run (`IKA-123:run`), or only the run
  when there is no task. The plan is a tag (`plan:71 Record the work`). A recorder that names no plan gets the plan and phase
  of the task's phase in a published plan on the Roadmap, so any other task has no tag. Plan, phase and task key are also trace metadata.
- **Tokens and cost in Langfuse:** a `chat` span holds the run's tokens, and its cost when iKanban recorded one. Laptop hook
  runs record no cost and count cache reads in their input tokens, so that span names no model and Langfuse shows no cost for them.
  The `invoke_agent` span names the model.
- **When it sends:** once per run, in the background, when the recorder ends the run. It tries up to 3
  times over a few seconds. A run that never ends is not sent, and runs that ended before you turned this
  on are not sent. Turned off, nothing is sent. iKanban posts at most 4 runs at once; the others wait.
- **How much:** at most 4 MB of step text per run. A longer run goes in part: **Last send** says
  *Part sent* and how many steps went. All the steps stay in iKanban.
- **Turning off** always saves, even when the host no longer answers. A bad value typed with it is not
  stored.
- **A failed send** never changes the run. **Last send** on the card shows the reason of the newest send. A new host
  clears it.
- **Host:** a public `https` address only. iKanban refuses `http`, private and link-local addresses, and
  checks again on each send. It follows no redirect. A new host needs the secret key again. Clear the
  host and save to remove the secret.
- **Secret key:** stored encrypted and never shown again. The card shows only that one is set. It goes
  only to that host.

## Deploy check (cache guard and intent check)

Agent settings → Pipelines → **Deploy check**, one card per team. Workspace owners and admins change
it; members see it.

- **Deploy check:** on or off. Off: no laptop checks a deploy for this team, even with a local
  `deploy_check` block in `.iKanban/settings-local.json`.
- **Deploy commands:** one per line. A shell command the agent runs that contains one of them is a deploy.
- **Build marker URL:** a page that names the commit the site was built from (https, or http on
  localhost). After a deploy, the agent reads or checks the site only when this page names the commit
  just deployed.
- **Site URL:** the page the agent opens to show that the change does what the task asked.
- **Dev API address:** the origin of your dev API: https and a public host name only. No IP address,
  `localhost`, one-word name, `.local`, `.internal` or `.localhost` name, path or sign-in. On save,
  iKanban looks the name up: an address that does not resolve, or resolves to a private or local
  address, is refused. Empty: no dev API check.

**Dev API check.** It needs the iKanban GitHub App on the repository: GitHub's merged pull request
event records the task's merge commit, and a task without one gets no dev check. With Deploy check
on and a Dev API address set, a deploy stage that passed with a full commit id queues one job for the
runner that built the task, once per task and commit, and only while that person is still a member
of the team. A task has at most one dev check job waiting or running at a time. The deployed commit
may be a later commit that holds several merges. The Smoke stage says *waiting for a runner* until
that runner takes it; after 24 hours with no runner it reads *skipped: not run: no runner picked it
up in 24 hours*. A merge the agent made during its own run counts too: iKanban reads the merge
commit from GitHub when the run reports done.
Before it reads the plan or makes a call, the runner checks in its clone that the deployed commit is
on the default branch and contains the task's merge commit. If not, the Smoke stage reads *skipped:
not run: the deployed commit does not contain this task's merge*. Then it checks out the deployed
commit, reads the plan's `api` criteria and makes each call itself, with no shell:

- one `curl` call per criterion, to the Dev API address only (same scheme, host and port); flags
  `-X`, `-H 'Content-Type: …'` and `-s`. Any other header, `-u`, `-L`, a pipe or a `$` is not run.
- only GET and HEAD run. A write (`-X POST`, `PUT`, `PATCH`, or `-d`) is never run and never a risk:
  it counts as a check for a person. DELETE is refused.
- `expect` gives the status code (the first number from 100 to 599) and each "quoted" text the
  answer must hold.
- a criterion `id` has letters, digits, `.`, `_` and `-` only; any other id is *not run: id*.
- the runner resolves the address once, within 5 seconds, and calls only a globally routable
  address. Never loopback, link-local, private, CGNAT, unique-local, site-local, documentation,
  benchmarking, ORCHID, reserved or multicast; never NAT64, 6to4 (or its relay), Teredo or
  IPv4-compatible IPv6. The connection stays on the address it checked.
- no redirect is followed, 30 seconds and 64 KB per call, at most 20 calls.
- the dev key is `IKANBAN_DEV_CHECK_TOKEN` on the runner's machine. It is sent only when
  `IKANBAN_DEV_CHECK_ORIGIN` on that machine equals the Dev API address, and only to that address.
  iKanban never stores it. Without it, a 401 or 403 is *needs a dev key*, not a risk. Setup: the
  agent setup docs, *Dev API check key*.

The Smoke stage then reads *A of B API checks passed, C failed; D checks for a person* (`browser`
criteria and writes), with one log line per call. Each failed call is a risk before Done marked
**Dev check**. A later dev check whose call passes with the same command and the same `expect` the
risk stored closes that risk with its proof; a command or `expect` edited in the plan since does not
close it.

The kit's hook (`.iKanban/hooks/deploy-check.js`) reads the card with the developer's key at most once
in 5 minutes, so a change reaches each laptop within 5 minutes. When iKanban does not answer, the hook
uses its last saved copy, else the local `deploy_check` block.
