Purpose
The Forgejo workflow in ai-shared-rules/github-rules.md still shells out to fj for issues — text output, no labels on create (second call), backtick substitution in comments. Cover the issue side with REST tools so fj is no longer needed for it.
Scope
- new
src/tools/forgejo-issue-create.ts, forgejo-issue-comment.ts, forgejo-issue-comments.ts
src/tools/forgejo-issue-close.ts — zombie check
src/lib/forgejo-utils.ts — label name → id resolver
src/four-opencode-git.ts (register), tests/forgejo-tools.test.ts, AGENTS.md, README.md
Out of Scope
PR tools (next issue). Editing labels on existing issues. Rules update in ai-shared-rules (separate repo).
Steps
forgejo_issue_create — title, body, labels[] (names). Resolve names via GET /repos/{o}/{r}/labels; any unknown name → refuse, create nothing (Unknown label(s): x — run rollout-defekt-labels --apply). POST /issues with labels ids. Returns #N url.
forgejo_issue_comment — POST /issues/{n}/comments; body is a tool argument (never shell). Works for PRs too (same index space). Returns the comment URL.
forgejo_issue_comments — GET /issues/{n}/comments, newest limit (default 10), one line each: author date: first line… (truncated).
forgejo_issue_close — zombie check mirroring gh_issue_close: warn when the issue references no merged PR.
- Register, fixture tests, docs (tool count 22 → 25).
AC
Constraints
Depends on the secrets/host-binding issue. Fixture JSON only, no live API in tests.
Escalation triggers
Forgejo API rejecting label ids on create (would need a second call).
Purpose
The Forgejo workflow in
ai-shared-rules/github-rules.mdstill shells out tofjfor issues — text output, no labels on create (second call), backtick substitution in comments. Cover the issue side with REST tools sofjis no longer needed for it.Scope
src/tools/forgejo-issue-create.ts,forgejo-issue-comment.ts,forgejo-issue-comments.tssrc/tools/forgejo-issue-close.ts— zombie checksrc/lib/forgejo-utils.ts— label name → id resolversrc/four-opencode-git.ts(register),tests/forgejo-tools.test.ts,AGENTS.md,README.mdOut of Scope
PR tools (next issue). Editing labels on existing issues. Rules update in
ai-shared-rules(separate repo).Steps
forgejo_issue_create—title,body,labels[](names). Resolve names viaGET /repos/{o}/{r}/labels; any unknown name → refuse, create nothing (Unknown label(s): x — run rollout-defekt-labels --apply).POST /issueswithlabelsids. Returns#N url.forgejo_issue_comment—POST /issues/{n}/comments; body is a tool argument (never shell). Works for PRs too (same index space). Returns the comment URL.forgejo_issue_comments—GET /issues/{n}/comments, newestlimit(default 10), one line each:author date: first line…(truncated).forgejo_issue_close— zombie check mirroringgh_issue_close: warn when the issue references no merged PR.AC
POST /issuescall$()arrives verbatim (fixture asserts request body)bun test,tsc --noEmitgreenConstraints
Depends on the secrets/host-binding issue. Fixture JSON only, no live API in tests.
Escalation triggers
Forgejo API rejecting label ids on create (would need a second call).