mirror of
https://github.com/garrytan/gstack.git
synced 2026-09-13 16:38:56 +02:00
Merge origin/main (v1.64.0.0) into garrytan/time-attack-fork-review
Both waves fixed several of the same bugs; resolutions keep whichever shape this branch's tests pin (#2018 jq bind, #1798 set-- pattern, stop-ack, lock errors, polyfill windowsHide) and take main's richer codex Step 2A (it absorbed the same mktemp fix). True unions: memory- ingest keeps main's capability-probed --include-gitignored inside our GIT_CEILING defense; setup wraps main's Playwright platform override in our stale-healing install lock; package.json takes main's diff@^9 and the combined test glob (design/test + ios-qa/daemon/test, 30s timeout). Generated SKILL.md files regenerated from resolved templates, never hand-picked. Ship goldens refreshed; parity/carve budgets re-measured for the summed preamble growth of both waves (itemized per entry).
This commit is contained in:
+32
-13
@@ -81,13 +81,15 @@ if [ "$_EXPLAIN_LEVEL" != "default" ] && [ "$_EXPLAIN_LEVEL" != "terse" ]; then
|
||||
echo "EXPLAIN_LEVEL: $_EXPLAIN_LEVEL"
|
||||
_QUESTION_TUNING=$(~/.claude/skills/gstack/bin/gstack-config get question_tuning 2>/dev/null || echo "false")
|
||||
echo "QUESTION_TUNING: $_QUESTION_TUNING"
|
||||
_UPDATE_CHECK=$(~/.claude/skills/gstack/bin/gstack-config get update_check 2>/dev/null || echo "true")
|
||||
echo "UPDATE_CHECK: $_UPDATE_CHECK"
|
||||
mkdir -p ~/.gstack/analytics
|
||||
if [ "$_TEL" != "off" ]; then
|
||||
echo '{"skill":"pair-agent","ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","repo":"'$(_repo=$(basename "$(git rev-parse --show-toplevel 2>/dev/null)" 2>/dev/null | tr -cd 'a-zA-Z0-9._-'); echo "${_repo:-unknown}")'"}' >> ~/.gstack/analytics/skill-usage.jsonl 2>/dev/null || true
|
||||
fi
|
||||
for _PF in $(find ~/.gstack/analytics -maxdepth 1 -name '.pending-*' 2>/dev/null); do
|
||||
if [ -f "$_PF" ]; then
|
||||
if [ "$_TEL" != "off" ] && [ -x "~/.claude/skills/gstack/bin/gstack-telemetry-log" ]; then
|
||||
if [ "$_TEL" != "off" ] && [ -x "$HOME/.claude/skills/gstack/bin/gstack-telemetry-log" ]; then
|
||||
~/.claude/skills/gstack/bin/gstack-telemetry-log --event-type skill_run --skill _pending_finalize --outcome unknown --session-id "$_SESSION_ID" 2>/dev/null || true
|
||||
fi
|
||||
rm -f "$_PF" 2>/dev/null || true
|
||||
@@ -153,6 +155,8 @@ If `PROACTIVE` is `"false"`, do not auto-invoke or proactively suggest skills. I
|
||||
|
||||
If `SKILL_PREFIX` is `"true"`, suggest/invoke `/gstack-*` names. Disk paths stay `~/.claude/skills/gstack/[skill-name]/SKILL.md`.
|
||||
|
||||
If `UPDATE_CHECK` is `"false"`, skip the next two lines — the update-check binary emits nothing in that mode, so there is no `UPGRADE_AVAILABLE` / `JUST_UPGRADED` output to act on.
|
||||
|
||||
If output shows `UPGRADE_AVAILABLE <old> <new>`: read `~/.claude/skills/gstack/gstack-upgrade/SKILL.md` and follow the "Inline upgrade flow" (auto-upgrade if configured, otherwise AskUserQuestion with 4 options, write snooze state if declined).
|
||||
|
||||
If output shows `JUST_UPGRADED <from> <to>`: print "Running gstack v{to} (just updated!)". If `SPAWNED_SESSION` is true, skip feature discovery.
|
||||
@@ -465,8 +469,8 @@ if [ -f "$HOME/.gstack-artifacts-remote.txt" ]; then
|
||||
else
|
||||
_BRAIN_REMOTE_FILE="$HOME/.gstack-brain-remote.txt"
|
||||
fi
|
||||
_BRAIN_SYNC_BIN="~/.claude/skills/gstack/bin/gstack-brain-sync"
|
||||
_BRAIN_CONFIG_BIN="~/.claude/skills/gstack/bin/gstack-config"
|
||||
_BRAIN_SYNC_BIN="$HOME/.claude/skills/gstack/bin/gstack-brain-sync"
|
||||
_BRAIN_CONFIG_BIN="$HOME/.claude/skills/gstack/bin/gstack-config"
|
||||
|
||||
# /sync-gbrain context-load: teach the agent to use gbrain when it's available.
|
||||
# Per-worktree pin: post-spike redesign uses kubectl-style `.gbrain-source` in the
|
||||
@@ -575,8 +579,8 @@ If A/B and `~/.gstack/.git` is missing, ask whether to run `gstack-artifacts-ini
|
||||
At skill END before telemetry:
|
||||
|
||||
```bash
|
||||
"~/.claude/skills/gstack/bin/gstack-brain-sync" --discover-new 2>/dev/null || true
|
||||
"~/.claude/skills/gstack/bin/gstack-brain-sync" --once 2>/dev/null || true
|
||||
"$HOME/.claude/skills/gstack/bin/gstack-brain-sync" --discover-new 2>/dev/null || true
|
||||
"$HOME/.claude/skills/gstack/bin/gstack-brain-sync" --once 2>/dev/null || true
|
||||
```
|
||||
|
||||
|
||||
@@ -791,11 +795,15 @@ fi
|
||||
if [ "$_TEL" != "off" ] && [ -x ~/.claude/skills/gstack/bin/gstack-telemetry-log ]; then
|
||||
~/.claude/skills/gstack/bin/gstack-telemetry-log \
|
||||
--skill "SKILL_NAME" --duration "$_TEL_DUR" --outcome "OUTCOME" \
|
||||
--used-browse "USED_BROWSE" --session-id "$_SESSION_ID" 2>/dev/null &
|
||||
--used-browse "USED_BROWSE" --session-id "$_SESSION_ID" \
|
||||
--error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" 2>/dev/null &
|
||||
fi
|
||||
```
|
||||
|
||||
Replace `SKILL_NAME`, `OUTCOME`, and `USED_BROWSE` before running.
|
||||
Replace `ERROR_MESSAGE` with a short description of the error (if outcome is error,
|
||||
otherwise use empty string ""), and `FAILED_STEP` with the step name or number where
|
||||
the failure occurred (if outcome is error, otherwise use empty string "").
|
||||
|
||||
## Plan Status Footer
|
||||
|
||||
@@ -984,23 +992,34 @@ Then tell the user:
|
||||
"Copy the block above and paste it into your other agent's chat. The setup key
|
||||
expires in 5 minutes."
|
||||
|
||||
**If ngrok is installed but NOT authed:** Walk the user through authentication:
|
||||
**If ngrok is installed but NOT authed:** Walk the user through authentication.
|
||||
|
||||
SECURITY: the ngrok authtoken must NEVER pass through this chat, a Bash tool
|
||||
call, or shell history — a token pasted here lands in the transcript (and
|
||||
anything the transcript syncs to). The user runs the auth command in their
|
||||
OWN terminal; you only verify the result.
|
||||
|
||||
Tell the user:
|
||||
"ngrok is installed but not logged in. Let's fix that:
|
||||
"ngrok is installed but not logged in. Let's fix that — in your own terminal
|
||||
(not here; the token should never enter this chat):
|
||||
|
||||
1. Go to https://dashboard.ngrok.com/get-started/your-authtoken
|
||||
2. Copy your auth token
|
||||
3. Come back here and I'll run the auth command for you."
|
||||
3. In YOUR terminal, run: ngrok config add-authtoken <paste your token>
|
||||
4. Tell me 'done' when finished."
|
||||
|
||||
STOP here and wait for the user to provide their auth token.
|
||||
STOP here and wait for the user to say they've run it. Do NOT accept a pasted
|
||||
token; if the user pastes one anyway, tell them to rotate it at
|
||||
https://dashboard.ngrok.com (it's now in the transcript) and re-auth in their
|
||||
terminal with the new one.
|
||||
|
||||
When they provide it, run:
|
||||
When they say done, verify without touching the token:
|
||||
```bash
|
||||
ngrok config add-authtoken THEIR_TOKEN
|
||||
ngrok config check 2>/dev/null && echo "NGROK_AUTHED" || echo "NGROK_NOT_AUTHED"
|
||||
```
|
||||
|
||||
Then retry `$B pair-agent --client TARGET_HOST`.
|
||||
If `NGROK_AUTHED`: retry `$B pair-agent --client TARGET_HOST`.
|
||||
If still `NGROK_NOT_AUTHED`: ask them to re-run the command in their terminal.
|
||||
|
||||
**If ngrok is NOT installed:** Walk the user through installation:
|
||||
|
||||
|
||||
@@ -175,23 +175,34 @@ Then tell the user:
|
||||
"Copy the block above and paste it into your other agent's chat. The setup key
|
||||
expires in 5 minutes."
|
||||
|
||||
**If ngrok is installed but NOT authed:** Walk the user through authentication:
|
||||
**If ngrok is installed but NOT authed:** Walk the user through authentication.
|
||||
|
||||
SECURITY: the ngrok authtoken must NEVER pass through this chat, a Bash tool
|
||||
call, or shell history — a token pasted here lands in the transcript (and
|
||||
anything the transcript syncs to). The user runs the auth command in their
|
||||
OWN terminal; you only verify the result.
|
||||
|
||||
Tell the user:
|
||||
"ngrok is installed but not logged in. Let's fix that:
|
||||
"ngrok is installed but not logged in. Let's fix that — in your own terminal
|
||||
(not here; the token should never enter this chat):
|
||||
|
||||
1. Go to https://dashboard.ngrok.com/get-started/your-authtoken
|
||||
2. Copy your auth token
|
||||
3. Come back here and I'll run the auth command for you."
|
||||
3. In YOUR terminal, run: ngrok config add-authtoken <paste your token>
|
||||
4. Tell me 'done' when finished."
|
||||
|
||||
STOP here and wait for the user to provide their auth token.
|
||||
STOP here and wait for the user to say they've run it. Do NOT accept a pasted
|
||||
token; if the user pastes one anyway, tell them to rotate it at
|
||||
https://dashboard.ngrok.com (it's now in the transcript) and re-auth in their
|
||||
terminal with the new one.
|
||||
|
||||
When they provide it, run:
|
||||
When they say done, verify without touching the token:
|
||||
```bash
|
||||
ngrok config add-authtoken THEIR_TOKEN
|
||||
ngrok config check 2>/dev/null && echo "NGROK_AUTHED" || echo "NGROK_NOT_AUTHED"
|
||||
```
|
||||
|
||||
Then retry `$B pair-agent --client TARGET_HOST`.
|
||||
If `NGROK_AUTHED`: retry `$B pair-agent --client TARGET_HOST`.
|
||||
If still `NGROK_NOT_AUTHED`: ask them to re-run the command in their terminal.
|
||||
|
||||
**If ngrok is NOT installed:** Walk the user through installation:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user