Binary DB v0: Git Interoperability Records
Expand the optional Git repository, generation, identity, commit, file, ref, Tag, and checkpoint mapping layouts.
Audience: Git interoperability implementers
Git records form an optional import/export mapping authority around AIT content; they do not replace primary workflow or content authority. The layouts retain exact source bytes where specified and fail closed on unsupported object or identity representations.
Local Git Import/Export Records#
Git interoperability is an optional local escape-hatch authority. Its fixed records preserve the landed git-identity-map/v1 and git-interop-checkpoint/v1 semantics without making Git the primary AIT authority. Every Git Object ID field in v0 is exactly 20 raw SHA-1 bytes. Another Git object format fails before any AIT or Git ref mutation; a writer must not widen these fields under layout_id = 1.
GIT_REPOSITORY_RECORD_SIZE = 28
GitRepositoryRecord — git_repository.bin:
u8 repository_meta
u8 object_format_kind
u16 reserved0
u32 identity_len
u64 identity_offset
u8 fingerprint96[12]fingerprint96 stores the 24 hexadecimal digits of the current GSR-*, GTR-*, or ASR-* repository fingerprint as 12 raw bytes. The prefix is reconstructed from repository_meta. The typed identity payload stores the same canonical source identity, target path, or AIT repository identity used to calculate that fingerprint.
GIT_GENERATION_RECORD_SIZE = 20
GitGenerationRecord — git_generation.bin:
u8 generation_meta
u8 reserved0
u16 reserved1
u32 source_repository_index
u32 target_repository_index_plus1
u8 generation_hash64[8]generation_hash64 stores the 16 hexadecimal digits of GIT-IMP-* or GIT-EXP-* as eight raw bytes. Import has one Git source repository and no stored target repository. Export has an AIT source repository and one Git target repository. A generation is immutable; it groups mappings created from one import source state or one deterministic export plan. This content generation is not a Binary DB transaction or activation generation.
GIT_IDENTITY_RECORD_SIZE = 24
GitIdentityRecord — git_identity.bin:
u8 identity_meta
u8 reserved0
i16 timezone_offset_minutes
u32 payload_len
u64 payload_offset
i64 timestamp_sAn identity record preserves the current raw, name, email, timestamp, and timezone fields. timestamp_s is the signed Git identity timestamp; timezone_offset_minutes is its parsed numeric offset. The raw identity bytes remain available for lossless imported-object evidence.
GIT_COMMIT_MAPPING_RECORD_SIZE = 96
GitCommitMappingRecord — git_commit_mapping.bin:
u8 mapping_meta
u8 reserved0
u16 parent_count
u32 generation_index
u32 snapshot_index
u32 author_identity_index
u32 committer_identity_index
u32 first_parent_mapping_index_plus1
u32 first_file_mapping_index_plus1
u32 file_count
u32 payload_len
u64 payload_offset
u8 git_object_id[20]
u8 git_tree_object_id[20]
u32 lfs_pointer_count
u64 created_at_sThe referenced Snapshot supplies the AIT root Tree locator and textual Snapshot identity; neither is duplicated here. parent_count is bounded by the Snapshot limit of 1,024. Parent and file mapping ranges are contiguous; their first_*_index_plus1 field is zero exactly when the corresponding count is zero. Commit mapping records are immutable and append-only.
GIT_COMMIT_PARENT_RECORD_SIZE = 28
GitCommitParentRecord — git_commit_parent.bin:
u32 commit_mapping_index
u32 snapshot_parent_edge_index
u8 parent_git_object_id[20]The referenced Snapshot parent edge owns parent_ordinal and the AIT parent Snapshot index. It must name the same child as the owning commit mapping's snapshot_index. Parent mapping range order must equal edge ordinal order, so Git commit parent order and Snapshot DAG order cannot diverge.
GIT_FILE_MAPPING_RECORD_SIZE = 52
GitFileMappingRecord — git_file_mapping.bin:
u8 git_object_type_kind
u8 reserved0
u16 reserved1
u32 commit_mapping_index
u32 entry_ordinal
u32 tree_entry_index
u32 git_mode
u32 path_len
u64 path_offset
u8 git_object_id[20]The Tree entry owns the AIT mode, target Tree/Blob index, and content identity; those values are not duplicated. git_mode, the Git object type and Object ID, and the exact Git path bytes preserve the Git-side tree mapping. Entry ordinals are contiguous inside one commit mapping range.
GIT_REF_MAPPING_RECORD_SIZE = 80
GitRefMappingRecord — git_ref_mapping.bin:
u8 ref_meta
u8 git_object_type_kind
u16 reserved0
u32 generation_index
u32 snapshot_index_plus1
u32 target_index_plus1
u32 symbolic_target_ref_mapping_index_plus1
u32 ref_name_len
u64 ref_name_offset
u8 git_object_id[20]
u8 expected_previous_git_object_id[20]
u64 created_at_sBranch mappings use target_index_plus1 as a numeric line_index + 1; Tag mappings use it as tag_index + 1. They never store AIT Line ID, Line name, Tag name, ait_kind, ait_name, or ait_identity. A symbolic HEAD record references the mapped target ref record numerically instead of duplicating a Line name. expected_previous_git_object_id is meaningful only when its meta bit is set and records export compare-and-swap evidence; otherwise all 20 bytes are zero.
GIT_TAG_MAPPING_RECORD_SIZE = 48
GitTagMappingRecord — git_tag_mapping.bin:
u8 tag_mapping_meta
u8 reserved0
u16 reserved1
u32 git_ref_mapping_index
u32 payload_len
u64 payload_offset
u8 peeled_commit_git_object_id[20]
u64 created_at_sThe referenced Git ref mapping supplies the Git ref name, Git object ID/type, Snapshot index, and numeric AIT Tag index. A lightweight Tag has Git object type commit and empty raw Tag bytes. An annotated Tag has object type tag and preserves its message and complete raw Tag object in the typed payload.
GIT_OPERATION_CHECKPOINT_RECORD_SIZE = 44
GitOperationCheckpointRecord — git_operation_checkpoint.bin:
u8 checkpoint_meta
u8 reserved0
u16 reserved1
u32 generation_index
u8 operation_hash64[8]
u8 plan_hash96[12]
u32 next_commit_index
u32 next_ref_index
u64 updated_at_soperation_hash64 stores the 16 hexadecimal digits of GIO-IMPORT-* or GIO-EXPORT-*; plan_hash96 stores the 24 hexadecimal digits of GIP-* or GEP-*. The two next indexes are resumable plan cursors. The checkpoint is updated in place with checkpoint_meta written last as the state commit marker. A completed operation result is deterministically rebuilt from its generation and immutable mapping rows; no opaque result JSON is authoritative.
Mapping contract, textual record_id, textual AIT IDs, Base64 wrappers, and the duplicated JSON arrays parent_*_ids and file_modes are not stored. Public GIM-* record identity remains derived by the landed git-identity-map/v1 logical canonicalization, excluding created_at and the record ID itself. Commit, ref, and Tag mapping physical ordinals are their exact append order; no AIT-generated subsecond ordering timestamp is persisted. The signed GitIdentityRecord.timestamp_s and timezone are retained separately because they are exact Git identity data. identity_source, published_remote_name, and a new planning-state field are not part of Git interop. Git import fabricates no Task or policy lineage; the existing TaskRecord.task_meta planned bit remains the complete binary planning state.