# `code@1`: pull requests, reviews, issues, deployments and releases

Version **1.3.0** · published 2026-12-02 · MIT · boards: delivery-overview, dora-metrics, my-code-year, dependencies-security, dev-infra-status, sprint-burndown · [changelog](../CHANGELOG.md)

One row of `pull_requests` is one pull request (GitHub) or merge request (GitLab) with its phase timestamps already
worked out by the connector: when it left draft (`ready_at`), its first review by someone else who is not a bot
(`first_review_at`), its first approval, and when it merged or closed. Metrics then measure cycle time and where work
waits without walking a timeline in SQL. `reviews`, `issues`, `deployments` (deployments and releases), `incidents`,
`repos` and `people` complete the picture. The GitHub connector (`dashremix connect github`, through the person's own
`gh` login) writes it into the crate library (`library/code.db`); Delivery Overview and DORA Metrics read it.

## Conventions
- **Instants** are ISO 8601 UTC (`2026-10-05T12:00:00Z`). Durations are never stored: metrics derive them.
- **IDs** are `<connector>:<repository scope>:<host id>`. The GitHub connector scopes by the repository's node id, which
  survives a rename: `gh:R_kgDOA…:PR_kwDOA…` for a pull request, `gh:R_kgDOA…:release:RE_…` for a release. A CSV export
  scopes by owner/name: `csv:sample-co/api:42`. They never depend on row order or import time, and two hosts or
  repositories never clash. `repo_id` is the current owner/name.
- **Phase timestamps** (computed by the connector, documented here so every connector agrees):
  - `ready_at`: the last time the pull request left draft; `created_at` when it never was a draft; NULL while it is a
    draft. A pull request that went back to draft and out again is ready from the second time.
  - `first_review_at`: the earliest submitted review (any state, including a comment-only review) by someone who is
    neither the author nor a bot. A review re-requested later does not move it.
  - `first_approval_at`: the earliest approving review by someone who is neither the author nor a bot.
  - `is_revert`: the title starts with "Revert" (GitHub's revert button writes that), or the person's revert rule.
- **Provenance**: `source` (connector id: `github`, `prs-csv`, `code-csv`), `source_ref` (the host's node id, or
  file:line), `imported_at` (left out of `meta.data_hash`).

## People and privacy
- `person_key` is a hash of the lower-case login: HMAC-SHA256 with a salt kept in the crate (`library/.people.salt`,
  git-ignored, made at the first connect or sync), first 16 hex. A crate synced before the salt existed gets new keys
  once (everything is read again). Without a salt (saved fixtures) it is plain SHA-256. A login is reversible
  from a list of logins only by someone who also has the salt.
- `display_name` is NULL by default. It is filled only when the person turns on `store_logins` **for their own team**
  (the logins in their own team mapping), never for anyone else.
- `team` comes from the person's own mapping (login → team, in the git-ignored `sources/github/people.yaml`), applied at
  sync time without storing the login. Changing it (or `bots:`) applies to everything already stored at the next sync.
- Boards are team-level by default. A board may show individual figures only behind an explicit setting for the
  person's own team, with a metrics-ethics note (engineering metrics describe a system, not a person; DORA's research
  warns against turning them into targets).
- Bots (`is_bot`: a GitHub `Bot` actor, a `[bot]` login, or a login the person lists) never count as a review.

## Deployments and releases
`deployments.kind` says what a row is: a GitHub deployment (`github_deployment`, with an `environment`), a deploying
workflow run (`workflow_run`), a published release (`release`: `ref` is the tag, `name` the release title), a tag, or a
manual entry. A deployment that was live and was later replaced is `inactive`: it still shipped. Since 1.1,
`status_history` keeps every status the host reported (oldest first) and `live_at` is the first time it reached `success`,
so a board can tell "live, then replaced" (`success` → `inactive`) from "never live" (`failure` → `inactive`) and date a
deployment by when it went live. `finished_at` keeps its 1.0 meaning (the latest status time). One repository can have several kinds; a metric that counts "things shipped" picks **one kind per
repository** (production deployments when there are any, else releases) and never adds kinds together.

## Lead time and deploy matching (1.1)
- `first_commit_at`: the authored time of the pull request's first commit, as the host lists its commits (GitHub: the
  first node of the pull request's `commits` connection). Authored times survive a rebase and a squash, so lead time
  can start at the first commit even when the branch was squashed into one commit on merge. NULL when the source does
  not give it (boards fall back to `created_at` and say so).
