os-sdlc: reload a timestamp column after stamping it with the DB clock #557
Labels
No labels
P0
P1
P2
P3
bug
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
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#557
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?
Context
ADR-0165 stamps lifecycle columns with
Sequel::CURRENT_TIMESTAMP. Sequel does not reload a row afterupdate, so the in-memory row keeps theSequel::SQL::Constantobject instead of a time.Model#refreshreloads the row but the associations plugin clears the association cache first, which drops the in-memory ADR-0171 commit record. During #552 this crashedDispatchSummary.seconds_betweenwithundefined method 'to_time' for an instance of Sequel::SQL::Constant, and the interim fix reads a fresh row inImplementation#summary. Verified against sequel 5.108.0 source; vault noteuser-guide/sequel-model-transaction-and-multi-db-gotchas.mdsection 3.Observed
Implementation#complete!,fail!,escalate!and the dispatch stamping methods leave the constant in memory.Implementation#summaryworks around it withSummary.for(Models.for(db).implementation[id]).Reproduce
In a test, open an implementation, call
complete!(position: "start"), then inspectcompleted_aton the same object: it is aSequel::SQL::Constant.Expected
One helper in the lifecycle module stamps a column with the DB clock and then reloads only that column (for example via
this.get(column)assigned intovalues), keeping the association cache. All<event>_atwrites use it.Implementation#summarygoes back toSummary.for(self). ADR-0165 stays intact; the DB clock is still the writer. Replacing the constant withTime.nowwas rejected because ADR-0165 chose the DB clock so every writing process shares one clock.Tasks
Implementation#summarytoSummary.for(self).complete!,completed_atis a Time on the same object andcommit_recordsurvives.Origin
Session: 5fdd0aa3-8a9c-4c31-a5b3-d575d8e709ab
Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/5fdd0aa3-8a9c-4c31-a5b3-d575d8e709ab.jsonl
Where: plugins/os-sdlc/lib/os_sdlc/runner/lifecycle.rb; plugins/os-sdlc/lib/os_sdlc/runner/implementation.rb
Filed by: agent, from the user's question on 2026-09-11 about replacing CURRENT_TIMESTAMP with Time.now. Parent: #552.