Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/review/unified-comment-bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,15 @@ export function verdictToRecommendation(verdict: Verdict): ReviewRecommendation
function rowState(resultCell: string): UnifiedSignalRow["state"] {
if (resultCell.startsWith("✅")) return "ok";
if (resultCell.startsWith("❌")) return "fail";
// A leading ℹ️ is an explicit neutral/informational marker (e.g. "no public Gittensor match", "none detected") —
// it must map to the `info` state, not fall through to `warn`, so a non-blocking row never renders as ⚠️.
if (resultCell.startsWith("ℹ️")) return "info";
return "warn";
}

/** Strip the leading status icon from a result cell so it is not duplicated next to the unified icon. */
function rowResultText(resultCell: string): string {
return resultCell.replace(/^[✅⚠️❌]+\s*/u, "").trim();
return resultCell.replace(/^[✅⚠️❌ℹ️]+\s*/u, "").trim();
}

/** Map the legacy panel signal rows → the unified table's rows (label/state/result/evidence). The
Expand Down
6 changes: 4 additions & 2 deletions src/review/unified-comment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ export interface UnifiedReviewInput {
/** One row of the readiness signal table (loopover side, host-provided; the engine adds Code review). */
export interface UnifiedSignalRow {
label: string;
state: "ok" | "warn" | "fail";
state: "ok" | "warn" | "fail" | "info";
/** Short result text, e.g. "Linked", "25/25". */
result?: string;
/** Evidence cell, e.g. "#1372". */
Expand Down Expand Up @@ -296,7 +296,9 @@ const STATUS_META: Record<UnifiedCommentStatus, { alert: string; square: string;
blocked: { alert: "CAUTION", square: "🟥", icon: "🛑" },
};

const SIGNAL_ICON: Record<UnifiedSignalRow["state"], string> = { ok: "✅", warn: "⚠️", fail: "❌" };
// `info` is a neutral/grey state — informational, NEVER implying a warning (⚠️) or failure (❌). It backs rows like a
// non-Gittensor contributor match or "no improvement detected" that are advisory context, not a reason to flag the PR.
const SIGNAL_ICON: Record<UnifiedSignalRow["state"], string> = { ok: "✅", warn: "⚠️", fail: "❌", info: "ℹ️" };

/** Derive the single unified status from reviewbot's decision/recs/CI + the host override. */
export function deriveUnifiedStatus(input: UnifiedReviewInput, ctx: UnifiedCommentContext = {}): UnifiedCommentStatus {
Expand Down
5 changes: 4 additions & 1 deletion src/signals/engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4957,8 +4957,11 @@ function contributorContextPanelResult(
const login = pr.authorLogin ?? profile.login;
const githubLink = `[${sanitizePanelText(login)}](${githubProfileUrl(login)})`;
if (!confirmedMiner) {
// #5100 bug fix: a ❌ (hard-failure icon everywhere else in this table) directly contradicted the adjacent
// "not a blocker" text — every non-Gittensor contributor, the majority of PR authors on most repos, saw a red
// X on their own PR for something that was never a failure. This is a neutral/informational state, never ❌.
return {
result: " No public Gittensor match",
result: "ℹ️ No public Gittensor match",
evidence: `${githubLink}; not a blocker.`,
action: "No action.",
};
Expand Down
7 changes: 5 additions & 2 deletions test/unit/queue-4.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3016,7 +3016,9 @@ describe("queue processors", () => {
// unified renderer's table only surfaces the first 3 of each row's 4 cells (Label/Result/Evidence, not
// Action) — same as the adjacent "Gate result" row, which also never shows its own 4th cell here — so this
// asserts against the 3 columns this renderer actually prints, not the row's full cells array.
expect(postedBody).toContain("| Improvement | ⚠️ ℹ️ None detected | value: none |");
// #5100: the "none detected" band is informational — a single neutral ℹ️. It formerly rendered "⚠️ ℹ️" (a
// warn icon prepended by the bridge PLUS an un-stripped legacy ℹ️ — a visible double-icon bug now fixed).
expect(postedBody).toContain("| Improvement | ℹ️ None detected | value: none |");
// Public-safe regardless: no internal trust/economics fields leak through this new row either.
expect(postedBody).not.toMatch(/wallet|hotkey|coldkey|reward|trust score/i);
} finally {
Expand Down Expand Up @@ -3194,7 +3196,8 @@ describe("queue processors", () => {
// The quadrant rating ("risk: low · value: none") threaded from the REAL slopBand computed this pass
// (missingTestEvidence only, slopRisk 15 -> band "low") IS the concise Evidence cell (#5101) -- proving
// processors.ts's hoisted slopBand reaches the rendered comment, not just computed and discarded.
expect(postedBody).toContain("| Improvement | ⚠️ ℹ️ None detected | risk: low · value: none |");
// #5100: single neutral ℹ️ (was the "⚠️ ℹ️" double-icon bug — see the sibling assertion above).
expect(postedBody).toContain("| Improvement | ℹ️ None detected | risk: low · value: none |");
// Public-safe regardless: no internal trust/economics fields leak through the new quadrant clause either.
expect(postedBody).not.toMatch(/wallet|hotkey|coldkey|reward|trust score/i);
} finally {
Expand Down
12 changes: 11 additions & 1 deletion test/unit/unified-comment-bridge.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,19 @@ describe("panelRowsToSignalRows", () => {
});

it("maps a ❌ result cell to fail", () => {
const rows = panelRowsToSignalRows([{ key: "contributorContext", cells: ["Contributor context", "❌ No public Gittensor match", "octocat; not a blocker.", "No action."] }]);
const rows = panelRowsToSignalRows([{ key: "linkedIssue", cells: ["Linked issue", "❌ Missing linked issue", "no closes/fixes reference", "Link an issue."] }]);
expect(rows[0]?.state).toBe("fail");
});

// #5100: a leading ℹ️ is a neutral/informational marker (e.g. a non-Gittensor contributor, "none detected") — it must
// map to the `info` state, NOT fall through to `warn`, and the icon must be stripped so it isn't doubled in the render.
it("maps a ℹ️ result cell to the neutral info state and strips the leading icon", () => {
const rows = panelRowsToSignalRows([
{ key: "contributorContext", cells: ["Contributor context", "ℹ️ No public Gittensor match", "octocat; not a blocker.", "No action."] },
]);
expect(rows[0]?.state).toBe("info");
expect(rows[0]?.result).toBe("No public Gittensor match");
});
});

describe("consensusDefectFromFindings", () => {
Expand Down