import_github.py: twin creation never copies the GitHub issue's body text nf-ovxi ← Beads

closed priority 2 task unassigned activesession:011-twinbody

Twinned from https://github.com/cfsh/ninefold/issues/1147 by tools/beads/import_github.py's reconcile pass.

Session: TBD

Found live by Aedan looking at http://159.89.200.95:8765/issue/nf-tvc.10 — T8a's twinned bd task for #1137 shows only the one-line "Twinned from <url>" stub, not #1137's actual ~4KB body (Goal/Scope/Out-of-scope spec).

Root cause, in tools/beads/import_github.py (PR #1140, design 011 T8a):

```python _GH_ISSUE_FIELDS = ("number", "title", "state", "labels", "url") ```

body is never requested from gh in the first place — not fetched then discarded, just never in the field list. _create_twin's body-file write is then necessarily just the stub:

```python handle.write(f"Twinned from {url} by tools/beads/import_github.py's reconcile pass.\n") ```

Fix

- Add "body" to _GH_ISSUE_FIELDS (both the bulk issue_list call and _fetch_gh_issue's issue_view call use the same tuple — check both call sites pick it up). - _create_twin writes the real body, with the "Twinned from <url>" line as a header (not a replacement) — e.g. f"Twinned from {url} by ...\n\n{gh_issue.get('body') or ''}". - A retitle/reconcile pass on an *existing* twin should probably also catch a body that's empty-but-shouldn't-be (this bug already shipped one such twin, nf-tvc.10) — worth a look at whether the existing-twin reconcile path needs a body-backfill case, or whether that's better as a one-off manual fix on nf-tvc.10 once this lands. - Golden test coverage: extend the existing fixture pair (tools/beads/test_data/011/) with a case where the GitHub issue has a real multi-line body, asserting the created bd task's description matches.

Priority: this blocks T8 (#1042, the real migration) in practice — T8's import step twins every open GitHub issue through this same function, so an unfixed bug here means the whole migration ships every issue with an empty body. Not a hard blocker in the dependency-graph sense (T8a's own code is merged), but assign and land before T8 starts building on it.

Dependencies

None.

Comments

No comments.

Add a comment