[pr-clusters] Merged PR clusters - 2026-11-28 - run 46128492209/1

オープン
#979 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
25/100
issue の種類
ドキュメント
明瞭さ
説明が足りない
活発さ
活発
技術スタック
typescript

調査の方向性

Start with the issue's Overview, Strategy comparison, and Validation and attempts sections to understand the report. Review the generated pr-clusters-question-signatures.ts source and the /tmp/gh-aw/agent/merged-prs.json input, then run the referenced run_rig workflow and lint/typecheck commands. The issue itself requests no change, so a concrete completion criterion must first be confirmed with a maintainer.

索引モデルが issue の本文から書いたものです。

説明

ai-agent automation
Overview
  • Repository: githubnext/rig
  • Window (UTC): 2026-10-28T09:02:03.467Z (inclusive) to 2026-11-28T09:02:03.467Z (exclusive)
  • Total merged PRs: 45 · classified: 42 · unclassified: 3 · clusters: 11
Top three clusters
Rank Theme PRs % of corpus Summary
1 Rig sample additions (q00734) 6 13.3% Recurring automated [rig-tasks] PRs adding batches of rig samples, plus one making the Dockerfile audit sample runnable.
2 Provider integration fixes and updates (q00890) 6 13.3% DeepSeek/Pi Copilot Responses routing, Gemini credential docs, retired Sonnet model, router-selected models, Codex fixture permissions.
3 Claude and Anthropic SDK compatibility (q00891) 6 13.3% Repeated [rig-claude] dynamic-workflow compatibility improvements and the direct Anthropic SDK contract.

Ranking is by unique PR count descending, ties by cluster ID ascending.

Representative PRs
Outside the top three

8 further clusters hold 24 PRs: q00765 Agentic workflow tooling and dependency upgrades (5), q00744 rig.ts header updates (3), q00751 Dependency version bumps (3), q00892 CI and release workflow reliability (3), q00915 Copilot model resolution and integration fixes (3), q00923 Monthly PR Clusters Rig integration (3), q00917 Decomposition benchmark reliability fixes (2), q00934 Actions failure repair workflow (2).

Unclassified (3): #886 and #916 (no other PR within average Hamming distance 1 on the 10 answers), #949 (answered no to every question).

Strategy comparison
  • History consulted: all 11 records in repo memory (semantic themes, labels, change scope, TF-IDF average linkage, two no-strategy runs, closed-vocabulary facets, pairwise graph, map-reduce, divisive bisection, seed-and-assign); full source read for the five most recent.
  • Nearest prior: closed-vocabulary facet extraction (45361254701-1) and the TF-IDF/concern-linkage agglomeration.
  • Strategy: one model call reads all titles and designs 10 corpus-specific yes/no questions; models answer all questions per PR (batches of 5, title plus 250-char URL-stripped body excerpt), yielding a 10-bit signature; TypeScript groups identical signatures and merges by average Hamming distance ≤ 1; groups of 2+ become clusters (one naming call each); singletons and all-false signatures are unclassified. 21 model calls.
  • Behavioral difference: the evidence representation is a model-designed binary question signature rather than free keywords, a fixed facet vocabulary, TF-IDF vectors, seeds, pairwise judgments, or recursive splits; distance is Hamming over shared answers.
  • Limitations: the questions are derived from titles, so they mirror what is visible; the provider-integration cluster mixes distinct concerns. No measured comparison with other strategies, so no claim of being better.
  • Lessons: bot-generated PR families cluster cleanly; question quality drives results.
Generated Rig source

SHA-256: df5eb8e16cc02e40124decc0c178f5af057f65cf0d1099d8c7d79994a23f5fed · repo-memory record 46128492209-1.json (branch memory/pr-cluster-rigs, persisted by the trusted job after this run).

pr-clusters-question-signatures.ts
import { agent, s, workflow } from "rig";
import { readFileSync } from "node:fs";

type Pr = { number: number; title: string; body?: string };

