20: Add forgejo_milestone_create tool #34
No reviewers
Labels
No labels
bug
chore
documentation
enhancement
feature
ready
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
david/pi-extensions-and-skills!34
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/issue-20/add-forgejo-milestone-create-tool"
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?
20: Add forgejo_milestone_create tool
Implements 20.
Generated in 7m 37s.
Review findings
I have a full picture now. Let me apply the fixes. Starting with the source code fixes:Now the docs fixes (README and DESIGN.md):Now add the formatting-branch tests to
tests/tools.test.ts:Now run the gates (build, check, test) as detected frompackage.json:All gates pass (136 tests, up from 134 with the two new formatting-branch tests). Let me verify the final diff of my remediation changes:All fixes are applied and gates are green. Here is the annotated findings document.Review Findings — 20
Summary
Stage 1 adds
forgejo_milestone_create(tool handler insrc/index.ts, API wrapper in newsrc/milestones.ts, unit tests intests/milestones.test.tsandtests/tools.test.ts, registration updated intests/index.test.ts). Gates run:npm run build(tsc) — PASS;npm run check(tsc --noEmit) — PASS;npm test(jest) — PASS (136 tests / 9 suites after adding 2 formatting-branch tests); lint — N/A (no lint script or config exists in the project). Remediation pass resolved all code/docs/test findings: reworded thepromptGuidelines(no more nonexistentforgejo_list_milestonescall), documented the tool in README.md and docs/DESIGN.md (with the v2 future-enhancement entry adjusted to scope it to list/lookup), dropped the deadidparameter frommilestonePath, hardened theopen_issues/closed_issuesguards to!= null, and added tests locking theformatMilestoneformatting branches. The only unresolved finding is the existing commit message (20: ...vs theissue-20: ...convention), which this stage cannot amend because the pipeline does not commit or rewrite history.Critical
High
promptGuidelinestells the agent to "Use forgejo_list_milestones afterwards to confirm the new milestone's id", butforgejo_list_milestonesis not registered anywhere in the extension (onlyforgejo_milestone_createexists; docs/DESIGN.md:21,208 explicitly deferforgejo_list_milestonesto v2). Every follow-up agent turn would attempt a nonexistent tool call and fail. Suggested fix: reword the guideline to "The created milestone's id is returned in the tool result; use it as themilestoneparam of forgejo_issue_create/forgejo_pr_create."Medium
forgejo_label_create) updates README.md and docs/DESIGN.md when adding a tool. Suggested fix: add aforgejo_milestone_createrow to the README tool table (and DESIGN.md matrix), and remove/adjust the "Milestones (v2)" future-enhancement entry now that a milestone create tool exists.Low
milestonePath(target, id?)has a deadidparameter and an untested/milestones/5branch; onlycreateMilestonecalls it, always without an id. Suggested fix: drop theidparameter until a view/list-milestone function needs it.open_issues/closed_issuesare guarded with!== undefinedwhiledescription/due_onuse truthy checks. If Forgejo ever returnsnullfor these (the codebase already normalizes nulls from the API — see the issue #29 regression fix for null labels/assignees), the text would print "Open issues: null" and details would carrynull. Suggested fix: use!= null(or truthy) guards for consistency with the other fields.formatMilestone's conditional branches ("Due:" line, open/closed issue counts, description-absent) are untested; the new handler tests only cover a description-present milestone. Suggested fix: add a test case withdue_onset and one with no description/due_on to lock the formatting branches.c3ec43f) — Commit message20: Add forgejo_milestone_create tooldeviates from the AGENTS.md formatissue-<N>: <summary>(e.g.issue-20: ...). Suggested fix: use theissue-20:prefix on the squash-merge commit (prior commits deviate too, but the standard is explicit).