fix: security hardening + setup resilience + Codex flags + cross-platform open#639
Open
raf-andrew wants to merge 1 commit intogarrytan:mainfrom
Open
fix: security hardening + setup resilience + Codex flags + cross-platform open#639raf-andrew wants to merge 1 commit intogarrytan:mainfrom
raf-andrew wants to merge 1 commit intogarrytan:mainfrom
Conversation
…m open setup (garrytan#466): - Auto-install Bun if missing instead of hard-failing with a manual instruction. Runs curl | bash and re-exports PATH so the rest of setup proceeds without the user having to open a new terminal. bin/gstack-review-log (garrytan#472): - Validate JSON input before appending to JSONL. Reject multi-line inputs (JSONL injection) and malformed JSON (using node or python3 if available). Use printf instead of echo to avoid trailing-newline ambiguity. bin/gstack-telemetry-log (garrytan#469): - Add sanitize_str() helper that strips \n/\r and escapes backslashes and double-quotes before embedding user-controlled fields into JSONL records. Apply to SKILL, SESSION_ID, EVENT_TYPE, OUTCOME, SOURCE, REPO_SLUG, BRANCH, ERROR_CLASS, ERROR_MESSAGE, FAILED_STEP. codex/SKILL.md.tmpl (garrytan#426): - Replace deprecated model_reasoning_effort="xhigh" with "high" (xhigh is rejected by the API with unsupported_value). - Replace --enable web_search_cached with --search (deprecated feature flag). - Expand gate verdict to fail on [P0] as well as [P1] findings. - Update explanatory prose to match corrected flags. bin/gstack-open + generator scripts (garrytan#475): - Add bin/gstack-open: cross-platform URL opener for macOS (open), Linux (xdg-open / sensible-browser / x-www-browser), WSL (explorer.exe / cmd.exe start), and Windows Git Bash (start). - Replace bare `open https://...` calls in gen-skill-docs.ts, scripts/resolvers/preamble.ts, and office-hours/SKILL.md.tmpl with ~/.claude/skills/gstack/bin/gstack-open so the Boil the Lake essay link works on all platforms. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Five independent fixes bundled into one community PR. Each is scoped to a small number of files with no cross-dependencies.
setupbin/gstack-review-logbin/gstack-telemetry-logxhigh→high,--enable web_search_cached→--search, P0+P1 gate)codex/SKILL.md.tmplgstack-open(replaces macOS-onlyopen)bin/gstack-open(new),scripts/gen-skill-docs.ts,scripts/resolvers/preamble.ts,office-hours/SKILL.md.tmplFix details
setup: auto-install Bun (#466)
Previously hard-failed with a manual install instruction. Now auto-runs
curl -fsSL https://bun.sh/install | bashand re-exports PATH so the rest of setup continues in the same shell. Falls back to the manual instruction on curl failure.gstack-review-log: JSON validation (#472)
echo "$1"wrote any string — including multi-line inputs — directly to the JSONL file. A maliciously crafted argument could inject extra JSONL lines or corrupt the file. Fix: reject inputs containing\n, then validate JSON structure vianodeorpython3if available.gstack-telemetry-log: JSONL sanitization (#469)
User-controlled fields (
SKILL,SESSION_ID,OUTCOME,SOURCE,ERROR_CLASS, etc.) were interpolated intoprintfformat strings without escaping. A\nin any field would create a new JSONL line; a"would break the JSON structure. Fix: addsanitize_str()that strips\n/\rand escapes\and"before embedding any field.codex flags (#426)
model_reasoning_effort="xhigh"→"high"(xhighcauses anunsupported_valueAPI error)--enable web_search_cached→--search(deprecated feature flag)[P0]in addition to[P1]gstack-open (#475)
The preamble uses
open https://garryslist.org/posts/boil-the-oceanto show the Boil the Lake essay.openis macOS-only — on Linux and Windows it silently does nothing or errors.bin/gstack-opendispatches to the correct launcher per platform:open(macOS),xdg-open/sensible-browser(Linux),explorer.exe/cmd.exe start(WSL),start ""(Windows Git Bash).Test plan
./setupwith Bun uninstalled: auto-installs and completesgstack-review-log $'{"a":1\nb":2}': rejected (newline injection)gstack-review-log 'not-json': rejected (invalid JSON)gstack-telemetry-log --skill $'qa\n{"injected":1}' --outcome success: newline stripped from JSONL output/codex reviewwith updated flags: nounsupported_valueAPI errorbin/gstack-open https://example.comon Linux: opens browser via xdg-open🤖 Generated with Claude Code