---
title: "git.change@1 · OpenVibe.Services"
canonical: "https://openvibe.services/docs/contracts/git.change"
updated: null
---

# git.change@1 · OpenVibe.Services

HTML: [git.change@1 · OpenVibe.Services](https://openvibe.services/docs/contracts/git.change)

# GitChange `git.change@1`

Generated at 2026-11-13 06:25:48 UTC from [`openvibe-contracts v0.419.0`](https://github.com/OpenVibers/OpenVibe.Contracts/tree/v0.419.0) and [`openvibe-sdk v0.161.0`](https://github.com/OpenVibers/OpenVibe.SDK/tree/v0.161.0).

- Version: 1.0.0
- Owner: git
- Visibility: public
- Status: active
- Compatibility: backward
- Schema: [`https://openvibe.network/contracts/git/change.v1.json`](/docs/contracts/git.change.json)

Git G2 change metadata. Community thread is hidden; Git authorizes repository access. PostgreSQL bigint numbers may be decimal strings.

## Fields

| Field | Type | Required | Description | Constraints |
| --- | --- | --- | --- | --- |
| `id` | string | yes |  | - `pattern ^chg_[0-9A-HJKMNP-TV-Z]{26}$` |
| `number` | integer \| string | yes |  | - `pattern ^[1-9][0-9]*$`<br>- `minimum 1` |
| `repo_id` | string | yes |  |  |
| `title` | string | yes |  | - `minLength 1`<br>- `maxLength 200` |
| `body` | string | yes |  | - `maxLength 10000` |
| `author` | string | yes |  |  |
| `state` | enum | yes |  | - `one of "open", "closed", "merged"` |
| `thread_id` | string \| null | yes |  |  |
| `created_at` | string | yes |  | - `format date-time` |
| `closed_at` | string \| null | yes |  | - `format date-time` |
| `source_repo_id` | string | yes |  |  |
| `base_ref` | string | yes |  | - `minLength 1`<br>- `maxLength 255` |
| `head_ref` | string | yes |  | - `minLength 1`<br>- `maxLength 255` |
| `head_sha` | string | yes |  | - `pattern ^[a-f0-9]{40,64}$` |
| `merge_sha` | string \| null | yes |  | - `pattern ^[a-f0-9]{40,64}$` |
| `branch_deleted_at` | string \| null | yes |  | - `format date-time` |
| `diff_base_sha` | string \| null | yes |  | - `pattern ^[a-f0-9]{40,64}$` |

## Examples

From the contract's own test fixtures: valid ones validate, rejected ones must fail.

 Valid: open

~~~~
{
  "id": "chg_00000000000000000000000000",
  "number": 1,
  "repo_id": "repo_00000000000000000000000000",
  "title": "Review a change",
  "body": "Details",
  "author": "usr_00000000000000000000000000",
  "state": "open",
  "thread_id": null,
  "created_at": "2026-11-09T12:00:00Z",
  "closed_at": null,
  "source_repo_id": "repo_00000000000000000000000000",
  "base_ref": "main",
  "head_ref": "agent/demo",
  "head_sha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "merge_sha": null,
  "branch_deleted_at": null,
  "diff_base_sha": null
}
~~~~

Rejected: state

~~~~
{
  "id": "chg_00000000000000000000000000",
  "number": 1,
  "repo_id": "repo_00000000000000000000000000",
  "title": "Review a change",
  "body": "Details",
  "author": "usr_00000000000000000000000000",
  "state": "unknown",
  "thread_id": null,
  "created_at": "2026-11-09T12:00:00Z",
  "closed_at": null,
  "source_repo_id": "repo_00000000000000000000000000",
  "base_ref": "main",
  "head_ref": "agent/demo",
  "head_sha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "merge_sha": null,
  "branch_deleted_at": null,
  "diff_base_sha": null
}
~~~~

## Validate

~~~~
const contracts = require('openvibe-contracts');
contracts.validate('git.change@1', value);   // { valid, errors: [{ path, message }] }
~~~~
