@@ -10,7 +10,7 @@ Fix errors and warnings from a `check-issue` report. Auto-fixes mechanical issue
1010## Invocation
1111
1212```
13- /fix-issue <issue-number >
13+ /fix-issue <model|rule >
1414```
1515
1616## Constants
@@ -21,13 +21,15 @@ GitHub Project board IDs:
2121| ----------| -------|
2222| ` PROJECT_ID ` | ` PVT_kwDOBrtarc4BRNVy ` |
2323| ` STATUS_FIELD_ID ` | ` PVTSSF_lADOBrtarc4BRNVyzg_GmQc ` |
24+ | ` STATUS_BACKLOG ` | ` ab337660 ` |
2425| ` STATUS_READY ` | ` f37d0d80 ` |
2526
2627## Process
2728
2829``` dot
2930digraph fix_issue {
3031 rankdir=TB;
32+ "Pick issue from Backlog" [shape=box];
3133 "Fetch issue + check comment" [shape=box];
3234 "Parse failures & warnings" [shape=box];
3335 "Auto-fix mechanical issues" [shape=box];
@@ -39,6 +41,7 @@ digraph fix_issue {
3941 "Ask what to change (free-form)" [shape=box];
4042 "Apply changes + re-check locally" [shape=box];
4143
44+ "Pick issue from Backlog" -> "Fetch issue + check comment";
4245 "Fetch issue + check comment" -> "Parse failures & warnings";
4346 "Parse failures & warnings" -> "Auto-fix mechanical issues";
4447 "Auto-fix mechanical issues" -> "Present auto-fixes to human";
@@ -54,15 +57,40 @@ digraph fix_issue {
5457
5558---
5659
57- ## Step 1: Fetch Issue and Check Comment
60+ ## Step 1: Pick Next Issue from Backlog
61+
62+ The argument is ` model ` or ` rule ` — determines which issue type (` [Model] ` or ` [Rule] ` ) to process.
63+
64+ ### 1a: Fetch candidate list from project board
65+
66+ ``` bash
67+ uv run --project scripts scripts/pipeline_board.py backlog < model| rule> --format json
68+ ```
69+
70+ Returns all Backlog issues of the requested type, sorted by ` Good ` label first then by issue number:
71+
72+ ``` json
73+ {
74+ "issue_type" : " rule" ,
75+ "items" : [
76+ {"number" : 246 , "title" : " [Rule] A → B" , "has_good" : true , "labels" : [" Good" , " rule" ]},
77+ {"number" : 91 , "title" : " [Rule] C to D" , "has_good" : false , "labels" : [" rule" ]}
78+ ]
79+ }
80+ ```
81+
82+ ### 1b: Pick the top issue
83+
84+ Pick the first item from the list. If the list is empty, STOP with message: "No ` [Model] ` /` [Rule] ` issues in Backlog."
85+
86+ ### 1c: Fetch the chosen issue
5887
5988``` bash
6089gh issue view < NUMBER> --json title,body,labels,comments
6190```
6291
63- - Detect issue type from title: ` [Rule] ` or ` [Model] `
6492- Find the ** most recent** comment that starts with ` ## Issue Quality Check ` — this is the check-issue report
65- - If no check comment found, STOP with message: "No check-issue report found. Run ` /check-issue <NUMBER> ` first."
93+ - If no check comment found, run ` /check-issue <NUMBER> ` first, then re-fetch the issue
6694
6795---
6896
@@ -99,7 +127,7 @@ Tag each issue as:
99127| Incomplete ` (TBD) ` in fields derivable from other sections | Fill from context |
100128| Incorrect DOI format | Reformat to ` https://doi.org/... ` |
101129
102- ** Substantive** (brainstorm with human):
130+ ** Substantive** (brainstorm with human, ask for human's input ):
103131
104132| Issue pattern | Why human input needed |
105133| --------------| ----------------------|
@@ -181,6 +209,8 @@ Print results to the human as a summary table (Check / Result / Details).
181209
182210## Step 7: Ask Human for Decision
183211
212+ Show the human the draft issue body.
213+
184214Use ` AskUserQuestion ` to present the options:
185215
186216> The issue has been re-checked locally. What would you like to do?
@@ -198,18 +228,15 @@ Apply the requested changes to the draft issue body, re-check locally (Step 6),
198228
199229---
200230
201- ## Step 8: Finalize (on "Looks good")
231+ ## Step 8: Finalize (If human picks 1 "Looks good")
202232
203233Only reached when the human approves. Now push everything to GitHub.
204234
205235### 8a: Edit the issue body
206236
207- ``` bash
208- # Write updated body to temp file
209- cat > /tmp/fix_issue_body.md << 'BODYEOF '
210- $UPDATED_BODY
211- BODYEOF
237+ Use the Write tool to save the updated body to ` /tmp/fix_issue_body.md ` , then:
212238
239+ ``` bash
213240gh issue edit < NUMBER> --body-file /tmp/fix_issue_body.md
214241```
215242
@@ -238,16 +265,10 @@ gh issue edit <NUMBER> --add-label "Good"
238265
239266### 8d: Move to Ready on project board
240267
268+ Use the ` item_id ` obtained from Step 1a:
269+
241270``` bash
242- # Find the project item ID for this issue
243- ITEM_ID=$( gh project item-list 8 --owner CodingThrust --format json | \
244- jq -r ' .items[] | select(.content.number == <NUMBER>) | .id' )
245-
246- gh project item-edit \
247- --id " $ITEM_ID " \
248- --project-id PVT_kwDOBrtarc4BRNVy \
249- --field-id PVTSSF_lADOBrtarc4BRNVyzg_GmQc \
250- --single-select-option-id f37d0d80
271+ uv run --project scripts scripts/pipeline_board.py move < ITEM_ID> Ready
251272```
252273
253274### 8e: Confirm
0 commit comments