R5: git-init-Orphans mechanisch verhindern (Guard-Block + Orphan-Gate)

Drei Naechte in Folge bauten Worker git-init-Branches ohne gemeinsamen
Ursprung mit main (cleanse-skill-index 12.07., skill-kanten-generator
13.07., blogwatcher-logging ~14.07.) - bei der Annahme technisch tot,
Nacht-Arbeit verloren. SOUL-Prosa allein driftet (Meta-Lehre Fallstrick-
Audit) -> jetzt mechanisch: tabu-pfade-guard blockt 'git init' im
Kanban-Workspace hart; pre-verify-gates prueft VOR dem Fertigmelden
merge-base gegen origin/main (Orphan-Gate ROT).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Hitonabi
2026-07-15 10:25:03 +02:00
parent abc8a365d2
commit 734cafd98f
2 changed files with 38 additions and 0 deletions
+23
View File
@@ -47,6 +47,29 @@ if [ -n "$srcfile" ] && [ $dist -eq 0 ]; then
fi
fi
# Gate 3 (R5, 15.07.): Orphan-Check — git-init-Repos ohne gemeinsamen Ursprung mit
# origin/main sind bei der Annahme technisch tot (3 Vorfaelle 12.14.07., je eine
# Nacht Arbeit verloren). VOR dem Fertigmelden fangen, nicht erst im Auftragsbuch.
orphan=""; checked=""
for p in "${paths[@]}"; do
root=$(dirname "$p"); n=0
while [ $n -lt 8 ] && [ -n "$root" ] && [ "$root" != "/" ] && [ ! -e "$root/.git" ]; do
root=$(dirname "$root"); n=$((n+1))
done
[ -e "$root/.git" ] || continue
case " $checked " in *" $root "*) continue ;; esac
checked="$checked $root"
git -C "$root" remote get-url origin >/dev/null 2>&1 || continue
git -C "$root" fetch -q origin main >/dev/null 2>&1 || true
if git -C "$root" rev-parse --verify -q origin/main >/dev/null 2>&1 \
&& ! git -C "$root" merge-base HEAD origin/main >/dev/null 2>&1; then
orphan="${orphan}${root}"$'\n'
fi
done
if [ -n "$orphan" ]; then
msgs+=("Orphan-Gate ROT: Dieses Repo hat KEINEN gemeinsamen Ursprung mit origin/main (git init statt Klonen?):"$'\n'"${orphan}So ist der Vorschlag bei der Annahme technisch TOT. Nicht fertigmelden — frisch VOLL klonen, Branch von origin/main abzweigen, Aenderungen ruebertragen.")
fi
if [ ${#msgs[@]} -eq 0 ]; then printf '{}'; exit 0; fi
joined=$(printf '%s\n\n' "${msgs[@]}")
jq --null-input --arg m "$joined" '{action:"continue", message:$m}'