Binary DB v0:Git 互操作記錄
展開可選的 Git 儲存庫、generation、身份、commit、檔案、ref、Tag 與 checkpoint 對映佈局。
適用對象: Git 互操作實作者
Git 記錄在 AIT 內容之外構成一個可選的匯入/匯出對映權威;它們不取代主工作流程權威或內容權威。這些 layout 在指定之處保留確切的源位元組,遇到不支援的物件或身份表示時失敗拒絕。
本地 Git 匯入/匯出記錄#
Git 互操作是一個可選的本地逃生艙權威。它的定長記錄保留已 land 的 git-identity-map/v1 與 git-interop-checkpoint/v1 語義,同時不讓 Git 成為 AIT 的主權威。v0 中每個 Git Object ID 欄位都恰好是 20 個原始 SHA-1 位元組。 其他 Git 物件格式會在任何 AIT 或 Git ref 變更之前失敗;在 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 以 12 個原始位元組存放目前 GSR-*、GTR-* 或 ASR-* 儲存庫指紋 的 24 位十六進位制數字。字首由 repository_meta 重建。帶型別的 identity payload 存放用於計算該指紋的同一個規範源身份、目標路徑或 AIT 儲存庫身份。
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 以八個原始位元組存放 GIT-IMP-* 或 GIT-EXP-* 的 16 位 十六進位制數字。匯入有一個 Git 源儲存庫,且不儲存目標儲存庫。匯出有一個 AIT 源儲存庫 和一個 Git 目標儲存庫。generation 不可變;它把由同一份匯入源狀態、或同一份 確定性匯出計劃所產生的對映歸為一組。這個內容 generation 不是 Binary DB 的 事務 generation 或啟用 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_sidentity 記錄保留目前的 raw、name、email、timestamp 和 timezone 欄位。timestamp_s 是有符號的 Git identity 時間戳;timezone_offset_minutes 是解析出的數值偏移。原始 identity 位元組仍然可用,作為無損的匯入物件證據。
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_s被引用的 Snapshot 提供 AIT 根 Tree 定位符和文字形式的 Snapshot 身份;兩者都不 在此處重複存放。parent_count 受 Snapshot 的 1,024 上限約束。parent 與 file 的對映區間是連續的;當且僅當對應的計數為零時,它們的 first_*_index_plus1 欄位才為零。commit 對映記錄不可變,且只追加。
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]被引用的 Snapshot parent edge 擁有 parent_ordinal 和 AIT 的父 Snapshot 索引。 它指向的子節點必須與所屬 commit 對映的 snapshot_index 相同。parent 對映區間 的順序必須等於 edge 的 ordinal 順序,因此 Git commit 的父順序與 Snapshot DAG 的順序不會分歧。
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]Tree entry 擁有 AIT mode、目標 Tree/Blob 索引和內容身份;這些值不重複存放。 git_mode、Git 物件型別與 Object ID,以及確切的 Git 路徑位元組,保留了 Git 一側 的 tree 對映。entry ordinal 在同一個 commit 對映區間內是連續的。
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 對映把 target_index_plus1 用作數值 line_index + 1;Tag 對映把它用作 tag_index + 1。它們絕不存放 AIT Line ID、Line 名稱、Tag 名稱、ait_kind、 ait_name 或 ait_identity。符號式 HEAD 記錄以數值方式引用被對映的目標 ref 記錄,而不是重複存一個 Line 名稱。只有當 expected_previous_git_object_id 的 meta 位置位時它才有意義,此時它記錄匯出的 compare-and-swap 證據;否則全部 20 位元組為零。
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_s被引用的 Git ref 對映提供 Git ref 名稱、Git 物件 ID/型別、Snapshot 索引和數值 形式的 AIT Tag 索引。輕量 Tag 的 Git 物件型別是 commit,原始 Tag 位元組為空。 附註 Tag 的物件型別是 tag,並在帶型別的 payload 中保留它的訊息和完整的原始 Tag 物件。
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 存放 GIO-IMPORT-* 或 GIO-EXPORT-* 的 16 位十六進位制 數字;plan_hash96 存放 GIP-* 或 GEP-* 的 24 位十六進位制數字。兩個 next 索引是可續跑的計劃遊標。checkpoint 就地更新,checkpoint_meta 最後寫入,作為 狀態提交標記。已完成的操作結果由它的 generation 和不可變對映行確定性地重建; 沒有任何不透明的結果 JSON 具有權威性。
對映的 contract、文字 record_id、文字形式的 AIT ID、Base64 包裝,以及重複 的 JSON 陣列 parent_*_ids 和 file_modes 都不儲存。公開的 GIM-* 記錄身份 仍由已 land 的 git-identity-map/v1 邏輯規範化推導,排除 created_at 和記錄 ID 本身。commit、ref 和 Tag 對映的物理 ordinal 就是它們確切的追加順序;不持久 化任何由 AIT 生成的亞秒級排序時間戳。有符號的 GitIdentityRecord.timestamp_s 和時區單獨保留,因為它們是確切的 Git identity 資料。identity_source、 published_remote_name 以及新增的 planning-state 欄位都不屬於 Git 互操作。 Git 匯入不會偽造任何 Task 或策略沿革;現有的 TaskRecord.task_meta planned 位 仍然是完整的二進位 planning 狀態。