Record each escalation as an Escalation row #884
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.
Blocks
Reference
jared/cc-os#884
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
ADR-0259 decision 2 records each escalation as a row in a new
escalationstable with a Sequel modelEscalation. TodayLanding#escalate!(command/implementation/landing.rb:31) callsImplementation#escalate!(model/implementation/lifecycle.rb:34). That writesescalated_atandfailed_reasonon the implementation row. A second escalation would overwrite both columns, against ADR-0165 append-only. Also, when no gate escalates and no bound is spent (for example the change-auditorfail: escalateedge),EscalationReasonreturns nil and the escalation has no reason.Reproduce
n/a: design change, nothing to reproduce.
Approach
Add the table in
Db.create_ledger_tables(adapter/db.rb), modeled onobjections, and bumpSCHEMA_VERSION(ADR-0129/0155; do not bump while a run is live):Add
OsSdlc::Escalation < Sequel::Model(many_to_one :implementation,many_to_one :dispatch).Implementation one_to_many :escalations, order: [Sequel.desc(:created_at), Sequel.desc(:id)](ADR-0259 decision 6; the id breaks same-second ties).Implementation#current_escalationreturnsescalations.first.Landing#escalate!adds one Escalation row throughadd_escalationwithdispatch_id= the landing dispatch andreason=escalate_reason. Whenescalate_reasonis nil, the reason isverdict:<dispatch verdict>, the same form asfail_reason, because the column is not null. This ticket keeps theescalated_atstamp; #872 removes it and makes escalation a waiting position.Required work:
:escalationsinplugins/os-sdlc/lib/os_sdlc/adapter/db.rbclass Escalation < Sequel::Modelinplugins/os-sdlc/lib/os_sdlc/**/*.rbdef current_escalationinplugins/os-sdlc/lib/os_sdlc/model/**/*.rbadd_escalationinplugins/os-sdlc/lib/os_sdlc/command/implementation/landing.rbAcceptance criteria
bound_exhausted:<node>/<verdict>.failwhose edge leads toescalate, when the transition lands, then the escalations row has reasonverdict:fail.created_at, whencurrent_escalationis read, then it returns the row with the higher id.Owner sketch
Origin
Parent: #859
Work started on branch ticket-884 (os-sdlc pipeline, map poodr-ticket-implementation).
Resolution
Done: Escalation rows: escalations table + Escalation model (implementation, dispatch, reason); the Runner landing adds one row per escalation; Implementation#current_escalation returns the newest; SCHEMA_VERSION 27. Deviation: the Runner commit left plugins/os-sdlc/lib/os_sdlc/model/dispatch.rb (Dispatch has many escalations) in dirty_paths; committed by hand as
4028738c(the suite had run with it).Evidence: main
643add26(Runner commit, implementation 1 implementation_complete, 11 dispatches, contract-auditor pass on round 2),4028738c, History row; bin/test on main: 9 suites passed.Follow-ups: none