Skip to content

Commit 2f2b159

Browse files
authored
fix(autodoc): add source material quality check; restore details block (#499)
## Summary - Adds conservatism clause to the burlap prompt: if the Epic is a placeholder or lacks real technical detail, the model must set `action: none` rather than hallucinating a draft. Fixes the 765-word fabricated document produced in the last test run. - Restores the `<details>` collapse of the documentation draft in the posted issue comment. This was dropped when `post_report.py` was removed in favour of inline shell; the wrapping Python snippet is now inlined in the finalize step. ## Test plan - [ ] Close a test issue tagged `Epic` + `Doc : Needs Doc` that is a clear placeholder (no real PRs, no substance) — confirm report has `action: none` - [ ] Close a real Epic with merged PRs — confirm comment is posted with draft inside a `<details>` block
1 parent 08c6f15 commit 2f2b159

1 file changed

Lines changed: 26 additions & 2 deletions

File tree

.github/workflows/issue_autodoc.yml

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,14 @@ jobs:
118118
Run multiple searches with varied queries to thoroughly assess coverage. Use the
119119
results to determine whether documentation exists, is sufficient, or needs updating.
120120
121+
**Source material quality check:** before drafting anything, assess whether the
122+
Epic and its PRs contain enough real technical detail to write accurate
123+
documentation. If the Epic is a placeholder, has no associated PRs, or describes
124+
a feature without specifying its behaviour, configuration, or user-facing surface —
125+
set `action: none` and explain that the source material is insufficient. Do not
126+
infer, invent, or pad from general knowledge. A short honest `none` report is
127+
always preferable to a hallucinated draft.
128+
121129
Then write the report to the path shown at the bottom of this context block,
122130
using the Write tool.
123131
@@ -298,8 +306,24 @@ jobs:
298306
exit 0
299307
fi
300308
301-
# Prepend idempotency marker so subsequent runs can find and edit this comment.
302-
{ echo '<!-- autodoc-report -->'; cat "$REPORT"; } > /tmp/comment_body.md
309+
# Build comment body: prepend idempotency marker and collapse the doc draft
310+
# under a <details> block so the comment isn't a wall of text.
311+
export REPORT
312+
python3 << 'PYEOF'
313+
import os
314+
report = open(os.environ['REPORT']).read()
315+
marker = '<!-- BEGIN_DOC_DRAFT -->'
316+
if marker in report:
317+
before, draft = report.split(marker, 1)
318+
body = (before.rstrip()
319+
+ '\n\n<details>\n<summary>Documentation Draft</summary>\n\n'
320+
+ draft.lstrip('\n')
321+
+ '\n</details>')
322+
else:
323+
body = report
324+
with open('/tmp/comment_body.md', 'w') as f:
325+
f.write('<!-- autodoc-report -->\n' + body.rstrip())
326+
PYEOF
303327
304328
# Edit the existing autodoc comment if one exists, otherwise create a new one.
305329
# --paginate ensures we search all comments, not just the first page.

0 commit comments

Comments
 (0)