Skip to content

fix(workflow): #411 marker test misses trapped draft prose when the marker sits before an unclosed inner example #414

Closed

Description

@dezren39

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 = dropped

That 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:

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)
```

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions