mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-02 15:04:37 +01:00
Merge origin/main v1.91.18.0 (#3023) into the v1.91.19.0 wave
Resolutions: - design-doc discovery: main's bin/gstack-design-doc-find replaces the inline block; it keeps #2839 (a root DESIGN.md is the design system, never the design doc; only docs/designs/ competes on freshness). Its unit test and the F2 harness (now installs the helper) follow. - design-shotgun: main's $D variants batch, staged under ${TMPDIR:-/tmp}. - memory ingest: main's scoped consent (scope counts, purge of staged pages outside the scope, zero-sessions notice) on the wave's locked state flow; the purge runs before the state loads, under the lock. - setup / render library: --model overlay plus --disabled-skills on every Claude render, including main's plain overlay render. - codex template and constants: the wave's sandbox preflight and unverified mode; main's issue-number removals. - docsync interface: ls-tree (main) and check-ignore (wave) are both reads. - census pins re-measured on the merged tree: 114 paid files; gate behavior census 44 files / 76 shards (periodic-only files skip the gate, now including two safety-rule evals); periodic floor 35,742 and release sum 58,097 (gate-only files no longer count toward periodic). - parity caps at measured merged sizes: ship 1.4271, review 1.1981, qa 1.1099. - generated output regenerated (gen:skill-docs --host all, llms.txt, context budget, goldens).
This commit is contained in:
commit
8e2beec2de
412 files changed
+24774
-1012
No files matched your search
+2
-2
@@ -492,7 +492,7 @@ if ! _gstack_codex_auth_probe >/dev/null; then
|
||||
_gstack_codex_log_event "codex_auth_failed"
|
||||
echo "AUTH_FAILED"
|
||||
elif _gstack_codex_sandbox_preflight; then # free; Linux only
|
||||
_gstack_codex_model_probe # ~10s round trip on first run, cached 1h (#2477)
|
||||
_gstack_codex_model_probe # ~10s round trip on first run, cached 1h
|
||||
fi
|
||||
_gstack_codex_version_check # warns if known-bad, non-blocking
|
||||
```
|
||||
@@ -507,7 +507,7 @@ source on the `CODEX_MODEL:` line) is invalid or the account cannot use it. Rela
|
||||
probe's HINT lines and
|
||||
follow the "Model not supported (HTTP 400 or 404)" recovery steps in
|
||||
`## Error Handling` below. Running the modes anyway just burns four
|
||||
invocations on the same 400 (#2477).
|
||||
invocations on the same 400.
|
||||
|
||||
If the output contains `CODEX_SANDBOX: unavailable`, stop: Codex's sandbox cannot
|
||||
start here, so every command it runs would fail and its review would read nothing.
|
||||
|
||||
+2
-2
@@ -84,7 +84,7 @@ if ! _gstack_codex_auth_probe >/dev/null; then
|
||||
_gstack_codex_log_event "codex_auth_failed"
|
||||
echo "AUTH_FAILED"
|
||||
elif _gstack_codex_sandbox_preflight; then # free; Linux only
|
||||
_gstack_codex_model_probe # ~10s round trip on first run, cached 1h (#2477)
|
||||
_gstack_codex_model_probe # ~10s round trip on first run, cached 1h
|
||||
fi
|
||||
_gstack_codex_version_check # warns if known-bad, non-blocking
|
||||
```
|
||||
@@ -99,7 +99,7 @@ source on the `CODEX_MODEL:` line) is invalid or the account cannot use it. Rela
|
||||
probe's HINT lines and
|
||||
follow the "Model not supported (HTTP 400 or 404)" recovery steps in
|
||||
`## Error Handling` below. Running the modes anyway just burns four
|
||||
invocations on the same 400 (#2477).
|
||||
invocations on the same 400.
|
||||
|
||||
If the output contains `CODEX_SANDBOX: unavailable`, stop: Codex's sandbox cannot
|
||||
start here, so every command it runs would fail and its review would read nothing.
|
||||
|
||||
@@ -76,14 +76,14 @@ for line in sys.stdin:
|
||||
err = obj.get('error',{}).get('message','') or 'no error message in event'
|
||||
print(f'[codex turn FAILED] {err}', flush=True, file=sys.stderr)
|
||||
except: pass
|
||||
# Fix 2: three-way completeness check (#2671) — a STATED failure is a failure,
|
||||
# Fix 2: three-way completeness check — a STATED failure is a failure,
|
||||
# not a network problem; only silence with no terminal event is a disconnect.
|
||||
if turn_failed:
|
||||
print('[codex] turn.failed received — the turn errored (reason above), not a disconnect.', flush=True, file=sys.stderr)
|
||||
elif turn_completed_count == 0:
|
||||
print('[codex warning] No turn.completed event received — possible mid-stream disconnect.', flush=True, file=sys.stderr)
|
||||
"
|
||||
_CODEX_EXIT=${PIPESTATUS[0]:-${pipestatus[1]}} # bash sets PIPESTATUS; zsh (lowercase, 1-indexed) falls through (#2669)
|
||||
_CODEX_EXIT=${PIPESTATUS[0]:-${pipestatus[1]}} # bash sets PIPESTATUS; zsh (lowercase, 1-indexed) falls through
|
||||
# Fix 1: hang detection — log + surface actionable message
|
||||
if [ "$_CODEX_EXIT" = "124" ]; then
|
||||
_gstack_codex_log_event "codex_timeout" "540"
|
||||
@@ -91,7 +91,7 @@ if [ "$_CODEX_EXIT" = "124" ]; then
|
||||
echo "Codex stalled past 9 minutes. Common causes: model API stall, long prompt, network issue. Try re-running. If persistent, split the prompt or check ~/.codex/logs/."
|
||||
elif [ "$_CODEX_EXIT" != "0" ]; then
|
||||
# Surface non-zero exits so the calling agent doesn't read "no output" as
|
||||
# a silent model/API stall. See #1327.
|
||||
# a silent model/API stall.
|
||||
echo "[codex exit $_CODEX_EXIT] $(head -1 "$TMPERR" 2>/dev/null || echo "no stderr captured")"
|
||||
head -20 "$TMPERR" 2>/dev/null | sed 's/^/ /' || true
|
||||
_gstack_codex_log_event "codex_nonzero_exit" "challenge:$_CODEX_EXIT"
|
||||
|
||||
@@ -74,14 +74,14 @@ for line in sys.stdin:
|
||||
err = obj.get('error',{}).get('message','') or 'no error message in event'
|
||||
print(f'[codex turn FAILED] {err}', flush=True, file=sys.stderr)
|
||||
except: pass
|
||||
# Fix 2: three-way completeness check (#2671) — a STATED failure is a failure,
|
||||
# Fix 2: three-way completeness check — a STATED failure is a failure,
|
||||
# not a network problem; only silence with no terminal event is a disconnect.
|
||||
if turn_failed:
|
||||
print('[codex] turn.failed received — the turn errored (reason above), not a disconnect.', flush=True, file=sys.stderr)
|
||||
elif turn_completed_count == 0:
|
||||
print('[codex warning] No turn.completed event received — possible mid-stream disconnect.', flush=True, file=sys.stderr)
|
||||
"
|
||||
_CODEX_EXIT=${PIPESTATUS[0]:-${pipestatus[1]}} # bash sets PIPESTATUS; zsh (lowercase, 1-indexed) falls through (#2669)
|
||||
_CODEX_EXIT=${PIPESTATUS[0]:-${pipestatus[1]}} # bash sets PIPESTATUS; zsh (lowercase, 1-indexed) falls through
|
||||
# Fix 1: hang detection — log + surface actionable message
|
||||
if [ "$_CODEX_EXIT" = "124" ]; then
|
||||
_gstack_codex_log_event "codex_timeout" "540"
|
||||
@@ -89,7 +89,7 @@ if [ "$_CODEX_EXIT" = "124" ]; then
|
||||
echo "Codex stalled past 9 minutes. Common causes: model API stall, long prompt, network issue. Try re-running. If persistent, split the prompt or check ~/.codex/logs/."
|
||||
elif [ "$_CODEX_EXIT" != "0" ]; then
|
||||
# Surface non-zero exits so the calling agent doesn't read "no output" as
|
||||
# a silent model/API stall. See #1327.
|
||||
# a silent model/API stall.
|
||||
echo "[codex exit $_CODEX_EXIT] $(head -1 "$TMPERR" 2>/dev/null || echo "no stderr captured")"
|
||||
head -20 "$TMPERR" 2>/dev/null | sed 's/^/ /' || true
|
||||
_gstack_codex_log_event "codex_nonzero_exit" "challenge:$_CODEX_EXIT"
|
||||
|
||||
@@ -121,7 +121,7 @@ for line in sys.stdin:
|
||||
err = obj.get('error',{}).get('message','') or 'no error message in event'
|
||||
print(f'[codex turn FAILED] {err}', flush=True, file=sys.stderr)
|
||||
except: pass
|
||||
# Three-way completeness check (#2671; consult previously had NONE): a STATED
|
||||
# Three-way completeness check: a STATED
|
||||
# failure is a failure, not a network problem; only silence is a disconnect.
|
||||
if turn_failed:
|
||||
print('[codex] turn.failed received — the turn errored (reason above), not a disconnect.', flush=True, file=sys.stderr)
|
||||
@@ -129,14 +129,14 @@ elif turn_completed_count == 0:
|
||||
print('[codex warning] No turn.completed event received — possible mid-stream disconnect.', flush=True, file=sys.stderr)
|
||||
"
|
||||
# Fix 1: hang detection for Consult new-session (mirrors Challenge + resume)
|
||||
_CODEX_EXIT=${PIPESTATUS[0]:-${pipestatus[1]}} # bash sets PIPESTATUS; zsh (lowercase, 1-indexed) falls through (#2669)
|
||||
_CODEX_EXIT=${PIPESTATUS[0]:-${pipestatus[1]}} # bash sets PIPESTATUS; zsh (lowercase, 1-indexed) falls through
|
||||
if [ "$_CODEX_EXIT" = "124" ]; then
|
||||
_gstack_codex_log_event "codex_timeout" "540"
|
||||
_gstack_codex_log_hang "consult" "$(wc -c < "$TMPERR" 2>/dev/null || echo 0)"
|
||||
echo "Codex stalled past 9 minutes. Common causes: model API stall, long prompt, network issue. Try re-running. If persistent, split the prompt or check ~/.codex/logs/."
|
||||
elif [ "$_CODEX_EXIT" != "0" ]; then
|
||||
# Surface non-zero exits so the calling agent doesn't read "no output" as
|
||||
# a silent model/API stall. See #1327.
|
||||
# a silent model/API stall.
|
||||
echo "[codex exit $_CODEX_EXIT] $(head -1 "$TMPERR" 2>/dev/null || echo "no stderr captured")"
|
||||
head -20 "$TMPERR" 2>/dev/null | sed 's/^/ /' || true
|
||||
_gstack_codex_log_event "codex_nonzero_exit" "consult:$_CODEX_EXIT"
|
||||
@@ -145,7 +145,7 @@ bun ~/.claude/skills/gstack/lib/outside-review-result.ts --label 'Codex consult'
|
||||
rm -f "$_PROMPT_FILE"
|
||||
```
|
||||
|
||||
**Session-cost reality (#2387, measured):** every `codex exec` call — resumed
|
||||
**Session-cost reality (measured):** every `codex exec` call — resumed
|
||||
or fresh — pays Codex's ~21K-token session prelude (its skill catalogue +
|
||||
instructions); `resume` does NOT amortize it (a measured resume came in
|
||||
slightly ABOVE a fresh call). Resume buys conversational continuity, never
|
||||
@@ -174,14 +174,14 @@ _gstack_codex_timeout_wrapper 540 codex exec resume <session-id> - -c "sandbox_m
|
||||
<same python streaming parser as above, with flush=True on all print() calls>
|
||||
"
|
||||
# Fix 1: same hang detection pattern as new-session block
|
||||
_CODEX_EXIT=${PIPESTATUS[0]:-${pipestatus[1]}} # bash sets PIPESTATUS; zsh (lowercase, 1-indexed) falls through (#2669)
|
||||
_CODEX_EXIT=${PIPESTATUS[0]:-${pipestatus[1]}} # bash sets PIPESTATUS; zsh (lowercase, 1-indexed) falls through
|
||||
if [ "$_CODEX_EXIT" = "124" ]; then
|
||||
_gstack_codex_log_event "codex_timeout" "540"
|
||||
_gstack_codex_log_hang "consult-resume" "$(wc -c < "$TMPERR" 2>/dev/null || echo 0)"
|
||||
echo "Codex stalled past 9 minutes. Common causes: model API stall, long prompt, network issue. Try re-running. If persistent, split the prompt or check ~/.codex/logs/."
|
||||
elif [ "$_CODEX_EXIT" != "0" ]; then
|
||||
# Surface non-zero exits so the calling agent doesn't read "no output" as
|
||||
# a silent model/API stall. See #1327.
|
||||
# a silent model/API stall.
|
||||
echo "[codex exit $_CODEX_EXIT] $(head -1 "$TMPERR" 2>/dev/null || echo "no stderr captured")"
|
||||
head -20 "$TMPERR" 2>/dev/null | sed 's/^/ /' || true
|
||||
_gstack_codex_log_event "codex_nonzero_exit" "consult-resume:$_CODEX_EXIT"
|
||||
|
||||
@@ -119,7 +119,7 @@ for line in sys.stdin:
|
||||
err = obj.get('error',{}).get('message','') or 'no error message in event'
|
||||
print(f'[codex turn FAILED] {err}', flush=True, file=sys.stderr)
|
||||
except: pass
|
||||
# Three-way completeness check (#2671; consult previously had NONE): a STATED
|
||||
# Three-way completeness check: a STATED
|
||||
# failure is a failure, not a network problem; only silence is a disconnect.
|
||||
if turn_failed:
|
||||
print('[codex] turn.failed received — the turn errored (reason above), not a disconnect.', flush=True, file=sys.stderr)
|
||||
@@ -127,14 +127,14 @@ elif turn_completed_count == 0:
|
||||
print('[codex warning] No turn.completed event received — possible mid-stream disconnect.', flush=True, file=sys.stderr)
|
||||
"
|
||||
# Fix 1: hang detection for Consult new-session (mirrors Challenge + resume)
|
||||
_CODEX_EXIT=${PIPESTATUS[0]:-${pipestatus[1]}} # bash sets PIPESTATUS; zsh (lowercase, 1-indexed) falls through (#2669)
|
||||
_CODEX_EXIT=${PIPESTATUS[0]:-${pipestatus[1]}} # bash sets PIPESTATUS; zsh (lowercase, 1-indexed) falls through
|
||||
if [ "$_CODEX_EXIT" = "124" ]; then
|
||||
_gstack_codex_log_event "codex_timeout" "540"
|
||||
_gstack_codex_log_hang "consult" "$(wc -c < "$TMPERR" 2>/dev/null || echo 0)"
|
||||
echo "Codex stalled past 9 minutes. Common causes: model API stall, long prompt, network issue. Try re-running. If persistent, split the prompt or check ~/.codex/logs/."
|
||||
elif [ "$_CODEX_EXIT" != "0" ]; then
|
||||
# Surface non-zero exits so the calling agent doesn't read "no output" as
|
||||
# a silent model/API stall. See #1327.
|
||||
# a silent model/API stall.
|
||||
echo "[codex exit $_CODEX_EXIT] $(head -1 "$TMPERR" 2>/dev/null || echo "no stderr captured")"
|
||||
head -20 "$TMPERR" 2>/dev/null | sed 's/^/ /' || true
|
||||
_gstack_codex_log_event "codex_nonzero_exit" "consult:$_CODEX_EXIT"
|
||||
@@ -143,7 +143,7 @@ bun ~/.claude/skills/gstack/lib/outside-review-result.ts --label 'Codex consult'
|
||||
rm -f "$_PROMPT_FILE"
|
||||
```
|
||||
|
||||
**Session-cost reality (#2387, measured):** every `codex exec` call — resumed
|
||||
**Session-cost reality (measured):** every `codex exec` call — resumed
|
||||
or fresh — pays Codex's ~21K-token session prelude (its skill catalogue +
|
||||
instructions); `resume` does NOT amortize it (a measured resume came in
|
||||
slightly ABOVE a fresh call). Resume buys conversational continuity, never
|
||||
@@ -172,14 +172,14 @@ _gstack_codex_timeout_wrapper 540 codex exec resume <session-id> - -c "sandbox_m
|
||||
<same python streaming parser as above, with flush=True on all print() calls>
|
||||
"
|
||||
# Fix 1: same hang detection pattern as new-session block
|
||||
_CODEX_EXIT=${PIPESTATUS[0]:-${pipestatus[1]}} # bash sets PIPESTATUS; zsh (lowercase, 1-indexed) falls through (#2669)
|
||||
_CODEX_EXIT=${PIPESTATUS[0]:-${pipestatus[1]}} # bash sets PIPESTATUS; zsh (lowercase, 1-indexed) falls through
|
||||
if [ "$_CODEX_EXIT" = "124" ]; then
|
||||
_gstack_codex_log_event "codex_timeout" "540"
|
||||
_gstack_codex_log_hang "consult-resume" "$(wc -c < "$TMPERR" 2>/dev/null || echo 0)"
|
||||
echo "Codex stalled past 9 minutes. Common causes: model API stall, long prompt, network issue. Try re-running. If persistent, split the prompt or check ~/.codex/logs/."
|
||||
elif [ "$_CODEX_EXIT" != "0" ]; then
|
||||
# Surface non-zero exits so the calling agent doesn't read "no output" as
|
||||
# a silent model/API stall. See #1327.
|
||||
# a silent model/API stall.
|
||||
echo "[codex exit $_CODEX_EXIT] $(head -1 "$TMPERR" 2>/dev/null || echo "no stderr captured")"
|
||||
head -20 "$TMPERR" 2>/dev/null | sed 's/^/ /' || true
|
||||
_gstack_codex_log_event "codex_nonzero_exit" "consult-resume:$_CODEX_EXIT"
|
||||
|
||||
@@ -41,7 +41,7 @@ sandbox is set with `-c` from `_GSTACK_CODEX_SANDBOX`, which `_gstack_codex_sele
|
||||
sets so the effective setting is `sandbox_mode="read-only"` (full access only for
|
||||
`GSTACK_CODEX_NO_SANDBOX=1`, with a warning). Without it the call inherits the user's
|
||||
`~/.codex/config.toml` default, which on a trusted project can be WRITE access —
|
||||
contradicting this skill's read-only contract (#2496, #2524):
|
||||
contradicting this skill's read-only contract:
|
||||
|
||||
```bash
|
||||
_REPO_ROOT=$(git rev-parse --show-toplevel) || { echo "ERROR: not in a git repo" >&2; exit 1; }
|
||||
@@ -62,7 +62,7 @@ if [ "$_CODEX_EXIT" = "124" ]; then
|
||||
elif [ "$_CODEX_EXIT" != "0" ]; then
|
||||
# Surface non-zero exits (parse errors, arg-shape breaks, etc.) so the
|
||||
# calling agent doesn't read "no output" as a silent model/API stall and
|
||||
# burn 30-60min misdiagnosing it. See #1327.
|
||||
# burn 30-60min misdiagnosing it.
|
||||
echo "[codex exit $_CODEX_EXIT] $(head -1 "$TMPERR" 2>/dev/null || echo "no stderr captured")"
|
||||
head -20 "$TMPERR" 2>/dev/null | sed 's/^/ /' || true
|
||||
_gstack_codex_log_event "codex_nonzero_exit" "review:$_CODEX_EXIT"
|
||||
|
||||
@@ -39,7 +39,7 @@ sandbox is set with `-c` from `_GSTACK_CODEX_SANDBOX`, which `_gstack_codex_sele
|
||||
sets so the effective setting is `sandbox_mode="read-only"` (full access only for
|
||||
`GSTACK_CODEX_NO_SANDBOX=1`, with a warning). Without it the call inherits the user's
|
||||
`~/.codex/config.toml` default, which on a trusted project can be WRITE access —
|
||||
contradicting this skill's read-only contract (#2496, #2524):
|
||||
contradicting this skill's read-only contract:
|
||||
|
||||
```bash
|
||||
_REPO_ROOT=$(git rev-parse --show-toplevel) || { echo "ERROR: not in a git repo" >&2; exit 1; }
|
||||
@@ -60,7 +60,7 @@ if [ "$_CODEX_EXIT" = "124" ]; then
|
||||
elif [ "$_CODEX_EXIT" != "0" ]; then
|
||||
# Surface non-zero exits (parse errors, arg-shape breaks, etc.) so the
|
||||
# calling agent doesn't read "no output" as a silent model/API stall and
|
||||
# burn 30-60min misdiagnosing it. See #1327.
|
||||
# burn 30-60min misdiagnosing it.
|
||||
echo "[codex exit $_CODEX_EXIT] $(head -1 "$TMPERR" 2>/dev/null || echo "no stderr captured")"
|
||||
head -20 "$TMPERR" 2>/dev/null | sed 's/^/ /' || true
|
||||
_gstack_codex_log_event "codex_nonzero_exit" "review:$_CODEX_EXIT"
|
||||
|
||||
Reference in new issue
Block a user