Skip to content
Closed
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://loop-protocol.local/schemas/CLOSE_DECISION_V1.schema.json",
"title": "CLOSE_DECISION_V1",
"type": "object",
"description": "Structured data representing a decision to close or retain an improvement issue.",
"properties": {
"issue_number": {
"type": "integer",
"description": "The GitHub issue number."
},
"decision": {
"type": "string",
"enum": ["absorbed", "superseded", "still_needed", "blocked"],
"description": "The classification of the decision. 'absorbed' (implemented elsewhere), 'superseded' (no longer needed due to new structure), 'still_needed' (keep open as standalone), 'blocked' (requires other dependencies)."
},
"github_close_state": {
"type": ["string", "null"],
"enum": ["completed", "not_planned", null],
"description": "How the issue should be closed on GitHub. Use 'completed' for absorbed, 'not_planned' for superseded, and null for others."
},
"evidence": {
"type": "object",
"description": "Evidence required for 'absorbed' decisions.",
"properties": {
"pr_numbers": {
"type": "array",
"items": { "type": "integer" }
},
"file_paths": {
"type": "array",
"items": { "type": "string" }
},
"ac_vc_refs": {
"type": "array",
"items": { "type": "string" }
}
},
"required": ["pr_numbers", "file_paths", "ac_vc_refs"],
"additionalProperties": false
},
"reasoning": {
"type": "string",
"description": "Detailed reasoning for the decision."
}
},
"required": ["issue_number", "decision", "reasoning"],
"allOf": [
{
"if": {
"properties": {
"decision": { "const": "absorbed" }
}
},
"then": {
"required": ["evidence"],
"properties": {
"github_close_state": { "const": "completed" }
}
}
},
{
"if": {
"properties": {
"decision": { "const": "superseded" }
}
},
"then": {
"properties": {
"github_close_state": { "const": "not_planned" }
}
}
},
{
"if": {
"properties": {
"decision": {
"enum": ["still_needed", "blocked"]
}
}
},
"then": {
"properties": {
"github_close_state": { "type": "null" }
}
}
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
#!/usr/bin/env python3
import json
import subprocess
import sys
from pathlib import Path

def run_gh_cmd(cmd: list[str]) -> str:
print(f"Running: {' '.join(cmd)}")
result = subprocess.run(cmd, capture_output=True, text=True)
if result.returncode != 0:
print(f"Error running cmd: {result.stderr}", file=sys.stderr)
return result.stdout.strip()

def post_comment(issue_number: int, body: str):
cmd = ["gh", "issue", "comment", str(issue_number), "-b", body]
run_gh_cmd(cmd)

def close_issue(issue_number: int, reason: str):
cmd = ["gh", "issue", "close", str(issue_number), "-r", reason]
run_gh_cmd(cmd)

def main():
inventory_path = Path(".claude/skills/issue-refinement-loop/scripts/sweep_inventory.json")
if not inventory_path.exists():
print("Inventory not found.", file=sys.stderr)
sys.exit(1)

with open(inventory_path, "r", encoding="utf-8") as f:
inventory = json.load(f)

summary_lines = ["### issue-refinement-loop Sweep Summary (#395)\n"]

for item in inventory:
issue_number = item["issue_number"]
decision = item["decision"]
state = item.get("current_state")
github_close_state = item.get("github_close_state")
reasoning = item.get("reasoning")
evidence = item.get("evidence")

summary_lines.append(f"- #{issue_number}: **{decision}** (was {state})")

# Skip if already closed
if state == "CLOSED":
continue

if decision in ["absorbed", "superseded"]:
# Format comment
comment_body = f"### Decision: {decision.capitalize()}\n\n"
comment_body += f"**Reasoning**: {reasoning}\n"
if decision == "absorbed" and evidence:
comment_body += "\n**Evidence**:\n"
if evidence.get("pr_numbers"):
comment_body += "- PRs: " + ", ".join(f"#{pr}" for pr in evidence["pr_numbers"]) + "\n"
if evidence.get("file_paths"):
comment_body += "- Paths: " + ", ".join(f"`{p}`" for p in evidence["file_paths"]) + "\n"
if evidence.get("ac_vc_refs"):
comment_body += "- AC/VC Refs: " + ", ".join(evidence["ac_vc_refs"]) + "\n"

post_comment(issue_number, comment_body)

if github_close_state == "completed":
close_issue(issue_number, "completed")
elif github_close_state == "not_planned":
close_issue(issue_number, "not planned")

elif decision in ["still_needed", "blocked"]:
comment_body = f"### Decision: {decision.replace('_', ' ').capitalize()}\n\n"
comment_body += f"**Reasoning**: {reasoning}\n"
post_comment(issue_number, comment_body)

# Post summary to #391 (Parent tracker)
post_comment(391, "\n".join(summary_lines))
print("Sweep applied successfully.", file=sys.stderr)

if __name__ == "__main__":
main()
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#!/usr/bin/env python3
import json
import subprocess
import sys
from pathlib import Path

# Target candidates from Issue #395
TARGET_ISSUES = [151, 203, 220, 228, 252, 300, 185, 186, 30, 247, 248, 339, 389]

def run_gh_cmd(cmd: list[str]) -> str:
result = subprocess.run(cmd, capture_output=True, text=True, check=True)
return result.stdout.strip()

def get_issue_info(issue_number: int) -> dict:
cmd = ["gh", "issue", "view", str(issue_number), "--json", "title,state,url"]
try:
output = run_gh_cmd(cmd)
return json.loads(output)
except subprocess.CalledProcessError as e:
print(f"Error fetching issue {issue_number}: {e}", file=sys.stderr)
return {}

def main():
print("Fetching issue information...", file=sys.stderr)
inventory = []
for issue_number in TARGET_ISSUES:
info = get_issue_info(issue_number)
if not info:
continue

# Pre-fill structure for CLOSE_DECISION_V1
state = info.get("state")
decision = "still_needed"
github_close_state = None
evidence = None

if state == "CLOSED":
# If already closed, we might categorize it as absorbed or superseded based on our knowledge,
# but for the inventory we can just put a placeholder or skip closing them.
# However, the schema requires evidence for absorbed.
decision = "absorbed"
github_close_state = "completed"
evidence = {"pr_numbers": [], "file_paths": [], "ac_vc_refs": []}

decision_item = {
"issue_number": issue_number,
"title": info.get("title"),
"current_state": state,
"decision": decision,
"github_close_state": github_close_state,
"reasoning": "Pending manual review."
}

if evidence is not None:
decision_item["evidence"] = evidence

inventory.append(decision_item)

output_path = Path(".claude/skills/issue-refinement-loop/scripts/sweep_inventory.json")
output_path.write_text(json.dumps(inventory, indent=2, ensure_ascii=False))
print(f"Created inventory at {output_path}", file=sys.stderr)

if __name__ == "__main__":
main()
146 changes: 146 additions & 0 deletions .claude/skills/issue-refinement-loop/scripts/sweep_inventory.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
[
{
"issue_number": 151,
"title": "実装: issue-refinement-loop に delivery-rollup parent の未起票 child slot 検出 guard を追加する",
"current_state": "OPEN",
"decision": "absorbed",
"github_close_state": "completed",
"reasoning": "Absorbed by the fail-closed delivery-rollup child materialization and follow-up materialization rules.",
"evidence": {
"pr_numbers": [341, 413],
"file_paths": [".claude/skills/issue-refinement-loop/references/follow-up-materialization.md"],
"ac_vc_refs": []
}
},
{
"issue_number": 203,
"title": "改善: issue-refinement-loop の web-researcher Step 1b に transient auth failure への 1-retry 機構を追加する",
"current_state": "CLOSED",
"decision": "superseded",
"github_close_state": "not_planned",
"reasoning": "Superseded as retry responsibility shifted to the SubAgent itself autonomously.",
"evidence": {
"pr_numbers": [],
"file_paths": [],
"ac_vc_refs": []
}
},
{
"issue_number": 220,
"title": "実装: issue-refinement-loop の Scope 変更シグナル検出に anchor-comment 由来 reframe の除外規定を追加する",
"current_state": "OPEN",
"decision": "absorbed",
"github_close_state": "completed",
"reasoning": "Absorbed into scope signal guard reference via thin entrypoint implementation.",
"evidence": {
"pr_numbers": [407, 413],
"file_paths": [".claude/skills/issue-refinement-loop/references/scope-signal-guard.md"],
"ac_vc_refs": []
}
},
{
"issue_number": 228,
"title": "実装: issue-refinement-loop が anchor_comment_url 未指定時に trusted author コメントを自動検出して Step 0a/0b を起動する",
"current_state": "OPEN",
"decision": "superseded",
"github_close_state": "not_planned",
"reasoning": "Superseded by the thin entrypoint architectural shift, where orchestrator or CLI explicitly pass the anchor comment URL."
},
{
"issue_number": 252,
"title": "実装: issue-refinement-loop がコメントフィードバックの AC/VC 修正案を Issue 本文に反映していることを確認するチェックを追加",
"current_state": "OPEN",
"decision": "absorbed",
"github_close_state": "completed",
"reasoning": "Absorbed into ac-vc reflection reference.",
"evidence": {
"pr_numbers": [413],
"file_paths": [".claude/skills/issue-refinement-loop/references/ac-vc-reflection.md"],
"ac_vc_refs": []
}
},
{
"issue_number": 300,
"title": "docs(issue-refinement-loop): superseded_by_decision / max_iterations 終了時の派生改善候補追跡手順を明確化する",
"current_state": "OPEN",
"decision": "absorbed",
"github_close_state": "completed",
"reasoning": "Absorbed into the termination policy documentation.",
"evidence": {
"pr_numbers": [413],
"file_paths": [".claude/skills/issue-refinement-loop/references/termination-policy.md"],
"ac_vc_refs": []
}
},
{
"issue_number": 185,
"title": "運用: issue-refinement-loop SKILL.md の自動起票セクションで候補収集 SubAgent 名を明示する",
"current_state": "OPEN",
"decision": "superseded",
"github_close_state": "not_planned",
"reasoning": "Superseded by the SubAgent-owned contract migration which redefines data flow."
},
{
"issue_number": 186,
"title": "運用: impl-review-loop 以外の skill 終了コメントにも note_only_observations / follow_up_issues フィールドを統一する",
"current_state": "OPEN",
"decision": "still_needed",
"github_close_state": null,
"reasoning": "Cross-cutting concern. Should not be closed in a single phase according to review feedback."
},
{
"issue_number": 30,
"title": "実装: Out of Scope / Remaining Parent Gaps を実 Issue として必ず起票する手順を create-issue / review-issue / refinement-loop に組み込む",
"current_state": "OPEN",
"decision": "still_needed",
"github_close_state": null,
"reasoning": "Cross-cutting concern. Should not be closed in a single phase according to review feedback."
},
{
"issue_number": 247,
"title": "実装: web-researcher / gemini-cli-headless-delegation に grounding failure retry と direct fallback 判定を集約する",
"current_state": "CLOSED",
"decision": "absorbed",
"github_close_state": "completed",
"reasoning": "Absorbed via WEB_RESEARCH_RESULT_V1 schema migration.",
"evidence": {
"pr_numbers": [403],
"file_paths": [".claude/skills/issue-refinement-loop/references/web-research-routing.md"],
"ac_vc_refs": []
}
},
{
"issue_number": 248,
"title": "実装: gemini-cli-headless-delegation に REPO_EVIDENCE_REF_V1 を追加し file evidence の commit_sha 固定・excerpt_sha256 検証を SSOT 化する",
"current_state": "CLOSED",
"decision": "absorbed",
"github_close_state": "completed",
"reasoning": "Absorbed via REPO_EVIDENCE_REF_V1 acting as SSOT.",
"evidence": {
"pr_numbers": [406],
"file_paths": [".claude/skills/issue-refinement-loop/references/anchor-comment-handling.md"],
"ac_vc_refs": []
}
},
{
"issue_number": 339,
"title": "改善: speckit-taskstoissues に LOOP_PROTOCOL adapter alignment を追加する(Follow-up D)",
"current_state": "OPEN",
"decision": "still_needed",
"github_close_state": null,
"reasoning": "Still needed as this is an active speckit-taskstoissues improvement."
},
{
"issue_number": 389,
"title": "perf(claude): #295 軽量化後の runtime /usage 計測(3 代表 Issue)",
"current_state": "CLOSED",
"decision": "absorbed",
"github_close_state": "completed",
"reasoning": "Performance measurement task was completed during the #295 lightweighting.",
"evidence": {
"pr_numbers": [388],
"file_paths": [],
"ac_vc_refs": []
}
}
]