Cost-to-outcome

How your spend reaches an intent

Ark reports what Cursor actually billed, per intent. The billing feed knows who spent what and in which chat. It does not know which intent a chat was for. You supply that link as session rows, and it only counts once those rows are on main.

The target is 95% of billed spend reconciled automatically, checked every morning by the reconciliation watch. On 12 November 2026 it measured 39.6% over the previous seven days.

Once: put your ingest.env in place

On the Ark board, pick Ark hook → Download my ingest.env in the top bar. The file holds your personal token, which only works for your own email. Cursor on a Mac or Windows laptop already has the hook through the Cursor team hooks, so save the file as ~/.ark/ingest.env (Windows: %USERPROFILE%\.ark\ingest.env) and you are done; Cursor blocks your prompts until it is there, and on Windows the hook needs Python 3.8 or later. Claude Code and Cursor on Linux have no team hook: run the installer below with the file from a kaptio-ark checkout (or a download of the tools/enforcement folder), delete the download and rerun it after the hook changes. The hook sends each prompt’s session straight to Ark, so there is nothing to publish. It is user-level, so a prompt in the kaptiotravel or edge-platform workspace that names INT-0092 counts the same as one in kaptio-ark.

bash tools/enforcement/install.sh --env-file ~/Downloads/ingest.env

Once per kaptio-ark clone: the commit gate

In each kaptio-ark clone you commit from, run npm ci and the command below. With the ingest hook in place it adds only the pre-commit gate. The gate lives in the clone’s own .git/hooks, so every new clone needs it once; worktrees of a clone share it. Without the ingest hook, the same command installs the older local hook, whose rows count only after you publish them.

npm run ark -- session install-hook

Every day: one chat per intent

Name the intent in the first prompt of a chat ("INT-0092: fix the Stone 11 fixture") and keep that chat to that intent. The reconcile then gives that chat’s spend to INT-0092 exactly. If a chat never names the intent, put the id on the first line of .ark-intent at the repository root, or declare a window with session start and session stop; a start without a stop counts for 12 hours at most. Both commands send the window to the Ark board with your ingest.env token, and the board puts it on main with your hook rows.

npm run ark -- session start INT-0092
npm run ark -- session stop INT-0092

Only if status says so: publish local rows

Backfills, the older hook and a session start or stop the board could not take (no token, or the board was down) write rows to a gitignored file on your laptop. A local row for a chat the board already recorded on the same intent does not count, so session status lists only the rows that still need publishing. Publishing adds them to handover/sessions/<you>.jsonl, plus one row per subagent chat of a conversation in that file, commits only that file and pushes it to main. Cursor bills each subagent under its own conversation, which no prompt names: the ingest hook registers it with the parent chat’s intent when it stops, and publishing derives one more row per subagent from your transcripts.

npm run ark -- session publish --push

Ark checks the hook for you

Commands that write intent state, such as run, plan, mr, intent log and task done, check your setup first. On a terminal Ark says what is missing and asks whether to install it now; after an install it stops, so restart Cursor and run the command again. With no terminal, for example a Cursor agent session, it refuses and prints the command. It asks when neither Cursor hook is installed or the clone has no commit gate. CI, launchd jobs, ARK_UNATTENDED=1 and the ark@kaptio.com identity are never blocked, and session install-hook, session publish and setup always run. A person on the ingest hook already has a working hook, so Ark does not ask for the older one.

npm run ark -- session install-hook

Every commit: the gate

The install command puts a pre-commit hook in the clone. A commit by a person is refused while your Cursor hook is broken or a local session row is not yet on main, either in your own file or as a chat the board ingest recorded on the same intent, and the message prints the fix: session publish --push from your main checkout, then commit again. CI, commits authored as ark@kaptio.com and commits that touch only handover/sessions/ are not gated. git commit --no-verify skips local hooks, and the skipped rows show up the next time you commit. This is a tracking gate, not a reconcile: os reconcile still runs only in the hourly CI job.

npm run ark -- session publish --push

Check it works

Status tells you whether the hook is installed and pointing at your checkout, how many rows are not published yet, and your coverage: the share of your billed spend that reached an intent. intents/ATTRIBUTION.md shows the same figure for the 15 largest unattributed identities. For the ingest hook, status checks only that the hook is installed, not your token or the ingest endpoint: after restarting Cursor, submit a prompt that names an intent and act on any Ark warning the hook reports.

npm run ark -- session status

Retrofit the last few weeks

Your transcripts are still on your laptop, so past chats can be attributed. The backfill gives each chat one intent: the one mentioned most, with your own messages weighted three times higher than the agent’s. The dry run shows what it would pick. Rows for days after the last full recompute show up at the next daily commit; older days change only when someone runs a new full recompute.

node --import tsx scripts/backfill-sessions.ts --dry-run
node --import tsx scripts/backfill-sessions.ts
npm run ark -- session publish --push

What stops the same cost landing on two intents

  • Each billed event is placed once: on one intent, split across overlapping session windows with shares that add up to one, or left unattributed. In a chat that names two intents, an event goes to the one named most recently before it.
  • A prompt that names several intents, such as a timesheet or a board summary, does not pick one, so a list of intents in a general chat does not move that chat onto one of them. The ingest hook treats two or more ids as a list: it keeps the chat’s current intent, or falls back to ARK_INTENT_ID or .ark-intent, and records nothing only when there is none. The older hook records nothing for three or more ids; for exactly two it writes a row for both, and the chat’s later spend goes to one of them.
  • Before writing, os reconcile checks that every billed cent is placed once: intents plus unattributed must equal the billed total, and each intent’s daily split and each person’s figures must agree. If they do not, it refuses to write.
  • A superseded intent’s spend moves to the intent that absorbed it, and its own charged figure is set to zero, so the same dollars are never listed on both.

Cost lands on intents, the budget sits on lanes

Charged dollars still land on the intent, which is what cost-to-outcome reads. The budget does not. From Cycle 19 a lane's director can give the lane an envelope for each planning window: Jón for Tech health and Business tools, Alex for Go-Live Enhancements, Sweep, Migration, Patch and Regression, and Ragnar for Product & Concepts and Presales until Jón and Alex agree. When a lane's reconciled spend reaches its envelope, Ark stops starting new work in that lane and names the director. Work already running finishes. A lane with no envelope has no lane cap.

The envelopes live in intents/BUDGETS.yaml and on the board's Money page. An intent's cost.budget_usd, the one field in that block a person sets, is an optional cap on that intent alone. The planning window total keeps its own tripwire: once it is spent, the daemon stops picking up new aligned intents. Who decides at a gate.

Two things not to do

Do not edit charged_*, total_usd or the token counts in cost: blocks in intent files, and do not ask an agent to "add this chat's cost to the intent". The reconcile owns the charged figures and the kernel ledger owns the estimate; a number written by hand counts the same spend twice.

Do not run os reconcile yourself. It needs a Cursor team-admin key, and a run from one laptop only sees that laptop's rows. The ark-reconcile CI job does the reconciling. You do not need the admin key or Maintainer access for any of this.

When the numbers move

The ark-reconcile CI job runs at 17 minutes past each hour, but only the run in the 05:00 UTC hour commits to main, so the figures move once a day. That run recomputes every day after the carried baseline (12 October 2026) from what is on main. That includes the kernel ledger rows every machine running Ark publishes to handover/ledger/, so no laptop has to run anything. Rows you publish show up after the next 05:00 UTC run. Days up to 12 October keep the figures the last laptop recompute produced; the top of intents/ATTRIBUTION.md names those days.