Repository navigation
v1.91.233.0 fix(plan-tune): bound each UTC day's pull on a dimension, record contributing_events (GSTA-79) - #3397
Merged
Merged
Conversation
…ofile 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>
…g answer; trace shares derive's accumulation (#2623) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
…doc (heredoc pipe-deadlock guard) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…n-cap Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> # Conflicts: # CHANGELOG.md
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>
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>
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>
This was referenced Oct 26, 2026
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>
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>
This was referenced Oct 26, 2026
Open
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…n-cap Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> # Conflicts: # CHANGELOG.md
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: forty "fix now" answers on /plan-eng-review pin
architecture_careat 0.998, and nothing records how many answers sit behind the number. After: each UTC day moves a dimension at most one strong answer's worth (±0.06), so the same log reads 0.808,contributing_eventsshows the 40 answers, and--traceshows each capped day with a total that matches--derive(#2623).Text before/after
Before:
After:
bin/gstack-developer-profile):--derivesums each UTC day's deltas per dimension and clamps the sum to the largest single delta in the signal map (±0.06 today, computed fromSIGNAL_MAP, so no new constant). Answers within a day net out before the clamp. The day comes from an ISO 8601ts(a zoneless or space-separated one reads as UTC); rows without one share a single undated bucket.session_id. /ship's reviews showedsession_idcan't carry the bound: the question-log hook and the agent log the same answer under different ids, and the agent often logs the literalSESSION_IDplaceholder, so a session-keyed bound double counts or collapses unrelated reviews. Keying by UTC day needs nothing the writers supply beyondts. The accepted cost: several reviews on one day count as one.--deriveand--traceshareaccumulateSignals, so the trace explains exactly the value derive wrote: every contributing answer, each capped day and aTOTALline. Control characters intsare replaced in--traceso a row can't forge a TOTAL line.inferred.contributing_events: per dimension, the number of unique answers that moved it. A dimension with no evidence reads 0 instead of a bare 0.5 that looks like balanced evidence.days_spanuses the same UTC day.constructorchoice no longer resolves toObject.prototype), null JSONL lines are skipped, andquestion_id/user_choicemust be strings.docs/designs/PLAN_TUNING_V0.mddocumentssignal_events,contributing_eventsand the per-day bound;TODOS.mdnarrows the /plan-tune inferred psychographic never leaves 0.5: SIGNAL_MAP is keyed by stable option keys, the capture hook logs UI labels (0 of 1,286 rows match) #2623 entry to the remaining Gate 1 work (plan-tune: {skill}-{slug} question ids never reach a signal (Gate 1 of #2623) #3442).Credit
The
contributing_eventsprovenance and theGSTACK_QUESTION_LOG_NO_DERIVEtest-harness fix are ported from #2625 by @v639dragoon, in their own commit withCo-authored-by. The bound and hardening are separate commits on top. #2625'sfollowed_recommendation→ autonomy signal stays parked, as its Oct 8 review decided.Why
#2623 found three problems. Labels never matched
SIGNAL_MAP(fixed by #3394). Once answers do match, a dimension saturates after about eight reviews because every answer adds its full delta, and "no evidence" and "balanced evidence" both print 0.5. Garry's Oct 17 decision on #2623 covered all three; this PR delivers the bound andcontributing_events, so a heavy day of reviews can no longer pin a dimension and the profile says how much evidence it has.Follow-ups filed from /ship's reviews: #3435 (dead
applySignal/newDimensionTotals), #3436 (--check-mismatch/--gapignorecontributing_events), #3437 (background derive temp-file race), #3442 (Gate 1{skill}-{slug}hinted fallback, crediting @v639dragoon), #3443 (no decay), #3444 (spawned-env-deny and auto-decided rows train the profile), #3445 (caller-suppliedtsbackdating).Approvals
Source: gstack-approvals record for capy/plan-tune-session-cap (display only; not an approval citation).
Summary
contributing_events, theGSTACK_QUESTION_LOG_NO_DERIVEharness fix) with co-author credit.--deriveand--trace.[Unreleased]entry.Test Coverage
All new code paths have test coverage in
test/gstack-developer-profile.test.ts: the per-day bound (positive and negative), theSESSION_IDplaceholder, the hook-plus-agent double log, a second day still moving (negative control), undated rows sharing one bucket, zoneless and space-separatedtsread as UTC underTZ=America/Los_Angeles, non-stringquestion_id/user_choice, a null line, aconstructorchoice,--tracecontrol characters, and trace/derive agreement.Tests ran: tests 177
Pre-Landing Review
Review (via ship, 2 cycles, converged): quality 9/10, 0 critical, 5 informational. Specialists: testing, maintainability, security, performance, simplification and red-team ran; data-migration, api-contract, design and state-machines were out of scope. Informational findings were filed as follow-ups (#3435, #3443, #3444, #3445) rather than fixed here.
Gate edits: none detected (no test expectation, threshold, budget, timeout, trial count or case kind changed).
Outside review (adversarial): verified at tree 2d072eb, verdict merge as is and file follow-ups. Both reviews were bound at b2ab7a8; the only later commit (d91337d) changes TODOS.md and CHANGELOG.md text.
Exploratory QA
Functional CLI smoke at b2ab7a8 on isolated state roots: 9/9 probes pass (verdict pass, no open findings). Covered the shared day bound across five session ids,
--tracecapped days and TOTAL,SESSION_IDplaceholder rows, the hook-plus-agent double log, aconstructorchoice with a null line, control characters ints, and the undated bucket with zoneless UTC reads.Design Review
No frontend files changed — design review skipped.
Eval Results
Focused paid case
plan-tune-inspect(gate tier, 1 trial) at d91337d: PASS 1/1, $0.13.Issues
Fixes #2623
Refs #2625
Refs #3436
Refs #3442
Verification Results
Pregate at tree fff627b: typecheck clean; remote free tier 11,739 tests, 0 failed ($0.04); macOS named regressions and the Windows free shard cleared from CI runs on this head (linked in the receipt's pregate record).
TODOS
No TODO items completed in this PR. The #2623 entry (TODOS.md:55) is narrowed to its remaining Gate 1 work, tracked as #3442.
Documentation
Status: current. The release docs match the code at d91337d. No edits, no blockers.
Scope: base 632bde7..d91337d (5 committed files; nothing staged, unstaged or untracked). Changed surface:
bin/gstack-developer-profile--deriveper-UTC-day bound (±0.06, the largest SIGNAL_MAP delta),inferred.contributing_events, and--traceclamped days with a TOTAL that matches--derive. The 111-file doc inventory was screened for the changed surface; the related docs and their verifying source were read.Documentation health:
docs/designs/PLAN_TUNING_V0.md: Current. The schema addssignal_eventsandcontributing_events, and the paragraph on the per-day bound, ISO-only dating and the double count across writers was verified against the code.TODOS.md: Current. The /plan-tune inferred psychographic never leaves 0.5: SIGNAL_MAP is keyed by stable option keys, the capture hook logs UI labels (0 of 1,286 rows match) #2623 entry is narrowed to the{skill}-{slug}hinted fallback (plan-tune: {skill}-{slug} question ids never reach a signal (Gate 1 of #2623) #3442).CHANGELOG.md: Current. The[Unreleased]entry's figures (0.998, 0.808, ±0.06) match the code.plan-tune/SKILL.md.tmpl: Current. Display gate,days_spanand calibration lines are unaffected.Coverage debt:
inferred.contributing_eventshas reference and explanation coverage (PLAN_TUNING_V0.md); nothing displays it yet (#3436, deliberate). The--traceclamped-day output has reference coverage only (bin usage header and PLAN_TUNING_V0.md); no /plan-tune how-to surfaces--trace. Diagram drift: none.Test plan
bun run typecheck: exit 0gstack-pregate --stage tests --remoteat tree fff627b: 11,739 tests, 0 failedbun run scripts/test-paid-shards.ts --tier gate --case plan-tune-inspect --trials 1: PASS 1/1, $0.13🤖 Generated with Claude Code