Ticket loads its comments one time as typed Comment objects #1633
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#1633
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
Ticket#commentssends a newGET /issues/{n}/commentson each call and returnsArray<String>. The hosts discard theid,user, andcreated_atthat Forgejo sends. Each comment kind is then found with its own string check, and a claim has no age, so code cannot tell a stale claim from a live one.lib/backlog/ticket/claiming.rb:43body.include?("## Bounced")lib/backlog/claim.rb:52,lib/backlog/resolution.rbinclude?(Resolution::HEADING)lib/backlog/ticket.rbrequest_reviewinclude?("Needs review: ...")lib/backlog/decision_sweep/gate_application.rb:31include?(FAILURE_HEADING)lib/backlog/ticket/claiming.rb:46One
ticket claimthat bounces sends two comment requests (claim.rb:29andtracker.rb:58).Reproduce
n/a: design change; the Problem cites each site.
Approach
id,author,created_at, andbody.GET /issues/{n}/commentshas no paging (server spec: onlysinceandbefore), so one request returns all comments.Comment.buildreads the type from one data block in the body, parsed withYAML.safe_load. A comment with an unknown kind becomesComment::Note.Comment::Claimcarriesagent_id,session_id,implementation_id(when os-sdlc runs the work), andclaimed_at, which is the commentcreated_at. The caller decides what to do with an existing claim. The code has no staleness rule.Comment::Claimis the comment value. Rename the checkout procedureBacklog::Claim(lib/backlog/claim.rb) to make the name free.save!adds the posted comments to@commentsor clears the cache, so the duplicate-post protection intracker.rb:58still holds.claim unless claimed?is not atomic. No lock: a survey of 3,063 comments found no double claim.Required work: none beyond the acceptance criteria.
Orchestrator work: the data block is vocabulary that other code parses; run
/os-adr:createbefore the build.Rejected: staleness checks that look up the session or implementation; no double claim has been seen, so the code would handle a case that does not occur.
Acceptance criteria
commentstwo times in one command, then the host gets one comments request.## Resolutioncomment with no data block, when the ticket loads, thenticket.resolutionscontains it.ticket claim --agent-id probe-7, when the ticket loads, thenticket.claims.lasthasagent_id"probe-7", asession_id, and aclaimed_atequal to the commentcreated_at.claimed?is false.include?orstart_with?on a heading.Owner sketch
Origin
lib/backlog/host/forgejo.rb:45,lib/backlog/ticket.rbcomments)VERDICT: CREATE
ADR-0308 records the comment data block format (docs/adr/0308-os-backlog-comments-that-code-reads-carry-one-machine-data-block.md). Orchestrator work done.
Start: os-sdlc implement on branch ticket-1633 (session 241a8fe6-1aa7-44b4-b9ff-4b38d4bc9515).
Resolution
Done: Ticket#comments loads one time per ticket as typed Comment objects (Claim, Bounce, Resolution, Review, GateFailure, Note) from host Comment::Records with id, author, created_at (Time). All writers append the ADR-0308 data block; kind detection is by class with a legacy-heading fallback. Claims carry agent_id and session_id (CLAUDE_CODE_SESSION_ID). Backlog::Claim renamed Backlog::Pickup. Commit
0255bcc0on main.Evidence: os-backlog suite 551 runs 0 failures (3 runs in worktree, 1 on main); os-sdlc suite 3510 runs 0 failures; rubocop total 35 = main baseline, none in touched files; grep finds no heading check for a comment kind in lib (only Ticket::Body body checks); live read of #335 from Forgejo gives Note/Note/Resolution with author jared and Time created_at; one design audit, 1 must-fix + 4 should-fix fixed. Pipeline run 262 escalated (120) and was hand-finished, then abandoned.
Follow-ups: Dropped: a writer for Claim#implementation_id (no os-sdlc caller of ticket claim yet; reader returns nil until one exists). Dropped: moving Backlog::Pickup to a Checkout root (audit note only; no defect). Already filed outside this repo: jared/forgejo-api#3 (repo-wide comment list stops after page 1).