Run issue-show and issue-edit through Ticket, Tracker, and the Forgejo host #1615

Closed
opened 2026-11-06 20:06:21 +00:00 by jared · 2 comments
Owner

Problem

The os-backlog code has no object that stands for a ticket, so each command repeats its own reads and writes. This slice proves the accepted object design end to end on the two simplest commands.

Approach

Build the tracer from sections 1 and 3 of docs/system-design-format/proof/2026-11-06-os-backlog-domain-objects.md. Ticket uses ActiveModel (ADR-0307). Tracker#save owns the write order: comments, add labels, remove labels, title and body, assignee, state. Other commands stay on the old code.

Backlog::Tracker already exists and only parses text. The new Tracker needs that name, so this slice renames the old one to Tracker::Address.

Required work:

  1. Add Ticket with find, setters, save, save!, valid?, and attributes — check: present class Ticket in plugins/os-backlog/lib/backlog/**/*.rb
  2. Add LabelList — check: present class LabelList in plugins/os-backlog/lib/backlog/**/*.rb
  3. Rename the text parser to Tracker::Address and add the new Tracker — check: present class Address in plugins/os-backlog/lib/backlog/**/*.rb
  4. Add the Memory host for tests and the Forgejo host — check: present class Memory in plugins/os-backlog/lib/backlog/**/*.rb
  5. Route issue-show and issue-edit through Ticket.

Acceptance criteria

  1. Given a ticket from the Memory host, when a caller sets the body, adds a label, and saves, then the host receives the writes in the stated write order.
  2. Given a label added as a symbol, when the caller reads ticket.labels, then the list holds a unique string.
  3. Given a Forgejo ticket, when issue-show runs, then the JSON keys body, labels, state, and title hold the same values as before the port.
  4. Given issue-edit with a body file, when it runs, then one read and one write occur and no create gate runs.
  5. Given a label name unknown to Forgejo, when save writes it, then the write fails.
  6. Given a failed validation, when save runs it returns false, and when save! runs it raises.
  7. Given a Ticket, when a caller sends state=, then Ruby raises NoMethodError.

Owner sketch

class Backlog::Ticket
  include ActiveModel::Model
  def self.find(number)
  def save
  def save!
end
class Backlog::Tracker
  def find(number)
  def save(ticket)
end

Non-goals

Do not rename a command before slice 9. Do not change ## Resolution, **Follow-ups:**, the body headings, the check form, the label names, or the issue-show JSON keys. Do not make a behavior change that this ticket does not name.

Blocking edges

Blocked by #1614

Origin

  • Trigger: port plan, section 5 of docs/system-design-format/proof/2026-11-06-os-backlog-domain-objects.md, slice 2
  • Improvised this session: none
  • Chain: os-backlog code has no domain objects ← commands own their own reads and writes ← DESIGN (ADR-0307, plugins/os-backlog/CONTEXT.md)
  • Root candidate: none found; searched Ticket, Tracker, Host, issue-show, ADR-0307
  • Where: plugins/os-backlog/lib/backlog/issue_show.rb, plugins/os-backlog/lib/backlog/tracker.rb, plugins/os-backlog/lib/backlog/forgejo_backend.rb
  • Session: 9d8c2e15-00c1-4dec-b177-e749fa05ec67
  • Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/9d8c2e15-00c1-4dec-b177-e749fa05ec67.jsonl

VERDICT: CREATE

