diff --git a/SKILL.md b/SKILL.md index 873d038e1..faf14f924 100644 --- a/SKILL.md +++ b/SKILL.md @@ -133,24 +133,24 @@ Do not log obvious facts or one-time transient errors. ## Telemetry (run last) -After workflow completion, log telemetry with 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). +When done, make ONE call — it also drains the artifacts-sync +queue (don't also run gstack-brain-sync). -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** writes telemetry to `$GSTACK_STATE_ROOT/analytics/`. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "gstack" --outcome OUTCOME \ --session-id "SESSION_ID" --tel-start "TEL_START" --used-browse USED_BROWSE \ - --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" 2>/dev/null || true + --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" \ + --exit-reason EXIT_REASON --invoked INVOKED --model-family MODEL_FAMILY --checks CHECKS 2>/dev/null || true ``` -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. +OUTCOME: success/error/abort/unknown. USED_BROWSE: yes/no. SESSION_ID, TEL_START: +skill-start echoes. ERROR_MESSAGE, FAILED_STEP: "" unless error. EXIT_REASON: +completed/user_stopped/blocked/tool_error/test_failed/context_limit/gave_up. +INVOKED: user/model/chained. MODEL_FAMILY (yours): claude_opus/claude_sonnet/ +claude_haiku/claude_other/gpt/gemini/other. CHECKS: passed/failed/not_run. No command +(stale install) — skip. ## Plan Status Footer diff --git a/autoplan/SKILL.md b/autoplan/SKILL.md index c39697ae5..b20173b01 100644 --- a/autoplan/SKILL.md +++ b/autoplan/SKILL.md @@ -128,24 +128,24 @@ jq -nc --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg skill "SKILL_NAME" --arg ## Telemetry (run last) -After workflow completion, log telemetry with 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). +When done, make ONE call — it also drains the artifacts-sync +queue (don't also run gstack-brain-sync). -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** writes telemetry to `$GSTACK_STATE_ROOT/analytics/`. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "autoplan" --outcome OUTCOME \ --session-id "SESSION_ID" --tel-start "TEL_START" --used-browse USED_BROWSE \ - --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" 2>/dev/null || true + --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" \ + --exit-reason EXIT_REASON --invoked INVOKED --model-family MODEL_FAMILY --checks CHECKS 2>/dev/null || true ``` -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. +OUTCOME: success/error/abort/unknown. USED_BROWSE: yes/no. SESSION_ID, TEL_START: +skill-start echoes. ERROR_MESSAGE, FAILED_STEP: "" unless error. EXIT_REASON: +completed/user_stopped/blocked/tool_error/test_failed/context_limit/gave_up. +INVOKED: user/model/chained. MODEL_FAMILY (yours): claude_opus/claude_sonnet/ +claude_haiku/claude_other/gpt/gemini/other. CHECKS: passed/failed/not_run. No command +(stale install) — skip. ## Step 0: Detect platform and base branch diff --git a/benchmark-models/SKILL.md b/benchmark-models/SKILL.md index e76e0bb91..89700ac12 100644 --- a/benchmark-models/SKILL.md +++ b/benchmark-models/SKILL.md @@ -133,24 +133,24 @@ Do not log obvious facts or one-time transient errors. ## Telemetry (run last) -After workflow completion, log telemetry with 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). +When done, make ONE call — it also drains the artifacts-sync +queue (don't also run gstack-brain-sync). -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** writes telemetry to `$GSTACK_STATE_ROOT/analytics/`. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "benchmark-models" --outcome OUTCOME \ --session-id "SESSION_ID" --tel-start "TEL_START" --used-browse USED_BROWSE \ - --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" 2>/dev/null || true + --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" \ + --exit-reason EXIT_REASON --invoked INVOKED --model-family MODEL_FAMILY --checks CHECKS 2>/dev/null || true ``` -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. +OUTCOME: success/error/abort/unknown. USED_BROWSE: yes/no. SESSION_ID, TEL_START: +skill-start echoes. ERROR_MESSAGE, FAILED_STEP: "" unless error. EXIT_REASON: +completed/user_stopped/blocked/tool_error/test_failed/context_limit/gave_up. +INVOKED: user/model/chained. MODEL_FAMILY (yours): claude_opus/claude_sonnet/ +claude_haiku/claude_other/gpt/gemini/other. CHECKS: passed/failed/not_run. No command +(stale install) — skip. ## Plan Status Footer diff --git a/benchmark/SKILL.md b/benchmark/SKILL.md index 63eb8f9ac..2bca6d8cf 100644 --- a/benchmark/SKILL.md +++ b/benchmark/SKILL.md @@ -134,24 +134,24 @@ Do not log obvious facts or one-time transient errors. ## Telemetry (run last) -After workflow completion, log telemetry with 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). +When done, make ONE call — it also drains the artifacts-sync +queue (don't also run gstack-brain-sync). -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** writes telemetry to `$GSTACK_STATE_ROOT/analytics/`. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "benchmark" --outcome OUTCOME \ --session-id "SESSION_ID" --tel-start "TEL_START" --used-browse USED_BROWSE \ - --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" 2>/dev/null || true + --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" \ + --exit-reason EXIT_REASON --invoked INVOKED --model-family MODEL_FAMILY --checks CHECKS 2>/dev/null || true ``` -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. +OUTCOME: success/error/abort/unknown. USED_BROWSE: yes/no. SESSION_ID, TEL_START: +skill-start echoes. ERROR_MESSAGE, FAILED_STEP: "" unless error. EXIT_REASON: +completed/user_stopped/blocked/tool_error/test_failed/context_limit/gave_up. +INVOKED: user/model/chained. MODEL_FAMILY (yours): claude_opus/claude_sonnet/ +claude_haiku/claude_other/gpt/gemini/other. CHECKS: passed/failed/not_run. No command +(stale install) — skip. ## Plan Status Footer diff --git a/bin/gstack-skill-end b/bin/gstack-skill-end index 441495814..2e38cb461 100755 --- a/bin/gstack-skill-end +++ b/bin/gstack-skill-end @@ -6,7 +6,8 @@ # The generated prose calls this once at workflow completion: # gstack-skill-end --skill NAME --outcome success|error|abort|unknown \ # --session-id ID --tel-start EPOCH [--used-browse yes|no] \ -# [--error-message MSG] [--failed-step STEP] +# [--error-message MSG] [--failed-step STEP] [--exit-reason R] \ +# [--invoked user|model|chained] [--model-family F] [--checks C] # # SESSION_ID and TEL_START come from gstack-skill-start's echoed STATUS lines # (inline shell vars never survived across Bash tool calls, so durations were @@ -15,6 +16,7 @@ SKILL_NAME="unknown"; OUTCOME="unknown"; SESSION_ID=""; TEL_START="" USED_BROWSE="no"; ERROR_MESSAGE=""; FAILED_STEP="" +EXIT_REASON=""; INVOKED=""; MODEL_FAMILY=""; CHECKS="" while [ $# -gt 0 ]; do case "$1" in --skill) SKILL_NAME="$2"; shift 2 ;; @@ -24,8 +26,12 @@ while [ $# -gt 0 ]; do --used-browse) USED_BROWSE="$2"; shift 2 ;; --error-message) ERROR_MESSAGE="$2"; shift 2 ;; --failed-step) FAILED_STEP="$2"; shift 2 ;; + --exit-reason) EXIT_REASON="$2"; shift 2 ;; + --invoked) INVOKED="$2"; shift 2 ;; + --model-family) MODEL_FAMILY="$2"; shift 2 ;; + --checks) CHECKS="$2"; shift 2 ;; -h|--help) - echo 'Usage: gstack-skill-end --skill NAME --outcome success|error|abort|unknown --session-id ID --tel-start EPOCH [--used-browse yes|no] [--error-message MSG] [--failed-step STEP]' + echo 'Usage: gstack-skill-end --skill NAME --outcome success|error|abort|unknown --session-id ID --tel-start EPOCH [--used-browse yes|no] [--error-message MSG] [--failed-step STEP] [--exit-reason R] [--invoked user|model|chained] [--model-family F] [--checks passed|failed|not_run|none]' echo 'Records skill completion. --help records nothing.' exit 0 ;; *) shift ;; @@ -54,8 +60,9 @@ if [ "$_SESSION_KIND" = "unattended" ]; then fi _TEL_END=$(date +%s) -case "$TEL_START" in ''|*[!0-9]*) TEL_START="$_TEL_END" ;; esac -_TEL_DUR=$(( _TEL_END - TEL_START )) +# An unknown start time is an unknown duration (empty, sent as null), not 0. +_TEL_DUR="" +case "$TEL_START" in ''|*[!0-9]*) ;; *) _TEL_DUR=$(( _TEL_END - TEL_START )) ;; esac [ -n "$SESSION_ID" ] && rm -f "$_GH/analytics/.pending-$SESSION_ID" 2>/dev/null || true # Release the workflow lease run gstack-skill-start opened (SESSION_ID starts # with its harness pid), so a finished run stops blocking gstack-upgrade (GST-1205). @@ -79,9 +86,40 @@ fi # Remote telemetry (opt-in, requires binary). if [ "$_TEL" != "off" ] && [ -x "$_BIN/gstack-telemetry-log" ]; then + # Which agent ran this: GSTACK_ACTIVE_HOST names an env-var host; otherwise + # Claude Code sets CLAUDECODE and Codex sets CODEX_THREAD_ID. + case "${GSTACK_ACTIVE_HOST:-}" in + claude) _HOST=claude_code ;; + codex|cursor|openclaw|hermes) _HOST="$GSTACK_ACTIVE_HOST" ;; + ?*) _HOST=other ;; + *) if [ -n "${CLAUDECODE:-}" ]; then _HOST=claude_code + elif [ -n "${CODEX_THREAD_ID:-}" ]; then _HOST=codex + else _HOST=unknown; fi ;; + esac + # Routing setup, read locally; only the enum leaves the machine. + _RB=no; for _RF in CLAUDE.md AGENTS.md; do grep -q "## Skill routing" "$_RF" 2>/dev/null && _RB=yes; done + _HK=no; grep -q "gstack-" "${CLAUDE_CONFIG_DIR:-$HOME/.claude}/settings.json" 2>/dev/null && _HK=yes + case "$_RB$_HK" in yesyes) _ROUTING=both ;; yesno) _ROUTING=block ;; noyes) _ROUTING=hooks ;; *) _ROUTING=none ;; esac + # harness_session_id: 16 random hex kept as the contents of this harness + # process's sessions/ marker (skill-start's touch keeps the contents, + # its 120-minute idle reaper ends the id). Never the device id. + _HSESS=""; _HPID="${SESSION_ID%%-*}" + # A shared harness (capy-server) runs every session under one pid: no id there. + . "$_BIN/gstack-harness-pid.sh" 2>/dev/null && gstack_shared_harness "$_HPID" && _HPID="" + case "$_HPID" in ''|*[!0-9]*) ;; *) + if [ -f "$_GH/sessions/$_HPID" ]; then + _HSESS=$(head -c 16 "$_GH/sessions/$_HPID" 2>/dev/null | tr -cd '0-9a-f') + if [ ${#_HSESS} -ne 16 ]; then + _HSESS=$(od -An -tx1 -N8 /dev/urandom 2>/dev/null | tr -d ' \n') + if [ ${#_HSESS} -eq 16 ]; then printf '%s' "$_HSESS" > "$_GH/sessions/$_HPID" 2>/dev/null || _HSESS=""; else _HSESS=""; fi + fi + fi ;; + esac "$_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 & + --error-message "$ERROR_MESSAGE" --failed-step "$FAILED_STEP" \ + --host "$_HOST" --routing "$_ROUTING" --harness-session "$_HSESS" \ + --exit-reason "$EXIT_REASON" --invoked "$INVOKED" --model-family "$MODEL_FAMILY" --checks "$CHECKS" 2>/dev/null & fi -echo "SKILL_END: recorded outcome=$OUTCOME duration_s=$_TEL_DUR" +echo "SKILL_END: recorded outcome=$OUTCOME duration_s=${_TEL_DUR:-unknown}" diff --git a/bin/gstack-skill-start b/bin/gstack-skill-start index c371df7b3..90eea8407 100755 --- a/bin/gstack-skill-start +++ b/bin/gstack-skill-start @@ -125,8 +125,8 @@ fi # Session markers: local functional state (live-session count), never sent and # not gated on telemetry (#1150). README "Privacy & Telemetry" describes them. mkdir -p "$_GH/sessions" 2>/dev/null || true -touch "$_GH/sessions/$PARENT_PID" 2>/dev/null || true find "$_GH/sessions" -mmin +120 -type f -exec rm {} + 2>/dev/null || true +touch "$_GH/sessions/$PARENT_PID" 2>/dev/null || true _SESSIONS=$(find "$_GH/sessions" -mmin -120 -type f 2>/dev/null | wc -l | tr -d ' ') _PROACTIVE=$("$_BIN/gstack-config" get proactive 2>/dev/null || echo "core") @@ -608,7 +608,7 @@ 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". +> Help gstack get better. Yes sends, per skill run: skill name, outcome and why it ended, duration, which coding agent and model family ran it, gstack version, OS, a redacted error summary, a random id per agent session 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) @@ -616,7 +616,7 @@ Options: If A: run \`$_BIN/gstack-config set telemetry community\`. If B, ask the follow-up: -> Anonymous mode sends only aggregate usage, no unique ID. +> Anonymous mode sends the same usage with no device ID; a random id per agent session that is never reused. 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\`. diff --git a/bin/gstack-telemetry-log b/bin/gstack-telemetry-log index a662e350f..53a3af394 100755 --- a/bin/gstack-telemetry-log +++ b/bin/gstack-telemetry-log @@ -57,6 +57,9 @@ SEC_CONFIDENCE="" SEC_LAYER="" SEC_VERDICT="" NO_SWEEP="" +# Next-telemetry fields (docs/privacy.md): fixed lists, a random session id, versions. +HOST=""; MODEL_FAMILY=""; INVOKED=""; EXIT_REASON=""; CHECKS=""; ROUTING="" +HARNESS_SESSION=""; FROM_VERSION=""; UPGRADE_ERROR="" while [ $# -gt 0 ]; do case "$1" in @@ -77,12 +80,28 @@ while [ $# -gt 0 ]; do --confidence) SEC_CONFIDENCE="$2"; shift 2 ;; --layer) SEC_LAYER="$2"; shift 2 ;; --verdict) SEC_VERDICT="$2"; shift 2 ;; + --host) HOST="$2"; shift 2 ;; + --model-family) MODEL_FAMILY="$2"; shift 2 ;; + --invoked) INVOKED="$2"; shift 2 ;; + --exit-reason) EXIT_REASON="$2"; shift 2 ;; + --checks) CHECKS="$2"; shift 2 ;; + --routing) ROUTING="$2"; shift 2 ;; + --harness-session) HARNESS_SESSION="$2"; shift 2 ;; + --from-version) FROM_VERSION="$2"; shift 2 ;; + --upgrade-error) UPGRADE_ERROR="$2"; shift 2 ;; *) shift ;; esac done -# Source: flag > env > default 'live' -SOURCE="${SOURCE:-${GSTACK_TELEMETRY_SOURCE:-live}}" +# Source: flag > GSTACK_TELEMETRY_SOURCE > an eval run (the eval harness sets +# EVALS_RUN_ID or GSTACK_EVAL_DIR) > CI > live. An explicit value always wins, +# so CI=true never relabels a row a test marked source=test. +if [ -z "$SOURCE" ]; then + if [ -n "${GSTACK_TELEMETRY_SOURCE:-}" ]; then SOURCE="$GSTACK_TELEMETRY_SOURCE" + elif [ -n "${EVALS_RUN_ID:-}" ] || [ -n "${GSTACK_EVAL_DIR:-}" ]; then SOURCE="eval" + elif [ "${CI:-}" = "true" ]; then SOURCE="ci" + else SOURCE="live"; fi +fi # ─── Read telemetry tier ───────────────────────────────────── TIER="$("$CONFIG_CMD" get telemetry 2>/dev/null || true)" @@ -272,12 +291,34 @@ SEC_LAYER_FIELD="null" SEC_VERDICT_FIELD="null" [ -n "$SEC_VERDICT" ] && SEC_VERDICT_FIELD="\"$SEC_VERDICT\"" -printf '{"v":1,"ts":"%s","event_type":"%s","skill":"%s","session_id":"%s","gstack_version":"%s","os":"%s","arch":"%s","duration_s":%s,"outcome":"%s","error_class":%s,"error_message":%s,"failed_step":%s,"used_browse":%s,"sessions":%s,"installation_id":%s,"source":"%s","security_url_domain":%s,"security_payload_hash":%s,"security_confidence":%s,"security_layer":%s,"security_verdict":%s,"_repo_slug":"%s","_branch":"%s"}\n' \ +# Next-telemetry fields: an empty value is null; a value off its fixed list is +# "unknown", so nothing free-form ever leaves the machine. +enum_field() { # + local v="$1"; shift + [ -z "$v" ] && { printf 'null'; return; } + local a; for a in "$@"; do [ "$v" = "$a" ] && { printf '"%s"' "$v"; return; }; done + printf '"unknown"' +} +HOST_FIELD="$(enum_field "$HOST" claude_code codex cursor openclaw hermes other)" +MODEL_FIELD="$(enum_field "$MODEL_FAMILY" claude_opus claude_sonnet claude_haiku claude_other gpt gemini other)" +INVOKED_FIELD="$(enum_field "$INVOKED" user model chained)" +EXIT_FIELD="$(enum_field "$EXIT_REASON" completed user_stopped blocked tool_error test_failed context_limit gave_up)" +CHECKS_FIELD="$(enum_field "$CHECKS" passed failed not_run)" +ROUTING_FIELD="$(enum_field "$ROUTING" none block hooks both)" +UPGRADE_ERR_FIELD="$(enum_field "$UPGRADE_ERROR" none refused_dirty busy fetch_failed setup_failed other)" +HSESS_FIELD="null" +case "$HARNESS_SESSION" in *[!0-9a-f]*|'') ;; *) [ ${#HARNESS_SESSION} -eq 16 ] && HSESS_FIELD="\"$HARNESS_SESSION\"" ;; esac +FROM_FIELD="null" +if printf '%s' "$FROM_VERSION" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?$'; then FROM_FIELD="\"$FROM_VERSION\""; fi + +printf '{"v":1,"ts":"%s","event_type":"%s","skill":"%s","session_id":"%s","gstack_version":"%s","os":"%s","arch":"%s","duration_s":%s,"outcome":"%s","error_class":%s,"error_message":%s,"failed_step":%s,"used_browse":%s,"sessions":%s,"installation_id":%s,"source":"%s","security_url_domain":%s,"security_payload_hash":%s,"security_confidence":%s,"security_layer":%s,"security_verdict":%s,"host":%s,"model_family":%s,"invoked":%s,"exit_reason":%s,"checks":%s,"routing":%s,"harness_session_id":%s,"from_version":%s,"upgrade_error":%s,"_repo_slug":"%s","_branch":"%s"}\n' \ "$TS" "$EVENT_TYPE" "$SKILL" "$SESSION_ID" "$GSTACK_VERSION" "$OS" "$ARCH" \ "$DUR_FIELD" "$OUTCOME" "$ERR_FIELD" "$ERR_MSG_FIELD" "$STEP_FIELD" \ "$BROWSE_BOOL" "${SESSIONS:-1}" \ "$INSTALL_FIELD" "$SOURCE" \ "$SEC_DOMAIN_FIELD" "$SEC_HASH_FIELD" "$SEC_CONF_FIELD" "$SEC_LAYER_FIELD" "$SEC_VERDICT_FIELD" \ + "$HOST_FIELD" "$MODEL_FIELD" "$INVOKED_FIELD" "$EXIT_FIELD" "$CHECKS_FIELD" "$ROUTING_FIELD" \ + "$HSESS_FIELD" "$FROM_FIELD" "$UPGRADE_ERR_FIELD" \ "$REPO_SLUG" "$BRANCH" >> "$JSONL_FILE" 2>/dev/null || true # ─── Trigger sync if tier is not off ───────────────────────── diff --git a/bin/gstack-telemetry-sync b/bin/gstack-telemetry-sync index 9ad5d62f3..92bb14b1d 100755 --- a/bin/gstack-telemetry-sync +++ b/bin/gstack-telemetry-sync @@ -106,6 +106,10 @@ while IFS= read -r LINE; do fi fi + # Ingest refuses a body over 50,000 bytes (413) and the cursor would never + # move, so each POST stays under 45,000 bytes (LC_ALL=C: ${#} counts bytes). + [ "$COUNT" -gt 0 ] && [ "$(LC_ALL=C; echo $(( ${#BATCH} + ${#CLEAN} + 2 )))" -gt 45000 ] && break + if [ "$FIRST" = "true" ]; then FIRST=false else diff --git a/bin/gstack-upgrade b/bin/gstack-upgrade index a335b0dd5..19ce317e7 100755 --- a/bin/gstack-upgrade +++ b/bin/gstack-upgrade @@ -57,8 +57,19 @@ case "${1:-}" in *) echo "gstack-upgrade: unknown argument '$1'" >&2; exit 2 ;; esac -refuse() { echo "gstack-upgrade: $1; nothing was changed; fix: $2 (UPGRADE_REFUSED)" >&2; exit 3; } -fetch_failed() { echo "gstack-upgrade: could not reach origin ($1); fix: check network access to $(git -C "$ROOT" remote get-url origin 2>/dev/null || echo origin), then re-run $ROOT/bin/gstack-upgrade (UPGRADE_FETCH_FAILED)" >&2; exit 3; } +# upg_tel [from_version] — one upgrade_completed telemetry event +# (docs/privacy.md), sent only when the user's telemetry setting allows it and +# never from --check or an unattended session. +upg_tel() { + [ "$CHECK" -eq 1 ] && return 0 + [ "$("$ROOT/bin/gstack-session-kind" 2>/dev/null)" = unattended ] && return 0 + [ -x "$ROOT/bin/gstack-telemetry-log" ] || return 0 + "$ROOT/bin/gstack-telemetry-log" --no-sweep --event-type upgrade_completed --outcome "$([ "$1" = none ] && echo success || echo error)" \ + --from-version "${2:-${INSTALLED:-}}" --upgrade-error "$1" >/dev/null 2>&1 || true +} +refuse() { case "$1" in "tracked files changed"*) upg_tel refused_dirty ;; *) upg_tel other ;; esac + echo "gstack-upgrade: $1; nothing was changed; fix: $2 (UPGRADE_REFUSED)" >&2; exit 3; } +fetch_failed() { upg_tel fetch_failed; echo "gstack-upgrade: could not reach origin ($1); fix: check network access to $(git -C "$ROOT" remote get-url origin 2>/dev/null || echo origin), then re-run $ROOT/bin/gstack-upgrade (UPGRADE_FETCH_FAILED)" >&2; exit 3; } bounded() { if command -v timeout >/dev/null 2>&1; then timeout "${GSTACK_UPGRADE_FETCH_TIMEOUT:-60}" "$@"; else "$@"; fi; } # Egress receipts (_receipted_git), fail-open like the session-start updater: # a user-run upgrade must not die over an audit-log hiccup. @@ -75,7 +86,7 @@ TOPLEVEL=$(git -C "$ROOT" rev-parse --show-toplevel 2>/dev/null) [ -f "$ROOT/VERSION" ] && [ -f "$ROOT/setup" ] && [ -n "$TOPLEVEL" ] && gstack_path_same "$TOPLEVEL" "$ROOT" \ || refuse "$ROOT is not a gstack checkout" "run gstack-upgrade from a git checkout of https://github.com/garrytan/gstack" PF=$(bash "$ROOT/bin/gstack-ff-update" --preflight "$ROOT" 2>/dev/null) -[ $? -eq 6 ] && { echo "gstack-upgrade: $PF (UPGRADE_REFUSED)" >&2; exit 3; } +[ $? -eq 6 ] && { upg_tel other; echo "gstack-upgrade: $PF (UPGRADE_REFUSED)" >&2; exit 3; } export GIT_TERMINAL_PROMPT=0 HOST=$(git -C "$ROOT" remote get-url origin 2>/dev/null); HOST="${HOST#*://}"; HOST="${HOST#*@}"; HOST="${HOST%%[/:]*}" R="user ran gstack-upgrade" @@ -162,12 +173,17 @@ reinstall() { # FROM — run the install step; a pending marker survives a failu # failure: no pending marker for it. if [ "$_rc" -ne 0 ] && [ "$(cat "$_held")" = "gstack: fail wrapper" ]; then rm -f "$PENDING" + upg_tel none "$1" echo "gstack-upgrade: reinstalled $(head -1 "$ROOT/VERSION"); only the wrapper row failed (an owner action on the Drive copy, CAPY_WRAPPER_STALE), so no reinstall is pending" fi if [ "$_rc" -eq 0 ]; then [ -n "$CALLER_PROJECT" ] || cat "$_held" - rm -f "$PENDING" "$_held" "$_ierr"; certify + rm -f "$PENDING" "$_held" "$_ierr" + ( certify ); _rc=$? + upg_tel "$([ "$_rc" -eq 0 ] && echo none || echo setup_failed)" "$1" + exit "$_rc" fi + [ -f "$PENDING" ] && upg_tel setup_failed "$1" [ -s "$_held" ] && cat "$_held" [ "$_rc" -eq 3 ] && [ ! -s "$_held" ] && stop_trailer "$_ierr" rm -f "$_held" "$_ierr" @@ -233,6 +249,7 @@ EOF_BUSY else echo "gstack-upgrade: live gstack sessions hold this installation: $HOLDERS; nothing was changed; fix: wait for those sessions to finish, or re-run with GSTACK_UPGRADE_FORCE=1 when you know they are idle (UPGRADE_BUSY)" >&2 fi + upg_tel busy exit 3 fi # shellcheck source=bin/gstack-bun-version.sh @@ -263,5 +280,5 @@ NEW=$(head -1 "$ROOT/VERSION") echo "gstack-upgrade: upgraded $INSTALLED -> $NEW" [ "$LOCK_HANDED" -eq 1 ] || { rm -rf "$LOCK_DIR"; trap - EXIT; } -[ "$REINSTALL" -eq 1 ] || exit 0 +[ "$REINSTALL" -eq 1 ] || { upg_tel none; exit 0; } reinstall "$INSTALLED" diff --git a/browse/SKILL.md b/browse/SKILL.md index 234cc7d7a..f5f38edfa 100644 --- a/browse/SKILL.md +++ b/browse/SKILL.md @@ -133,24 +133,24 @@ Do not log obvious facts or one-time transient errors. ## Telemetry (run last) -After workflow completion, log telemetry with 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). +When done, make ONE call — it also drains the artifacts-sync +queue (don't also run gstack-brain-sync). -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** writes telemetry to `$GSTACK_STATE_ROOT/analytics/`. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "browse" --outcome OUTCOME \ --session-id "SESSION_ID" --tel-start "TEL_START" --used-browse USED_BROWSE \ - --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" 2>/dev/null || true + --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" \ + --exit-reason EXIT_REASON --invoked INVOKED --model-family MODEL_FAMILY --checks CHECKS 2>/dev/null || true ``` -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. +OUTCOME: success/error/abort/unknown. USED_BROWSE: yes/no. SESSION_ID, TEL_START: +skill-start echoes. ERROR_MESSAGE, FAILED_STEP: "" unless error. EXIT_REASON: +completed/user_stopped/blocked/tool_error/test_failed/context_limit/gave_up. +INVOKED: user/model/chained. MODEL_FAMILY (yours): claude_opus/claude_sonnet/ +claude_haiku/claude_other/gpt/gemini/other. CHECKS: passed/failed/not_run. No command +(stale install) — skip. ## Plan Status Footer diff --git a/canary/SKILL.md b/canary/SKILL.md index aa94ed252..0304e4051 100644 --- a/canary/SKILL.md +++ b/canary/SKILL.md @@ -83,24 +83,24 @@ Exit code 2 = rejected as not user-originated; do not retry. On success: "Set `< ## Telemetry (run last) -After workflow completion, log telemetry with 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). +When done, make ONE call — it also drains the artifacts-sync +queue (don't also run gstack-brain-sync). -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** writes telemetry to `$GSTACK_STATE_ROOT/analytics/`. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "canary" --outcome OUTCOME \ --session-id "SESSION_ID" --tel-start "TEL_START" --used-browse USED_BROWSE \ - --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" 2>/dev/null || true + --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" \ + --exit-reason EXIT_REASON --invoked INVOKED --model-family MODEL_FAMILY --checks CHECKS 2>/dev/null || true ``` -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. +OUTCOME: success/error/abort/unknown. USED_BROWSE: yes/no. SESSION_ID, TEL_START: +skill-start echoes. ERROR_MESSAGE, FAILED_STEP: "" unless error. EXIT_REASON: +completed/user_stopped/blocked/tool_error/test_failed/context_limit/gave_up. +INVOKED: user/model/chained. MODEL_FAMILY (yours): claude_opus/claude_sonnet/ +claude_haiku/claude_other/gpt/gemini/other. CHECKS: passed/failed/not_run. No command +(stale install) — skip. ## BROWSER SETUP (Aside — run this check BEFORE any browser step) diff --git a/captain/SKILL.md b/captain/SKILL.md index b48b3d55b..7b1fe49c1 100644 --- a/captain/SKILL.md +++ b/captain/SKILL.md @@ -90,24 +90,24 @@ Exit code 2 = rejected as not user-originated; do not retry. On success: "Set `< ## Telemetry (run last) -After workflow completion, log telemetry with 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). +When done, make ONE call — it also drains the artifacts-sync +queue (don't also run gstack-brain-sync). -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** writes telemetry to `$GSTACK_STATE_ROOT/analytics/`. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "captain" --outcome OUTCOME \ --session-id "SESSION_ID" --tel-start "TEL_START" --used-browse USED_BROWSE \ - --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" 2>/dev/null || true + --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" \ + --exit-reason EXIT_REASON --invoked INVOKED --model-family MODEL_FAMILY --checks CHECKS 2>/dev/null || true ``` -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. +OUTCOME: success/error/abort/unknown. USED_BROWSE: yes/no. SESSION_ID, TEL_START: +skill-start echoes. ERROR_MESSAGE, FAILED_STEP: "" unless error. EXIT_REASON: +completed/user_stopped/blocked/tool_error/test_failed/context_limit/gave_up. +INVOKED: user/model/chained. MODEL_FAMILY (yours): claude_opus/claude_sonnet/ +claude_haiku/claude_other/gpt/gemini/other. CHECKS: passed/failed/not_run. No command +(stale install) — skip. # /captain: one controller, many lanes diff --git a/changelog.d/next-telemetry-fields.md b/changelog.d/next-telemetry-fields.md new file mode 100644 index 000000000..fcffef2e5 --- /dev/null +++ b/changelog.d/next-telemetry-fields.md @@ -0,0 +1 @@ +**Opted-in telemetry now says why a skill run ended, which coding agent and model family ran it, and whether an upgrade worked.** Each skill run adds a few labels from fixed lists (agent, model family, how it started, why it ended, whether its checks passed, routing setup) and a random id for the agent session, so failures can be traced to the skills, agents and versions that cause them. Upgrades report success or why they failed. CI and eval runs label themselves, and an unmeasured duration is sent empty instead of 0. The opt-in prompt lists the new fields, and anonymous mode now says it sends no device ID but a random per-session id. Every field is listed in docs/privacy.md; nothing new carries code, paths, prompts or repo names. diff --git a/codex/SKILL.md b/codex/SKILL.md index de1c1f7e6..db27067ce 100644 --- a/codex/SKILL.md +++ b/codex/SKILL.md @@ -114,24 +114,24 @@ jq -nc --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg skill "SKILL_NAME" --arg ## Telemetry (run last) -After workflow completion, log telemetry with 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). +When done, make ONE call — it also drains the artifacts-sync +queue (don't also run gstack-brain-sync). -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** writes telemetry to `$GSTACK_STATE_ROOT/analytics/`. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "codex" --outcome OUTCOME \ --session-id "SESSION_ID" --tel-start "TEL_START" --used-browse USED_BROWSE \ - --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" 2>/dev/null || true + --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" \ + --exit-reason EXIT_REASON --invoked INVOKED --model-family MODEL_FAMILY --checks CHECKS 2>/dev/null || true ``` -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. +OUTCOME: success/error/abort/unknown. USED_BROWSE: yes/no. SESSION_ID, TEL_START: +skill-start echoes. ERROR_MESSAGE, FAILED_STEP: "" unless error. EXIT_REASON: +completed/user_stopped/blocked/tool_error/test_failed/context_limit/gave_up. +INVOKED: user/model/chained. MODEL_FAMILY (yours): claude_opus/claude_sonnet/ +claude_haiku/claude_other/gpt/gemini/other. CHECKS: passed/failed/not_run. No command +(stale install) — skip. ## Step 0: Detect platform and base branch diff --git a/context-restore/SKILL.md b/context-restore/SKILL.md index ca8feb79a..f2ca67787 100644 --- a/context-restore/SKILL.md +++ b/context-restore/SKILL.md @@ -85,24 +85,24 @@ Exit code 2 = rejected as not user-originated; do not retry. On success: "Set `< ## Telemetry (run last) -After workflow completion, log telemetry with 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). +When done, make ONE call — it also drains the artifacts-sync +queue (don't also run gstack-brain-sync). -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** writes telemetry to `$GSTACK_STATE_ROOT/analytics/`. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "context-restore" --outcome OUTCOME \ --session-id "SESSION_ID" --tel-start "TEL_START" --used-browse USED_BROWSE \ - --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" 2>/dev/null || true + --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" \ + --exit-reason EXIT_REASON --invoked INVOKED --model-family MODEL_FAMILY --checks CHECKS 2>/dev/null || true ``` -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. +OUTCOME: success/error/abort/unknown. USED_BROWSE: yes/no. SESSION_ID, TEL_START: +skill-start echoes. ERROR_MESSAGE, FAILED_STEP: "" unless error. EXIT_REASON: +completed/user_stopped/blocked/tool_error/test_failed/context_limit/gave_up. +INVOKED: user/model/chained. MODEL_FAMILY (yours): claude_opus/claude_sonnet/ +claude_haiku/claude_other/gpt/gemini/other. CHECKS: passed/failed/not_run. No command +(stale install) — skip. # /context-restore — Restore Saved Working Context diff --git a/context-save/SKILL.md b/context-save/SKILL.md index 4a658af19..2daf1dbe9 100644 --- a/context-save/SKILL.md +++ b/context-save/SKILL.md @@ -85,24 +85,24 @@ Exit code 2 = rejected as not user-originated; do not retry. On success: "Set `< ## Telemetry (run last) -After workflow completion, log telemetry with 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). +When done, make ONE call — it also drains the artifacts-sync +queue (don't also run gstack-brain-sync). -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** writes telemetry to `$GSTACK_STATE_ROOT/analytics/`. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "context-save" --outcome OUTCOME \ --session-id "SESSION_ID" --tel-start "TEL_START" --used-browse USED_BROWSE \ - --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" 2>/dev/null || true + --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" \ + --exit-reason EXIT_REASON --invoked INVOKED --model-family MODEL_FAMILY --checks CHECKS 2>/dev/null || true ``` -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. +OUTCOME: success/error/abort/unknown. USED_BROWSE: yes/no. SESSION_ID, TEL_START: +skill-start echoes. ERROR_MESSAGE, FAILED_STEP: "" unless error. EXIT_REASON: +completed/user_stopped/blocked/tool_error/test_failed/context_limit/gave_up. +INVOKED: user/model/chained. MODEL_FAMILY (yours): claude_opus/claude_sonnet/ +claude_haiku/claude_other/gpt/gemini/other. CHECKS: passed/failed/not_run. No command +(stale install) — skip. # /context-save — Save Working Context diff --git a/design-consultation/SKILL.md b/design-consultation/SKILL.md index 8e3998ed5..fdabd1483 100644 --- a/design-consultation/SKILL.md +++ b/design-consultation/SKILL.md @@ -139,24 +139,24 @@ jq -nc --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg skill "SKILL_NAME" --arg ## Telemetry (run last) -After workflow completion, log telemetry with 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). +When done, make ONE call — it also drains the artifacts-sync +queue (don't also run gstack-brain-sync). -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** writes telemetry to `$GSTACK_STATE_ROOT/analytics/`. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "design-consultation" --outcome OUTCOME \ --session-id "SESSION_ID" --tel-start "TEL_START" --used-browse USED_BROWSE \ - --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" 2>/dev/null || true + --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" \ + --exit-reason EXIT_REASON --invoked INVOKED --model-family MODEL_FAMILY --checks CHECKS 2>/dev/null || true ``` -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. +OUTCOME: success/error/abort/unknown. USED_BROWSE: yes/no. SESSION_ID, TEL_START: +skill-start echoes. ERROR_MESSAGE, FAILED_STEP: "" unless error. EXIT_REASON: +completed/user_stopped/blocked/tool_error/test_failed/context_limit/gave_up. +INVOKED: user/model/chained. MODEL_FAMILY (yours): claude_opus/claude_sonnet/ +claude_haiku/claude_other/gpt/gemini/other. CHECKS: passed/failed/not_run. No command +(stale install) — skip. # /design-consultation: Your Design System, Built Together diff --git a/design-html/SKILL.md b/design-html/SKILL.md index 572c1f6ea..2f7be80a1 100644 --- a/design-html/SKILL.md +++ b/design-html/SKILL.md @@ -86,24 +86,24 @@ Exit code 2 = rejected as not user-originated; do not retry. On success: "Set `< ## Telemetry (run last) -After workflow completion, log telemetry with 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). +When done, make ONE call — it also drains the artifacts-sync +queue (don't also run gstack-brain-sync). -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** writes telemetry to `$GSTACK_STATE_ROOT/analytics/`. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "design-html" --outcome OUTCOME \ --session-id "SESSION_ID" --tel-start "TEL_START" --used-browse USED_BROWSE \ - --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" 2>/dev/null || true + --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" \ + --exit-reason EXIT_REASON --invoked INVOKED --model-family MODEL_FAMILY --checks CHECKS 2>/dev/null || true ``` -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. +OUTCOME: success/error/abort/unknown. USED_BROWSE: yes/no. SESSION_ID, TEL_START: +skill-start echoes. ERROR_MESSAGE, FAILED_STEP: "" unless error. EXIT_REASON: +completed/user_stopped/blocked/tool_error/test_failed/context_limit/gave_up. +INVOKED: user/model/chained. MODEL_FAMILY (yours): claude_opus/claude_sonnet/ +claude_haiku/claude_other/gpt/gemini/other. CHECKS: passed/failed/not_run. No command +(stale install) — skip. # /design-html: Pretext-Native HTML Engine diff --git a/design-motion/SKILL.md b/design-motion/SKILL.md index b7471d85e..42162b870 100644 --- a/design-motion/SKILL.md +++ b/design-motion/SKILL.md @@ -85,24 +85,24 @@ Exit code 2 = rejected as not user-originated; do not retry. On success: "Set `< ## Telemetry (run last) -After workflow completion, log telemetry with 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). +When done, make ONE call — it also drains the artifacts-sync +queue (don't also run gstack-brain-sync). -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** writes telemetry to `$GSTACK_STATE_ROOT/analytics/`. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "design-motion" --outcome OUTCOME \ --session-id "SESSION_ID" --tel-start "TEL_START" --used-browse USED_BROWSE \ - --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" 2>/dev/null || true + --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" \ + --exit-reason EXIT_REASON --invoked INVOKED --model-family MODEL_FAMILY --checks CHECKS 2>/dev/null || true ``` -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. +OUTCOME: success/error/abort/unknown. USED_BROWSE: yes/no. SESSION_ID, TEL_START: +skill-start echoes. ERROR_MESSAGE, FAILED_STEP: "" unless error. EXIT_REASON: +completed/user_stopped/blocked/tool_error/test_failed/context_limit/gave_up. +INVOKED: user/model/chained. MODEL_FAMILY (yours): claude_opus/claude_sonnet/ +claude_haiku/claude_other/gpt/gemini/other. CHECKS: passed/failed/not_run. No command +(stale install) — skip. # /design-motion: Showcase Loops from an Approved Design diff --git a/design-review/SKILL.md b/design-review/SKILL.md index f98de8df6..43062db7d 100644 --- a/design-review/SKILL.md +++ b/design-review/SKILL.md @@ -117,24 +117,24 @@ jq -nc --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg skill "SKILL_NAME" --arg ## Telemetry (run last) -After workflow completion, log telemetry with 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). +When done, make ONE call — it also drains the artifacts-sync +queue (don't also run gstack-brain-sync). -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** writes telemetry to `$GSTACK_STATE_ROOT/analytics/`. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "design-review" --outcome OUTCOME \ --session-id "SESSION_ID" --tel-start "TEL_START" --used-browse USED_BROWSE \ - --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" 2>/dev/null || true + --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" \ + --exit-reason EXIT_REASON --invoked INVOKED --model-family MODEL_FAMILY --checks CHECKS 2>/dev/null || true ``` -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. +OUTCOME: success/error/abort/unknown. USED_BROWSE: yes/no. SESSION_ID, TEL_START: +skill-start echoes. ERROR_MESSAGE, FAILED_STEP: "" unless error. EXIT_REASON: +completed/user_stopped/blocked/tool_error/test_failed/context_limit/gave_up. +INVOKED: user/model/chained. MODEL_FAMILY (yours): claude_opus/claude_sonnet/ +claude_haiku/claude_other/gpt/gemini/other. CHECKS: passed/failed/not_run. No command +(stale install) — skip. diff --git a/design-shotgun/SKILL.md b/design-shotgun/SKILL.md index d3c74e7ac..7e9f8b583 100644 --- a/design-shotgun/SKILL.md +++ b/design-shotgun/SKILL.md @@ -103,24 +103,24 @@ Exit code 2 = rejected as not user-originated; do not retry. On success: "Set `< ## Telemetry (run last) -After workflow completion, log telemetry with 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). +When done, make ONE call — it also drains the artifacts-sync +queue (don't also run gstack-brain-sync). -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** writes telemetry to `$GSTACK_STATE_ROOT/analytics/`. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "design-shotgun" --outcome OUTCOME \ --session-id "SESSION_ID" --tel-start "TEL_START" --used-browse USED_BROWSE \ - --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" 2>/dev/null || true + --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" \ + --exit-reason EXIT_REASON --invoked INVOKED --model-family MODEL_FAMILY --checks CHECKS 2>/dev/null || true ``` -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. +OUTCOME: success/error/abort/unknown. USED_BROWSE: yes/no. SESSION_ID, TEL_START: +skill-start echoes. ERROR_MESSAGE, FAILED_STEP: "" unless error. EXIT_REASON: +completed/user_stopped/blocked/tool_error/test_failed/context_limit/gave_up. +INVOKED: user/model/chained. MODEL_FAMILY (yours): claude_opus/claude_sonnet/ +claude_haiku/claude_other/gpt/gemini/other. CHECKS: passed/failed/not_run. No command +(stale install) — skip. # /design-shotgun: Visual Design Exploration diff --git a/devex-review/SKILL.md b/devex-review/SKILL.md index 013ad1390..4a3a02f46 100644 --- a/devex-review/SKILL.md +++ b/devex-review/SKILL.md @@ -115,24 +115,24 @@ jq -nc --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg skill "SKILL_NAME" --arg ## Telemetry (run last) -After workflow completion, log telemetry with 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). +When done, make ONE call — it also drains the artifacts-sync +queue (don't also run gstack-brain-sync). -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** writes telemetry to `$GSTACK_STATE_ROOT/analytics/`. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "devex-review" --outcome OUTCOME \ --session-id "SESSION_ID" --tel-start "TEL_START" --used-browse USED_BROWSE \ - --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" 2>/dev/null || true + --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" \ + --exit-reason EXIT_REASON --invoked INVOKED --model-family MODEL_FAMILY --checks CHECKS 2>/dev/null || true ``` -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. +OUTCOME: success/error/abort/unknown. USED_BROWSE: yes/no. SESSION_ID, TEL_START: +skill-start echoes. ERROR_MESSAGE, FAILED_STEP: "" unless error. EXIT_REASON: +completed/user_stopped/blocked/tool_error/test_failed/context_limit/gave_up. +INVOKED: user/model/chained. MODEL_FAMILY (yours): claude_opus/claude_sonnet/ +claude_haiku/claude_other/gpt/gemini/other. CHECKS: passed/failed/not_run. No command +(stale install) — skip. ## Step 0: Detect platform and base branch diff --git a/diagram/SKILL.md b/diagram/SKILL.md index 70c9408c7..7989b237d 100644 --- a/diagram/SKILL.md +++ b/diagram/SKILL.md @@ -136,24 +136,24 @@ Do not log obvious facts or one-time transient errors. ## Telemetry (run last) -After workflow completion, log telemetry with 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). +When done, make ONE call — it also drains the artifacts-sync +queue (don't also run gstack-brain-sync). -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** writes telemetry to `$GSTACK_STATE_ROOT/analytics/`. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "diagram" --outcome OUTCOME \ --session-id "SESSION_ID" --tel-start "TEL_START" --used-browse USED_BROWSE \ - --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" 2>/dev/null || true + --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" \ + --exit-reason EXIT_REASON --invoked INVOKED --model-family MODEL_FAMILY --checks CHECKS 2>/dev/null || true ``` -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. +OUTCOME: success/error/abort/unknown. USED_BROWSE: yes/no. SESSION_ID, TEL_START: +skill-start echoes. ERROR_MESSAGE, FAILED_STEP: "" unless error. EXIT_REASON: +completed/user_stopped/blocked/tool_error/test_failed/context_limit/gave_up. +INVOKED: user/model/chained. MODEL_FAMILY (yours): claude_opus/claude_sonnet/ +claude_haiku/claude_other/gpt/gemini/other. CHECKS: passed/failed/not_run. No command +(stale install) — skip. ## Plan Status Footer diff --git a/docs/privacy.md b/docs/privacy.md index edd0d397e..1e5808714 100644 --- a/docs/privacy.md +++ b/docs/privacy.md @@ -11,9 +11,35 @@ no, and `gstack-config set telemetry off` turns it off at any time. whether the browser was used, whether the run was live or a test, a session id, the count of live session markers (below), the error class, the failed step, and an error message passed through gstack's secret redaction (cut to 200 characters). `community` adds a stable device - ID; `anonymous` sends no ID. Prompt-injection detections add the attacking + ID; `anonymous` sends no device ID. Prompt-injection detections add the attacking page's domain, a payload hash, a confidence score, the detection layer and the verdict. +- **Each skill run also sends** these labels, each a pick from a + fixed list (anything else is sent as `unknown`): + - `host`: which coding agent ran it (`claude_code`, `codex`, `cursor`, + `openclaw`, `hermes` or `other`), read from the agent's environment. + - `model_family`: `claude_opus`, `claude_sonnet`, `claude_haiku`, + `claude_other`, `gpt`, `gemini` or `other`, as the model reports it about itself. + - `invoked`: started by you, by the model, or chained from another skill. + - `exit_reason`: completed, stopped by you, blocked, a tool error, a test + failure, the context limit, or gave up. + - `checks`: whether the skill's own checks passed, failed or weren't run. + - `routing`: whether your CLAUDE.md/AGENTS.md has gstack's routing section + and whether gstack hooks are installed (`none`, `block`, `hooks`, + `both`). The files are read on your machine; only that word is sent. + - `harness_session_id`: a random 16-character id for one agent session. It + is created on first use, kept in that session's marker file below, and + ends when the marker does (120 idle minutes). It is never your device ID + and never reused, so it links the skills of one session and nothing + across sessions or machines. It is sent on both tiers, except under a + harness that runs every session in one process (Capy's capy-server). + - Upgrades send one `upgrade_completed` event: success or the failure + reason (`refused_dirty`, `busy`, `fetch_failed`, `setup_failed`, + `other`) and the version you came from. `--check` and unattended + sessions send nothing. + - `source` is set to `ci` under CI and `eval` inside gstack's eval runs, + so lab traffic stays out of real-use numbers. A duration gstack can't + measure is sent empty instead of 0. - **What's never sent:** code, file paths, repo names, branch names, prompts, or any other content you write. - **What stays on your machine:** opted in, each run is also logged to @@ -61,8 +87,9 @@ them by name. your telemetry setting. They are functional state, not usage logs, and the files are never sent: -- **Session markers:** `~/.gstack/sessions/`, one empty file per live agent - session, touched at skill start and deleted after 120 minutes. The count lets +- **Session markers:** `~/.gstack/sessions/`, one file per live agent + session, touched at skill start and deleted after 120 idle minutes. With + telemetry on it holds that session's random `harness_session_id`. The count lets skills notice several sessions on one machine; with telemetry on, that number is the session count above. - **Project timeline:** `~/.gstack/projects//timeline.jsonl` records skill diff --git a/document-generate/SKILL.md b/document-generate/SKILL.md index 61ebc6c46..372570ce3 100644 --- a/document-generate/SKILL.md +++ b/document-generate/SKILL.md @@ -89,24 +89,24 @@ Exit code 2 = rejected as not user-originated; do not retry. On success: "Set `< ## Telemetry (run last) -After workflow completion, log telemetry with 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). +When done, make ONE call — it also drains the artifacts-sync +queue (don't also run gstack-brain-sync). -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** writes telemetry to `$GSTACK_STATE_ROOT/analytics/`. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "document-generate" --outcome OUTCOME \ --session-id "SESSION_ID" --tel-start "TEL_START" --used-browse USED_BROWSE \ - --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" 2>/dev/null || true + --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" \ + --exit-reason EXIT_REASON --invoked INVOKED --model-family MODEL_FAMILY --checks CHECKS 2>/dev/null || true ``` -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. +OUTCOME: success/error/abort/unknown. USED_BROWSE: yes/no. SESSION_ID, TEL_START: +skill-start echoes. ERROR_MESSAGE, FAILED_STEP: "" unless error. EXIT_REASON: +completed/user_stopped/blocked/tool_error/test_failed/context_limit/gave_up. +INVOKED: user/model/chained. MODEL_FAMILY (yours): claude_opus/claude_sonnet/ +claude_haiku/claude_other/gpt/gemini/other. CHECKS: passed/failed/not_run. No command +(stale install) — skip. ## Step 0: Detect platform and base branch diff --git a/document-release/SKILL.md b/document-release/SKILL.md index 6521ba078..8d34673fd 100644 --- a/document-release/SKILL.md +++ b/document-release/SKILL.md @@ -85,24 +85,24 @@ Exit code 2 = rejected as not user-originated; do not retry. On success: "Set `< ## Telemetry (run last) -After workflow completion, log telemetry with 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). +When done, make ONE call — it also drains the artifacts-sync +queue (don't also run gstack-brain-sync). -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** writes telemetry to `$GSTACK_STATE_ROOT/analytics/`. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "document-release" --outcome OUTCOME \ --session-id "SESSION_ID" --tel-start "TEL_START" --used-browse USED_BROWSE \ - --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" 2>/dev/null || true + --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" \ + --exit-reason EXIT_REASON --invoked INVOKED --model-family MODEL_FAMILY --checks CHECKS 2>/dev/null || true ``` -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. +OUTCOME: success/error/abort/unknown. USED_BROWSE: yes/no. SESSION_ID, TEL_START: +skill-start echoes. ERROR_MESSAGE, FAILED_STEP: "" unless error. EXIT_REASON: +completed/user_stopped/blocked/tool_error/test_failed/context_limit/gave_up. +INVOKED: user/model/chained. MODEL_FAMILY (yours): claude_opus/claude_sonnet/ +claude_haiku/claude_other/gpt/gemini/other. CHECKS: passed/failed/not_run. No command +(stale install) — skip. ## Step 0: Detect platform and base branch diff --git a/eval-plan/SKILL.md b/eval-plan/SKILL.md index c67567349..c4c4c23cb 100644 --- a/eval-plan/SKILL.md +++ b/eval-plan/SKILL.md @@ -88,24 +88,24 @@ Exit code 2 = rejected as not user-originated; do not retry. On success: "Set `< ## Telemetry (run last) -After workflow completion, log telemetry with 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). +When done, make ONE call — it also drains the artifacts-sync +queue (don't also run gstack-brain-sync). -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** writes telemetry to `$GSTACK_STATE_ROOT/analytics/`. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "eval-plan" --outcome OUTCOME \ --session-id "SESSION_ID" --tel-start "TEL_START" --used-browse USED_BROWSE \ - --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" 2>/dev/null || true + --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" \ + --exit-reason EXIT_REASON --invoked INVOKED --model-family MODEL_FAMILY --checks CHECKS 2>/dev/null || true ``` -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. +OUTCOME: success/error/abort/unknown. USED_BROWSE: yes/no. SESSION_ID, TEL_START: +skill-start echoes. ERROR_MESSAGE, FAILED_STEP: "" unless error. EXIT_REASON: +completed/user_stopped/blocked/tool_error/test_failed/context_limit/gave_up. +INVOKED: user/model/chained. MODEL_FAMILY (yours): claude_opus/claude_sonnet/ +claude_haiku/claude_other/gpt/gemini/other. CHECKS: passed/failed/not_run. No command +(stale install) — skip. # /eval-plan: Preregistered, paid evals diff --git a/health/SKILL.md b/health/SKILL.md index 5ffdd1f2e..07c1fc34e 100644 --- a/health/SKILL.md +++ b/health/SKILL.md @@ -85,24 +85,24 @@ Exit code 2 = rejected as not user-originated; do not retry. On success: "Set `< ## Telemetry (run last) -After workflow completion, log telemetry with 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). +When done, make ONE call — it also drains the artifacts-sync +queue (don't also run gstack-brain-sync). -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** writes telemetry to `$GSTACK_STATE_ROOT/analytics/`. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "health" --outcome OUTCOME \ --session-id "SESSION_ID" --tel-start "TEL_START" --used-browse USED_BROWSE \ - --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" 2>/dev/null || true + --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" \ + --exit-reason EXIT_REASON --invoked INVOKED --model-family MODEL_FAMILY --checks CHECKS 2>/dev/null || true ``` -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. +OUTCOME: success/error/abort/unknown. USED_BROWSE: yes/no. SESSION_ID, TEL_START: +skill-start echoes. ERROR_MESSAGE, FAILED_STEP: "" unless error. EXIT_REASON: +completed/user_stopped/blocked/tool_error/test_failed/context_limit/gave_up. +INVOKED: user/model/chained. MODEL_FAMILY (yours): claude_opus/claude_sonnet/ +claude_haiku/claude_other/gpt/gemini/other. CHECKS: passed/failed/not_run. No command +(stale install) — skip. # /health -- Code Quality Dashboard diff --git a/ios-clean/SKILL.md b/ios-clean/SKILL.md index 3cd332bdb..59a9ee8f6 100644 --- a/ios-clean/SKILL.md +++ b/ios-clean/SKILL.md @@ -84,24 +84,24 @@ Exit code 2 = rejected as not user-originated; do not retry. On success: "Set `< ## Telemetry (run last) -After workflow completion, log telemetry with 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). +When done, make ONE call — it also drains the artifacts-sync +queue (don't also run gstack-brain-sync). -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** writes telemetry to `$GSTACK_STATE_ROOT/analytics/`. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "ios-clean" --outcome OUTCOME \ --session-id "SESSION_ID" --tel-start "TEL_START" --used-browse USED_BROWSE \ - --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" 2>/dev/null || true + --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" \ + --exit-reason EXIT_REASON --invoked INVOKED --model-family MODEL_FAMILY --checks CHECKS 2>/dev/null || true ``` -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. +OUTCOME: success/error/abort/unknown. USED_BROWSE: yes/no. SESSION_ID, TEL_START: +skill-start echoes. ERROR_MESSAGE, FAILED_STEP: "" unless error. EXIT_REASON: +completed/user_stopped/blocked/tool_error/test_failed/context_limit/gave_up. +INVOKED: user/model/chained. MODEL_FAMILY (yours): claude_opus/claude_sonnet/ +claude_haiku/claude_other/gpt/gemini/other. CHECKS: passed/failed/not_run. No command +(stale install) — skip. # Strip the DebugBridge from an iOS app diff --git a/ios-design-review/SKILL.md b/ios-design-review/SKILL.md index b2d565d38..a2bcd4ba0 100644 --- a/ios-design-review/SKILL.md +++ b/ios-design-review/SKILL.md @@ -83,24 +83,24 @@ Exit code 2 = rejected as not user-originated; do not retry. On success: "Set `< ## Telemetry (run last) -After workflow completion, log telemetry with 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). +When done, make ONE call — it also drains the artifacts-sync +queue (don't also run gstack-brain-sync). -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** writes telemetry to `$GSTACK_STATE_ROOT/analytics/`. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "ios-design-review" --outcome OUTCOME \ --session-id "SESSION_ID" --tel-start "TEL_START" --used-browse USED_BROWSE \ - --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" 2>/dev/null || true + --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" \ + --exit-reason EXIT_REASON --invoked INVOKED --model-family MODEL_FAMILY --checks CHECKS 2>/dev/null || true ``` -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. +OUTCOME: success/error/abort/unknown. USED_BROWSE: yes/no. SESSION_ID, TEL_START: +skill-start echoes. ERROR_MESSAGE, FAILED_STEP: "" unless error. EXIT_REASON: +completed/user_stopped/blocked/tool_error/test_failed/context_limit/gave_up. +INVOKED: user/model/chained. MODEL_FAMILY (yours): claude_opus/claude_sonnet/ +claude_haiku/claude_other/gpt/gemini/other. CHECKS: passed/failed/not_run. No command +(stale install) — skip. # iOS Design Review diff --git a/ios-fix/SKILL.md b/ios-fix/SKILL.md index 16466c56c..fe247f12b 100644 --- a/ios-fix/SKILL.md +++ b/ios-fix/SKILL.md @@ -85,24 +85,24 @@ Exit code 2 = rejected as not user-originated; do not retry. On success: "Set `< ## Telemetry (run last) -After workflow completion, log telemetry with 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). +When done, make ONE call — it also drains the artifacts-sync +queue (don't also run gstack-brain-sync). -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** writes telemetry to `$GSTACK_STATE_ROOT/analytics/`. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "ios-fix" --outcome OUTCOME \ --session-id "SESSION_ID" --tel-start "TEL_START" --used-browse USED_BROWSE \ - --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" 2>/dev/null || true + --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" \ + --exit-reason EXIT_REASON --invoked INVOKED --model-family MODEL_FAMILY --checks CHECKS 2>/dev/null || true ``` -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. +OUTCOME: success/error/abort/unknown. USED_BROWSE: yes/no. SESSION_ID, TEL_START: +skill-start echoes. ERROR_MESSAGE, FAILED_STEP: "" unless error. EXIT_REASON: +completed/user_stopped/blocked/tool_error/test_failed/context_limit/gave_up. +INVOKED: user/model/chained. MODEL_FAMILY (yours): claude_opus/claude_sonnet/ +claude_haiku/claude_other/gpt/gemini/other. CHECKS: passed/failed/not_run. No command +(stale install) — skip. # Autonomous iOS bug fixer diff --git a/ios-qa/SKILL.md b/ios-qa/SKILL.md index 1dbd485eb..a86fc56aa 100644 --- a/ios-qa/SKILL.md +++ b/ios-qa/SKILL.md @@ -118,24 +118,24 @@ jq -nc --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg skill "SKILL_NAME" --arg ## Telemetry (run last) -After workflow completion, log telemetry with 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). +When done, make ONE call — it also drains the artifacts-sync +queue (don't also run gstack-brain-sync). -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** writes telemetry to `$GSTACK_STATE_ROOT/analytics/`. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "ios-qa" --outcome OUTCOME \ --session-id "SESSION_ID" --tel-start "TEL_START" --used-browse USED_BROWSE \ - --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" 2>/dev/null || true + --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" \ + --exit-reason EXIT_REASON --invoked INVOKED --model-family MODEL_FAMILY --checks CHECKS 2>/dev/null || true ``` -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. +OUTCOME: success/error/abort/unknown. USED_BROWSE: yes/no. SESSION_ID, TEL_START: +skill-start echoes. ERROR_MESSAGE, FAILED_STEP: "" unless error. EXIT_REASON: +completed/user_stopped/blocked/tool_error/test_failed/context_limit/gave_up. +INVOKED: user/model/chained. MODEL_FAMILY (yours): claude_opus/claude_sonnet/ +claude_haiku/claude_other/gpt/gemini/other. CHECKS: passed/failed/not_run. No command +(stale install) — skip. # Live-device iOS QA diff --git a/ios-sync/SKILL.md b/ios-sync/SKILL.md index 70d982c23..1227b920e 100644 --- a/ios-sync/SKILL.md +++ b/ios-sync/SKILL.md @@ -85,24 +85,24 @@ Exit code 2 = rejected as not user-originated; do not retry. On success: "Set `< ## Telemetry (run last) -After workflow completion, log telemetry with 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). +When done, make ONE call — it also drains the artifacts-sync +queue (don't also run gstack-brain-sync). -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** writes telemetry to `$GSTACK_STATE_ROOT/analytics/`. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "ios-sync" --outcome OUTCOME \ --session-id "SESSION_ID" --tel-start "TEL_START" --used-browse USED_BROWSE \ - --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" 2>/dev/null || true + --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" \ + --exit-reason EXIT_REASON --invoked INVOKED --model-family MODEL_FAMILY --checks CHECKS 2>/dev/null || true ``` -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. +OUTCOME: success/error/abort/unknown. USED_BROWSE: yes/no. SESSION_ID, TEL_START: +skill-start echoes. ERROR_MESSAGE, FAILED_STEP: "" unless error. EXIT_REASON: +completed/user_stopped/blocked/tool_error/test_failed/context_limit/gave_up. +INVOKED: user/model/chained. MODEL_FAMILY (yours): claude_opus/claude_sonnet/ +claude_haiku/claude_other/gpt/gemini/other. CHECKS: passed/failed/not_run. No command +(stale install) — skip. # Resync the iOS debug bridge diff --git a/land-and-deploy/SKILL.md b/land-and-deploy/SKILL.md index f09ba0408..4d536a697 100644 --- a/land-and-deploy/SKILL.md +++ b/land-and-deploy/SKILL.md @@ -114,24 +114,24 @@ jq -nc --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg skill "SKILL_NAME" --arg ## Telemetry (run last) -After workflow completion, log telemetry with 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). +When done, make ONE call — it also drains the artifacts-sync +queue (don't also run gstack-brain-sync). -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** writes telemetry to `$GSTACK_STATE_ROOT/analytics/`. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "land-and-deploy" --outcome OUTCOME \ --session-id "SESSION_ID" --tel-start "TEL_START" --used-browse USED_BROWSE \ - --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" 2>/dev/null || true + --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" \ + --exit-reason EXIT_REASON --invoked INVOKED --model-family MODEL_FAMILY --checks CHECKS 2>/dev/null || true ``` -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. +OUTCOME: success/error/abort/unknown. USED_BROWSE: yes/no. SESSION_ID, TEL_START: +skill-start echoes. ERROR_MESSAGE, FAILED_STEP: "" unless error. EXIT_REASON: +completed/user_stopped/blocked/tool_error/test_failed/context_limit/gave_up. +INVOKED: user/model/chained. MODEL_FAMILY (yours): claude_opus/claude_sonnet/ +claude_haiku/claude_other/gpt/gemini/other. CHECKS: passed/failed/not_run. No command +(stale install) — skip. ## Step 0: Detect platform and base branch diff --git a/landing-report/SKILL.md b/landing-report/SKILL.md index 9957ed40e..0f3a6f828 100644 --- a/landing-report/SKILL.md +++ b/landing-report/SKILL.md @@ -84,24 +84,24 @@ Exit code 2 = rejected as not user-originated; do not retry. On success: "Set `< ## Telemetry (run last) -After workflow completion, log telemetry with 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). +When done, make ONE call — it also drains the artifacts-sync +queue (don't also run gstack-brain-sync). -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** writes telemetry to `$GSTACK_STATE_ROOT/analytics/`. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "landing-report" --outcome OUTCOME \ --session-id "SESSION_ID" --tel-start "TEL_START" --used-browse USED_BROWSE \ - --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" 2>/dev/null || true + --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" \ + --exit-reason EXIT_REASON --invoked INVOKED --model-family MODEL_FAMILY --checks CHECKS 2>/dev/null || true ``` -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. +OUTCOME: success/error/abort/unknown. USED_BROWSE: yes/no. SESSION_ID, TEL_START: +skill-start echoes. ERROR_MESSAGE, FAILED_STEP: "" unless error. EXIT_REASON: +completed/user_stopped/blocked/tool_error/test_failed/context_limit/gave_up. +INVOKED: user/model/chained. MODEL_FAMILY (yours): claude_opus/claude_sonnet/ +claude_haiku/claude_other/gpt/gemini/other. CHECKS: passed/failed/not_run. No command +(stale install) — skip. --- diff --git a/learn/SKILL.md b/learn/SKILL.md index c1c58ec07..12804cc4c 100644 --- a/learn/SKILL.md +++ b/learn/SKILL.md @@ -85,24 +85,24 @@ Exit code 2 = rejected as not user-originated; do not retry. On success: "Set `< ## Telemetry (run last) -After workflow completion, log telemetry with 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). +When done, make ONE call — it also drains the artifacts-sync +queue (don't also run gstack-brain-sync). -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** writes telemetry to `$GSTACK_STATE_ROOT/analytics/`. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "learn" --outcome OUTCOME \ --session-id "SESSION_ID" --tel-start "TEL_START" --used-browse USED_BROWSE \ - --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" 2>/dev/null || true + --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" \ + --exit-reason EXIT_REASON --invoked INVOKED --model-family MODEL_FAMILY --checks CHECKS 2>/dev/null || true ``` -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. +OUTCOME: success/error/abort/unknown. USED_BROWSE: yes/no. SESSION_ID, TEL_START: +skill-start echoes. ERROR_MESSAGE, FAILED_STEP: "" unless error. EXIT_REASON: +completed/user_stopped/blocked/tool_error/test_failed/context_limit/gave_up. +INVOKED: user/model/chained. MODEL_FAMILY (yours): claude_opus/claude_sonnet/ +claude_haiku/claude_other/gpt/gemini/other. CHECKS: passed/failed/not_run. No command +(stale install) — skip. # /learn: project learnings diff --git a/make-pdf/SKILL.md b/make-pdf/SKILL.md index d7e7a9813..b0fec6224 100644 --- a/make-pdf/SKILL.md +++ b/make-pdf/SKILL.md @@ -171,24 +171,24 @@ Do not log obvious facts or one-time transient errors. ## Telemetry (run last) -After workflow completion, log telemetry with 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). +When done, make ONE call — it also drains the artifacts-sync +queue (don't also run gstack-brain-sync). -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** writes telemetry to `$GSTACK_STATE_ROOT/analytics/`. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "make-pdf" --outcome OUTCOME \ --session-id "SESSION_ID" --tel-start "TEL_START" --used-browse USED_BROWSE \ - --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" 2>/dev/null || true + --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" \ + --exit-reason EXIT_REASON --invoked INVOKED --model-family MODEL_FAMILY --checks CHECKS 2>/dev/null || true ``` -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. +OUTCOME: success/error/abort/unknown. USED_BROWSE: yes/no. SESSION_ID, TEL_START: +skill-start echoes. ERROR_MESSAGE, FAILED_STEP: "" unless error. EXIT_REASON: +completed/user_stopped/blocked/tool_error/test_failed/context_limit/gave_up. +INVOKED: user/model/chained. MODEL_FAMILY (yours): claude_opus/claude_sonnet/ +claude_haiku/claude_other/gpt/gemini/other. CHECKS: passed/failed/not_run. No command +(stale install) — skip. ## Plan Status Footer diff --git a/modernize/SKILL.md b/modernize/SKILL.md index c4344637b..d365312bd 100644 --- a/modernize/SKILL.md +++ b/modernize/SKILL.md @@ -87,24 +87,24 @@ Exit code 2 = rejected as not user-originated; do not retry. On success: "Set `< ## Telemetry (run last) -After workflow completion, log telemetry with 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). +When done, make ONE call — it also drains the artifacts-sync +queue (don't also run gstack-brain-sync). -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** writes telemetry to `$GSTACK_STATE_ROOT/analytics/`. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "modernize" --outcome OUTCOME \ --session-id "SESSION_ID" --tel-start "TEL_START" --used-browse USED_BROWSE \ - --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" 2>/dev/null || true + --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" \ + --exit-reason EXIT_REASON --invoked INVOKED --model-family MODEL_FAMILY --checks CHECKS 2>/dev/null || true ``` -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. +OUTCOME: success/error/abort/unknown. USED_BROWSE: yes/no. SESSION_ID, TEL_START: +skill-start echoes. ERROR_MESSAGE, FAILED_STEP: "" unless error. EXIT_REASON: +completed/user_stopped/blocked/tool_error/test_failed/context_limit/gave_up. +INVOKED: user/model/chained. MODEL_FAMILY (yours): claude_opus/claude_sonnet/ +claude_haiku/claude_other/gpt/gemini/other. CHECKS: passed/failed/not_run. No command +(stale install) — skip. --- diff --git a/office-hours/SKILL.md b/office-hours/SKILL.md index ecc96e5a1..212a3855f 100644 --- a/office-hours/SKILL.md +++ b/office-hours/SKILL.md @@ -160,24 +160,24 @@ jq -nc --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg skill "SKILL_NAME" --arg ## Telemetry (run last) -After workflow completion, log telemetry with 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). +When done, make ONE call — it also drains the artifacts-sync +queue (don't also run gstack-brain-sync). -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** writes telemetry to `$GSTACK_STATE_ROOT/analytics/`. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "office-hours" --outcome OUTCOME \ --session-id "SESSION_ID" --tel-start "TEL_START" --used-browse USED_BROWSE \ - --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" 2>/dev/null || true + --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" \ + --exit-reason EXIT_REASON --invoked INVOKED --model-family MODEL_FAMILY --checks CHECKS 2>/dev/null || true ``` -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. +OUTCOME: success/error/abort/unknown. USED_BROWSE: yes/no. SESSION_ID, TEL_START: +skill-start echoes. ERROR_MESSAGE, FAILED_STEP: "" unless error. EXIT_REASON: +completed/user_stopped/blocked/tool_error/test_failed/context_limit/gave_up. +INVOKED: user/model/chained. MODEL_FAMILY (yours): claude_opus/claude_sonnet/ +claude_haiku/claude_other/gpt/gemini/other. CHECKS: passed/failed/not_run. No command +(stale install) — skip. ## Third-Party Web Actions diff --git a/open-gstack-browser/SKILL.md b/open-gstack-browser/SKILL.md index 0935a3df5..bbf5b7a46 100644 --- a/open-gstack-browser/SKILL.md +++ b/open-gstack-browser/SKILL.md @@ -133,24 +133,24 @@ Do not log obvious facts or one-time transient errors. ## Telemetry (run last) -After workflow completion, log telemetry with 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). +When done, make ONE call — it also drains the artifacts-sync +queue (don't also run gstack-brain-sync). -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** writes telemetry to `$GSTACK_STATE_ROOT/analytics/`. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "open-gstack-browser" --outcome OUTCOME \ --session-id "SESSION_ID" --tel-start "TEL_START" --used-browse USED_BROWSE \ - --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" 2>/dev/null || true + --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" \ + --exit-reason EXIT_REASON --invoked INVOKED --model-family MODEL_FAMILY --checks CHECKS 2>/dev/null || true ``` -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. +OUTCOME: success/error/abort/unknown. USED_BROWSE: yes/no. SESSION_ID, TEL_START: +skill-start echoes. ERROR_MESSAGE, FAILED_STEP: "" unless error. EXIT_REASON: +completed/user_stopped/blocked/tool_error/test_failed/context_limit/gave_up. +INVOKED: user/model/chained. MODEL_FAMILY (yours): claude_opus/claude_sonnet/ +claude_haiku/claude_other/gpt/gemini/other. CHECKS: passed/failed/not_run. No command +(stale install) — skip. ## Plan Status Footer diff --git a/pair-agent/SKILL.md b/pair-agent/SKILL.md index 086cc905e..01c362903 100644 --- a/pair-agent/SKILL.md +++ b/pair-agent/SKILL.md @@ -82,24 +82,24 @@ Exit code 2 = rejected as not user-originated; do not retry. On success: "Set `< ## Telemetry (run last) -After workflow completion, log telemetry with 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). +When done, make ONE call — it also drains the artifacts-sync +queue (don't also run gstack-brain-sync). -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** writes telemetry to `$GSTACK_STATE_ROOT/analytics/`. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "pair-agent" --outcome OUTCOME \ --session-id "SESSION_ID" --tel-start "TEL_START" --used-browse USED_BROWSE \ - --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" 2>/dev/null || true + --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" \ + --exit-reason EXIT_REASON --invoked INVOKED --model-family MODEL_FAMILY --checks CHECKS 2>/dev/null || true ``` -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. +OUTCOME: success/error/abort/unknown. USED_BROWSE: yes/no. SESSION_ID, TEL_START: +skill-start echoes. ERROR_MESSAGE, FAILED_STEP: "" unless error. EXIT_REASON: +completed/user_stopped/blocked/tool_error/test_failed/context_limit/gave_up. +INVOKED: user/model/chained. MODEL_FAMILY (yours): claude_opus/claude_sonnet/ +claude_haiku/claude_other/gpt/gemini/other. CHECKS: passed/failed/not_run. No command +(stale install) — skip. # /pair-agent — Share Your Browser With Another AI Agent diff --git a/plan-ceo-review/SKILL.md b/plan-ceo-review/SKILL.md index 843949bae..cf2ce6cfc 100644 --- a/plan-ceo-review/SKILL.md +++ b/plan-ceo-review/SKILL.md @@ -159,24 +159,24 @@ jq -nc --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg skill "SKILL_NAME" --arg ## Telemetry (run last) -After workflow completion, log telemetry with 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). +When done, make ONE call — it also drains the artifacts-sync +queue (don't also run gstack-brain-sync). -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** writes telemetry to `$GSTACK_STATE_ROOT/analytics/`. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "plan-ceo-review" --outcome OUTCOME \ --session-id "SESSION_ID" --tel-start "TEL_START" --used-browse USED_BROWSE \ - --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" 2>/dev/null || true + --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" \ + --exit-reason EXIT_REASON --invoked INVOKED --model-family MODEL_FAMILY --checks CHECKS 2>/dev/null || true ``` -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. +OUTCOME: success/error/abort/unknown. USED_BROWSE: yes/no. SESSION_ID, TEL_START: +skill-start echoes. ERROR_MESSAGE, FAILED_STEP: "" unless error. EXIT_REASON: +completed/user_stopped/blocked/tool_error/test_failed/context_limit/gave_up. +INVOKED: user/model/chained. MODEL_FAMILY (yours): claude_opus/claude_sonnet/ +claude_haiku/claude_other/gpt/gemini/other. CHECKS: passed/failed/not_run. No command +(stale install) — skip. ## Step 0: Detect platform and base branch diff --git a/plan-design-review/SKILL.md b/plan-design-review/SKILL.md index ddfa7ec0e..05cb75c1a 100644 --- a/plan-design-review/SKILL.md +++ b/plan-design-review/SKILL.md @@ -161,24 +161,24 @@ jq -nc --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg skill "SKILL_NAME" --arg ## Telemetry (run last) -After workflow completion, log telemetry with 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). +When done, make ONE call — it also drains the artifacts-sync +queue (don't also run gstack-brain-sync). -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** writes telemetry to `$GSTACK_STATE_ROOT/analytics/`. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "plan-design-review" --outcome OUTCOME \ --session-id "SESSION_ID" --tel-start "TEL_START" --used-browse USED_BROWSE \ - --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" 2>/dev/null || true + --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" \ + --exit-reason EXIT_REASON --invoked INVOKED --model-family MODEL_FAMILY --checks CHECKS 2>/dev/null || true ``` -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. +OUTCOME: success/error/abort/unknown. USED_BROWSE: yes/no. SESSION_ID, TEL_START: +skill-start echoes. ERROR_MESSAGE, FAILED_STEP: "" unless error. EXIT_REASON: +completed/user_stopped/blocked/tool_error/test_failed/context_limit/gave_up. +INVOKED: user/model/chained. MODEL_FAMILY (yours): claude_opus/claude_sonnet/ +claude_haiku/claude_other/gpt/gemini/other. CHECKS: passed/failed/not_run. No command +(stale install) — skip. ## Step 0: Detect platform and base branch diff --git a/plan-devex-review/SKILL.md b/plan-devex-review/SKILL.md index 66758de56..cb1f79357 100644 --- a/plan-devex-review/SKILL.md +++ b/plan-devex-review/SKILL.md @@ -129,24 +129,24 @@ jq -nc --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg skill "SKILL_NAME" --arg ## Telemetry (run last) -After workflow completion, log telemetry with 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). +When done, make ONE call — it also drains the artifacts-sync +queue (don't also run gstack-brain-sync). -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** writes telemetry to `$GSTACK_STATE_ROOT/analytics/`. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "plan-devex-review" --outcome OUTCOME \ --session-id "SESSION_ID" --tel-start "TEL_START" --used-browse USED_BROWSE \ - --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" 2>/dev/null || true + --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" \ + --exit-reason EXIT_REASON --invoked INVOKED --model-family MODEL_FAMILY --checks CHECKS 2>/dev/null || true ``` -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. +OUTCOME: success/error/abort/unknown. USED_BROWSE: yes/no. SESSION_ID, TEL_START: +skill-start echoes. ERROR_MESSAGE, FAILED_STEP: "" unless error. EXIT_REASON: +completed/user_stopped/blocked/tool_error/test_failed/context_limit/gave_up. +INVOKED: user/model/chained. MODEL_FAMILY (yours): claude_opus/claude_sonnet/ +claude_haiku/claude_other/gpt/gemini/other. CHECKS: passed/failed/not_run. No command +(stale install) — skip. ## Step 0: Detect platform and base branch diff --git a/plan-eng-review/SKILL.md b/plan-eng-review/SKILL.md index 641fead30..ad0e7bbb2 100644 --- a/plan-eng-review/SKILL.md +++ b/plan-eng-review/SKILL.md @@ -247,24 +247,24 @@ jq -nc --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg skill "SKILL_NAME" --arg ## Telemetry (run last) -After workflow completion, log telemetry with 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). +When done, make ONE call — it also drains the artifacts-sync +queue (don't also run gstack-brain-sync). -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** writes telemetry to `$GSTACK_STATE_ROOT/analytics/`. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "plan-eng-review" --outcome OUTCOME \ --session-id "SESSION_ID" --tel-start "TEL_START" --used-browse USED_BROWSE \ - --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" 2>/dev/null || true + --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" \ + --exit-reason EXIT_REASON --invoked INVOKED --model-family MODEL_FAMILY --checks CHECKS 2>/dev/null || true ``` -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. +OUTCOME: success/error/abort/unknown. USED_BROWSE: yes/no. SESSION_ID, TEL_START: +skill-start echoes. ERROR_MESSAGE, FAILED_STEP: "" unless error. EXIT_REASON: +completed/user_stopped/blocked/tool_error/test_failed/context_limit/gave_up. +INVOKED: user/model/chained. MODEL_FAMILY (yours): claude_opus/claude_sonnet/ +claude_haiku/claude_other/gpt/gemini/other. CHECKS: passed/failed/not_run. No command +(stale install) — skip. ## Plan Status Footer diff --git a/plan-tune/SKILL.md b/plan-tune/SKILL.md index 5897171c0..f769b3037 100644 --- a/plan-tune/SKILL.md +++ b/plan-tune/SKILL.md @@ -89,24 +89,24 @@ Exit code 2 = rejected as not user-originated; do not retry. On success: "Set `< ## Telemetry (run last) -After workflow completion, log telemetry with 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). +When done, make ONE call — it also drains the artifacts-sync +queue (don't also run gstack-brain-sync). -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** writes telemetry to `$GSTACK_STATE_ROOT/analytics/`. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "plan-tune" --outcome OUTCOME \ --session-id "SESSION_ID" --tel-start "TEL_START" --used-browse USED_BROWSE \ - --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" 2>/dev/null || true + --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" \ + --exit-reason EXIT_REASON --invoked INVOKED --model-family MODEL_FAMILY --checks CHECKS 2>/dev/null || true ``` -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. +OUTCOME: success/error/abort/unknown. USED_BROWSE: yes/no. SESSION_ID, TEL_START: +skill-start echoes. ERROR_MESSAGE, FAILED_STEP: "" unless error. EXIT_REASON: +completed/user_stopped/blocked/tool_error/test_failed/context_limit/gave_up. +INVOKED: user/model/chained. MODEL_FAMILY (yours): claude_opus/claude_sonnet/ +claude_haiku/claude_other/gpt/gemini/other. CHECKS: passed/failed/not_run. No command +(stale install) — skip. # /plan-tune — Question Tuning + Developer Profile (v1 observational) diff --git a/qa-only/SKILL.md b/qa-only/SKILL.md index 847ca3676..22679c8bb 100644 --- a/qa-only/SKILL.md +++ b/qa-only/SKILL.md @@ -113,24 +113,24 @@ jq -nc --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg skill "SKILL_NAME" --arg ## Telemetry (run last) -After workflow completion, log telemetry with 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). +When done, make ONE call — it also drains the artifacts-sync +queue (don't also run gstack-brain-sync). -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** writes telemetry to `$GSTACK_STATE_ROOT/analytics/`. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "qa-only" --outcome OUTCOME \ --session-id "SESSION_ID" --tel-start "TEL_START" --used-browse USED_BROWSE \ - --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" 2>/dev/null || true + --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" \ + --exit-reason EXIT_REASON --invoked INVOKED --model-family MODEL_FAMILY --checks CHECKS 2>/dev/null || true ``` -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. +OUTCOME: success/error/abort/unknown. USED_BROWSE: yes/no. SESSION_ID, TEL_START: +skill-start echoes. ERROR_MESSAGE, FAILED_STEP: "" unless error. EXIT_REASON: +completed/user_stopped/blocked/tool_error/test_failed/context_limit/gave_up. +INVOKED: user/model/chained. MODEL_FAMILY (yours): claude_opus/claude_sonnet/ +claude_haiku/claude_other/gpt/gemini/other. CHECKS: passed/failed/not_run. No command +(stale install) — skip. # /qa-only: Report-Only QA Testing diff --git a/qa/SKILL.md b/qa/SKILL.md index 51e4a6fb1..581adba24 100644 --- a/qa/SKILL.md +++ b/qa/SKILL.md @@ -116,24 +116,24 @@ jq -nc --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg skill "SKILL_NAME" --arg ## Telemetry (run last) -After workflow completion, log telemetry with 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). +When done, make ONE call — it also drains the artifacts-sync +queue (don't also run gstack-brain-sync). -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** writes telemetry to `$GSTACK_STATE_ROOT/analytics/`. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "qa" --outcome OUTCOME \ --session-id "SESSION_ID" --tel-start "TEL_START" --used-browse USED_BROWSE \ - --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" 2>/dev/null || true + --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" \ + --exit-reason EXIT_REASON --invoked INVOKED --model-family MODEL_FAMILY --checks CHECKS 2>/dev/null || true ``` -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. +OUTCOME: success/error/abort/unknown. USED_BROWSE: yes/no. SESSION_ID, TEL_START: +skill-start echoes. ERROR_MESSAGE, FAILED_STEP: "" unless error. EXIT_REASON: +completed/user_stopped/blocked/tool_error/test_failed/context_limit/gave_up. +INVOKED: user/model/chained. MODEL_FAMILY (yours): claude_opus/claude_sonnet/ +claude_haiku/claude_other/gpt/gemini/other. CHECKS: passed/failed/not_run. No command +(stale install) — skip. ## Step 0: Detect platform and base branch diff --git a/retro/SKILL.md b/retro/SKILL.md index 0bbb215c9..89a355e5e 100644 --- a/retro/SKILL.md +++ b/retro/SKILL.md @@ -103,24 +103,24 @@ Exit code 2 = rejected as not user-originated; do not retry. On success: "Set `< ## Telemetry (run last) -After workflow completion, log telemetry with 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). +When done, make ONE call — it also drains the artifacts-sync +queue (don't also run gstack-brain-sync). -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** writes telemetry to `$GSTACK_STATE_ROOT/analytics/`. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "retro" --outcome OUTCOME \ --session-id "SESSION_ID" --tel-start "TEL_START" --used-browse USED_BROWSE \ - --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" 2>/dev/null || true + --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" \ + --exit-reason EXIT_REASON --invoked INVOKED --model-family MODEL_FAMILY --checks CHECKS 2>/dev/null || true ``` -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. +OUTCOME: success/error/abort/unknown. USED_BROWSE: yes/no. SESSION_ID, TEL_START: +skill-start echoes. ERROR_MESSAGE, FAILED_STEP: "" unless error. EXIT_REASON: +completed/user_stopped/blocked/tool_error/test_failed/context_limit/gave_up. +INVOKED: user/model/chained. MODEL_FAMILY (yours): claude_opus/claude_sonnet/ +claude_haiku/claude_other/gpt/gemini/other. CHECKS: passed/failed/not_run. No command +(stale install) — skip. ## Step 0: Detect platform and base branch diff --git a/review/SKILL.md b/review/SKILL.md index 103b3e54e..6d59c741e 100644 --- a/review/SKILL.md +++ b/review/SKILL.md @@ -144,24 +144,24 @@ jq -nc --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg skill "SKILL_NAME" --arg ## Telemetry (run last) -After workflow completion, log telemetry with 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). +When done, make ONE call — it also drains the artifacts-sync +queue (don't also run gstack-brain-sync). -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** writes telemetry to `$GSTACK_STATE_ROOT/analytics/`. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "review" --outcome OUTCOME \ --session-id "SESSION_ID" --tel-start "TEL_START" --used-browse USED_BROWSE \ - --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" 2>/dev/null || true + --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" \ + --exit-reason EXIT_REASON --invoked INVOKED --model-family MODEL_FAMILY --checks CHECKS 2>/dev/null || true ``` -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. +OUTCOME: success/error/abort/unknown. USED_BROWSE: yes/no. SESSION_ID, TEL_START: +skill-start echoes. ERROR_MESSAGE, FAILED_STEP: "" unless error. EXIT_REASON: +completed/user_stopped/blocked/tool_error/test_failed/context_limit/gave_up. +INVOKED: user/model/chained. MODEL_FAMILY (yours): claude_opus/claude_sonnet/ +claude_haiku/claude_other/gpt/gemini/other. CHECKS: passed/failed/not_run. No command +(stale install) — skip. ## Step 0: Detect platform and base branch diff --git a/runaway-stopper/SKILL.md b/runaway-stopper/SKILL.md index 19b94f1b0..da448484c 100644 --- a/runaway-stopper/SKILL.md +++ b/runaway-stopper/SKILL.md @@ -133,24 +133,24 @@ Do not log obvious facts or one-time transient errors. ## Telemetry (run last) -After workflow completion, log telemetry with 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). +When done, make ONE call — it also drains the artifacts-sync +queue (don't also run gstack-brain-sync). -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** writes telemetry to `$GSTACK_STATE_ROOT/analytics/`. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "runaway-stopper" --outcome OUTCOME \ --session-id "SESSION_ID" --tel-start "TEL_START" --used-browse USED_BROWSE \ - --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" 2>/dev/null || true + --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" \ + --exit-reason EXIT_REASON --invoked INVOKED --model-family MODEL_FAMILY --checks CHECKS 2>/dev/null || true ``` -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. +OUTCOME: success/error/abort/unknown. USED_BROWSE: yes/no. SESSION_ID, TEL_START: +skill-start echoes. ERROR_MESSAGE, FAILED_STEP: "" unless error. EXIT_REASON: +completed/user_stopped/blocked/tool_error/test_failed/context_limit/gave_up. +INVOKED: user/model/chained. MODEL_FAMILY (yours): claude_opus/claude_sonnet/ +claude_haiku/claude_other/gpt/gemini/other. CHECKS: passed/failed/not_run. No command +(stale install) — skip. ## Plan Status Footer diff --git a/scrape/SKILL.md b/scrape/SKILL.md index 99a662dae..56d50b108 100644 --- a/scrape/SKILL.md +++ b/scrape/SKILL.md @@ -134,24 +134,24 @@ Do not log obvious facts or one-time transient errors. ## Telemetry (run last) -After workflow completion, log telemetry with 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). +When done, make ONE call — it also drains the artifacts-sync +queue (don't also run gstack-brain-sync). -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** writes telemetry to `$GSTACK_STATE_ROOT/analytics/`. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "scrape" --outcome OUTCOME \ --session-id "SESSION_ID" --tel-start "TEL_START" --used-browse USED_BROWSE \ - --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" 2>/dev/null || true + --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" \ + --exit-reason EXIT_REASON --invoked INVOKED --model-family MODEL_FAMILY --checks CHECKS 2>/dev/null || true ``` -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. +OUTCOME: success/error/abort/unknown. USED_BROWSE: yes/no. SESSION_ID, TEL_START: +skill-start echoes. ERROR_MESSAGE, FAILED_STEP: "" unless error. EXIT_REASON: +completed/user_stopped/blocked/tool_error/test_failed/context_limit/gave_up. +INVOKED: user/model/chained. MODEL_FAMILY (yours): claude_opus/claude_sonnet/ +claude_haiku/claude_other/gpt/gemini/other. CHECKS: passed/failed/not_run. No command +(stale install) — skip. ## Plan Status Footer diff --git a/scripts/resolvers/preamble/generate-completion-status.ts b/scripts/resolvers/preamble/generate-completion-status.ts index fc10a732c..09e7b8043 100644 --- a/scripts/resolvers/preamble/generate-completion-status.ts +++ b/scripts/resolvers/preamble/generate-completion-status.ts @@ -69,24 +69,24 @@ Do not log obvious facts or one-time transient errors. ## Telemetry (run last) -After workflow completion, log telemetry with 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). +When done, make ONE call — it also drains the artifacts-sync +queue (don't also run gstack-brain-sync). -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -\`$GSTACK_STATE_ROOT/analytics/\`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** writes telemetry to \`$GSTACK_STATE_ROOT/analytics/\`. \`\`\`bash ${ctx.paths.binDir}/gstack-skill-end --skill "${ctx.skillName}" --outcome OUTCOME \\ --session-id "SESSION_ID" --tel-start "TEL_START" --used-browse USED_BROWSE \\ - --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" 2>/dev/null || true + --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" \\ + --exit-reason EXIT_REASON --invoked INVOKED --model-family MODEL_FAMILY --checks CHECKS 2>/dev/null || true \`\`\` -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. +OUTCOME: success/error/abort/unknown. USED_BROWSE: yes/no. SESSION_ID, TEL_START: +skill-start echoes. ERROR_MESSAGE, FAILED_STEP: "" unless error. EXIT_REASON: +completed/user_stopped/blocked/tool_error/test_failed/context_limit/gave_up. +INVOKED: user/model/chained. MODEL_FAMILY (yours): claude_opus/claude_sonnet/ +claude_haiku/claude_other/gpt/gemini/other. CHECKS: passed/failed/not_run. No command +(stale install) — skip. ## Plan Status Footer diff --git a/setup-browser-cookies/SKILL.md b/setup-browser-cookies/SKILL.md index ad7de86f5..1934b7fc8 100644 --- a/setup-browser-cookies/SKILL.md +++ b/setup-browser-cookies/SKILL.md @@ -132,24 +132,24 @@ Do not log obvious facts or one-time transient errors. ## Telemetry (run last) -After workflow completion, log telemetry with 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). +When done, make ONE call — it also drains the artifacts-sync +queue (don't also run gstack-brain-sync). -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** writes telemetry to `$GSTACK_STATE_ROOT/analytics/`. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "setup-browser-cookies" --outcome OUTCOME \ --session-id "SESSION_ID" --tel-start "TEL_START" --used-browse USED_BROWSE \ - --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" 2>/dev/null || true + --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" \ + --exit-reason EXIT_REASON --invoked INVOKED --model-family MODEL_FAMILY --checks CHECKS 2>/dev/null || true ``` -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. +OUTCOME: success/error/abort/unknown. USED_BROWSE: yes/no. SESSION_ID, TEL_START: +skill-start echoes. ERROR_MESSAGE, FAILED_STEP: "" unless error. EXIT_REASON: +completed/user_stopped/blocked/tool_error/test_failed/context_limit/gave_up. +INVOKED: user/model/chained. MODEL_FAMILY (yours): claude_opus/claude_sonnet/ +claude_haiku/claude_other/gpt/gemini/other. CHECKS: passed/failed/not_run. No command +(stale install) — skip. ## Plan Status Footer diff --git a/setup-deploy/SKILL.md b/setup-deploy/SKILL.md index f8f48adde..86ea7de8a 100644 --- a/setup-deploy/SKILL.md +++ b/setup-deploy/SKILL.md @@ -85,24 +85,24 @@ Exit code 2 = rejected as not user-originated; do not retry. On success: "Set `< ## Telemetry (run last) -After workflow completion, log telemetry with 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). +When done, make ONE call — it also drains the artifacts-sync +queue (don't also run gstack-brain-sync). -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** writes telemetry to `$GSTACK_STATE_ROOT/analytics/`. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "setup-deploy" --outcome OUTCOME \ --session-id "SESSION_ID" --tel-start "TEL_START" --used-browse USED_BROWSE \ - --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" 2>/dev/null || true + --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" \ + --exit-reason EXIT_REASON --invoked INVOKED --model-family MODEL_FAMILY --checks CHECKS 2>/dev/null || true ``` -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. +OUTCOME: success/error/abort/unknown. USED_BROWSE: yes/no. SESSION_ID, TEL_START: +skill-start echoes. ERROR_MESSAGE, FAILED_STEP: "" unless error. EXIT_REASON: +completed/user_stopped/blocked/tool_error/test_failed/context_limit/gave_up. +INVOKED: user/model/chained. MODEL_FAMILY (yours): claude_opus/claude_sonnet/ +claude_haiku/claude_other/gpt/gemini/other. CHECKS: passed/failed/not_run. No command +(stale install) — skip. ## Third-Party Web Actions diff --git a/setup-gbrain/SKILL.md b/setup-gbrain/SKILL.md index b498dd106..9cbd9303b 100644 --- a/setup-gbrain/SKILL.md +++ b/setup-gbrain/SKILL.md @@ -87,24 +87,24 @@ Exit code 2 = rejected as not user-originated; do not retry. On success: "Set `< ## Telemetry (run last) -After workflow completion, log telemetry with 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). +When done, make ONE call — it also drains the artifacts-sync +queue (don't also run gstack-brain-sync). -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** writes telemetry to `$GSTACK_STATE_ROOT/analytics/`. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "setup-gbrain" --outcome OUTCOME \ --session-id "SESSION_ID" --tel-start "TEL_START" --used-browse USED_BROWSE \ - --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" 2>/dev/null || true + --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" \ + --exit-reason EXIT_REASON --invoked INVOKED --model-family MODEL_FAMILY --checks CHECKS 2>/dev/null || true ``` -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. +OUTCOME: success/error/abort/unknown. USED_BROWSE: yes/no. SESSION_ID, TEL_START: +skill-start echoes. ERROR_MESSAGE, FAILED_STEP: "" unless error. EXIT_REASON: +completed/user_stopped/blocked/tool_error/test_failed/context_limit/gave_up. +INVOKED: user/model/chained. MODEL_FAMILY (yours): claude_opus/claude_sonnet/ +claude_haiku/claude_other/gpt/gemini/other. CHECKS: passed/failed/not_run. No command +(stale install) — skip. # /setup-gbrain — Coding-Agent Onboarding for gbrain diff --git a/ship/SKILL.md b/ship/SKILL.md index fbc1b978b..4fabb920a 100644 --- a/ship/SKILL.md +++ b/ship/SKILL.md @@ -117,24 +117,24 @@ jq -nc --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg skill "SKILL_NAME" --arg ## Telemetry (run last) -After workflow completion, log telemetry with 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). +When done, make ONE call — it also drains the artifacts-sync +queue (don't also run gstack-brain-sync). -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** writes telemetry to `$GSTACK_STATE_ROOT/analytics/`. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "ship" --outcome OUTCOME \ --session-id "SESSION_ID" --tel-start "TEL_START" --used-browse USED_BROWSE \ - --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" 2>/dev/null || true + --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" \ + --exit-reason EXIT_REASON --invoked INVOKED --model-family MODEL_FAMILY --checks CHECKS 2>/dev/null || true ``` -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. +OUTCOME: success/error/abort/unknown. USED_BROWSE: yes/no. SESSION_ID, TEL_START: +skill-start echoes. ERROR_MESSAGE, FAILED_STEP: "" unless error. EXIT_REASON: +completed/user_stopped/blocked/tool_error/test_failed/context_limit/gave_up. +INVOKED: user/model/chained. MODEL_FAMILY (yours): claude_opus/claude_sonnet/ +claude_haiku/claude_other/gpt/gemini/other. CHECKS: passed/failed/not_run. No command +(stale install) — skip. ## Third-Party Web Actions diff --git a/skillify/SKILL.md b/skillify/SKILL.md index 99da95928..d0aa8ba91 100644 --- a/skillify/SKILL.md +++ b/skillify/SKILL.md @@ -83,24 +83,24 @@ Exit code 2 = rejected as not user-originated; do not retry. On success: "Set `< ## Telemetry (run last) -After workflow completion, log telemetry with 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). +When done, make ONE call — it also drains the artifacts-sync +queue (don't also run gstack-brain-sync). -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** writes telemetry to `$GSTACK_STATE_ROOT/analytics/`. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "skillify" --outcome OUTCOME \ --session-id "SESSION_ID" --tel-start "TEL_START" --used-browse USED_BROWSE \ - --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" 2>/dev/null || true + --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" \ + --exit-reason EXIT_REASON --invoked INVOKED --model-family MODEL_FAMILY --checks CHECKS 2>/dev/null || true ``` -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. +OUTCOME: success/error/abort/unknown. USED_BROWSE: yes/no. SESSION_ID, TEL_START: +skill-start echoes. ERROR_MESSAGE, FAILED_STEP: "" unless error. EXIT_REASON: +completed/user_stopped/blocked/tool_error/test_failed/context_limit/gave_up. +INVOKED: user/model/chained. MODEL_FAMILY (yours): claude_opus/claude_sonnet/ +claude_haiku/claude_other/gpt/gemini/other. CHECKS: passed/failed/not_run. No command +(stale install) — skip. # /skillify — codify the last scrape into a permanent skill diff --git a/spec/SKILL.md b/spec/SKILL.md index ea532978b..221352f54 100644 --- a/spec/SKILL.md +++ b/spec/SKILL.md @@ -116,24 +116,24 @@ jq -nc --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg skill "SKILL_NAME" --arg ## Telemetry (run last) -After workflow completion, log telemetry with 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). +When done, make ONE call — it also drains the artifacts-sync +queue (don't also run gstack-brain-sync). -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** writes telemetry to `$GSTACK_STATE_ROOT/analytics/`. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "spec" --outcome OUTCOME \ --session-id "SESSION_ID" --tel-start "TEL_START" --used-browse USED_BROWSE \ - --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" 2>/dev/null || true + --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" \ + --exit-reason EXIT_REASON --invoked INVOKED --model-family MODEL_FAMILY --checks CHECKS 2>/dev/null || true ``` -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. +OUTCOME: success/error/abort/unknown. USED_BROWSE: yes/no. SESSION_ID, TEL_START: +skill-start echoes. ERROR_MESSAGE, FAILED_STEP: "" unless error. EXIT_REASON: +completed/user_stopped/blocked/tool_error/test_failed/context_limit/gave_up. +INVOKED: user/model/chained. MODEL_FAMILY (yours): claude_opus/claude_sonnet/ +claude_haiku/claude_other/gpt/gemini/other. CHECKS: passed/failed/not_run. No command +(stale install) — skip. ## Third-Party Web Actions diff --git a/supabase/functions/telemetry-ingest/index.ts b/supabase/functions/telemetry-ingest/index.ts index 72eaedfd3..40d0a9cae 100644 --- a/supabase/functions/telemetry-ingest/index.ts +++ b/supabase/functions/telemetry-ingest/index.ts @@ -27,6 +27,55 @@ interface TelemetryEvent { security_confidence?: number; security_layer?: string; security_verdict?: string; + host?: string; + model_family?: string; + invoked?: string; + exit_reason?: string; + checks?: string; + routing?: string; + harness_session_id?: string; + from_version?: string; + upgrade_error?: string; +} + +// Fields from migration 009 (docs/privacy.md). Each is a pick from a fixed list +// the client also enforces, a 16-hex random session id, or a version; anything +// else is stored as null. Keep these lists equal to bin/gstack-telemetry-log's. +const NEXT_ENUMS: Record = { + host: ["claude_code", "codex", "cursor", "openclaw", "hermes", "other", "unknown"], + model_family: ["claude_opus", "claude_sonnet", "claude_haiku", "claude_other", "gpt", "gemini", "other", "unknown"], + invoked: ["user", "model", "chained", "unknown"], + exit_reason: ["completed", "user_stopped", "blocked", "tool_error", "test_failed", "context_limit", "gave_up", "unknown"], + checks: ["passed", "failed", "not_run", "unknown"], + routing: ["none", "block", "hooks", "both", "unknown"], + upgrade_error: ["none", "refused_dirty", "busy", "fetch_failed", "setup_failed", "other", "unknown"], +}; +const VERSION_RE = /^[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?$/; +function nextFields(event: TelemetryEvent) { + const out: Record = {}; + for (const [k, allowed] of Object.entries(NEXT_ENUMS)) { + const v = (event as unknown as Record)[k]; + out[k] = typeof v === "string" && allowed.includes(v) ? v : null; + } + out.harness_session_id = typeof event.harness_session_id === "string" && + /^[0-9a-f]{16}$/.test(event.harness_session_id) ? event.harness_session_id : null; + out.from_version = typeof event.from_version === "string" && VERSION_RE.test(event.from_version) + ? event.from_version : null; + return out; +} + +// outcome arrives in about ten spellings from older clients; store one of four +// and keep the original in outcome_raw when it differed. +const OUTCOME_MAP: Record = { + success: "success", ok: "success", done: "success", completed: "success", + error: "error", fail: "error", failed: "error", failure: "error", + abort: "abort", aborted: "abort", cancelled: "abort", canceled: "abort", + unknown: "unknown", +}; +function normalizeOutcome(outcome: unknown) { + const raw = String(outcome).slice(0, 20); + const norm = OUTCOME_MAP[raw.toLowerCase()] ?? "unknown"; + return { outcome: norm, outcome_raw: norm === raw ? null : raw }; } // bin/gstack-telemetry-log writes source from --source or @@ -136,7 +185,7 @@ Deno.serve(async (req) => { skill: event.skill ? String(event.skill).slice(0, 50) : null, session_id: event.session_id ? String(event.session_id).slice(0, 50) : null, duration_s: typeof event.duration_s === "number" ? event.duration_s : null, - outcome: String(event.outcome).slice(0, 20), + ...normalizeOutcome(event.outcome), error_class: event.error_class ? String(event.error_class).slice(0, 100) : null, error_message: event.error_message ? String(event.error_message).slice(0, 500) : null, failed_step: event.failed_step ? String(event.failed_step).slice(0, 100) : null, @@ -145,6 +194,7 @@ Deno.serve(async (req) => { installation_id: event.installation_id ? String(event.installation_id).slice(0, 64) : null, source: normalizeSource(event.source), ...(event.event_type === "attack_attempt" ? securityFields(event) : {}), + ...nextFields(event), }); // Track installations for upsert diff --git a/supabase/migrations/007_drop_unused_installation_columns.sql b/supabase/migrations/007_drop_unused_installation_columns.sql index 8cfebf3ac..29bf00020 100644 --- a/supabase/migrations/007_drop_unused_installation_columns.sql +++ b/supabase/migrations/007_drop_unused_installation_columns.sql @@ -4,8 +4,14 @@ -- config_snapshot, analytics_snapshot, retro_history, last_backup_at and -- backup_version. On 2026-11-19 all seven were empty in all 37,566 rows. -- An email column has no place in a telemetry table (docs/privacy.md: no --- personal data), so drop them. The guard refuses if any row holds a value, --- so this can never delete data; it does nothing where the columns are absent. +-- personal data), so drop them. The guard refuses if any row holds a value +-- (for backup_version, any value other than its default 0), so this can never +-- delete data; it does nothing where the columns are absent. +-- +-- The live project also carries three policies no migration here creates +-- (auth_read_own, auth_update_own, auth_write_own on installations). They key +-- on user_id, so the column cannot be dropped while they exist; nothing can use +-- them, because the authenticated role holds no grants (005). Drop them first. DO $$ DECLARE @@ -13,11 +19,15 @@ DECLARE filled bigint; BEGIN LOCK TABLE public.installations IN ACCESS EXCLUSIVE MODE; + DROP POLICY IF EXISTS auth_read_own ON public.installations; + DROP POLICY IF EXISTS auth_update_own ON public.installations; + DROP POLICY IF EXISTS auth_write_own ON public.installations; FOREACH col IN ARRAY ARRAY['user_id', 'email', 'config_snapshot', 'analytics_snapshot', 'retro_history', 'last_backup_at', 'backup_version'] LOOP IF EXISTS (SELECT 1 FROM information_schema.columns WHERE table_schema = 'public' AND table_name = 'installations' AND column_name = col) THEN - EXECUTE format('SELECT COUNT(*) FROM public.installations WHERE %I IS NOT NULL', col) INTO filled; + EXECUTE format('SELECT COUNT(*) FROM public.installations WHERE %I IS NOT NULL%s', col, + CASE WHEN col = 'backup_version' THEN ' AND backup_version <> 0' ELSE '' END) INTO filled; IF filled > 0 THEN RAISE EXCEPTION 'installations.% holds % values; refusing to drop it', col, filled; END IF; diff --git a/supabase/migrations/009_next_telemetry_fields.sql b/supabase/migrations/009_next_telemetry_fields.sql new file mode 100644 index 000000000..6d7a745e8 --- /dev/null +++ b/supabase/migrations/009_next_telemetry_fields.sql @@ -0,0 +1,59 @@ +-- 009_next_telemetry_fields.sql +-- The next telemetry fields (docs/privacy.md, "What each skill run sends"), +-- approved by Garry on 2026-11-19. Every new column is nullable and holds a +-- pick from a fixed list, a random 16-hex agent-session id or a version: no +-- free text. telemetry-ingest and bin/gstack-telemetry-log enforce the same +-- lists; the CHECKs here are the last line. +-- +-- Deploy order (each step only after the one before it): +-- 1. PR #4537's telemetry-ingest and migrations 004-006 and 008 (done live +-- 2026-11-19; 007 waits for this PR and is applied after step 4), +-- 2. this migration, +-- 3. this PR's telemetry-ingest (it writes these columns; deployed before +-- step 2, every insert fails and telemetry stalls until step 2 lands), +-- 4. the client release. Clients are safe in any order: an older ingest +-- ignores keys it does not know. + +ALTER TABLE telemetry_events + ADD COLUMN IF NOT EXISTS host TEXT CHECK (host IN ('claude_code', 'codex', 'cursor', 'openclaw', + 'hermes', 'other', 'unknown')), + ADD COLUMN IF NOT EXISTS model_family TEXT CHECK (model_family IN ('claude_opus', 'claude_sonnet', + 'claude_haiku', 'claude_other', 'gpt', 'gemini', 'other', 'unknown')), + ADD COLUMN IF NOT EXISTS invoked TEXT CHECK (invoked IN ('user', 'model', 'chained', 'unknown')), + ADD COLUMN IF NOT EXISTS exit_reason TEXT CHECK (exit_reason IN ('completed', 'user_stopped', 'blocked', + 'tool_error', 'test_failed', 'context_limit', 'gave_up', 'unknown')), + ADD COLUMN IF NOT EXISTS checks TEXT CHECK (checks IN ('passed', 'failed', 'not_run', 'unknown')), + ADD COLUMN IF NOT EXISTS routing TEXT CHECK (routing IN ('none', 'block', 'hooks', 'both', 'unknown')), + ADD COLUMN IF NOT EXISTS harness_session_id TEXT CHECK (harness_session_id ~ '^[0-9a-f]{16}$'), + ADD COLUMN IF NOT EXISTS from_version TEXT CHECK (from_version ~ '^[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?$'), + ADD COLUMN IF NOT EXISTS upgrade_error TEXT CHECK (upgrade_error IN ('none', 'refused_dirty', 'busy', + 'fetch_failed', 'setup_failed', 'other', 'unknown')), + ADD COLUMN IF NOT EXISTS outcome_raw TEXT; + +-- Skill sequences and reruns are counted per agent session on the server. +CREATE INDEX IF NOT EXISTS idx_telemetry_harness_session + ON telemetry_events (harness_session_id, event_timestamp) + WHERE harness_session_id IS NOT NULL; + +-- A view's SELECT * is fixed when it is created, so recreate 006's live view +-- (same filter) to carry the new columns. +CREATE OR REPLACE VIEW telemetry_live_events WITH (security_invoker = true) AS +SELECT * +FROM telemetry_events +WHERE source = 'live' + AND gstack_version ~ '^[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?$' + AND gstack_version NOT LIKE '0.0.0%' + AND event_type IN ('skill_run', 'upgrade_prompted', 'upgrade_completed', 'onboarding', + 'first_task_scaffold_shown', 'handoff', 'route', 'attack_attempt') + AND ( + (event_type = 'skill_run' AND session_id ~ '^[0-9]+-[0-9]+(-[0-9A-Za-z]+)?$') + OR (event_type = 'upgrade_prompted' AND session_id ~ '^update-[0-9]+-[0-9]+$') + OR event_type NOT IN ('skill_run', 'upgrade_prompted') + ); + +-- On the hosted project, objects postgres creates give service_role no SELECT +-- by default, so the pulse function (security invoker, called with the +-- service-role key) needs these explicitly. Applied live with 006 on 2026-11-19. +REVOKE ALL ON telemetry_live_events FROM PUBLIC, anon, authenticated; +GRANT SELECT ON telemetry_live_events TO service_role; +GRANT SELECT, INSERT, UPDATE ON community_pulse_cache TO service_role; diff --git a/sync-gbrain/SKILL.md b/sync-gbrain/SKILL.md index cafcf877a..06db3b5d6 100644 --- a/sync-gbrain/SKILL.md +++ b/sync-gbrain/SKILL.md @@ -86,24 +86,24 @@ Exit code 2 = rejected as not user-originated; do not retry. On success: "Set `< ## Telemetry (run last) -After workflow completion, log telemetry with 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). +When done, make ONE call — it also drains the artifacts-sync +queue (don't also run gstack-brain-sync). -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** writes telemetry to `$GSTACK_STATE_ROOT/analytics/`. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "sync-gbrain" --outcome OUTCOME \ --session-id "SESSION_ID" --tel-start "TEL_START" --used-browse USED_BROWSE \ - --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" 2>/dev/null || true + --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" \ + --exit-reason EXIT_REASON --invoked INVOKED --model-family MODEL_FAMILY --checks CHECKS 2>/dev/null || true ``` -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. +OUTCOME: success/error/abort/unknown. USED_BROWSE: yes/no. SESSION_ID, TEL_START: +skill-start echoes. ERROR_MESSAGE, FAILED_STEP: "" unless error. EXIT_REASON: +completed/user_stopped/blocked/tool_error/test_failed/context_limit/gave_up. +INVOKED: user/model/chained. MODEL_FAMILY (yours): claude_opus/claude_sonnet/ +claude_haiku/claude_other/gpt/gemini/other. CHECKS: passed/failed/not_run. No command +(stale install) — skip. # /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 576b98b77..feee1f137 100644 --- a/test-audit/SKILL.md +++ b/test-audit/SKILL.md @@ -85,24 +85,24 @@ Exit code 2 = rejected as not user-originated; do not retry. On success: "Set `< ## Telemetry (run last) -After workflow completion, log telemetry with 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). +When done, make ONE call — it also drains the artifacts-sync +queue (don't also run gstack-brain-sync). -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** writes telemetry to `$GSTACK_STATE_ROOT/analytics/`. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "test-audit" --outcome OUTCOME \ --session-id "SESSION_ID" --tel-start "TEL_START" --used-browse USED_BROWSE \ - --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" 2>/dev/null || true + --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" \ + --exit-reason EXIT_REASON --invoked INVOKED --model-family MODEL_FAMILY --checks CHECKS 2>/dev/null || true ``` -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. +OUTCOME: success/error/abort/unknown. USED_BROWSE: yes/no. SESSION_ID, TEL_START: +skill-start echoes. ERROR_MESSAGE, FAILED_STEP: "" unless error. EXIT_REASON: +completed/user_stopped/blocked/tool_error/test_failed/context_limit/gave_up. +INVOKED: user/model/chained. MODEL_FAMILY (yours): claude_opus/claude_sonnet/ +claude_haiku/claude_other/gpt/gemini/other. CHECKS: passed/failed/not_run. No command +(stale install) — skip. # /test-audit: Test value sweep diff --git a/test/fixtures/golden/agy-ship-SKILL.md b/test/fixtures/golden/agy-ship-SKILL.md index 7cc920a1f..6487b8172 100644 --- a/test/fixtures/golden/agy-ship-SKILL.md +++ b/test/fixtures/golden/agy-ship-SKILL.md @@ -110,26 +110,26 @@ jq -nc --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg skill "SKILL_NAME" --arg ## Telemetry (run last) -After workflow completion, log telemetry with 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). +When done, make ONE call — it also drains the artifacts-sync +queue (don't also run gstack-brain-sync). -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** writes telemetry to `$GSTACK_STATE_ROOT/analytics/`. ```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;} GSTACK_BIN=$GSTACK_ROOT/bin $GSTACK_BIN/gstack-skill-end --skill "ship" --outcome OUTCOME \ --session-id "SESSION_ID" --tel-start "TEL_START" --used-browse USED_BROWSE \ - --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" 2>/dev/null || true + --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" \ + --exit-reason EXIT_REASON --invoked INVOKED --model-family MODEL_FAMILY --checks CHECKS 2>/dev/null || true ``` -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. +OUTCOME: success/error/abort/unknown. USED_BROWSE: yes/no. SESSION_ID, TEL_START: +skill-start echoes. ERROR_MESSAGE, FAILED_STEP: "" unless error. EXIT_REASON: +completed/user_stopped/blocked/tool_error/test_failed/context_limit/gave_up. +INVOKED: user/model/chained. MODEL_FAMILY (yours): claude_opus/claude_sonnet/ +claude_haiku/claude_other/gpt/gemini/other. CHECKS: passed/failed/not_run. No command +(stale install) — skip. ## Third-Party Web Actions diff --git a/test/fixtures/golden/claude-ship-SKILL.md b/test/fixtures/golden/claude-ship-SKILL.md index fbc1b978b..4fabb920a 100644 --- a/test/fixtures/golden/claude-ship-SKILL.md +++ b/test/fixtures/golden/claude-ship-SKILL.md @@ -117,24 +117,24 @@ jq -nc --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg skill "SKILL_NAME" --arg ## Telemetry (run last) -After workflow completion, log telemetry with 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). +When done, make ONE call — it also drains the artifacts-sync +queue (don't also run gstack-brain-sync). -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** writes telemetry to `$GSTACK_STATE_ROOT/analytics/`. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "ship" --outcome OUTCOME \ --session-id "SESSION_ID" --tel-start "TEL_START" --used-browse USED_BROWSE \ - --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" 2>/dev/null || true + --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" \ + --exit-reason EXIT_REASON --invoked INVOKED --model-family MODEL_FAMILY --checks CHECKS 2>/dev/null || true ``` -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. +OUTCOME: success/error/abort/unknown. USED_BROWSE: yes/no. SESSION_ID, TEL_START: +skill-start echoes. ERROR_MESSAGE, FAILED_STEP: "" unless error. EXIT_REASON: +completed/user_stopped/blocked/tool_error/test_failed/context_limit/gave_up. +INVOKED: user/model/chained. MODEL_FAMILY (yours): claude_opus/claude_sonnet/ +claude_haiku/claude_other/gpt/gemini/other. CHECKS: passed/failed/not_run. No command +(stale install) — skip. ## Third-Party Web Actions diff --git a/test/fixtures/golden/codex-ship-SKILL.md b/test/fixtures/golden/codex-ship-SKILL.md index 0f3269c45..e2188acbe 100644 --- a/test/fixtures/golden/codex-ship-SKILL.md +++ b/test/fixtures/golden/codex-ship-SKILL.md @@ -108,26 +108,26 @@ jq -nc --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg skill "SKILL_NAME" --arg ## Telemetry (run last) -After workflow completion, log telemetry with 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). +When done, make ONE call — it also drains the artifacts-sync +queue (don't also run gstack-brain-sync). -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** writes telemetry to `$GSTACK_STATE_ROOT/analytics/`. ```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;} GSTACK_BIN=$GSTACK_ROOT/bin $GSTACK_BIN/gstack-skill-end --skill "ship" --outcome OUTCOME \ --session-id "SESSION_ID" --tel-start "TEL_START" --used-browse USED_BROWSE \ - --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" 2>/dev/null || true + --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" \ + --exit-reason EXIT_REASON --invoked INVOKED --model-family MODEL_FAMILY --checks CHECKS 2>/dev/null || true ``` -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. +OUTCOME: success/error/abort/unknown. USED_BROWSE: yes/no. SESSION_ID, TEL_START: +skill-start echoes. ERROR_MESSAGE, FAILED_STEP: "" unless error. EXIT_REASON: +completed/user_stopped/blocked/tool_error/test_failed/context_limit/gave_up. +INVOKED: user/model/chained. MODEL_FAMILY (yours): claude_opus/claude_sonnet/ +claude_haiku/claude_other/gpt/gemini/other. CHECKS: passed/failed/not_run. No command +(stale install) — skip. ## Third-Party Web Actions diff --git a/test/fixtures/golden/factory-ship-SKILL.md b/test/fixtures/golden/factory-ship-SKILL.md index 46e851d32..0e03a65f4 100644 --- a/test/fixtures/golden/factory-ship-SKILL.md +++ b/test/fixtures/golden/factory-ship-SKILL.md @@ -110,26 +110,26 @@ jq -nc --arg ts "$(date -u +%Y-%m-%dT%H:%M:%SZ)" --arg skill "SKILL_NAME" --arg ## Telemetry (run last) -After workflow completion, log telemetry with 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). +When done, make ONE call — it also drains the artifacts-sync +queue (don't also run gstack-brain-sync). -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** writes telemetry to `$GSTACK_STATE_ROOT/analytics/`. ```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;} GSTACK_BIN=$GSTACK_ROOT/bin $GSTACK_BIN/gstack-skill-end --skill "ship" --outcome OUTCOME \ --session-id "SESSION_ID" --tel-start "TEL_START" --used-browse USED_BROWSE \ - --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" 2>/dev/null || true + --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" \ + --exit-reason EXIT_REASON --invoked INVOKED --model-family MODEL_FAMILY --checks CHECKS 2>/dev/null || true ``` -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. +OUTCOME: success/error/abort/unknown. USED_BROWSE: yes/no. SESSION_ID, TEL_START: +skill-start echoes. ERROR_MESSAGE, FAILED_STEP: "" unless error. EXIT_REASON: +completed/user_stopped/blocked/tool_error/test_failed/context_limit/gave_up. +INVOKED: user/model/chained. MODEL_FAMILY (yours): claude_opus/claude_sonnet/ +claude_haiku/claude_other/gpt/gemini/other. CHECKS: passed/failed/not_run. No command +(stale install) — skip. ## Third-Party Web Actions diff --git a/test/gstack-upgrade-bin.test.ts b/test/gstack-upgrade-bin.test.ts index fe1d98c49..fa89a572e 100644 --- a/test/gstack-upgrade-bin.test.ts +++ b/test/gstack-upgrade-bin.test.ts @@ -130,6 +130,27 @@ describe('gstack-upgrade', () => { expect(f.run().stdout).toContain('gstack-upgrade: current 1.0.1'); }); + test('telemetry: one upgrade_completed per run with its upgrade_error and from-version; --check sends nothing', () => { + const f = fixture(); + const telLog = path.join(f.host.base, 'calls.log.tel'); + write(path.join(f.root, 'bin/gstack-telemetry-log'), '#!/usr/bin/env bash\necho "$*" >> "$UPGRADE_LOG.tel"\n', 0o755); + const tel = () => fs.existsSync(telLog) ? fs.readFileSync(telLog, 'utf8').trim().split('\n').filter(Boolean) : []; + expect(f.run(['--check']).status).toBe(1); + expect(tel()).toEqual([]); + fs.writeFileSync(path.join(f.root, 'README.md'), 'local edit\n'); + expect(f.run().status).toBe(3); + f.git(['checkout', '--', 'README.md']); + expect(f.run([], { STUB_SETUP_EXIT: '1' }).status).toBe(1); + const retry = f.run(); + expect(retry.status, retry.stdout + retry.stderr).toBe(0); + const ev = '--no-sweep --event-type upgrade_completed'; + expect(tel()).toEqual([ + `${ev} --outcome error --from-version 1.0.0 --upgrade-error refused_dirty`, + `${ev} --outcome error --from-version 1.0.0 --upgrade-error setup_failed`, + `${ev} --outcome success --from-version 1.0.0 --upgrade-error none`, + ]); + }); + test('a Capy install (the installer marker) runs bin/gstack-capy-install instead of setup', () => { const f = fixture(); write(path.join(f.root, 'bin/gstack-capy-install'), '#!/usr/bin/env bash\necho "capy-install $*" >> "$UPGRADE_LOG"\necho "gstack: ok $(cat VERSION) for=autoplan"\n', 0o755); diff --git a/test/next-telemetry-fields.test.ts b/test/next-telemetry-fields.test.ts new file mode 100644 index 000000000..2fa557b6a --- /dev/null +++ b/test/next-telemetry-fields.test.ts @@ -0,0 +1,165 @@ +/** The next telemetry fields (docs/privacy.md, migration 009) as the client + * writes them: fixed lists, a random per-agent-session id, and a source label + * an explicit setting always wins. Network is stubbed; nothing leaves the box. */ +import { afterEach, beforeEach, describe, expect, test } from 'bun:test'; +import { spawn, spawnSync } from 'child_process'; +import * as fs from 'fs'; +import * as os from 'os'; +import * as path from 'path'; + +const ROOT = path.resolve(import.meta.dir, '..'); +const BIN = path.join(ROOT, 'bin'); +let tmp: string; + +function env(extra: Record = {}): Record { + return { + ...process.env as Record, + HOME: path.join(tmp, 'home'), GSTACK_HOME: tmp, GSTACK_STATE_ROOT: tmp, GSTACK_STATE_DIR: tmp, + GSTACK_DIR: ROOT, GSTACK_SUPABASE_URL: 'https://telemetry.fixture.invalid', GSTACK_SUPABASE_ANON_KEY: 'fixture', + GSTACK_TEST_BLOCK_LIVE_TELEMETRY: '1', GSTACK_SESSION_KIND: 'interactive', + CI: '', GSTACK_TELEMETRY_SOURCE: '', EVALS_RUN_ID: '', GSTACK_EVAL_DIR: '', + GSTACK_ACTIVE_HOST: '', CLAUDECODE: '', CODEX_THREAD_ID: '', + PATH: `${path.join(tmp, 'bin')}:${process.env.PATH}`, + ...extra, + }; +} +function run(bin: string, args: string[], extra: Record = {}) { + const r = spawnSync(path.join(BIN, bin), args, { cwd: tmp, env: env(extra), encoding: 'utf-8', timeout: 20_000 }); + expect(r.status).toBe(0); + return r.stdout; +} +function events(): any[] { + const f = path.join(tmp, 'analytics', 'skill-usage.jsonl'); + const lines = fs.existsSync(f) ? fs.readFileSync(f, 'utf-8').trim().split('\n').filter(Boolean).map(l => JSON.parse(l)) : []; + return lines.filter(e => e.v === 1); +} +async function eventually(n: number): Promise { + for (let i = 0; i < 50 && events().length < n; i++) await Bun.sleep(100); + return events(); +} + +beforeEach(() => { + tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'gstack-nexttel-')); + fs.mkdirSync(path.join(tmp, 'home')); + fs.mkdirSync(path.join(tmp, 'bin')); + fs.writeFileSync(path.join(tmp, 'bin', 'curl'), '#!/bin/sh\nprintf 200\n', { mode: 0o755 }); + run('gstack-config', ['set', 'telemetry', 'anonymous']); +}); +afterEach(() => { fs.rmSync(tmp, { recursive: true, force: true }); }); + +describe.skipIf(process.platform === 'win32')('gstack-telemetry-log next fields', () => { + test('fixed-list fields pass through, off-list values become unknown, absent ones null', () => { + run('gstack-telemetry-log', ['--skill', 'qa', '--outcome', 'success', '--host', 'codex', '--model-family', 'gpt', + '--invoked', 'model', '--exit-reason', 'rm -rf /', '--checks', 'passed', '--routing', 'block']); + const [e] = events(); + expect([e.host, e.model_family, e.invoked, e.exit_reason, e.checks, e.routing]).toEqual(['codex', 'gpt', 'model', 'unknown', 'passed', 'block']); + expect([e.harness_session_id, e.from_version, e.upgrade_error]).toEqual([null, null, null]); + }); + + test('the session id must be 16 hex and from_version a version, or they are dropped', () => { + run('gstack-telemetry-log', ['--event-type', 'upgrade_completed', '--outcome', 'error', '--harness-session', '0123456789abcdef', + '--from-version', '1.2.3.4', '--upgrade-error', 'busy']); + run('gstack-telemetry-log', ['--outcome', 'success', '--harness-session', 'not-a-session-id', '--from-version', '1.2; DROP']); + const [a, b] = events(); + expect([a.harness_session_id, a.from_version, a.upgrade_error]).toEqual(['0123456789abcdef', '1.2.3.4', 'busy']); + expect([b.harness_session_id, b.from_version]).toEqual([null, null]); + }); + + test('source: flag > GSTACK_TELEMETRY_SOURCE > eval run > CI > live, so CI never relabels a test row', () => { + run('gstack-telemetry-log', ['--outcome', 'success', '--source', 'test'], { CI: 'true', EVALS_RUN_ID: 'r1' }); + run('gstack-telemetry-log', ['--outcome', 'success'], { CI: 'true', GSTACK_TELEMETRY_SOURCE: 'test' }); + run('gstack-telemetry-log', ['--outcome', 'success'], { CI: 'true', EVALS_RUN_ID: 'r1' }); + run('gstack-telemetry-log', ['--outcome', 'success'], { CI: 'true' }); + run('gstack-telemetry-log', ['--outcome', 'success']); + expect(events().map(e => e.source)).toEqual(['test', 'test', 'eval', 'ci', 'live']); + }); +}); + +describe.skipIf(process.platform === 'win32')('gstack-skill-end next fields', () => { + test('one random id per harness process, kept in its sessions marker without adding a session', async () => { + fs.mkdirSync(path.join(tmp, 'sessions')); + const marker = path.join(tmp, 'sessions', '4242'); + fs.writeFileSync(marker, ''); + const args = ['--skill', 'qa', '--outcome', 'success', '--session-id', '4242-1700000000-1', '--tel-start', '1700000000', + '--exit-reason', 'completed', '--invoked', 'user', '--model-family', 'claude_opus', '--checks', 'not_run']; + run('gstack-skill-end', args, { CLAUDECODE: '1' }); + run('gstack-skill-end', args, { CLAUDECODE: '1' }); + const [a, b] = await eventually(2); + expect(a.harness_session_id).toMatch(/^[0-9a-f]{16}$/); + expect(b.harness_session_id).toBe(a.harness_session_id); + expect(fs.readFileSync(marker, 'utf-8')).toBe(a.harness_session_id); + expect(fs.readdirSync(path.join(tmp, 'sessions'))).toEqual(['4242']); + expect([a.host, a.exit_reason, a.invoked, a.model_family, a.checks, a.routing]).toEqual(['claude_code', 'completed', 'user', 'claude_opus', 'not_run', 'none']); + }); + + test('under a shared harness (capy-server) every session has one pid, so no session id is sent', async () => { + fs.copyFileSync('/bin/sleep', path.join(tmp, 'capy-server')); + fs.chmodSync(path.join(tmp, 'capy-server'), 0o755); + const harness = spawn(path.join(tmp, 'capy-server'), ['30'], { stdio: 'ignore' }); + try { + fs.mkdirSync(path.join(tmp, 'sessions')); + fs.writeFileSync(path.join(tmp, 'sessions', String(harness.pid)), ''); + run('gstack-skill-end', ['--skill', 'qa', '--outcome', 'success', '--session-id', `${harness.pid}-1700000000-1`, '--tel-start', '1700000000']); + const [e] = await eventually(1); + expect(e.harness_session_id).toBeNull(); + expect(fs.readFileSync(path.join(tmp, 'sessions', String(harness.pid)), 'utf-8')).toBe(''); + } finally { harness.kill('SIGKILL'); } + }); + + test('a recycled pid with a stale marker gets a new session id, never the old one', async () => { + fs.appendFileSync(path.join(tmp, 'config.yaml'), 'update_check: false\n'); + fs.mkdirSync(path.join(tmp, 'sessions')); + const marker = path.join(tmp, 'sessions', '4343'); + fs.writeFileSync(marker, 'aaaaaaaaaaaaaaaa'); + const threeHoursAgo = new Date(Date.now() - 3 * 3600_000); + fs.utimesSync(marker, threeHoursAgo, threeHoursAgo); + run('gstack-skill-start', ['--skill', 'qa', '--parent-pid', '4343']); + expect(fs.readFileSync(marker, 'utf-8')).toBe(''); + run('gstack-skill-end', ['--skill', 'qa', '--outcome', 'success', '--session-id', '4343-1700000000-1', '--tel-start', '1700000000'], { CLAUDECODE: '1' }); + const [e] = await eventually(1); + expect(e.harness_session_id).toMatch(/^[0-9a-f]{16}$/); + expect(e.harness_session_id).not.toBe('aaaaaaaaaaaaaaaa'); + }, 30_000); + + test('an unknown start time sends a null duration, not 0', async () => { + const out = run('gstack-skill-end', ['--skill', 'qa', '--outcome', 'success', '--session-id', '99-1']); + expect(out).toContain('duration_s=unknown'); + const [e] = await eventually(1); + expect(e.duration_s).toBeNull(); + }); +}); + +describe.skipIf(process.platform === 'win32')('gstack-telemetry-sync batch size', () => { + test('a backlog of full-size events is sent in bodies under ingest\'s 50,000-byte limit', () => { + fs.writeFileSync(path.join(tmp, 'bin', 'curl'), + '#!/bin/sh\nfor a in "$@"; do case "$a" in @*) wc -c < "${a#@}" >> "$SIZES" ;; esac; done\nprintf 500\n', { mode: 0o755 }); + const event = JSON.stringify({ v: 1, ts: '2026-11-19T21:00:00Z', event_type: 'skill_run', skill: 'plan-design-review', session_id: '12345-1763600000-abc', + gstack_version: '1.102.0.0', os: 'darwin', arch: 'arm64', duration_s: 1234, outcome: 'success', error_class: null, error_message: null, failed_step: null, + used_browse: false, sessions: 1, installation_id: null, source: 'live', security_url_domain: null, security_payload_hash: null, security_confidence: null, + security_layer: null, security_verdict: null, host: 'claude_code', model_family: 'claude_opus', invoked: 'user', exit_reason: 'completed', checks: 'passed', + routing: 'both', harness_session_id: '0123456789abcdef', from_version: null, upgrade_error: null, _repo_slug: 'owner/repo', _branch: 'main' }); + fs.mkdirSync(path.join(tmp, 'analytics'), { recursive: true }); + fs.writeFileSync(path.join(tmp, 'analytics', 'skill-usage.jsonl'), `${event}\n`.repeat(120)); + const sizes = path.join(tmp, 'sizes'); + run('gstack-telemetry-sync', [], { SIZES: sizes }); + const sent = fs.readFileSync(sizes, 'utf-8').trim().split('\n').map(Number); + expect(sent).toHaveLength(1); + expect(sent[0]).toBeGreaterThan(40_000); + expect(sent[0]).toBeLessThanOrEqual(45_000); + }); + + test('multi-byte events are measured in bytes, so the body stays under the limit', () => { + fs.writeFileSync(path.join(tmp, 'bin', 'curl'), + '#!/bin/sh\nfor a in "$@"; do case "$a" in @*) wc -c < "${a#@}" >> "$SIZES" ;; esac; done\nprintf 500\n', { mode: 0o755 }); + const event = JSON.stringify({ v: 1, ts: '2026-11-19T21:00:00Z', event_type: 'skill_run', skill: 'qa', session_id: '12345-1763600000-abc', + outcome: 'error', error_message: '\u20ac'.repeat(300), source: 'live', host: 'claude_code' }); + fs.mkdirSync(path.join(tmp, 'analytics'), { recursive: true }); + fs.writeFileSync(path.join(tmp, 'analytics', 'skill-usage.jsonl'), `${event}\n`.repeat(100)); + const sizes = path.join(tmp, 'sizes'); + run('gstack-telemetry-sync', [], { SIZES: sizes, LC_ALL: process.platform === 'darwin' ? 'en_US.UTF-8' : 'C.UTF-8' }); + const sent = fs.readFileSync(sizes, 'utf-8').trim().split('\n').map(Number); + expect(sent).toHaveLength(1); + expect(sent[0]).toBeGreaterThan(40_000); + expect(sent[0]).toBeLessThanOrEqual(45_000); + }); +}); diff --git a/test/supabase-telemetry-schema.test.ts b/test/supabase-telemetry-schema.test.ts index b044d67e9..62544085f 100644 --- a/test/supabase-telemetry-schema.test.ts +++ b/test/supabase-telemetry-schema.test.ts @@ -94,3 +94,55 @@ describe('migrations keep the public key and signed-in users out', () => { expect([...created].filter(p => /^anon_(insert|update)/.test(p))).toEqual([]); }); }); + +describe('the next telemetry fields stay in step across client, ingest and schema', () => { + const LOG = fs.readFileSync(path.join(ROOT, 'bin', 'gstack-telemetry-log'), 'utf-8'); + const sql = fs.readFileSync(path.join(MIGRATIONS, '009_next_telemetry_fields.sql'), 'utf-8'); + const ingestEnums = (field: string) => { + const m = INGEST.match(new RegExp(`${field}: \\[([^\\]]*)\\]`)); + return [...(m?.[1] ?? '').matchAll(/"([a-z_]+)"/g)].map(x => x[1]).sort(); + }; + const fields: Array<[string, string]> = [['host', 'HOST_FIELD'], ['model_family', 'MODEL_FIELD'], ['invoked', 'INVOKED_FIELD'], + ['exit_reason', 'EXIT_FIELD'], ['checks', 'CHECKS_FIELD'], ['routing', 'ROUTING_FIELD'], ['upgrade_error', 'UPGRADE_ERR_FIELD']]; + + test('each fixed list is the same in the client, the ingest and the CHECK (plus unknown)', () => { + for (const [col, v] of fields) { + const client = (LOG.match(new RegExp(`${v}="\\$\\(enum_field "\\$[A-Z_]+" ([^)]*)\\)"`))?.[1] ?? '').split(' ').filter(Boolean); + const check = [...(sql.match(new RegExp(`ADD COLUMN IF NOT EXISTS ${col} TEXT CHECK \\(${col} IN \\(([^)]*)\\)`))?.[1] ?? '').matchAll(/'([a-z_]+)'/g)].map(x => x[1]); + expect(client.length, col).toBeGreaterThan(2); + expect(ingestEnums(col), col).toEqual([...client, 'unknown'].sort()); + expect(check.sort(), col).toEqual([...client, 'unknown'].sort()); + } + }); + + test('every column the ingest writes is added by a migration', () => { + const cols = new Set(); + for (const f of fs.readdirSync(MIGRATIONS).filter(x => x.endsWith('.sql'))) { + const text = fs.readFileSync(path.join(MIGRATIONS, f), 'utf-8'); + const table = text.match(/CREATE TABLE telemetry_events \(([\s\S]*?)\n\);/)?.[1] ?? ''; + for (const m of table.matchAll(/^\s+([a-z_]+)\s+[A-Z]/gm)) cols.add(m[1]); + for (const m of text.matchAll(/ADD COLUMN IF NOT EXISTS ([a-z_]+)/g)) cols.add(m[1]); + } + const rows = INGEST.match(/rows\.push\(\{([\s\S]*?)\n\s*\}\);/)?.[1] ?? ''; + const written = [...rows.matchAll(/^\s+([a-z_]+):/gm)].map(m => m[1]) + .concat(Object.keys({ outcome: 1, outcome_raw: 1, harness_session_id: 1, from_version: 1 })) + .concat(fields.map(([c]) => c)) + .concat(['security_url_domain', 'security_payload_hash', 'security_confidence', 'security_layer', 'security_verdict']); + expect(written.length).toBeGreaterThan(25); + expect(written.filter(c => !cols.has(c))).toEqual([]); + }); + + test('009 gives the backend role what the pulse needs and nobody else anything', () => { + expect(sql).toContain('GRANT SELECT ON telemetry_live_events TO service_role;'); + expect(sql).toContain('GRANT SELECT, INSERT, UPDATE ON community_pulse_cache TO service_role;'); + expect(sql).not.toMatch(/GRANT [^;]* TO [^;]*\b(anon|authenticated|PUBLIC)\b/i); + }); + + test('007 drops the live-only user_id policies before the columns, and treats backup_version 0 as empty', () => { + const s007 = fs.readFileSync(path.join(MIGRATIONS, '007_drop_unused_installation_columns.sql'), 'utf-8'); + const drops = ['auth_read_own', 'auth_update_own', 'auth_write_own'].map(p => s007.indexOf(`DROP POLICY IF EXISTS ${p} ON public.installations`)); + expect(drops.every(i => i > 0 && i < s007.indexOf('DROP COLUMN'))).toBe(true); + expect(s007).toContain("CASE WHEN col = 'backup_version' THEN ' AND backup_version <> 0' ELSE '' END"); + }); +}); + diff --git a/ubicloud/SKILL.md b/ubicloud/SKILL.md index e7c5c6fd9..a6ba4f60c 100644 --- a/ubicloud/SKILL.md +++ b/ubicloud/SKILL.md @@ -83,24 +83,24 @@ Exit code 2 = rejected as not user-originated; do not retry. On success: "Set `< ## Telemetry (run last) -After workflow completion, log telemetry with 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). +When done, make ONE call — it also drains the artifacts-sync +queue (don't also run gstack-brain-sync). -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** writes telemetry to `$GSTACK_STATE_ROOT/analytics/`. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "ubicloud" --outcome OUTCOME \ --session-id "SESSION_ID" --tel-start "TEL_START" --used-browse USED_BROWSE \ - --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" 2>/dev/null || true + --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" \ + --exit-reason EXIT_REASON --invoked INVOKED --model-family MODEL_FAMILY --checks CHECKS 2>/dev/null || true ``` -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. +OUTCOME: success/error/abort/unknown. USED_BROWSE: yes/no. SESSION_ID, TEL_START: +skill-start echoes. ERROR_MESSAGE, FAILED_STEP: "" unless error. EXIT_REASON: +completed/user_stopped/blocked/tool_error/test_failed/context_limit/gave_up. +INVOKED: user/model/chained. MODEL_FAMILY (yours): claude_opus/claude_sonnet/ +claude_haiku/claude_other/gpt/gemini/other. CHECKS: passed/failed/not_run. No command +(stale install) — skip. --- diff --git a/verify/SKILL.md b/verify/SKILL.md index 4256279c8..f132cd2d5 100644 --- a/verify/SKILL.md +++ b/verify/SKILL.md @@ -158,24 +158,24 @@ Do not log obvious facts or one-time transient errors. ## Telemetry (run last) -After workflow completion, log telemetry with 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). +When done, make ONE call — it also drains the artifacts-sync +queue (don't also run gstack-brain-sync). -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** writes telemetry to `$GSTACK_STATE_ROOT/analytics/`. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "verify" --outcome OUTCOME \ --session-id "SESSION_ID" --tel-start "TEL_START" --used-browse USED_BROWSE \ - --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" 2>/dev/null || true + --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" \ + --exit-reason EXIT_REASON --invoked INVOKED --model-family MODEL_FAMILY --checks CHECKS 2>/dev/null || true ``` -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. +OUTCOME: success/error/abort/unknown. USED_BROWSE: yes/no. SESSION_ID, TEL_START: +skill-start echoes. ERROR_MESSAGE, FAILED_STEP: "" unless error. EXIT_REASON: +completed/user_stopped/blocked/tool_error/test_failed/context_limit/gave_up. +INVOKED: user/model/chained. MODEL_FAMILY (yours): claude_opus/claude_sonnet/ +claude_haiku/claude_other/gpt/gemini/other. CHECKS: passed/failed/not_run. No command +(stale install) — skip. ## Plan Status Footer diff --git a/write-skill/SKILL.md b/write-skill/SKILL.md index f74aaf92d..2f72b267b 100644 --- a/write-skill/SKILL.md +++ b/write-skill/SKILL.md @@ -86,24 +86,24 @@ Exit code 2 = rejected as not user-originated; do not retry. On success: "Set `< ## Telemetry (run last) -After workflow completion, log telemetry with 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). +When done, make ONE call — it also drains the artifacts-sync +queue (don't also run gstack-brain-sync). -**PLAN MODE EXCEPTION — ALWAYS RUN:** This writes telemetry to -`$GSTACK_STATE_ROOT/analytics/`, matching preamble analytics writes. +**PLAN MODE EXCEPTION — ALWAYS RUN:** writes telemetry to `$GSTACK_STATE_ROOT/analytics/`. ```bash ~/.claude/skills/gstack/bin/gstack-skill-end --skill "write-skill" --outcome OUTCOME \ --session-id "SESSION_ID" --tel-start "TEL_START" --used-browse USED_BROWSE \ - --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" 2>/dev/null || true + --error-message "ERROR_MESSAGE" --failed-step "FAILED_STEP" \ + --exit-reason EXIT_REASON --invoked INVOKED --model-family MODEL_FAMILY --checks CHECKS 2>/dev/null || true ``` -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. +OUTCOME: success/error/abort/unknown. USED_BROWSE: yes/no. SESSION_ID, TEL_START: +skill-start echoes. ERROR_MESSAGE, FAILED_STEP: "" unless error. EXIT_REASON: +completed/user_stopped/blocked/tool_error/test_failed/context_limit/gave_up. +INVOKED: user/model/chained. MODEL_FAMILY (yours): claude_opus/claude_sonnet/ +claude_haiku/claude_other/gpt/gemini/other. CHECKS: passed/failed/not_run. No command +(stale install) — skip. # /write-skill: write and improve skills, lean