[pr-clusters] Merged PR clusters - 2026-12-01 - run 46612481419/1

Đang mở
#1,010 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
1/100
Loại issue
Tính năng
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Sôi nổi
Công nghệ
github-actions, typescript
Lĩnh vực
ai-infra-agents, tooling

Hướng nghiên cứu

This issue is a generated report of merged PR clusters and does not describe a change to make or identify a follow-up task. Its Rig source is included as pr-clusters-consensus.ts, and the run is linked as GitHub Actions run 46612481419. The report says persistence belongs to the repo-memory job; a newcomer would need a concrete requested change before there is a defined completion criterion.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

ai-agent automation
Overview
  • Repository: githubnext/rig
  • Window (UTC): 2026-11-01T09:02:51.521Z (inclusive) to 2026-12-01T09:02:51.521Z (exclusive)
  • Total merged PRs: 49; classified: 45; unclassified: 4; clusters: 12
Top three clusters
Rank Theme PRs % of corpus Summary
1 Agentic workflow failures and fixes (e00888) 7 14.3% Fixes for install, dependency, firewall and missing-runner failures in Copilot-backed workflows (task generator, decomposition benchmark, Monthly PR Clusters).
2 Provider integration workflow fixes (e00890) 7 14.3% Fixes and docs for DeepSeek, Pi, Gemini, Codex and Copilot SDK driver integration runs: routing, reasoning effort, credentials, tool definitions, temp-dir permissions.
3 Claude dynamic-workflow compatibility improvements (e00927) 7 14.3% Docs and mapping gaps closed for porting Claude dynamic workflows to rig.

The top three are tied at 7 PRs; ranking uses cluster ID ascending as the tiebreak.

Cluster details and representative PRs
Outside the top three

9 further clusters hold 24 PRs, and 4 PRs are unclassified.

Cluster PRs Theme
e00734 734, 926, 945, 954, 964 Rig sample catalog additions
e00744 744, 906, 961 rig.ts header refresh
e00751 751, 754, 770 npm dependency bumps
e00831 831, 886, 905 Microsoft npm feed and SDK migration
e00892 892, 910 Copilot integration CI enforcement and credentials
e00932 932, 977 Samples failing under stdin execution
e00933 933, 938 Retired Sonnet model in integration samples
e00934 934, 948 Action Failure Repair workflow
e00935 935, 978 CI failure repair PRs

Unclassified (each was grouped with another PR in fewer than half of the 3 view partitions): #891, #931, #949, #993.

