Repository navigation
feat: github view data: detail.py foundation + gated GET /detail/pr route (read-only) - #47
Conversation
There was a problem hiding this comment.
QA panel review — PASS
code-review-structural · head 515eeab97207 · formal
Low-risk, purely additive PR: a new detail.py module, its test file, and one new route in api.py. No correctness or cross-file defects were found. The single surviving item is a documentation nit — detail.py is missing from PROTO.md's §3 file-layout table. The verifier confirmed it against the file at head. No panel disagreement, no verification gaps, no prior requests to disposition.
Findings
| Severity | Location | Finding | Verified | |
|---|---|---|---|---|
| ⚪ | nit | PROTO.md |
The new detail.py module is not added to the file-layout table in PROTO.md §3, which documents every module in the package. |
confirmed |
findings JSON (machine-readable)
[
{
"file": "PROTO.md",
"line": 0,
"severity": "nit",
"category": "conventions",
"claim": "The new `detail.py` module is not added to the file-layout table in PROTO.md \u00a73, which documents every module in the package.",
"evidence": "PROTO.md \u00a73 lists `__init__.py`, `gh_cli.py`, `status.py`, `projects.py`, `read_tools.py`, `write_tools.py`, `review_tools.py`, `gh_issue.py`, `api.py`, `view.py`, `tests/` \u2014 but the PR adds `detail.py` without updating the table.",
"verdict": "confirmed",
"note": "Read PROTO.md at head 515eeab: \u00a73 table ends with `view.py` and `tests/`; `detail.py` is absent. The diff adds `detail.py` as a new module. Finding is accurate."
}
]1 finding(s) excluded from the verdict by in-diff confinement (file not among this PR's changed paths):
PROTO.md(nit) — The newdetail.pymodule is not added to the file-layout table in PROTO.md §3, which documents every module in the package.
There was a problem hiding this comment.
Promoting the PASS verdict for head 515eeab97207: all checks terminal-green, zero unresolved review threads. (approve-on-green)
Open findings carried by this approval — non-blocking, but they did not go away:
- nit
PROTO.md:0— The newdetail.pymodule is not added to the file-layout table in PROTO.md §3, which documents every module in the package.
Approving a WARN does not resolve its findings (issue #22).
Summary
Adds
detail.py, the data foundation for epic bd-nm78's in-console PR/issue drawer. It is a host-free module of plain async functions in theapi.fetch_prsstyle: everyghcall goes throughrun_gh, the repo is validated withbad_repo(), failures are classified withcheck_gh_error, bodies are parsed withparse_json, and each function returns a dict or{"error": …}and never raises.fetch_pr_detail(repo, number, fresh=False)makes onegh pr view N --repo o/n --json <fields>call and returns the full object — the merge-readiness picture (mergeable/mergeStateStatus/reviewDecision/latestReviews) plus the metadata the drawer will render (labels/assignees/milestone/reviewRequests/closingIssuesReferences/files).numbermust be a positive int; anything else is an{"error"}returned without touchinggh. The body is capped at 60000 chars withbody_truncated: truewhen cut.cached(key, coro_fn, ttl=15), keyed by("pr", repo, number)— coalesces the drawer's open + reflexive refreshes into oneghcall; error results are never cached andfresh=Truebypasses a live entry.GET /detail/pr?repo=o/n&number=N[&fresh=1]on the gated/api/plugins/githubprefix inbuild_data_router, with the FastAPI/detail imports kept lazy. No UI and no write routes were added.All 24 requested JSON fields were verified present in
gh pr view --json's field list on the real CLI, so none were dropped.