// Agent role: design discriminating yes/no questions from the list of PR titles.
const designQuestions = agent({
  name: "designQuestions",
  model: "small",
  input: s.object({ titles: s.string }),
  output: s.object({ questions: s.array(s.string) }),
  instructions:
    "Each line is 'number | title' of a merged PR in one repository. Write exactly 10 short, mutually independent yes/no questions that, answered per PR, would best separate these PRs into distinct themes (e.g. 'Does this PR change dependency versions?'). Each question must be answerable from a title plus short excerpt, cover a different theme, and be true for several but not most PRs.",
});

// Agent role: answer every question for each PR in a batch.
const answerQuestions = agent({
  name: "answerQuestions",
  model: "small",
  input: s.object({ questions: s.string, prs: s.string }),
  output: s.object({ items: s.array(s.object({ pr: s.int, answers: s.array(s.boolean) })) }),
  instructions:
    "Questions are numbered lines. Each PR line is 'number | title | body excerpt'. For every listed PR return one item whose answers array has exactly one boolean per question, in question order. Use only listed numbers, each exactly once.",
});

// Agent role: name a cluster from its member PRs.
const describeCluster = agent({
  name: "describeCluster",
  model: "small",
  input: s.object({ members: s.string }),
  output: s.object({ label: s.string, summary: s.string }),
  instructions:
    "Each line is 'number | title'. Return a short thematic label (max 6 words) and a one-sentence summary grounded only in these titles.",
});

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

