Move os-sdlc orchestrator payload rendering into presenters #805
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#805
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
Three layers build the payloads that the orchestrator receives.
Implementation::OpenPayloadis inpresenter/.NextStep#dispatch_payloadandNextStep#base_terminal_payloadare inpipeline/next_step.rb:69-86.CompletionIntake#payloadand#dispatch_reply_fieldsare incommand/completion_intake.rb:112-121.OpenPayloadandNextStepeach build thesession_id,implementation_id,nodeandinstructionskeys with no shared code. A new payload field, such as the failure block, would go intopipeline/and make the problem worse.Reproduce
n/a: refactor ticket.
Approach
NextStepdecides which payload applies. A presenter renders it.Put the shared keys in one place that all three payloads use.
CompletionIntakekeeps its decision logic and gets its reply hash from a presenter. The JSON that each command prints does not change: same keys, same values, same order where tests pin order.Test boundary: the new presenters themselves.
Implementation::DispatchPayload.for(...).to_h,Implementation::TerminalPayload.for(...).to_h, thecompletion_recordedreply presenter,Implementation::Timestamp#to_sandImplementation::Duration#to_sdo not exist yet, so tests against them are red for the intended reason. The existing tests atCompletionIntake.callandNextStep#callalready pin the payload JSON and must stay green unchanged. A test only atCompletionIntake.callpasses before any production change, and the run escalates withunexpected_pass(implementation 63).Required work:
NextStep#dispatch_payloadto a presenter inlib/os_sdlc/presenter/implementation/.NextStep#terminal_payloadand#base_terminal_payloadto a presenter in the same directory.completion_recordedreply rendering fromCompletionIntake#payloadand#dispatch_reply_fieldsto a presenter namedImplementation::CompletionReply.session_id,implementation_id,nodeandinstructionskeys in one place, used byOpenPayloadand the new presenters — check:grep -n "implementation_id:" plugins/os-sdlc/lib/os_sdlc/pipeline/next_step.rb plugins/os-sdlc/lib/os_sdlc/command/completion_intake.rbprints nothing.command/stall_watch.rbandcommand/start_subagent.rbare out of scope.OsSdlc::TimestampandOsSdlc::Durationfrompresenter/timestamp.rbandpresenter/duration.rbtopresenter/implementation/asImplementation::TimestampandImplementation::Duration, with their tests. All callers are insideOsSdlc::Implementation(lens A2 rule 3, from the #804 lens challenge) — check:ls plugins/os-sdlc/lib/os_sdlc/presenter/implementation/timestamp.rb plugins/os-sdlc/lib/os_sdlc/presenter/implementation/duration.rbRejected: add the failure field to
NextStep#dispatch_payloaddirectly — it puts more rendering intopipeline/.Acceptance criteria
reason,state_dumpon escalation, andcommitwhen present.os-sdlc-subagent-stopreplies, then the reply is the same as before, includingnext_stepandfinal_output.Implementation::DispatchPayloadrenders them, then it returns thedispatchpayload hash.Implementation::TerminalPayloadrenders it, then it returns the terminal payload hash, withstate_dumpon escalation andcommitwhen present.Implementation::TimestampandImplementation::Durationrender them, then the text is the same asOsSdlc::TimestampandOsSdlc::Durationgave before the move.Owner sketch
Non-goals
No new payload fields. The failure block is a separate ticket that depends on this one.
Origin
pipeline/← DESIGN (pipeline/next_step.rb:82-86)plugins/os-sdlc/lib/os_sdlc/pipeline/next_step.rb,plugins/os-sdlc/lib/os_sdlc/command/completion_intake.rbScope addition from #804 lens challenge: A2 rule (3) applies. Move OsSdlc::Timestamp and OsSdlc::Duration (presenter/timestamp.rb, presenter/duration.rb) under presenter/implementation/ as Implementation::Timestamp and Implementation::Duration; callers already sit inside OsSdlc::Implementation, so no caller edits. Promote to top level only when a caller outside Implementation appears (A2 rule 2).
Work started on branch ticket-805 via /os-sdlc:implement (maps/coding.yaml, behavior-preserving refactor).
Correction: running maps/poodr-ticket-implementation.yaml, not coding.yaml. The new presenter classes and the Timestamp/Duration move need test-writer edits.
Implementation 63 escalated: unexpected_pass:test-writer/diff-test at dispatch 652. Cause: under-decomposed ticket. The seam was CompletionIntake.call, where a behavior-preserving refactor has no red test. Recovery per escalation procedure: ticket edited to name the new presenters as the test boundary (AC 4-6), R4 check narrowed, reply presenter named Implementation::CompletionReply. Re-opening as a new implementation.
Implementation 64 failed: verdict:error from test-reviewer dispatch 669. Failed step: test-reviewer after the behavior-verifier (665) sent the run back to test-writer. Gate details: 8 of 10 new tests were green because programmer 662 had already built the presenters; the reviewer treated green tests as a defect. Its own note says the correct verdict was pass. Worktree ticket-805 is kept with the partial work (presenters built, 2 red commit-case tests). Workflow defect captured separately.
Resolution
Done: Payload rendering moved into presenters Implementation::DispatchPayload, TerminalPayload, CompletionReply, Identity, CompletionOutcome; Timestamp and Duration moved to presenter/implementation/; JSON unchanged. Merged to main
17d051b7(hand-finished after #811).Evidence: Merge
17d051b7(ff). ruby tests/all.rb in plugins/os-sdlc: 1311 runs, 2870 assertions, 0 failures, 0 errors, 9 skips. rubocop 22 files no offenses. grep -n 'implementation_id:' next_step.rb completion_intake.rb prints nothing.Follow-ups: #811 (test-reviewer round scope) must ship before the next pipeline run; #806 unblocked