v0.7.0: the PM verbs — list PRs, merge-readiness get_pr, issue comments, search-before-filing, body-gated create_issue - #28
Merged
Conversation
…comments, search-before-filing, body-gated create_issue The verbs a Project Manager needs that the rail still lacked. - github_list_prs(repo?, state="open", limit=30): number/title/author/state/ draft/head->base/reviewDecision/mergeStateStatus/url per row. Reuses api.fetch_prs (its --json field list gained baseRefName + mergeStateStatus; the board rows ignore extras) so the tool and the board can't disagree. - github_get_pr now carries the merge-readiness picture: isDraft, reviewDecision, mergeable, mergeStateStatus, statusCheckRollup summarised (N pass / N fail / N pending [/ N skipped] + the failing check names — both the CheckRun and StatusContext shapes, verified against gh 2.92), reviews (author, state, body <= 300 chars, <= 10 shown). Output bounded at 12k. - github_issue_comments(repo?, number, limit=30): `gh issue view --json comments` (works on PRs); the newest `limit` in chronological order, each body <= 1000 chars, null rows tolerated. - github_search_issues(repo?, query, state="open", limit=20): `gh search issues --repo R`; `all` omits --state (gh only knows open|closed). Documented as DEDUPE BEFORE FILING; create_issue's description points at it. - github_create_issue runs the SAME body gate /issue enforces (gh_issue.missing_sections): a thin body / a bug without repro / a feature without a direction-or-acceptance section is refused with the scaffold and never posted. New `kind` arg picks the gate's sections and adds the type label via labels_for (bug / enhancement first, like /issue). Existing create-issue tests now pass gate-clearing bodies. - api.fetch_issues/fetch_prs type-check the gh body via parse_json — the no-raise sweep caught `gh pr list` returning a non-list crashing the new tool (and, latently, the board route). - Inventory recounted from register(): 15 read / 8 write / 3 review = 26 (the brief said 16; three read tools were added, get_pr was enriched). A test pins the counts against README/PROTO so they can't drift. - Version 0.7.0 in manifest + pyproject (lockstep). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…gate regex parity + label-inferred kind Review of #28, all items: 1. github_search_issues: flags first, the query LAST after a -- separator — a leading qualifier (-label:bug) was read by gh as an unknown shorthand flag (verified live, gh 2.92). argv test with -label:x. 2. github_get_pr shows latestReviews (one per reviewer, their most recent — accepted by gh 2.92) so a dozen bot COMMENTED reviews can't bury a human CHANGES_REQUESTED; an older gh without the field falls back to the NEWEST reviews, never the oldest ten. Tested both ways. 3. dicts() is total: a non-list (statusCheckRollup: 42 / reviews: 42 / comments: 42) is []. A nested-scalars row joined the no-raise sweep — and caught github_get_issue's (author or {}).get on an int; every actor read now goes through _login(). 4. Body-gate parity with protoAgent's CI issue gate (issue-gate.yml): problem += observed|symptom|idea|current behavior|\bwhat\b, repro += root cause, proposal += \bwork\b|plan. infer_kind(): a generic call with a bug / enhancement LABEL is gated as that kind (CI keys on the label) — in the tool AND the /issue command. A test pins a sample heading per regex alternative. Nits: gh_issue.py docstring says the two paths share the GATE; _bounded on github_issue_comments; test_get_pr_output_is_bounded actually reaches 12k; test_register pins the literal '15 read / 8 write / 3 review = 26'; the tool/command agreement test exercises both entry points in BOTH directions (same refusal, same gh argv head + labels when filing). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
QA panel review — PASS
code-review-structural · head 7b0632bf2a32 · formal
This round produced no confirmed findings for PR #28, but that's a coverage gap, not a clean bill of health. Correctness and removed-behavior lanes ran and found nothing meeting the confidence bar; cross-file, conventions, and the structural-analysis (protopatch) pass failed to produce usable output at all, so those angles were never actually reviewed. Fix-first item: re-run the cross-file, conventions, and structural-analysis lanes before merge — don't treat this pass as a clean approval. Nothing to disagree on since no findings were submitted, and the verifier had nothing to confirm or refute this round.
No findings — the review came back clean.
findings JSON (machine-readable)
[]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
v0.7.0 — the PM verbs
The verbs a Project Manager needs that the GitHub rail still lacked after v0.6.0: see the PR board, judge a PR's merge readiness in one call, read a thread, and search before filing — with issue creation held to the same gate
/issuealready enforces. The repo keeps no CHANGELOG; this body is it (PROTO.md §7).Deliverables
github_list_prs(repo?, state="open", limit=30)— number / title / author / state / draft /head -> base/ reviewDecision / mergeStateStatus / url per row. Reusesapi.fetch_prs(its--jsonfield list gainedbaseRefName+mergeStateStatus; the board's rows ignore the extras) so the tool and the board can never disagree about a PR's state.github_get_prnow carries the merge-readiness picture:isDraft,reviewDecision,mergeable,mergeStateStatus,statusCheckRollupsummarised asN pass / N fail / N pending [/ N skipped] — failing: a, b(both theCheckRun{status, conclusion}andStatusContext{state}shapes, verified against gh 2.92), andreviews(author, state, body ≤ 300 chars, ≤ 10 shown). Total output bounded at 12 000 chars.github_issue_comments(repo?, number, limit=30)—gh issue view --json comments(a PR is an issue, verified live on a PR); the newestlimitin chronological order, each body ≤ 1000 chars; null rows tolerated.github_search_issues(repo?, query, state="open", limit=20)—gh search issues --repo R <query> --json number,title,state,url;state: allomits--state(gh only acceptsopen|closed— verified). Description says DEDUPE BEFORE FILING;github_create_issue's description points the model at it.github_create_issueis body-gated with the samegh_issue.missing_sectionsthe/issuecommand uses: a thin body (< 80 chars / no Problem section), abugwithout a repro section, or afeaturewithout a direction-or-acceptance section is refused with the scaffold and never posted. Newkindarg (generic|bug|feature) picks the gate's sections and adds the type label vialabels_for(type label first, like/issue). The existing create-issue tests now pass gate-clearing bodies; a test asserts the tool and the command agree on every refusal.register(): 15 read / 8 write / 3 review = 26 in README + PROTO.md. (The brief said 16 read — three read tools were added; feat: Implement github_create_issue in write_tools.py + test #2 enriches an existing one.)test_inventory_counts_match_the_docspins the numbers against both docs so they can't drift again.Also: the no-raise sweep (now 26 tools × 12 gh shapes × 3 spawn failures) caught
api.fetch_prs/fetch_issuestrustingjson.loadswithout a type check — a non-list body crashed the new tool and, latently, the board route. Both now go throughparse_json.Gates (Python 3.12,
pip install -r requirements-dev.txtexactly as CI) — at7b0632bLive smoke against real repos (gh 2.92.0):
github_get_pron protoAgent#2978 →checks: 18 pass / 0 fail / 0 pending / 2 skipped, 1 review rendered;github_list_prs→ 2 open rows withdraft, UNKNOWN/BLOCKEDflags;github_issue_commentson a PR → the coderabbit comment, capped;github_search_issues "default_repo" --state allon this repo → #23;github_create_issuewith a thin body → "Not filed — …" + scaffold, noghcall.Review round 1 — all items addressed (commit
7b0632b)gh search issues --repo R "-label:bug"→ "unknown shorthand flag"--(verified live). argv test with-label:bug crash.github_get_prshowed the OLDEST 10 reviews — bot COMMENTED reviews buried a human CHANGES_REQUESTEDlatestReviews(one per reviewer, verified on gh 2.92); older gh falls back to the NEWESTreviews. Tested both ways.dicts(42)raised —statusCheckRollup: 42/reviews: 42/comments: 42escapeddicts()is total (non-list →[]). Anested-scalarsrow joined the sweep — and caughtgithub_get_issue's(author or {}).geton an int; every actor read now goes through_login().labels="bug"not gated as a bugissue-gate.yml(observed|symptom|idea|current behavior|\bwhat\b,root cause,\bwork\b|plan);infer_kind()promotes a generic call bybug/enhancementlabel — in the tool AND/issue. A test pins a heading sample per regex alternative.file_issuemissing_sections/infer_kind/labels_for).github_issue_commentsunbounded_bounded(…, 12000).15 read / 8 write / 3 review = 26(PROTO) and**Read** (always, 15)+26 tools in all(README)./issueagainst separate gh stubs: both refuse or both file, with the same gh argv head and labels when filing.🤖 Generated with Claude Code