Repository navigation
feat(plan-tune): registry-independent autonomy signal from followed_recommendation (partial #2623) - #2625
feat(plan-tune): registry-independent autonomy signal from followed_recommendation (partial #2623)#2625v639dragoon wants to merge 1 commit into
Conversation
…ecommendation
/plan-tune's inferred psychographic never leaves its 0.5 seed. On a real
1,286-row question-log with all four calibration gates passing, --derive
applied zero signal deltas and --trace reported "no events contribute" for
every dimension.
Cause (filed separately): SIGNAL_MAP attribution needs three exact-string
matches to land -- question_id in QUESTIONS, that entry carrying a signal_key,
and user_choice matching a key in SIGNAL_MAP[signal_key]. The third matched
0 of 1,286 rows: the capture hook records the UI LABEL while SIGNAL_MAP is
keyed by stable option keys, and AskUserQuestion has no slot for a key. So
growing the registry alone cannot fix it.
followed_recommendation is different. gstack-question-log already computes it
at write time from (user_choice, recommended), so it is present on ~95% of
existing rows and needs no registry entry, no marker and no skill change. It
is the only signal that can read existing history retroactively.
scripts/psychographic-signals.ts
recommendationSignal(): ONE bounded autonomy delta from the whole log.
Laplace-smoothed rate, then a confidence ramp keyed on the ELIGIBLE count
-- deliberately not sample_size, which counts every logged row, so 3
eligible rows beside 1,200 unrelated ones would otherwise render a
confident score from three answers.
Eligibility fails closed on hand-edited JSONL: strict boolean (the string
"false" is truthy), source present and not 'auto-decided' (the preference
hook auto-picks the recommendation, which would feed the dimension that
licenses auto-deciding back into itself), and precedence over the registry
autonomy path so one decision is never counted twice.
bin/gstack-developer-profile
derive applies the aggregate; trace reports it, so --trace autonomy no
longer says "no events contribute" while --profile shows a moved number.
Both call the same exported function rather than re-implementing the rule
in two separate bun -e blocks.
inferred now records per-dimension contributing_events (UNIQUE ROWS) and
derivation_version. normalizeToDimensionValue(0) is exactly 0.5, so
without this a dead pipeline and balanced evidence print the same number
-- which is how five 0.5s sat beside sample_size 1286 looking healthy.
Why the contribution is O(1) and not a per-event delta: the sigmoid runs over
an ACCUMULATED total, so a per-event delta at this file's usual +/-0.03..0.06
reaches 0.9994 by 50 events -- as uninformative as the 0.5 it replaced.
Measured on the 1,286-row log: autonomy 0.5 -> 0.797 (1,187/1,240 eligible
rows followed, 95.7%), other dimensions unchanged.
Known limitation, pinned by a test rather than fixed here: the per-event
registry path can still swamp this signal, because it accumulates unbounded.
With 200 mapped events one way and 60 rate rows the other, the result is 1.0
where the rate evidence alone reads 0.190. Bounding that re-prices every delta
in the signal map and belongs in its own change.
Test harness: logQuestion now sets GSTACK_QUESTION_LOG_NO_DERIVE=1.
gstack-question-log fires --derive in the background after every append, which
races the explicit --derive a test then makes; observed as intermittently
empty stdout.
Co-Authored-By: Claude Opus 5 <[email protected]>
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
|
Thank you for this, @v639dragoon. It's a reasonable idea, but not one we can take right now: Fix #2623's root cause first (signal keys versus logged UI labels) so all five dimensions move, then decide whether a whole-history autonomy prior is still needed. We're parking it: closing the PR and recording the idea in TODOS.md under its theme, so it isn't lost. When we pick that theme up we'll reference this PR and credit you. |
… record contributing_events (GSTA-79) (#3397) * feat(plan-tune): per-dimension contributing_events in the inferred profile Port of the provenance part of #2625 by @v639dragoon: --derive records, per dimension, how many unique log rows moved it, so "no evidence" and "balanced evidence" no longer both print a bare 0.5. Also ports the test harness fix: logQuestion sets GSTACK_QUESTION_LOG_NO_DERIVE=1 so the background derive cannot race the test's own --derive. The registry-independent autonomy signal from #2625 stays parked, as the Oct 8 review decided. Co-authored-by: v639dragoon <[email protected]> Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(plan-tune): clamp each session's pull on a dimension to one strong answer; trace shares derive's accumulation (#2623) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(plan-tune): shared accumulation JS as a quoted string, not a heredoc (heredoc pipe-deadlock guard) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix: pre-landing review fixes Own-property signal lookups so a logged choice such as constructor cannot break every later --derive; --trace replaces control characters in the fields it prints; tests for the negative clamp, empty session_id, an unmatched answer and both fixes; docs and CHANGELOG say the bound keys on the writer session_id. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix: pre-landing review fixes (pass 2) A session_id that is an unsubstituted placeholder such as SESSION_ID counts as its own session instead of collapsing every agent-logged answer into one bound; a log line that parses to null is skipped; the accumulation tolerates a dimension it did not seed; the trace test covers DEL and C1 controls; docs and CHANGELOG wording match the code. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(plan-tune): bound each UTC day instead of each session_id The per-session bound trusted whatever session_id a writer logged. The PostToolUse hook and the agent log different ids for one review, and an unsubstituted SESSION_ID placeholder either merged every review into one bound or left each answer unbounded. Bucketing by the UTC day of ts stops one burst from pinning a dimension without trusting any id; several reviews on one day count as one. Decision A from GStack Minder. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix: pre-landing review fixes (day bound) Rows without a parseable string ts share one undated bucket instead of each escaping the bound; a ts without a zone is read as UTC, so the day does not depend on the machine's zone; days_span counts the same UTC days; question_id and user_choice must be strings. Tests pin a zone west of UTC. CHANGELOG says contributing_events is recorded in the profile JSON and not displayed yet (#3436). Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix: pre-landing review fixes (strict ISO ts) Only an ISO 8601 date or date-time ts counts as dated; Date alone parses strings such as "junk 1" as real days, which let junk rows escape the bound and inflate days_span. A zoneless time, T- or space-separated, is read as UTC. Tests cover array-valued fields, an offset ts in days_span, the space separator and every undated row reaching the shared bucket. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * docs: narrow the #2623 TODOS entry to its remaining Gate 1 work (#3442) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> --------- Co-authored-by: v639dragoon <[email protected]> Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
Thank you, @v639dragoon. The |
Partial fix for #2623.
What this does
Adds one registry-independent signal —
followed_recommendation→autonomy—so
/plan-tunecan read existing history for one of five dimensions.It does not fix #2623. Gates 1 and 3 there need a design call I did not want
to make on your behalf, and four of five dimensions still sit at 0.5 after this
lands. The title says "signal", not "fix", deliberately.
Why this signal specifically
It is the only one that reads existing history retroactively.
gstack-question-logalready computesfollowed_recommendationat write timefrom
(user_choice, recommended), so it is present on ~95% of rows today andneeds no registry entry, no
<gstack-qid:>marker and no skill change.Measured on a real 1,286-row log: autonomy 0.5 → 0.797 (1,187 of 1,240
eligible rows followed, 95.7%). Other dimensions unchanged.
Three design points worth reviewing
1. The contribution is O(1), not a per-event delta.
normalizeToDimensionValueis a sigmoid over an accumulated total, so a per-event delta at this file's
usual ±0.03..0.06 reaches 0.9994 by 50 events and 1.0 by 100 — as uninformative
as the 0.5 it replaces. This computes one bounded delta from the whole history:
2. The ramp is keyed on the eligible count, not
sample_size. My first draftdropped the ramp, reasoning that the documented 20-event calibration gate already
handles thin evidence. It does not:
sample_sizecounts every logged row(
bin/gstack-developer-profile:351), so 3 eligible rows beside 1,200 unrelatedones passes that gate and would render a confident score from three answers.
3.
W = 0.5is an unvalidated starting constant, and I have said so in thecode. It was picked on one user's data because it lands near their declared
value, which is post-hoc. It is also confounded: a high follow rate may measure
how good the agent's recommendations are as much as how much the user delegates.
The comment frames it the way this file's header already frames v1 deltas —
"best-guess starting points". Happy to re-pick it on broader data.
Eligibility fails closed
question-log.jsonlis hand-editable JSONL, so every clause rejects rather thancoerces: strict boolean (the string
"false"is truthy and would silently countas a follow),
sourcepresent and notauto-decided(the preference hookauto-picks the recommendation, which would feed the dimension that licenses
auto-deciding straight back into itself), and precedence over the registry
autonomy path so one decision is never counted twice.
Also included: derivation provenance
inferrednow carries per-dimensioncontributing_events(unique rows) andderivation_version.normalizeToDimensionValue(0)is exactly 0.5, so today adead dimension and a perfectly balanced one print the same number — which is how
#2623 hid for two months behind
sample_size: 1286. With this,--deriveon anunpatched log shows
contributing_events: 0across the board, which makes thatissue reproducible in one command.
Both fields are additive and sit beside
diversityin the existing shape.Known limitation, pinned rather than fixed
The per-event registry path can still swamp this signal, because it accumulates
unbounded. With 200 mapped
decision-autonomyevents one way and 60 rate rowsthe other, the derived value is 1.0 where the rate evidence alone reads
0.190 — not diluted, erased, and the conclusion flips.
I did not fix that here: bounding per-event accumulation re-prices every delta in
psychographic-signals.tsand deserves its own change. Instead there is a testnamed
KNOWN LIMITATION: the per-event registry path still swamps the rate signalthat pins the current behaviour, so whoever fixes it gets a red test andre-baselines deliberately. Detail in #2623.
Tests
test/plan-tune.test.tsgets the math (in-process, beside the existingpsychographic signal mapblock);test/gstack-developer-profile.test.tsgetsthe wiring. 117 pass across the two files.
Every new assertion is mutation-verified — 11 mutations, each reds its named
test: per-event accumulation, ramp keyed on total rows, smoothing removed,
truthiness instead of strict boolean, missing-source allowed, precedence dropped,
aggregate not applied, provenance write deleted, applications counted instead of
unique rows, and two that strip the trace aggregate.
One of those mutations caught a weak test of mine: the
UNIQUE ROWScaseoriginally used a rate-only fixture, so the registry contributor count was 0 and
multiplying it changed nothing. It now uses a question whose
signal_keywritesmore than one dimension from a single row.
One test-harness change
logQuestionnow setsGSTACK_QUESTION_LOG_NO_DERIVE=1.gstack-question-logfires
--derivein the background after every append(
bin/gstack-question-log:242-250), which races the explicit--derivea testthen makes — I saw it as intermittently empty stdout. That env var exists for
exactly this; without it, any test that logs several rows and then derives is
flaky by construction.
Pre-existing failures, not from this change
bun run test:freehas 3 failures on this branch, all inbrowse/test/path-validation.test.tsandbrowse/test/data-platform.test.ts.They reproduce identically on a clean worktree at
c86e647with none of mychanges, and this PR touches no file under
browse/. Looks like macOS/private/tmpsymlink resolution.VERSIONis deliberately untouched —version-gate.ymlonly triggers on thatpath, so I have left the bump to you.