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:
Garry Tan
2026-08-25 20:50:15 +00:00
co-authored by Claude Fable 5
parent 46d158c5ed
commit 49321ce71f
5 changed files with 12 additions and 10 deletions
-2
View File
@@ -28,8 +28,6 @@ import {
generatePlanModeInfo,
} from './preamble/generate-completion-status';
// One-time onboarding prompts
// Host-specific instructions
import { generateBrainHealthInstruction } from './preamble/generate-brain-health-instruction';
@@ -6,9 +6,10 @@
* daily pull, queue-depth status) now runs inside `bin/gstack-skill-start`
* (invoked by the Preamble fence above) and reports through the same STATUS
* 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
* one-time privacy stop-gate, which stays inline until the Phase 2
* instruction-emission layer moves it behind its runtime gate.
* line. What remains here is the prose the model acts on. The one-time
* privacy stop-gate moved behind its runtime gate in Phase 2: it now arrives
* 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`
* (invoked by the Telemetry step) drains the queue before logging.
+2 -2
View File
@@ -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.
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
${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."