decision-system S4c: lever fields in PredictionParser and PredictionLog, and the os-me-route CLI #1263
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#1263
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
The prediction log does not record the lever labels of a prediction.
PredictionParserreads only the ruling text and theConfidence:line. os-sdlc flows (S5) must get the labels of a row without a gem dependency between plugins, and no command prints them. The design is indocs/decision-system/operations.md(PredictionParserextension) anddocs/decision-system/build-plan.mdS4. This ticket is the third of three S4 tickets. It usesRow,AnswerSource,WrongCost::Assessor, andRequiredBandfrom S4a.Approach
PredictionParser#parsereads four more lines from the prediction text. It adds their values to each ruling hash. It removes these lines from the ruling text, as it removes theConfidence:line today. A field whose line is absent is not in the hash.operations.md)Source: precedent/^Source:\s*(\w+)/source:StringCost: medium/^Cost:\s*(\w+)/cost:StringBand: 80/^Band:\s*(\d+)/band:IntegerEvidence: 55% -> 82%/^Evidence:\s*(\d+)%\s*->\s*(\d+)%/evidence_before:Integer,evidence_after:IntegerPredictionLog::FIELDSgainssource cost band evidence_before evidence_after, afterbeat_note. Old records read these fields asnil.The command
os-me-route ROW_FILEreads the whole file as the row text. It asks the model throughDecisionModel::Clientwith theHeadlessClaudeadapter and no model flag. It asks four questions in this order: theAnswerSourcequestion, then theWrongCost::Assessorquestionshard_to_undo,compounds,stays_hidden. It prints one line of JSON (JSON.generate) and exits 0. The keys are in this order:required_bandisnullfor the levellow. O-9 is settled: os-sdlc calls this CLI; the levers stay in os-me. The ADR challenge rejected an ADR.Required work:
Source:,Cost:,Band:, andEvidence:lines inPredictionParser— check: presentEvidence:inplugins/os-me/lib/os_me/prediction_parser.rbsource cost band evidence_before evidence_aftertoPredictionLog::FIELDS— check: presentevidence_beforeinplugins/os-me/lib/os_me/prediction_log.rbRowLabels, which builds the labels of one row and gives the hash for the JSON line — check: presentclass RowLabelsinplugins/os-me/lib/os_me/row_labels.rbroute ROW_FILEcommand toOsMe::CLI— check: presentdef route(row_file)inplugins/os-me/lib/os_me/cli.rbbin/os-me-route, which startsOsMe::CLIwithroute— check: present['route', *ARGV]inplugins/os-me/bin/os-me-routeAcceptance criteria
a. Keep StepOutcome in Gate.\nConfidence: 80%\nSource: precedent\nCost: medium\nBand: 80\nEvidence: 55% -> 82%, whenPredictionParser#parseruns, then it returns[{ id: "session:a", text: "Keep StepOutcome in Gate.", confidence: 80, triggers: [], source: "precedent", cost: "medium", band: 80, evidence_before: 55, evidence_after: 82 }].Jared would accept the plan.\nConfidence: 60%, whenPredictionParser#parseruns, then it returns[{ id: "session:1", text: "Jared would accept the plan.", confidence: 60, triggers: [] }].a. Split it.\nb. Defer it.\nConfidence: 65%\nBand: 65\nEvidence: 50%->65%, whenPredictionParser#parseruns, then both rulings haveband: 65,evidence_before: 50, andevidence_after: 65, and their texts areSplit it.andDefer it.{"id":"session:a","session_id":"s1","confidence":80}, whenPredictionLog#recordsruns, then the record has"source","cost","band","evidence_before", and"evidence_after", eachnil.os-me-eval append TRANSCRIPTruns, then the log record has"source" => "precedent","cost" => "medium","band" => 80,"evidence_before" => 55, and"evidence_after" => 82.Move Gate::StepOutcome to OsSdlc::StepOutcome.and a fakeclaudethat answersfacts,no,yes,noin turn, whenos-me-route ROW_FILEruns, then stdout is exactly the JSON line in Approach plus a newline, and the exit status is 0.claudethat answerstaste,no,no,no, whenos-me-route ROW_FILEruns, then stdout is{"source":"taste","max_rung":0,"novel":true,"wrong_cost":{"hard_to_undo":false,"compounds":false,"stays_hidden":false},"level":"low","required_band":null}plus a newline.claudethat answersfacts,yes,yes,yes, whenos-me-route ROW_FILEruns, then the JSON has"level":"high"and"required_band":85.os-me-route ROW_FILEruns, then the fakeclaudegets four calls, and each prompt includesMove Gate::StepOutcome to OsSdlc::StepOutcome.claudewhose first answer is not one of the five sources, whenos-me-route ROW_FILEruns, then the exit status is not 0 and stdout is empty.Owner sketch
Non-goals
PredictLooptext inplugins/os-me/skills/predict/SKILL.md. The orchestrator writes it through the fast path.SUGGESTIONS.mdline forbrief.md. The orchestrator writes it.**Band:** 80. The parser reads the plain forms in the table only.RowRouter(S5).Blocked by: #1246 (
Row,AnswerSource,WrongCost::Assessor,RequiredBand).Origin
DESIGN(docs/decision-system/operations.md).VERDICT: CREATE (user-approved stage split of #1246; backlog search only)
Work started on branch ticket-1263 (/os-sdlc:implement, S4c).
Resolution
Done: S4c built: Source/Cost/Band/Evidence fields in PredictionParser and PredictionLog::FIELDS, RowLabels, and the os-me-route ROW_FILE CLI that prints the labels as JSON; implementation 130 complete.
Evidence: Branch ticket-1263, Runner commit; one test-review round; suite, lint and required-work gates green; contract audit passed first time; lever_fields_test.rb and route_cli_test.rb.
Follow-ups: The predict SKILL.md PredictLoop text and the Store SUGGESTIONS.md brief line are orchestrator work for S4 (fast path), not tickets. S5 #1247 wires os-sdlc flows to os-me-route.