framework tools/git: provider-normalization arms on issue-close and milestone-list (codex should-fix)
ci/woodpecker/pr/ci Pipeline was successful

gh stub exiting 2 on the close/api path -> wrapper exit 1 with the
normalized stderr message; mirrors the issue-assign 6b arm. All
touched suites green; brain mirror updated.
This commit is contained in:
2026-08-28 18:33:32 -05:00
parent 7db25b8820
commit 34e56f242e
@@ -128,4 +128,26 @@ done
# the arm above proves only parse acceptance and non-usage classification.
# Parser-failure arms (1-4) remain zero-contact (asserted at 4b).
# 6b. Provider-exit normalization (codex PR #1464): a provider stub exiting
# 2 (its own usage-error status) must surface as wrapper exit 1, never 2.
GH_REPO="$WORK_DIR/repo-gh"
mkdir -p "$GH_REPO"
git -C "$GH_REPO" init -q
git -C "$GH_REPO" remote add origin https://github.com/acme/widgets.git
cat > "$BIN_DIR/gh" <<GHSTUB
#!/usr/bin/env bash
echo "gh \$*" >> "$PROBE_LOG"
if [[ "\$1" == "api" ]]; then exit 2; fi
exit 0
GHSTUB
chmod +x "$BIN_DIR/gh"
rc=0
(
cd "$GH_REPO"
PATH="$BIN_DIR:$PATH" MOSAIC_GIT_IDENTITY="" MOSAIC_BRAIN_HOME="" \
"$SCRIPT_DIR/milestone-list.sh" >"$OUT_FILE" 2>"$ERR_FILE"
) || rc=$?
[[ "$rc" -eq 1 ]] || fail "GitHub path: gh exit 2 must normalize to wrapper exit 1 (got $rc)"
grep -q "provider" "$ERR_FILE" || fail "GitHub path: normalized provider error missing from stderr"
echo "milestone-list.sh usage-contract regression passed (R1/R4)"