This repository was archived by the owner on Jul 16, 2026. It is now read-only.
Repository navigation
Phase 5.21: stop parse_priority at task: delimiter (sync OSS sutando) - #89
Merged
Merged
Conversation
Task files place `task:` last, with the user-supplied body following. `parse_priority_from_text` scans line-by-line for `priority:` headers. Before this PR it stopped only on `---` or a blank line — not on `task:`. A forged body line `priority: urgent` after `task:` was still matched, escalating priority via the task-body injection vector. OSS sutando closes this by stopping at the first `task:` line (everything after is opaque body). This PR ports that one-line behavioral change verbatim. The function body is now identical to OSS. Also updates the existing task-priority.test.py header fixture to place `priority:` before `task:` (the writer convention), and adds task-priority-stop-at-task-delimiter.test.py with 6 regression cases. Verification: 62/62 Python tests pass. Co-authored-by: Cursor <cursoragent@cursor.com>
7 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes a priority-escalation injection vector in
parse_priority_from_text. Task files placetask:last, with the user-supplied body following. The parser previously stopped scanning only on---or a blank line — not ontask:— so a forged body linepriority: urgentaftertask:could escalate priority. OSS sutando fixes this by stopping at the firsttask:line; this PR ports that change verbatim.What changes
src/task_priority.py: addtask:to the header-scan stop condition (one behavioral line + docstring)tests/task-priority.test.py: fix header fixture field order (priority:beforetask:— matches writer convention)tests/task-priority-stop-at-task-delimiter.test.py: 6 regression cases (new file, ported from OSS)Why minimal divergence
Test plan
priority: urgentheader beforetask:→ parsed as urgentpriority: urgentaftertask:→ ignored (returns normal) — core regression---separator still breaks scanpriority:word in multi-paragraph body → ignoredPhase context
Made with Cursor