- `merge_sha`: the commit the merge made on the base branch (GitHub's `mergeCommit`): the merge commit, the squash
  commit, or the last rebased commit. A deployment whose `sha` equals it shipped that pull request (and everything
  merged before it since the previous deployment). Which deployments a pull request reached is worked out by each board
  from its own settings (production environments, services); it is never stored here.

## Commits, branches and ownership (1.2)
Read from local git clones by the shared reader (`dashremix_board/git/`, read-only: it never fetches, and a repository's
own config cannot make it run a program). The tables hold facts only git can give; areas, work types, platform work and
refactor calls are each board's own rules, applied at its import, so changing a rule never means reading the repository
again.
- **Which commits.** Everything reachable from the default branch (`on_default = 1`), merges included as rows with no
  file rows. Commits only on other branches are `on_default = 0`, after leaving out any whose `git patch-id --stable`
  already exists on the default branch (cherry-picks and rebased copies). `branches.unmerged_commits` lists them.
- **Lines.** `commit_files` is numstat with renames off: a moved file counts as removed plus added. A binary file has 0
  lines and `is_binary = 1`. A commit's `additions`, `deletions` and `files_n` are the sums of its file rows (checked).
- **Dates.** `authored_at` is when the work was written; it survives a rebase and a squash. `committed_at` moves when
  history is rewritten. Both are UTC; `author_tz_offset` keeps the author's own offset.
- **Agents.** `agent_mode` says who did the work: `agent_authored` when the author or committer identity is a coding
  agent (claude[bot], Cursor's agent, copilot-swe-agent), `agent_assisted` when a person committed it with a
  `Co-Authored-By:` trailer naming an agent (Claude Code and Codex write one) or a "Generated with" line, `bot` for
  automation nobody directs (Dependabot, Renovate), else `human`. `agent_name` names the agent. Boards count agent work
  explicitly and give it to the person who ran it.
- **People.** `author_key`, `committer_key` and `co_author_keys` are `person_key`s, made like a pull request author's:
  HMAC-SHA256 with the crate's salt of the canonical identity, which is the person's own alias for it, else the GitHub
  login from a noreply address, else the email after `.mailmap`. So the same person has one key across pull requests and
  commits when their login is known. Emails are never stored. `people.is_me` marks the person's own identities on a
  personal board.
- **Branch names** often carry a login or a ticket, so `branches.name` is NULL unless the person opted in, or (on a
  personal board) every unmerged commit on it is their own; `branch_id` hashes the ref name with the salt.
- **Subjects** stay on this computer: static exports and shared pages drop them.
- **Ownership** is `git blame -w -M -C` at the default branch's head, summed per file and person: whitespace changes do
  not move a line's author, moved and copied lines keep theirs. Nothing per line is kept.

## CI, uptime, dependencies and sprints (1.3)

Four groups of optional tables for the boards that watch how a team's software runs, not only how it is written. Each
is read from files the person saved (a CI report, a monitor's history, a lockfile, a sprint board export); nothing is
probed or fetched.

- **`services`** are the person's own list (name, team, the repository each is built from). CI runs and uptime checks
  point at them.
- **`ci_runs`**: one row per attempt. A rerun is a new row with `attempt` 2, 3 ...; a named test inside a run is
  `kind = test` with its `test_name`, so a test that failed and passed on a rerun counts as flaky, not as a failure.
  Skipped and neutral runs are `cancelled`: never a pass, never a failure.
- **`uptime_checks`**: intervals `[first_at, last_at)` with a state. `unknown` (no data) is never counted as up, and
  announced `maintenance` is not an outage. Availability = up time / (up + down + degraded time) over the period.
- **`dependency_snapshots`**, **`dependencies`**, **`advisories`**: one row per dated lockfile read and one per package in
  it, so a board compares snapshots instead of guessing history. `advisories_read` and `releases_read` say what else was
  read that day: a snapshot without an advisory report has *unknown* alerts, never zero. `is_outdated` is compared by the
  connector (semantic versions are not compared in SQL). An advisory appears once per snapshot under its stable
  `alert_key`, so "fixed since the last snapshot" is a join.
- **`sprints`**, **`sprint_snapshots`**: a sprint's planned dates, and each item's state as an export showed it on a day.
  Scope, done and remaining (in items or in points) per day come from these rows; the ideal line runs from the first
  snapshot's scope to zero on `end_on`. Items whose status the person has not mapped are `unknown`, shown for review and
  never counted as done.

## Sources that fill it
| Source | Lane | Tables and columns it fills |
|---|---|---|
| GitHub through the person's own `gh` login (`dashremix connect github`): GraphQL for pull requests with reviews and draft events, REST for issues, deployments and releases; incremental by `updated_at` | 2 | repos, people, pull_requests, reviews, issues, deployments (`github_deployment`, `release`) |
| Saved `gh api` answers in `sources/github/` (`replay:`), for air-gapped teams | 1 | the same |
| A pull request CSV (GitLab's merge request export, or DashRemix's own columns) read by a board | 1 | repos, people, pull_requests (no review times in GitLab's export) |
| Local git clones (a working clone, a bare or `--mirror` clone, or a `git bundle` file) through the shared reader (1.2) | 1 | repos, people, commits, commit_files, branches, ownership |
| Saved CI reports (GitHub Actions run fields, or a CI report CSV) and an uptime monitor's interval history (1.3) | 1 | services, ci_runs, uptime_checks, deployments, incidents |
| npm lockfiles (v1-v3), saved Dependabot alert lists and a registry release-facts CSV (1.3) | 1 | repos, dependency_snapshots, dependencies, advisories |
| Saved sprint board exports from Jira, Linear or GitHub Projects, one per day (1.3) | 1 | repos, sprints, sprint_snapshots, issues |
| The standard itself as one CSV per table (like `fixtures/`) | 1 | everything |

## Compatibility
- A board that declares `code@1 >=1.0` keeps working on any later 1.x database.
- Remixes that add only metrics, pages and `x_<owner>_` tables survive every minor.
- Breaking changes go to `code@2` with a migration and `metrics-codemod.py` (see `../../README.md`, Semver).

## Fields

<!-- fields:begin (generated from schema.sql by spec/build.py; edit the DDL comments) -->

### `meta` (required table)

Key/value facts about this database. Required: schema, schema_version, as_of, data_hash. Recommended (checked at warn): source_built_at (ISO 8601 UTC instant the database was written).

| Field | Type | Required | Meaning |
|---|---|---|---|
| `key` | TEXT | no |  |
| `value` | TEXT | no |  |

### `repos` (required table)

Repositories (or projects) the work happens in.

| Field | Type | Required | Meaning |
|---|---|---|---|
| `repo_id` | TEXT | **yes** | owner/name as the host writes it, e.g. sample-co/api |
| `default_branch` | TEXT | no | e.g. main |
| `is_private` | INTEGER | no | 1 private, 0 public |
| `language` | TEXT | no | primary language as the host reports it |
| `stars` | INTEGER | no | stargazers at the last sync |
| `archived` | INTEGER | no | 1 when archived (kept for history, no new work expected) |
| `source` | TEXT | no | connector id that wrote the row: github \| prs-csv \| code-csv |
| `imported_at` | TEXT (instant) | no | ISO 8601 UTC instant of the import (left out of meta.data_hash) |

### `people` (required table)

Everyone who authored, reviewed or was assigned something. Keys are hashes, never logins.

| Field | Type | Required | Meaning |
|---|---|---|---|
| `person_key` | TEXT | **yes** | 16 hex: HMAC-SHA256 of the lower-case login with a per-crate salt (sha256 without one), first 16 hex |
| `display_name` | TEXT | no | the login or a name: only when the person opted in for their own team (store_logins); NULL otherwise |
| `is_bot` | INTEGER | **yes** | 1 for automation (a Bot actor, a [bot] login, or a login the person listed as a bot); bots never count as a review |
| `team` | TEXT | no | team name from the person's own mapping (crate.yaml or inputs); NULL = no team given |
| `is_me` | INTEGER | no | 1 for the person's own identities on a personal board (their own people file); NULL or 0 otherwise (1.2) |
| `source` | TEXT | no | connector id that wrote the row |
| `imported_at` | TEXT | no | ISO 8601 UTC instant of the import |

### `pull_requests` (required table)

One pull request (GitHub) or merge request (GitLab), with phase timestamps computed by the connector.

| Field | Type | Required | Meaning |
|---|---|---|---|
| `pr_id` | TEXT | **yes** | <connector>:<repo>:<host id>, e.g. gh:sample-co/api:PR_kwDO… (never a list position) |
| `repo_id` | TEXT | **yes** | the repository (repos.repo_id) |
| `number` | INTEGER | **yes** | the number people see (#123) |
| `title` | TEXT | no | title as written (used for release notes and the ledger; stays on this computer) |
| `author_key` | TEXT | no | people.person_key of the author; NULL = deleted account |
| `created_at` | TEXT (instant) | **yes** | opened (ISO 8601 UTC) |
| `updated_at` | TEXT (instant) | no | last change on the host (incremental sync cursor) |
| `ready_at` | TEXT (instant) | no | ready for review: the last time it left draft, or created_at when it never was a draft; NULL while still a draft |
| `first_review_at` | TEXT (instant) | no | first review by someone other than the author who is not a bot (any state); NULL = no review yet |
| `first_approval_at` | TEXT (instant) | no | first approving review by someone other than the author who is not a bot |
| `merged_at` | TEXT (instant) | no | merged; NULL = not merged |
| `closed_at` | TEXT (instant) | no | closed (merged or not); NULL = still open |
| `additions` | INTEGER | no | lines added |
| `deletions` | INTEGER | no | lines deleted |
| `changed_files` | INTEGER | no | files changed |
| `commits_n` | INTEGER | no | commits in the pull request |
| `base_branch` | TEXT | no | target branch, e.g. main |
| `head_branch` | TEXT | no | source branch |
| `labels` | TEXT | no | JSON array of label names, e.g. ["feature"] |
| `is_draft` | INTEGER | **yes** | 1 while it is a draft |
| `is_revert` | INTEGER | **yes** | 1 when it reverts earlier work (title starts with Revert, or a revert branch) |
| `linked_issues` | TEXT | no | JSON array of issue numbers it closes |
| `first_commit_at` | TEXT (instant) | no | authored time of the pull request's first commit (ISO 8601 UTC); lead time for changes starts here (1.1) |
| `merge_sha` | TEXT | no | the commit the merge made on the base branch (merge, squash or rebase commit); matches a deployment's sha (1.1) |
| `source` | TEXT | no | connector id that wrote the row |
| `source_ref` | TEXT | no | where in the source: the host's node id, or file:line |
| `imported_at` | TEXT (instant) | no | ISO 8601 UTC instant of the import |

### `reviews` (required table)

Every submitted review, including bots and the author's own comments (metrics leave those out).

| Field | Type | Required | Meaning |
|---|---|---|---|
| `review_id` | TEXT | **yes** | <connector>:<repo>:<host id> |
| `pr_id` | TEXT | **yes** | the pull request (pull_requests.pr_id) |
| `reviewer_key` | TEXT | no | people.person_key of the reviewer; NULL = deleted account |
| `submitted_at` | TEXT (instant) | **yes** | ISO 8601 UTC |
| `state` | TEXT (vocab `review_states`) | no | approved \| changes_requested \| commented \| dismissed (vocab review_states) |
| `source` | TEXT | no | connector id that wrote the row |
| `imported_at` | TEXT | no | ISO 8601 UTC instant of the import |

### `deployments`

Things shipped: deployments, workflow runs that deploy, releases and tags. One repo should be read from one kind (README, "Deployments and releases"); boards never add kinds together for the same repo.

| Field | Type | Required | Meaning |
|---|---|---|---|
| `deploy_id` | TEXT | **yes** | <connector>:<repo>:<kind>:<host id> |
| `repo_id` | TEXT | **yes** | the repository |
| `environment` | TEXT | no | production, staging …; release for a release, tag for a tag |
| `created_at` | TEXT (instant) | **yes** | started (deployment), published (release), or tagged (ISO 8601 UTC) |
| `finished_at` | TEXT (instant) | no | the final status time, when known |
| `status` | TEXT (vocab `deploy_statuses`) | no | success \| failure \| error \| inactive \| in_progress \| queued \| pending \| cancelled (vocab deploy_statuses) |
| `sha` | TEXT | no | commit deployed, when known |
| `ref` | TEXT | no | tag, branch or ref deployed (a release's tag name, e.g. v2.4.0) |
| `name` | TEXT | no | a release's title as written (release notes) |
| `kind` | TEXT (vocab `deploy_kinds`) | **yes** | github_deployment \| workflow_run \| release \| tag \| manual (vocab deploy_kinds) |
| `pr_ids` | TEXT | no | JSON array of pull_requests.pr_id shipped in it, when known |
| `live_at` | TEXT (instant) | no | when it first reached success (ISO 8601 UTC), from its status history; NULL = never live (1.1) |
| `status_history` | TEXT | no | JSON array of [state, instant] pairs, oldest first, e.g. [["in_progress","…Z"],["success","…Z"],["inactive","…Z"]] (1.1) |
| `source` | TEXT | no | connector id that wrote the row |
| `source_ref` | TEXT | no | the host's id, or file:line |
| `imported_at` | TEXT | no | ISO 8601 UTC instant of the import |

### `incidents`

Production incidents, for change-failure and recovery metrics (DORA).

| Field | Type | Required | Meaning |
|---|---|---|---|
| `incident_id` | TEXT | **yes** | <connector>:<repo>:<host id>, or a hash of the natural key |
| `repo_id` | TEXT | no | the repository, when one is known |
| `opened_at` | TEXT (instant) | **yes** | ISO 8601 UTC |
| `resolved_at` | TEXT (instant) | no | ISO 8601 UTC; NULL = still open |
| `severity` | TEXT | no | as the person labels it (sev1, high …) |
| `caused_by_deploy_id` | TEXT | no | deployments.deploy_id, when known |
| `kind` | TEXT (vocab `incident_kinds`) | no | issue_label \| revert_pr \| hotfix_branch \| manual \| deploy_failure \| rollback (vocab incident_kinds): how it was found |
| `title` | TEXT | no | what happened, as written (stays on this computer) (1.1) |
| `source` | TEXT | no | connector id that wrote the row |
| `source_ref` | TEXT | no | where in the source |
| `imported_at` | TEXT | no | ISO 8601 UTC instant of the import |

### `issues`

Issues (bugs, features, tasks). Pull requests are never issues here.

| Field | Type | Required | Meaning |
|---|---|---|---|
| `issue_id` | TEXT | **yes** | <connector>:<repo>:<host id> |
| `repo_id` | TEXT | no | the repository |
| `number` | INTEGER | no | the number people see |
| `title` | TEXT | no | title as written (stays on this computer) |
| `created_at` | TEXT (instant) | **yes** | opened (ISO 8601 UTC) |
| `updated_at` | TEXT (instant) | no | last change on the host |
| `closed_at` | TEXT (instant) | no | closed; NULL = open |
| `state_reason` | TEXT (vocab `issue_state_reasons`) | no | completed \| not_planned \| duplicate \| reopened (vocab issue_state_reasons); NULL when open or not given |
| `labels` | TEXT | no | JSON array of label names |
| `is_bug` | INTEGER | **yes** | 1 when a label says bug (or the person's bug_labels) |
| `assignee_key` | TEXT | no | people.person_key of the first assignee |
| `milestone` | TEXT | no | milestone title |
| `source` | TEXT | no | connector id that wrote the row |
| `source_ref` | TEXT | no | where in the source |
| `imported_at` | TEXT | no | ISO 8601 UTC instant of the import |

### `commits`

One commit read from a local clone (1.2). The default branch's commits and, after patch-id dedupe, the commits only on other branches. Merges are rows too (is_merge = 1) with no file rows: their diff repeats work already counted.

| Field | Type | Required | Meaning |
|---|---|---|---|
| `commit_id` | TEXT | **yes** | <connector>:<repo_id>:<sha>, e.g. git:sample-co/api:3f2a… (1.2) |
| `repo_id` | TEXT | **yes** | the repository (repos.repo_id) (1.2) |
| `sha` | TEXT | **yes** | the full commit hash (1.2) |
| `author_key` | TEXT | no | people.person_key of the author (salted hash of the canonical identity; never an email) (1.2) |
| `committer_key` | TEXT | no | people.person_key of the committer (1.2) |
| `authored_at` | TEXT (instant) | **yes** | author time, ISO 8601 UTC: when the work was written; survives rebase and squash (1.2) |
| `committed_at` | TEXT (instant) | no | committer time, ISO 8601 UTC: a rebase, amend or cherry-pick moves it (1.2) |
| `author_tz_offset` | INTEGER | no | the author's UTC offset in minutes at authoring time, e.g. -300 (1.2) |
| `parents_n` | INTEGER | no | number of parents: 0 root, 1 normal, 2+ merge (1.2) |
| `is_merge` | INTEGER | **yes** | 1 for a merge commit (no file rows) (1.2) |
| `on_default` | INTEGER | **yes** | 1 when reachable from the default branch at as_of; 0 = only on other branches (unmerged) (1.2) |
| `subject` | TEXT | no | first line of the message as written (stays on this computer; exports drop it) (1.2) |
| `additions` | INTEGER | no | lines added over every file (numstat, renames off; binary files count 0) (1.2) |
| `deletions` | INTEGER | no | lines deleted over every file (1.2) |
| `files_n` | INTEGER | no | files changed (1.2) |
| `created_files_n` | INTEGER | no | files the commit created (1.2) |
| `patch_id` | TEXT | no | git patch-id --stable, when computed (unmerged commits); NULL otherwise (1.2) |
| `word_change_ratio` | REAL | no | share of words that really change (0..1; moved or re-indented words do not count), measured for refactor candidates only; NULL = not measured (1.2) |
| `agent_mode` | TEXT (vocab `agent_modes`) | **yes** | human \| agent_assisted \| agent_authored \| bot (vocab agent_modes) (1.2) |
| `agent_name` | TEXT (vocab `agent_names`) | no | claude \| codex \| cursor \| copilot \| devin \| aider \| gemini \| grok \| other (vocab agent_names); NULL for human and bot (1.2) |
| `co_author_keys` | TEXT | no | JSON array of people.person_key from Co-Authored-By trailers that are people (agents are agent_name) (1.2) |
| `revert_of` | TEXT | no | sha this commit reverts ("This reverts commit …"), when it says so (1.2) |
| `pr_id` | TEXT | no | pull_requests.pr_id that merged it (via merge_sha), when the library has pull requests (1.2) |
| `source` | TEXT | no | connector or importer id that wrote the row: git \| git-bundle \| code-csv (1.2) |
| `source_ref` | TEXT | no | where in the source: the sha, or file:line (1.2) |
| `imported_at` | TEXT (instant) | no | ISO 8601 UTC instant of the import (left out of meta.data_hash) (1.2) |

### `commit_files`

Lines changed per file per commit (numstat; renames off, so a moved file is removed + added) (1.2). Raw facts only: areas, work types and platform categories are a board's own rules, applied at its import.

| Field | Type | Required | Meaning |
|---|---|---|---|
| `commit_id` | TEXT | **yes** | commits.commit_id (1.2) |
| `path` | TEXT | **yes** | repo-relative path as git writes it (1.2) |
| `additions` | INTEGER | **yes** | lines added (0 for a binary file) (1.2) |
| `deletions` | INTEGER | **yes** | lines deleted (0 for a binary file) (1.2) |
| `change` | TEXT (vocab `file_changes`) | no | A created \| M modified or deleted (vocab file_changes) (1.2) |
| `is_binary` | INTEGER | **yes** | 1 when git shows no line counts (images, archives) (1.2) |

### `branches`

Branches of a clone at as_of: the default branch and every other branch with its unmerged commits (1.2).

| Field | Type | Required | Meaning |
|---|---|---|---|
| `branch_id` | TEXT | **yes** | <connector>:<repo_id>:<16 hex HMAC of the ref name with the salt> (names often carry a login) (1.2) |
| `repo_id` | TEXT | **yes** | the repository (1.2) |
| `kind` | TEXT (vocab `branch_kinds`) | **yes** | default \| local \| remote (vocab branch_kinds) (1.2) |
| `name` | TEXT | no | the branch name: NULL unless the person opted in, or every unmerged commit on it is their own on a personal board (1.2) |
| `head_sha` | TEXT | no | the commit the branch points at (1.2) |
| `last_commit_at` | TEXT (instant) | no | committer time of that commit, ISO 8601 UTC (1.2) |
| `ahead` | INTEGER | no | commits on the branch not on the default branch (merges included) (1.2) |
| `behind` | INTEGER | no | commits on the default branch not on the branch (1.2) |
| `unmerged_commits` | TEXT | no | JSON array of commits.commit_id only on this branch (patch-id duplicates of default-branch work left out) (1.2) |
| `is_default` | INTEGER | **yes** | 1 for the default branch (1.2) |
| `source` | TEXT | no | connector or importer id (1.2) |
| `imported_at` | TEXT (instant) | no | ISO 8601 UTC instant of the import (1.2) |

### `ownership`

Who wrote the code that is still there: git blame -w -M -C at the default branch's head, aggregated per file and person (never per line) (1.2).

| Field | Type | Required | Meaning |
|---|---|---|---|
| `repo_id` | TEXT | **yes** | the repository (1.2) |
| `head_sha` | TEXT | **yes** | the commit blamed (1.2) |
| `path` | TEXT | **yes** | repo-relative path (1.2) |
| `person_key` | TEXT | **yes** | people.person_key of the line's author (1.2) |
| `lines` | INTEGER | **yes** | current lines by that person in that file (1.2) |

### `services`

Services the person runs (1.3): an API, a web app, a worker. CI runs and uptime checks point here; one service is built from one repository. Names come from the person's own list, never from a probe.

| Field | Type | Required | Meaning |
|---|---|---|---|
| `service_id` | TEXT | **yes** | the person's short id for the service, e.g. api |
| `name` | TEXT | no | display name, e.g. Harbor API |
| `team` | TEXT | no | the team that answers for it, from the person's own mapping |
| `repo_id` | TEXT | no | repos.repo_id it is built from, when known |
| `source` | TEXT | no | who wrote the row: inputs \| the connector id |
| `imported_at` | TEXT (instant) | no | ISO 8601 UTC instant of the import |

### `ci_runs`

One CI attempt (1.3): a workflow run, a deployment job or one named test, as a saved CI report or the host gives it. A rerun is a new row (attempt 2, 3 ...), so a test that failed and then passed is visible as flaky.

| Field | Type | Required | Meaning |
|---|---|---|---|
| `ci_run_id` | TEXT | **yes** | <connector>:<repo_id>:<16 hex of sha1 of run_ref\|attempt\|test_name> |
| `repo_id` | TEXT | **yes** | repos.repo_id |
| `service_id` | TEXT | no | services.service_id, when the person maps runs to a service |
| `workflow` | TEXT | **yes** | the workflow or pipeline name, e.g. Main build |
| `run_ref` | TEXT | **yes** | the host's run id or number, as written |
| `attempt` | INTEGER | **yes** | 1 for the first try, 2 for the first rerun ... |
| `kind` | TEXT (vocab `ci_kinds`) | **yes** | build \| test \| deployment (vocab ci_kinds) |
| `test_name` | TEXT | no | the test's name, exactly when kind = test (stays on this computer) |
| `conclusion` | TEXT (vocab `ci_conclusions`) | **yes** | success \| failure \| cancelled (vocab ci_conclusions): skipped and neutral runs are cancelled |
| `started_at` | TEXT (instant) | no | ISO 8601 UTC, when the report has it |
| `completed_at` | TEXT (instant) | **yes** | ISO 8601 UTC |
| `environment` | TEXT | no | deployment target, e.g. production |
| `branch` | TEXT | no | the branch built, when the report has it |
| `source` | TEXT | **yes** | connector id: code-csv \| github |
| `source_ref` | TEXT | **yes** | file:line or the API object |
| `imported_at` | TEXT (instant) | no | ISO 8601 UTC instant of the import |

### `uptime_checks`

What an uptime monitor reported for a service over an interval (1.3): first_at inclusive, last_at exclusive. Read from the monitor's saved history; nothing is probed. One service's intervals never overlap.

| Field | Type | Required | Meaning |
|---|---|---|---|
| `check_id` | TEXT | **yes** | <connector>:<service_id>:<first_at> |
| `service_id` | TEXT | **yes** | services.service_id |
| `first_at` | TEXT (instant) | **yes** | ISO 8601 UTC start of the interval |
| `last_at` | TEXT (instant) | **yes** | ISO 8601 UTC end of the interval (exclusive) |
| `state` | TEXT (vocab `uptime_states`) | **yes** | up \| down \| degraded \| maintenance \| unknown (vocab uptime_states) |
| `response_ms` | REAL | no | average response time over the interval, when the monitor gives it |
| `source` | TEXT | **yes** | connector id: monitor-csv |
| `source_ref` | TEXT | **yes** | file:line |
| `imported_at` | TEXT (instant) | no | ISO 8601 UTC instant of the import |

### `dependency_snapshots`

One dated read of a dependency manifest's lockfile (1.3), with what else was read for that day, so a board can tell "no advisory" from "advisories not checked".

| Field | Type | Required | Meaning |
|---|---|---|---|
| `snapshot_id` | TEXT | **yes** | <connector>:<repo_id>:<manifest>@<snapshot_on> |
| `repo_id` | TEXT | **yes** | repos.repo_id |
| `manifest` | TEXT | **yes** | the lockfile's path in the repository, e.g. package-lock.json |
| `ecosystem` | TEXT (vocab `ecosystems`) | **yes** | npm \| pypi \| maven \| rubygems \| cargo \| go \| nuget \| composer (vocab ecosystems) |
| `snapshot_on` | TEXT (date) | **yes** | the day the lockfile was saved (YYYY-MM-DD) |
| `layout` | TEXT | no | the file layout read, e.g. npm-lock-v3 |
| `advisories_read` | INTEGER (bool) | **yes** | 1 when a security-alert report for this manifest was read for this day (no row then means none) |
| `releases_read` | INTEGER (bool) | **yes** | 1 when registry release facts (latest version, release date, license) were read |
| `source` | TEXT | **yes** | connector id: npm-lock \| github |
| `source_ref` | TEXT | **yes** | the lockfile read |
| `imported_at` | TEXT (instant) | no | ISO 8601 UTC instant of the import |

### `dependencies`

One resolved package in a lockfile snapshot (1.3). A package installed at two places in the tree is two rows.

| Field | Type | Required | Meaning |
|---|---|---|---|
| `snapshot_id` | TEXT | **yes** | dependency_snapshots.snapshot_id |
| `package_path` | TEXT | **yes** | where it sits in the lock tree (node_modules/a/node_modules/b), or the name in a flat ecosystem |
| `name` | TEXT | **yes** | the package name, e.g. @fixture/date-kit |
| `version` | TEXT | no | the resolved version as written |
| `is_direct` | INTEGER (bool) | no | 1 a direct dependency of the manifest, 0 transitive, NULL when the layout does not say |
| `license` | TEXT | no | licence as the lockfile or registry gives it (SPDX), NULL = unknown |
| `latest_version` | TEXT | no | newest release in the registry facts, when read |
| `released_on` | TEXT (date) | no | day the resolved version was published, when read |
| `is_outdated` | INTEGER (bool) | no | 1 when version is older than latest_version (compared by the connector), 0 when current, NULL when either is unknown |
| `source` | TEXT | **yes** | connector id |
| `source_ref` | TEXT | **yes** | file:entry |
| `imported_at` | TEXT (instant) | no | ISO 8601 UTC instant of the import |

### `advisories`

A security alert on a dependency as it stood on a snapshot's day (1.3): the same alert appears once per snapshot, so a board can show when it opened and when it was fixed.

| Field | Type | Required | Meaning |
|---|---|---|---|
| `snapshot_id` | TEXT | **yes** | dependency_snapshots.snapshot_id (its advisories_read is 1) |
| `alert_key` | TEXT | **yes** | the host's alert, the same at every snapshot: <connector>:<repo_id>:<alert number> |
| `package` | TEXT | **yes** | the affected package name (dependencies.name) |
| `advisory_id` | TEXT | **yes** | GHSA or CVE id, e.g. GHSA-fixt-0001-abcd |
| `severity` | TEXT (vocab `advisory_severities`) | **yes** | low \| moderate \| high \| critical (vocab advisory_severities; GitHub's medium is moderate) |
| `state` | TEXT (vocab `advisory_states`) | **yes** | open \| fixed \| dismissed \| auto_dismissed (vocab advisory_states) |
| `fixed_version` | TEXT | no | first patched version, when one exists |
| `opened_at` | TEXT (instant) | no | ISO 8601 UTC the alert opened, when the report has it |
| `closed_at` | TEXT (instant) | no | ISO 8601 UTC it was fixed or dismissed, when the report has it |
| `source` | TEXT | **yes** | connector id: dependabot-json \| github |
| `source_ref` | TEXT | **yes** | file:entry |
| `imported_at` | TEXT (instant) | no | ISO 8601 UTC instant of the import |

### `sprints`

A sprint (iteration, cycle) of a project (1.3), with its planned dates. end_on is the sprint's last working day.

| Field | Type | Required | Meaning |
|---|---|---|---|
| `sprint_id` | TEXT | **yes** | <connector>:<repo_id>:<the tool's sprint id or the person's key> |
| `repo_id` | TEXT | **yes** | repos.repo_id of the project |
| `name` | TEXT | **yes** | e.g. Sprint 14 (stays on this computer) |
| `start_on` | TEXT (date) | **yes** | first day (YYYY-MM-DD) |
| `end_on` | TEXT (date) | **yes** | last day, inclusive |
| `committed_points` | REAL | no | points committed at sprint start, when the tool records it |
| `source` | TEXT | **yes** | connector id: sprint-csv \| the person's inputs |
| `source_ref` | TEXT | no | file or the person's inputs |
| `imported_at` | TEXT (instant) | no | ISO 8601 UTC instant of the import |

### `sprint_snapshots`

One work item's state in a sprint as a saved board export showed it on one day (1.3). Scope, done and remaining per day come from these rows; an item that leaves the sprint is absent from later snapshots.

| Field | Type | Required | Meaning |
|---|---|---|---|
| `sprint_id` | TEXT | **yes** | sprints.sprint_id |
| `snapshot_on` | TEXT (date) | **yes** | the day the export was saved (YYYY-MM-DD), within the sprint's dates |
| `item_key` | TEXT | **yes** | the tool's item key: DEMO-12, owner/repo#12 |
| `issue_id` | TEXT | no | issues.issue_id, when the item is also an issue row |
| `status` | TEXT | no | the tool's own status label, e.g. In Review |
| `state` | TEXT (vocab `sprint_item_states`) | **yes** | open \| done \| unknown (vocab sprint_item_states): unknown = a status the person has not mapped |
| `points` | REAL | no | the item's estimate, NULL = not estimated |
| `source` | TEXT | **yes** | connector id: jira-csv \| linear-csv \| github-projects-csv |
| `source_ref` | TEXT | **yes** | file:line |
| `imported_at` | TEXT (instant) | no | ISO 8601 UTC instant of the import |

### `import_issues`

What a connector or importer could not read or chose to leave out, so a board can show it (never guessed).

| Field | Type | Required | Meaning |
|---|---|---|---|
| `issue_id` | TEXT | **yes** | stable id: <file>:<line> or <source>:<kind> |
| `severity` | TEXT (vocab `severities`) | **yes** | info \| warn \| error (vocab severities) |
| `kind` | TEXT | **yes** | skipped_row \| ignored_rows \| unknown_layout \| rate_limited \| source_overlap |
| `file` | TEXT | no | the source file name (never its contents) |
| `line` | INTEGER | no | 1-based line in that file, when the issue is one row |
| `detail` | TEXT | **yes** | what happened, e.g. "the created date is not a date" |
| `handling` | TEXT | **yes** | what was done: skipped the row, kept what was read … |
| `source` | TEXT | no | connector id |

### `annotations`

Notes on metrics and pages (platform table, as finance@2). Numbers only through {{metric:...}} placeholders.

| Field | Type | Required | Meaning |
|---|---|---|---|
| `annotation_id` | TEXT | **yes** | stable id |
| `target` | TEXT | **yes** | metric id or page id |
| `kind` | TEXT | **yes** | note \| caveat \| flag \| decision \| open_item |
| `body` | TEXT | **yes** | the note text |
| `author` | TEXT | no | person or assistant |
| `source_ref` | TEXT | no | where it came from |
| `created_at` | TEXT | no | ISO 8601 instant |
| `data_hash` | TEXT | no | hash of the cited metric values when written (stale when they change) |
| `status` | TEXT | no | active \| stale \| retired |

### `metric_registry`

The board's metrics, installed from metrics.sql by the importer (platform table).

| Field | Type | Required | Meaning |
|---|---|---|---|
| `metric_id` | TEXT | **yes** | e.g. kpi.delivery |
| `version` | INTEGER | no | the metric's own version |
| `unit` | TEXT | no | rows \| count \| days \| hours \| pct \| date |
| `params` | TEXT | no | comma list of parameters it honours |
| `description` | TEXT | no | the @desc line |
| `sql` | TEXT | no | expanded SQL |
| `test` | TEXT | no | the @test line (check that covers it) |

<!-- fields:end -->

## Vocabularies
- `review_states`: approved, changes_requested, commented, dismissed.
- `deploy_statuses`: success, failure, error, inactive, in_progress, queued, pending, cancelled (1.1: a cancelled or skipped run, never live and never a failed attempt) (a GitHub deployment's latest
  status; a published release is a success).
- `deploy_kinds`: github_deployment, workflow_run, release, tag, manual.
- `incident_kinds`: issue_label, revert_pr, hotfix_branch, manual.
- `issue_state_reasons`: completed, not_planned, duplicate, reopened (GitHub's `state_reason`).
- `severities`: info, warn, error (for `import_issues`).
- `agent_modes` (1.2): human, agent_assisted, agent_authored, bot. `agent_names` (1.2): claude, codex, cursor, copilot,
  devin, aider, gemini, grok, other. `branch_kinds` (1.2): default, local, remote. `file_changes` (1.2): A, M.
- `ci_kinds` (1.3): build, test, deployment. `ci_conclusions` (1.3): success, failure, cancelled. `uptime_states` (1.3):
  up, down, degraded, maintenance, unknown. `ecosystems` (1.3): npm, pypi, maven, rubygems, cargo, go, nuget, composer.
  `advisory_severities` (1.3): low, moderate, high, critical. `advisory_states` (1.3): open, fixed, dismissed,
  auto_dismissed. `sprint_item_states` (1.3): open, done, unknown.

## Conformance checks
See `checks.yaml`. `dashremix spec check <db> code@1` runs them after the DDL diff, the meta keys and the JSON Schema:
namespaced ids; repositories, pull requests and people referenced; timestamps in order; hashed people keys; the first
review is never a bot or the author; flags are 0 or 1 and line counts are not negative; `source_built_at` (warn).
1.3 adds checks on its new tables only (a 1.2 database holds none of them, so it cannot fail them): services and CI runs
reference known repositories and services with namespaced ids, attempts from 1 and test names exactly on tests; uptime
intervals run forward for a known service (no overlaps, at warn); dependency rows and advisories belong to a snapshot,
advisories only where they were read; sprint rows fall inside their sprint's dates with points that are not negative.
