---
title: Issue Tracking
description: File and rate reports of what is broken or missing, and take each to an outcome, through calls from your own tools to an issue service Turn Zero Cloud runs.
slug: /backend-packages/tztrack
order: 14
visibility: public
redirects_from: [/backend-packages/issue-tracking]
---

# Issue Tracking

Give your app a shared place for bug reports, feedback, and test results. Read this page when connecting your backend to Issue Tracking or testing that connection without contacting the live service.

Turn Zero Cloud operates Issue Tracking. Signed-in Turn Zero members can read the issues their membership allows in a browser. To read restricted issues, a member needs contribute or owner access. Their membership must allow restricted issues and have no account restriction. The service also has pages for stopping issue-watch emails.

People, agents, and programs use their own tools to file [reports](/cloud/concepts/glossary/#issue-and-report), rate their experience, and work each report through to an outcome. The package states the service's contract and includes a client and a [test double](/cloud/concepts/glossary/#test-double) for an application's backend and its tests.

## Use it when

Use Issue Tracking when an application needs one queue for bug reports, feedback, and the checks its test runs record, which agents file and read as readily as people do. Declare the `issue_tracking` service in the [manifest](/cloud/concepts/glossary/#manifest), and the platform creates one space, the set of records one owner keeps, shared by both of the application's environments. Your backend reaches the space through the platform's [egress gateway](/cloud/concepts/glossary/#egress-gateway), which presents the space's credential for it.

Use it for an application's own end users: the backend files each user's report under the user's identity and reads the queue through the client. When your backend files a report for one of your users, send that user only their own report's state. Do not send the call's whole answer: the issue in it holds other reporters' words. Your tool reads the whole space, files into it and settles its reports through the platform's feedback actions, naming the space ([Feedback in your application's space](https://dev.turnzero.ai/turnzero/guides/feedback/#feedback-in-your-application-s-space)).

Do not use it for work that needs boards or sprints, for notifying your application's users, or for fields your application defines. A `watch` call can name an issue and a messaging handle, which gets one message each time the issue's state, outcome, or `waiting_for` changes. The handle names a messaging participant, which an account that holds Turn Zero's messaging product has. Your tool can set that messaging watch through `relay_issue_act`; your backend's gateway forwards no `watch`.

A person can watch by email with `email: true` through `tztrack_watch` on the Turn Zero connection or the REST API. The emails go only to that caller's verified sign-in addresses. The service holds no address and sends no email to your application's users. A space credential or `relay_issue_act` is refused `watch_refused` for email. [Watching an issue](https://dev.turnzero.ai/tztrack/reference/the-tools/#watching-an-issue) gives the confirmation, changes and stop link.

An issue moves only through the calls and the passes, along one fixed set of allowed moves between its states. The passes are the AI runs that match new reports to known issues ([What the triage passes do](/cloud/guides/keep-your-own-issue-list/#what-the-triage-passes-do)). They require the space's own `ai_reviews_enabled` setting to be on. These runs also need the tzTrack AI reviews option. An unbilled account's own space is exempt. A paused account's paid passes do not run.

The option leaves the setting unchanged unless `tztrack_set_ai_passes` includes `enable_reviews: true` with `on: true`. The setting alone runs nothing. You can also set it through the contract's `configure` call ([Configure the space](/cloud/guides/keep-your-own-issue-list/#5-configure-the-space)). The tzTrack AI reviews option is a paid [monthly item](/cloud/concepts/glossary/#monthly-item) for each space, including a space created for an application.

## What it provides

### Spaces and access

- **Spaces.** A space contains one owner's records and is identified by a universally unique identifier (UUID). Each of its tokens has one of five permission levels, from lowest to highest `file`, `report`, `contribute`, `record`, and `owner`, one token per holder. Every call made with a token reads and writes that space alone. Keep a `file` token in your backend and give it to no end user, device, or client: its holder names the reporter each call is for.
- **The report level.** A `report` token files and reads as a reporter does and never sees a restricted issue. It can be limited to a list of the space's components when it is minted.
- **Attributed writes.** Every write names the person, agent, or program that acted. A service that relays its users' actions names each user, never itself, and a relayed read returns that user's own reports and nothing of anyone else's.
- **Issues and reports.** An issue is the one curated record of a problem. It has a short identifier such as `#12`, a kind, a state and an outcome, a priority, a component, what it waits for and who claims it, and the counts of its reports. A report is one filing in the filer's words, never edited, linked to the issue with the reason for the link.
- **The kinds.** `bug`, `gap`, `docs`, `friction`, `question`, `task`, `praise`, and `idea`; `problem`, `error`, and `mistake` file a `bug`. An `idea` takes no priority and is never fixed, and `next` never hands it out. Later requests link to it, so its report count is its demand.
- **What an issue waits for.** `waiting_for` names who or what it waits on: null, `person` (the space's owner), `person:<account>` (one member of a shared space), `reporter`, `outside:<what>`, or `evidence` (more evidence is needed). Every `waiting` issue uses `evidence`, and no other state does. An issue waiting for a person, the reporter, or an outside event stays open, and nothing closes it on its own. `list` and `count` filter and group by it and by the claim, `none` selecting the issues with no value. For `waiting_for`, `outside` alone selects every issue whose wait starts with `outside:`.
- **Who claims it.** `claimed_by` identifies the worker handling the issue: null, or a label of 1 to 200 printable characters. Only `next` sets a `branch:<name>` claim and returns its lease, the record and secret used to control that claim. Other workers claim through `update` with another label. A claim made while another exists is refused `lease_conflict`. Call `give_back` with a reason to clear a claim: a caller at the `contribute` level can clear a label claim, but clearing a branch claim also requires its lease secret. A claim untouched for a day has `claim_stale: true`.

### Match a report to an issue

- **Matching at filing.** The service fingerprints evidence the platform adds to a report and links repeats to the known issue without AI. A report whose origin is not `workspace` or `platform` is never linked by its evidence onto a restricted issue, one marked as a security concern that the service hides from other reporters. When the filer follows up with the same problem key, the service adds a new report to the same issue. If `waiting_for` is `reporter`, that reporter’s follow-up clears the field and returns the issue to the queue.
- **What a fingerprint needs.** A report links by its fingerprint only where its evidence names the call's `refusal`. Two reports of a call that was answered, naming no refusal, are never linked by it.
- **Undoing a confirmation.** If a filer's `follow` closes the issue created for their filing as a duplicate, and that issue contains only their report, `unmerge` also removes the link made by `follow`. The report then belongs only to its own issue.
- **A repeat of a declined request.** A filing's `candidates`, its likely matches, include an issue closed `declined` or `as_designed`: a request considered and not taken. It ranks after an open issue that matches as well, and a closed restricted one is never offered, whatever the filing's origin. Each candidate carries its `outcome`, null while the issue is not closed, and a fixed `sentence`, such as "Not taken.", and never the resolution's words. A `follow` onto such an issue adds the report and leaves the issue closed.
- **Which issues are candidates.** A filing that names a `component` is offered that component's issues by its title's words, and an issue of another component only where the filing's evidence matches it. A filing that names none is offered issues of every component.
- **Why a candidate matched.** Each candidate names its issue's `kind` and `component`, and its `summary` where a trusted actor wrote one. Its `matched_evidence` lists the filing's evidence fields that matched the existing reports used to select the issue. It is empty when only the title's words matched. A filing's words are matched only against text the candidate shows. That can be the issue's title, if shown, or its summary, if a trusted actor wrote it. An issue whose words the filer is not shown is offered only where its evidence matches.

### Report amendments and notes

- **Clearing a resolution.** In the current Issue Tracking API, `update` with `resolution: null` clears the resolution of a new or open issue and writes no replacement. `settle` and `wait` write one. The `update` that `createIssueTrackingClient` makes still writes a resolution, on any state.
- **Amend your own report.** Call `submit` with `amends` set to the original report's number. The service adds a new report with `amends` and `withdraws` and leaves the original as filed. The amendment joins each issue the original belongs to with `link_basis: amendment`. An unknown report number or a report filed by another actor returns `report_not_found`.
- **What you can amend.** Send at least one of `kind`, `labels`, `title`, `text`, `impact`, `workaround`, `proposed_resolution`, `attachments`, or `withdraws`. A praise report can stay `praise`, and other reports can use any kind they could file except `praise`. A field report cannot use `question` or `task`. Sending `labels` requires `contribute` access or higher. Below that level the service returns `grant_required`.
- **What the amendment keeps.** The problem key stays the same. If you omit `kind`, `title`, `text`, `impact`, `workaround`, or `proposed_resolution`, the amendment uses the latest amendment that did not withdraw the report, or the original if there is none. A withdrawal with no `impact` has none. Send `null` to clear `text`, `workaround`, or `proposed_resolution`. An empty string clears `text` too. Evidence stays on the original report. A person decides how to settle the issue after a withdrawal.
- **What changes on the issue.** The amendment can update the kind or replace the filing labels on the issue the original report opened. Send the full list of filing labels to keep. The service keeps any kind or labels a space member set by hand. Issues the report only joined keep their own kind and labels.
- **Which client amends.** `createIssueTrackingClient` has no `amends`, so a backend amends through the gateway with `createIssueTrackingClientV2` ([Methods and results](#methods-and-results)).
- **Images on reports and comments.** A filing and a comment can each carry up to four images, PNG, JPEG, or WebP, each at most 512 KiB, judged by their bytes and never by a name. The service stores each beside its report, under the report's own privacy and restriction, within 16 MiB a space. A read lists each image as `{ id, media_type, size_bytes, sha256 }`, and `GET /v2/attachment/<id>` under a `contribute` token fetches it. A retry stores no image, `redact` at the `owner` level removes one whole, the retention drop takes a report's images with its text, and no AI pass reads one.
- **A note to reporters.** An issue's `note_to_reporters` holds up to 2,000 characters, returned by a read that names a reporter. An `update` at `contribute` or above writes or clears it on any state; a filing cannot set it. Never quote a report or name a reporter or restricted issue. A `fixes` or `resolves` landing, the record of a fixing commit, writes a note naming the commit and when it landed. Reporters read it only while the issue is fixed or closed `done` or `verified`. Only `createIssueTrackingClientV2` returns it through the gateway.

### Kinds and relations

- **Praise apart.** Praise and every other kind are kept on separate issues. A report filed as `praise` opens or joins a praise issue, and a report of another kind joins no praise issue, even under a problem key once used for praise. Where a praise report and a problem's issue meet, the service relates the two issues, unless either is restricted, and links neither report across. No merge joins a praise issue with an issue of another kind, and a praise report never reopens a fixed issue.
- **Mentions become relations.** In the current Issue Tracking API, a comment or an `update` that sets the summary adds a `relates_to` link to each issue it names, such as `#12`. The service makes at most five relations a write; the answer's `mentioned` lists them. It skips the issue itself, a number with no issue, a pair already related or unlinked, and a restricted issue beside one that is not. A quoted line opening with `>` or a code span links nothing, nor does a number inside a word, a path, or an entity. A report's text links nothing.
- **Mentions stay related.** No pass reads a mention: the `relates_to` the service makes stays as it is, and a person or a session sets `blocks` or `part_of` with `relate`.
- **Who waited on a settled issue.** In the current Issue Tracking API, `settle` returns up to 20 entries in `related_open`. It includes incoming and outgoing `blocks`, `part_of`, or `relates_to` links with an issue that is not closed. Each entry names the relation's `type`, `from`, and `target`, and the other issue's `state`. `blocks` comes first, then `part_of`, then `relates_to`, each by effective priority and then by number. A restricted issue is listed only when the settled issue is restricted too. Where 20 are listed, `read` the issue for the rest.

### Builds and verification

- **Builds and checks.** A build records a version of a release line, the sequence of versions an environment runs, written by the deploy. A check records each run of a monitored job under a stable key, and an issue opens from it only once the failures repeat. An issue a check opens reads `blocked` where the check breaks after at least three green runs and the failure is in the product or the client. A build without a release line counts toward neither cause. A landing records the commit that fixed an issue, with its regression test and proof.
- **Withdrawing a run.** The job that posted a check run can withdraw it using the run's original key. The withdrawal stays in the check's history and closes the failure episode that run opened: the sequence of failures since the check first failed, normally ended by a successful run. If the withdrawal also supplies a `key`, that key prevents duplicate withdrawals on retry; it does not identify the original run.
- **Verification by exposure.** A fixed issue closes verified once live builds that contain the fix have exercised it a set number of times, with no report of the same point since. An issue nobody can explain waits, and the next report reopens it. A bug or a friction closed `done` by hand, with no landing, names in `fixed_in` the build that serves the fix where a returning reporter filed on it, and may name it otherwise. A later report then reopens the issue only when it comes from that build or a later one, and with no `fixed_in` it reopens nothing.
- **A report that names no build.** For a `product` release line, a report with no build on that line counts as seen with the fix only if it was filed after the release containing the fix went live. If the report names a build on that line, the service uses only that build to decide. On a `client` line, only a named build counts. Your backend's reports name no line, so on a `product` line they are read by when they were filed. Each report's `seen_after_fix_basis` says which reading found it with the fix: `build`, `filed_at`, or `landing`.
- **A fix no release ships.** Where no release ships a fix within the space's `watch_cap_days` after it lands, 14 days unless the space sets another, the daily sweep labels the issue `recheck` and leaves it fixed.
- **A fix on the `landing` line.** If your space declares a component on the `landing` line, the fix takes effect when it lands. A report filed at or after that landing counts as a report with the fix, regardless of the build it names, and the AI reviewer can reopen the issue. A report filed before the landing, or after a newer `revert`, attaches to the issue. These fixes require no exposures and are recorded as unshipped. If the component declares an exposure source, the sweep adds `recheck` after `watch_cap_days`. A space that declares no components treats its `landing` line as a `product` line.

### Proposals from AI passes

- **Passes.** Two AI passes propose and check duplicates, splits, and themes, and the triage pass judges each new issue to give it a priority from 1 to 3. A merge is applied where they agree and the evidence on at least one side was stamped by the platform or confirmed against its records. A pass never edits a report, and never moves a priority a person or a program wrote. [How an issue gets its priority](/cloud/guides/keep-your-own-issue-list/#how-an-issue-gets-its-priority) explains each rule.
- **What delays a merge.** A merge the passes agree on waits while its duplicate carries a `plan`, is `fixed`, or carries a branch's claim. Once the duplicate is free, the passes apply the merge at their next write, or withdraw it where it no longer fits their limits. A merge withdrawn because its master closed as a duplicate is proposed again against the surviving master. A person's `settle` applies a merge held by a plan at once, and so does `createIssueTrackingClient`'s `settle` with the act `approve`.
- **When an agreement lapses.** The critic must review the merge again if the master issue closes or moves to `waiting` or `fixed`, a report joins or leaves either issue, or a component is set. The master is the issue the duplicate merges into. The merge then waits for the critic to read it again.
- **What the passes propose.** A `read` without `actor` returns `proposals`, the pending proposals for a merge, split, or theme that reaches the issue. A merge reaches its duplicate and its master, a theme its issue, and a split the first issue its report is linked to. Each entry carries its `id`, its `type`, its other end, the passes' `verdicts`, its `disagreements`, its instant `at`, and `restricted`. `list` with `proposed: true` selects the issues a waiting proposal reaches.
- **How often the passes' merges were wrong.** `read_space` returns `sampled_merges`, `{ rate, audits }`: the share of the last thirty days' audited merges judged `wrong`, 0 where none was audited, and how many verdicts it counts. While `rate` is above the configuration's `merge_error_rate_threshold`, an agreed merge waits for a person. `relay_issue_act` forwards `read_space` only under an `owner` token.

### Counts, reads, and the client

- **A space's figures.** `count` returns how many issues have the state, outcome, kind, component, label, `waiting_for`, `claimed_by`, effective priority, or requirement you name, leaving out issues with labels you name. It returns a total, or totals by any one field except the requirement. `rates` returns how many issues were filed, closed by outcome, reopened after a fix, and still open, per day or week over up to 400 steps. It also returns the time to close by kind and effective priority. Both take an `owner` token; `relay_issue_act` forwards both at its `owner` level, and the gateway forwards neither ([Keep your own issue list](/cloud/guides/keep-your-own-issue-list/)).
- **Counting through the gateway.** A deployment counts the issues `list` returns. It requests pages with `limit: 100` until the returned `cursor` is null. A page can contain fewer than 100 issues even when more pages follow. A large space is counted over several minutes, its pages paced within the space's rate. From development a `list` names its actor, so that count holds the actor's own issues alone.
- **Reads and erasure.** List, search, and export read a space. Erasure replaces a person's identity on every record and keeps every report's text, so leave out of a report anything you do not want kept.
- **A client and a test double**, which [The client](#the-client) and [Test with the double](#test-with-the-double) describe.

### States, permission levels, and moves

An issue is in one of five states: `new`, `open`, `waiting`, `fixed`, and `closed`. A filing opens it `new` where the space's passes run, and `open` where they do not, the default. Triage, or an `update` that sets its kind or component, moves a `new` issue to `open`.

`wait` parks a `new` or `open` issue as `waiting`, with what would settle it, as a green check does for the `open` issue it opened. With `waiting_for` set to `person`, `person:<account>`, `reporter`, or `outside:<what>`, it sets what the issue waits for and moves no state. An `update` giving a `waiting` issue any other value is refused `state_conflict`, `reopen` the way out.

A `fixes` or `resolves` landing recorded with `land` moves an issue to `fixed` or closes it `done`. A `narrows` landing leaves its state, and a `revert` reopens it. The `settle` call closes an issue with an outcome. The `reopen` call moves a `fixed`, `closed`, or `waiting` issue back to `open`. Use `unmerge` to reverse a `duplicate` settlement. A new report, or one a merge moves in, reopens a `waiting` issue or one closed `unexplained`.

A landing's `proof` reads `proved`, `unverified`, or `untestable`. `unverified` marks a test read from the commit alone, with no proof record behind it, and moves the issue as `proved` does.

A closed issue carries one outcome: `verified`, `done`, `as_designed`, `declined`, `duplicate`, `superseded`, `noted`, or `unexplained`. A fixed issue closes `verified` once live builds have exercised the fix enough times with no report of the same point, and one nobody can explain closes `unexplained` after the long wait. A `praise` filing that opens its issue closes it `noted` at once.

Each token has one permission level, and a level allows its own calls and those of every level below it:

- `file` files with `submit` and confirms a repeat with `follow`, for the reporter each call names. Its `follow` names a likely match the report's filing was offered, or an issue the reporter already reports. Any other issue number is refused `issue_not_found`, as a number that matches no issue is.
- `report` files and reads as a reporter does: it reads, lists, and searches issues, never a restricted one.
- `contribute` reads, lists, and searches issues, sets an issue's curated members with `update`, comments, relates, and splits. It sets what an issue waits for with `wait`, takes work with `next`, and gives work or a label claim back. On `/v2`, it can reopen a `task` and settle a `task` with any outcome its state allows except `duplicate`.
- `record` confirms a report's evidence and records landings, builds, shipments, exposures, and checks.
- `owner` can settle or reopen other kinds of issues on `/v2`, settle as `duplicate` to merge issues, and use `unmerge` to reverse a merge. On `/v1`, `settle` requires `owner`. This level also clears `restricted` marks and alarms, redacts, reads counts and rates, exports, erases an actor, reads and restores the record, configures the space, mints and revokes tokens, and deletes the space.

### Restricted issues

The service hides a restricted issue from a reporter and from no one else. Below the `contribute` permission level, and in every read that names a reading actor, a restricted issue is never returned. From the `contribute` level up, every read returns it as it returns any other issue. A filing whose origin is not `workspace` or `platform` is offered no restricted issue as a likely match, under any token. The one exception is a filing under an `owner` token that names its caller's `relayed_level` as `contribute` or above, as the platform's relay does at the `contribute` level.

Where the service accepts filings directly under the caller's own credential, it determines that level from the caller's access to the space. A filing sent directly that includes `relayed_level` is refused `invalid_request`.

A filing marked restricted links only to restricted issues, and otherwise opens its own restricted issue. A later confirmation of its report links it only to restricted issues too. A filing kept back from a restricted issue opens its own issue restricted as well, and so does a report a later confirmation keeps back, where its issue holds that report alone.

Where a report is kept from a restricted issue closed `done` or `verified`, the daily sweep surfaces that issue once with the label `recheck` and leaves it closed. A person reads it and reopens it or leaves it.

Code that reaches the service with its own token reads these answers:

- Under a `contribute` or `record` token, `list`, `search`, and the counts of `read_space` include restricted issues.
- A `list` that names `actor` answers no restricted issue, whatever the token, as the reporter's own view never does. With `proposed: true` it selects no issue by a proposal that reaches a restricted issue.
- A `read`'s `proposals` entry that reaches a restricted issue carries `restricted: true`. The calls that answer it take a `contribute` token, so a reporter never reads one.
- On the calls `createIssueTrackingClient` makes, an issue record carries `restricted`, `true` or `false`. Their `update` sets no `restricted`, and is refused `invalid_request` where it names one.
- On the service's current calls, an `update` that sets `restricted` to `false`, or that names `alarm`, is refused `grant_required` under a token below `owner`, before the key is read. Setting `restricted` to `true` needs a `contribute` token.

Merging an issue preserves its restricted text: the resulting issue is restricted if either original issue was restricted. If the merge sets that mark, its `merged` history entry records `restricted: false` for the earlier value. Splitting an issue from a restricted issue creates another restricted issue, whether a person or an AI pass performs the split. `unmerge` leaves each issue's current restricted mark unchanged.

The triage pass looks for a restricted issue's likely matches, and offers a restricted issue among another issue's. A merge or a theme between a restricted issue and one that is not waits for a person, and the passes withdraw it where it no longer fits their limits. A merge or a theme of two restricted issues follows the usual limits.

The second reader is the AI pass that checks an issue's priority again. No pass can clear a restricted mark; only a person at the `owner` level can do so, with `update`. An older issue's history may hold a `kept` entry from when the second reader retained a mark. Calls through `createIssueTrackingClient` return no `kept` entry.

The second reader also flags an issue with an `alarm`. It does so where three accounts report the issue as blocking them, or where its reports name security, data loss, or billing. A flagged issue comes first within its effective priority in `next` and in `list`'s `priority` order. `list`'s `ranking_score` order puts the flagged issues of effective priority 2 first, and the `newest` and `report_count` orders ignore the flag. `list { alarm: true }` reads every flagged issue.

Priority 1, a close, or a move to `idea` clears the flag, and so does an `owner` token's `update` naming `alarm` with `null`. A later mark the second reader reads sets it again.

When a pass gives up on an item, it writes a `critic_failed` entry on the item's issue. The entry names the item and why: three failed attempts, or 36 hourly runs with no answer from the model. An item given up on for want of an answer is still tried once each run, and the first answer written for it adds a `critic_cleared` entry. The calls `createIssueTrackingClient` makes return neither entry.

### How the gateway keeps both environments apart

The space is created when the manifest is first submitted. Your deployments in each environment file into it and read from it, and so do your [local runs](/cloud/concepts/glossary/#local-run), under the development credential. The submission result's `issue_tracking` list gives the space, and never a token. An application that has a space for each environment keeps both until it is deleted, its production space created at its first [promote](/cloud/concepts/glossary/#promote), or its first production deploy where it has one environment.

For a shared space binding, the gateway keeps the two environments apart in three ways. An older application provisioned with one space per environment reaches that environment’s space without the shared binding’s report stamp or actor prefix.

1. It stamps every report your backend files with the environment the call came from and the version it serves, `local` from your own machine. On the first client's `submit` these are `evidence.environment` and `evidence.version`. On `createIssueTrackingClientV2`'s they are one `seen_in` entry, `{ release_line: null, version, environment }`, in place of any the call names, and an amendment carries none.
2. It puts `development:` in front of every person, agent, or program id a development call names, so a development tester never appears as one of your production users. From development, a `list` without `actor` is refused `invalid_request`, as are `read` and `search` on either client. So is a development write that names another issue by its id, and an id that already starts with `development:` or passes 200 characters once prefixed.
3. A deployment reaches the space at its binding's [grant level](/cloud/concepts/glossary/#grant-level): `report` for the application's own space or a space for each environment, and `report` or `contribute` for a space of your account. At `report`, a deployment can file reports and read the space. On the first client’s wire (0.2.0), `contribute` adds `update`, `comment`, and `relate`. The gateway refuses `settle`, `export`, and `erase_actor` at both deployment grant levels on that wire. Those three calls require `owner`. Both clients classify `export` as a read that requires `owner`. A call outside the binding’s grant returns `issue_tracking_call_refused`.

Every filing on `createIssueTrackingClientV2` reaches the space with the origin `field`, whatever it names, so the service reads it as a reporter's. One naming an `evidence_basis` other than `claimed` is refused `invalid_request`, and so is one naming `relayed_level`.

At `report`, the gateway leaves a [restricted issue](#restricted-issues) out of every response, whichever space the binding names. A list or a search skips it, and a read of it is refused as for an issue the space does not hold. The response to a filing or an amendment names no restricted issue. A read's `proposals` leave out each entry that reaches one, and a reporter's own view never holds one. The counts `read_space` returns include restricted issues, because the gateway forwards a count as it comes.

At `report` a `list` that names `proposed` is refused `issue_tracking_call_refused` on either client; its other filters still work. A read at `report` leaves out each history entry that records a proposal. On the first client's calls there, every issue's `proposed` reads `false`, and a read leaves out a relation that is still only proposed.

A finding is an issue that groups other issues, its members, stored as a `task` labelled `finding`. On the first client's calls at `report`, a finding's `members` list only the issues that are in it. A finding whose own `proposed` field is true is left out, just like a restricted issue. A finding created by a proposal and not yet approved is also left out.

The first client's list and search also skip a finding the passes made that a person approved and later declined by hand, though a read of it still returns it. On `createIssueTrackingClientV2` the gateway skips every finding with no report of its own, approved ones included, so a backend at `report` sees no such finding. Read findings at a higher grant level.

The `contribute` grant level adds the working calls, and `owner` reaches every call; no deployment has `owner`. The call that starts a deploy may name `commit`, 7 to 64 lower-case hexadecimal characters. After each deploy, promote, and rollback, the platform writes a build record into the application's own space naming the version, the environment, and that commit, never delaying the deploy. A malformed `commit`, or one on the call that only prepares an upload, is refused `invalid_request`. An application with a space for each environment gets no build record.

### A space of your account's own

A manifest can instead name a `space` your account created with `create_space`, and the platform binds the application to it under the same three rules. [Bind an application to the space](/cloud/guides/keep-your-own-issue-list/#bind-an-application-to-the-space) gives the `space` and `level` to name, the release line the platform adds, and their refusals.

Issue Tracking connects your application to tzTrack, Turn Zero's issue tracker. Every account has it, so there is nothing to add. If a call through this binding is refused `tztrack_required`, repeat the request; `read_account` lists the products the account holds.

### Deletion and copies

The platform keeps the space's token in [custody](/cloud/concepts/glossary/#custody) under a platform-minted name, and no application and no author has it. A manifest revision that drops the kind changes nothing: the space and its records remain. The platform reads a space's records only through the feedback actions naming the space, the export, the deletion of the space or of your account, and the daily copy.

Deleting the application deletes its own space with every record in it, and ends a binding to a space of your account's own. Deleting your account deletes every space of its applications and its own. `delete_space`, which you approve in the browser, deletes one space your account owns with every record in it and ends every binding to it ([Delete a space](/cloud/guides/keep-your-own-issue-list/#delete-a-space)). Deleting the development environment deletes nothing of a shared space, ends a development binding, and deletes a per-environment development space. A deleted space cannot be recovered.

Once a day, the platform copies each space your account holds and each application's own space into storage it holds for your account. A copy is kept 35 days, the newest until a newer one is written, and a space's copies are deleted with it. Per-environment spaces are not copied, and no action reads or restores a copy.

The daily copy lists a report's or a comment's images and carries none of their bytes; a copy the contract's `read_record` answers carries them, and a restore from it brings a redacted image back. Deleting a space deletes its images with it, and a holder of the `owner` level removes one image whole with `redact`.

## Availability

Version 0.100.0 is the package's current version, and this page describes it. Until the library's next publish, `read_library` can return an earlier version, the one you can take, so this page can describe a change that version lacks. The entry includes the `testing` subpath. The entry contains the compiled clients and double as the npm package `@turnzero/tztrack`, the package's [product statement and detailed contract](/cloud/concepts/glossary/#product-statement-and-detailed-contract), and its integration guide. The contract's "Migration to" sections explain changes to the package's guarantees by version.

Turn Zero Cloud runs the service and creates one space for every application that declares the kind. That space counts toward neither the account's five spaces nor its 100,000 open issues. There is no charge for calls, records or stored bytes in that space.

tzTrack AI reviews is a paid option for each space, an application's own space included. Call `tztrack_set_ai_passes` with the space, `on: true` and `enable_reviews: true` to turn on the option and the space's reviews setting together.

Check `reviews_written`. If it is `false`, the option is on and any charge remains, but the setting was not written. Repeat the same call to retry the setting without charging again for an option already on. Without `enable_reviews`, only the option changes.

Turning on the option charges one day’s share of its monthly rate unless that space was already charged for it that UTC day. The daily billing run charges for each later UTC day it finds the option on. Turning it off stops new charges from the next run and returns nothing already charged.

When the day’s charge is due, the remaining Free Allowance plus available credit must exceed the option’s charge for the days left in the UTC month, including today. The call can be refused `balance_short` (402) or `rates_unread` (503). [Space limits and tzTrack AI reviews](https://dev.turnzero.ai/tztrack/concepts/free-and-paid-tiers/) explains the limits and option; the [pricing page](https://dev.turnzero.ai/pricing) gives its rate.

The service limits each space's forwarded calls per minute, and a call past the limit is refused `rate_limited`. When many reads of large spaces run at once, the service can also refuse a read `rate_limited`: wait a few seconds and call again.

## Related feature packages

The tztrack package depends on no other feature package. [Storage](/cloud/backend-packages/storage/) states the rule this service applies to every write: where a service relays its users' actions, each write names the user who acted. [Account](/cloud/backend-packages/account/) verifies the end users an application names as actors.

## The client

The package is published in the library as the npm package `@turnzero/tztrack`, not on the npm registry; [Use the feature package library](/cloud/guides/use-the-library/#5-install-a-package-s-compiled-code) installs it with one line. The module holds two clients: `createIssueTrackingClient` and `createIssueTrackingClientV2`. For a binding limited to a list of components, use `createIssueTrackingClientV2`. The gateway refuses calls from the first client on that binding.

For `createIssueTrackingClientV2`, the gateway forwards four calls: `submit`, `read`, `list`, and `search`. The V2 `submit` call can also amend a user's report. See [Methods and results](#methods-and-results) for the calls the first client can use. A [relay](/cloud/concepts/glossary/#relay) of your account reaches the other V2 calls.

### Construction

`createIssueTrackingClient(transport)` builds the client for bindings without a components list, with no options. `transport(path, init)` sends each call to `POST /egress/v0/issue-tracking/v1/<call>` under the application's [platform credential](/cloud/concepts/glossary/#platform-credential), `TURNZERO_CLOUD_APP_TOKEN`, and returns the response. The path sits on `TURNZERO_CLOUD_GATEWAY_URL` where the deploy sets it, and on `TURNZERO_CLOUD_API` where it does not. The gateway finds the space from the calling application and environment, and presents the space's token for it.

A [local run](/cloud/concepts/glossary/#local-run) reaches the same space through the platform's public gateway under the development credential. For a shared space binding, the gateway stamps the run's reports `local`. A test runs the double in its place ([Test with the double](#test-with-the-double)).

`createIssueTrackingClientV2(transport)`, also with no options, runs over the same transport, each call at `/egress/v0/issue-tracking/v2/<call>`.

For a program calling the service directly, construct `createIssueTrackingClientV2(transport, { space, credential })` with the space's `owner` token. Its `configure` method accepts `add_release_lines`, a list of `{ name, kind }` entries. New names are appended; an existing name keeps its line's settings, including `kind`. A `configure` naming only `add_release_lines` changes nothing and leaves `changed_at` unchanged when all its names are already present.

Declare each name once, and choose `product` or `client` as `kind`. An addition that would take the list past 50 lines is refused without changes. Do not send `add_release_lines` beside `release_lines`, which still replaces the whole list. The gateway, the relay and the service's MCP tools do not accept this member.

### Methods and results

For the first client, the gateway forwards `submit`, `read`, `list`, `search`, and `read_space` at the `report` grant level, each a method of the client, such as `client.submit(request)` and `client.readSpace()`. Each method takes `{ signal }` as its last argument.

- `submit({ actor, kind, source, title, body, evidence, key })` files one report, `actor` being `{ kind, id }` for the user you file for. It returns `{ issue, outcome }`, the outcome one of `filed`, `retried`, `repeated`, `reopened`, and `recovered`.
- `read(issue)` returns the issue, its history, comments, relations, and members. `list` and `search` return issues, `list` in the order `newest` or `score`, the service's rank by an issue's reports.
- On this client, a priority is 1 to 4. `excerpt` may only be `false`, and `true` is refused `invalid_request`. `recovered: true` is refused `recovery_unmatched` unless that actor's own filing under that key opened the issue and every report on the issue is that actor's.

On `createIssueTrackingClientV2` the gateway forwards `submit`, `read`, `list`, and `search` at both grant levels, and refuses every other call `issue_tracking_call_refused`. Use the first client for other forwarded calls only where the binding has no components list. A components binding admits only these four V2 calls.

- `submit({ actor, origin, kind, title, text, key })` files one report, and returns its `report`, whose `id` is its number, with the `issue` and the `outcome`. The current outcomes are `filed`, `linked`, `retried`, `noted` and `amended`. The gateway files it with the origin `field`. The service refuses a `question` or `task` filed this way. Use the first client for those kinds only if the binding has no components list.
- `submit({ actor, amends, text, withdraws, key })` corrects or withdraws a report that `actor` filed, `amends` being its number. A new amendment returns `amended`; a retry with the same key returns `retried`.
- `read({ issue, actor })`, `list({ actor })`, and `search({ query, actor })` return that user's own view: the issues their reports belong to, each with their reports and each report's `amends`, `withdraws`, and `seen_after_fix_basis`.

### Failures

- `IssueTrackingGatewayRefusal`, for the gateway's own refusal, which the client tells apart by the marker header. `issue_tracking_call_refused` is a call the gateway does not forward, and `issue_tracking_application_required` a credential that names no application. `issue_tracking_not_provisioned` is an environment with no space, and `issue_tracking_unavailable` a token that cannot be read, which may be retried. `tztrack_required` is a binding to a space of your account's own while your account lacks tzTrack.
- `IssueTrackingRefusal`, for the service's refusal by name in `refusal`, with `status` and `detail`. A refused call changes nothing. Its `own` is null except on a `read` naming `actor` refused `issue_not_found`, where that user's own report joined the issue the number names. There `own` is the identifier of the issue that report is on now. A read naming the same actor returns that issue. `own` never names an issue that user cannot read. It is null for another user's issue, for a restricted issue, and for a number that names no issue.
- `IssueTrackingUnreachable`, when the transport fails, the service reports a fault, or the client cannot read the response. You can retry a read. If you retry a write that takes a `key`, reuse the original key.

Branch on `refusal`, never on `detail`. The [refusals page](/cloud/reference/refusals/) lists the gateway's five refusals with their cause and remedy. The service's own names, `recovery_unmatched` among them, are listed in the package's contract, the entry's `tztrack.md`.

## Test with the double

`createIssueTrackingDouble(options)` from `@turnzero/tztrack/testing` answers both clients' calls in memory, and passes the same list of test cases the contract states. Seed a space with `double.createSpace()`, then take `double.gatewayView({ space })` over its `space.id`: the gateway's view, as the deployed backend reaches its space. Build `createIssueTrackingClient(view.transport)` with no options, and `createIssueTrackingClientV2(view.transport)` for the four current calls the view forwards. `reset()` empties every space, so seed a space and take its view in each test. A test runs this sample over the double.

```js
import assert from 'node:assert/strict';
import { createIssueTrackingClient, createIssueTrackingClientV2, IssueTrackingGatewayRefusal } from '@turnzero/tztrack';
import { createIssueTrackingDouble } from '@turnzero/tztrack/testing';

// One space, reached as the deployed backend reaches it: through the gateway's view.
const tracker = createIssueTrackingDouble();
const { space } = tracker.createSpace();
const view = tracker.gatewayView({ space: space.id });
const client = createIssueTrackingClient(view.transport);

// The backend files the signed-in user's report under the user's own id.
const filed = await client.submit({ actor: { kind: 'person', id: 'user-1' }, kind: 'bug', source: 'person', title: 'Export does nothing', body: 'Clicking Export downloads no file.' });
assert.equal(filed.outcome, 'filed');
// Answer the user with their own report's state alone, never the whole issue.
const reply = { issue: filed.issue.id, status: filed.issue.status };
assert.equal(reply.status, 'open');
// The same transport carries the current client's filing and the user's own amendment.
const current = createIssueTrackingClientV2(view.transport);
const first = await current.submit({ actor: { kind: 'person', id: 'user-1' }, origin: 'field', kind: 'bug', title: 'Import fails' });
const amended = await current.submit({ actor: { kind: 'person', id: 'user-1' }, amends: first.report.id, withdraws: true });
assert.equal(amended.outcome, 'amended');
// A call the gateway refuses throws its own refusal, told apart from the service's.
view.refuseNext('issue_tracking_unavailable');
await assert.rejects(client.list(), (error) => error instanceof IssueTrackingGatewayRefusal && error.refusal === 'issue_tracking_unavailable');
```

The client's refusals are those [Failures](#failures) lists. These come from the double's own setup:

| Refusal | Cause | Remedy |
| --- | --- | --- |
| `issue_tracking_call_refused`, `issue_tracking_application_required`, `issue_tracking_not_provisioned`, `issue_tracking_unavailable`, `tztrack_required` | `view.refuseNext` scripted the gateway's refusal, or the call named a path the gateway does not forward, such as `"delete_space"`. | Call through the client, and assert the refusal where the test scripts it. |
| `issue_tracking_not_provisioned`, unscripted | The view's space does not exist: it was never seeded, or `reset()` emptied it. The view returns this refusal on its own for every call to a space that does not exist. | Seed the space with `double.createSpace()` and take its view again in each test. |
