Repository navigation
v1.91.223.0 fix(plan-tune): log the registered option key, not the clicked label (GSTA-79) - #3394
Merged
Merged
Conversation
…ed option key at capture (#2623) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
5 tasks done
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This was referenced Oct 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Before: capture wrote the clicked label (
A) Fix it now (recommended)), no answer matchedSIGNAL_MAP, and every dimension stayed at 0.5 with 0 signal events. After: the same five answers are written asfix-now/deferwith the label kept inchoice_label, soarchitecture_caremoves to 0.632 and--tracelists all five (#2623).bin/gstack-question-log: on a hook-captured event (source: hook) for a registeredquestion_id, the clicked label is mapped to that question's registered option key before it is written, and the label is kept in a newchoice_labelfield. A label inrecommendedis mapped the same way, sofollowed_recommendationcompares keys. Ad-hoc andhook-<hash>ids and unmatched or ambiguous labels are written as given.scripts/psychographic-signals.ts: newresolveOptionKey(question_id, label). It strips theA)selector and(recommended)suffix, then matches the label's leading words against that question's own registered options only: each key's own words (fix-now→ "fix now") plus a short cue list ("Add to TODOs" →defer, "Ship as-is" →skip, "HOLD SCOPE" →hold). The longest cue wins; a tie stays unmapped.Only hook rows are mapped. Rows from the agent's own log call, auto-decide, Codex import and typed free text stay as written, because existing readers match on them: the plan-ceo-review auto-decide check (
test/helpers/native-auto-decide.ts) authenticates rows by their full mode names (HOLD SCOPE), pinned bytest/auto-decide-fixture.test.ts. Existing logs are not rewritten.Why
/plan-tune's inferred profile never left 0.5: the reporter's 1,286-event log had 0 answers that matched, because the PostToolUse hook records the UI label whileSIGNAL_MAP(and--derive) look answers up by registered option key. Garry's Oct 17 decision on #2623 was to map the label to the registered key at capture time, for registered ids only, leaving unmatched ids unmapped.Not in this PR (named in the same Oct 17 comment, left for a follow-up lane because they live in
bin/gstack-developer-profile): bounding per-session accumulation and recording per-dimensioncontributing_events. The{skill}-{slug}escape hatch stays a later step, as decided.Approvals
contributing_eventscontributing_events(follow-up)Evidence
test/plan-tune.test.ts(56 pass): every registered option resolves from its own words, bare and asA) … (recommended); 20 common phrasings (including the four plan-ceo-review mode names) map to their keys; negative controls stay unmapped (unregistered ids, a question with no options, a label naming no option, a mid-sentence cue, another question's key, a selector-looking number). Two capture tests run the real bin; both fail against the old bin (negative control run on the base tree with only the resolver copied in: 2 fail).bun run typecheckclean;bun run typecheck:test819 known, none new;gstack-pregate sealedno findings.Refs #2623. The follow-up PR (accumulation bound and per-dimension
contributing_events) closes it.