feat BREAKING GSW-FIX-b feat/gsw-fix-governance-sync-write-path #2 / 3
aaronrene · 34 days ago · Jul 31, 2026 · Diff

feat(GSW-FIX-b): governance-sync write-path order + dual-HEAD rollback (BV pass GSW-BV-r1)

Built exactly to frozen docs/PHASE-GSW-FIX-GOVERNANCE-SYNC-WRITE-PATH.md (GSW-r3): - _apply_plan: capture → realign (original branch) → dual-HEAD ensure → write → commit → marker (D1+D2 after commit) → push - rollback restores docs + prior marker + original branch(es); no --force - commit_feature already-on-branch short-circuit; Muse dirty-carry via --autoshelf - seven-tier §GSW.10 29 green incl. dirty-tree --write on all three regimes

ROADMAP GSW-FIX-b → DONE; NEXT → GSW-FIX → main (land-a).

sha256:2a07a912be09e85121db8744578ce61d8c4b8225210e40fc62bbf7eacc03f36e sha
+136 ~20 −9 symbols
sha256:0eb9f2880021f9b521de9313348279ea4c44655948cde904c91c185413699d20 snapshot
+136
symbols added
~20
symbols modified
−9
symbols removed
0
dead code introduced
Semantic Changes 165 symbols
+ _MERGED_K5B variable variable _MERGED_K5B L19–28
+ _seed_d1_aligned_d3_drift function function _seed_d1_aligned_d3_drift L31–36
+ FIXTURES import import FIXTURES L17–17
+ Path import import Path L14–14
+ annotations import import annotations L10–10
+ date import import date L13–13
+ gsw_runner import import gsw_runner L17–17
+ json import import json L12–12
+ kit_root import import kit_root L16–16
+ run_cli import import run_cli L17–17
+ seed_gsw_repo import import seed_gsw_repo L17–17
+ test_failure_after_switch_and_write_restores_everything function function test_failure_after_switch_and_write_restores_everything L39–59
+ test_second_write_single_commit_bundles_both_docs_then_marker function function test_second_write_single_commit_bundles_both_docs_then_marker L62–94
+ test_step_c_failure_leaves_docs_and_branch_untouched function function test_step_c_failure_leaves_docs_and_branch_untouched L97–126
+ _feature_branch function function _feature_branch L21–22
+ Path import import Path L15–15
+ annotations import import annotations L10–10
+ date import import date L14–14
+ gsw_runner import import gsw_runner L18–18
+ io import import io L12–12
+ kit_root import import kit_root L17–17
+ redirect_stdout import import redirect_stdout L13–13
+ run_cli import import run_cli L18–18
+ seed_gsw_repo import import seed_gsw_repo L18–18
+ test_git_only_dirty_tree_write function function test_git_only_dirty_tree_write L25–43
+ test_muse_git_mirror_dirty_tree_write_closes_live_incident function function test_muse_git_mirror_dirty_tree_write_closes_live_incident L73–104
+ test_muse_only_dirty_tree_write_never_invokes_git function function test_muse_only_dirty_tree_write_never_invokes_git L46–70
+ _doc_write_indexes function function _doc_write_indexes L53–58
+ _events_for_write function function _events_for_write L21–46
+ _feature_branch function function _feature_branch L17–18
+ _first_index function function _first_index L49–50
+ Path import import Path L11–11
+ annotations import import annotations L8–8
+ date import import date L10–10
+ gsw_runner import import gsw_runner L14–14
+ kit_root import import kit_root L13–13
+ run_cli import import run_cli L14–14
+ seed_gsw_repo import import seed_gsw_repo L14–14
+ test_git_only_write_order function function test_git_only_write_order L61–69
+ test_muse_git_mirror_dual_head_before_writes function function test_muse_git_mirror_dual_head_before_writes L89–107
+ test_muse_git_mirror_realign_runs_before_branch_ensure function function test_muse_git_mirror_realign_runs_before_branch_ensure L110–125
+ test_muse_only_write_order function function test_muse_only_write_order L72–86
+ Path import import Path L10–10
+ annotations import import annotations L7–7
+ gsw_runner import import gsw_runner L13–13
+ kit_root import import kit_root L12–12
+ run_cli import import run_cli L13–13
+ seed_gsw_repo import import seed_gsw_repo L13–13
+ time import import time L9–9
+ test_write_path_bounded_on_kit_sized_docs function function test_write_path_bounded_on_kit_sized_docs L16–38
+ HOSTILE_BRANCH variable variable HOSTILE_BRANCH L21–21
+ BranchState import import BranchState L15–15
+ Path import import Path L10–10
+ _ensure_feature_branch import import _ensure_feature_branch L15–15
+ _restore_branch_state import import _restore_branch_state L15–15
+ adapter_for import import adapter_for L14–14
+ annotations import import annotations L8–8
+ gsw_runner import import gsw_runner L14–14
+ kit_root import import kit_root L13–13
+ make_runner import import make_runner L14–14
+ ok import import ok L14–14
+ quote_arg import import quote_arg L12–12
+ run_cli import import run_cli L14–14
+ seed_gsw_repo import import seed_gsw_repo L14–14
+ test_git_only_write_call_log_has_zero_muse_argv function function test_git_only_write_call_log_has_zero_muse_argv L61–66
+ test_hostile_branch_name_is_quoted_in_ensure function function test_hostile_branch_name_is_quoted_in_ensure L24–38
+ test_hostile_branch_name_is_quoted_in_muse_ensure_and_restore function function test_hostile_branch_name_is_quoted_in_muse_ensure_and_restore L41–58
+ test_muse_only_write_call_log_has_zero_git_argv function function test_muse_only_write_call_log_has_zero_git_argv L69–74
+ test_no_force_checkout_in_success_or_rollback_paths function function test_no_force_checkout_in_success_or_rollback_paths L77–93
+ ROUNDS variable variable ROUNDS L15–15
+ Path import import Path L10–10
+ annotations import import annotations L8–8
+ gsw_runner import import gsw_runner L13–13
+ kit_root import import kit_root L12–12
+ run_cli import import run_cli L13–13
+ seed_gsw_repo import import seed_gsw_repo L13–13
+ test_repeated_commit_failure_never_strands_git_only function function test_repeated_commit_failure_never_strands_git_only L18–32
+ test_repeated_commit_failure_never_strands_muse_git_mirror function function test_repeated_commit_failure_never_strands_muse_git_mirror L35–53
~ tests/unit/test_gsw_write_path.py .py 28 symbols added
+ _EventRunner class class _EventRunner L30–43
+ __init__ method method __init__ L33–35
+ calls method method calls L42–43
+ run method method run L37–39
+ BranchState import import BranchState L23–23
+ Path import import Path L11–11
+ _capture_branch_state import import _capture_branch_state L23–23
+ _restore_branch_state import import _restore_branch_state L23–23
+ adapter_for import import adapter_for L14–14
+ annotations import import annotations L9–9
+ fail import import fail L14–14
+ gsw_runner import import gsw_runner L14–14
+ kit_root import import kit_root L13–13
+ make_runner import import make_runner L14–14
+ ok import import ok L14–14
+ run_cli import import run_cli L14–14
+ seed_gsw_repo import import seed_gsw_repo L14–14
+ test_apply_plan_realign_then_ensure_then_writes function function test_apply_plan_realign_then_ensure_then_writes L46–84
+ test_capture_branch_state_dual_fields_for_mirror function function test_capture_branch_state_dual_fields_for_mirror L179–184
+ test_capture_branch_state_fails_closed_on_unreadable_head function function test_capture_branch_state_fails_closed_on_unreadable_head L168–176
+ test_commit_feature_short_circuit_git_only function function test_commit_feature_short_circuit_git_only L87–100
+ test_commit_feature_short_circuit_muse_git_mirror function function test_commit_feature_short_circuit_muse_git_mirror L119–132
+ test_commit_feature_short_circuit_muse_only function function test_commit_feature_short_circuit_muse_only L103–116
+ test_marker_not_written_when_commit_fails function function test_marker_not_written_when_commit_fails L239–246
+ test_muse_git_mirror_dirty_off_branch_uses_autoshelf function function test_muse_git_mirror_dirty_off_branch_uses_autoshelf L152–165
+ test_muse_only_dirty_off_branch_uses_autoshelf function function test_muse_only_dirty_off_branch_uses_autoshelf L135–149
+ test_restore_branch_state_dirty_muse_uses_autoshelf function function test_restore_branch_state_dirty_muse_uses_autoshelf L216–236
+ test_restore_branch_state_restores_each_regime function function test_restore_branch_state_restores_each_regime L187–213
~ docs/OVERSEER-HANDOVER.md .md 9 symbols added, 9 symbols removed, 7 symbols modified
NEXT SESSION — GSW-FIX-b (governance-sync write-path build) section NEXT SESSION — GSW-FIX-b (governance-sync write-path build) L10–83
Authority split (read this — three different handovers) section Authority split (read this — three different handovers) L20–28
table section table L22–27
Paste-ready prompt — GSW-FIX-b section Paste-ready prompt — GSW-FIX-b L51–83
code[text] variable variable code[text] L53–80
THE ONE NEXT STEP — Model: Auto section THE ONE NEXT STEP — Model: Auto L36–51
table section table L43–50
What just landed section What just landed L28–36
table section table L30–35
+ NEXT SESSION — GSW-FIX → main (land-a) section NEXT SESSION — GSW-FIX → main (land-a) L10–81
+ Authority split (read this — three different handovers) section Authority split (read this — three different handovers) L21–29
+ table section table L23–28
+ Paste-ready prompt — GSW-FIX → main (land-a) section Paste-ready prompt — GSW-FIX → main (land-a) L51–81
+ code[text] variable variable code[text] L53–78
+ THE ONE NEXT STEP — Model: Operator + Auto section THE ONE NEXT STEP — Model: Operator + Auto L37–51
+ table section table L43–50
+ What just landed section What just landed L29–37
+ table section table L31–36
~ table
~ table
~ table
~ tests/support.py .py 13 symbols added
+ BranchStateRunner class class BranchStateRunner L95–241
+ __init__ method method __init__ L105–135
+ _git method method _git L151–190
+ _muse method method _muse L192–241
+ run method method run L137–149
+ GSW_CONFIG_BY_REGIME variable variable GSW_CONFIG_BY_REGIME L252–256
+ GSW_DOC_NAMES variable variable GSW_DOC_NAMES L258–262
+ _GSW_MUSE_ONLY_HANDOVER variable variable _GSW_MUSE_ONLY_HANDOVER L264–264
+ _GSW_MUSE_ONLY_ROADMAP variable variable _GSW_MUSE_ONLY_ROADMAP L265–269
+ _fail_result function function _fail_result L248–249
+ _ok_result function function _ok_result L244–245
+ gsw_runner function function gsw_runner L314–322
+ seed_gsw_repo function function seed_gsw_repo L272–311
~ tools/governance_hygiene/engine.py .py 8 symbols added, 2 symbols modified
+ BranchState class class BranchState L652–656
+ _capture_branch_state function function _capture_branch_state L664–693
+ _ensure_git_branch function function _ensure_git_branch L751–767
+ _ensure_muse_branch function function _ensure_muse_branch L722–748
+ _muse_command_prefix function function _muse_command_prefix L659–661
+ _restore_branch_state function function _restore_branch_state L814–849
+ _restore_marker function function _restore_marker L804–811
+ _rollback_apply function function _rollback_apply L770–801

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:2a07a912be09e85121db8744578ce61d8c4b8225210e40fc62bbf7eacc03f36e --body "your comment"