S23: forge blocks spike (PRs and issues from Forgejo, GitHub, GitLab) #87

Closed
opened 2026-10-03 02:06:49 +00:00 by jhgaylor · 1 comment
Owner

Before: M36. Plan: PLAN's "Forge track", S23.

Forge track. PRs and issues from Forgejo, then GitHub, then GitLab, as one forge block type: attention on the rail, capture --text for agents, and diff, terminal and agent blocks opened on the PR's code. Decided 2026-10-02: Forgejo first, auth through the user's CLIs (tea, gh, glab; illogical stores no tokens), poll now and webhooks later, agents draft and people send.


About half a day. Each answer goes in as a fixture or a measured number:

  1. CLIs as the read path: do tea / gh / glab api passthroughs cover PR, reviews, checks, timeline and diff refs? How each picks a login for a repo (tea here says "no login matched this repository" for the ssh://git@git.tailb2e8f2.ts.net/... remote and falls back to forgejo). Do ETag/304 conditional requests pass through, or does the daemon need the token and its own client?
  2. Cost: a full PR read and an unchanged poll, on Forgejo and GitHub. Measure wall time, requests and rate-limit use.
  3. Normalized model: one PR each on Forgejo, GitHub and gitlab.com mapped to item / review / check / timeline event, plus what doesn't fit (check runs vs statuses, pipelines, draft vs WIP:, threads vs discussions).
  4. Attention rules: which states mean "needs you" (review requested directly or through a team, your checks red, changes requested, mention, green and ready to merge), and who "you" is on each forge.
  5. The PR's code: fetch the head (refs/pull/N/head, refs/merge-requests/N/head) into a worktree, including from a fork, and check that M11's diff on merge-base..head matches the forge's.
  6. Drafts as asks: an agent's comment through MCP becomes an ask, and Send posts it as the person through tea. Measure ask → posted.

Done when: go or no-go in spikes/s23-forge/README.md, with fixtures, and the results written into PLAN.

**Before:** M36. **Plan:** PLAN's "Forge track", S23. *Forge track. PRs and issues from Forgejo, then GitHub, then GitLab, as one `forge` block type: attention on the rail, `capture --text` for agents, and diff, terminal and agent blocks opened on the PR's code. Decided 2026-10-02: Forgejo first, auth through the user's CLIs (`tea`, `gh`, `glab`; illogical stores no tokens), poll now and webhooks later, agents draft and people send.* --- About half a day. Each answer goes in as a fixture or a measured number: 1. **CLIs as the read path:** do `tea` / `gh` / `glab` `api` passthroughs cover PR, reviews, checks, timeline and diff refs? How each picks a login for a repo (`tea` here says "no login matched this repository" for the `ssh://git@git.tailb2e8f2.ts.net/...` remote and falls back to `forgejo`). Do ETag/304 conditional requests pass through, or does the daemon need the token and its own client? 2. **Cost:** a full PR read and an unchanged poll, on Forgejo and GitHub. Measure wall time, requests and rate-limit use. 3. **Normalized model:** one PR each on Forgejo, GitHub and gitlab.com mapped to item / review / check / timeline event, plus what doesn't fit (check runs vs statuses, pipelines, draft vs `WIP:`, threads vs discussions). 4. **Attention rules:** which states mean "needs you" (review requested directly or through a team, your checks red, changes requested, mention, green and ready to merge), and who "you" is on each forge. 5. **The PR's code:** fetch the head (`refs/pull/N/head`, `refs/merge-requests/N/head`) into a worktree, including from a fork, and check that M11's diff on `merge-base..head` matches the forge's. 6. **Drafts as asks:** an agent's `comment` through MCP becomes an ask, and *Send* posts it as the person through `tea`. Measure ask → posted. **Done when:** go or no-go in `spikes/s23-forge/README.md`, with fixtures, and the results written into PLAN.
Author
Owner

Done 2026-10-02: go. Branch s23-forge-spike (cd61397, plus 92a4620 for the decisions). See spikes/s23-forge/README.md and PLAN's S23 section.

  • Read path: tokens come from the CLIs (tea login helper get, gh auth token, glab config get token) and requests go through the daemon's own reqwest. The daemon matches logins itself, because tea matches by ssh_host, and this repo's tailnet remote isn't the login's.
  • Cost:
    • GitHub REST: 7 requests per full read; an unchanged poll gets 304s and uses 0 points. GraphQL would cost a point on every poll.
    • Forgejo sends no ETags, so it polls the item and its combined status (2 requests, 0.1–0.35 s).
  • Model: ForgeRef / Item / Review / Check / Event. The README covers what doesn't fit (Forgejo's requested_reviewers, the empty-status "pending", no rerun API on Forgejo, GitLab's merge-commit pipelines).
  • PR code: fetching the head ref and diffing from the merge base matched the forge's file list on every PR, including forks. GitLab needs diff_refs.base_sha.
  • Drafts as asks: queued in the block, sent through the ask answer path. The writes are review {event}, not approve.
  • Decided (Jake): the owner and editors may send drafts, and each send records who sent it.

M36 (#88) is in progress on m36-forge-prs.

**Done 2026-10-02: go.** Branch `s23-forge-spike` (`cd61397`, plus `92a4620` for the decisions). See `spikes/s23-forge/README.md` and PLAN's S23 section. - **Read path:** tokens come from the CLIs (`tea login helper get`, `gh auth token`, `glab config get token`) and requests go through the daemon's own reqwest. The daemon matches logins itself, because `tea` matches by `ssh_host`, and this repo's tailnet remote isn't the login's. - **Cost:** - GitHub REST: 7 requests per full read; an unchanged poll gets 304s and uses 0 points. GraphQL would cost a point on every poll. - Forgejo sends no ETags, so it polls the item and its combined status (2 requests, 0.1–0.35 s). - **Model:** ForgeRef / Item / Review / Check / Event. The README covers what doesn't fit (Forgejo's `requested_reviewers`, the empty-status "pending", no rerun API on Forgejo, GitLab's merge-commit pipelines). - **PR code:** fetching the head ref and diffing from the merge base matched the forge's file list on every PR, including forks. GitLab needs `diff_refs.base_sha`. - **Drafts as asks:** queued in the block, sent through the ask answer path. The writes are `review {event}`, not `approve`. - **Decided (Jake):** the owner and editors may send drafts, and each send records who sent it. M36 (#88) is in progress on `m36-forge-prs`.
Commenting is not possible because the repository is archived.
No milestone
No project
No assignees
1 participant
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
jhgaylor/illogical#87
No description provided.