Git 底座(gateway/guard/autocommit/session-ref)
Git 底座(gateway/guard/autocommit/session-ref) partial 底座
复合态:核心链路 live,07-19 新增两条残差;trace 对 git 链覆盖是全系统最弱一环(有非结构化日志、无结构化台账)
职责:每 turn 改动最终被捕获、绝不失败 session、绝不碰 HEAD/main;session 隔离走 git ref+index 不建物理 worktree
策展 as-of 2026-07-19 · 状态真源 data/systems_status.mjs(人工策展,机器测不出 live/partial)
证据锚
rules/git_safety.md· 2026-07-19contexts/survey_sessions/trace_base_tooling_state_audit_20260719_manual.md· 2026-07-19adhoc_jobs/context_infra_migration_20260709/design/OPEN_PROBLEMS.md· 2026-07-19
未决项(4)
- GIT-2 三处危险操作清单平行手工同步风险,未收敛为工具化方案
- GIT-3 共享 checkout 缺 sanctioned 干净基线配方
- HL-2 第二层全兜底(commit_wrapper 自杀式 deadline)OPEN
- T3923 settings.json synthetic staging 失败 + T3924 STATE.md 自身 git rm --cached 分叉态
进出边(消费链登记)
→ ⊘(missing:stop_hook 583 失败无台账);← 新根 ~/infra 迁移(r006→r012)(degraded:波次1未启动,依赖旧根)
结构图(4 张 · 快照)
一、设计架构图(36 节点 / 30 边,按 territory 分组)设计图 · git_tooling · 块 1
flowchart TD subgraph tCommit_group["提交管道"] du_stop_hook_commit["du-stop-hook-commit<br/>CC Stop hook 自动提交"] du_codex_rescue["du-codex-rescue<br/>Codex 侧兜底提交"] du_cron_fallback["du-cron-fallback<br/>cron 定期兜底"] du_commit_gateway["du-commit-gateway<br/>单一写网关 commit_wrapper"] du_artifacts_capture["du-artifacts-capture<br/>生成物自动捕获"] du_runtime_commit_completeness["du-runtime-commit-completeness<br/>运行态入库"] end subgraph tSession_group["会话问责"] du_session_ref["du-session-ref<br/>session 提交 reference 区分"] du_accountability_query["du-accountability-query<br/>问责反查注入面"] du_session_owner_anchor["du-session-owner-anchor<br/>归属不被并发覆盖"] du_no_worktree["du-no-worktree<br/>弃 worktree 立场"] end subgraph tMerge_group["合并仲裁"] du_merge_accountability["du-merge-accountability<br/>merge 问责制"] du_llm_arbitration["du-llm-arbitration<br/>LLM 仲裁引擎"] end subgraph tSafety_group["写安全"] du_git_guard["du-git-guard<br/>写保护 guard"] du_safety_policy["du-safety-policy<br/>安全总纲"] du_release_boundary["du-release-boundary<br/>发布边界闸"] end subgraph tHygiene_group["仓库卫生"] du_lock_watchdog["du-lock-watchdog<br/>陈旧 lock 常驻检测"] du_repo_hygiene["du-repo-hygiene<br/>仓库环境清理防复发"] du_auto_gc["du-auto-gc<br/>auto-gc 畅通"] du_conflict_throttle["du-conflict-throttle<br/>互抢停摆防护"] du_stability_refactor["du-stability-refactor<br/>工具重构稳定支持"] end subgraph tDiag_group["诊断核查"] du_commit_count_explain["du-commit-count-explain<br/>提交数量可解释"] du_health_probe["du-health-probe<br/>运行核查面"] du_cron_smoke["du-cron-smoke<br/>cron 环境 smoke"] du_bin_paths["du-bin-paths<br/>外部二进制路径注册表"] du_daily_digest["du-daily-digest<br/>Daily Digest"] du_receipts_schema["du-receipts-schema<br/>receipts 台账 schema 纯净"] end subgraph tRelease_group["远端发布"] du_remote_push["du-remote-push<br/>远端 push 通道"] du_version_tagging["du-version-tagging<br/>tag 自动化闭环"] end subgraph tRecovery_group["恢复兜底"] du_rescue_tooling["du-rescue-tooling<br/>rescue 补跑正式工具"] du_session_recovery["du-session-recovery<br/>session 突发关闭恢复"] du_reconcile["du-reconcile<br/>main index reconcile"] du_sandbox_defer["du-sandbox-defer<br/>沙箱暂缓立场"] du_fallback_recovery["du-fallback-recovery<br/>偶发故障备用恢复路径"] end subgraph tDocs_group["文档政策"] du_safety_doc["du-safety-doc<br/>git_safety 文档新鲜"] du_readme_doc["du-readme-doc<br/>版本控制 README 更新"] du_docs_consolidation["du-docs-consolidation<br/>工具目录与文档唯一性"] end %% ---- 设计承诺边(30 条)---- du_stop_hook_commit -->|经网关提交| du_commit_gateway du_codex_rescue -->|经网关提交| du_commit_gateway du_cron_fallback -->|经网关提交| du_commit_gateway du_commit_gateway -->|写入 refs 命名空间| du_session_ref du_session_owner_anchor -->|决定提交归属| du_session_ref du_session_ref -->|问责判断输入| du_merge_accountability du_merge_accountability -->|综合判断调用| du_llm_arbitration du_session_ref -->|反查基础| du_accountability_query du_git_guard -->|拦截强制走网关| du_commit_gateway du_safety_policy -->|禁令由 guard 执行| du_git_guard du_safety_policy -->|禁令由边界闸执行| du_release_boundary du_lock_watchdog -->|清锁保网关不死锁| du_commit_gateway du_artifacts_capture -->|捕获物经网关入库| du_commit_gateway du_rescue_tooling -->|重建/修复| du_session_ref du_session_recovery -->|恢复后重新对齐| du_reconcile du_reconcile -->|一致性为提交前提| du_commit_gateway du_cron_smoke -.->|部署前验证环境差异| du_cron_fallback du_bin_paths -.->|路径来自集中注册表| du_cron_fallback du_bin_paths -.->|路径来自集中注册表| du_codex_rescue du_conflict_throttle -->|互抢时暂停/重编排| du_cron_fallback du_release_boundary -->|打 tag 受五问约束| du_version_tagging du_safety_policy -->|落到文档并保持新鲜| du_safety_doc du_no_worktree -.->|隔离改用 ref+index 层| du_session_ref du_health_probe -->|验收提交链完成度| du_commit_gateway du_commit_count_explain -.->|按 ref 命名空间解释| du_session_ref du_fallback_recovery -->|具体化:补跑路径| du_rescue_tooling du_fallback_recovery -->|具体化:恢复机制| du_session_recovery du_runtime_commit_completeness -->|运行态变更入 HEAD| du_commit_gateway du_receipts_schema -.->|服务可信记账| du_artifacts_capture du_repo_hygiene -.->|共用不复发目标| du_session_recovery %% ---- classDef:按 territory 的结构色(不表状态)---- classDef tCommit fill:#dbeafe,stroke:#1d4ed8,stroke-width:1.5px,color:#1e3a8a; classDef tSession fill:#dcfce7,stroke:#15803d,stroke-width:1.5px,color:#14532d; classDef tMerge fill:#fef9c3,stroke:#a16207,stroke-width:1.5px,color:#713f12; classDef tSafety fill:#fee2e2,stroke:#b91c1c,stroke-width:1.5px,color:#7f1d1d; classDef tHygiene fill:#ede9fe,stroke:#6d28d9,stroke-width:1.5px,color:#4c1d95; classDef tDiag fill:#e0f2fe,stroke:#0369a1,stroke-width:1.5px,color:#0c4a6e; classDef tRelease fill:#fae8ff,stroke:#a21caf,stroke-width:1.5px,color:#701a75; classDef tRecovery fill:#ffedd5,stroke:#c2410c,stroke-width:1.5px,color:#7c2d12; classDef tDocs fill:#f1f5f9,stroke:#475569,stroke-width:1.5px,color:#1e293b; class du_stop_hook_commit,du_codex_rescue,du_cron_fallback,du_commit_gateway,du_artifacts_capture,du_runtime_commit_completeness tCommit; class du_session_ref,du_accountability_query,du_session_owner_anchor,du_no_worktree tSession; class du_merge_accountability,du_llm_arbitration tMerge; class du_git_guard,du_safety_policy,du_release_boundary tSafety; class du_lock_watchdog,du_repo_hygiene,du_auto_gc,du_conflict_throttle,du_stability_refactor tHygiene; class du_commit_count_explain,du_health_probe,du_cron_smoke,du_bin_paths,du_daily_digest,du_receipts_schema tDiag; class du_remote_push,du_version_tagging tRelease; class du_rescue_tooling,du_session_recovery,du_reconcile,du_sandbox_defer,du_fallback_recovery tRecovery; class du_safety_doc,du_readme_doc,du_docs_consolidation tDocs; subgraph legend["图例(territory 结构色,不表状态)"] direction LR legend_tCommit["提交管道"] legend_tSession["会话问责"] legend_tMerge["合并仲裁"] legend_tSafety["写安全"] legend_tHygiene["仓库卫生"] legend_tDiag["诊断核查"] legend_tRelease["远端发布"] legend_tRecovery["恢复兜底"] legend_tDocs["文档政策"] end class legend_tCommit tCommit; class legend_tSession tSession; class legend_tMerge tMerge; class legend_tSafety tSafety; class legend_tHygiene tHygiene; class legend_tDiag tDiag; class legend_tRelease tRelease; class legend_tRecovery tRecovery; class legend_tDocs tDocs;
真源 adhoc_jobs/context_infra_base_tooling_STATE_20260709/domains/git_tooling/bundle_r_git_tooling_20260713/diagrams/design_diagrams.md · bundle 20260713 · 结构图快照,非实时
图例实现图 · git_tooling · 块 1
flowchart LR
subgraph LEGEND["图例(颜色=verdict 状态 / 线型=边关系)"]
direction LR
lg1["landed 已落地(行为+消费者)"]:::landed
lg2["partial 部分实现(缺行为或缺消费)"]:::partial
lg3["orphan(exists) 功能全无消费/未验证"]:::orphan
lg4["drift 承诺与实况矛盾"]:::drift
end
classDef landed fill:#d4edda,stroke:#28a745,color:#155724;
classDef partial fill:#fff3cd,stroke:#d39e00,color:#856404;
classDef orphan fill:#e2e3e5,stroke:#6c757d,color:#41464b,stroke-dasharray:3 3;
classDef drift fill:#ffe5d0,stroke:#fd7e14,stroke-width:2px,color:#7a3d00,stroke-dasharray:5 3;
classDef dnb fill:#f8d7da,stroke:#c00,color:#721c24,stroke-dasharray:5 3;
classDef mixed fill:#cfe2ff,stroke:#0d6efd,color:#084298;
真源 adhoc_jobs/context_infra_base_tooling_STATE_20260709/domains/git_tooling/bundle_r_git_tooling_20260713/diagrams/impl_diagrams.md · bundle 20260713 · 结构图快照,非实时
实现架构图(63 节点 / 35 边 / 11 territory 分组)实现图 · git_tooling · 块 2
flowchart TB
subgraph TG_SUBMIT["提交管道 submission-pipeline"]
C1["C1 commit_wrapper.sh"]:::landed
C14["C14 preflight_baseline.py"]:::landed
C32["C32 todo_exec.sh"]:::landed
C40["C40 codex_rescue.py E"]:::orphan
C41["C41 codex_rescue_cron.sh"]:::drift
C57["C57 COMMIT_PIPELINE.md"]:::landed
end
subgraph TG_CCHOOK["CC hook(settings.json 挂载)"]
C2["C2 stop_hook.sh"]:::landed
C3["C3 session_start_hook.sh"]:::landed
C4["C4 session_end_reap.sh"]:::landed
C5["C5 posttooluse_stage.sh 缺C"]:::partial
C6["C6 git_guard.sh"]:::landed
end
subgraph TG_GITHOOK["git 原生 hook(.git/hooks)"]
C7["C7 prepare-commit-msg"]:::landed
C8["C8 pre-commit"]:::landed
C9["C9 post-commit"]:::landed
end
subgraph TG_SESSION["会话问责 session-accountability"]
C10["C10 session_liveness.py"]:::landed
C11["C11 session_journal.py"]:::landed
C12["C12 session_snapshot.py 缺C"]:::partial
C13["C13 shadow_gate.py E"]:::orphan
C33["C33 claude_launcher.sh"]:::landed
C34["C34 session_wrap.sh"]:::landed
end
subgraph TG_MERGE["合并仲裁 merge-arbitration"]
C15["C15 session_tasks.py"]:::landed
C16["C16 accountability_merge.py"]:::landed
C17["C17 accountability_journal.py"]:::landed
C18["C18 merge_conflict_router.py"]:::landed
C19["C19 merge_daemon.sh"]:::partial
C20["C20 session_merge.sh"]:::landed
C21["C21 cron_merge.sh"]:::landed
C22["C22 periodic_merge.sh 缺C"]:::partial
C23["C23 snapshot_merge.sh"]:::landed
C24["C24 daily_run.py(仲裁)"]:::landed
C36["C36 todo_merge_driver.py"]:::drift
C49["C49 lib/pending_merges.sh"]:::landed
end
subgraph TG_HYGIENE["仓库卫生 repo-hygiene"]
C25["C25 lock_watchdog.py"]:::landed
C48["C48 pending_merges.py"]:::landed
C56["C56 MAINTENANCE_POLICY.md"]:::landed
end
subgraph TG_RECOVERY["恢复兜底 recovery-fallback"]
C26["C26 orphan_session_index_reaper.py"]:::landed
C27["C27 session_env_sweep.sh 缺C"]:::partial
C28["C28 worktree_cleaner.sh"]:::landed
C29["C29 worktree_mgr.sh"]:::landed
C30["C30 task_mgr.sh E"]:::orphan
C31["C31 task_fork.sh"]:::landed
C37["C37 backfill_window.py"]:::landed
C38["C38 main_index_reconcile.sh 缺C"]:::partial
C39["C39 rescue_by_session.py E"]:::orphan
C59["C59 CRON_WORKTREE_SYNC.md E"]:::orphan
end
subgraph TG_DIAG["诊断核查 diagnostics"]
C42["C42 git_health_probe.py"]:::landed
C43["C43 diagnose.sh"]:::landed
C45["C45 find/history/overlap族 E"]:::orphan
C50["C50 buildlog_coverage_check.py 缺C"]:::partial
C55["C55 BUG_TRACKER.md"]:::landed
C58["C58 TROUBLESHOOTING.md E"]:::orphan
C63["C63 bin_paths.sh"]:::landed
C64["C64 CRONTAB.md"]:::landed
end
subgraph TG_WRITESAFE["写安全 write-safety"]
C44["C44 release_boundary_check.py"]:::landed
C46["C46 pin/rollback/safe_op族 E"]:::orphan
C61["C61 allowed_repos.conf"]:::landed
end
subgraph TG_RELEASE["远端发布 remote-release"]
C47["C47 version_manager_cron.py 缺C"]:::partial
end
subgraph TG_DOCS["文档政策 docs-policy"]
C51["C51 git_safety.md"]:::landed
C52["C52 AGENT_GUIDE.md"]:::landed
C53["C53 DOCS_MAP.md"]:::landed
C54["C54 README.md E"]:::orphan
C60["C60 STATUS.md"]:::drift
C62["C62 version_history/ E"]:::orphan
end
%% impl_edges(IMPL_FACTS §4,35 条;C36→— drift 占位行不画边)
C2 -->|"calls"| C1
C2 -->|"calls"| C11
C2 -->|"calls"| C12
C2 -->|"imports"| C63
C2 -.->|"file_pointer_consumption"| C61
C1 -->|"imports"| C63
C1 -->|"calls"| C14
C1 -->|"calls"| C8
C6 -.->|"file_pointer_consumption"| C1
C21 -->|"calls"| C1
C22 -->|"calls"| C1
C20 -->|"calls"| C1
C23 -->|"calls"| C1
C31 -->|"calls"| C1
C32 -->|"calls"| C1
C19 -->|"calls"| C10
C7 -->|"calls"| C10
C19 -->|"calls"| C20
C20 -->|"calls"| C16
C16 -->|"calls"| C15
C16 -->|"calls"| C17
C16 -->|"calls"| C18
C20 -->|"imports"| C49
C42 -->|"imports"| C48
C44 -->|"imports"| C42
C43 -->|"calls"| C42
C42 -.->|"file_pointer_consumption"| C55
C33 -->|"imports"| C63
C34 -->|"calls"| C33
C34 -->|"imports"| C63
C29 -->|"imports"| C63
C28 -->|"imports"| C63
C43 -->|"imports"| C63
C30 -->|"calls"| C23
C19 -->|"calls"| C23
classDef landed fill:#d4edda,stroke:#28a745,color:#155724;
classDef partial fill:#fff3cd,stroke:#d39e00,color:#856404;
classDef orphan fill:#e2e3e5,stroke:#6c757d,color:#41464b,stroke-dasharray:3 3;
classDef drift fill:#ffe5d0,stroke:#fd7e14,stroke-width:2px,color:#7a3d00,stroke-dasharray:5 3;
classDef dnb fill:#f8d7da,stroke:#c00,color:#721c24,stroke-dasharray:5 3;
classDef mixed fill:#cfe2ff,stroke:#0d6efd,color:#084298;
真源 adhoc_jobs/context_infra_base_tooling_STATE_20260709/domains/git_tooling/bundle_r_git_tooling_20260713/diagrams/impl_diagrams.md · bundle 20260713 · 结构图快照,非实时
一、差距图(本图仅含 gap 涉及的 du/comp 子集)差距图 · git_tooling · 块 1
flowchart TD
subgraph GAP_DNB["dnb(GAP-01)"]
du_artifacts_capture["du-artifacts-capture"]:::dnb
C5["C5 posttooluse_stage.sh 缺C"]:::dnb
end
subgraph GAP_DRIFT["drift(GAP-02/03/04)"]
du_conflict_throttle["du-conflict-throttle"]:::drift
throttle_adhoc["断路器脚本(adhoc事故目录)"]:::drift
du_merge_accountability["du-merge-accountability"]:::drift
C36["C36 todo_merge_driver.py"]:::drift
du_docs_consolidation["du-docs-consolidation"]:::drift
C60["C60 STATUS.md"]:::drift
end
subgraph GAP_ORPHAN["orphan(GAP-05/06)"]
du_session_recovery["du-session-recovery"]:::orphan
C27["C27 session_env_sweep.sh E"]:::orphan
orphan_null_C36["null(无du溯源)"]:::orphan
end
subgraph GAP_FNL["FNL-01..06"]
du_codex_rescue["du-codex-rescue"]:::partial
C40["C40 codex_rescue.py F"]:::partial
C41["C41 codex_rescue_cron.sh F"]:::partial
du_reconcile["du-reconcile"]:::partial
C38["C38 main_index_reconcile.sh F"]:::partial
du_version_tagging["du-version-tagging"]:::partial
C47["C47 version_manager_cron.py F"]:::partial
du_cron_fallback["du-cron-fallback"]:::partial
C22["C22 periodic_merge.sh F"]:::partial
du_stability_refactor["du-stability-refactor"]:::partial
C13["C13 shadow_gate.py F"]:::partial
du_remote_push["du-remote-push"]:::partial
C64["C64 CRONTAB.md F"]:::partial
end
subgraph GAP_BUILT_REF["built 对照"]
du_commit_gateway["du-commit-gateway"]:::landed
C1["C1 commit_wrapper.sh"]:::landed
end
%% ---- gap 边(来自 join_table,pair_status ∈ {dnb, drift, orphan, partial})----
du_artifacts_capture -.->|"挂载边从未接上,hooks空数组"| C5
du_conflict_throttle -.->|"缓解层降级挣扎,986次超时(点内读数)"| throttle_adhoc
du_merge_accountability -.->|"声明与git config不一致,未注册"| C36
du_docs_consolidation -.->|"L1快照层过时,80天未更新"| C60
du_session_recovery -.->|"设计有位置,实现游离调度外"| C27
orphan_null_C36 -.->|"零程序化消费者(orphan视角)"| C36
du_codex_rescue -.->|"cron两行DISABLED/PAUSED"| C40
du_codex_rescue -.->|"曾装又撤"| C41
du_reconcile -.->|"两行PAUSED未恢复"| C38
du_version_tagging -.->|"就绪未装,待用户门"| C47
du_cron_fallback -.->|"wechat模板行PAUSED"| C22
du_stability_refactor -.->|"v2引擎NO-GO未达标准"| C13
du_remote_push -.->|"55天未推,长期无动作"| C64
%% ---- built 对照边(正常实线,供视觉参照;REQ-28/UP-53 落点,本 run 重验 landed)----
du_commit_gateway -->|"经网关提交(--paths path-scoped)"| C1
%% ---- 六 classDef(照抄 GAP_STATS/impl_diagrams 六色 hex,CHK-9b 核)----
classDef landed fill:#d4edda,stroke:#28a745,color:#155724;
classDef partial fill:#fff3cd,stroke:#d39e00,color:#856404;
classDef orphan fill:#e2e3e5,stroke:#6c757d,color:#41464b,stroke-dasharray:3 3;
classDef drift fill:#ffe5d0,stroke:#fd7e14,stroke-width:2px,color:#7a3d00,stroke-dasharray:5 3;
classDef dnb fill:#f8d7da,stroke:#c00,color:#721c24,stroke-dasharray:5 3;
classDef mixed fill:#cfe2ff,stroke:#0d6efd,color:#084298;
%% ---- salience 强调(top_by_meaning:REQ-21/REQ-08/REQ-20 下钻首选,粗边框标注)----
style throttle_adhoc stroke-width:4px
style du_merge_accountability stroke-width:4px
style du_artifacts_capture stroke-width:4px
subgraph legend["图例"]
direction LR
legend_dnb["dnb=红虚,设计边从未接上"]:::dnb
legend_drift["drift=橙虚,声明与实况不一致"]:::drift
legend_orphan["灰虚 = 未证活性(E)<br/>或 无属主(孤儿)"]:::orphan
legend_partial["F=functional-not-landed<br/>P+B hold,miss C"]:::partial
legend_landed["landed=绿,built对照"]:::landed
legend_salience["粗边框=下钻首选"]
end
class legend_dnb dnb;
class legend_drift drift;
class legend_orphan orphan;
class legend_partial partial;
class legend_landed landed;
真源 adhoc_jobs/context_infra_base_tooling_STATE_20260709/domains/git_tooling/bundle_r_git_tooling_20260713/diagrams/gap_diagrams.md · bundle 20260713 · 结构图快照,非实时
图源为仓内 bundle mermaid 逐字提取(仅隐私清洗),渲染失败时原样退化为代码块。结构图是绘制时点的快照,非实时状态。