diff --git a/SKILL.md b/SKILL.md index d314cb816ed..e66fed3f2d5 100644 --- a/SKILL.md +++ b/SKILL.md @@ -119,15 +119,15 @@ empty result, not a skipped step. Do not log obvious facts or one-time transient errors. -## Telemetry (run last) +## Skill end (run last) -After workflow completion, log telemetry with ONE command. OUTCOME is +After workflow completion, run ONE command. OUTCOME is success/error/abort/unknown; `SESSION_ID` and `TEL_START` are the values the -preamble's skill-start output echoed. It also drains the artifacts-sync queue -(the former skill-end sync step — do not run gstack-brain-sync separately). +preamble's skill-start output echoed. It releases the session lease and drains +the artifacts-sync queue (do not run gstack-brain-sync separately). It records +no telemetry. -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** This only writes local session state. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "gstack" --outcome OUTCOME \ @@ -138,7 +138,7 @@ preamble's skill-start output echoed. It also drains the artifacts-sync queue Replace `OUTCOME` and `USED_BROWSE` (yes/no) before running; substitute `SESSION_ID`/`TEL_START` from the skill-start echoes. `ERROR_MESSAGE`/`FAILED_STEP` are "" unless outcome is error. If the command is missing (stale install), skip -telemetry — it never blocks the workflow. +it — it never blocks the workflow. ## Plan Status Footer @@ -162,14 +162,6 @@ This is the gstack router. Its one job is to send the request to the right skill Windows, or Aside closed); on Aside there is nothing to open or import. 3. Otherwise, route by the rules below. If nothing matches, answer directly. -Best-effort, record which way you routed (never block on it). Set `ROUTE_OUTCOME` to -`browse` (sent to /browse), `routed` (sent to another skill), or `direct` (answered -directly, no skill matched), and replace `SESSION_ID` with the value the skill-start -output echoed: -```bash -~/.claude/skills/gstack/bin/gstack-telemetry-log --event-type route --skill gstack --outcome ROUTE_OUTCOME --session-id "SESSION_ID" 2>/dev/null || true -``` - If `PROACTIVE` is `false` or `off`: do not proactively invoke or suggest other gstack skills during this session, including by asking whether to run one ("want me to run /X?"). Only run skills the user explicitly invokes. This preference persists across sessions via diff --git a/SKILL.md.tmpl b/SKILL.md.tmpl index 58e44e0a292..c387ef7d782 100644 --- a/SKILL.md.tmpl +++ b/SKILL.md.tmpl @@ -38,14 +38,6 @@ This is the gstack router. Its one job is to send the request to the right skill Windows, or Aside closed); on Aside there is nothing to open or import. 3. Otherwise, route by the rules below. If nothing matches, answer directly. -Best-effort, record which way you routed (never block on it). Set `ROUTE_OUTCOME` to -`browse` (sent to /browse), `routed` (sent to another skill), or `direct` (answered -directly, no skill matched), and replace `SESSION_ID` with the value the skill-start -output echoed: -```bash -~/.claude/skills/gstack/bin/gstack-telemetry-log --event-type route --skill gstack --outcome ROUTE_OUTCOME --session-id "SESSION_ID" 2>/dev/null || true -``` - If `PROACTIVE` is `false` or `off`: do not proactively invoke or suggest other gstack skills during this session, including by asking whether to run one ("want me to run /X?"). Only run skills the user explicitly invokes. This preference persists across sessions via diff --git a/autoplan/SKILL.md b/autoplan/SKILL.md index 962e7a4d846..c9ea0b96ca0 100644 --- a/autoplan/SKILL.md +++ b/autoplan/SKILL.md @@ -119,15 +119,15 @@ BRANCH=$(~/.claude/skills/gstack/bin/gstack-slug --get BRANCH 2>/dev/null) jq -nc --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg skill "SKILL_NAME" --arg branch "$BRANCH" --arg insight "ONE_LINE_SUMMARY" '{ts:$ts,skill:$skill,branch:$branch,insight:$insight}' >> "$GSTACK_STATE_ROOT/analytics/eureka.jsonl" 2>/dev/null || true ``` -## Telemetry (run last) +## Skill end (run last) -After workflow completion, log telemetry with ONE command. OUTCOME is +After workflow completion, run ONE command. OUTCOME is success/error/abort/unknown; `SESSION_ID` and `TEL_START` are the values the -preamble's skill-start output echoed. It also drains the artifacts-sync queue -(the former skill-end sync step — do not run gstack-brain-sync separately). +preamble's skill-start output echoed. It releases the session lease and drains +the artifacts-sync queue (do not run gstack-brain-sync separately). It records +no telemetry. -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** This only writes local session state. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "autoplan" --outcome OUTCOME \ @@ -138,7 +138,7 @@ preamble's skill-start output echoed. It also drains the artifacts-sync queue Replace `OUTCOME` and `USED_BROWSE` (yes/no) before running; substitute `SESSION_ID`/`TEL_START` from the skill-start echoes. `ERROR_MESSAGE`/`FAILED_STEP` are "" unless outcome is error. If the command is missing (stale install), skip -telemetry — it never blocks the workflow. +it — it never blocks the workflow. ## Step 0: Detect platform and base branch @@ -227,7 +227,7 @@ Follow its instructions from top to bottom, **skipping these sections when prese - Shared preamble (load first) - Search Before Building - Contributor Mode -- Telemetry (run last) +- Skill end (run last) - Step 0: Detect platform and base branch - Review Readiness Dashboard - Plan File Review Report @@ -478,7 +478,7 @@ the tasks aggregator at Phase 4. Run every applicable skill and lazy section ful - AskUserQuestion Format - Shared preamble (load first) - Search Before Building -- Telemetry (run last) +- Skill end (run last) - Step 0: Detect platform and base branch - Review Readiness Dashboard - Plan File Review Report diff --git a/autoplan/SKILL.md.tmpl b/autoplan/SKILL.md.tmpl index 57c9a5e10d4..2e5108f739a 100644 --- a/autoplan/SKILL.md.tmpl +++ b/autoplan/SKILL.md.tmpl @@ -260,7 +260,7 @@ the tasks aggregator at Phase 4. Run every applicable skill and lazy section ful - AskUserQuestion Format - Shared preamble (load first) - Search Before Building -- Telemetry (run last) +- Skill end (run last) - Step 0: Detect platform and base branch - Review Readiness Dashboard - Plan File Review Report diff --git a/benchmark-models/SKILL.md b/benchmark-models/SKILL.md index 0f344471861..612b9df38ce 100644 --- a/benchmark-models/SKILL.md +++ b/benchmark-models/SKILL.md @@ -119,15 +119,15 @@ empty result, not a skipped step. Do not log obvious facts or one-time transient errors. -## Telemetry (run last) +## Skill end (run last) -After workflow completion, log telemetry with ONE command. OUTCOME is +After workflow completion, run ONE command. OUTCOME is success/error/abort/unknown; `SESSION_ID` and `TEL_START` are the values the -preamble's skill-start output echoed. It also drains the artifacts-sync queue -(the former skill-end sync step — do not run gstack-brain-sync separately). +preamble's skill-start output echoed. It releases the session lease and drains +the artifacts-sync queue (do not run gstack-brain-sync separately). It records +no telemetry. -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** This only writes local session state. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "benchmark-models" --outcome OUTCOME \ @@ -138,7 +138,7 @@ preamble's skill-start output echoed. It also drains the artifacts-sync queue Replace `OUTCOME` and `USED_BROWSE` (yes/no) before running; substitute `SESSION_ID`/`TEL_START` from the skill-start echoes. `ERROR_MESSAGE`/`FAILED_STEP` are "" unless outcome is error. If the command is missing (stale install), skip -telemetry — it never blocks the workflow. +it — it never blocks the workflow. ## Plan Status Footer diff --git a/benchmark/SKILL.md b/benchmark/SKILL.md index ee09bbba430..a27c8459587 100644 --- a/benchmark/SKILL.md +++ b/benchmark/SKILL.md @@ -120,15 +120,15 @@ empty result, not a skipped step. Do not log obvious facts or one-time transient errors. -## Telemetry (run last) +## Skill end (run last) -After workflow completion, log telemetry with ONE command. OUTCOME is +After workflow completion, run ONE command. OUTCOME is success/error/abort/unknown; `SESSION_ID` and `TEL_START` are the values the -preamble's skill-start output echoed. It also drains the artifacts-sync queue -(the former skill-end sync step — do not run gstack-brain-sync separately). +preamble's skill-start output echoed. It releases the session lease and drains +the artifacts-sync queue (do not run gstack-brain-sync separately). It records +no telemetry. -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** This only writes local session state. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "benchmark" --outcome OUTCOME \ @@ -139,7 +139,7 @@ preamble's skill-start output echoed. It also drains the artifacts-sync queue Replace `OUTCOME` and `USED_BROWSE` (yes/no) before running; substitute `SESSION_ID`/`TEL_START` from the skill-start echoes. `ERROR_MESSAGE`/`FAILED_STEP` are "" unless outcome is error. If the command is missing (stale install), skip -telemetry — it never blocks the workflow. +it — it never blocks the workflow. ## Plan Status Footer diff --git a/bin/gstack-config b/bin/gstack-config index 8eb26cf7289..240d9e85b23 100755 --- a/bin/gstack-config +++ b/bin/gstack-config @@ -82,7 +82,7 @@ CONFIG_HEADER='# gstack configuration — edit freely, changes take effect on ne # # telemetry. # # ─── Updates ───────────────────────────────────────────────────────── -# auto_upgrade: false # true = silently upgrade on session start +# auto_upgrade: true # true = silently upgrade on session start (fork default) # update_check: true # false = suppress version check notifications # update_channel: auto # auto = stable when team_mode is true, else main # # stable = the weekly tagged release (refs/heads/stable) @@ -330,7 +330,7 @@ lookup_default() { proactive) echo "core" ;; # core | all | off (true = all, false = off); core suggests only /office-hours, /review, /qa, /ship routing_declined) echo "false" ;; telemetry) echo "off" ;; - auto_upgrade) echo "false" ;; + auto_upgrade) echo "true" ;; # fork: silent update from cheese-work/gstack (CHE-5564) update_check) echo "true" ;; update_channel) echo "auto" ;; # auto | stable | main — bin/gstack-update-channel.sh resolves auto (docs/releases.md) skill_prefix) echo "false" ;; diff --git a/bin/gstack-skill-end b/bin/gstack-skill-end index 44149581452..7dd523da4a3 100755 --- a/bin/gstack-skill-end +++ b/bin/gstack-skill-end @@ -37,7 +37,7 @@ _BIN="$_SCRIPT_DIR" . "$(dirname "$0")/gstack-state-root.sh" 2>/dev/null || { echo "$0: cannot resolve the gstack state root: $(dirname "$0")/gstack-state-root.sh is missing. fix: reinstall with ./setup or /gstack-upgrade (docs/state-root.md)" >&2; exit 1; } gstack_state_root_select _GH="$_gstack_sr_root" -_TEL=$("$_BIN/gstack-config" get telemetry 2>/dev/null || echo off) +_TEL=off # fork (CHE-5564): telemetry is hard off # Plan B1: an unattended session writes no usage, sends no telemetry and never # drains or pushes the artifacts queue, whatever the inherited settings say. The # upgrade offer it skipped at start becomes one line here, read from the @@ -72,16 +72,4 @@ if [ "$_SESSION_KIND" != "unattended" ]; then "$_BIN/gstack-brain-sync" --once 2>/dev/null || true fi -# Local analytics (gated on telemetry setting). -if [ "$_TEL" != "off" ]; then - echo '{"skill":"'"$SKILL_NAME"'","duration_s":"'"$_TEL_DUR"'","outcome":"'"$OUTCOME"'","browse":"'"$USED_BROWSE"'","session":"'"$SESSION_ID"'","ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'"}' >> "$_GH/analytics/skill-usage.jsonl" 2>/dev/null || true -fi - -# Remote telemetry (opt-in, requires binary). -if [ "$_TEL" != "off" ] && [ -x "$_BIN/gstack-telemetry-log" ]; then - "$_BIN/gstack-telemetry-log" \ - --skill "$SKILL_NAME" --duration "$_TEL_DUR" --outcome "$OUTCOME" \ - --used-browse "$USED_BROWSE" --session-id "$SESSION_ID" \ - --error-message "$ERROR_MESSAGE" --failed-step "$FAILED_STEP" 2>/dev/null & -fi echo "SKILL_END: recorded outcome=$OUTCOME duration_s=$_TEL_DUR" diff --git a/bin/gstack-skill-start b/bin/gstack-skill-start index 6d2a52baece..180f6cbdef6 100755 --- a/bin/gstack-skill-start +++ b/bin/gstack-skill-start @@ -229,8 +229,9 @@ fi printf 'FIRST_TASK: %s\n' "$_FIRST_TASK" | _sanitize _LAKE_SEEN=$([ -f "$_GH/.completeness-intro-seen" ] && echo "yes" || echo "no") echo "LAKE_INTRO: $_LAKE_SEEN" -_TEL=$("$_BIN/gstack-config" get telemetry 2>/dev/null || true) -_TEL_PROMPTED=$([ -f "$_GH/.telemetry-prompted" ] && echo "yes" || echo "no") +# Fork (CHE-5564): telemetry is hard off and never prompted. +_TEL=off +_TEL_PROMPTED=yes _TEL_START=$(date +%s) # PID+epoch alone is guessable; a random suffix makes the block-binding token # unforgeable by content reflected into the same tool result. Falls back to @@ -558,11 +559,20 @@ _emit_block() { echo "GSTACK_INSTRUCTION_BEGIN: $1 $_SESSION_ID"; cat; echo "GST # guard: the former is the gate's inverse, the latter is interactive-only. if [ "$_NO_HUMAN" != "yes" ]; then -# Upgrade flow (gated: update-check emitted something above). +# Upgrade (fork, CHE-5564): no question. A newer cheese-work/gstack version +# installs silently when auto_upgrade is true (the fork default); a failed +# upgrade stays silent and retries at the next session start. if [ -n "$_UPD" ]; then - _emit_block upgrade-flow < \`: read \`$_ROOT_DIR/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 it shows \`JUST_UPGRADED \`: print "Running gstack v{to} (just updated!)". If \`SPAWNED_SESSION\` is true, skip feature discovery. After upgrade prompts, continue the workflow. + case "$_UPD" in + UPGRADE_AVAILABLE*) + [ "$("$_BIN/gstack-config" get auto_upgrade 2>/dev/null || true)" = "true" ] \ + && "$_BIN/gstack-upgrade" >/dev/null 2>&1 || true ;; + JUST_UPGRADED*) + _emit_block upgrade-flow < \`: print "Running gstack v{to} (just updated!)". If \`SPAWNED_SESSION\` is true, skip feature discovery. EOI + ;; + esac fi # Feature discovery (one prompt per session, marker-gated). These are # machine-local UX acknowledgements, so keep them in GSTACK_HOME rather than @@ -597,29 +607,8 @@ Say: "gstack follows the **Boil the Ocean** principle — complete coverage, min EOI fi -# Telemetry opt-in (interactive; consent — the model acks after answering). -if [ "$_TEL_PROMPTED" = "no" ] && [ "$_LAKE_SEEN" = "yes" ]; then - _emit_block telemetry-prompt < Help gstack get better. Yes sends, per skill run: skill name, outcome, duration, gstack version, OS, a redacted error summary and a stable device ID. Never code, file paths, prompts, repo or branch names. Your repo and branch are also logged on this machine (analytics/skill-usage.jsonl) and stripped before upload; off logs nothing. Not covered by this answer: the update check asks GitHub for the latest version about hourly (\`gstack-config set update_check false\`), and outside reviews send code to Codex or Claude Code (\`gstack-config set codex_reviews disabled\`). Details: README "Privacy & Telemetry". - -Options: -- A) Help gstack get better! (recommended) -- B) No thanks - -If A: run \`$_BIN/gstack-config set telemetry community\`. If B, ask the follow-up: - -> Anonymous mode sends only aggregate usage, no unique ID. - -Options: A) Sure, anonymous is fine B) No thanks, fully off -If B→A: \`$_BIN/gstack-config set telemetry anonymous\`. If B→B: \`$_BIN/gstack-config set telemetry off\`. -Always run: \`touch "$_GH/.telemetry-prompted"\`. -EOI -fi - # Proactive-suggestions opt-in (interactive; a stored off answered it above). -if [ "$_PROACTIVE_PROMPTED" = "no" ] && [ "$_TEL_PROMPTED" = "yes" ]; then +if [ "$_PROACTIVE_PROMPTED" = "no" ] && [ "$_LAKE_SEEN" = "yes" ]; then _emit_block proactive-prompt </dev/null 2>&1; then GSTACK_BUN_CONFIG=NUL; fi ;; esac GSTACK_DIR="${GSTACK_DIR:-$(cd "$(dirname "$0")/.." && pwd)}" diff --git a/bin/gstack-telemetry-sync b/bin/gstack-telemetry-sync index 9ad5d62f3ed..5cba21578cb 100755 --- a/bin/gstack-telemetry-sync +++ b/bin/gstack-telemetry-sync @@ -10,6 +10,9 @@ # GSTACK_DIR — override auto-detected gstack root # GSTACK_SUPABASE_URL — override Supabase project URL set -uo pipefail +# cheese-work fork (CHE-5564): telemetry is hard off. No event is written or sent, whatever the config says. +exit 0 + GSTACK_DIR="${GSTACK_DIR:-$(cd "$(dirname "$0")/.." && pwd)}" . "$(dirname "$0")/gstack-state-root.sh" 2>/dev/null || { echo "$0: cannot resolve the gstack state root: $(dirname "$0")/gstack-state-root.sh is missing. fix: reinstall with ./setup or /gstack-upgrade (docs/state-root.md)" >&2; exit 1; } diff --git a/bin/gstack-update-check b/bin/gstack-update-check index 986519978dc..a048a6bcb6c 100755 --- a/bin/gstack-update-check +++ b/bin/gstack-update-check @@ -82,10 +82,10 @@ VERSION_FILE="$GSTACK_DIR/VERSION" . "$GSTACK_DIR/bin/gstack-update-channel.sh" 2>/dev/null || gstack_update_channel() { echo main; } CHANNEL=$(gstack_update_channel "$GSTACK_DIR" 2>/dev/null) || CHANNEL=main case "$CHANNEL" in stable|main) ;; *) CHANNEL=main ;; esac -REMOTE_RAW_BASE="${GSTACK_REMOTE_RAW_BASE:-https://raw.githubusercontent.com/garrytan/gstack}" +REMOTE_RAW_BASE="${GSTACK_REMOTE_RAW_BASE:-https://raw.githubusercontent.com/cheese-work/gstack}" REMOTE_URL="${GSTACK_REMOTE_URL:-$REMOTE_RAW_BASE/$CHANNEL/VERSION}" -REMOTE_REPO="${GSTACK_REMOTE_REPO:-https://github.com/garrytan/gstack.git}" -COMPARE_API="${GSTACK_COMPARE_API:-https://api.github.com/repos/garrytan/gstack/compare}" +REMOTE_REPO="${GSTACK_REMOTE_REPO:-https://github.com/cheese-work/gstack.git}" +COMPARE_API="${GSTACK_COMPARE_API:-https://api.github.com/repos/cheese-work/gstack/compare}" # ─── Force flag (busts cache + snooze for standalone /gstack-upgrade) ── FORCE=0 @@ -278,32 +278,7 @@ fi # ─── Step 4: Slow path — fetch remote version ──────────────── mkdir -p "$STATE_DIR" -# Fire Supabase install ping in background (parallel, non-blocking) -# This logs an update check event for community health metrics via edge function. -# If Supabase is not configured or telemetry is off, this is a no-op. -if [ -z "${GSTACK_SUPABASE_URL:-}" ] && [ -f "$GSTACK_DIR/supabase/config.sh" ]; then - . "$GSTACK_DIR/supabase/config.sh" -fi -_SUPA_URL="${GSTACK_SUPABASE_URL:-}" -_SUPA_KEY="${GSTACK_SUPABASE_ANON_KEY:-}" -# Respect telemetry opt-out — don't ping Supabase if user set telemetry: off -_TEL_TIER="$("$GSTACK_DIR/bin/gstack-config" get telemetry 2>/dev/null || true)" -if [ -n "$_SUPA_URL" ] && [ -n "$_SUPA_KEY" ] && [ "${_TEL_TIER:-off}" != "off" ]; then - _OS="$(uname -s | tr '[:upper:]' '[:lower:]')" - # Receipted (fail-open) and fully backgrounded: the receipt write happens - # inside the background subshell, so it can never block this script's exit. - _PING_FILE="$(mktemp "${TMPDIR:-/tmp}/gstack-update-ping-XXXXXX" 2>/dev/null)" || _PING_FILE="" - if [ -n "$_PING_FILE" ]; then - printf '{"version":"%s","os":"%s"}' "$LOCAL" "$_OS" > "$_PING_FILE" - _SUPA_HOST="${_SUPA_URL#*://}"; _SUPA_HOST="${_SUPA_HOST%%/*}" - GSTACK_HOME="$STATE_DIR" _receipted_curl open update-check "$_SUPA_HOST" update-check-ping "telemetry=$_TEL_TIER" "$_PING_FILE" \ - curl -sf --max-time 5 \ - -X POST "${_SUPA_URL}/functions/v1/update-check" \ - -H "Content-Type: application/json" \ - -H "apikey: ${_SUPA_KEY}" \ - >/dev/null 2>&1 & - fi -fi +# Telemetry is hard off in the fork (CHE-5564): no Supabase update-check ping. # Resolve VERSION via a SHA-pinned raw URL. GitHub's branch-raw CDN # (raw.githubusercontent.com////...) can serve stale diff --git a/browse/SKILL.md b/browse/SKILL.md index ca934a60be6..77c35e38735 100644 --- a/browse/SKILL.md +++ b/browse/SKILL.md @@ -119,15 +119,15 @@ empty result, not a skipped step. Do not log obvious facts or one-time transient errors. -## Telemetry (run last) +## Skill end (run last) -After workflow completion, log telemetry with ONE command. OUTCOME is +After workflow completion, run ONE command. OUTCOME is success/error/abort/unknown; `SESSION_ID` and `TEL_START` are the values the -preamble's skill-start output echoed. It also drains the artifacts-sync queue -(the former skill-end sync step — do not run gstack-brain-sync separately). +preamble's skill-start output echoed. It releases the session lease and drains +the artifacts-sync queue (do not run gstack-brain-sync separately). It records +no telemetry. -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** This only writes local session state. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "browse" --outcome OUTCOME \ @@ -138,7 +138,7 @@ preamble's skill-start output echoed. It also drains the artifacts-sync queue Replace `OUTCOME` and `USED_BROWSE` (yes/no) before running; substitute `SESSION_ID`/`TEL_START` from the skill-start echoes. `ERROR_MESSAGE`/`FAILED_STEP` are "" unless outcome is error. If the command is missing (stale install), skip -telemetry — it never blocks the workflow. +it — it never blocks the workflow. ## Plan Status Footer diff --git a/canary/SKILL.md b/canary/SKILL.md index 0ef61ffd7fd..8ffc95b3447 100644 --- a/canary/SKILL.md +++ b/canary/SKILL.md @@ -74,15 +74,15 @@ Write (free-form only after confirmation; its words go in that file too, with `- Exit code 2 = rejected as not user-originated; do not retry. On success: "Set `` → ``. Active immediately." -## Telemetry (run last) +## Skill end (run last) -After workflow completion, log telemetry with ONE command. OUTCOME is +After workflow completion, run ONE command. OUTCOME is success/error/abort/unknown; `SESSION_ID` and `TEL_START` are the values the -preamble's skill-start output echoed. It also drains the artifacts-sync queue -(the former skill-end sync step — do not run gstack-brain-sync separately). +preamble's skill-start output echoed. It releases the session lease and drains +the artifacts-sync queue (do not run gstack-brain-sync separately). It records +no telemetry. -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** This only writes local session state. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "canary" --outcome OUTCOME \ @@ -93,7 +93,7 @@ preamble's skill-start output echoed. It also drains the artifacts-sync queue Replace `OUTCOME` and `USED_BROWSE` (yes/no) before running; substitute `SESSION_ID`/`TEL_START` from the skill-start echoes. `ERROR_MESSAGE`/`FAILED_STEP` are "" unless outcome is error. If the command is missing (stale install), skip -telemetry — it never blocks the workflow. +it — it never blocks the workflow. ## BROWSER SETUP (Aside — run this check BEFORE any browser step) diff --git a/captain/SKILL.md b/captain/SKILL.md index 2d6544b8442..1cb452677d7 100644 --- a/captain/SKILL.md +++ b/captain/SKILL.md @@ -81,15 +81,15 @@ Write (free-form only after confirmation; its words go in that file too, with `- Exit code 2 = rejected as not user-originated; do not retry. On success: "Set `` → ``. Active immediately." -## Telemetry (run last) +## Skill end (run last) -After workflow completion, log telemetry with ONE command. OUTCOME is +After workflow completion, run ONE command. OUTCOME is success/error/abort/unknown; `SESSION_ID` and `TEL_START` are the values the -preamble's skill-start output echoed. It also drains the artifacts-sync queue -(the former skill-end sync step — do not run gstack-brain-sync separately). +preamble's skill-start output echoed. It releases the session lease and drains +the artifacts-sync queue (do not run gstack-brain-sync separately). It records +no telemetry. -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** This only writes local session state. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "captain" --outcome OUTCOME \ @@ -100,7 +100,7 @@ preamble's skill-start output echoed. It also drains the artifacts-sync queue Replace `OUTCOME` and `USED_BROWSE` (yes/no) before running; substitute `SESSION_ID`/`TEL_START` from the skill-start echoes. `ERROR_MESSAGE`/`FAILED_STEP` are "" unless outcome is error. If the command is missing (stale install), skip -telemetry — it never blocks the workflow. +it — it never blocks the workflow. # /captain: one controller, many lanes diff --git a/changelog.d/che-5564-fork-update-no-telemetry.md b/changelog.d/che-5564-fork-update-no-telemetry.md new file mode 100644 index 00000000000..872b7e6d1c3 --- /dev/null +++ b/changelog.d/che-5564-fork-update-no-telemetry.md @@ -0,0 +1 @@ +- **The cheese-work fork updates from itself without a prompt and has telemetry hard off (CHE-5564).** `gstack-update-check` now reads versions only from `cheese-work/gstack`, never `garrytan/gstack`. `auto_upgrade` defaults to `true`, so `gstack-skill-start` runs `gstack-upgrade` silently when a newer fork version exists. It emits no `upgrade-flow` question and no `telemetry-prompt` block. Telemetry has no prompt, no send path and no "Telemetry (run last)" section in generated skills; the `gstack-skill-end` call stays as "Skill end (run last)" for the lease release and the artifacts-sync drain. diff --git a/codex/SKILL.md b/codex/SKILL.md index 01a54c47840..659e1fe60cb 100644 --- a/codex/SKILL.md +++ b/codex/SKILL.md @@ -105,15 +105,15 @@ BRANCH=$(~/.claude/skills/gstack/bin/gstack-slug --get BRANCH 2>/dev/null) jq -nc --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg skill "SKILL_NAME" --arg branch "$BRANCH" --arg insight "ONE_LINE_SUMMARY" '{ts:$ts,skill:$skill,branch:$branch,insight:$insight}' >> "$GSTACK_STATE_ROOT/analytics/eureka.jsonl" 2>/dev/null || true ``` -## Telemetry (run last) +## Skill end (run last) -After workflow completion, log telemetry with ONE command. OUTCOME is +After workflow completion, run ONE command. OUTCOME is success/error/abort/unknown; `SESSION_ID` and `TEL_START` are the values the -preamble's skill-start output echoed. It also drains the artifacts-sync queue -(the former skill-end sync step — do not run gstack-brain-sync separately). +preamble's skill-start output echoed. It releases the session lease and drains +the artifacts-sync queue (do not run gstack-brain-sync separately). It records +no telemetry. -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** This only writes local session state. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "codex" --outcome OUTCOME \ @@ -124,7 +124,7 @@ preamble's skill-start output echoed. It also drains the artifacts-sync queue Replace `OUTCOME` and `USED_BROWSE` (yes/no) before running; substitute `SESSION_ID`/`TEL_START` from the skill-start echoes. `ERROR_MESSAGE`/`FAILED_STEP` are "" unless outcome is error. If the command is missing (stale install), skip -telemetry — it never blocks the workflow. +it — it never blocks the workflow. ## Step 0: Detect platform and base branch diff --git a/context-restore/SKILL.md b/context-restore/SKILL.md index ee68c875206..26eb4baee32 100644 --- a/context-restore/SKILL.md +++ b/context-restore/SKILL.md @@ -76,15 +76,15 @@ Write (free-form only after confirmation; its words go in that file too, with `- Exit code 2 = rejected as not user-originated; do not retry. On success: "Set `` → ``. Active immediately." -## Telemetry (run last) +## Skill end (run last) -After workflow completion, log telemetry with ONE command. OUTCOME is +After workflow completion, run ONE command. OUTCOME is success/error/abort/unknown; `SESSION_ID` and `TEL_START` are the values the -preamble's skill-start output echoed. It also drains the artifacts-sync queue -(the former skill-end sync step — do not run gstack-brain-sync separately). +preamble's skill-start output echoed. It releases the session lease and drains +the artifacts-sync queue (do not run gstack-brain-sync separately). It records +no telemetry. -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** This only writes local session state. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "context-restore" --outcome OUTCOME \ @@ -95,7 +95,7 @@ preamble's skill-start output echoed. It also drains the artifacts-sync queue Replace `OUTCOME` and `USED_BROWSE` (yes/no) before running; substitute `SESSION_ID`/`TEL_START` from the skill-start echoes. `ERROR_MESSAGE`/`FAILED_STEP` are "" unless outcome is error. If the command is missing (stale install), skip -telemetry — it never blocks the workflow. +it — it never blocks the workflow. # /context-restore — Restore Saved Working Context diff --git a/context-save/SKILL.md b/context-save/SKILL.md index 05c13659a0d..ed8179a08ed 100644 --- a/context-save/SKILL.md +++ b/context-save/SKILL.md @@ -76,15 +76,15 @@ Write (free-form only after confirmation; its words go in that file too, with `- Exit code 2 = rejected as not user-originated; do not retry. On success: "Set `` → ``. Active immediately." -## Telemetry (run last) +## Skill end (run last) -After workflow completion, log telemetry with ONE command. OUTCOME is +After workflow completion, run ONE command. OUTCOME is success/error/abort/unknown; `SESSION_ID` and `TEL_START` are the values the -preamble's skill-start output echoed. It also drains the artifacts-sync queue -(the former skill-end sync step — do not run gstack-brain-sync separately). +preamble's skill-start output echoed. It releases the session lease and drains +the artifacts-sync queue (do not run gstack-brain-sync separately). It records +no telemetry. -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** This only writes local session state. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "context-save" --outcome OUTCOME \ @@ -95,7 +95,7 @@ preamble's skill-start output echoed. It also drains the artifacts-sync queue Replace `OUTCOME` and `USED_BROWSE` (yes/no) before running; substitute `SESSION_ID`/`TEL_START` from the skill-start echoes. `ERROR_MESSAGE`/`FAILED_STEP` are "" unless outcome is error. If the command is missing (stale install), skip -telemetry — it never blocks the workflow. +it — it never blocks the workflow. # /context-save — Save Working Context diff --git a/design-consultation/SKILL.md b/design-consultation/SKILL.md index 71ecbe7df2f..4681f821783 100644 --- a/design-consultation/SKILL.md +++ b/design-consultation/SKILL.md @@ -130,15 +130,15 @@ BRANCH=$(~/.claude/skills/gstack/bin/gstack-slug --get BRANCH 2>/dev/null) jq -nc --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg skill "SKILL_NAME" --arg branch "$BRANCH" --arg insight "ONE_LINE_SUMMARY" '{ts:$ts,skill:$skill,branch:$branch,insight:$insight}' >> "$GSTACK_STATE_ROOT/analytics/eureka.jsonl" 2>/dev/null || true ``` -## Telemetry (run last) +## Skill end (run last) -After workflow completion, log telemetry with ONE command. OUTCOME is +After workflow completion, run ONE command. OUTCOME is success/error/abort/unknown; `SESSION_ID` and `TEL_START` are the values the -preamble's skill-start output echoed. It also drains the artifacts-sync queue -(the former skill-end sync step — do not run gstack-brain-sync separately). +preamble's skill-start output echoed. It releases the session lease and drains +the artifacts-sync queue (do not run gstack-brain-sync separately). It records +no telemetry. -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** This only writes local session state. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "design-consultation" --outcome OUTCOME \ @@ -149,7 +149,7 @@ preamble's skill-start output echoed. It also drains the artifacts-sync queue Replace `OUTCOME` and `USED_BROWSE` (yes/no) before running; substitute `SESSION_ID`/`TEL_START` from the skill-start echoes. `ERROR_MESSAGE`/`FAILED_STEP` are "" unless outcome is error. If the command is missing (stale install), skip -telemetry — it never blocks the workflow. +it — it never blocks the workflow. # /design-consultation: Your Design System, Built Together diff --git a/design-html/SKILL.md b/design-html/SKILL.md index 57ee215e5ea..81511c24a4f 100644 --- a/design-html/SKILL.md +++ b/design-html/SKILL.md @@ -77,15 +77,15 @@ Write (free-form only after confirmation; its words go in that file too, with `- Exit code 2 = rejected as not user-originated; do not retry. On success: "Set `` → ``. Active immediately." -## Telemetry (run last) +## Skill end (run last) -After workflow completion, log telemetry with ONE command. OUTCOME is +After workflow completion, run ONE command. OUTCOME is success/error/abort/unknown; `SESSION_ID` and `TEL_START` are the values the -preamble's skill-start output echoed. It also drains the artifacts-sync queue -(the former skill-end sync step — do not run gstack-brain-sync separately). +preamble's skill-start output echoed. It releases the session lease and drains +the artifacts-sync queue (do not run gstack-brain-sync separately). It records +no telemetry. -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** This only writes local session state. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "design-html" --outcome OUTCOME \ @@ -96,7 +96,7 @@ preamble's skill-start output echoed. It also drains the artifacts-sync queue Replace `OUTCOME` and `USED_BROWSE` (yes/no) before running; substitute `SESSION_ID`/`TEL_START` from the skill-start echoes. `ERROR_MESSAGE`/`FAILED_STEP` are "" unless outcome is error. If the command is missing (stale install), skip -telemetry — it never blocks the workflow. +it — it never blocks the workflow. # /design-html: Pretext-Native HTML Engine diff --git a/design-motion/SKILL.md b/design-motion/SKILL.md index 01d2938cdd1..c6ffa486469 100644 --- a/design-motion/SKILL.md +++ b/design-motion/SKILL.md @@ -76,15 +76,15 @@ Write (free-form only after confirmation; its words go in that file too, with `- Exit code 2 = rejected as not user-originated; do not retry. On success: "Set `` → ``. Active immediately." -## Telemetry (run last) +## Skill end (run last) -After workflow completion, log telemetry with ONE command. OUTCOME is +After workflow completion, run ONE command. OUTCOME is success/error/abort/unknown; `SESSION_ID` and `TEL_START` are the values the -preamble's skill-start output echoed. It also drains the artifacts-sync queue -(the former skill-end sync step — do not run gstack-brain-sync separately). +preamble's skill-start output echoed. It releases the session lease and drains +the artifacts-sync queue (do not run gstack-brain-sync separately). It records +no telemetry. -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** This only writes local session state. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "design-motion" --outcome OUTCOME \ @@ -95,7 +95,7 @@ preamble's skill-start output echoed. It also drains the artifacts-sync queue Replace `OUTCOME` and `USED_BROWSE` (yes/no) before running; substitute `SESSION_ID`/`TEL_START` from the skill-start echoes. `ERROR_MESSAGE`/`FAILED_STEP` are "" unless outcome is error. If the command is missing (stale install), skip -telemetry — it never blocks the workflow. +it — it never blocks the workflow. # /design-motion: Showcase Loops from an Approved Design diff --git a/design-review/SKILL.md b/design-review/SKILL.md index 8c6e3537a13..aaaf3ab2bb7 100644 --- a/design-review/SKILL.md +++ b/design-review/SKILL.md @@ -108,15 +108,15 @@ BRANCH=$(~/.claude/skills/gstack/bin/gstack-slug --get BRANCH 2>/dev/null) jq -nc --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg skill "SKILL_NAME" --arg branch "$BRANCH" --arg insight "ONE_LINE_SUMMARY" '{ts:$ts,skill:$skill,branch:$branch,insight:$insight}' >> "$GSTACK_STATE_ROOT/analytics/eureka.jsonl" 2>/dev/null || true ``` -## Telemetry (run last) +## Skill end (run last) -After workflow completion, log telemetry with ONE command. OUTCOME is +After workflow completion, run ONE command. OUTCOME is success/error/abort/unknown; `SESSION_ID` and `TEL_START` are the values the -preamble's skill-start output echoed. It also drains the artifacts-sync queue -(the former skill-end sync step — do not run gstack-brain-sync separately). +preamble's skill-start output echoed. It releases the session lease and drains +the artifacts-sync queue (do not run gstack-brain-sync separately). It records +no telemetry. -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** This only writes local session state. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "design-review" --outcome OUTCOME \ @@ -127,7 +127,7 @@ preamble's skill-start output echoed. It also drains the artifacts-sync queue Replace `OUTCOME` and `USED_BROWSE` (yes/no) before running; substitute `SESSION_ID`/`TEL_START` from the skill-start echoes. `ERROR_MESSAGE`/`FAILED_STEP` are "" unless outcome is error. If the command is missing (stale install), skip -telemetry — it never blocks the workflow. +it — it never blocks the workflow. diff --git a/design-shotgun/SKILL.md b/design-shotgun/SKILL.md index 803fa51a662..7fd4411c8ed 100644 --- a/design-shotgun/SKILL.md +++ b/design-shotgun/SKILL.md @@ -94,15 +94,15 @@ Write (free-form only after confirmation; its words go in that file too, with `- Exit code 2 = rejected as not user-originated; do not retry. On success: "Set `` → ``. Active immediately." -## Telemetry (run last) +## Skill end (run last) -After workflow completion, log telemetry with ONE command. OUTCOME is +After workflow completion, run ONE command. OUTCOME is success/error/abort/unknown; `SESSION_ID` and `TEL_START` are the values the -preamble's skill-start output echoed. It also drains the artifacts-sync queue -(the former skill-end sync step — do not run gstack-brain-sync separately). +preamble's skill-start output echoed. It releases the session lease and drains +the artifacts-sync queue (do not run gstack-brain-sync separately). It records +no telemetry. -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** This only writes local session state. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "design-shotgun" --outcome OUTCOME \ @@ -113,7 +113,7 @@ preamble's skill-start output echoed. It also drains the artifacts-sync queue Replace `OUTCOME` and `USED_BROWSE` (yes/no) before running; substitute `SESSION_ID`/`TEL_START` from the skill-start echoes. `ERROR_MESSAGE`/`FAILED_STEP` are "" unless outcome is error. If the command is missing (stale install), skip -telemetry — it never blocks the workflow. +it — it never blocks the workflow. # /design-shotgun: Visual Design Exploration diff --git a/devex-review/SKILL.md b/devex-review/SKILL.md index d22a5cea18c..5123849b2f0 100644 --- a/devex-review/SKILL.md +++ b/devex-review/SKILL.md @@ -106,15 +106,15 @@ BRANCH=$(~/.claude/skills/gstack/bin/gstack-slug --get BRANCH 2>/dev/null) jq -nc --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg skill "SKILL_NAME" --arg branch "$BRANCH" --arg insight "ONE_LINE_SUMMARY" '{ts:$ts,skill:$skill,branch:$branch,insight:$insight}' >> "$GSTACK_STATE_ROOT/analytics/eureka.jsonl" 2>/dev/null || true ``` -## Telemetry (run last) +## Skill end (run last) -After workflow completion, log telemetry with ONE command. OUTCOME is +After workflow completion, run ONE command. OUTCOME is success/error/abort/unknown; `SESSION_ID` and `TEL_START` are the values the -preamble's skill-start output echoed. It also drains the artifacts-sync queue -(the former skill-end sync step — do not run gstack-brain-sync separately). +preamble's skill-start output echoed. It releases the session lease and drains +the artifacts-sync queue (do not run gstack-brain-sync separately). It records +no telemetry. -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** This only writes local session state. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "devex-review" --outcome OUTCOME \ @@ -125,7 +125,7 @@ preamble's skill-start output echoed. It also drains the artifacts-sync queue Replace `OUTCOME` and `USED_BROWSE` (yes/no) before running; substitute `SESSION_ID`/`TEL_START` from the skill-start echoes. `ERROR_MESSAGE`/`FAILED_STEP` are "" unless outcome is error. If the command is missing (stale install), skip -telemetry — it never blocks the workflow. +it — it never blocks the workflow. ## Step 0: Detect platform and base branch diff --git a/diagram/SKILL.md b/diagram/SKILL.md index 0a050b64761..b56f771d317 100644 --- a/diagram/SKILL.md +++ b/diagram/SKILL.md @@ -122,15 +122,15 @@ empty result, not a skipped step. Do not log obvious facts or one-time transient errors. -## Telemetry (run last) +## Skill end (run last) -After workflow completion, log telemetry with ONE command. OUTCOME is +After workflow completion, run ONE command. OUTCOME is success/error/abort/unknown; `SESSION_ID` and `TEL_START` are the values the -preamble's skill-start output echoed. It also drains the artifacts-sync queue -(the former skill-end sync step — do not run gstack-brain-sync separately). +preamble's skill-start output echoed. It releases the session lease and drains +the artifacts-sync queue (do not run gstack-brain-sync separately). It records +no telemetry. -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** This only writes local session state. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "diagram" --outcome OUTCOME \ @@ -141,7 +141,7 @@ preamble's skill-start output echoed. It also drains the artifacts-sync queue Replace `OUTCOME` and `USED_BROWSE` (yes/no) before running; substitute `SESSION_ID`/`TEL_START` from the skill-start echoes. `ERROR_MESSAGE`/`FAILED_STEP` are "" unless outcome is error. If the command is missing (stale install), skip -telemetry — it never blocks the workflow. +it — it never blocks the workflow. ## Plan Status Footer diff --git a/document-generate/SKILL.md b/document-generate/SKILL.md index 1c0dba74304..0cae99638d6 100644 --- a/document-generate/SKILL.md +++ b/document-generate/SKILL.md @@ -80,15 +80,15 @@ Write (free-form only after confirmation; its words go in that file too, with `- Exit code 2 = rejected as not user-originated; do not retry. On success: "Set `` → ``. Active immediately." -## Telemetry (run last) +## Skill end (run last) -After workflow completion, log telemetry with ONE command. OUTCOME is +After workflow completion, run ONE command. OUTCOME is success/error/abort/unknown; `SESSION_ID` and `TEL_START` are the values the -preamble's skill-start output echoed. It also drains the artifacts-sync queue -(the former skill-end sync step — do not run gstack-brain-sync separately). +preamble's skill-start output echoed. It releases the session lease and drains +the artifacts-sync queue (do not run gstack-brain-sync separately). It records +no telemetry. -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** This only writes local session state. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "document-generate" --outcome OUTCOME \ @@ -99,7 +99,7 @@ preamble's skill-start output echoed. It also drains the artifacts-sync queue Replace `OUTCOME` and `USED_BROWSE` (yes/no) before running; substitute `SESSION_ID`/`TEL_START` from the skill-start echoes. `ERROR_MESSAGE`/`FAILED_STEP` are "" unless outcome is error. If the command is missing (stale install), skip -telemetry — it never blocks the workflow. +it — it never blocks the workflow. ## Step 0: Detect platform and base branch diff --git a/document-release/SKILL.md b/document-release/SKILL.md index 437e8ffe59b..b673f6d1bd1 100644 --- a/document-release/SKILL.md +++ b/document-release/SKILL.md @@ -76,15 +76,15 @@ Write (free-form only after confirmation; its words go in that file too, with `- Exit code 2 = rejected as not user-originated; do not retry. On success: "Set `` → ``. Active immediately." -## Telemetry (run last) +## Skill end (run last) -After workflow completion, log telemetry with ONE command. OUTCOME is +After workflow completion, run ONE command. OUTCOME is success/error/abort/unknown; `SESSION_ID` and `TEL_START` are the values the -preamble's skill-start output echoed. It also drains the artifacts-sync queue -(the former skill-end sync step — do not run gstack-brain-sync separately). +preamble's skill-start output echoed. It releases the session lease and drains +the artifacts-sync queue (do not run gstack-brain-sync separately). It records +no telemetry. -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** This only writes local session state. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "document-release" --outcome OUTCOME \ @@ -95,7 +95,7 @@ preamble's skill-start output echoed. It also drains the artifacts-sync queue Replace `OUTCOME` and `USED_BROWSE` (yes/no) before running; substitute `SESSION_ID`/`TEL_START` from the skill-start echoes. `ERROR_MESSAGE`/`FAILED_STEP` are "" unless outcome is error. If the command is missing (stale install), skip -telemetry — it never blocks the workflow. +it — it never blocks the workflow. ## Step 0: Detect platform and base branch diff --git a/eval-plan/SKILL.md b/eval-plan/SKILL.md index adca9139cf5..5b0f65c18be 100644 --- a/eval-plan/SKILL.md +++ b/eval-plan/SKILL.md @@ -79,15 +79,15 @@ Write (free-form only after confirmation; its words go in that file too, with `- Exit code 2 = rejected as not user-originated; do not retry. On success: "Set `` → ``. Active immediately." -## Telemetry (run last) +## Skill end (run last) -After workflow completion, log telemetry with ONE command. OUTCOME is +After workflow completion, run ONE command. OUTCOME is success/error/abort/unknown; `SESSION_ID` and `TEL_START` are the values the -preamble's skill-start output echoed. It also drains the artifacts-sync queue -(the former skill-end sync step — do not run gstack-brain-sync separately). +preamble's skill-start output echoed. It releases the session lease and drains +the artifacts-sync queue (do not run gstack-brain-sync separately). It records +no telemetry. -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** This only writes local session state. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "eval-plan" --outcome OUTCOME \ @@ -98,7 +98,7 @@ preamble's skill-start output echoed. It also drains the artifacts-sync queue Replace `OUTCOME` and `USED_BROWSE` (yes/no) before running; substitute `SESSION_ID`/`TEL_START` from the skill-start echoes. `ERROR_MESSAGE`/`FAILED_STEP` are "" unless outcome is error. If the command is missing (stale install), skip -telemetry — it never blocks the workflow. +it — it never blocks the workflow. # /eval-plan: Preregistered, paid evals diff --git a/health/SKILL.md b/health/SKILL.md index ecde9b5f2ab..7f7d05eb6d0 100644 --- a/health/SKILL.md +++ b/health/SKILL.md @@ -76,15 +76,15 @@ Write (free-form only after confirmation; its words go in that file too, with `- Exit code 2 = rejected as not user-originated; do not retry. On success: "Set `` → ``. Active immediately." -## Telemetry (run last) +## Skill end (run last) -After workflow completion, log telemetry with ONE command. OUTCOME is +After workflow completion, run ONE command. OUTCOME is success/error/abort/unknown; `SESSION_ID` and `TEL_START` are the values the -preamble's skill-start output echoed. It also drains the artifacts-sync queue -(the former skill-end sync step — do not run gstack-brain-sync separately). +preamble's skill-start output echoed. It releases the session lease and drains +the artifacts-sync queue (do not run gstack-brain-sync separately). It records +no telemetry. -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** This only writes local session state. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "health" --outcome OUTCOME \ @@ -95,7 +95,7 @@ preamble's skill-start output echoed. It also drains the artifacts-sync queue Replace `OUTCOME` and `USED_BROWSE` (yes/no) before running; substitute `SESSION_ID`/`TEL_START` from the skill-start echoes. `ERROR_MESSAGE`/`FAILED_STEP` are "" unless outcome is error. If the command is missing (stale install), skip -telemetry — it never blocks the workflow. +it — it never blocks the workflow. # /health -- Code Quality Dashboard diff --git a/ios-clean/SKILL.md b/ios-clean/SKILL.md index 099596af391..c92d41d0ab1 100644 --- a/ios-clean/SKILL.md +++ b/ios-clean/SKILL.md @@ -75,15 +75,15 @@ Write (free-form only after confirmation; its words go in that file too, with `- Exit code 2 = rejected as not user-originated; do not retry. On success: "Set `` → ``. Active immediately." -## Telemetry (run last) +## Skill end (run last) -After workflow completion, log telemetry with ONE command. OUTCOME is +After workflow completion, run ONE command. OUTCOME is success/error/abort/unknown; `SESSION_ID` and `TEL_START` are the values the -preamble's skill-start output echoed. It also drains the artifacts-sync queue -(the former skill-end sync step — do not run gstack-brain-sync separately). +preamble's skill-start output echoed. It releases the session lease and drains +the artifacts-sync queue (do not run gstack-brain-sync separately). It records +no telemetry. -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** This only writes local session state. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "ios-clean" --outcome OUTCOME \ @@ -94,7 +94,7 @@ preamble's skill-start output echoed. It also drains the artifacts-sync queue Replace `OUTCOME` and `USED_BROWSE` (yes/no) before running; substitute `SESSION_ID`/`TEL_START` from the skill-start echoes. `ERROR_MESSAGE`/`FAILED_STEP` are "" unless outcome is error. If the command is missing (stale install), skip -telemetry — it never blocks the workflow. +it — it never blocks the workflow. # Strip the DebugBridge from an iOS app diff --git a/ios-design-review/SKILL.md b/ios-design-review/SKILL.md index 6000c79a51a..100b308ddac 100644 --- a/ios-design-review/SKILL.md +++ b/ios-design-review/SKILL.md @@ -74,15 +74,15 @@ Write (free-form only after confirmation; its words go in that file too, with `- Exit code 2 = rejected as not user-originated; do not retry. On success: "Set `` → ``. Active immediately." -## Telemetry (run last) +## Skill end (run last) -After workflow completion, log telemetry with ONE command. OUTCOME is +After workflow completion, run ONE command. OUTCOME is success/error/abort/unknown; `SESSION_ID` and `TEL_START` are the values the -preamble's skill-start output echoed. It also drains the artifacts-sync queue -(the former skill-end sync step — do not run gstack-brain-sync separately). +preamble's skill-start output echoed. It releases the session lease and drains +the artifacts-sync queue (do not run gstack-brain-sync separately). It records +no telemetry. -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** This only writes local session state. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "ios-design-review" --outcome OUTCOME \ @@ -93,7 +93,7 @@ preamble's skill-start output echoed. It also drains the artifacts-sync queue Replace `OUTCOME` and `USED_BROWSE` (yes/no) before running; substitute `SESSION_ID`/`TEL_START` from the skill-start echoes. `ERROR_MESSAGE`/`FAILED_STEP` are "" unless outcome is error. If the command is missing (stale install), skip -telemetry — it never blocks the workflow. +it — it never blocks the workflow. # iOS Design Review diff --git a/ios-fix/SKILL.md b/ios-fix/SKILL.md index f51d36ae002..da98909e01d 100644 --- a/ios-fix/SKILL.md +++ b/ios-fix/SKILL.md @@ -76,15 +76,15 @@ Write (free-form only after confirmation; its words go in that file too, with `- Exit code 2 = rejected as not user-originated; do not retry. On success: "Set `` → ``. Active immediately." -## Telemetry (run last) +## Skill end (run last) -After workflow completion, log telemetry with ONE command. OUTCOME is +After workflow completion, run ONE command. OUTCOME is success/error/abort/unknown; `SESSION_ID` and `TEL_START` are the values the -preamble's skill-start output echoed. It also drains the artifacts-sync queue -(the former skill-end sync step — do not run gstack-brain-sync separately). +preamble's skill-start output echoed. It releases the session lease and drains +the artifacts-sync queue (do not run gstack-brain-sync separately). It records +no telemetry. -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** This only writes local session state. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "ios-fix" --outcome OUTCOME \ @@ -95,7 +95,7 @@ preamble's skill-start output echoed. It also drains the artifacts-sync queue Replace `OUTCOME` and `USED_BROWSE` (yes/no) before running; substitute `SESSION_ID`/`TEL_START` from the skill-start echoes. `ERROR_MESSAGE`/`FAILED_STEP` are "" unless outcome is error. If the command is missing (stale install), skip -telemetry — it never blocks the workflow. +it — it never blocks the workflow. # Autonomous iOS bug fixer diff --git a/ios-qa/SKILL.md b/ios-qa/SKILL.md index 2fb38d73539..6006085cddb 100644 --- a/ios-qa/SKILL.md +++ b/ios-qa/SKILL.md @@ -109,15 +109,15 @@ BRANCH=$(~/.claude/skills/gstack/bin/gstack-slug --get BRANCH 2>/dev/null) jq -nc --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg skill "SKILL_NAME" --arg branch "$BRANCH" --arg insight "ONE_LINE_SUMMARY" '{ts:$ts,skill:$skill,branch:$branch,insight:$insight}' >> "$GSTACK_STATE_ROOT/analytics/eureka.jsonl" 2>/dev/null || true ``` -## Telemetry (run last) +## Skill end (run last) -After workflow completion, log telemetry with ONE command. OUTCOME is +After workflow completion, run ONE command. OUTCOME is success/error/abort/unknown; `SESSION_ID` and `TEL_START` are the values the -preamble's skill-start output echoed. It also drains the artifacts-sync queue -(the former skill-end sync step — do not run gstack-brain-sync separately). +preamble's skill-start output echoed. It releases the session lease and drains +the artifacts-sync queue (do not run gstack-brain-sync separately). It records +no telemetry. -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** This only writes local session state. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "ios-qa" --outcome OUTCOME \ @@ -128,7 +128,7 @@ preamble's skill-start output echoed. It also drains the artifacts-sync queue Replace `OUTCOME` and `USED_BROWSE` (yes/no) before running; substitute `SESSION_ID`/`TEL_START` from the skill-start echoes. `ERROR_MESSAGE`/`FAILED_STEP` are "" unless outcome is error. If the command is missing (stale install), skip -telemetry — it never blocks the workflow. +it — it never blocks the workflow. # Live-device iOS QA diff --git a/ios-sync/SKILL.md b/ios-sync/SKILL.md index 0597d91cbd5..ae2b39c5f3b 100644 --- a/ios-sync/SKILL.md +++ b/ios-sync/SKILL.md @@ -76,15 +76,15 @@ Write (free-form only after confirmation; its words go in that file too, with `- Exit code 2 = rejected as not user-originated; do not retry. On success: "Set `` → ``. Active immediately." -## Telemetry (run last) +## Skill end (run last) -After workflow completion, log telemetry with ONE command. OUTCOME is +After workflow completion, run ONE command. OUTCOME is success/error/abort/unknown; `SESSION_ID` and `TEL_START` are the values the -preamble's skill-start output echoed. It also drains the artifacts-sync queue -(the former skill-end sync step — do not run gstack-brain-sync separately). +preamble's skill-start output echoed. It releases the session lease and drains +the artifacts-sync queue (do not run gstack-brain-sync separately). It records +no telemetry. -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** This only writes local session state. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "ios-sync" --outcome OUTCOME \ @@ -95,7 +95,7 @@ preamble's skill-start output echoed. It also drains the artifacts-sync queue Replace `OUTCOME` and `USED_BROWSE` (yes/no) before running; substitute `SESSION_ID`/`TEL_START` from the skill-start echoes. `ERROR_MESSAGE`/`FAILED_STEP` are "" unless outcome is error. If the command is missing (stale install), skip -telemetry — it never blocks the workflow. +it — it never blocks the workflow. # Resync the iOS debug bridge diff --git a/land-and-deploy/SKILL.md b/land-and-deploy/SKILL.md index 0ad025054da..527ea68bb4e 100644 --- a/land-and-deploy/SKILL.md +++ b/land-and-deploy/SKILL.md @@ -105,15 +105,15 @@ BRANCH=$(~/.claude/skills/gstack/bin/gstack-slug --get BRANCH 2>/dev/null) jq -nc --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg skill "SKILL_NAME" --arg branch "$BRANCH" --arg insight "ONE_LINE_SUMMARY" '{ts:$ts,skill:$skill,branch:$branch,insight:$insight}' >> "$GSTACK_STATE_ROOT/analytics/eureka.jsonl" 2>/dev/null || true ``` -## Telemetry (run last) +## Skill end (run last) -After workflow completion, log telemetry with ONE command. OUTCOME is +After workflow completion, run ONE command. OUTCOME is success/error/abort/unknown; `SESSION_ID` and `TEL_START` are the values the -preamble's skill-start output echoed. It also drains the artifacts-sync queue -(the former skill-end sync step — do not run gstack-brain-sync separately). +preamble's skill-start output echoed. It releases the session lease and drains +the artifacts-sync queue (do not run gstack-brain-sync separately). It records +no telemetry. -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** This only writes local session state. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "land-and-deploy" --outcome OUTCOME \ @@ -124,7 +124,7 @@ preamble's skill-start output echoed. It also drains the artifacts-sync queue Replace `OUTCOME` and `USED_BROWSE` (yes/no) before running; substitute `SESSION_ID`/`TEL_START` from the skill-start echoes. `ERROR_MESSAGE`/`FAILED_STEP` are "" unless outcome is error. If the command is missing (stale install), skip -telemetry — it never blocks the workflow. +it — it never blocks the workflow. ## Step 0: Detect platform and base branch diff --git a/landing-report/SKILL.md b/landing-report/SKILL.md index 449d24b807f..addb52a3903 100644 --- a/landing-report/SKILL.md +++ b/landing-report/SKILL.md @@ -75,15 +75,15 @@ Write (free-form only after confirmation; its words go in that file too, with `- Exit code 2 = rejected as not user-originated; do not retry. On success: "Set `` → ``. Active immediately." -## Telemetry (run last) +## Skill end (run last) -After workflow completion, log telemetry with ONE command. OUTCOME is +After workflow completion, run ONE command. OUTCOME is success/error/abort/unknown; `SESSION_ID` and `TEL_START` are the values the -preamble's skill-start output echoed. It also drains the artifacts-sync queue -(the former skill-end sync step — do not run gstack-brain-sync separately). +preamble's skill-start output echoed. It releases the session lease and drains +the artifacts-sync queue (do not run gstack-brain-sync separately). It records +no telemetry. -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** This only writes local session state. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "landing-report" --outcome OUTCOME \ @@ -94,7 +94,7 @@ preamble's skill-start output echoed. It also drains the artifacts-sync queue Replace `OUTCOME` and `USED_BROWSE` (yes/no) before running; substitute `SESSION_ID`/`TEL_START` from the skill-start echoes. `ERROR_MESSAGE`/`FAILED_STEP` are "" unless outcome is error. If the command is missing (stale install), skip -telemetry — it never blocks the workflow. +it — it never blocks the workflow. --- diff --git a/learn/SKILL.md b/learn/SKILL.md index 12d5804da22..528edf3dff3 100644 --- a/learn/SKILL.md +++ b/learn/SKILL.md @@ -76,15 +76,15 @@ Write (free-form only after confirmation; its words go in that file too, with `- Exit code 2 = rejected as not user-originated; do not retry. On success: "Set `` → ``. Active immediately." -## Telemetry (run last) +## Skill end (run last) -After workflow completion, log telemetry with ONE command. OUTCOME is +After workflow completion, run ONE command. OUTCOME is success/error/abort/unknown; `SESSION_ID` and `TEL_START` are the values the -preamble's skill-start output echoed. It also drains the artifacts-sync queue -(the former skill-end sync step — do not run gstack-brain-sync separately). +preamble's skill-start output echoed. It releases the session lease and drains +the artifacts-sync queue (do not run gstack-brain-sync separately). It records +no telemetry. -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** This only writes local session state. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "learn" --outcome OUTCOME \ @@ -95,7 +95,7 @@ preamble's skill-start output echoed. It also drains the artifacts-sync queue Replace `OUTCOME` and `USED_BROWSE` (yes/no) before running; substitute `SESSION_ID`/`TEL_START` from the skill-start echoes. `ERROR_MESSAGE`/`FAILED_STEP` are "" unless outcome is error. If the command is missing (stale install), skip -telemetry — it never blocks the workflow. +it — it never blocks the workflow. # /learn: project learnings diff --git a/make-pdf/SKILL.md b/make-pdf/SKILL.md index 4c164a68dd5..0ff7291a228 100644 --- a/make-pdf/SKILL.md +++ b/make-pdf/SKILL.md @@ -157,15 +157,15 @@ empty result, not a skipped step. Do not log obvious facts or one-time transient errors. -## Telemetry (run last) +## Skill end (run last) -After workflow completion, log telemetry with ONE command. OUTCOME is +After workflow completion, run ONE command. OUTCOME is success/error/abort/unknown; `SESSION_ID` and `TEL_START` are the values the -preamble's skill-start output echoed. It also drains the artifacts-sync queue -(the former skill-end sync step — do not run gstack-brain-sync separately). +preamble's skill-start output echoed. It releases the session lease and drains +the artifacts-sync queue (do not run gstack-brain-sync separately). It records +no telemetry. -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** This only writes local session state. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "make-pdf" --outcome OUTCOME \ @@ -176,7 +176,7 @@ preamble's skill-start output echoed. It also drains the artifacts-sync queue Replace `OUTCOME` and `USED_BROWSE` (yes/no) before running; substitute `SESSION_ID`/`TEL_START` from the skill-start echoes. `ERROR_MESSAGE`/`FAILED_STEP` are "" unless outcome is error. If the command is missing (stale install), skip -telemetry — it never blocks the workflow. +it — it never blocks the workflow. ## Plan Status Footer diff --git a/modernize/SKILL.md b/modernize/SKILL.md index 7322016ed96..1a594710836 100644 --- a/modernize/SKILL.md +++ b/modernize/SKILL.md @@ -78,15 +78,15 @@ Write (free-form only after confirmation; its words go in that file too, with `- Exit code 2 = rejected as not user-originated; do not retry. On success: "Set `` → ``. Active immediately." -## Telemetry (run last) +## Skill end (run last) -After workflow completion, log telemetry with ONE command. OUTCOME is +After workflow completion, run ONE command. OUTCOME is success/error/abort/unknown; `SESSION_ID` and `TEL_START` are the values the -preamble's skill-start output echoed. It also drains the artifacts-sync queue -(the former skill-end sync step — do not run gstack-brain-sync separately). +preamble's skill-start output echoed. It releases the session lease and drains +the artifacts-sync queue (do not run gstack-brain-sync separately). It records +no telemetry. -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** This only writes local session state. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "modernize" --outcome OUTCOME \ @@ -97,7 +97,7 @@ preamble's skill-start output echoed. It also drains the artifacts-sync queue Replace `OUTCOME` and `USED_BROWSE` (yes/no) before running; substitute `SESSION_ID`/`TEL_START` from the skill-start echoes. `ERROR_MESSAGE`/`FAILED_STEP` are "" unless outcome is error. If the command is missing (stale install), skip -telemetry — it never blocks the workflow. +it — it never blocks the workflow. --- diff --git a/office-hours/SKILL.md b/office-hours/SKILL.md index 571f62648f4..848594f6dbe 100644 --- a/office-hours/SKILL.md +++ b/office-hours/SKILL.md @@ -151,15 +151,15 @@ BRANCH=$(~/.claude/skills/gstack/bin/gstack-slug --get BRANCH 2>/dev/null) jq -nc --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg skill "SKILL_NAME" --arg branch "$BRANCH" --arg insight "ONE_LINE_SUMMARY" '{ts:$ts,skill:$skill,branch:$branch,insight:$insight}' >> "$GSTACK_STATE_ROOT/analytics/eureka.jsonl" 2>/dev/null || true ``` -## Telemetry (run last) +## Skill end (run last) -After workflow completion, log telemetry with ONE command. OUTCOME is +After workflow completion, run ONE command. OUTCOME is success/error/abort/unknown; `SESSION_ID` and `TEL_START` are the values the -preamble's skill-start output echoed. It also drains the artifacts-sync queue -(the former skill-end sync step — do not run gstack-brain-sync separately). +preamble's skill-start output echoed. It releases the session lease and drains +the artifacts-sync queue (do not run gstack-brain-sync separately). It records +no telemetry. -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** This only writes local session state. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "office-hours" --outcome OUTCOME \ @@ -170,7 +170,7 @@ preamble's skill-start output echoed. It also drains the artifacts-sync queue Replace `OUTCOME` and `USED_BROWSE` (yes/no) before running; substitute `SESSION_ID`/`TEL_START` from the skill-start echoes. `ERROR_MESSAGE`/`FAILED_STEP` are "" unless outcome is error. If the command is missing (stale install), skip -telemetry — it never blocks the workflow. +it — it never blocks the workflow. ## Third-Party Web Actions diff --git a/office-hours/sections/design-and-handoff.md b/office-hours/sections/design-and-handoff.md index 5071a96f91f..f9a4d35af40 100644 --- a/office-hours/sections/design-and-handoff.md +++ b/office-hours/sections/design-and-handoff.md @@ -691,16 +691,7 @@ D) Not now — I'll run a review later ❌ Review gaps compound; problems get more expensive after code exists Net: 15 minutes of structured review now against rework risk later. -On the user's SELECTION of A/B/C (not on invocation success), log the handoff, then invoke -the chosen skill via the **Skill tool** (it auto-discovers the design doc). In both log -commands, replace `SESSION_ID` with the value the skill-start output echoed: -```bash -~/.claude/skills/gstack/bin/gstack-telemetry-log --event-type handoff --skill office-hours --outcome accepted --session-id "SESSION_ID" 2>/dev/null || true -``` -On D, log declined and stop: -```bash -~/.claude/skills/gstack/bin/gstack-telemetry-log --event-type handoff --skill office-hours --outcome declined --session-id "SESSION_ID" 2>/dev/null || true -``` +On the user's SELECTION of A/B/C, invoke the chosen skill via the **Skill tool** (it auto-discovers the design doc). On D, stop. The design doc at `~/.gstack/projects/` is automatically discoverable by downstream skills — they will read it during their pre-review system audit. diff --git a/office-hours/sections/design-and-handoff.md.tmpl b/office-hours/sections/design-and-handoff.md.tmpl index 91d5439be44..d2c9bf27807 100644 --- a/office-hours/sections/design-and-handoff.md.tmpl +++ b/office-hours/sections/design-and-handoff.md.tmpl @@ -532,16 +532,7 @@ D) Not now — I'll run a review later ❌ Review gaps compound; problems get more expensive after code exists Net: 15 minutes of structured review now against rework risk later. -On the user's SELECTION of A/B/C (not on invocation success), log the handoff, then invoke -the chosen skill via the **Skill tool** (it auto-discovers the design doc). In both log -commands, replace `SESSION_ID` with the value the skill-start output echoed: -```bash -~/.claude/skills/gstack/bin/gstack-telemetry-log --event-type handoff --skill office-hours --outcome accepted --session-id "SESSION_ID" 2>/dev/null || true -``` -On D, log declined and stop: -```bash -~/.claude/skills/gstack/bin/gstack-telemetry-log --event-type handoff --skill office-hours --outcome declined --session-id "SESSION_ID" 2>/dev/null || true -``` +On the user's SELECTION of A/B/C, invoke the chosen skill via the **Skill tool** (it auto-discovers the design doc). On D, stop. The design doc at `~/.gstack/projects/` is automatically discoverable by downstream skills — they will read it during their pre-review system audit. diff --git a/open-gstack-browser/SKILL.md b/open-gstack-browser/SKILL.md index 26fb660fd41..91b7fba27b8 100644 --- a/open-gstack-browser/SKILL.md +++ b/open-gstack-browser/SKILL.md @@ -119,15 +119,15 @@ empty result, not a skipped step. Do not log obvious facts or one-time transient errors. -## Telemetry (run last) +## Skill end (run last) -After workflow completion, log telemetry with ONE command. OUTCOME is +After workflow completion, run ONE command. OUTCOME is success/error/abort/unknown; `SESSION_ID` and `TEL_START` are the values the -preamble's skill-start output echoed. It also drains the artifacts-sync queue -(the former skill-end sync step — do not run gstack-brain-sync separately). +preamble's skill-start output echoed. It releases the session lease and drains +the artifacts-sync queue (do not run gstack-brain-sync separately). It records +no telemetry. -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** This only writes local session state. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "open-gstack-browser" --outcome OUTCOME \ @@ -138,7 +138,7 @@ preamble's skill-start output echoed. It also drains the artifacts-sync queue Replace `OUTCOME` and `USED_BROWSE` (yes/no) before running; substitute `SESSION_ID`/`TEL_START` from the skill-start echoes. `ERROR_MESSAGE`/`FAILED_STEP` are "" unless outcome is error. If the command is missing (stale install), skip -telemetry — it never blocks the workflow. +it — it never blocks the workflow. ## Plan Status Footer diff --git a/pair-agent/SKILL.md b/pair-agent/SKILL.md index 59f6a0113bb..444859a2e1e 100644 --- a/pair-agent/SKILL.md +++ b/pair-agent/SKILL.md @@ -73,15 +73,15 @@ Write (free-form only after confirmation; its words go in that file too, with `- Exit code 2 = rejected as not user-originated; do not retry. On success: "Set `` → ``. Active immediately." -## Telemetry (run last) +## Skill end (run last) -After workflow completion, log telemetry with ONE command. OUTCOME is +After workflow completion, run ONE command. OUTCOME is success/error/abort/unknown; `SESSION_ID` and `TEL_START` are the values the -preamble's skill-start output echoed. It also drains the artifacts-sync queue -(the former skill-end sync step — do not run gstack-brain-sync separately). +preamble's skill-start output echoed. It releases the session lease and drains +the artifacts-sync queue (do not run gstack-brain-sync separately). It records +no telemetry. -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** This only writes local session state. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "pair-agent" --outcome OUTCOME \ @@ -92,7 +92,7 @@ preamble's skill-start output echoed. It also drains the artifacts-sync queue Replace `OUTCOME` and `USED_BROWSE` (yes/no) before running; substitute `SESSION_ID`/`TEL_START` from the skill-start echoes. `ERROR_MESSAGE`/`FAILED_STEP` are "" unless outcome is error. If the command is missing (stale install), skip -telemetry — it never blocks the workflow. +it — it never blocks the workflow. # /pair-agent — Share Your Browser With Another AI Agent diff --git a/plan-ceo-review/SKILL.md b/plan-ceo-review/SKILL.md index e64c876ece9..1ece9378919 100644 --- a/plan-ceo-review/SKILL.md +++ b/plan-ceo-review/SKILL.md @@ -150,15 +150,15 @@ BRANCH=$(~/.claude/skills/gstack/bin/gstack-slug --get BRANCH 2>/dev/null) jq -nc --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg skill "SKILL_NAME" --arg branch "$BRANCH" --arg insight "ONE_LINE_SUMMARY" '{ts:$ts,skill:$skill,branch:$branch,insight:$insight}' >> "$GSTACK_STATE_ROOT/analytics/eureka.jsonl" 2>/dev/null || true ``` -## Telemetry (run last) +## Skill end (run last) -After workflow completion, log telemetry with ONE command. OUTCOME is +After workflow completion, run ONE command. OUTCOME is success/error/abort/unknown; `SESSION_ID` and `TEL_START` are the values the -preamble's skill-start output echoed. It also drains the artifacts-sync queue -(the former skill-end sync step — do not run gstack-brain-sync separately). +preamble's skill-start output echoed. It releases the session lease and drains +the artifacts-sync queue (do not run gstack-brain-sync separately). It records +no telemetry. -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** This only writes local session state. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "plan-ceo-review" --outcome OUTCOME \ @@ -169,7 +169,7 @@ preamble's skill-start output echoed. It also drains the artifacts-sync queue Replace `OUTCOME` and `USED_BROWSE` (yes/no) before running; substitute `SESSION_ID`/`TEL_START` from the skill-start echoes. `ERROR_MESSAGE`/`FAILED_STEP` are "" unless outcome is error. If the command is missing (stale install), skip -telemetry — it never blocks the workflow. +it — it never blocks the workflow. ## Step 0: Detect platform and base branch @@ -358,7 +358,7 @@ Follow its instructions from top to bottom, **skipping these sections when prese - Shared preamble (load first) - Search Before Building - Contributor Mode -- Telemetry (run last) +- Skill end (run last) - Step 0: Detect platform and base branch - Review Readiness Dashboard - Plan File Review Report @@ -401,7 +401,7 @@ Follow its instructions from top to bottom, **skipping these sections when prese - Shared preamble (load first) - Search Before Building - Contributor Mode -- Telemetry (run last) +- Skill end (run last) - Step 0: Detect platform and base branch - Review Readiness Dashboard - Plan File Review Report @@ -1040,6 +1040,6 @@ SLUG=$(~/.claude/skills/gstack/bin/gstack-slug --get SLUG 2>/dev/null) || true ``` -After the refresh, run the preamble's **Telemetry (run last)** once. The review +After the refresh, run the preamble's **Skill end (run last)** once. The review is now finished. Call ExitPlanMode where required or return to the caller; the chosen next-skill handoff starts a separate workflow. diff --git a/plan-ceo-review/SKILL.md.tmpl b/plan-ceo-review/SKILL.md.tmpl index 1f55d3a87ee..253246dc198 100644 --- a/plan-ceo-review/SKILL.md.tmpl +++ b/plan-ceo-review/SKILL.md.tmpl @@ -592,6 +592,6 @@ If the Summary or report preceded that Read, stop, Read and redo the review. {{BRAIN_CACHE_REFRESH}} -After the refresh, run the preamble's **Telemetry (run last)** once. The review +After the refresh, run the preamble's **Skill end (run last)** once. The review is now finished. Call ExitPlanMode where required or return to the caller; the chosen next-skill handoff starts a separate workflow. diff --git a/plan-design-review/SKILL.md b/plan-design-review/SKILL.md index 9cdad3fa3f0..bde2edc50ff 100644 --- a/plan-design-review/SKILL.md +++ b/plan-design-review/SKILL.md @@ -156,15 +156,15 @@ BRANCH=$(~/.claude/skills/gstack/bin/gstack-slug --get BRANCH 2>/dev/null) jq -nc --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg skill "SKILL_NAME" --arg branch "$BRANCH" --arg insight "ONE_LINE_SUMMARY" '{ts:$ts,skill:$skill,branch:$branch,insight:$insight}' >> "$GSTACK_STATE_ROOT/analytics/eureka.jsonl" 2>/dev/null || true ``` -## Telemetry (run last) +## Skill end (run last) -After workflow completion, log telemetry with ONE command. OUTCOME is +After workflow completion, run ONE command. OUTCOME is success/error/abort/unknown; `SESSION_ID` and `TEL_START` are the values the -preamble's skill-start output echoed. It also drains the artifacts-sync queue -(the former skill-end sync step — do not run gstack-brain-sync separately). +preamble's skill-start output echoed. It releases the session lease and drains +the artifacts-sync queue (do not run gstack-brain-sync separately). It records +no telemetry. -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** This only writes local session state. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "plan-design-review" --outcome OUTCOME \ @@ -175,7 +175,7 @@ preamble's skill-start output echoed. It also drains the artifacts-sync queue Replace `OUTCOME` and `USED_BROWSE` (yes/no) before running; substitute `SESSION_ID`/`TEL_START` from the skill-start echoes. `ERROR_MESSAGE`/`FAILED_STEP` are "" unless outcome is error. If the command is missing (stale install), skip -telemetry — it never blocks the workflow. +it — it never blocks the workflow. ## Step 0: Detect platform and base branch diff --git a/plan-devex-review/SKILL.md b/plan-devex-review/SKILL.md index 19ca31dafbb..f12997c292d 100644 --- a/plan-devex-review/SKILL.md +++ b/plan-devex-review/SKILL.md @@ -120,15 +120,15 @@ BRANCH=$(~/.claude/skills/gstack/bin/gstack-slug --get BRANCH 2>/dev/null) jq -nc --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg skill "SKILL_NAME" --arg branch "$BRANCH" --arg insight "ONE_LINE_SUMMARY" '{ts:$ts,skill:$skill,branch:$branch,insight:$insight}' >> "$GSTACK_STATE_ROOT/analytics/eureka.jsonl" 2>/dev/null || true ``` -## Telemetry (run last) +## Skill end (run last) -After workflow completion, log telemetry with ONE command. OUTCOME is +After workflow completion, run ONE command. OUTCOME is success/error/abort/unknown; `SESSION_ID` and `TEL_START` are the values the -preamble's skill-start output echoed. It also drains the artifacts-sync queue -(the former skill-end sync step — do not run gstack-brain-sync separately). +preamble's skill-start output echoed. It releases the session lease and drains +the artifacts-sync queue (do not run gstack-brain-sync separately). It records +no telemetry. -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** This only writes local session state. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "plan-devex-review" --outcome OUTCOME \ @@ -139,7 +139,7 @@ preamble's skill-start output echoed. It also drains the artifacts-sync queue Replace `OUTCOME` and `USED_BROWSE` (yes/no) before running; substitute `SESSION_ID`/`TEL_START` from the skill-start echoes. `ERROR_MESSAGE`/`FAILED_STEP` are "" unless outcome is error. If the command is missing (stale install), skip -telemetry — it never blocks the workflow. +it — it never blocks the workflow. ## Step 0: Detect platform and base branch @@ -549,7 +549,7 @@ Follow its instructions from top to bottom, **skipping these sections when prese - Shared preamble (load first) - Search Before Building - Contributor Mode -- Telemetry (run last) +- Skill end (run last) - Step 0: Detect platform and base branch - Review Readiness Dashboard - Plan File Review Report diff --git a/plan-eng-review/SKILL.md b/plan-eng-review/SKILL.md index 4061ac83ba2..f11cf3c8930 100644 --- a/plan-eng-review/SKILL.md +++ b/plan-eng-review/SKILL.md @@ -241,15 +241,15 @@ BRANCH=$(~/.claude/skills/gstack/bin/gstack-slug --get BRANCH 2>/dev/null) jq -nc --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg skill "SKILL_NAME" --arg branch "$BRANCH" --arg insight "ONE_LINE_SUMMARY" '{ts:$ts,skill:$skill,branch:$branch,insight:$insight}' >> "$GSTACK_STATE_ROOT/analytics/eureka.jsonl" 2>/dev/null || true ``` -## Telemetry (run last) +## Skill end (run last) -After workflow completion, log telemetry with ONE command. OUTCOME is +After workflow completion, run ONE command. OUTCOME is success/error/abort/unknown; `SESSION_ID` and `TEL_START` are the values the -preamble's skill-start output echoed. It also drains the artifacts-sync queue -(the former skill-end sync step — do not run gstack-brain-sync separately). +preamble's skill-start output echoed. It releases the session lease and drains +the artifacts-sync queue (do not run gstack-brain-sync separately). It records +no telemetry. -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** This only writes local session state. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "plan-eng-review" --outcome OUTCOME \ @@ -260,7 +260,7 @@ preamble's skill-start output echoed. It also drains the artifacts-sync queue Replace `OUTCOME` and `USED_BROWSE` (yes/no) before running; substitute `SESSION_ID`/`TEL_START` from the skill-start echoes. `ERROR_MESSAGE`/`FAILED_STEP` are "" unless outcome is error. If the command is missing (stale install), skip -telemetry — it never blocks the workflow. +it — it never blocks the workflow. ## Plan Status Footer @@ -451,7 +451,7 @@ Follow its instructions from top to bottom, **skipping these sections when prese - Shared preamble (load first) - Search Before Building - Contributor Mode -- Telemetry (run last) +- Skill end (run last) - Step 0: Detect platform and base branch - Review Readiness Dashboard - Plan File Review Report @@ -498,9 +498,9 @@ outputs steps 1–4 for changed outputs before choosing navigation again. Unchan may reuse their successful Review Log. If a final gate discovers stale evidence, follow **Blocked outcome** first; then resume here. -**Blocked outcome:** Stop the review and report `BLOCKED`, the missing path/work, actual attempts and what is needed to resume. Label complete chat-only output **not persisted**; it supplies no saved-review or completion credit. If startup values and a permitted telemetry command are available, run **Telemetry (run last)** once with `OUTCOME=error` and the actual `ERROR_MESSAGE`/`FAILED_STEP`. Do not call ExitPlanMode. Resume at the failed step using Recovery routing. +**Blocked outcome:** Stop the review and report `BLOCKED`, the missing path/work, actual attempts and what is needed to resume. Label complete chat-only output **not persisted**; it supplies no saved-review or completion credit. If startup values and a permitted telemetry command are available, run **Skill end (run last)** once with `OUTCOME=error` and the actual `ERROR_MESSAGE`/`FAILED_STEP`. Do not call ExitPlanMode. Resume at the failed step using Recovery routing. -**Report-back outcome:** The caller forbids the report file or required Review Log. Present Required outputs steps 1 and 4 as **not persisted**; skip navigation, Read-back, the EXIT PLAN MODE GATE and ExitPlanMode. Run permitted **Telemetry (run last)** with `OUTCOME=success`. Report `DONE` and `PERSISTED: no`; the last line is `PERSIST: ` plus the filled `gstack-review-log` command for the caller to run. No saved-review credit until then. +**Report-back outcome:** The caller forbids the report file or required Review Log. Present Required outputs steps 1 and 4 as **not persisted**; skip navigation, Read-back, the EXIT PLAN MODE GATE and ExitPlanMode. Run permitted **Skill end (run last)** with `OUTCOME=success`. Report `DONE` and `PERSISTED: no`; the last line is `PERSIST: ` plus the filled `gstack-review-log` command for the caller to run. No saved-review credit until then. ## Section self-check (before you finish) @@ -534,7 +534,7 @@ an unrecovered save cannot pass. If any check fails, follow **Blocked outcome** without success telemetry or ExitPlanMode. Body prose cannot replace the separate terminal structured report. -After the gate passes: **Telemetry (run last)** once with `OUTCOME=success`, then cache refresh. Make no further working-plan or approval changes between verification and exit. +After the gate passes: **Skill end (run last)** once with `OUTCOME=success`, then cache refresh. Make no further working-plan or approval changes between verification and exit. ## Brain Cache Background Refresh diff --git a/plan-eng-review/SKILL.md.tmpl b/plan-eng-review/SKILL.md.tmpl index 2ac3b966d35..fd91361b996 100644 --- a/plan-eng-review/SKILL.md.tmpl +++ b/plan-eng-review/SKILL.md.tmpl @@ -173,9 +173,9 @@ outputs steps 1–4 for changed outputs before choosing navigation again. Unchan may reuse their successful Review Log. If a final gate discovers stale evidence, follow **Blocked outcome** first; then resume here. -**Blocked outcome:** Stop the review and report `BLOCKED`, the missing path/work, actual attempts and what is needed to resume. Label complete chat-only output **not persisted**; it supplies no saved-review or completion credit. If startup values and a permitted telemetry command are available, run **Telemetry (run last)** once with `OUTCOME=error` and the actual `ERROR_MESSAGE`/`FAILED_STEP`. Do not call ExitPlanMode. Resume at the failed step using Recovery routing. +**Blocked outcome:** Stop the review and report `BLOCKED`, the missing path/work, actual attempts and what is needed to resume. Label complete chat-only output **not persisted**; it supplies no saved-review or completion credit. If startup values and a permitted telemetry command are available, run **Skill end (run last)** once with `OUTCOME=error` and the actual `ERROR_MESSAGE`/`FAILED_STEP`. Do not call ExitPlanMode. Resume at the failed step using Recovery routing. -**Report-back outcome:** The caller forbids the report file or required Review Log. Present Required outputs steps 1 and 4 as **not persisted**; skip navigation, Read-back, the EXIT PLAN MODE GATE and ExitPlanMode. Run permitted **Telemetry (run last)** with `OUTCOME=success`. Report `DONE` and `PERSISTED: no`; the last line is `PERSIST: ` plus the filled `gstack-review-log` command for the caller to run. No saved-review credit until then. +**Report-back outcome:** The caller forbids the report file or required Review Log. Present Required outputs steps 1 and 4 as **not persisted**; skip navigation, Read-back, the EXIT PLAN MODE GATE and ExitPlanMode. Run permitted **Skill end (run last)** with `OUTCOME=success`. Report `DONE` and `PERSISTED: no`; the last line is `PERSIST: ` plus the filled `gstack-review-log` command for the caller to run. No saved-review credit until then. ## Section self-check (before you finish) @@ -185,7 +185,7 @@ and use Recovery routing above. Preserve verified work. {{EXIT_PLAN_MODE_GATE}} -After the gate passes: **Telemetry (run last)** once with `OUTCOME=success`, then cache refresh. Make no further working-plan or approval changes between verification and exit. +After the gate passes: **Skill end (run last)** once with `OUTCOME=success`, then cache refresh. Make no further working-plan or approval changes between verification and exit. {{BRAIN_CACHE_REFRESH}} diff --git a/plan-tune/SKILL.md b/plan-tune/SKILL.md index d4e77e8186f..66d40da1ac2 100644 --- a/plan-tune/SKILL.md +++ b/plan-tune/SKILL.md @@ -80,15 +80,15 @@ Write (free-form only after confirmation; its words go in that file too, with `- Exit code 2 = rejected as not user-originated; do not retry. On success: "Set `` → ``. Active immediately." -## Telemetry (run last) +## Skill end (run last) -After workflow completion, log telemetry with ONE command. OUTCOME is +After workflow completion, run ONE command. OUTCOME is success/error/abort/unknown; `SESSION_ID` and `TEL_START` are the values the -preamble's skill-start output echoed. It also drains the artifacts-sync queue -(the former skill-end sync step — do not run gstack-brain-sync separately). +preamble's skill-start output echoed. It releases the session lease and drains +the artifacts-sync queue (do not run gstack-brain-sync separately). It records +no telemetry. -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** This only writes local session state. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "plan-tune" --outcome OUTCOME \ @@ -99,7 +99,7 @@ preamble's skill-start output echoed. It also drains the artifacts-sync queue Replace `OUTCOME` and `USED_BROWSE` (yes/no) before running; substitute `SESSION_ID`/`TEL_START` from the skill-start echoes. `ERROR_MESSAGE`/`FAILED_STEP` are "" unless outcome is error. If the command is missing (stale install), skip -telemetry — it never blocks the workflow. +it — it never blocks the workflow. # /plan-tune — Question Tuning + Developer Profile (v1 observational) diff --git a/qa-only/SKILL.md b/qa-only/SKILL.md index 34dfe43d6d5..1134677810c 100644 --- a/qa-only/SKILL.md +++ b/qa-only/SKILL.md @@ -104,15 +104,15 @@ BRANCH=$(~/.claude/skills/gstack/bin/gstack-slug --get BRANCH 2>/dev/null) jq -nc --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg skill "SKILL_NAME" --arg branch "$BRANCH" --arg insight "ONE_LINE_SUMMARY" '{ts:$ts,skill:$skill,branch:$branch,insight:$insight}' >> "$GSTACK_STATE_ROOT/analytics/eureka.jsonl" 2>/dev/null || true ``` -## Telemetry (run last) +## Skill end (run last) -After workflow completion, log telemetry with ONE command. OUTCOME is +After workflow completion, run ONE command. OUTCOME is success/error/abort/unknown; `SESSION_ID` and `TEL_START` are the values the -preamble's skill-start output echoed. It also drains the artifacts-sync queue -(the former skill-end sync step — do not run gstack-brain-sync separately). +preamble's skill-start output echoed. It releases the session lease and drains +the artifacts-sync queue (do not run gstack-brain-sync separately). It records +no telemetry. -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** This only writes local session state. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "qa-only" --outcome OUTCOME \ @@ -123,7 +123,7 @@ preamble's skill-start output echoed. It also drains the artifacts-sync queue Replace `OUTCOME` and `USED_BROWSE` (yes/no) before running; substitute `SESSION_ID`/`TEL_START` from the skill-start echoes. `ERROR_MESSAGE`/`FAILED_STEP` are "" unless outcome is error. If the command is missing (stale install), skip -telemetry — it never blocks the workflow. +it — it never blocks the workflow. # /qa-only: Report-Only QA Testing diff --git a/qa/SKILL.md b/qa/SKILL.md index d9b5dd54def..969f4186a46 100644 --- a/qa/SKILL.md +++ b/qa/SKILL.md @@ -107,15 +107,15 @@ BRANCH=$(~/.claude/skills/gstack/bin/gstack-slug --get BRANCH 2>/dev/null) jq -nc --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg skill "SKILL_NAME" --arg branch "$BRANCH" --arg insight "ONE_LINE_SUMMARY" '{ts:$ts,skill:$skill,branch:$branch,insight:$insight}' >> "$GSTACK_STATE_ROOT/analytics/eureka.jsonl" 2>/dev/null || true ``` -## Telemetry (run last) +## Skill end (run last) -After workflow completion, log telemetry with ONE command. OUTCOME is +After workflow completion, run ONE command. OUTCOME is success/error/abort/unknown; `SESSION_ID` and `TEL_START` are the values the -preamble's skill-start output echoed. It also drains the artifacts-sync queue -(the former skill-end sync step — do not run gstack-brain-sync separately). +preamble's skill-start output echoed. It releases the session lease and drains +the artifacts-sync queue (do not run gstack-brain-sync separately). It records +no telemetry. -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** This only writes local session state. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "qa" --outcome OUTCOME \ @@ -126,7 +126,7 @@ preamble's skill-start output echoed. It also drains the artifacts-sync queue Replace `OUTCOME` and `USED_BROWSE` (yes/no) before running; substitute `SESSION_ID`/`TEL_START` from the skill-start echoes. `ERROR_MESSAGE`/`FAILED_STEP` are "" unless outcome is error. If the command is missing (stale install), skip -telemetry — it never blocks the workflow. +it — it never blocks the workflow. ## Step 0: Detect platform and base branch diff --git a/retro/SKILL.md b/retro/SKILL.md index 30af82d8543..614aaaa08aa 100644 --- a/retro/SKILL.md +++ b/retro/SKILL.md @@ -94,15 +94,15 @@ Write (free-form only after confirmation; its words go in that file too, with `- Exit code 2 = rejected as not user-originated; do not retry. On success: "Set `` → ``. Active immediately." -## Telemetry (run last) +## Skill end (run last) -After workflow completion, log telemetry with ONE command. OUTCOME is +After workflow completion, run ONE command. OUTCOME is success/error/abort/unknown; `SESSION_ID` and `TEL_START` are the values the -preamble's skill-start output echoed. It also drains the artifacts-sync queue -(the former skill-end sync step — do not run gstack-brain-sync separately). +preamble's skill-start output echoed. It releases the session lease and drains +the artifacts-sync queue (do not run gstack-brain-sync separately). It records +no telemetry. -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** This only writes local session state. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "retro" --outcome OUTCOME \ @@ -113,7 +113,7 @@ preamble's skill-start output echoed. It also drains the artifacts-sync queue Replace `OUTCOME` and `USED_BROWSE` (yes/no) before running; substitute `SESSION_ID`/`TEL_START` from the skill-start echoes. `ERROR_MESSAGE`/`FAILED_STEP` are "" unless outcome is error. If the command is missing (stale install), skip -telemetry — it never blocks the workflow. +it — it never blocks the workflow. ## Step 0: Detect platform and base branch diff --git a/review/SKILL.md b/review/SKILL.md index 9b560bd6f83..9e6645357bf 100644 --- a/review/SKILL.md +++ b/review/SKILL.md @@ -135,15 +135,15 @@ BRANCH=$(~/.claude/skills/gstack/bin/gstack-slug --get BRANCH 2>/dev/null) jq -nc --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg skill "SKILL_NAME" --arg branch "$BRANCH" --arg insight "ONE_LINE_SUMMARY" '{ts:$ts,skill:$skill,branch:$branch,insight:$insight}' >> "$GSTACK_STATE_ROOT/analytics/eureka.jsonl" 2>/dev/null || true ``` -## Telemetry (run last) +## Skill end (run last) -After workflow completion, log telemetry with ONE command. OUTCOME is +After workflow completion, run ONE command. OUTCOME is success/error/abort/unknown; `SESSION_ID` and `TEL_START` are the values the -preamble's skill-start output echoed. It also drains the artifacts-sync queue -(the former skill-end sync step — do not run gstack-brain-sync separately). +preamble's skill-start output echoed. It releases the session lease and drains +the artifacts-sync queue (do not run gstack-brain-sync separately). It records +no telemetry. -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** This only writes local session state. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "review" --outcome OUTCOME \ @@ -154,7 +154,7 @@ preamble's skill-start output echoed. It also drains the artifacts-sync queue Replace `OUTCOME` and `USED_BROWSE` (yes/no) before running; substitute `SESSION_ID`/`TEL_START` from the skill-start echoes. `ERROR_MESSAGE`/`FAILED_STEP` are "" unless outcome is error. If the command is missing (stale install), skip -telemetry — it never blocks the workflow. +it — it never blocks the workflow. ## Step 0: Detect platform and base branch diff --git a/runaway-stopper/SKILL.md b/runaway-stopper/SKILL.md index c94d9d91d00..361110b2093 100644 --- a/runaway-stopper/SKILL.md +++ b/runaway-stopper/SKILL.md @@ -119,15 +119,15 @@ empty result, not a skipped step. Do not log obvious facts or one-time transient errors. -## Telemetry (run last) +## Skill end (run last) -After workflow completion, log telemetry with ONE command. OUTCOME is +After workflow completion, run ONE command. OUTCOME is success/error/abort/unknown; `SESSION_ID` and `TEL_START` are the values the -preamble's skill-start output echoed. It also drains the artifacts-sync queue -(the former skill-end sync step — do not run gstack-brain-sync separately). +preamble's skill-start output echoed. It releases the session lease and drains +the artifacts-sync queue (do not run gstack-brain-sync separately). It records +no telemetry. -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** This only writes local session state. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "runaway-stopper" --outcome OUTCOME \ @@ -138,7 +138,7 @@ preamble's skill-start output echoed. It also drains the artifacts-sync queue Replace `OUTCOME` and `USED_BROWSE` (yes/no) before running; substitute `SESSION_ID`/`TEL_START` from the skill-start echoes. `ERROR_MESSAGE`/`FAILED_STEP` are "" unless outcome is error. If the command is missing (stale install), skip -telemetry — it never blocks the workflow. +it — it never blocks the workflow. ## Plan Status Footer diff --git a/scrape/SKILL.md b/scrape/SKILL.md index 50a2b158c5c..92832b00cc0 100644 --- a/scrape/SKILL.md +++ b/scrape/SKILL.md @@ -120,15 +120,15 @@ empty result, not a skipped step. Do not log obvious facts or one-time transient errors. -## Telemetry (run last) +## Skill end (run last) -After workflow completion, log telemetry with ONE command. OUTCOME is +After workflow completion, run ONE command. OUTCOME is success/error/abort/unknown; `SESSION_ID` and `TEL_START` are the values the -preamble's skill-start output echoed. It also drains the artifacts-sync queue -(the former skill-end sync step — do not run gstack-brain-sync separately). +preamble's skill-start output echoed. It releases the session lease and drains +the artifacts-sync queue (do not run gstack-brain-sync separately). It records +no telemetry. -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** This only writes local session state. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "scrape" --outcome OUTCOME \ @@ -139,7 +139,7 @@ preamble's skill-start output echoed. It also drains the artifacts-sync queue Replace `OUTCOME` and `USED_BROWSE` (yes/no) before running; substitute `SESSION_ID`/`TEL_START` from the skill-start echoes. `ERROR_MESSAGE`/`FAILED_STEP` are "" unless outcome is error. If the command is missing (stale install), skip -telemetry — it never blocks the workflow. +it — it never blocks the workflow. ## Plan Status Footer diff --git a/scripts/free-test-durations.json b/scripts/free-test-durations.json index 9c66ddc4604..0a2efb27da6 100644 --- a/scripts/free-test-durations.json +++ b/scripts/free-test-durations.json @@ -1580,7 +1580,6 @@ "test/team-init-hook-shell-neutral.test.ts": 1166, "test/team-mode.test.ts": 2205, "test/telemetry-repo-strip.test.ts": 47, - "test/telemetry.test.ts": 7114, "test/template-context-parity.test.ts": 21, "test/terse-build.test.ts": 27, "test/test-fixture-root.test.ts": 329, diff --git a/scripts/resolvers/composition.ts b/scripts/resolvers/composition.ts index acf9ed896e0..87970ad37a8 100644 --- a/scripts/resolvers/composition.ts +++ b/scripts/resolvers/composition.ts @@ -81,7 +81,7 @@ export function generateInvokeSkill(ctx: TemplateContext, args?: string[]): stri 'Shared preamble (load first)', 'Search Before Building', 'Contributor Mode', - 'Telemetry (run last)', + 'Skill end (run last)', 'Step 0: Detect platform and base branch', 'Review Readiness Dashboard', 'Plan File Review Report', diff --git a/scripts/resolvers/preamble/generate-completion-status.ts b/scripts/resolvers/preamble/generate-completion-status.ts index fc10a732c80..764f0bf43ea 100644 --- a/scripts/resolvers/preamble/generate-completion-status.ts +++ b/scripts/resolvers/preamble/generate-completion-status.ts @@ -67,15 +67,15 @@ ${ctx.paths.binDir}/gstack-learnings-log '{"skill":"SKILL_NAME","type":"operatio Do not log obvious facts or one-time transient errors. -## Telemetry (run last) +## Skill end (run last) -After workflow completion, log telemetry with ONE command. OUTCOME is +After workflow completion, run ONE command. OUTCOME is success/error/abort/unknown; \`SESSION_ID\` and \`TEL_START\` are the values the -preamble's skill-start output echoed. It also drains the artifacts-sync queue -(the former skill-end sync step — do not run gstack-brain-sync separately). +preamble's skill-start output echoed. It releases the session lease and drains +the artifacts-sync queue (do not run gstack-brain-sync separately). It records +no telemetry. -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -\`$GSTACK_STATE_ROOT/analytics/\`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** This only writes local session state. \`\`\`bash ${ctx.paths.binDir}/gstack-skill-end --skill "${ctx.skillName}" --outcome OUTCOME \\ @@ -86,7 +86,7 @@ ${ctx.paths.binDir}/gstack-skill-end --skill "${ctx.skillName}" --outcome OUTCOM Replace \`OUTCOME\` and \`USED_BROWSE\` (yes/no) before running; substitute \`SESSION_ID\`/\`TEL_START\` from the skill-start echoes. \`ERROR_MESSAGE\`/\`FAILED_STEP\` are "" unless outcome is error. If the command is missing (stale install), skip -telemetry — it never blocks the workflow. +it — it never blocks the workflow. ## Plan Status Footer diff --git a/setup-browser-cookies/SKILL.md b/setup-browser-cookies/SKILL.md index c193d6c3fc7..2eada4ab712 100644 --- a/setup-browser-cookies/SKILL.md +++ b/setup-browser-cookies/SKILL.md @@ -118,15 +118,15 @@ empty result, not a skipped step. Do not log obvious facts or one-time transient errors. -## Telemetry (run last) +## Skill end (run last) -After workflow completion, log telemetry with ONE command. OUTCOME is +After workflow completion, run ONE command. OUTCOME is success/error/abort/unknown; `SESSION_ID` and `TEL_START` are the values the -preamble's skill-start output echoed. It also drains the artifacts-sync queue -(the former skill-end sync step — do not run gstack-brain-sync separately). +preamble's skill-start output echoed. It releases the session lease and drains +the artifacts-sync queue (do not run gstack-brain-sync separately). It records +no telemetry. -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** This only writes local session state. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "setup-browser-cookies" --outcome OUTCOME \ @@ -137,7 +137,7 @@ preamble's skill-start output echoed. It also drains the artifacts-sync queue Replace `OUTCOME` and `USED_BROWSE` (yes/no) before running; substitute `SESSION_ID`/`TEL_START` from the skill-start echoes. `ERROR_MESSAGE`/`FAILED_STEP` are "" unless outcome is error. If the command is missing (stale install), skip -telemetry — it never blocks the workflow. +it — it never blocks the workflow. ## Plan Status Footer diff --git a/setup-deploy/SKILL.md b/setup-deploy/SKILL.md index 1ad580a9fdd..0daca6a322a 100644 --- a/setup-deploy/SKILL.md +++ b/setup-deploy/SKILL.md @@ -76,15 +76,15 @@ Write (free-form only after confirmation; its words go in that file too, with `- Exit code 2 = rejected as not user-originated; do not retry. On success: "Set `` → ``. Active immediately." -## Telemetry (run last) +## Skill end (run last) -After workflow completion, log telemetry with ONE command. OUTCOME is +After workflow completion, run ONE command. OUTCOME is success/error/abort/unknown; `SESSION_ID` and `TEL_START` are the values the -preamble's skill-start output echoed. It also drains the artifacts-sync queue -(the former skill-end sync step — do not run gstack-brain-sync separately). +preamble's skill-start output echoed. It releases the session lease and drains +the artifacts-sync queue (do not run gstack-brain-sync separately). It records +no telemetry. -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** This only writes local session state. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "setup-deploy" --outcome OUTCOME \ @@ -95,7 +95,7 @@ preamble's skill-start output echoed. It also drains the artifacts-sync queue Replace `OUTCOME` and `USED_BROWSE` (yes/no) before running; substitute `SESSION_ID`/`TEL_START` from the skill-start echoes. `ERROR_MESSAGE`/`FAILED_STEP` are "" unless outcome is error. If the command is missing (stale install), skip -telemetry — it never blocks the workflow. +it — it never blocks the workflow. ## Third-Party Web Actions diff --git a/setup-gbrain/SKILL.md b/setup-gbrain/SKILL.md index 97b60bed20c..844093a05cd 100644 --- a/setup-gbrain/SKILL.md +++ b/setup-gbrain/SKILL.md @@ -78,15 +78,15 @@ Write (free-form only after confirmation; its words go in that file too, with `- Exit code 2 = rejected as not user-originated; do not retry. On success: "Set `` → ``. Active immediately." -## Telemetry (run last) +## Skill end (run last) -After workflow completion, log telemetry with ONE command. OUTCOME is +After workflow completion, run ONE command. OUTCOME is success/error/abort/unknown; `SESSION_ID` and `TEL_START` are the values the -preamble's skill-start output echoed. It also drains the artifacts-sync queue -(the former skill-end sync step — do not run gstack-brain-sync separately). +preamble's skill-start output echoed. It releases the session lease and drains +the artifacts-sync queue (do not run gstack-brain-sync separately). It records +no telemetry. -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** This only writes local session state. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "setup-gbrain" --outcome OUTCOME \ @@ -97,7 +97,7 @@ preamble's skill-start output echoed. It also drains the artifacts-sync queue Replace `OUTCOME` and `USED_BROWSE` (yes/no) before running; substitute `SESSION_ID`/`TEL_START` from the skill-start echoes. `ERROR_MESSAGE`/`FAILED_STEP` are "" unless outcome is error. If the command is missing (stale install), skip -telemetry — it never blocks the workflow. +it — it never blocks the workflow. # /setup-gbrain — Coding-Agent Onboarding for gbrain diff --git a/ship/SKILL.md b/ship/SKILL.md index c389dd07251..a1e64ae47ad 100644 --- a/ship/SKILL.md +++ b/ship/SKILL.md @@ -109,15 +109,15 @@ BRANCH=$(~/.claude/skills/gstack/bin/gstack-slug --get BRANCH 2>/dev/null) jq -nc --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg skill "SKILL_NAME" --arg branch "$BRANCH" --arg insight "ONE_LINE_SUMMARY" '{ts:$ts,skill:$skill,branch:$branch,insight:$insight}' >> "$GSTACK_STATE_ROOT/analytics/eureka.jsonl" 2>/dev/null || true ``` -## Telemetry (run last) +## Skill end (run last) -After workflow completion, log telemetry with ONE command. OUTCOME is +After workflow completion, run ONE command. OUTCOME is success/error/abort/unknown; `SESSION_ID` and `TEL_START` are the values the -preamble's skill-start output echoed. It also drains the artifacts-sync queue -(the former skill-end sync step — do not run gstack-brain-sync separately). +preamble's skill-start output echoed. It releases the session lease and drains +the artifacts-sync queue (do not run gstack-brain-sync separately). It records +no telemetry. -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** This only writes local session state. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "ship" --outcome OUTCOME \ @@ -128,7 +128,7 @@ preamble's skill-start output echoed. It also drains the artifacts-sync queue Replace `OUTCOME` and `USED_BROWSE` (yes/no) before running; substitute `SESSION_ID`/`TEL_START` from the skill-start echoes. `ERROR_MESSAGE`/`FAILED_STEP` are "" unless outcome is error. If the command is missing (stale install), skip -telemetry — it never blocks the workflow. +it — it never blocks the workflow. ## Third-Party Web Actions diff --git a/skillify/SKILL.md b/skillify/SKILL.md index fbf9b99ab41..1556162fb31 100644 --- a/skillify/SKILL.md +++ b/skillify/SKILL.md @@ -74,15 +74,15 @@ Write (free-form only after confirmation; its words go in that file too, with `- Exit code 2 = rejected as not user-originated; do not retry. On success: "Set `` → ``. Active immediately." -## Telemetry (run last) +## Skill end (run last) -After workflow completion, log telemetry with ONE command. OUTCOME is +After workflow completion, run ONE command. OUTCOME is success/error/abort/unknown; `SESSION_ID` and `TEL_START` are the values the -preamble's skill-start output echoed. It also drains the artifacts-sync queue -(the former skill-end sync step — do not run gstack-brain-sync separately). +preamble's skill-start output echoed. It releases the session lease and drains +the artifacts-sync queue (do not run gstack-brain-sync separately). It records +no telemetry. -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** This only writes local session state. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "skillify" --outcome OUTCOME \ @@ -93,7 +93,7 @@ preamble's skill-start output echoed. It also drains the artifacts-sync queue Replace `OUTCOME` and `USED_BROWSE` (yes/no) before running; substitute `SESSION_ID`/`TEL_START` from the skill-start echoes. `ERROR_MESSAGE`/`FAILED_STEP` are "" unless outcome is error. If the command is missing (stale install), skip -telemetry — it never blocks the workflow. +it — it never blocks the workflow. # /skillify — codify the last scrape into a permanent skill diff --git a/spec/SKILL.md b/spec/SKILL.md index 4307940e109..e2e9d924f9b 100644 --- a/spec/SKILL.md +++ b/spec/SKILL.md @@ -107,15 +107,15 @@ BRANCH=$(~/.claude/skills/gstack/bin/gstack-slug --get BRANCH 2>/dev/null) jq -nc --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg skill "SKILL_NAME" --arg branch "$BRANCH" --arg insight "ONE_LINE_SUMMARY" '{ts:$ts,skill:$skill,branch:$branch,insight:$insight}' >> "$GSTACK_STATE_ROOT/analytics/eureka.jsonl" 2>/dev/null || true ``` -## Telemetry (run last) +## Skill end (run last) -After workflow completion, log telemetry with ONE command. OUTCOME is +After workflow completion, run ONE command. OUTCOME is success/error/abort/unknown; `SESSION_ID` and `TEL_START` are the values the -preamble's skill-start output echoed. It also drains the artifacts-sync queue -(the former skill-end sync step — do not run gstack-brain-sync separately). +preamble's skill-start output echoed. It releases the session lease and drains +the artifacts-sync queue (do not run gstack-brain-sync separately). It records +no telemetry. -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** This only writes local session state. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "spec" --outcome OUTCOME \ @@ -126,7 +126,7 @@ preamble's skill-start output echoed. It also drains the artifacts-sync queue Replace `OUTCOME` and `USED_BROWSE` (yes/no) before running; substitute `SESSION_ID`/`TEL_START` from the skill-start echoes. `ERROR_MESSAGE`/`FAILED_STEP` are "" unless outcome is error. If the command is missing (stale install), skip -telemetry — it never blocks the workflow. +it — it never blocks the workflow. ## Third-Party Web Actions diff --git a/sync-gbrain/SKILL.md b/sync-gbrain/SKILL.md index b4d6ebfe46e..b710d50d3d9 100644 --- a/sync-gbrain/SKILL.md +++ b/sync-gbrain/SKILL.md @@ -77,15 +77,15 @@ Write (free-form only after confirmation; its words go in that file too, with `- Exit code 2 = rejected as not user-originated; do not retry. On success: "Set `` → ``. Active immediately." -## Telemetry (run last) +## Skill end (run last) -After workflow completion, log telemetry with ONE command. OUTCOME is +After workflow completion, run ONE command. OUTCOME is success/error/abort/unknown; `SESSION_ID` and `TEL_START` are the values the -preamble's skill-start output echoed. It also drains the artifacts-sync queue -(the former skill-end sync step — do not run gstack-brain-sync separately). +preamble's skill-start output echoed. It releases the session lease and drains +the artifacts-sync queue (do not run gstack-brain-sync separately). It records +no telemetry. -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** This only writes local session state. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "sync-gbrain" --outcome OUTCOME \ @@ -96,7 +96,7 @@ preamble's skill-start output echoed. It also drains the artifacts-sync queue Replace `OUTCOME` and `USED_BROWSE` (yes/no) before running; substitute `SESSION_ID`/`TEL_START` from the skill-start echoes. `ERROR_MESSAGE`/`FAILED_STEP` are "" unless outcome is error. If the command is missing (stale install), skip -telemetry — it never blocks the workflow. +it — it never blocks the workflow. # /sync-gbrain — Keep gbrain current and teach the agent to use it diff --git a/test-audit/SKILL.md b/test-audit/SKILL.md index 03c444f6fe9..5574e5e9174 100644 --- a/test-audit/SKILL.md +++ b/test-audit/SKILL.md @@ -76,15 +76,15 @@ Write (free-form only after confirmation; its words go in that file too, with `- Exit code 2 = rejected as not user-originated; do not retry. On success: "Set `` → ``. Active immediately." -## Telemetry (run last) +## Skill end (run last) -After workflow completion, log telemetry with ONE command. OUTCOME is +After workflow completion, run ONE command. OUTCOME is success/error/abort/unknown; `SESSION_ID` and `TEL_START` are the values the -preamble's skill-start output echoed. It also drains the artifacts-sync queue -(the former skill-end sync step — do not run gstack-brain-sync separately). +preamble's skill-start output echoed. It releases the session lease and drains +the artifacts-sync queue (do not run gstack-brain-sync separately). It records +no telemetry. -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** This only writes local session state. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "test-audit" --outcome OUTCOME \ @@ -95,7 +95,7 @@ preamble's skill-start output echoed. It also drains the artifacts-sync queue Replace `OUTCOME` and `USED_BROWSE` (yes/no) before running; substitute `SESSION_ID`/`TEL_START` from the skill-start echoes. `ERROR_MESSAGE`/`FAILED_STEP` are "" unless outcome is error. If the command is missing (stale install), skip -telemetry — it never blocks the workflow. +it — it never blocks the workflow. # /test-audit: Test value sweep diff --git a/test/audit-compliance.test.ts b/test/audit-compliance.test.ts index 64e6347bcf3..ebe0afdf9a2 100644 --- a/test/audit-compliance.test.ts +++ b/test/audit-compliance.test.ts @@ -50,9 +50,8 @@ describe('Audit compliance', () => { expect(skillStart).toContain('gstack-telemetry-log'); // End-of-skill telemetry (gstack-skill-end) must also be conditional const skillEnd = readFileSync(join(ROOT, 'bin/gstack-skill-end'), 'utf-8'); - expect(skillEnd).toContain('_TEL" != "off"'); - expect(skillEnd).toContain('-x '); - expect(skillEnd).toContain('gstack-telemetry-log'); + // Fork (CHE-5564): telemetry is hard off; the end-of-skill script sends none. + expect(skillEnd).not.toContain('gstack-telemetry-log'); // The render-side epilogue prose survives in the resolvers and hands off // to gstack-skill-end. const preambleDir = join(ROOT, 'scripts/resolvers/preamble'); @@ -60,7 +59,7 @@ describe('Audit compliance', () => { ? readdirSync(preambleDir).filter(f => f.endsWith('.ts')).map(f => readFileSync(join(preambleDir, f), 'utf-8')) : []; const preamble = submoduleFiles.join('\n'); - const completionIdx = preamble.indexOf('Telemetry (run last)'); + const completionIdx = preamble.indexOf('Skill end (run last)'); expect(completionIdx).toBeGreaterThan(-1); expect(preamble.slice(completionIdx)).toContain('gstack-skill-end'); }); @@ -139,6 +138,7 @@ describe('Audit compliance', () => { expect(telLog).toContain('if [ "$TIER" = "off" ]'); expect(telLog).toMatch(/if \[ "\$TIER" = "off" \][\s\S]{0,200}?exit 0/); + // Fork (CHE-5564): no generated skill invokes the telemetry binary at all. const skills = getAllSkillMds(); let checked = 0; for (const { name, content } of skills) { @@ -151,7 +151,6 @@ describe('Audit compliance', () => { expect(line, `${name}: telemetry call must not surface errors`).toContain('2>/dev/null'); } } - // Guard against the scan silently matching nothing. - expect(checked).toBeGreaterThan(0); + expect(checked).toBe(0); }); }); diff --git a/test/fixtures/golden/agy-ship-SKILL.md b/test/fixtures/golden/agy-ship-SKILL.md index a9671d20979..5f1f969a619 100644 --- a/test/fixtures/golden/agy-ship-SKILL.md +++ b/test/fixtures/golden/agy-ship-SKILL.md @@ -108,15 +108,15 @@ BRANCH=$($GSTACK_BIN/gstack-slug --get BRANCH 2>/dev/null) jq -nc --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg skill "SKILL_NAME" --arg branch "$BRANCH" --arg insight "ONE_LINE_SUMMARY" '{ts:$ts,skill:$skill,branch:$branch,insight:$insight}' >> "$GSTACK_STATE_ROOT/analytics/eureka.jsonl" 2>/dev/null || true ``` -## Telemetry (run last) +## Skill end (run last) -After workflow completion, log telemetry with ONE command. OUTCOME is +After workflow completion, run ONE command. OUTCOME is success/error/abort/unknown; `SESSION_ID` and `TEL_START` are the values the -preamble's skill-start output echoed. It also drains the artifacts-sync queue -(the former skill-end sync step — do not run gstack-brain-sync separately). +preamble's skill-start output echoed. It releases the session lease and drains +the artifacts-sync queue (do not run gstack-brain-sync separately). It records +no telemetry. -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** This only writes local session state. ```bash [ -d "${GSTACK_ROOT:-/-}/bin" ]&&[ -d "$GSTACK_ROOT/lib" ]||{ _r=$(git rev-parse --show-toplevel 2>/dev/null)/.agents/skills/gstack;[ -d "$_r/bin" ]||_r=~/.gemini/antigravity-cli/skills/gstack;[ -d "$_r/bin" ]||{ echo "gstack: no install found (tried $_r). Fix: ./setup --host agy from your gstack checkout; ./setup --status shows it.">&2;exit 1;};GSTACK_ROOT=$_r;} @@ -129,7 +129,7 @@ $GSTACK_BIN/gstack-skill-end --skill "ship" --outcome OUTCOME \ Replace `OUTCOME` and `USED_BROWSE` (yes/no) before running; substitute `SESSION_ID`/`TEL_START` from the skill-start echoes. `ERROR_MESSAGE`/`FAILED_STEP` are "" unless outcome is error. If the command is missing (stale install), skip -telemetry — it never blocks the workflow. +it — it never blocks the workflow. ## Third-Party Web Actions diff --git a/test/fixtures/golden/claude-ship-SKILL.md b/test/fixtures/golden/claude-ship-SKILL.md index c389dd07251..a1e64ae47ad 100644 --- a/test/fixtures/golden/claude-ship-SKILL.md +++ b/test/fixtures/golden/claude-ship-SKILL.md @@ -109,15 +109,15 @@ BRANCH=$(~/.claude/skills/gstack/bin/gstack-slug --get BRANCH 2>/dev/null) jq -nc --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg skill "SKILL_NAME" --arg branch "$BRANCH" --arg insight "ONE_LINE_SUMMARY" '{ts:$ts,skill:$skill,branch:$branch,insight:$insight}' >> "$GSTACK_STATE_ROOT/analytics/eureka.jsonl" 2>/dev/null || true ``` -## Telemetry (run last) +## Skill end (run last) -After workflow completion, log telemetry with ONE command. OUTCOME is +After workflow completion, run ONE command. OUTCOME is success/error/abort/unknown; `SESSION_ID` and `TEL_START` are the values the -preamble's skill-start output echoed. It also drains the artifacts-sync queue -(the former skill-end sync step — do not run gstack-brain-sync separately). +preamble's skill-start output echoed. It releases the session lease and drains +the artifacts-sync queue (do not run gstack-brain-sync separately). It records +no telemetry. -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** This only writes local session state. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "ship" --outcome OUTCOME \ @@ -128,7 +128,7 @@ preamble's skill-start output echoed. It also drains the artifacts-sync queue Replace `OUTCOME` and `USED_BROWSE` (yes/no) before running; substitute `SESSION_ID`/`TEL_START` from the skill-start echoes. `ERROR_MESSAGE`/`FAILED_STEP` are "" unless outcome is error. If the command is missing (stale install), skip -telemetry — it never blocks the workflow. +it — it never blocks the workflow. ## Third-Party Web Actions diff --git a/test/fixtures/golden/codex-ship-SKILL.md b/test/fixtures/golden/codex-ship-SKILL.md index 3f8c2558994..8575222df20 100644 --- a/test/fixtures/golden/codex-ship-SKILL.md +++ b/test/fixtures/golden/codex-ship-SKILL.md @@ -106,15 +106,15 @@ BRANCH=$($GSTACK_BIN/gstack-slug --get BRANCH 2>/dev/null) jq -nc --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg skill "SKILL_NAME" --arg branch "$BRANCH" --arg insight "ONE_LINE_SUMMARY" '{ts:$ts,skill:$skill,branch:$branch,insight:$insight}' >> "$GSTACK_STATE_ROOT/analytics/eureka.jsonl" 2>/dev/null || true ``` -## Telemetry (run last) +## Skill end (run last) -After workflow completion, log telemetry with ONE command. OUTCOME is +After workflow completion, run ONE command. OUTCOME is success/error/abort/unknown; `SESSION_ID` and `TEL_START` are the values the -preamble's skill-start output echoed. It also drains the artifacts-sync queue -(the former skill-end sync step — do not run gstack-brain-sync separately). +preamble's skill-start output echoed. It releases the session lease and drains +the artifacts-sync queue (do not run gstack-brain-sync separately). It records +no telemetry. -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** This only writes local session state. ```bash [ -d "${GSTACK_ROOT:-/-}/bin" ]&&[ -d "$GSTACK_ROOT/lib" ]||{ _r=$(git rev-parse --show-toplevel 2>/dev/null)/.agents/skills/gstack;[ -d "$_r/bin" ]||_r=${CODEX_HOME:-~/.codex}/skills/gstack;[ -d "$_r/bin" ]||{ echo "gstack: no install found (tried $_r). Fix: ./setup --host codex from your gstack checkout; ./setup --status shows it.">&2;exit 1;};GSTACK_ROOT=$_r;} @@ -127,7 +127,7 @@ $GSTACK_BIN/gstack-skill-end --skill "ship" --outcome OUTCOME \ Replace `OUTCOME` and `USED_BROWSE` (yes/no) before running; substitute `SESSION_ID`/`TEL_START` from the skill-start echoes. `ERROR_MESSAGE`/`FAILED_STEP` are "" unless outcome is error. If the command is missing (stale install), skip -telemetry — it never blocks the workflow. +it — it never blocks the workflow. ## Third-Party Web Actions diff --git a/test/fixtures/golden/factory-ship-SKILL.md b/test/fixtures/golden/factory-ship-SKILL.md index 2854fa993a0..8ede1f6b195 100644 --- a/test/fixtures/golden/factory-ship-SKILL.md +++ b/test/fixtures/golden/factory-ship-SKILL.md @@ -108,15 +108,15 @@ BRANCH=$($GSTACK_BIN/gstack-slug --get BRANCH 2>/dev/null) jq -nc --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg skill "SKILL_NAME" --arg branch "$BRANCH" --arg insight "ONE_LINE_SUMMARY" '{ts:$ts,skill:$skill,branch:$branch,insight:$insight}' >> "$GSTACK_STATE_ROOT/analytics/eureka.jsonl" 2>/dev/null || true ``` -## Telemetry (run last) +## Skill end (run last) -After workflow completion, log telemetry with ONE command. OUTCOME is +After workflow completion, run ONE command. OUTCOME is success/error/abort/unknown; `SESSION_ID` and `TEL_START` are the values the -preamble's skill-start output echoed. It also drains the artifacts-sync queue -(the former skill-end sync step — do not run gstack-brain-sync separately). +preamble's skill-start output echoed. It releases the session lease and drains +the artifacts-sync queue (do not run gstack-brain-sync separately). It records +no telemetry. -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** This only writes local session state. ```bash [ -d "${GSTACK_ROOT:-/-}/bin" ]&&[ -d "$GSTACK_ROOT/lib" ]||{ _r=$(git rev-parse --show-toplevel 2>/dev/null)/.factory/skills/gstack;[ -d "$_r/bin" ]||_r=~/.factory/skills/gstack;[ -d "$_r/bin" ]||{ echo "gstack: no install found (tried $_r). Fix: ./setup --host factory from your gstack checkout; ./setup --status shows it.">&2;exit 1;};GSTACK_ROOT=$_r;} @@ -129,7 +129,7 @@ $GSTACK_BIN/gstack-skill-end --skill "ship" --outcome OUTCOME \ Replace `OUTCOME` and `USED_BROWSE` (yes/no) before running; substitute `SESSION_ID`/`TEL_START` from the skill-start echoes. `ERROR_MESSAGE`/`FAILED_STEP` are "" unless outcome is error. If the command is missing (stale install), skip -telemetry — it never blocks the workflow. +it — it never blocks the workflow. ## Third-Party Web Actions diff --git a/test/fork-update-no-telemetry.test.ts b/test/fork-update-no-telemetry.test.ts new file mode 100644 index 00000000000..b7e3cbae4de --- /dev/null +++ b/test/fork-update-no-telemetry.test.ts @@ -0,0 +1,166 @@ +/** + * CHE-5564: the fork updates from cheese-work/gstack without a prompt and + * ships with telemetry hard off. + * + * 1. bin/gstack-update-check reads versions only from cheese-work/gstack + * (curl and git are shimmed on PATH; the request log must hold no garrytan URL). + * 2. bin/gstack-skill-start on a fresh state root, with a newer fork version + * available, upgrades silently (bin/gstack-upgrade runs) and emits no + * upgrade-flow or telemetry-prompt block. + * 3. No committed SKILL.md carries the "Telemetry (run last)" section or + * gstack-telemetry-log. + */ +import { describe, expect, test } from 'bun:test'; +import { execFileSync, spawnSync } from 'node:child_process'; +import * as fs from 'node:fs'; +import * as os from 'node:os'; +import * as path from 'node:path'; + +const ROOT = path.resolve(import.meta.dir, '..'); + +function tmp(prefix: string): string { + return fs.mkdtempSync(path.join(os.tmpdir(), prefix)); +} + +describe('gstack-update-check queries only the fork', () => { + test('curl and git requests name cheese-work/gstack, never garrytan', () => { + const dir = tmp('gstack-fork-upd-'); + const install = path.join(dir, 'install'); + const state = path.join(dir, 'state'); + const shim = path.join(dir, 'shim'); + const log = path.join(dir, 'requests.log'); + fs.mkdirSync(path.join(install, 'bin'), { recursive: true }); + fs.mkdirSync(state); + fs.mkdirSync(shim); + for (const n of ['gstack-config', 'gstack-egress-lib.sh', 'gstack-state-root.sh', 'gstack-egress-receipt', 'gstack-update-channel.sh']) { + fs.symlinkSync(path.join(ROOT, 'bin', n), path.join(install, 'bin', n)); + } + fs.writeFileSync(path.join(install, 'VERSION'), '1.0.0\n'); + fs.writeFileSync(path.join(shim, 'curl'), `#!/usr/bin/env bash\necho "curl $*" >> "${log}"\necho 1.0.1\n`, { mode: 0o755 }); + fs.writeFileSync(path.join(shim, 'git'), `#!/usr/bin/env bash\necho "git $*" >> "${log}"\nexit 0\n`, { mode: 0o755 }); + try { + const r = spawnSync('bash', [path.join(ROOT, 'bin', 'gstack-update-check'), '--force'], { + encoding: 'utf8', + timeout: 30_000, + env: { PATH: `${shim}:${process.env.PATH}`, HOME: dir, GSTACK_DIR: install, GSTACK_HOME: state }, + }); + const requests = fs.existsSync(log) ? fs.readFileSync(log, 'utf8') : ''; + expect(requests, r.stdout + r.stderr).toContain('cheese-work/gstack'); + expect(requests).not.toContain('garrytan'); + expect(r.stdout).toContain('UPGRADE_AVAILABLE 1.0.0 1.0.1'); + } finally { + fs.rmSync(dir, { recursive: true, force: true }); + } + }); +}); + +describe('gstack-update-check sends no telemetry ping', () => { + test('no request to Supabase even with telemetry: community and a Supabase URL configured', () => { + const dir = tmp('gstack-fork-ping-'); + const install = path.join(dir, 'install'); + const state = path.join(dir, 'state'); + const shim = path.join(dir, 'shim'); + const log = path.join(dir, 'requests.log'); + fs.mkdirSync(path.join(install, 'bin'), { recursive: true }); + fs.mkdirSync(state); + fs.mkdirSync(shim); + for (const n of ['gstack-config', 'gstack-egress-lib.sh', 'gstack-state-root.sh', 'gstack-egress-receipt', 'gstack-update-channel.sh']) { + fs.symlinkSync(path.join(ROOT, 'bin', n), path.join(install, 'bin', n)); + } + fs.writeFileSync(path.join(install, 'VERSION'), '1.0.0\n'); + fs.writeFileSync(path.join(state, 'config.yaml'), 'telemetry: community\n'); + fs.writeFileSync(path.join(shim, 'curl'), `#!/usr/bin/env bash\necho "curl $*" >> "${log}"\necho 1.0.1\n`, { mode: 0o755 }); + fs.writeFileSync(path.join(shim, 'git'), `#!/usr/bin/env bash\necho "git $*" >> "${log}"\nexit 0\n`, { mode: 0o755 }); + try { + const r = spawnSync('bash', [path.join(ROOT, 'bin', 'gstack-update-check'), '--force'], { + encoding: 'utf8', + timeout: 30_000, + env: { + PATH: `${shim}:${process.env.PATH}`, HOME: dir, GSTACK_DIR: install, GSTACK_HOME: state, + GSTACK_SUPABASE_URL: 'https://example.supabase.co', GSTACK_SUPABASE_ANON_KEY: 'k', + }, + }); + Bun.sleepSync(1000); // the old ping ran in a background subshell + const requests = fs.existsSync(log) ? fs.readFileSync(log, 'utf8') : ''; + expect(requests, r.stdout + r.stderr).toContain('cheese-work/gstack'); + expect(requests).not.toContain('supabase'); + expect(requests).not.toContain('update-check'); + } finally { + fs.rmSync(dir, { recursive: true, force: true }); + } + }); +}); + +describe('gstack-skill-start: silent fork upgrade, no telemetry prompt', () => { + function runFresh(lakeSeen: boolean): { out: string; upgradeCalls: string } { + const dir = tmp('gstack-fork-start-'); + const home = path.join(dir, 'home'); + const state = path.join(dir, 'state'); // fresh state root: no config.yaml + fs.mkdirSync(home); + fs.mkdirSync(state); + if (lakeSeen) fs.writeFileSync(path.join(state, '.completeness-intro-seen'), ''); + const bin = path.join(dir, 'bin'); + fs.cpSync(path.join(ROOT, 'bin'), bin, { recursive: true, dereference: false }); + fs.writeFileSync(path.join(bin, 'gstack-update-check'), '#!/usr/bin/env bash\necho "UPGRADE_AVAILABLE 1.0.0 1.0.1"\n', { mode: 0o755 }); + const calls = path.join(dir, 'upgrade-calls'); + fs.writeFileSync(path.join(bin, 'gstack-upgrade'), `#!/usr/bin/env bash\necho "called $*" >> "${calls}"\necho "gstack-upgrade: upgraded 1.0.0 -> 1.0.1"\n`, { mode: 0o755 }); + try { + const out = execFileSync(path.join(bin, 'gstack-skill-start'), ['--skill', 'testskill'], { + encoding: 'utf8', + timeout: 60_000, + cwd: home, + env: { PATH: process.env.PATH!, HOME: home, GSTACK_HOME: state, GSTACK_LEASE_DIR: path.join(state, 'leases') }, + }); + return { out, upgradeCalls: fs.existsSync(calls) ? fs.readFileSync(calls, 'utf8') : '' }; + } finally { + fs.rmSync(dir, { recursive: true, force: true }); + } + } + + for (const lakeSeen of [false, true]) { + test(`newer fork version installs silently (lake intro seen: ${lakeSeen})`, () => { + const { out, upgradeCalls } = runFresh(lakeSeen); + expect(upgradeCalls).toContain('called'); + expect(out).not.toContain('GSTACK_INSTRUCTION_BEGIN: upgrade-flow'); + expect(out).not.toContain('AskUserQuestion with 4 options'); + expect(out).not.toContain('GSTACK_INSTRUCTION_BEGIN: telemetry-prompt'); + expect(out).toMatch(/^TELEMETRY: off$/m); + }); + } +}); + +describe('telemetry is hard off', () => { + test('gstack-telemetry-log writes nothing and gstack-telemetry-sync sends nothing, even with telemetry: community', () => { + const dir = tmp('gstack-fork-tel-'); + const shim = path.join(dir, 'shim'); + const log = path.join(dir, 'curl.log'); + fs.mkdirSync(shim); + fs.writeFileSync(path.join(shim, 'curl'), `#!/usr/bin/env bash\necho "curl $*" >> "${log}"\n`, { mode: 0o755 }); + fs.writeFileSync(path.join(dir, 'config.yaml'), 'telemetry: community\n'); + const env = { PATH: `${shim}:${process.env.PATH}`, HOME: dir, GSTACK_HOME: dir }; + try { + for (const args of [['telemetry-log', '--skill', 'x', '--outcome', 'success'], ['telemetry-sync']]) { + const r = spawnSync('bash', [path.join(ROOT, 'bin', 'gstack-' + args[0]), ...args.slice(1)], { encoding: 'utf8', timeout: 30_000, env }); + expect(r.status, r.stderr).toBe(0); + } + expect(fs.existsSync(path.join(dir, 'analytics', 'skill-usage.jsonl'))).toBe(false); + expect(fs.existsSync(log)).toBe(false); + } finally { + fs.rmSync(dir, { recursive: true, force: true }); + } + }); +}); + +describe('generated skills carry no telemetry section', () => { + test('no SKILL.md contains "Telemetry (run last)" or gstack-telemetry-log', () => { + const files = execFileSync('git', ['ls-files', '--', '*SKILL.md', '*SKILL.md.tmpl'], { cwd: ROOT, encoding: 'utf8' }) + .split('\n') + .filter((f) => f && !f.startsWith('test/fixtures/')); + expect(files.length).toBeGreaterThan(50); + const offenders = files.filter((f) => { + const text = fs.readFileSync(path.join(ROOT, f), 'utf8'); + return text.includes('Telemetry (run last)') || text.includes('gstack-telemetry-log'); + }); + expect(offenders).toEqual([]); + }); +}); diff --git a/test/gen-skill-docs.test.ts b/test/gen-skill-docs.test.ts index 2e3bb05fd41..dbfa0b6a369 100644 --- a/test/gen-skill-docs.test.ts +++ b/test/gen-skill-docs.test.ts @@ -414,10 +414,10 @@ describe('gen-skill-docs', () => { expect(updateCheck, 'binary must read update_check config').toContain('get update_check'); expect(updateCheck, 'binary must exit silently on update_check=false') .toMatch(/if \[ "\$_UC" = "false" \]; then\n\s*exit 0/); - // Gate half 2: the upgrade-flow instruction block emits only when the + // Gate half 2: the silent fork upgrade (CHE-5564) runs only when the // binary emitted something (empty when opted out, cached, or up to date). - expect(SKILL_START_SCRIPT, 'upgrade-flow must be gated on update-check output') - .toMatch(/if \[ -n "\$_UPD" \]; then\n\s*_emit_block upgrade-flow/); + expect(SKILL_START_SCRIPT, 'upgrade must be gated on update-check output') + .toMatch(/if \[ -n "\$_UPD" \]; then\n\s*case "\$_UPD" in/); }); test('tier 2+ skills contain ELI10 simplification rules (AskUserQuestion format)', () => { @@ -450,13 +450,12 @@ describe('gen-skill-docs', () => { expect(router).toContain('model or skill benchmarks → invoke `/benchmark-models`'); }); - test('telemetry producer lives in the scripts; render documents the analytics sink', () => { - // The skill-usage.jsonl producers moved into the scripts (Phase 1). - expect(SKILL_START_SCRIPT).toContain('analytics/skill-usage.jsonl'); - expect(SKILL_END_SCRIPT).toContain('analytics/skill-usage.jsonl'); - // The render still tells the model where telemetry lands. - const content = fs.readFileSync(path.join(ROOT, 'SKILL.md'), 'utf-8'); - expect(content).toContain('$GSTACK_STATE_ROOT/analytics/'); + test('telemetry is hard off in the scripts (CHE-5564)', () => { + // Fork: the skill-usage.jsonl producer in skill-start stays behind a gate + // that is forced off; skill-end carries no analytics producer at all. + expect(SKILL_START_SCRIPT).toContain('_TEL=off'); + expect(SKILL_END_SCRIPT).not.toContain('analytics/skill-usage.jsonl'); + expect(SKILL_END_SCRIPT).not.toContain('gstack-telemetry-log'); }); test('plan-review generated preambles stay under the Option A budget', () => { @@ -1522,7 +1521,7 @@ describe('make-pdf setup ordering', () => { const preambleIdx = content.indexOf('## Preamble (run first)'); const setupIdx = content.indexOf('## MAKE-PDF SETUP'); const planModeIdx = content.indexOf('## Plan Mode Safe Operations'); - const telemetryIdx = content.indexOf('## Telemetry (run last)'); + const telemetryIdx = content.indexOf('## Skill end (run last)'); const workflowIdx = content.indexOf('# make-pdf: publication-quality PDFs from markdown'); expect(preambleIdx).toBeGreaterThanOrEqual(0); @@ -2154,7 +2153,7 @@ describe('INVOKE_SKILL resolver', () => { test('INVOKE_SKILL output includes default skip list', () => { expect(ceoContent).toContain('Preamble (run first)'); - expect(ceoContent).toContain('Telemetry (run last)'); + expect(ceoContent).toContain('Skill end (run last)'); expect(ceoContent).toContain('AskUserQuestion Format'); }); @@ -3134,11 +3133,9 @@ describe('Codex generation (--host codex)', () => { expect(content).toContain('[ -d "$GSTACK_ROOT/bin" ]||GSTACK_ROOT=${CODEX_HOME:-~/.codex}/skills/gstack'); expect(content).toContain('"$GSTACK_ROOT/bin/gstack-skill-start"'); expect(content).toContain('$GSTACK_BIN/gstack-question-preference'); - // The upgrade-skill doc reference moved into the script's upgrade-flow - // block, resolved $0-relative ($_ROOT_DIR) — host-neutral by construction, - // so the Codex render no longer needs its own copy. - expect(SKILL_START_SCRIPT).toContain('$_ROOT_DIR/gstack-upgrade/SKILL.md'); - expect(SKILL_START_SCRIPT).toContain('_ROOT_DIR=$(dirname "$_BIN")'); + // The silent fork upgrade runs gstack-upgrade from the script's own bin + // dir ($_BIN) — host-neutral by construction, no per-host copy in the render. + expect(SKILL_START_SCRIPT).toContain('"$_BIN/gstack-upgrade"'); expect(content).not.toContain('~/.codex/skills/gstack/bin/gstack-config get telemetry'); }); @@ -4005,40 +4002,33 @@ describe('telemetry', () => { expect(SKILL_START_SCRIPT).toContain('_SESSION_ID='); expect(SKILL_START_SCRIPT).toContain('echo "TELEMETRY:'); expect(SKILL_START_SCRIPT).toContain('echo "TEL_PROMPTED:'); - expect(SKILL_START_SCRIPT).toMatch(/gstack-config" get telemetry/); + // Fork (CHE-5564): telemetry is forced off, never read from config. + expect(SKILL_START_SCRIPT).toContain('_TEL=off'); + expect(SKILL_START_SCRIPT).not.toMatch(/gstack-config" get telemetry/); // The render must tell the model to carry SESSION_ID/TEL_START to skill end. const content = fs.readFileSync(path.join(ROOT, 'SKILL.md'), 'utf-8'); expect(content).toContain('SESSION_ID'); expect(content).toContain('TEL_START'); }); - test('telemetry opt-in prompt lives in gstack-skill-start (marker-gated emit)', () => { - // Token-reduction Phase 2: the one-time consent prompt left the renders - // (absence pinned by test/onboarding-moved-literals.test.ts); the script - // gates it on the marker files and emits it as a GSTACK_INSTRUCTION block - // with all three config-set outcomes and the ack INSIDE the block. - expect(SKILL_START_SCRIPT).toContain( - 'if [ "$_TEL_PROMPTED" = "no" ] && [ "$_LAKE_SEEN" = "yes" ]; then', - ); - expect(SKILL_START_SCRIPT).toContain('_emit_block telemetry-prompt'); - expect(SKILL_START_SCRIPT).toContain('gstack-config set telemetry community'); - expect(SKILL_START_SCRIPT).toContain('gstack-config set telemetry anonymous'); - expect(SKILL_START_SCRIPT).toContain('gstack-config set telemetry off'); - expect(SKILL_START_SCRIPT).toContain('touch "$_GH/.telemetry-prompted"'); + test('no telemetry opt-in prompt exists in gstack-skill-start (CHE-5564)', () => { + expect(SKILL_START_SCRIPT).not.toContain('_emit_block telemetry-prompt'); + expect(SKILL_START_SCRIPT).not.toContain('gstack-config set telemetry'); + expect(SKILL_START_SCRIPT).not.toContain('.telemetry-prompted"'); }); - test('generated SKILL.md contains telemetry epilogue (one gstack-skill-end call)', () => { + test('generated SKILL.md contains the skill-end epilogue (one gstack-skill-end call, no telemetry)', () => { const content = fs.readFileSync(path.join(ROOT, 'SKILL.md'), 'utf-8'); - expect(content).toContain('Telemetry (run last)'); + expect(content).toContain('Skill end (run last)'); expect(content).toContain('gstack-skill-end --skill "gstack" --outcome OUTCOME'); expect(content).toContain('--tel-start "TEL_START"'); expect(content).toContain('PLAN MODE EXCEPTION'); - // The duration math + remote-log dispatch moved into gstack-skill-end. + expect(content).not.toContain('Telemetry (run last)'); expect(SKILL_END_SCRIPT).toContain('_TEL_END'); expect(SKILL_END_SCRIPT).toContain('_TEL_DUR'); expect(SKILL_END_SCRIPT).toContain('SKILL_NAME'); expect(SKILL_END_SCRIPT).toContain('OUTCOME'); - expect(SKILL_END_SCRIPT).toContain('gstack-telemetry-log'); + expect(SKILL_END_SCRIPT).not.toContain('gstack-telemetry-log'); }); test('pending marker handling lives in the scripts', () => { @@ -4055,7 +4045,7 @@ describe('telemetry', () => { const skillPath = path.join(ROOT, skill, 'SKILL.md'); if (fs.existsSync(skillPath)) { const content = fs.readFileSync(skillPath, 'utf-8'); - expect(content).toContain('Telemetry (run last)'); + expect(content).toContain('Skill end (run last)'); expect(content).toContain(`gstack-skill-end --skill "${skill}"`); expect(content).toContain('--tel-start "TEL_START"'); } @@ -4887,7 +4877,7 @@ describe('EXIT PLAN MODE GATE placement', () => { expect(gate).toBeGreaterThan(headings.indexOf('## Section self-check (before you finish)')); expect(headings.slice(gate)).toEqual(['## EXIT PLAN MODE GATE (BLOCKING)', '## Brain Cache Background Refresh']); const tail = md.slice(md.indexOf('## EXIT PLAN MODE GATE (BLOCKING)')); - const telemetry = tail.indexOf('**Telemetry (run last)**'); + const telemetry = tail.indexOf('**Skill end (run last)**'); expect(telemetry).toBeGreaterThan(0); const cache = tail.indexOf('## Brain Cache Background Refresh'); if (skill === 'plan-ceo-review') expect(telemetry).toBeGreaterThan(cache); @@ -4896,7 +4886,7 @@ describe('EXIT PLAN MODE GATE placement', () => { const finalHandoff = tail.slice(tail.indexOf('## Brain Cache Background Refresh')); expect(finalHandoff).toContain(skill === 'plan-ceo-review' ? 'Call ExitPlanMode where required or return to the caller' : 'After success telemetry and cache dispatch, call ExitPlanMode'); if (skill === 'plan-ceo-review') { - expect(finalHandoff.indexOf('Call ExitPlanMode')).toBeGreaterThan(finalHandoff.indexOf('**Telemetry (run last)**')); + expect(finalHandoff.indexOf('Call ExitPlanMode')).toBeGreaterThan(finalHandoff.indexOf('**Skill end (run last)**')); expect(finalHandoff).toContain('handoff starts a separate workflow'); } if (skill === 'plan-eng-review') { diff --git a/test/helpers/skill-fixture.ts b/test/helpers/skill-fixture.ts index 9fdd82f483d..b1632b34ee4 100644 --- a/test/helpers/skill-fixture.ts +++ b/test/helpers/skill-fixture.ts @@ -103,7 +103,7 @@ export const CODEX_REVIEW_E2E_SECTIONS = [ const SHARED_PREAMBLE_FIRST = ['Preamble (run first)', 'Preamble (after scope gate)']; const SHARED_PREAMBLE_LAST = 'Plan Status Footer'; /** Preamble sections a hoisted SKILL.md keeps inline because they name the skill. */ -const INLINE_PREAMBLE = [...SHARED_PREAMBLE_FIRST, 'Question Tuning', 'Repo Ownership', 'Search Before Building', 'Telemetry (run last)']; +const INLINE_PREAMBLE = [...SHARED_PREAMBLE_FIRST, 'Question Tuning', 'Repo Ownership', 'Search Before Building', 'Skill end (run last)']; interface H2Section { heading: string; @@ -258,8 +258,8 @@ export function extractSkillBody(skillDir: string): string { let end = pointer; while (end + 1 < all.length && (shared.has(all[end + 1].heading) || INLINE_PREAMBLE.some(name => all[end + 1].heading.startsWith(name)))) end++; - if (!all.slice(pointer, end + 1).some(section => section.heading === 'Telemetry (run last)')) { - throw new Error(`skill-fixture: no "## Telemetry (run last)" closes the preamble in ${file}.`); + if (!all.slice(pointer, end + 1).some(section => section.heading === 'Skill end (run last)')) { + throw new Error(`skill-fixture: no "## Skill end (run last)" closes the preamble in ${file}.`); } [first, last] = [all[pointer], all[end]]; } else { diff --git a/test/onboarding-moved-literals.test.ts b/test/onboarding-moved-literals.test.ts index 47cffc1eb40..6888a505167 100644 --- a/test/onboarding-moved-literals.test.ts +++ b/test/onboarding-moved-literals.test.ts @@ -22,7 +22,6 @@ const SCRIPT = fs.readFileSync(path.join(ROOT, 'bin', 'gstack-skill-start'), 'ut /** flow id -> distinctive literal that must live in the script only. */ const MOVED: Record = { 'lake-intro': 'https://garryslist.org/posts/boil-the-ocean', - 'telemetry-prompt': 'Help gstack get better! (recommended)', 'proactive-prompt': "Turn it off — I'll type /commands myself", 'first-run-tip': 'Fresh repo — shape it first with', 'first-loop-tip': 'gstack pays off when you complete one loop', @@ -31,7 +30,7 @@ const MOVED: Record = { 'writing-style-migration': 'Keep default or restore terse?', 'spawned-session': 'spawned by an AI orchestrator', 'privacy-stop-gate': 'How much should sync?', - 'upgrade-flow': 'Inline upgrade flow', + 'upgrade-flow': 'JUST_UPGRADED ', }; function generatedSkillFiles(): string[] { diff --git a/test/proactive-skill-start.test.ts b/test/proactive-skill-start.test.ts index 4b53845986f..8b01a3a3db5 100644 --- a/test/proactive-skill-start.test.ts +++ b/test/proactive-skill-start.test.ts @@ -147,14 +147,14 @@ describe('gstack-skill-start PROACTIVE status line', () => { expect(rulesOf(shipped.section).length).toBeGreaterThan(4); }, 60_000); - test('a stored off answers the one-time proactive prompt: no prompt block, marker written; core still asks once telemetry was answered', () => { + test('a stored off answers the one-time proactive prompt: no prompt block, marker written; core still asks once the lake intro was answered', () => { const cases: Array<[string, boolean]> = [ ['update_check: false\ntelemetry: off\n', true], ['update_check: false\ntelemetry: off\nproactive: off\n', false], ]; for (const [config, asked] of cases) { const state = freshState(config); - fs.writeFileSync(path.join(state, '.telemetry-prompted'), ''); + fs.writeFileSync(path.join(state, '.completeness-intro-seen'), ''); try { const out = runStart(path.join(BIN, 'gstack-skill-start'), state); expect(out.includes('GSTACK_INSTRUCTION_BEGIN: proactive-prompt'), config).toBe(asked); diff --git a/test/skill-ceo-section-ordering.test.ts b/test/skill-ceo-section-ordering.test.ts index 8f6ee762a9b..122d1eec4de 100644 --- a/test/skill-ceo-section-ordering.test.ts +++ b/test/skill-ceo-section-ordering.test.ts @@ -632,7 +632,7 @@ test('CEO closing route checks approvals before outputs and verifies artifacts b const terminal = skeleton.slice(actualGate); const success = compactProse(terminal.split('**Passed with a verified persisted report:**')[1]!); ordered(success, [/finish the cache refresh below/i, '{{BRAIN_CACHE_REFRESH}}', - '**Telemetry (run last)** once', /the review is now finished/i, 'Call ExitPlanMode', + '**Skill end (run last)** once', /the review is now finished/i, 'Call ExitPlanMode', /next-skill handoff starts a separate workflow/i]); expect(terminal).not.toMatch(/return to (?:the )?section|Closing hooks/); for (const host of ALL_HOST_CONFIGS) { diff --git a/test/skill-fixture.test.ts b/test/skill-fixture.test.ts index f05ca0729eb..773489a630c 100644 --- a/test/skill-fixture.test.ts +++ b/test/skill-fixture.test.ts @@ -299,7 +299,7 @@ describe('real-skill pins: section lists used by E2E fixtures', () => { expect(out).toContain('## Step 4: Critical pass (core review)'); expect(out).toContain('## Important Rules'); // Drops the shared preamble and the untested workflow tail. - expect(out).not.toContain('## Telemetry (run last)'); + expect(out).not.toContain('## Skill end (run last)'); expect(out).not.toContain('## Step 5: Fix-First Review'); expect(out).not.toContain('review/sections/review-army.md'); // Step 4's sideways-sweep paragraph (plan D2 replaced the enum-only one) survives the extraction. @@ -322,7 +322,7 @@ describe('real-skill pins: section lists used by E2E fixtures', () => { ); const out = extractSkillSections(path.join(ROOT, 'review'), skeletonSections); expect(out).toContain('## Step 1.5: Scope Drift Detection'); - expect(out).not.toContain('## Telemetry (run last)'); + expect(out).not.toContain('## Skill end (run last)'); const planCompletion = fs.readFileSync( path.join(ROOT, 'review', 'sections', 'plan-completion.md'), 'utf-8'); @@ -349,7 +349,7 @@ describe('real-skill pins: section lists used by E2E fixtures', () => { expect(out).not.toContain('## Global Retrospective Mode'); expect(out).toContain('Read `~/.claude/skills/gstack/retro/sections/report-format.md` and execute it'); expectMentions(out, [['stop', 'repo-scoped', 'result-save']], 'out'); - expect(out).not.toContain('## Telemetry (run last)'); + expect(out).not.toContain('## Skill end (run last)'); const reportFormat = fs.readFileSync( path.join(ROOT, 'retro', 'sections', 'report-format.md'), 'utf-8'); @@ -362,7 +362,7 @@ describe('real-skill pins: section lists used by E2E fixtures', () => { if (!fs.existsSync(path.join(codexReview, 'SKILL.md'))) return; // gitignored artifact, absent in fresh checkouts const out = extractSkillSections(codexReview, CODEX_REVIEW_E2E_SECTIONS); expect(out).toContain('## Step 4: Critical pass (core review)'); - expect(out).not.toContain('## Telemetry (run last)'); + expect(out).not.toContain('## Skill end (run last)'); }); // Run 42571575838: the excerpt kept ~/.claude/skills/gstack/bin/gstack-codex-probe, @@ -417,7 +417,7 @@ describe('real-skill pins: body/head extraction used by E2E fixtures', () => { const out = extractSkillBody(path.join(ROOT, skill)); expect(out).not.toContain('## Preamble (run first)'); expect(out).not.toContain('## Preamble (after scope gate)'); - expect(out).not.toContain('## Telemetry (run last)'); + expect(out).not.toContain('## Skill end (run last)'); expect(out).not.toContain(SHARED_POINTER_HEADING); const full = readSkillStartup(path.join(ROOT, skill, 'SKILL.md')); expect(out.length).toBeLessThan(full.length * 0.75); diff --git a/test/skill-validation.test.ts b/test/skill-validation.test.ts index ea2b5a996ad..d6a9bf03916 100644 --- a/test/skill-validation.test.ts +++ b/test/skill-validation.test.ts @@ -374,20 +374,14 @@ describe('Update check preamble', () => { }); } - test('bin/gstack-skill-start emits the UPGRADE_AVAILABLE interpretation as the upgrade-flow instruction block', () => { - // Phase 2 successor of the per-render UPGRADE_AVAILABLE prose pin: the - // interpretation now lives in the script's instruction-emission layer, - // wrapped in GSTACK_INSTRUCTION_BEGIN/upgrade-flow/SESSION_ID markers and - // emitted only when the gate fires. Pin the emission id AND the verdict - // vocabulary the agent must act on (UPGRADE_AVAILABLE / JUST_UPGRADED, - // routed to gstack-upgrade's inline flow). + test('bin/gstack-skill-start upgrades silently on UPGRADE_AVAILABLE and notes JUST_UPGRADED (CHE-5564)', () => { + // Fork: no upgrade question. UPGRADE_AVAILABLE runs gstack-upgrade without + // a prompt; JUST_UPGRADED still emits a short upgrade-flow note, bound to + // the live SESSION_ID by the emission wrapper. const script = fs.readFileSync(path.join(ROOT, 'bin', 'gstack-skill-start'), 'utf-8'); - expect(script).toContain('_emit_block upgrade-flow'); - expect(script).toContain('UPGRADE_AVAILABLE '); + expect(script).toContain('"$_BIN/gstack-upgrade"'); expect(script).toContain('JUST_UPGRADED '); - expect(script).toContain('gstack-upgrade/SKILL.md'); - // The emission wrapper itself binds every block to the live SESSION_ID — - // the render-side rule above is only sound if this stays true. + expect(script).not.toContain('AskUserQuestion with 4 options'); expect(script).toContain('GSTACK_INSTRUCTION_BEGIN: $1 $_SESSION_ID'); }); diff --git a/test/telemetry.test.ts b/test/telemetry.test.ts deleted file mode 100644 index 2b0a28b849e..00000000000 --- a/test/telemetry.test.ts +++ /dev/null @@ -1,577 +0,0 @@ -import { describe, test, expect, beforeEach, afterEach } from 'bun:test'; -import { execSync } from 'child_process'; -import * as fs from 'fs'; -import * as path from 'path'; -import * as os from 'os'; - -const ROOT = path.resolve(import.meta.dir, '..'); -const BIN = path.join(ROOT, 'bin'); - -// Each test owns its state and HTTP transport. The real logger backgrounds -// sync while retaining stdout, and run() waits for that transport: the -// command's stdout goes through cat, which exits only after every holder of -// the pipe (the backgrounded sync included) closes it. execSync alone does -// not guarantee that wait (Bun 1.3.x returns when the direct child exits). -// Letting it reach the configured backend made a slow curl exceed our 10s -// command timeout before the local marker assertions could run. -let tmpDir: string; -const FIXTURE_SUPABASE_URL = 'https://telemetry.fixture.invalid'; - -function run(cmd: string, env: Record = {}): string { - return execSync(`{ ${cmd}\n} | cat; exit "\${PIPESTATUS[0]}"`, { - shell: '/bin/bash', - cwd: ROOT, - env: { - ...process.env, - HOME: path.join(tmpDir, 'home'), - GSTACK_STATE_DIR: tmpDir, GSTACK_STATE_ROOT: tmpDir, GSTACK_HOME: tmpDir, - GSTACK_DIR: ROOT, GSTACK_SUPABASE_URL: FIXTURE_SUPABASE_URL, - GSTACK_SUPABASE_ANON_KEY: 'fixture-anon-key', - GSTACK_TEST_CURL_ARGS: path.join(tmpDir, 'curl-args'), - ...env, - // Preserve per-case bun stubs while keeping curl isolated in every case. - PATH: `${path.join(tmpDir, 'bin')}:${env.PATH ?? process.env.PATH ?? ''}`, - }, - encoding: 'utf-8', - timeout: 10000, - }).trim(); -} - -function setConfig(key: string, value: string) { - run(`${BIN}/gstack-config set ${key} ${value}`); -} - -function readJsonl(): string[] { - const file = path.join(tmpDir, 'analytics', 'skill-usage.jsonl'); - if (!fs.existsSync(file)) return []; - return fs.readFileSync(file, 'utf-8').trim().split('\n').filter(Boolean); -} - -function parseJsonl(): any[] { - return readJsonl().map(line => JSON.parse(line)); -} - -function curlRequests(): string[][] { - const file = path.join(tmpDir, 'curl-args'); - if (!fs.existsSync(file)) return []; - return fs.readFileSync(file, 'utf8').split('\0\0').filter(Boolean).map(call => call.split('\0')); -} - -function unconfiguredRoot(): string { - const fixture = path.join(tmpDir, 'unconfigured'); - fs.mkdirSync(path.join(fixture, 'bin'), { recursive: true }); - fs.copyFileSync(path.join(BIN, 'gstack-egress-lib.sh'), path.join(fixture, 'bin', 'gstack-egress-lib.sh')); - return fixture; -} - -beforeEach(() => { - tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'gstack-tel-')); - fs.mkdirSync(path.join(tmpDir, 'home')); - fs.mkdirSync(path.join(tmpDir, 'bin')); - fs.writeFileSync(path.join(tmpDir, 'bin', 'curl'), `#!/bin/sh -printf '%s\\0' "$@" >> "$GSTACK_TEST_CURL_ARGS" -printf '\\0' >> "$GSTACK_TEST_CURL_ARGS" -fixture_output='' -fixture_body='{"inserted":1}' -while [ "$#" -gt 0 ]; do - case "$1" in - -o) shift; fixture_output="$1" ;; - */functions/v1/community-pulse) fixture_body='{"status":"ok","weekly_active":7,"change_pct":0,"top_skills":[],"crashes":[],"versions":[]}' ;; - esac - shift -done -[ -z "$fixture_output" ] || printf '%s' "$fixture_body" > "$fixture_output" -printf '200' -`, { mode: 0o755 }); -}); - -afterEach(() => { - fs.rmSync(tmpDir, { recursive: true, force: true }); -}); - -describe('gstack-telemetry-log', () => { - test('appends valid JSONL when tier=anonymous', () => { - setConfig('telemetry', 'anonymous'); - run(`${BIN}/gstack-telemetry-log --skill qa --duration 142 --outcome success --session-id test-123`); - - const events = parseJsonl(); - expect(events).toHaveLength(1); - expect(events[0].v).toBe(1); - expect(events[0].skill).toBe('qa'); - expect(events[0].duration_s).toBe(142); - expect(events[0].outcome).toBe('success'); - expect(events[0].session_id).toBe('test-123'); - expect(events[0].event_type).toBe('skill_run'); - expect(events[0].os).toBeTruthy(); - expect(events[0].gstack_version).toBeTruthy(); - const requests = curlRequests(); - expect(requests).toHaveLength(1); - expect(requests[0]).toContain(`${FIXTURE_SUPABASE_URL}/functions/v1/telemetry-ingest`); - expect(requests[0]).toContain('apikey: fixture-anon-key'); - expect(requests[0][requests[0].indexOf('-X') + 1]).toBe('POST'); - }); - - test('produces no output when tier=off', () => { - setConfig('telemetry', 'off'); - run(`${BIN}/gstack-telemetry-log --skill ship --duration 30 --outcome success --session-id test-456`); - - expect(readJsonl()).toHaveLength(0); - }); - - test('defaults to off for invalid tier value', () => { - setConfig('telemetry', 'invalid_value'); - run(`${BIN}/gstack-telemetry-log --skill ship --duration 30 --outcome success --session-id test-789`); - - expect(readJsonl()).toHaveLength(0); - }); - - test('includes installation_id for community tier', () => { - setConfig('telemetry', 'community'); - run(`${BIN}/gstack-telemetry-log --skill review --duration 100 --outcome success --session-id comm-123`); - - const events = parseJsonl(); - expect(events).toHaveLength(1); - // installation_id should be a UUID v4 (or hex fallback) - expect(events[0].installation_id).toMatch(/^[a-f0-9-]{32,36}$/); - }); - - test('installation_id is null for anonymous tier', () => { - setConfig('telemetry', 'anonymous'); - run(`${BIN}/gstack-telemetry-log --skill qa --duration 50 --outcome success --session-id anon-123`); - - const events = parseJsonl(); - expect(events[0].installation_id).toBeNull(); - }); - - test('includes error_class when provided', () => { - setConfig('telemetry', 'anonymous'); - run(`${BIN}/gstack-telemetry-log --skill browse --duration 10 --outcome error --error-class timeout --session-id err-123`); - - const events = parseJsonl(); - expect(events[0].error_class).toBe('timeout'); - expect(events[0].outcome).toBe('error'); - }); - - test('handles missing duration gracefully', () => { - setConfig('telemetry', 'anonymous'); - run(`${BIN}/gstack-telemetry-log --skill qa --outcome success --session-id nodur-123`); - - const events = parseJsonl(); - expect(events[0].duration_s).toBeNull(); - }); - - test('supports event_type flag', () => { - setConfig('telemetry', 'anonymous'); - run(`${BIN}/gstack-telemetry-log --event-type upgrade_prompted --skill "" --outcome success --session-id up-123`); - - const events = parseJsonl(); - expect(events[0].event_type).toBe('upgrade_prompted'); - }); - - test('includes local-only fields (_repo_slug, _branch)', () => { - setConfig('telemetry', 'anonymous'); - run(`${BIN}/gstack-telemetry-log --skill qa --duration 50 --outcome success --session-id local-123`); - - const events = parseJsonl(); - // These should be present in local JSONL - expect(events[0]).toHaveProperty('_repo_slug'); - expect(events[0]).toHaveProperty('_branch'); - }); - - // ─── json_safe() injection prevention tests ──────────────── - test('sanitizes skill name with quote injection attempt', () => { - setConfig('telemetry', 'anonymous'); - run(`${BIN}/gstack-telemetry-log --skill 'review","injected":"true' --duration 10 --outcome success --session-id inj-1`); - - const lines = readJsonl(); - expect(lines).toHaveLength(1); - // Must be valid JSON (no injection — quotes stripped, so no field injection possible) - const event = JSON.parse(lines[0]); - // The key check: no injected top-level property was created - expect(event).not.toHaveProperty('injected'); - // Skill field should have quotes stripped but content preserved - expect(event.skill).not.toContain('"'); - }); - - test('truncates skill name exceeding 200 chars', () => { - setConfig('telemetry', 'anonymous'); - const longSkill = 'a'.repeat(250); - run(`${BIN}/gstack-telemetry-log --skill '${longSkill}' --duration 10 --outcome success --session-id trunc-1`); - - const events = parseJsonl(); - expect(events[0].skill.length).toBeLessThanOrEqual(200); - }); - - test('sanitizes outcome with newline injection attempt', () => { - setConfig('telemetry', 'anonymous'); - // Use printf to pass actual newline in the argument - run(`bash -c 'OUTCOME=$(printf "success\\nfake\\":\\"true"); ${BIN}/gstack-telemetry-log --skill qa --duration 10 --outcome "$OUTCOME" --session-id inj-2'`); - - const lines = readJsonl(); - expect(lines).toHaveLength(1); - const event = JSON.parse(lines[0]); - expect(event).not.toHaveProperty('fake'); - }); - - test('sanitizes session_id with backslash-quote injection', () => { - setConfig('telemetry', 'anonymous'); - run(`${BIN}/gstack-telemetry-log --skill qa --duration 10 --outcome success --session-id 'id\\\\"","x":"y'`); - - const lines = readJsonl(); - expect(lines).toHaveLength(1); - const event = JSON.parse(lines[0]); - expect(event).not.toHaveProperty('x'); - }); - - test('sanitizes error_class with quote injection', () => { - setConfig('telemetry', 'anonymous'); - run(`${BIN}/gstack-telemetry-log --skill qa --duration 10 --outcome error --error-class 'timeout","extra":"val' --session-id inj-3`); - - const lines = readJsonl(); - expect(lines).toHaveLength(1); - const event = JSON.parse(lines[0]); - expect(event).not.toHaveProperty('extra'); - }); - - test('sanitizes failed_step with quote injection', () => { - setConfig('telemetry', 'anonymous'); - run(`${BIN}/gstack-telemetry-log --skill qa --duration 10 --outcome error --failed-step 'step1","hacked":"yes' --session-id inj-4`); - - const lines = readJsonl(); - expect(lines).toHaveLength(1); - const event = JSON.parse(lines[0]); - expect(event).not.toHaveProperty('hacked'); - }); - - test('escapes error_message quotes and preserves content', () => { - setConfig('telemetry', 'anonymous'); - run(`${BIN}/gstack-telemetry-log --skill qa --duration 10 --outcome error --error-message 'Error: file "test.txt" not found' --session-id inj-5`); - - const lines = readJsonl(); - expect(lines).toHaveLength(1); - const event = JSON.parse(lines[0]); - expect(event.error_message).toContain('file'); - expect(event.error_message).toContain('not found'); - }); - - test('redacts credential spans in error_message before they touch disk (#1947)', () => { - setConfig('telemetry', 'anonymous'); - const token = 'ghp_' + 'A1b2C3d4E5f6G7h8I9j0K1l2M3n4O5p6Q7r8'; - run( - `${BIN}/gstack-telemetry-log --skill qa --duration 10 --outcome error --error-message 'push failed: auth ${token} rejected by remote' --session-id red-1`, - ); - - const lines = readJsonl(); - expect(lines).toHaveLength(1); - const event = JSON.parse(lines[0]); - // The span is masked, the surrounding triage context survives. - expect(event.error_message).toContain(''); - expect(event.error_message).toContain('push failed'); - expect(event.error_message).not.toContain(token); - // Raw bytes on disk never contain the token either. - expect(lines[0]).not.toContain(token); - }); - - test('fails closed: error_message becomes null when the redactor is unavailable (#1947)', () => { - setConfig('telemetry', 'anonymous'); - const token = 'ghp_' + 'A1b2C3d4E5f6G7h8I9j0K1l2M3n4O5p6Q7r8'; - // Shadow bun with a failing stub on a prepended PATH (deterministic on - // any host layout — pre-landing review flagged the bare '/usr/bin:/bin' - // variant as environment-dependent): the redaction snippet cannot run, - // so the whole message must drop — never raw passthrough. - const stubBin = fs.mkdtempSync(path.join(os.tmpdir(), 'gstack-tel-nobun-')); - try { - fs.writeFileSync(path.join(stubBin, 'bun'), '#!/bin/sh\nexit 127\n'); - fs.chmodSync(path.join(stubBin, 'bun'), 0o755); - run( - `${BIN}/gstack-telemetry-log --skill qa --duration 10 --outcome error --error-message 'auth ${token} rejected' --session-id red-2`, - { PATH: `${stubBin}:${process.env.PATH}` }, - ); - } finally { - fs.rmSync(stubBin, { recursive: true, force: true }); - } - - const lines = readJsonl(); - expect(lines).toHaveLength(1); - const event = JSON.parse(lines[0]); - expect(event.error_message).toBeNull(); - expect(lines[0]).not.toContain(token); - }); - - test('fails closed: PEM key in error_message drops the whole message (#1947 review fix)', () => { - setConfig('telemetry', 'anonymous'); - // Header-only pattern: span replacement would forward the key body, so - // the engine returns null and the bin must store null. - run( - `${BIN}/gstack-telemetry-log --skill qa --duration 10 --outcome error --error-message 'deploy failed: -----BEGIN PRIVATE KEY----- MIIEvQIBADANBgkqhkiG9w0BAQEFAASC' --session-id red-5`, - ); - - const lines = readJsonl(); - expect(lines).toHaveLength(1); - const event = JSON.parse(lines[0]); - expect(event.error_message).toBeNull(); - expect(lines[0]).not.toContain('MIIEvQIBADAN'); - }); - - test('truncates error_message to 200 chars after redaction (#1947)', () => { - setConfig('telemetry', 'anonymous'); - const long = 'x'.repeat(300); - run( - `${BIN}/gstack-telemetry-log --skill qa --duration 10 --outcome error --error-message '${long}' --session-id red-3`, - ); - - const events = parseJsonl(); - expect(events).toHaveLength(1); - expect(events[0].error_message.length).toBeLessThanOrEqual(200); - }); - - test('redacts an anchored error_message value at its original offset (#1947, #2930)', () => { - setConfig('telemetry', 'anonymous'); - const secret = '8Fk2pQ9vXz4wL7mN3rT6yB1cD5eG0hJq'; - run( - `${BIN}/gstack-telemetry-log --skill qa --duration 10 --outcome error --error-message 'API_KEY=${secret} rejected by daemon' --session-id red-4`, - ); - - const lines = readJsonl(); - expect(lines).toHaveLength(1); - const event = JSON.parse(lines[0]); - expect(event.error_message).toBe('API_KEY= rejected by daemon'); - expect(lines[0]).not.toContain(secret); - }); - - test('creates analytics directory if missing', () => { - // Remove analytics dir - const analyticsDir = path.join(tmpDir, 'analytics'); - if (fs.existsSync(analyticsDir)) fs.rmSync(analyticsDir, { recursive: true }); - - setConfig('telemetry', 'anonymous'); - run(`${BIN}/gstack-telemetry-log --skill qa --duration 50 --outcome success --session-id mkdir-123`); - - expect(fs.existsSync(analyticsDir)).toBe(true); - expect(readJsonl()).toHaveLength(1); - }); - - // ─── Telemetry JSON safety: branch/repo with special chars ──── - test('branch name with quotes does not corrupt JSON', () => { - setConfig('telemetry', 'anonymous'); - // Simulate a branch name with double quotes by setting it via git env override - // The json_safe function strips quotes, so the JSONL should remain valid - run(`${BIN}/gstack-telemetry-log --skill qa --duration 10 --outcome success --session-id branch-quotes-1`); - - const lines = readJsonl(); - expect(lines).toHaveLength(1); - // Every line must be valid JSON - const event = JSON.parse(lines[0]); - expect(event._branch).toBeDefined(); - // _branch should not contain double quotes (json_safe strips them) - expect(event._branch).not.toContain('"'); - }); - - test('repo slug with special chars does not corrupt JSON', () => { - setConfig('telemetry', 'anonymous'); - run(`${BIN}/gstack-telemetry-log --skill qa --duration 10 --outcome success --session-id repo-special-1`); - - const lines = readJsonl(); - expect(lines).toHaveLength(1); - const event = JSON.parse(lines[0]); - expect(event._repo_slug).toBeDefined(); - // _repo_slug should not contain double quotes (json_safe strips them) - expect(event._repo_slug).not.toContain('"'); - }); -}); - -describe('.pending marker', () => { - test('--no-sweep (one-shot setup events) leaves other sessions\' in-flight markers untouched', () => { - setConfig('telemetry', 'anonymous'); - const analyticsDir = path.join(tmpDir, 'analytics'); - fs.mkdirSync(analyticsDir, { recursive: true }); - const marker = path.join(analyticsDir, '.pending-live-456'); - fs.writeFileSync(marker, '{"skill":"ship","ts":"2026-09-04T00:00:00Z","session_id":"live-456","gstack_version":"1.79.0.0"}'); - run(`${BIN}/gstack-telemetry-log --event-type onboarding --skill _setup_playwright --outcome chromium-install --no-sweep`); - expect(fs.existsSync(marker)).toBe(true); - const events = parseJsonl(); - expect(events).toHaveLength(1); - expect(events[0].event_type).toBe('onboarding'); - expect(events[0].outcome).toBe('chromium-install'); - }); - - test('finalizes stale .pending from another session as outcome:unknown', () => { - setConfig('telemetry', 'anonymous'); - - // Write a fake .pending marker from a different session - const analyticsDir = path.join(tmpDir, 'analytics'); - fs.mkdirSync(analyticsDir, { recursive: true }); - fs.writeFileSync( - path.join(analyticsDir, '.pending-old-123'), - '{"skill":"old-skill","ts":"2026-03-18T00:00:00Z","session_id":"old-123","gstack_version":"0.6.4"}' - ); - - // Run telemetry-log with a DIFFERENT session — should finalize the old pending marker - run(`${BIN}/gstack-telemetry-log --skill qa --duration 50 --outcome success --session-id new-456`); - - const events = parseJsonl(); - expect(events).toHaveLength(2); - - // First event: finalized pending - expect(events[0].skill).toBe('old-skill'); - expect(events[0].outcome).toBe('unknown'); - expect(events[0].session_id).toBe('old-123'); - - // Second event: new event - expect(events[1].skill).toBe('qa'); - expect(events[1].outcome).toBe('success'); - }); - - test('.pending-SESSION file is removed after finalization', () => { - setConfig('telemetry', 'anonymous'); - - const analyticsDir = path.join(tmpDir, 'analytics'); - fs.mkdirSync(analyticsDir, { recursive: true }); - const pendingPath = path.join(analyticsDir, '.pending-stale-session'); - fs.writeFileSync(pendingPath, '{"skill":"stale","ts":"2026-03-18T00:00:00Z","session_id":"stale-session","gstack_version":"v"}'); - - run(`${BIN}/gstack-telemetry-log --skill qa --duration 50 --outcome success --session-id new-456`); - - expect(fs.existsSync(pendingPath)).toBe(false); - }); - - test('does not finalize own session pending marker', () => { - setConfig('telemetry', 'anonymous'); - - const analyticsDir = path.join(tmpDir, 'analytics'); - fs.mkdirSync(analyticsDir, { recursive: true }); - // Create pending for same session ID we'll use - const pendingPath = path.join(analyticsDir, '.pending-same-session'); - fs.writeFileSync(pendingPath, '{"skill":"in-flight","ts":"2026-03-18T00:00:00Z","session_id":"same-session","gstack_version":"v"}'); - - run(`${BIN}/gstack-telemetry-log --skill qa --duration 50 --outcome success --session-id same-session`); - - // Should only have 1 event (the new one), not finalize own pending - const events = parseJsonl(); - expect(events).toHaveLength(1); - expect(events[0].skill).toBe('qa'); - }); - - test('tier=off still clears own session pending', () => { - setConfig('telemetry', 'off'); - - const analyticsDir = path.join(tmpDir, 'analytics'); - fs.mkdirSync(analyticsDir, { recursive: true }); - const pendingPath = path.join(analyticsDir, '.pending-off-123'); - fs.writeFileSync(pendingPath, '{"skill":"stale","ts":"2026-03-18T00:00:00Z","session_id":"off-123","gstack_version":"v"}'); - - run(`${BIN}/gstack-telemetry-log --skill qa --duration 50 --outcome success --session-id off-123`); - - expect(fs.existsSync(pendingPath)).toBe(false); - // But no JSONL entries since tier=off - expect(readJsonl()).toHaveLength(0); - }); -}); - -describe('gstack-analytics', () => { - test('shows "no data" for empty JSONL', () => { - const output = run(`${BIN}/gstack-analytics`); - expect(output).toContain('no data'); - }); - - test('renders usage dashboard with events', () => { - setConfig('telemetry', 'anonymous'); - run(`${BIN}/gstack-telemetry-log --skill qa --duration 120 --outcome success --session-id a-1`); - run(`${BIN}/gstack-telemetry-log --skill qa --duration 60 --outcome success --session-id a-2`); - run(`${BIN}/gstack-telemetry-log --skill ship --duration 30 --outcome error --error-class timeout --session-id a-3`); - - const output = run(`${BIN}/gstack-analytics all`); - expect(output).toContain('/qa'); - expect(output).toContain('/ship'); - expect(output).toContain('2 runs'); - expect(output).toContain('1 runs'); - expect(output).toContain('Success rate: 66%'); - expect(output).toContain('Errors: 1'); - }); - - test('filters by time window', () => { - setConfig('telemetry', 'anonymous'); - run(`${BIN}/gstack-telemetry-log --skill qa --duration 60 --outcome success --session-id t-1`); - - const output7d = run(`${BIN}/gstack-analytics 7d`); - expect(output7d).toContain('/qa'); - expect(output7d).toContain('last 7 days'); - }); -}); - -describe('gstack-telemetry-sync', () => { - test('exits silently with no Supabase URL configured', () => { - const result = run(`${BIN}/gstack-telemetry-sync`, { - GSTACK_DIR: unconfiguredRoot(), GSTACK_SUPABASE_URL: '', GSTACK_SUPABASE_ANON_KEY: '', - }); - expect(result).toBe(''); - expect(curlRequests()).toEqual([]); - }); - - test('exits silently with no JSONL file', () => { - const result = run(`${BIN}/gstack-telemetry-sync`, { GSTACK_SUPABASE_URL: 'http://localhost:9999' }); - expect(result).toBe(''); - }); - - test('does not rename JSONL field names (edge function expects raw names)', () => { - setConfig('telemetry', 'anonymous'); - run(`${BIN}/gstack-telemetry-log --skill qa --duration 60 --outcome success --session-id raw-fields-1`); - - const events = parseJsonl(); - expect(events).toHaveLength(1); - // Edge function expects these raw field names, NOT Postgres column names - expect(events[0]).toHaveProperty('v'); - expect(events[0]).toHaveProperty('ts'); - expect(events[0]).toHaveProperty('sessions'); - // Should NOT have Postgres column names - expect(events[0]).not.toHaveProperty('schema_version'); - expect(events[0]).not.toHaveProperty('event_timestamp'); - expect(events[0]).not.toHaveProperty('concurrent_sessions'); - }); -}); - -describe('gstack-community-dashboard', () => { - test('shows unconfigured message when no Supabase config available', () => { - // Use a fake GSTACK_DIR with no supabase/config.sh - const output = run(`${BIN}/gstack-community-dashboard`, { - GSTACK_DIR: unconfiguredRoot(), - GSTACK_SUPABASE_URL: '', - GSTACK_SUPABASE_ANON_KEY: '', - }); - expect(output).toContain('Supabase not configured'); - expect(output).toContain('gstack-analytics'); - }); - - test('requests configured community stats through the isolated transport', () => { - const output = run(`${BIN}/gstack-community-dashboard`); - expect(output).toContain('gstack community dashboard'); - expect(output).not.toContain('Supabase not configured'); - expect(output).toContain('Weekly active installs: 7'); - const requests = curlRequests(); - expect(requests).toHaveLength(1); - expect(requests[0]).toContain(`${FIXTURE_SUPABASE_URL}/functions/v1/community-pulse`); - expect(requests[0]).toContain('apikey: fixture-anon-key'); - }); -}); - -describe('preamble telemetry gating (#467)', () => { - test('preamble source does not write JSONL unconditionally', () => { - const preamble = fs.readFileSync(path.join(ROOT, 'scripts', 'resolvers', 'preamble.ts'), 'utf-8'); - const lines = preamble.split('\n'); - for (let i = 0; i < lines.length; i++) { - if (lines[i].includes('skill-usage.jsonl') && lines[i].includes('>>')) { - // Each JSONL write must be inside a _TEL conditional (within 5 lines above) - let foundConditional = false; - for (let j = i - 1; j >= Math.max(0, i - 5); j--) { - if (lines[j].includes('_TEL') && lines[j].includes('off')) { - foundConditional = true; - break; - } - } - if (!foundConditional) { - throw new Error(`Unconditional JSONL write at preamble.ts line ${i + 1}: ${lines[i].trim()}`); - } - } - } - }); -}); diff --git a/ubicloud/SKILL.md b/ubicloud/SKILL.md index 53cf66f8682..d90d9736458 100644 --- a/ubicloud/SKILL.md +++ b/ubicloud/SKILL.md @@ -74,15 +74,15 @@ Write (free-form only after confirmation; its words go in that file too, with `- Exit code 2 = rejected as not user-originated; do not retry. On success: "Set `` → ``. Active immediately." -## Telemetry (run last) +## Skill end (run last) -After workflow completion, log telemetry with ONE command. OUTCOME is +After workflow completion, run ONE command. OUTCOME is success/error/abort/unknown; `SESSION_ID` and `TEL_START` are the values the -preamble's skill-start output echoed. It also drains the artifacts-sync queue -(the former skill-end sync step — do not run gstack-brain-sync separately). +preamble's skill-start output echoed. It releases the session lease and drains +the artifacts-sync queue (do not run gstack-brain-sync separately). It records +no telemetry. -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** This only writes local session state. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "ubicloud" --outcome OUTCOME \ @@ -93,7 +93,7 @@ preamble's skill-start output echoed. It also drains the artifacts-sync queue Replace `OUTCOME` and `USED_BROWSE` (yes/no) before running; substitute `SESSION_ID`/`TEL_START` from the skill-start echoes. `ERROR_MESSAGE`/`FAILED_STEP` are "" unless outcome is error. If the command is missing (stale install), skip -telemetry — it never blocks the workflow. +it — it never blocks the workflow. --- diff --git a/verify/SKILL.md b/verify/SKILL.md index 2c13cc1ab52..b51322fe629 100644 --- a/verify/SKILL.md +++ b/verify/SKILL.md @@ -124,15 +124,15 @@ empty result, not a skipped step. Do not log obvious facts or one-time transient errors. -## Telemetry (run last) +## Skill end (run last) -After workflow completion, log telemetry with ONE command. OUTCOME is +After workflow completion, run ONE command. OUTCOME is success/error/abort/unknown; `SESSION_ID` and `TEL_START` are the values the -preamble's skill-start output echoed. It also drains the artifacts-sync queue -(the former skill-end sync step — do not run gstack-brain-sync separately). +preamble's skill-start output echoed. It releases the session lease and drains +the artifacts-sync queue (do not run gstack-brain-sync separately). It records +no telemetry. -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** This only writes local session state. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "verify" --outcome OUTCOME \ @@ -143,7 +143,7 @@ preamble's skill-start output echoed. It also drains the artifacts-sync queue Replace `OUTCOME` and `USED_BROWSE` (yes/no) before running; substitute `SESSION_ID`/`TEL_START` from the skill-start echoes. `ERROR_MESSAGE`/`FAILED_STEP` are "" unless outcome is error. If the command is missing (stale install), skip -telemetry — it never blocks the workflow. +it — it never blocks the workflow. ## Plan Status Footer diff --git a/write-skill/SKILL.md b/write-skill/SKILL.md index 78688ecf507..a66800d3897 100644 --- a/write-skill/SKILL.md +++ b/write-skill/SKILL.md @@ -77,15 +77,15 @@ Write (free-form only after confirmation; its words go in that file too, with `- Exit code 2 = rejected as not user-originated; do not retry. On success: "Set `` → ``. Active immediately." -## Telemetry (run last) +## Skill end (run last) -After workflow completion, log telemetry with ONE command. OUTCOME is +After workflow completion, run ONE command. OUTCOME is success/error/abort/unknown; `SESSION_ID` and `TEL_START` are the values the -preamble's skill-start output echoed. It also drains the artifacts-sync queue -(the former skill-end sync step — do not run gstack-brain-sync separately). +preamble's skill-start output echoed. It releases the session lease and drains +the artifacts-sync queue (do not run gstack-brain-sync separately). It records +no telemetry. -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** This only writes local session state. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "write-skill" --outcome OUTCOME \ @@ -96,7 +96,7 @@ preamble's skill-start output echoed. It also drains the artifacts-sync queue Replace `OUTCOME` and `USED_BROWSE` (yes/no) before running; substitute `SESSION_ID`/`TEL_START` from the skill-start echoes. `ERROR_MESSAGE`/`FAILED_STEP` are "" unless outcome is error. If the command is missing (stale install), skip -telemetry — it never blocks the workflow. +it — it never blocks the workflow. # /write-skill: write and improve skills, lean