[pr-clusters] Merged PR clusters - 2026-11-25 - run 45581461634/1

Ouverte
#951 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
5/5
Temps estimé
Plus d'une semaine
Accessibilité débutants
25/100
Type d'issue
Fonctionnalité
Clarté
Plutôt claire
Activité
Active
Stack technique
github-actions, node.js, typescript

Piste de recherche

Start with the generated Rig program in the issue body and the Monthly PR Clusters workflow run. The workflow groups PRs by number in chunks of eight, then merges group descriptions; the issue identifies outliers that may fit existing clusters as a limitation. Explore how to include outliers in the reduce step or chunk by similarity or label, and compare the resulting classifications against the listed 35 PRs.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

ai-agent automation
Overview
  • Repository: githubnext/rig
  • Window (UTC, start-inclusive, end-exclusive): 2026-10-25T09:02:07.552Z → 2026-11-25T09:02:07.552Z
  • Total merged PRs: 35 · classified: 26 · unclassified: 9 · clusters: 5
Top three clusters
Rank Theme PRs % of corpus Summary
1 CI and integration test fixes (t00890) 12 34.3% Provider integration tests and workflows: routing, credentials, dependency installs, model pinning, retired/router-selected model IDs.
2 Dependency and toolchain upgrades (t00751) 8 22.9% Dependabot npm bumps plus gh-aw, agent CLI/SDK, Copilot pins and npm registry configuration.
3 Automated rig skill maintenance (t00734) 2 5.7% Bot updates to rig samples, the rig.ts header and samples catalog. (Tied at size 2 with t00916 and t00934; t00734 wins by ID.)
Representative PRs
  • t00890: #890 native Responses for DeepSeek Copilot route; #891 direct Anthropic SDK contract; #892 require Copilot integration coverage in CI; #893 Pi judge reasoning effort; #894 Gemini credential docs.
  • t00751: #751 undici bump; #754 fast-uri bump; #765 gh-aw/agent engine upgrade with cooldown; #770 vitest bump; #831 npm approved feed.
  • t00734: #734 3 rig samples; #744 rig.ts header update.
Outside the top three

2 further clusters (4 PRs): t00916 Workflow agent tooling (#916, #923) and t00934 Actions failure repair automation (#934, #935). Both have size 2, same as the rank-3 cluster. Together with the top three, 26 PRs are classified.

9 PRs are unclassified (chunk-level outliers, with no local peer in their chunk of 8): #906, #924, #926, #927, #931, #932, #941, #945, #946. Reasons are in the archived result; examples: #926 and #945 are sample-addition PRs that did not land in the same chunk as the sample-maintenance cluster, and #927 fixes docs links in Claude-port samples. Several of these plausibly belong to existing clusters, which is a limitation of the strategy.

Strategy comparison
  • History consulted: all 8 prior records (37680026048-1, 38039912415-2, 38126880290-1, 40477786734-1, 40661045982-1, 45005503491-1, 45361254701-1, 45553032858-1) with full source of the most recent ones.
  • Nearest prior: pairwise-verified-similarity-graph-components (45553032858-1), which was never executed (dependency failure).
  • Behavioral change: map-reduce by corpus chunk. PRs sorted by number are split into 5 chunks of 8; one model call per chunk groups its PRs locally; one reduce call merges group descriptors (label and summary, not PR lists) into global themes; TypeScript expands themes back to PR numbers and validates the partition. No lexical candidate edges, no per-PR facets or closed vocabulary, no pairwise judgments.
  • Evidence: PR number, labels, title, 300-char URL-stripped body excerpt.
  • Limitations: chunking by PR number splits related PRs; cross-chunk merging sees only labels/summaries, leaving 9 outliers that never get reconsidered. 6 model calls total. No measured comparison with other strategies, so no claim of superiority.
  • Lessons: let the reduce step also see outliers; chunk by similarity or label rather than number.
Rig source

Digest: sha256:97c10d47227ae4200ff11a79dfae2eb74562e2761650212e32a64ce9924bbed6 (5702 bytes). Repo-memory record: pr-cluster-rigs/45581461634-1.json (pending the trusted persistence job).

Complete generated Rig program
import { agent, s, workflow } from "rig";
import { readFileSync } from "node:fs";

type Pr = { number: number; title: string; body?: string; labels?: unknown[]; url: string };

// Agent role: partition one chunk of PRs into local groups plus outliers.
const mapChunk = agent({
  name: "mapChunk",
  model: "small",
  input: s.object({ prs: s.string }),
  output: s.object({
    groups: s.array(s.object({ label: s.string, summary: s.string, prs: s.array(s.int) })),
    outliers: s.array(s.object({ pr: s.int, reason: s.string })),
  }),
  instructions:
    "Each line is a merged PR: number | labels | title | body excerpt. Partition ALL listed PRs into local groups of PRs sharing one specific engineering concern. A group needs 2+ PRs; PRs that fit nowhere go to outliers with a reason. Every listed number must appear exactly once. Use only listed numbers.",
});

// Agent role: reduce local groups from all chunks into global themes.
const reduceGroups = agent({
  name: "reduceGroups",
  model: "small",
  input: s.object({ groups: s.string }),
  output: s.object({
    themes: s.array(s.object({ label: s.string, summary: s.string, groupIds: s.array(s.string) })),
  }),
  instructions:
    "Each line is a local PR group: id | label | summary. Merge groups that describe the same theme across chunks into global themes with a short thematic label and an evidence-grounded one-sentence summary. Every group id must appear in exactly one theme. Use only listed ids.",
});

const clean = (t = "") => t.replace(/https?:\S+/g, "").replace((s/redacted)+/g, " ").trim();

// Workflow role: map-reduce clustering of merged PRs, chunk-local grouping then global theme merge.
export default workflow({
  meta: {
    name: "map-reduce-local-group-merge",
    description: "Chunk-local grouping by model, global theme merge by model, TypeScript validation",
    phases: ["Map", "Reduce"],
  },
  body: async ({ call, phase }) => {
    const corpus = JSON.parse(readFileSync("/tmp/gh-aw/agent/merged-prs.json", "utf8"));
    const prs: Pr[] = corpus.prs;
    const nums = new Set(prs.map((p) => p.number));
    if (prs.length === 0 || nums.size !== prs.length) throw new Error("bad corpus");

    const ordered = [...prs].sort((a, b) => a.number - b.number);
    const size = 8;
    const chunks: Pr[][] = [];
    for (let i = 0; i < ordered.length; i += size) chunks.push(ordered.slice(i, i + size));
    if (chunks.length > 10) throw new Error("too many chunks");

    phase("Map");
    const mapped = await Promise.all(
      chunks.map((c, i) =>
        call(
          mapChunk,
          {
            prs: c
              .map((p) => `${p.number} | ${(p.labels ?? []).map((l) => (typeof l === "string" ? l : JSON.stringify(l))).join(",")} | ${p.title} | ${clean(p.body).slice(0, 300)}`)
              .join("\n"),
          },
          { label: `chunk${i}` },
        ),
      ),
    );

    const local = new Map<string, { label: string; summary: string; prs: number[] }>();
    const outliers = new Map<number, string>();
    mapped.forEach((m, i) => {
      if (!m) throw new Error(`missing map response ${i}`);
      const allowed = new Set(chunks[i].map((p) => p.number));
      const seen = new Set<number>();
      const take = (n: number) => {
        if (!allowed.has(n) || seen.has(n)) throw new Error(`chunk ${i}: invalid or duplicate PR ${n}`);
        seen.add(n);
      };
      m.groups.forEach((g, k) => {
        g.prs.forEach(take);
        if (g.prs.length > 0) local.set(`g${i}_${k}`, { label: g.label, summary: g.summary, prs: g.prs });
      });
      m.outliers.forEach((o) => {
        take(o.pr);
        outliers.set(o.pr, o.reason || "No local peer in its chunk");
      });
      if (seen.size !== allowed.size) throw new Error(`chunk ${i}: incomplete coverage`);
    });

    phase("Reduce");
    const reduced = await call(
      reduceGroups,
      { groups: [...local].map(([id, g]) => `${id} | ${g.label} | ${g.summary}`).join("\n") },
      { label: "reduce" },
    );
    if (!reduced) throw new Error("missing reduce response");
    const used = new Set<string>();
    const clusters = reduced.themes
      .map((t) => {
        const members: number[] = [];
        for (const id of t.groupIds) {
          if (!local.has(id) || used.has(id)) throw new Error(`invalid or duplicate group ${id}`);
          used.add(id);
          members.push(...local.get(id)!.prs);
        }
        members.sort((a, b) => a - b);
        return { id: `t${String(members[0] ?? 0).padStart(5, "0")}`, label: t.label, summary: t.summary, prs: members, size: members.length };
      })
      .filter((c) => c.size > 0)
      .sort((x, y) => y.size - x.size || x.id.localeCompare(y.id));
    if (used.size !== local.size) throw new Error("reduce missed local groups");

    const unclassified = [...outliers].map(([pr, reason]) => ({ pr, reason })).sort((a, b) => a.pr - b.pr);
    const seenAll = new Set<number>();
    for (const n of [...clusters.flatMap((c) => c.prs), ...unclassified.map((u) => u.pr)]) {
      if (!nums.has(n) || seenAll.has(n)) throw new Error(`invalid or duplicate PR ${n}`);
      seenAll.add(n);
    }
    if (seenAll.size !== prs.length) throw new Error("incomplete coverage");
    if (new Set(clusters.map((c) => c.id)).size !== clusters.length) throw new Error("duplicate cluster id");

    return {
      repository: corpus.repository,
      window: corpus.window,
      strategy: "Map-reduce: chunk-local model grouping, then model merge of local group descriptors into global themes",
      totalPrs: prs.length,
      modelCalls: chunks.length + 1,
      clusters,
      topThree: clusters.slice(0, 3).map((c) => c.id),
      unclassified,
    };
  },
});
Validation and attempts
  • Attempt 1 (only attempt): lint pass, typecheck pass, execution success (1 of 2 allowed executions; 6 model calls; no repairs needed).
  • Independent check of the saved result against the corpus: 35 PRs covered exactly once, all numbers known, unique cluster IDs, sizes match member counts, ranking is size desc then ID asc, window matches the corpus.

Workflow run: https://github.com/githubnext/rig/actions/runs/45581461634

Generated by Monthly PR Clusters · copilot · auto (Claude Sonnet 5.5) · ~106 AIC · ⌖ ~2 AIC · ⊞ 10.7K · history

Langage dominant
TypeScript
Étoiles
16
Forks
0
Merge moyen
2 h 7 min
PR mergées (30 j)
44

Préparer son environnement

Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de githubnext/rig

Toutes les issues de githubnext/rig

Issues similaires

Plus d'issues TypeScript

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.