// Workflow role: yes/no question signatures per PR, deterministic Hamming-distance grouping, cluster naming, validation.
export default workflow({
  meta: {
    name: "question-signature-hamming-groups",
    description: "Model designs discriminating questions, answers them per PR into binary signatures, TypeScript groups by Hamming distance",
    phases: ["Questions", "Answer", "Group", "Describe", "Validate"],
  },
  body: async ({ call, phase }) => {
    const corpus = JSON.parse(readFileSync("/tmp/gh-aw/agent/merged-prs.json", "utf8"));
    const prs: Pr[] = [...corpus.prs].sort((a: Pr, b: Pr) => a.number - b.number);
    const byNum = new Map(prs.map((p) => [p.number, p]));
    if (prs.length === 0 || byNum.size !== prs.length) throw new Error("bad corpus");

    phase("Questions");
    const q = await call(designQuestions, { titles: prs.map((p) => `${p.number} | ${p.title}`).join("\n") }, { label: "questions" });
    if (!q || q.questions.length !== NQ || q.questions.some((x) => !x.trim())) throw new Error("malformed question set");
    const qText = q.questions.map((x, i) => `${i + 1}. ${x}`).join("\n");

    phase("Answer");
    const batches: Pr[][] = [];
    for (let i = 0; i < prs.length; i += 5) batches.push(prs.slice(i, i + 5));
    if (batches.length > 20) throw new Error("too many batches");
    const sig = new Map<number, boolean[]>();
    for (let g = 0; g < batches.length; g += 3) {
      const group = batches.slice(g, g + 3);
      const res = await Promise.all(
        group.map((b, i) =>
          call(answerQuestions, { questions: qText, prs: b.map((p) => `${p.number} | ${p.title} | ${clean(p.body).slice(0, 250)}`).join("\n") }, { label: `answer${g + i}` }),
        ),
      );
      res.forEach((r, i) => {
        if (!r) throw new Error(`missing answer response ${g + i}`);
        const want = new Set(group[i].map((p) => p.number));
        for (const it of r.items) {
          if (!want.has(it.pr) || sig.has(it.pr) || it.answers.length !== NQ) throw new Error(`invalid answer for PR ${it.pr}`);
          sig.set(it.pr, it.answers);
        }
        if (group[i].some((p) => !sig.has(p.number))) throw new Error(`batch ${g + i}: incomplete coverage`);
      });
    }

    phase("Group");
    const ham = (a: number, b: number) => sig.get(a)!.reduce((t, x, k) => t + (x === sig.get(b)![k] ? 0 : 1), 0);
    const unclassified: { pr: number; reason: string }[] = [];
    const bySig = new Map<string, number[]>();
    for (const p of prs) {
      const key = sig.get(p.number)!.map((x) => (x ? 1 : 0)).join("");
      if (!key.includes("1")) {
        unclassified.push({ pr: p.number, reason: "Answered no to every discriminating question" });
        continue;
      }
      bySig.set(key, [...(bySig.get(key) ?? []), p.number]);
    }
    let groups = [...bySig.values()];
    const MAXAVG = 1;
    for (;;) {
      let best = Infinity;
      let bi = 0;
      let bj = 0;
      for (let i = 0; i < groups.length; i++)
        for (let j = i + 1; j < groups.length; j++) {
          let t = 0;
          for (const a of groups[i]) for (const b of groups[j]) t += ham(a, b);
          const avg = t / (groups[i].length * groups[j].length);
          if (avg < best) {
            best = avg;
            bi = i;
            bj = j;
          }
        }
      if (best > MAXAVG) break;
      groups = groups.filter((_, k) => k !== bi && k !== bj).concat([[...groups[bi], ...groups[bj]]]);
    }
    const multi = groups.filter((g) => g.length >= 2).map((g) => [...g].sort((a, b) => a - b));
    for (const g of groups.filter((x) => x.length === 1))
      unclassified.push({ pr: g[0], reason: `No other PR within average Hamming distance ${MAXAVG} on ${NQ} question answers` });
    unclassified.sort((a, b) => a.pr - b.pr);

    phase("Describe");
    if (1 + batches.length + multi.length > 38) throw new Error("call budget exceeded");
    const described: ({ label: string; summary: string } | null)[] = [];
    for (let g = 0; g < multi.length; g += 3) {
      const res = await Promise.all(
        multi.slice(g, g + 3).map((m, i) =>
          call(describeCluster, { members: m.map((n) => `${n} | ${byNum.get(n)!.title}`).join("\n") }, { label: `describe${g + i}` }),
        ),
      );
      described.push(...res);
    }
    const clusters = multi
      .map((m, i) => {
        const d = described[i];
        if (!d || !d.label.trim() || !d.summary.trim()) throw new Error("missing cluster description");
        return { id: `q${String(m[0]).padStart(5, "0")}`, label: d.label, summary: d.summary, prs: m, size: m.length };
      })
      .sort((x, y) => y.size - x.size || x.id.localeCompare(y.id));

    phase("Validate");
    const seen = new Set<number>();
    for (const n of [...clusters.flatMap((c) => c.prs), ...unclassified.map((u) => u.pr)]) {
      if (!byNum.has(n) || seen.has(n)) throw new Error(`invalid or duplicate PR ${n}`);
      seen.add(n);
    }
    if (seen.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: `Model-designed ${NQ} yes/no discriminating questions, per-PR binary answer signatures, TypeScript average-Hamming agglomeration (<= ${MAXAVG}), cluster naming`,
      questions: q.questions,
      totalPrs: prs.length,
      modelCalls: 1 + batches.length + multi.length,
      clusters,
      topThree: clusters.slice(0, 3).map((c) => c.id),
      unclassified,
    };
  },
});
Validation and attempts
  • Attempt 1 (only attempt): lint passed, typecheck passed, one run_rig execution succeeded with 21 model calls (limit 40); no errors, no repairs.
  • Independent check: 45 input PRs, 45 assigned exactly once (42 clustered + 3 unclassified), all numbers known, unique cluster IDs, sizes and ranking correct, window matches the corpus.
  • Workflow run: https://github.com/githubnext/rig/actions/runs/46128492209

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

主要言語
TypeScript
スター
16
フォーク
0
平均マージ
2時間 7分
マージ済み PR(30日)
44

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

githubnext/rig のほかの issue

githubnext/rig の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。