fix(deploy): gate rebase conflict-side flags and unchecked pull --rebase in DEPLOY-GATE-D07.TOPO_PUSH_PARITY

This commit is contained in:
Hermes Agent committed 2026-12-02 22:45:41 +00:00
1 parent 0d4b2a5d27
commit 808882e0a6
4 files changed
+57 -20

No files matched your search

@@ -23,6 +23,28 @@ from hyperstitionstud_io import __version__ as CURRENT_VERSION
from hyperstitionstud_io.config import load_workspace_config, normalize_workspace_relpath
FORBIDDEN_CONFLICT_SIDE_RE = re.compile(r"(?:^|\s)(?:--theirs|--ours|-X\s*(?:theirs|ours))\b")
FORBIDDEN_UNCHECKED_REBASE_RE = re.compile(r"pull\s+--rebase[^\n]*\|\|\s*true")
def validate_push_script_rebase_gating(push_txt: str) -> list[str]:
"""
Gate DEPLOY-GATE-D07.TOPO_PUSH_PARITY: Reject conflict-side resolution flags
(--theirs, --ours, -X theirs, -X ours) and unchecked pull --rebase ... || true
suppressions in push-all-to-git-libre-audio.sh.
"""
violations: list[str] = []
for m_flag in FORBIDDEN_CONFLICT_SIDE_RE.finditer(push_txt):
violations.append(
f"Gate DEPLOY-GATE-D07.TOPO_PUSH_PARITY: Forbidden conflict-side flag {m_flag.group(0).strip()!r} in push-all-to-git-libre-audio.sh"
)
for m_reb in FORBIDDEN_UNCHECKED_REBASE_RE.finditer(push_txt):
violations.append(
f"Gate DEPLOY-GATE-D07.TOPO_PUSH_PARITY: Forbidden unchecked rebase suppression {m_reb.group(0)!r} in push-all-to-git-libre-audio.sh"
)
return violations
def prepare_and_verify_deploy_scripts(
workspace_root: str | Path | None = None,
target_version: str | None = None,
@@ -194,7 +216,7 @@ def prepare_and_verify_deploy_scripts(
if not gate_d6_ok:
errors.append("Gate D6: Single-layer compression enforcement or Caddyfile media extension parity missing")
# Gate DEPLOY-GATE-D07.TOPO_PUSH_PARITY: Topological 6-Repository Push & Force-Tag Sync Parity in push-all-to-git-libre-audio.sh
# Gate DEPLOY-GATE-D07.TOPO_PUSH_PARITY: Topological 6-Repository Push, Force-Tag Sync & Fail-Fast Rebase Parity in push-all-to-git-libre-audio.sh
required_push_markers = (
"hyperstitionstudio-core",
"ingglish-hyperdope-gematria",
@@ -209,9 +231,11 @@ def prepare_and_verify_deploy_scripts(
"--exegesis-uninstall",
"--skip-exegesis-deploy",
)
gate_d7_ok = all(m in push_txt_cur for m in required_push_markers)
if not gate_d7_ok:
errors.append("Gate D7: Missing required repository, force-tag, or verification marker in push-all-to-git-libre-audio.sh")
d7_rebase_violations = validate_push_script_rebase_gating(push_txt_cur)
gate_d7_ok = all(m in push_txt_cur for m in required_push_markers) and len(d7_rebase_violations) == 0
if not all(m in push_txt_cur for m in required_push_markers):
errors.append("Gate DEPLOY-GATE-D07.TOPO_PUSH_PARITY: Missing required repository, force-tag, or verification marker in push-all-to-git-libre-audio.sh")
errors.extend(d7_rebase_violations)
# Gate DEPLOY-GATE-D08.PRE_COMMIT_STAGE: Automatic Git Staging Prior to Commit (--stage)
staged_files: list[str] = []