## Problem The os-backlog code has no object that stands for a ticket, so each command repeats its own reads and writes. This slice proves the accepted object design end to end on the two simplest commands. ## Approach Build the tracer from sections 1 and 3 of `docs/system-design-format/proof/2026-11-06-os-backlog-domain-objects.md`. `Ticket` uses ActiveModel (ADR-0307). `Tracker#save` owns the write order: comments, add labels, remove labels, title and body, assignee, state. Other commands stay on the old code. `Backlog::Tracker` already exists and only parses text. The new `Tracker` needs that name, so this slice renames the old one to `Tracker::Address`. Required work: 1. Add `Ticket` with `find`, setters, `save`, `save!`, `valid?`, and `attributes` — check: present `class Ticket` in `plugins/os-backlog/lib/backlog/**/*.rb` 2. Add `LabelList` — check: present `class LabelList` in `plugins/os-backlog/lib/backlog/**/*.rb` 3. Rename the text parser to `Tracker::Address` and add the new `Tracker` — check: present `class Address` in `plugins/os-backlog/lib/backlog/**/*.rb` 4. Add the `Memory` host for tests and the `Forgejo` host — check: present `class Memory` in `plugins/os-backlog/lib/backlog/**/*.rb` 5. Route `issue-show` and `issue-edit` through `Ticket`. ## Acceptance criteria 1. Given a ticket from the Memory host, when a caller sets the body, adds a label, and saves, then the host receives the writes in the stated write order. 2. Given a label added as a symbol, when the caller reads `ticket.labels`, then the list holds a unique string. 3. Given a Forgejo ticket, when `issue-show` runs, then the JSON keys `body`, `labels`, `state`, and `title` hold the same values as before the port. 4. Given `issue-edit` with a body file, when it runs, then one read and one write occur and no create gate runs. 5. Given a label name unknown to Forgejo, when `save` writes it, then the write fails. 6. Given a failed validation, when `save` runs it returns false, and when `save!` runs it raises. 7. Given a `Ticket`, when a caller sends `state=`, then Ruby raises NoMethodError. ## Owner sketch ```ruby class Backlog::Ticket include ActiveModel::Model def self.find(number) def save def save! end class Backlog::Tracker def find(number) def save(ticket) end ``` ## Non-goals Do not rename a command before slice 9. Do not change `## Resolution`, `**Follow-ups:**`, the body headings, the check form, the label names, or the `issue-show` JSON keys. Do not make a behavior change that this ticket does not name. ## Blocking edges Blocked by #1614 ## Origin - Trigger: port plan, section 5 of `docs/system-design-format/proof/2026-11-06-os-backlog-domain-objects.md`, slice 2 - Improvised this session: none - Chain: os-backlog code has no domain objects ← commands own their own reads and writes ← DESIGN (ADR-0307, `plugins/os-backlog/CONTEXT.md`) - Root candidate: none found; searched Ticket, Tracker, Host, issue-show, ADR-0307 - Where: plugins/os-backlog/lib/backlog/issue_show.rb, plugins/os-backlog/lib/backlog/tracker.rb, plugins/os-backlog/lib/backlog/forgejo_backend.rb - Session: 9d8c2e15-00c1-4dec-b177-e749fa05ec67 - Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/9d8c2e15-00c1-4dec-b177-e749fa05ec67.jsonl VERDICT: CREATE
Author
Owner

Work started on branch ticket-1615.

Work started on branch ticket-1615.
Author
Owner

Resolution

Done: Added Ticket, LabelList, Tracker, Tracker::Address, and the Host role with Memory and Forgejo. issue-show and issue-edit run through Ticket on Forgejo; other hosts stay on the old path.

Evidence: Merged to main in ebc9fbe2 and 94fec410 (commits 8eadad4e, ebc9fbe2). Suite on main: 407 runs, 0 failures, on seed 19992 and 6 random seeds. Lint gate passed. A real issue-show read Forgejo through the tracer. Contract audit corrections applied by hand.

Follow-ups: Comments and state join Tracker#save in #1617 and #1618 (commented). Tracker forwarders go in #1621 (commented).

## Resolution **Done:** Added Ticket, LabelList, Tracker, Tracker::Address, and the Host role with Memory and Forgejo. issue-show and issue-edit run through Ticket on Forgejo; other hosts stay on the old path. **Evidence:** Merged to main in ebc9fbe2 and 94fec410 (commits 8eadad4e, ebc9fbe2). Suite on main: 407 runs, 0 failures, on seed 19992 and 6 random seeds. Lint gate passed. A real issue-show read Forgejo through the tracer. Contract audit corrections applied by hand. **Follow-ups:** Comments and state join Tracker#save in #1617 and #1618 (commented). Tracker forwarders go in #1621 (commented).
jared closed this issue 2026-11-06 20:59:25 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jared/cc-os#1615
No description provided.