Fix the os-sdlc PostToolUse:Agent hook: bind the database before the Implementation constant loads #1754
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#1754
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 os-sdlc
PostToolUse:Agenthook raises on each async agent launch in a project with a pipeline database. The transcript gets ahook_non_blocking_errorrecord, and the next instruction that the hook must inject is lost.Observed
Counts from the transcripts under
~/.claude/projectson 2026-11-13: 553hook_non_blocking_errorrecords dated 2026-11-11 to 2026-11-13.514 of them have the hook
PostToolUse:Agent, all dated 2026-11-11 to 2026-11-13:plugins/os-sdlc/lib/os_sdlc/hook.rb:33is:Ruby resolves the receiver
Implementation::NextInstructionbefore it evaluates the argumentconnect(root). The constant lookup loadsimplementation.rb, whereclass Implementation < Sequel::Modelneeds a database.connect(root)is the call that binds the database, and it has not run yet. The other two hook entries usein_project, which callsconnect(root)first. Commit031244657(2026-11-10, #1646) wrote line 33 in this form.Reproduce
Launch one background Agent in a session whose project has
.sdlc/pipeline.db. The transcript gets the error above.Approach
Hook#post_tool_usebinds the database before it names anImplementationconstant, asin_projectdoes.Required work: none beyond the acceptance criteria.
Acceptance criteria
.sdlc/pipeline.db, when thePostToolUsehook runs for an async Agent launch, then it exits 0 and prints the next-instruction envelope.hook_non_blocking_errorrecords with the textNo database associated with Sequel::Modelfromhook.rb:33, then the count is 0.Non-goals
The trim-status-table hook path. A separate ticket of 2026-11-13 covers it.
Origin
031244657(#1646) wrote the call in that order ← DESIGN (plugins/os-sdlc/lib/os_sdlc/hook.rb)VERDICT: CREATE (ticket-skeptic, 2026-11-13): observed recurring failure, 514 records; the skeptic split the draft into two tickets by mechanism.