@open-tomato/rafa 0.42.0 → 0.44.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -105,11 +105,26 @@ changes the area, re-run the step 3 search against the new terms. If no priority
105
105
  comes back, file without any priority label and leave prioritisation to triage;
106
106
  never guess one.
107
107
 
108
- **5. Draft the issue.** Write the body to a file (e.g. `/tmp/bug.md`) with these
109
- sections: Context, Reproduction, Expected, Actual, Environment, Regression range
110
- (when known), Artifact (the verbatim output), Refs (paths and symbols from the
111
- Artifact), Source agent output (verbatim, in a fence), Owner verdict (only
112
- when someone gave you one). Title as `Fix {noun} — {context}`.
108
+ **5. Draft the issue.** Write the body to a file (e.g. `/tmp/bug.md`) with
109
+ `## ` sections. rafa reads five of them as the bug's fields:
110
+
111
+ - `What`: the context and the symptom.
112
+ - `Reproduce`: the steps, or the condition that revealed it. Required, and
113
+ never "unknown": when no steps are known, say what was running when it
114
+ showed.
115
+ - `Rerun`: one command that shows it again, when there is one.
116
+ - `Artifact`: the verbatim output. rafa takes the error line from its first
117
+ line and keeps its first 60 lines.
118
+ - `Suspected cause`: only when the source agent named one.
119
+
120
+ Any other section is kept as you wrote it, after those: Expected, Actual,
121
+ Regression range (when known), Refs (paths and symbols from the Artifact),
122
+ Source agent output (verbatim, in a fence), Owner verdict (only when someone
123
+ gave you one). Write no Environment or Versions section: rafa fills the
124
+ place, its own version, the commit and the package.
125
+
126
+ Write no title. rafa renders it from the fields you pass in step 7, as
127
+ `<module> - <action>: <summary>`.
113
128
 
114
129
  The **Refs** section lists paths (e.g. `src/a.ts`) and symbols (code-shaped
115
130
  names like `handleClick`, `BUFFER_SIZE`, or `serve()`) extracted from the
@@ -126,20 +141,41 @@ reader must be able to see that something was removed and what kind of thing it
126
141
  was.
127
142
 
128
143
  **6. Confirm before filing.** Filing a new issue on a public repo publishes
129
- content under the org's name — show the user the rendered draft and the target
130
- labels/priority, and ask before creating. Do not file on your own initiative.
144
+ content under the org's name — show the user the rendered draft (step 7's
145
+ `--dry-run` prints it) and the target module, cause and priority, and ask
146
+ before creating. Do not file on your own initiative.
131
147
  Commenting on an existing issue (step 3, hit case) does not need this
132
148
  confirmation — it only adds evidence to a record that already exists.
133
149
 
134
- **7. File it.**
150
+ **7. File it.** Pick the cause code first. rafa ranks the closest ones for
151
+ the error line:
135
152
 
136
153
  ```bash
137
- rafa issue create --type=bug --body-file /tmp/bug.md \
138
- --label "<area>" --label "<priority>"
154
+ rafa bug codes --suggest="<the error line>"
139
155
  ```
140
156
 
141
- Drop the priority label entirely if step 4 produced none, and the area label if
142
- routing stayed unresolved.
157
+ Then file from the fields:
158
+
159
+ ```bash
160
+ rafa issue create --type=bug --body-file=/tmp/bug.md \
161
+ --module=<module> --action=<action> --summary="<one line>" \
162
+ --cause=<code> --reproduce="<steps, or the revealing condition>" \
163
+ --priority=<priority>
164
+ ```
165
+
166
+ - `--module` is the area from step 4, lower-case, and `--module=unknown` if
167
+ routing stayed unresolved. `--action` is what was running, a command, a step
168
+ or a test, or `unknown`.
169
+ - `--summary` is one line saying what is wrong, with no module in front.
170
+ - `--cause` is a code from the list. When no code fits, pass
171
+ `<family>:new-context` with `--proposed=<family>:<leaf>`, the leaf you
172
+ would have used, or `unknown:new-context` when no family fits either.
173
+ - `--reproduce` can be left out when the body file has a `Reproduce` section.
174
+ - Drop `--priority` entirely if step 4 produced none.
175
+
176
+ For step 6, run the same line with `--dry-run` first: it prints the title and
177
+ the body rafa would file, and files nothing. A line rafa refuses names each
178
+ field it lacks; add them and run it again.
143
179
 
144
180
  **8. Report back** the issue number, the tracker url, the priority you were
145
181
  given, and the redactions you made. If `gh` was unreachable, say so explicitly,
@@ -156,6 +192,8 @@ write the report into the repo instead.
156
192
  vulnerability.
157
193
  - Do not guess a priority. Ask; if nobody sets one, file with no priority label
158
194
  and leave it for triage.
195
+ - Do not write a title, or a module in front of the summary. rafa renders the
196
+ title from the fields, and a title typed by hand must agree with them.
159
197
  - Do not size the issue or estimate effort. You don't have the context, and
160
198
  guessing is worse than leaving it for triage.
161
199
  - Do not move issues across project boards or milestones — filing or commenting
@@ -44,9 +44,13 @@ rafa issue list --module=cli-gap --search="<the step in a few words>"
44
44
  When none matches, file it:
45
45
 
46
46
  ```bash
47
- rafa issue create --type=bug --module=cli-gap --title="<the step rafa cannot do yet>" --body="<the raw line, the rafa line that came closest, what it lacks>"
47
+ rafa issue create --type=bug --module=cli-gap --action="<the rafa action that came closest, or unknown>" --summary="<the step rafa cannot do yet>" --cause=cli:new-context --reproduce="<the raw line>" --body="<the rafa line that came closest, what it lacks>"
48
48
  ```
49
49
 
50
+ A bug is filed from its fields, and rafa renders its title from them. A
51
+ line that leaves one of the four out is refused, naming it. The action
52
+ is lower-case, without the word `rafa`: `pr open`, `loop start`.
53
+
50
54
  When one matches, add the stretch's case to it:
51
55
 
52
56
  ```bash