Skip to content

v1.91.223.0 fix(plan-tune): log the registered option key, not the clicked label (GSTA-79) - #3394

Merged
capy-ai[bot] merged 2 commits into
mainfrom
capy/log-the-registered-option
Oct 25, 2026
Merged

capy-ai[bot] merged 2 commits into
mainfrom
capy/log-the-registered-option

Conversation

@garrytan

@garrytan garrytan commented Oct 24, 2026 •

Copy link
Copy Markdown
Owner

What changed

Before/after: five hook-captured answers to plan-eng-review-arch-finding

Before: capture wrote the clicked label (A) Fix it now (recommended)), no answer matched SIGNAL_MAP, and every dimension stayed at 0.5 with 0 signal events. After: the same five answers are written as fix-now / defer with the label kept in choice_label, so architecture_care moves to 0.632 and --trace lists all five (#2623).

  • bin/gstack-question-log: on a hook-captured event (source: hook) for a registered question_id, the clicked label is mapped to that question's registered option key before it is written, and the label is kept in a new choice_label field. A label in recommended is mapped the same way, so followed_recommendation compares keys. Ad-hoc and hook-<hash> ids and unmatched or ambiguous labels are written as given.
  • scripts/psychographic-signals.ts: new resolveOptionKey(question_id, label). It strips the A) 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 by test/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 while SIGNAL_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-dimension contributing_events. The {skill}-{slug} escape hatch stays a later step, as decided.

Approvals

Date Asked Garry's words Covers Pending
2026-10-17 #2623 design call: map the chosen label to the registered option key at capture time (registered ids only), plus bounded accumulation and contributing_events "3223 subset / Accept all recommendations" (relayed by GStack Minder; decision posted on #2623) label → key mapping at capture (this PR) accumulation bound and contributing_events (follow-up)
standing merge through a train (CREW 6), focused paid runs (CREW 5) standing approval this PR none

Evidence

  • test/plan-tune.test.ts (56 pass): every registered option resolves from its own words, bare and as A) … (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).
  • Adjacent focused set, 19 files, 1129 pass 0 fail: plan-tune, auto-decide-fixture, ceo-mode-handoff, distill-free-text, gstack-codex-session-import, gstack-developer-profile, gstack-question-log, gstack-state-root-override, hooks-windows-paths, hostile-path-writers, native-auto-decide, question-log-hook, question-preference-hook, bin-windows-bun-import-paths, plan-tune-cathedral, spawnsync-timeout-tripwire, module-size-ratchet, bun-entry-isolation, state-root-ratchet.
  • bun run typecheck clean; bun run typecheck:test 819 known, none new; gstack-pregate sealed no findings.
  • Gate integrity: no test expectation, threshold, budget, timeout, trial count or case kind changed.

Refs #2623. The follow-up PR (accumulation bound and per-dimension contributing_events) closes it.

Open in Capy

…ed option key at capture (#2623)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@trunk-io

trunk-io Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@github-actions github-actions Bot changed the title fix(plan-tune): log the registered option key, not the clicked label (GSTA-79) v1.91.223.0 fix(plan-tune): log the registered option key, not the clicked label (GSTA-79) Oct 25, 2026
@capy-ai
capy-ai Bot merged commit 1c28c09 into main Oct 25, 2026
62 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant