Add the GitHub and Files hosts and fix their defects #1616

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

Problem

Ticket runs only on Forgejo after the tracer. The repo: backend also has defects that lose data.

Approach

Host::Files and Host::GitHub wrap FileBackend and GithubBackend, as Host::Forgejo wraps ForgejoBackend. Fix the defects in the backend, so every command gains the fix now and no second copy exists. Slice 8 moves the code into the hosts when it deletes the backends. Host#labels? returns false on Files, and slice 7 uses it. Owned rules: inventory 1.9 and 2.2.

The repo: list still hides closed tickets. Only a read of one ticket shows them.

Required work:

  1. Add Host::Files — check: present def labels? in plugins/os-backlog/lib/backlog/**/*.rb
  2. Add Host::GitHub on GithubBackend — check: present class GitHub in plugins/os-backlog/lib/backlog/**/*.rb
  3. Route CLI::Session#ticket to the host for each tracker kind, and delete the legacy fallback in CLI::IssueTarget — check: absent legacy_show in plugins/os-backlog/lib/backlog/cli/issue_target.rb
  4. Fix inventory defects 1, 2, 3, 4, 19, and 21.
  5. Check whether the Forgejo label list stops at 50 (defect 12). Fix it if it does.

Acceptance criteria

  1. Given a repo: ticket with no labels, when a label is added, then the state: line stays intact.
  2. Given a closed repo: ticket, when issue-show runs, then its title, labels, and closed state appear.
  3. Given a closed repo: ticket, when issues runs, then the ticket does not appear.
  4. Given a repo: ticket, when issue-comments runs, then the result holds comments and no body paragraphs.
  5. Given a repo: tracker with an issue numbered 1000 or above, when a ticket is created, then its number does not collide.
  6. Given a repo: file with no state: key, when it closes, then state: lands inside the front matter.
  7. Given issue-show on each host, when it runs, then the output has the same keys as on Forgejo.
  8. Given issue-edit on a repo: and a github: tracker, when it runs, then the title and body change through Ticket.
  9. Given a Forgejo repository with more than 50 labels, when a ticket adds the last label, then the write finds it.
  10. Given HostRoleTests, when it runs against Host::Files and Host::GitHub, then each example passes.

Owner sketch

class Backlog::Host::GitHub
  def find(number)
class Backlog::Host::Files
  def labels? = false

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 #1615
Blocked by #857

Origin

  • Trigger: port plan, section 5 of docs/system-design-format/proof/2026-11-06-os-backlog-domain-objects.md, slice 3
  • 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 gh_backend, file_backend, octokit, repo: backend (#857 overlaps only the octokit step)
  • Where: plugins/os-backlog/lib/backlog/issues/gh_backend.rb, plugins/os-backlog/lib/backlog/issues/file_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 `Ticket` runs only on Forgejo after the tracer. The `repo:` backend also has defects that lose data. ## Approach `Host::Files` and `Host::GitHub` wrap `FileBackend` and `GithubBackend`, as `Host::Forgejo` wraps `ForgejoBackend`. Fix the defects in the backend, so every command gains the fix now and no second copy exists. Slice 8 moves the code into the hosts when it deletes the backends. `Host#labels?` returns false on Files, and slice 7 uses it. Owned rules: inventory 1.9 and 2.2. The `repo:` list still hides closed tickets. Only a read of one ticket shows them. Required work: 1. Add `Host::Files` — check: present `def labels?` in `plugins/os-backlog/lib/backlog/**/*.rb` 2. Add `Host::GitHub` on `GithubBackend` — check: present `class GitHub` in `plugins/os-backlog/lib/backlog/**/*.rb` 3. Route `CLI::Session#ticket` to the host for each tracker kind, and delete the legacy fallback in `CLI::IssueTarget` — check: absent `legacy_show` in `plugins/os-backlog/lib/backlog/cli/issue_target.rb` 4. Fix inventory defects 1, 2, 3, 4, 19, and 21. 5. Check whether the Forgejo label list stops at 50 (defect 12). Fix it if it does. ## Acceptance criteria 1. Given a `repo:` ticket with no labels, when a label is added, then the `state:` line stays intact. 2. Given a closed `repo:` ticket, when `issue-show` runs, then its title, labels, and closed state appear. 3. Given a closed `repo:` ticket, when `issues` runs, then the ticket does not appear. 4. Given a `repo:` ticket, when `issue-comments` runs, then the result holds comments and no body paragraphs. 5. Given a `repo:` tracker with an issue numbered 1000 or above, when a ticket is created, then its number does not collide. 6. Given a `repo:` file with no `state:` key, when it closes, then `state:` lands inside the front matter. 7. Given `issue-show` on each host, when it runs, then the output has the same keys as on Forgejo. 8. Given `issue-edit` on a `repo:` and a `github:` tracker, when it runs, then the title and body change through `Ticket`. 9. Given a Forgejo repository with more than 50 labels, when a ticket adds the last label, then the write finds it. 10. Given `HostRoleTests`, when it runs against `Host::Files` and `Host::GitHub`, then each example passes. ## Owner sketch ```ruby class Backlog::Host::GitHub def find(number) class Backlog::Host::Files def labels? = false ``` ## 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 #1615 Blocked by #857 ## Origin - Trigger: port plan, section 5 of `docs/system-design-format/proof/2026-11-06-os-backlog-domain-objects.md`, slice 3 - 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 gh_backend, file_backend, octokit, repo: backend (#857 overlaps only the octokit step) - Where: plugins/os-backlog/lib/backlog/issues/gh_backend.rb, plugins/os-backlog/lib/backlog/issues/file_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-1616.

Work started on branch ticket-1616.
Author
Owner

Work restarted on branch ticket-1616, with the corrected ticket body.

Work restarted on branch ticket-1616, with the corrected ticket body.
Author
Owner

Resolution

Done: Host::Files and Host::GitHub wrap the old backends. issue-show and issue-edit run through Ticket on every tracker. IssueShow and the legacy fallback are deleted. Defects 1, 2, 3, 4, 19, 21 are fixed in FileBackend. Defect 12 is not a defect: forgejo-api walks every label page. A closed repo: ticket now gives its title and labels to every reader, as on Forgejo, so close, occurrence, categorize, checkout, bounce, and the sweep gate treat it as they do on Forgejo. Hand-finished: run 250 stalled and is abandoned.

Evidence: main a45d11e8: os-backlog 468 runs, os-sdlc 3508 runs, ticket-takedown 623 runs, all 0 failures. Branch: seed 19992 plus three random seeds. AC9 test runs the real Forgejo Page class and fails under a first-page-only mutation. One design audit: KeyError finding rejected because require_cwd_tracker refuses a malformed tracker first; green tests kept as regression pins.

Follow-ups: none. Runner stall recorded as an occurrence on #773.

## Resolution **Done:** Host::Files and Host::GitHub wrap the old backends. issue-show and issue-edit run through Ticket on every tracker. IssueShow and the legacy fallback are deleted. Defects 1, 2, 3, 4, 19, 21 are fixed in FileBackend. Defect 12 is not a defect: forgejo-api walks every label page. A closed repo: ticket now gives its title and labels to every reader, as on Forgejo, so close, occurrence, categorize, checkout, bounce, and the sweep gate treat it as they do on Forgejo. Hand-finished: run 250 stalled and is abandoned. **Evidence:** main a45d11e8: os-backlog 468 runs, os-sdlc 3508 runs, ticket-takedown 623 runs, all 0 failures. Branch: seed 19992 plus three random seeds. AC9 test runs the real Forgejo Page class and fails under a first-page-only mutation. One design audit: KeyError finding rejected because require_cwd_tracker refuses a malformed tracker first; green tests kept as regression pins. **Follow-ups:** none. Runner stall recorded as an occurrence on #773.
jared closed this issue 2026-11-06 22:22:14 +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#1616
No description provided.