Repository navigation
Description
Finding
PR #411 (fix for #410, merged in e987e5c7) made the trailing-fence drop in issue_drafts() conditional on the workflow:issue marker itself being the trapped text:
# scripts/research_workflow.py:567-571 on current main (7ccd2817)
dropped = "\n".join(lines[:-1])
if "workflow:issue" not in draft_prose(block) and "workflow:issue" in draft_prose(dropped):
block = droppedThat recovers the canonical #401 shape (marker after an unclosed inner example) and preserves the #410 exemption (marker before a properly closed example that is the draft's last element). It does not recover the combination of the two acknowledged placements:
- the marker sits before the inner example — the exact placement PR fix(workflow): keep a closed inner example exempt in an unclosed draft (#410) #411's own new test documents ("The marker sits before the example, as in a draft whose example is an appendix"), and
- the inner example is unclosed (fix(workflow): drafts whose inner code example is unclosed still escape the link check past the example (#400 residual) #401's authoring slip), so draft prose after the example's opening fence is trapped inside the example as
draft_prose()sees it, and the draft's own closing fence is the block's trailing bare fence.
In that shape draft_prose(block) already contains the marker (it is before the example), so the first condition fails, the fence is kept, and the trapped prose is discarded with the closed-looking example. A broken link in the trapped prose passes the check silently — the #401 failure mode, differing only in marker position.
Evidence
Verified on current main 7ccd2817 with the merged scripts/research_workflow.py (scratch copy, removed after):
Canonical #401 shape (marker after the unclosed example) — recovered, as intended:
issue_drafts()yields the concept pointer line; the broken pointer is link-checked.
Hybrid shape (marker before, pointer trapped after the unclosed example):
```markdown
# Research
<!-- workflow:issue {"package": "pkg", "concept": "C001", "stage": "S1"} -->
```python
print('example')
- Concept Document: [concept](concepts/C001-source-preservation.md)
```_fenced_blocks()yields the block withclosed=False, trailing line is a bare fence — the same trigger shape as fix(workflow): drafts whose inner code example is unclosed still escape the link check past the example (#400 residual) #401/fix(workflow): #407 trailing-fence drop strips a properly closed inner example's exemption in an unclosed draft #410.draft_prose(block)='# Research\n<!-- workflow:issue ... -->'(marker present, so no drop).draft_prose(dropped)does surface the trapped pointer line, but it is never used because the marker test short-circuits the decision.issue_drafts()yields only'# Research\n';link_targets()on the drafts is[]— the broken pointerconcepts/C001-source-preservation.mdnever reaches the link check, socheckpasses on a draft whose pointer is broken.- Control: the fix(workflow): #407 trailing-fence drop strips a properly closed inner example's exemption in an unclosed draft #410 shape (marker before a properly closed example at the end) correctly yields the valid pointer and keeps the example's broken link-shaped line exempt — that behaviour must not regress.
Cross-repo: research_workflow.py / draft_prose / issue_drafts exist only in this repo (checked the local clones of developing-today/opencode, developing-today/openchamber and dezren39/nix — no matches), so this is a single-repo issue.
Deduped: searches for draft_prose, "unclosed draft" and "410 411 fence" return only #401 (closed), #410 (closed) and PRs #407/#411 themselves — neither covers a marker placed before the unclosed example.
Why it matters
research_workflow.py check is the guard that a trigger-issue draft's pointers actually resolve before the draft is copied into a GitHub issue. A whole class of drafts — marker-early / appendix-style drafts, a placement #411 itself treats as valid — silently loses that guard for any prose written after an unclosed inner example, which is precisely the slip #401 set out to recover.
Acceptance criteria
- A regression test with an unclosed draft whose marker sits before an unclosed inner example, with draft prose (including a concept pointer) after the example's opening fence: the draft fails
checkwhen that pointer is broken and passes when it is valid. - The existing fix(workflow): drafts whose inner code example is unclosed still escape the link check past the example (#400 residual) #401 tests (marker after the unclosed example) and the fix(workflow): #407 trailing-fence drop strips a properly closed inner example's exemption in an unclosed draft #410 tests (marker before a properly closed example at the end — example contents stay exempt, draft prose still checked) all still pass.
- The full workflow test suite stays green and
research_workflow.py check --repo-root .on the real tree returns ok. - If the two shapes are judged genuinely indistinguishable for this placement too, record that limitation explicitly in the
issue_drafts()comment instead of leaving the marker test as an implied complete recovery, and close this issue with that rationale.
Activity