π The fast, Pythonic way to build MCP servers and clients.
Keep format flags from dismissing issues (#6159)
nate nowack189ed54a2dff
diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.ymlindex 1af7f1d07..13a84d7d7 100644--- a/.github/ISSUE_TEMPLATE/bug.yml+++ b/.github/ISSUE_TEMPLATE/bug.yml@@ -1,6 +1,6 @@name: π Bug Reportdescription: Report a bug or unexpected behavior in FastMCP-labels: [bug, pending]+labels: [bug]body:- type: markdowndiff --git a/.github/ISSUE_TEMPLATE/enhancement.yml b/.github/ISSUE_TEMPLATE/enhancement.ymlindex ff759cdd6..85f195cea 100644--- a/.github/ISSUE_TEMPLATE/enhancement.yml+++ b/.github/ISSUE_TEMPLATE/enhancement.yml@@ -1,6 +1,6 @@name: π‘ Enhancement Requestdescription: Suggest an idea or improvement for FastMCP-labels: [enhancement, pending]+labels: [enhancement]body:- type: markdowndiff --git a/.github/workflows/marvin-label-triage.yml b/.github/workflows/marvin-label-triage.ymlindex 2c462329e..3b49d4695 100644--- a/.github/workflows/marvin-label-triage.yml+++ b/.github/workflows/marvin-label-triage.yml@@ -66,6 +66,17 @@ jobs:permission-issues: writepermission-pull-requests: write+ - name: Read repository labels+ id: repository-labels+ shell: bash+ env:+ GH_TOKEN: ${{ steps.marvin-token.outputs.token }}+ REPO: ${{ github.repository }}+ run: |+ labels=$(gh api --paginate --slurp "repos/$REPO/labels?per_page=100" \+ | jq -c 'add | map({name, description})')+ printf 'labels=%s\n' "$labels" >> "$GITHUB_OUTPUT"+- name: Set triage promptid: triage-promptrun: |@@ -81,7 +92,7 @@ jobs:remove: `bash .github/scripts/triage-label.sh remove "label1"`- The helper uses the additive REST labels endpoint, so it works for both issues and PRs and never clobbers labels applied by other workflows β notably the Require Issue Link workflow's `missing-issue-link` control label, which must survive or an auto-closed PR won't reopen when its author is assigned.- The helper is your ONLY GitHub write access. Do NOT use raw `gh api`, `gh issue edit`, `gh pr edit`, or any other mutation β they are not available to you.- - Only apply labels that exist in the repository (from `gh label list` in step 1). Never invent labels.+ - Only apply labels from the complete repository label list below. Never invent labels.- Use `remove` only to correct a label you believe is wrong, and never remove the control labels `missing-issue-link`, `bypass-issue-check`, or `trusted-contributor`.Issue/PR Information:@@ -91,8 +102,8 @@ jobs:TRIAGE PROCESS:- 1. Get available labels:- Run: `gh label list`+ 1. Read the available labels and descriptions collected from every repository label page:+ ${{ steps.repository-labels.outputs.labels }}2. Retrieve issue/PR details using GitHub tools:- mcp__github__get_issue: Get the issue/PR details@@ -101,7 +112,7 @@ jobs:3. Analyze and apply labels based on these guidelines:- CORE CATEGORIES (apply EXACTLY ONE - these are mutually exclusive; skip if applying too-long):+ CORE CATEGORIES (apply EXACTLY ONE - these are mutually exclusive, including when applying too-long):- bug: Reports of broken functionality OR PRs that fix bugs- enhancement: New functions/endpoints, improvements to existing features, internal tooling, workflow improvements, minor new capabilities- feature: ONLY for major headline functionality worthy of a blog post announcement (2-4 per release, never for issues)@@ -191,7 +202,7 @@ jobs:allowed_non_write_users: "*"allowed_bots: "marvin-context-protocol"claude_args: |- --allowedTools "Bash(gh label list:*)","Bash(bash .github/scripts/triage-label.sh:*)",mcp__github__get_issue,mcp__github__get_issue_comments,mcp__github__add_issue_comment,mcp__github__get_pull_request,mcp__github__get_pull_request_files+ --allowedTools "Bash(bash .github/scripts/triage-label.sh:*)",mcp__github__get_issue,mcp__github__get_issue_comments,mcp__github__add_issue_comment,mcp__github__get_pull_request,mcp__github__get_pull_request_filessettings: |{"model": "claude-sonnet-5",@@ -240,8 +251,7 @@ jobs:| map(.tool_input.command // "")| { total: length,granted: map(select(- startswith("gh label list")- or startswith("bash .github/scripts/triage-label.sh")+ startswith("bash .github/scripts/triage-label.sh")))}| "\(.total)\t\(.granted | length)\t\(.granted | join(" | "))"diff --git a/scripts/rank_issues.py b/scripts/rank_issues.pyindex 4f6f1a36b..052675a59 100644--- a/scripts/rank_issues.py+++ b/scripts/rank_issues.py@@ -91,12 +91,10 @@ DEFAULT_WEIGHTS: dict[str, float] = {"feature_label": -1.0,}-# Maintainer (or triage-bot) labels are the strongest facts available; each-# set feeds one component. Override per repository through Config.+# Labels are ranking hints, not evidence of a human response or a verdict.+# Override per repository through Config.DEFAULT_LABEL_SIGNALS: dict[str, frozenset[str]] = {- "dismissed": frozenset(- {"invalid", "duplicate", "wontfix", "potential-duplicate", "too-long", "spam"}- ),+ "dismissed": frozenset({"invalid", "duplicate", "wontfix", "spam"}),"waiting": frozenset({"needs more info", "needs MRE"}),"priority": frozenset({"high-priority", "critical"}),"deprioritized": frozenset({"low-priority"}),@@ -857,9 +855,6 @@ def score_issue("handled": handled,})- if components.get("dismissed") or components.get("waiting"):- # A triage label is a maintainer response.- components["neglect"] = 0.0if judgment:components.update(severity=judgment.severity,@@ -1036,7 +1031,7 @@ PUBLIC_COMPONENTS = {"feature": "enhancement request","question": "usage question","dismissed": "existing triage label",- "waiting": "waiting for reporter information",+ "waiting": "information-request label","priority": "priority label","deprioritized": "low-priority label","security_label": "security label",diff --git a/scripts/rank_issues_tui.py b/scripts/rank_issues_tui.pyindex 2bd7d84f2..5d548bc28 100644--- a/scripts/rank_issues_tui.py+++ b/scripts/rank_issues_tui.py@@ -75,7 +75,7 @@ COMPONENT_LABELS = {"low_effort": "low-effort report","spray": "author opens PRs across many repos","dismissed": "labeled invalid, duplicate, or wontfix",- "waiting": "waiting on the reporter",+ "waiting": "information-request label","priority": "labeled high priority","deprioritized": "labeled low priority","security_label": "labeled security",diff --git a/status-site/README.md b/status-site/README.mdindex f0d7ec480..a763dd8a6 100644--- a/status-site/README.md+++ b/status-site/README.md@@ -56,4 +56,9 @@ just issues --public --judge none --limit 500The public issue list supports kind and unanswered filters, expandable score contributions, and linked fixes. Comment histories that are incomplete do not count as unanswered. The terminal browser also supports loading additional pages, reranking, and private author context.+Format flags and unconfirmed duplicate suggestions do not count as dismissal.+Labels do not establish that a maintainer has replied. Information-request labels+remain ranking hints; their presence does not prove that the reporter still owes+a response. Check the discussion and later edits before acting on them.+On GitHub Pages, the browser reads JSON directly from the public `status` branch: bot commits do not trigger a Pages rebuild. Other hosts and local previews use adjacent `status.json`. Publishing the UI itself still requires a Pages deployment.diff --git a/tests/test_issue_ranking.py b/tests/test_issue_ranking.pyindex 29cb0ef13..fb2c4cb46 100644--- a/tests/test_issue_ranking.py+++ b/tests/test_issue_ranking.py@@ -93,7 +93,7 @@ def test_public_scoring_is_independent_of_author_reputation(ranking_module):assert "author_trust" not in a.components-def test_assignment_reduces_attention_and_triage_label_removes_neglect(ranking_module):+def test_assignment_reduces_attention(ranking_module):m = ranking_moduleconfig = m.Config(repo="PrefectHQ/fastmcp", judge="none", public=True)now = datetime.now(timezone.utc)@@ -102,11 +102,74 @@ def test_assignment_reduces_attention_and_triage_label_removes_neglect(ranking_massigned = m.score_issue(replace(original, assignees=["maintainer"]), None, None, [], config, now)- waiting = m.score_issue(- replace(original, labels=["needs MRE"]), None, None, [], config, now+ assert unanswered.score > assigned.score++[email protected]("label", ["too-long", "potential-duplicate"])[email protected]("public", [False, True])+def test_format_and_unconfirmed_duplicates_do_not_dismiss_assigned_work(+ ranking_module, label, public+):+ m = ranking_module+ config = m.Config(repo="PrefectHQ/fastmcp", judge="none", public=public)+ now = datetime.now(timezone.utc)+ assigned = replace(issue(m), assignees=["reporter"], linked_prs=[2])+ baseline = m.score_issue(assigned, None, None, [], config, now)+ labeled = m.score_issue(+ replace(assigned, labels=[label]), None, None, [], config, now+ )+ assert labeled.score == baseline.score+ assert labeled.components["dismissed"] == 0++[email protected]("label", ["needs MRE", "needs more info", "invalid"])+def test_label_is_not_a_human_response(ranking_module, label):+ m = ranking_module+ config = m.Config(repo="PrefectHQ/fastmcp", judge="none", public=True)+ now = datetime.now(timezone.utc)+ original = replace(issue(m), labels=[label])+ unanswered = m.score_issue(original, None, None, [], config, now)+ answered = m.score_issue(+ replace(original, maintainer_replied_at=now), None, None, [], config, now+ )+ assert unanswered.components["neglect"] == 1+ assert answered.components["neglect"] == 0+ assert unanswered.score - answered.score == config.weights["neglect"]+ doc = m.public_snapshot(m.RankedPage([unanswered], None), config)+ assert doc["items"][0]["maintainer_replied"] is False+ assert any(r["signal"] == "neglect" for r in doc["items"][0]["reasons"])++[email protected]("label", ["invalid", "duplicate", "wontfix", "spam"])+def test_disposition_labels_still_reduce_attention(ranking_module, label):+ m = ranking_module+ config = m.Config(repo="PrefectHQ/fastmcp", judge="none", public=True)+ now = datetime.now(timezone.utc)+ original = issue(m)+ baseline = m.score_issue(original, None, None, [], config, now)+ labeled = m.score_issue(+ replace(original, labels=[label]), None, None, [], config, now+ )+ assert labeled.score - baseline.score == config.weights["dismissed"]+++def test_explicit_label_signal_override_is_preserved(ranking_module):+ m = ranking_module+ config = m.Config(+ repo="PrefectHQ/fastmcp",+ judge="none",+ label_signals={"dismissed": frozenset({"too-long"})},+ )+ ranked = m.score_issue(+ replace(issue(m), labels=["too-long"]),+ None,+ None,+ [],+ config,+ datetime.now(timezone.utc),)- assert unanswered.score > assigned.score > waiting.score- assert waiting.components["neglect"] == 0+ assert ranked.components["dismissed"] == 1+ assert ranked.components["neglect"] == 1def test_partial_comment_history_does_not_imply_unanswered(ranking_module):diff --git a/tests/test_label_triage.py b/tests/test_label_triage.pynew file mode 100644index 000000000..a539d9823--- /dev/null+++ b/tests/test_label_triage.py@@ -0,0 +1,108 @@+import json+import os+import subprocess+import sys+from pathlib import Path++import pytest+import yaml++ROOT = Path(__file__).parents[1]+++def triage_steps():+ workflow = yaml.load(+ (ROOT / ".github/workflows/marvin-label-triage.yml").read_text(),+ Loader=yaml.BaseLoader,+ )+ return {+ step["id"]: step+ for step in workflow["jobs"]["label-issue-or-pr"]["steps"]+ if "id" in step+ }+++ sys.platform == "win32", reason="Exercises the Ubuntu shell workflow"+)[email protected]("failure", [None, "api", "json"])+def test_label_collection_is_paginated_and_fails_before_prompt(+ triage_steps, tmp_path, failure+):+ labels = [{"name": f"label-{i}", "description": "A label"} for i in range(140)]+ labels[-1]["description"] = "A description\nEOF\n$(touch unexpected)"+ response = tmp_path / "response.json"+ response.write_text(+ "invalid JSON"+ if failure == "json"+ else json.dumps([labels[:100], labels[100:]]) + "\n"+ )+ calls = tmp_path / "gh-args.txt"+ output = tmp_path / "output.txt"+ gh = tmp_path / "gh"+ gh.write_text(+ '#!/bin/sh\nprintf "%s\\n" "$@" > "$GH_ARGS"\n'+ 'if [ "$GH_FAIL" = 1 ]; then exit 1; fi\n'+ 'cat "$GH_RESPONSE"\n'+ )+ gh.chmod(0o755)+ env = {+ **os.environ,+ "PATH": str(tmp_path) + os.pathsep + os.environ["PATH"],+ "GH_TOKEN": "test-token",+ "REPO": "PrefectHQ/fastmcp",+ "GH_ARGS": str(calls),+ "GH_RESPONSE": str(response),+ "GH_FAIL": "1" if failure == "api" else "0",+ "GITHUB_OUTPUT": str(output),+ }+ assert triage_steps["repository-labels"]["shell"] == "bash"+ result = subprocess.run(+ [+ "bash",+ "-e",+ "-o",+ "pipefail",+ "-c",+ triage_steps["repository-labels"]["run"],+ ],+ env=env,+ cwd=tmp_path,+ capture_output=True,+ text=True,+ timeout=5,+ )+ args = calls.read_text().splitlines()+ assert args[:4] == [+ "api",+ "--paginate",+ "--slurp",+ "repos/PrefectHQ/fastmcp/labels?per_page=100",+ ]+ assert len(args) == 4+ if failure:+ assert result.returncode != 0+ assert not output.exists()+ return+ assert result.returncode == 0, result.stderr+ lines = output.read_text().splitlines()+ assert len(lines) == 1+ assert lines[0].startswith("labels=")+ supplied = lines[0].removeprefix("labels=")+ assert json.loads(supplied) == labels+ prompt = triage_steps["triage-prompt"]["run"].replace(+ "${{ steps.repository-labels.outputs.labels }}", supplied+ )+ output.unlink()+ result = subprocess.run(+ ["bash", "-e", "-o", "pipefail", "-c", prompt],+ env=env,+ cwd=tmp_path,+ capture_output=True,+ text=True,+ timeout=5,+ )+ assert result.returncode == 0, result.stderr+ assert supplied in output.read_text()+ assert not (tmp_path / "unexpected").exists()