Skip to content

fix(workflow): drafts whose inner code example is unclosed still escape the link check past the example (#400 residual) #401

Closed

Description

@dezren39

Finding

PR #400's nesting-aware fence scanner (fixes #393) still lets a trigger-issue draft escape the link check when the draft's embedded code example is itself unclosed. Everything in the draft from the example's opening fence onward is stripped before link checking, so any pointer/link after the example is silently unchecked — the same silent-escape failure mode as #382 / #391 / #393.

Two shapes reproduce it on current main 2b9b424a via links() in scripts/research_workflow.py:

  1. Inner example never closed — the draft's own closing fence is consumed as the example's close:

    ```markdown
    ```python
    print(1)
    - [concept](missing/a.md)
    <!-- workflow:issue {"package": "pkg", "concept": "C001", "stage": "S1"} -->
    ```

    Result: no error. The broken pointer missing/a.md is never checked. Adding a second closing fence after it changes nothing — still no error.

  2. Inner example closed with a shorter fence than it opened with (opens ````python, closes ```): the short bare fence is literal content under fence_events()' length rule, so the example is again unclosed and a broken pointer after it passes silently.

Control (the shape PR #400's regression tests cover — pointer before a properly closed ```python example) correctly raises missing link target: missing/a.md.

Evidence

Why it matters

research_workflow.py check is the guard that draft pointers resolve before a draft is copied into a GitHub issue. #400 explicitly adopted the principle that unclosed shapes are "checked rather than silently dropped" for the draft's outer fence; an author who forgets to close an embedded example — or closes it with a shorter fence — is exactly the hand-authoring slip this checker exists to catch, and today it re-opens the silent escape #400 was filed to close, for every link after the example.

Acceptance criteria

  • A regression test with a draft whose inner code example is unclosed and which carries a broken pointer after the example fails check (and passes when the pointer is valid).
  • A regression test for the shorter-closing-fence variant (example opens with 4 backticks, closes with 3) likewise fails check on a broken post-example pointer.
  • Links before the example, and the existing nested/unclosed-draft behaviour from fix(workflow): check draft links past inner code fences (#393) #400, are unchanged: the full workflow suite (48 tests) still passes and python3 scripts/research_workflow.py check --repo-root . still returns ok: true on the real tree.
  • Embedded example contents themselves remain exempt from link checks (a link-shaped line inside the example, closed or not, is not checked as draft prose).
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