Declare the dispatch preload on the association and delete Dispatch.for_summary #816
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#816
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
Dispatch.for_summaryis named for its one caller, not for what it returns. It returns every dispatch of an implementation, sorted by id, with three associations preloaded. It does not filter anything. The preload list is knowledge about the implementation's dispatches, but it lives in a dataset method onDispatch..oldestrepeats theorder: :idthat the association already declares.Reproduce
n/a: refactor with no behavior change.
Approach
Declare the preload on the association with Sequel's
eager:association option. The presenter readsimplementation.dispatches. Deletefor_summary.The
eager:option applies only when code loads the cached associationimplementation.dispatches. It does not apply todispatches_dataset. No code underlib/callsimplementation.dispatchestoday, so the summary presenter is the only reader that pays for the preload.Required work:
eager: %i[agent step_results created_handoff]toone_to_many :dispatchesinmodel/implementation.rb— check:cd plugins/os-sdlc && grep -n "eager: %i\[agent step_results created_handoff\]" lib/os_sdlc/model/implementation.rbpresenter/implementation/summary.rbto readimplementation.dispatches— check:cd plugins/os-sdlc && grep -c "for_summary" lib/os_sdlc/presenter/implementation/summary.rbprints 0for_summaryfrommodel/dispatch/queries.rb— check:cd plugins/os-sdlc && grep -rc "for_summary" lib | grep -v ":0"prints nothingRejected: a query-count test that pins the
eagerlist onfor_summary— it tests where the preload lives, not what the summary shows. Rejected: anImplementation#summary_dispatchesor#dispatch_summarymethod — both name the reader, andDispatchSummaryalready exists as the presenter that takes these dispatches.Acceptance criteria
Implementation#summaryruns, then it lists the same dispatches in the same id order, with the same agent, step, and handoff fields, as before.Implementation#summaryruns, then it returns an empty dispatch list, as before.Owner sketch
Origin
lib/os_sdlc/model/dispatch/queries.rb)Work started on branch ticket-816 (os-sdlc implementation, coding map).
Resolution
Done: one_to_many :dispatches on Implementation now declares eager: %i[agent step_results created_handoff]. Implementation::Summary reads implementation.dispatches. Dispatch.for_summary deleted.
Evidence: Commit
cf8d8873on branch ticket-816. os-sdlc implementation 70 (coding map): programmer gate diff-test+lint pass (dispatch 704), reviewer pass (705), suite gate pass in 17.9 s (706). tests/presenter/implementation/summary_test.rb covers both criteria.Follow-ups: 1. Reviewer: implementation.dispatches caches after first load; only the summary reads it today; dropped, no current reader at risk. 2. A stray plugins/os-sdlc/lib/os_sdlc/.sdlc/ (pipeline.db plus a 0-byte pipeline.db.stale) appeared during the run; evidence for the fresh-db-archived-to-stale defect, recorded in the session handoff, ticket to follow.