Strategy comparison
  • History consulted: all 14 prior records (37680026048-1 through 46386695563-1), with full source read for the five most recent and the most similar ones.
  • Nearest prior strategies: map-reduce-local-group-merge (45581461634-1) and divisive-recursive-bisection (45771811713-1), which also ask a model to partition PR sets directly.
  • Behavioral change: consensus clustering. Three independent full-corpus model partitions each see a different evidence view (title-only, title+body, body-only) in a different PR order. TypeScript builds a co-association matrix and runs average-linkage agglomeration (stop below 0.5 agreement). Membership comes only from cross-partition agreement, so single-view errors are voted down. Prior strategies used one model pass as final structure or used model output as per-PR features.
  • Evidence: titles and URL-stripped body excerpts (160 to 260 characters). Calls: 3 partition calls plus 12 describe calls = 15.
  • Limitations: only 3 views, so agreement is coarse (0, 1/3, 2/3, 1). The top three tie at 7, and tiebreaking by ID is arbitrary. No measured comparison against other strategies was made, so no claim of improvement.
  • Lessons: pairs seen in only one view are dropped, which leaves a few clearly related PRs unclassified (e.g. #891). More views or a graded threshold could be tested next.
Rig source

Digest (SHA-256): 6acbc3da854a1a6de66a6a952ca8629485c1a95368bdd24d167ebc305f2de50e. Repo-memory record: pr-cluster-rigs/46612481419-1.json; its persistence is owned by the repo-memory job.

Complete generated Rig program (pr-clusters-consensus.ts)
import { agent, s, workflow } from "rig";
import { readFileSync } from "node:fs";

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

// Agent role: partition the whole set of PRs from one evidence view into thematic groups.
const partitionView = agent({
  name: "partitionView",
  model: "small",
  input: s.object({ view: s.string, prs: s.string }),
  output: s.object({
    groups: s.array(s.array(s.int)),
    outliers: s.array(s.int),
  }),
  instructions:
    "Each line is a merged PR from one repository, shown through a single evidence VIEW. Partition ALL listed PRs into groups of 2+ PRs that share one specific engineering concern. PRs that fit no group go in outliers. Every listed number must appear exactly once across groups and outliers. Use only listed numbers.",
});

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

const clean = (t = "") => t.replace(/https?:\S+/g, "").replace(/[#>*|`]/g, " ").replace((s/redacted)+/g, " ").trim();
const VIEWS = [
  { name: "title-only", line: (p: Pr) => `${p.number} | ${p.title}` },
  { name: "title+body", line: (p: Pr) => `${p.number} | ${p.title} | ${clean(p.body).slice(0, 160)}` },
  { name: "body-only", line: (p: Pr) => `${p.number} | ${clean(p.body).slice(0, 260) || p.title}` },
];

// Workflow role: consensus clustering over independent whole-corpus partitions from three evidence views, merged by co-association in TypeScript.
export default workflow({
  meta: {
    name: "co-association-consensus-clustering",
    description: "Three independent view-specific partitions, co-association matrix, average-linkage consensus, cluster naming",
    phases: ["Partition", "Consensus", "Describe", "Validate"],
  },
  body: async ({ call, phase, parallel }) => {
    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");
    const nums = prs.map((p) => p.number);

    phase("Partition");
    const res = await parallel(
      VIEWS.map((v, vi) => () => {
        const order = vi === 0 ? prs : vi === 1 ? [...prs].reverse() : [...prs].sort((a, b) => (a.number * 7919) % 1009 - (b.number * 7919) % 1009);
        return call(partitionView, { view: v.name, prs: order.map(v.line).join("\n") }, { label: v.name });
      }),
    );
    const parts: number[][][] = res.map((r, i) => {
      if (!r) throw new Error(`missing partition ${VIEWS[i].name}`);
      const seen = new Set<number>();
      for (const n of [...r.groups.flat(), ...r.outliers]) {
        if (!byNum.has(n) || seen.has(n)) throw new Error(`view ${VIEWS[i].name}: invalid or duplicate PR ${n}`);
        seen.add(n);
      }
      if (seen.size !== nums.length) throw new Error(`view ${VIEWS[i].name}: incomplete coverage`);
      if (r.groups.some((g) => g.length < 2)) throw new Error(`view ${VIEWS[i].name}: group smaller than 2`);
      return r.groups;
    });

    phase("Consensus");
    const co = new Map<string, number>();
    const key = (a: number, b: number) => (a < b ? `${a}-${b}` : `${b}-${a}`);
    for (const part of parts)
      for (const g of part)
        for (let i = 0; i < g.length; i++) for (let j = i + 1; j < g.length; j++) co.set(key(g[i], g[j]), (co.get(key(g[i], g[j])) ?? 0) + 1);
    const sim = (a: number, b: number) => (co.get(key(a, b)) ?? 0) / parts.length;
    let groups: number[][] = nums.map((n) => [n]);
    for (;;) {
      let best = 0;
      let bi = -1;
      let bj = -1;
      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 += sim(a, b);
          const avg = t / (groups[i].length * groups[j].length);
          if (avg > best) { best = avg; bi = i; bj = j; }
        }
      if (bi < 0 || best < 0.5) 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));
    const unclassified = groups
      .filter((g) => g.length === 1)
      .map((g) => ({ pr: g[0], reason: "Co-grouped with any single PR in fewer than half of the 3 independent view partitions" }))
      .sort((a, b) => a.pr - b.pr);
    if (parts.length + multi.length > 38) throw new Error("call budget exceeded");

    phase("Describe");
    const described: ({ label: string; summary: string } | null)[] = [];
    for (let g = 0; g < multi.length; g += 3) {
      const out = await parallel(
        multi.slice(g, g + 3).map((m, i) => () => {
          let t = 0;
          let c = 0;
          for (let x = 0; x < m.length; x++) for (let y = x + 1; y < m.length; y++) { t += sim(m[x], m[y]); c++; }
          return call(
            describeCluster,
            { members: m.map((n) => `${n} | ${byNum.get(n)!.title} | ${clean(byNum.get(n)!.body).slice(0, 120)}`).join("\n"), agreement: (t / c).toFixed(2) },
            { label: `describe${g + i}` },
          );
        }),
      );
      described.push(...out);
    }
    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: `e${String(m[0]).padStart(5, "0")}`, label: d.label.trim(), summary: d.summary.trim(), 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: "Consensus clustering: 3 independent whole-corpus model partitions from title-only, title+body and body-only views (different orders), co-association matrix, TypeScript average-linkage merge at >=0.5 agreement, cluster naming",
      totalPrs: prs.length,
      modelCalls: parts.length + multi.length,
      viewGroupCounts: parts.map((p) => p.length),
      clusters,
      topThree: clusters.slice(0, 3).map((c) => c.id),
      unclassified,
    };
  },
});
Validation and attempts
  • Source attempt 1 of 2: lint passed, typecheck passed, execution 1 of 2 succeeded via run_rig (15 model calls, within the 40-call limit and concurrency 3). No errors, so no repairs were needed.
  • Independent node check against the corpus passed: all 49 PRs covered exactly once, known PR numbers, unique cluster IDs, sizes equal unique PR counts, ranking (size desc, ID asc), top three, and window match.
  • Workflow run: 46612481419

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

Ngôn ngữ chính
TypeScript
Star
16
Fork
0
Merge trung bình
2 giờ 7 phút
Pull request đã merge (30 ngày)
44

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của githubnext/rig

Tất cả issue của githubnext/rig

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.