Record every Prediction in a session, not only the first #1233
Labels
No labels
P0
P1
P2
P3
bug
category/code-change
category/cross-repo
category/eval-run
category/investigation
category/no-test-target
category/owner-ruling
category/prose-artifact
category/recurring-chore
category/structure
category/umbrella
crc-refactor
create
delete
enhancement
filed-by/agent
filed-by/user
frozen
lint-rule
needs-info
needs-triage
next
plugin/cc-architect
plugin/os
plugin/os-adr
plugin/os-aidd-lint
plugin/os-backlog
plugin/os-context
plugin/os-doc-hygiene
plugin/os-sdlc
plugin/os-vault
project/cc-os
ready-for-agent
ready-for-human
recurring
review
rule-proposal
update
waiting
wayfinder:grilling
wayfinder:map
wayfinder:map
wayfinder:research
wayfinder:task
wayfinder:task
wontfix
worklist/deviations
worklist/lint-rule
worklist/new-implement-build
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
jared/cc-os#1233
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
A second
/os-me:predictin one session is never recorded.PredictionParser#parsegives each ruling the idsession:<n>, numbered from 1 inside one Prediction.PredictionLog#appenddrops a record whose id and session_id are already in the log. So the first Prediction of a session takessession:1, and every later Prediction in that session is dropped without a message. The log then under-counts predictions, and the second Prediction's verdict can never be scored.Observed
Session 8468f10b showed two Predictions on 2026-10-22 (correct, 70%; redirect, 60%). The log holds one record for it.
Reproduce
Approach
Give each Prediction in a session its own id, so the dedupe keeps its meaning (one record per shown ruling) without dropping later Predictions. One shape: the id carries the Prediction's position in the transcript, for example the index of the notification entry, or its timestamp. The parser owns the id; the log owns the dedupe. Keep
score-record IDworking for old ids.Required work:
recorded_atinplugins/os-me/lib/os_me/prediction_log.rbAcceptance criteria
session:1, whenscore-record session:1 --verdict hitruns with its session, then it scores.Owner sketch
Origin
d4fa00d7,9530bb66); this session's second Prediction was missing.PredictionLog#appenddedupe on (id, session_id) ← ids aresession:<n>per Prediction, not per session ← DESIGN (#1079 append dedupe by id and session; #1081 id assignment in the parser).plugins/os-me/lib/os_me/prediction_log.rbappend;plugins/os-me/lib/os_me/prediction_parser.rbparseVERDICT: CREATE
Findings of the backfill run on 2026-11-13. Checked against the source on that date.
Cause that this ticket owns: the id.
YamlPrediction#row(plugins/os-me/lib/os_me/prediction_parser/yaml_prediction.rb:25) always gives the idsession:1. The body above says that ids are numberedsession:<n>. That is true only forLegacyPrediction(letters a, b, c). Each YAML Prediction getssession:1.PredictionLog#identity(plugins/os-me/lib/os_me/prediction_log.rb:36-39) is the pair id and session_id.PredictionLog#append(prediction_log.rb:14-19) drops a record whose pair is in the log, with no message.session:1.Evidence sessions.
Split with #1758, so the two tickets do not overlap.
PredictionParser#yaml_blockkeeps only the last block of a message, (c)CliAppender#prediction_shown?reads the whole transcript, so an older Prediction marks a new invocation as recorded, (d)appendcannot name an invocation and the hook path is silent, (e) no held-out check.Note for acceptance criterion 2. After #1758 limits the read to the pending invocation, the same Prediction is no longer re-appended by a later Stop. The dedupe must still keep one row when
appendruns two times over one transcript.Work started on 2026-11-13 through /os-sdlc:implement. Branch: ticket-1233. Cause and evidence sessions are in the comment of 2026-11-13; #1758 owns the parser and Stop hook faults.
Resolution
Done: Each Prediction in a session now gets its own positioned id, so the log keeps a second and later Prediction of the same session. The parser owns the positioned id; the log keeps its dedupe on id and session.
Evidence: os-sdlc implementation 291, 2026-11-13: 18 dispatches, suite gate green, survivor gate green, contract audit pass. Branch ticket-1233; paths plugins/os-me/lib/os_me/prediction_parser.rb, plugins/os-me/lib/os_me/cli/append_request.rb, plugins/os-me/test/prediction_repeat_cli_test.rb, plugins/os-me/test/prediction_cli_test.rb.
Follow-ups: #1758 (already filed): the parser block shapes, the last-block rule, the whole-transcript ready check, and the held-out check. No new follow-up.