Skip to content

B1: mr-categorize step — HIGH / ACTIVE / SEEN enrichment#47

Merged
hartsock merged 1 commit into
mainfrom
feat/mr-categorize
Jun 9, 2026
Merged

B1: mr-categorize step — HIGH / ACTIVE / SEEN enrichment#47
hartsock merged 1 commit into
mainfrom
feat/mr-categorize

Conversation

@hartsock

@hartsock hartsock commented Jun 9, 2026

Copy link
Copy Markdown
Owner

Summary

First of the two morning-parity-gap PRs (Part B; independent of the board stack). Adds a mr-categorize step that turns a flat MR list into an actionable triage.

Buckets the user's authored (or reviewer) MRs:

  • HIGH — your MR with new activity from others
  • ACTIVE — needs attention / uncategorized
  • SEEN — you reacted (👀) or commented and nothing changed since

Lists via glab mr list {--author|--reviewer}={user} -R {project}, parses the !IID⇥PROJECT!IID⇥TITLE lines, enriches each MR via three glab api GETs (merge_requests detail, award_emoji, notes?sort=desc&per_page=20), and applies the rules. Params: role (author default | reviewer), seen_emoji (default eyes).

  • data_schema {high, active, seen} of {project, iid, title, author, web_url, category, reason} — golden pinned.
  • All spawns through ExecGate. Timestamps parsed only to order activity (display math), never coordination.
  • All-auth-failed soft-skips with the glab auth login hint (parity with the other forge steps).

Disclosure tier: step.

Test plan

  • just check green (fmt + clippy -D warnings + all tests incl. golden + data-contract; EXIT=0).
  • Unit: parse_mr_lines_extracts_project_iid_title, categorize_high_active_seen_rules (all three rules), mr_categorize_buckets_high_end_to_end (mock list → detail → emoji → notes, asserts endpoints), mr_categorize_all_auth_failures_soft_skip.

FIXTURE-SYNC: the glab api JSON shapes mirror the GitLab REST API; the glab presence/auth belief is exercised by tests/live_contract.rs.

🤖 Generated with Claude Code

WHAT: Add a `mr-categorize` step that buckets a user's authored (or
reviewer) merge requests into:
  - HIGH   — your MR with new activity from others (act on it)
  - ACTIVE — needs attention / uncategorized
  - SEEN   — you reacted (eyes) or commented and nothing changed since
It lists MRs via `glab mr list {--author|--reviewer}={user} -R {project}`,
parses the `!IID\tPROJECT!IID\tTITLE` lines, then enriches each MR via three
`glab api` GETs — merge_requests detail, award_emoji, and notes — and
applies the rules. Params: `role` (author default | reviewer), `seen_emoji`
(default eyes). data_schema {high, active, seen} of
{project, iid, title, author, web_url, category, reason}; golden pinned.

All spawns go through ExecGate. Timestamps are parsed only to ORDER
activity (display math), never as a coordination primitive. All-auth-failed
soft-skips with the `glab auth login` hint, matching the other forge steps.

WHY: closes a gila-morning parity gap — the plain `gitlab-mr-*` steps pass
glab text through; this turns the review queue into an actionable triage.

Disclosure tier: step. Registered + documented + data-contract + golden.
FIXTURE-SYNC: the glab-api JSON shapes mirror the GitLab REST API; the glab
presence/auth belief is exercised by tests/live_contract.rs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@hartsock hartsock added the risk:low Scoped, tested, no CI/build changes label Jun 9, 2026
@hartsock hartsock merged commit 3f229f2 into main Jun 9, 2026
1 check passed
@hartsock hartsock deleted the feat/mr-categorize branch June 9, 2026 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:low Scoped, tested, no CI/build changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant