mirror of
https://github.com/garrytan/gstack.git
synced 2026-09-17 18:32:19 +02:00
fix(resolvers): question-log session_id becomes a substitution placeholder + stale-comment sweep
The question-log block bound $_SESSION_ID, a shell variable the consolidated fence never sets — hook-less hosts logged empty session_id, breaking /plan-tune per-session grouping. It now uses the same substitute-from-the-skill-start-echoes contract as the telemetry block. Also: retired the pre-Phase-2 stop-gate docstring, repointed the gbrain-local-status cross-reference at the script's inline jq, dropped an orphaned section comment, documented retro-metrics' suffix-only census. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
46d158c5ed
commit
49321ce71f
@@ -297,6 +297,9 @@ echo "PRS_REFERENCED: $(printf '%s' "$_PRS" | wc -w | tr -d ' ')"
|
|||||||
[ -n "$_PRS" ] && echo "PR_REFS: $_PRS" || true
|
[ -n "$_PRS" ] && echo "PR_REFS: $_PRS" || true
|
||||||
|
|
||||||
# ── Test health (repo-wide + window) ─────────────────────────────────────────
|
# ── Test health (repo-wide + window) ─────────────────────────────────────────
|
||||||
|
# Deliberately suffix-only (narrower than is_test's dir-based patterns): the
|
||||||
|
# repo-wide census counts conventional test FILES; is_test additionally counts
|
||||||
|
# dir-homed helpers toward test-insertion ratios.
|
||||||
_TF_TOTAL=$(git ls-files 2>/dev/null | grep -cE '(\.test\.|\.spec\.|_test\.|_spec\.)' || true)
|
_TF_TOTAL=$(git ls-files 2>/dev/null | grep -cE '(\.test\.|\.spec\.|_test\.|_spec\.)' || true)
|
||||||
case "$_TF_TOTAL" in ''|*[!0-9]*) _TF_TOTAL=0 ;; esac
|
case "$_TF_TOTAL" in ''|*[!0-9]*) _TF_TOTAL=0 ;; esac
|
||||||
echo "TEST_FILES_TOTAL: $_TF_TOTAL"
|
echo "TEST_FILES_TOTAL: $_TF_TOTAL"
|
||||||
|
|||||||
@@ -146,9 +146,9 @@ function gbrainConfigPath(env?: NodeJS.ProcessEnv): string {
|
|||||||
* cwd's NEAREST-ANCESTOR project scope only (#2499 made project scope
|
* cwd's NEAREST-ANCESTOR project scope only (#2499 made project scope
|
||||||
* visible; the per-project scoping fixes the machine-wide bleed where ONE
|
* visible; the per-project scoping fixes the machine-wide bleed where ONE
|
||||||
* project's remote registration reclassified broken local engines as
|
* project's remote registration reclassified broken local engines as
|
||||||
* thin-client for EVERY cwd). Ancestor matching mirrors the
|
* thin-client for EVERY cwd). Ancestor matching mirrors the inline jq
|
||||||
* GBRAIN_MCP_ENTRY_JQ resolution in
|
* resolution in bin/gstack-skill-start (the single bash copy of the #2499
|
||||||
* scripts/resolvers/preamble/generate-brain-sync-block.ts: cwd == key or
|
* resolution, moved there in token-reduction Phase 1): cwd == key or
|
||||||
* cwd startswith key + separator, longest matching key that actually
|
* cwd startswith key + separator, longest matching key that actually
|
||||||
* carries a gbrain entry wins (a nested project WITHOUT gbrain doesn't
|
* carries a gbrain entry wins (a nested project WITHOUT gbrain doesn't
|
||||||
* shadow its parent's registration).
|
* shadow its parent's registration).
|
||||||
|
|||||||
@@ -28,8 +28,6 @@ import {
|
|||||||
generatePlanModeInfo,
|
generatePlanModeInfo,
|
||||||
} from './preamble/generate-completion-status';
|
} from './preamble/generate-completion-status';
|
||||||
|
|
||||||
// One-time onboarding prompts
|
|
||||||
|
|
||||||
// Host-specific instructions
|
// Host-specific instructions
|
||||||
import { generateBrainHealthInstruction } from './preamble/generate-brain-health-instruction';
|
import { generateBrainHealthInstruction } from './preamble/generate-brain-health-instruction';
|
||||||
|
|
||||||
|
|||||||
@@ -6,9 +6,10 @@
|
|||||||
* daily pull, queue-depth status) now runs inside `bin/gstack-skill-start`
|
* daily pull, queue-depth status) now runs inside `bin/gstack-skill-start`
|
||||||
* (invoked by the Preamble fence above) and reports through the same STATUS
|
* (invoked by the Preamble fence above) and reports through the same STATUS
|
||||||
* lines it always emitted: the GBrain hint text and the `ARTIFACTS_SYNC:`
|
* lines it always emitted: the GBrain hint text and the `ARTIFACTS_SYNC:`
|
||||||
* line. What remains here is the prose the model acts on — including the
|
* line. What remains here is the prose the model acts on. The one-time
|
||||||
* one-time privacy stop-gate, which stays inline until the Phase 2
|
* privacy stop-gate moved behind its runtime gate in Phase 2: it now arrives
|
||||||
* instruction-emission layer moves it behind its runtime gate.
|
* as a GSTACK_INSTRUCTION block from gstack-skill-start when consent is
|
||||||
|
* actually pending; this generator only carries the interpretation prose.
|
||||||
*
|
*
|
||||||
* Skill-END sync is no longer a separate fence: `bin/gstack-skill-end`
|
* Skill-END sync is no longer a separate fence: `bin/gstack-skill-end`
|
||||||
* (invoked by the Telemetry step) drains the queue before logging.
|
* (invoked by the Telemetry step) drains the queue before logging.
|
||||||
|
|||||||
@@ -33,9 +33,9 @@ Before each AskUserQuestion, choose \`question_id\` from \`${registry}\` or \`{s
|
|||||||
|
|
||||||
**Embed the option recommendation via the \`(recommended)\` label suffix** on exactly one option per AUQ. The PreToolUse hook parses \`(recommended)\` first, falls back to "Recommendation: X" prose, and refuses to auto-decide if ambiguous. Two \`(recommended)\` labels = refuse.
|
**Embed the option recommendation via the \`(recommended)\` label suffix** on exactly one option per AUQ. The PreToolUse hook parses \`(recommended)\` first, falls back to "Recommendation: X" prose, and refuses to auto-decide if ambiguous. Two \`(recommended)\` labels = refuse.
|
||||||
|
|
||||||
After answer, log best-effort (PostToolUse hook also captures deterministically when installed; dedup on (source, tool_use_id) handles double-writes):
|
After answer, log best-effort (PostToolUse hook also captures deterministically when installed; dedup on (source, tool_use_id) handles double-writes). Substitute \`SESSION_ID\` with the value the preamble's skill-start output echoed — shell variables do not survive between Bash calls:
|
||||||
\`\`\`bash
|
\`\`\`bash
|
||||||
${bin}/gstack-question-log '{"skill":"${ctx.skillName}","question_id":"<id>","question_summary":"<short>","category":"<approval|clarification|routing|cherry-pick|feedback-loop>","door_type":"<one-way|two-way>","options_count":N,"user_choice":"<key>","recommended":"<key>","session_id":"'"$_SESSION_ID"'"}' 2>/dev/null || true
|
${bin}/gstack-question-log '{"skill":"${ctx.skillName}","question_id":"<id>","question_summary":"<short>","category":"<approval|clarification|routing|cherry-pick|feedback-loop>","door_type":"<one-way|two-way>","options_count":N,"user_choice":"<key>","recommended":"<key>","session_id":"SESSION_ID"}' 2>/dev/null || true
|
||||||
\`\`\`
|
\`\`\`
|
||||||
|
|
||||||
For two-way questions, offer: "Tune this question? Reply \`tune: never-ask\`, \`tune: always-ask\`, or free-form."
|
For two-way questions, offer: "Tune this question? Reply \`tune: never-ask\`, \`tune: always-ask\`, or free-form."
|
||||||
|
|||||||
Reference in New Issue
Block a user