GitChange git.change@1

Generated at from openvibe-contracts v0.419.0 and openvibe-sdk v0.161.0.

Version
1.0.0
Owner
git
Visibility
public
Status
active
Compatibility
backward
Schema
https://openvibe.network/contracts/git/change.v1.json

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

Fields

FieldTypeRequiredDescriptionConstraints
idstringyes
  • pattern ^chg_[0-9A-HJKMNP-TV-Z]{26}$
numberinteger | stringyes
  • pattern ^[1-9][0-9]*$
  • minimum 1
repo_idstringyes
titlestringyes
  • minLength 1
  • maxLength 200
bodystringyes
  • maxLength 10000
authorstringyes
stateenumyes
  • one of "open", "closed", "merged"
thread_idstring | nullyes
created_atstringyes
  • format date-time
closed_atstring | nullyes
  • format date-time
source_repo_idstringyes
base_refstringyes
  • minLength 1
  • maxLength 255
head_refstringyes
  • minLength 1
  • maxLength 255
head_shastringyes
  • pattern ^[a-f0-9]{40,64}$
merge_shastring | nullyes
  • pattern ^[a-f0-9]{40,64}$
branch_deleted_atstring | nullyes
  • format date-time
diff_base_shastring | nullyes
  • 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 }] }