Repository navigation
fix(workflow): recover trapped concept pointer when marker precedes an unclosed example - #419
Conversation
…n unclosed example (#414) issue_drafts() dropped an unclosed draft's trailing fence only when doing so surfaced the workflow:issue marker (#411). A draft whose marker sits before an unclosed inner example — the placement #410's appendix shape documents — traps its Concept Document pointer inside the example instead, and that pointer was never link-checked. Drop the fence when recovery surfaces either draft-defining element the kept prose lacks: the marker, or a Concept Document pointer line not already in the kept prose. A properly closed appendix example (#410) surfaces neither, so its exemption stands; the residual indistinguishable shape is documented in the comment. Two regression tests (broken pointer fails, valid passes); the broken-pointer test fails pre-fix.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 13 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c0909e97af
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| recovered = draft_prose(dropped) | ||
| if ( | ||
| "workflow:issue" not in kept and "workflow:issue" in recovered | ||
| ) or concept_pointers(recovered) - concept_pointers(kept): |
There was a problem hiding this comment.
Keep Concept Document lines inside closed examples exempt
When an unclosed outer draft ends with a properly closed fenced example that itself contains a sample - Concept Document: line, this set difference treats that example-only line as recovered draft prose. It then drops the example's genuine closing fence, causing draft_prose() to expose the entire example and links() to reject any intentionally non-resolving links in it. This regresses the closed-appendix exemption preserved by the adjacent #410 logic; the recovery signal must distinguish the draft's pointer from pointer-shaped content inside a closed example.
Useful? React with 👍 / 👎.
Closes #414
Problem
issue_drafts()dropped an unclosed draft's trailing fence only when doing so surfaced theworkflow:issuemarker (the #411 recovery for #401). A draft whose marker sits before an unclosed inner example — the placement #410's own appendix test documents — traps its Concept Document pointer inside the example instead:draft_prose(block)already contains the marker, so no drop occurred, the trapped prose was discarded with the closed-looking example, and a broken pointer passedresearch_workflow.py checksilently. Reproduced on main 86a2aa9: the hybrid draft yielded only'# Research'andlink_targetswas[].Solution
Drop the trailing fence when recovery surfaces either draft-defining element the kept prose lacks:
workflow:issuemarker (existing fix(workflow): drafts whose inner code example is unclosed still escape the link check past the example (#400 residual) #401/fix(workflow): keep a closed inner example exempt in an unclosed draft (#410) #411 signal), orconcept_pointers()helper, set difference — fix(workflow): #411 marker test misses trapped draft prose when the marker sits before an unclosed inner example #414).A properly closed appendix example (#410) surfaces neither — its marker and pointer already sit in the kept prose — so its exemption stands. The residual shape (trapped prose that is neither element, in a draft already carrying both) is genuinely indistinguishable from a closed example's contents; that limitation is now recorded explicitly in the
issue_drafts()comment, per #414's acceptance criteria.Single-repo:
research_workflow.pyexists only in this repo (per #414's cross-repo check).Verification
link_targets == []; post-fix the broken pointerconcepts/C001-source-preservation.mdis surfaced. fix(workflow): #407 trailing-fence drop strips a properly closed inner example's exemption in an unclosed draft #410 control still yields only its valid pointer (example contents exempt); fix(workflow): drafts whose inner code example is unclosed still escape the link check past the example (#400 residual) #401 canonical shape still recovered.origin/main'sresearch_workflow.py), passes post-fix.python3 scripts/research_workflow.py check --repo-root .on the real tree:ok: true.ruff format --checkclean on both changed files (the format treefmt applies).Need help on this PR? Tag
@codesmith-botwith what you need.