Repository navigation
fix: parse machine tags only from the trailing tag region (#9) - #10
Merged
Merged
Conversation
Tag extraction and editing scanned the whole item line, so a `@key=value` mentioned in a task's descriptive title (e.g. a task titled after the `@tags=… → @milestone=…` migration) was parsed as a real tag. This miscounted such a task into a phantom `milestone` bucket, and made `migrate-tags-to-milestone` treat it as an already-assigned conflict and skip it. Anchor tag parsing to the trailing contiguous run of recognized `@…` tokens after the title: - split_item_tags() splits an item's rest into (title, trailing tag tokens); reads (_get_tag_value, get_all_items) and edits (_set_single_tag, _set_or_remove_tag) now operate on that region only. Whitespace normalization matches how the tool already writes tags, so tool-managed lines are unchanged. - Fixes the write path too: set/link no longer strip a look-alike @key=value out of the title prose. - Docstring + schema note the trailing-region rule. version 1.1.0 -> 1.1.1. - New e2e scenario 48 reproduces the issue (rollup, list filter, show, migrate, and title-preservation on write).
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #9.
Problem
Machine tags (
@milestone=,@deps=,@tags=, …) were extracted by scanning the whole item line, so a@key=valuethat merely appears in a task's descriptive title was parsed as a real tag. Reported for@milestone=:milestonerollup showed a phantom bucket for a milestone mentioned only in prose.migrate-tags-to-milestonetreated such a task as an already-assigned conflict and skipped it — which is exactly what happens to the task that tracks the migration itself.The write path had the same class of bug:
set/linkwouldre.suba look-alike@key=valueout of the title prose.Fix
Anchor tag parsing/editing to the trailing contiguous run of recognized
@…tokens after the title:split_item_tags(rest) -> (title, tag_tokens)— only the trailing run of known@name=value/@shadowtokens counts as tags._get_tag_value,get_all_items) and edits (_set_single_tag,_set_or_remove_tag) now operate on that region only.Verification
list --milestonefilter,show,migratenot-skipped, and title preserved on write).make checkgreen: 243 assertions, 0 failures; smoke OK; Python 3.8-safe; single file, zero deps.@milestone=<id>no longer creates a phantom bucket; the rollup shows only real milestones +default.Notes
@shadowdetection is intentionally left whole-line: it's a system-only flag never typed in prose, and it's central to the heavily-tested shadow machinery.__version__1.1.0 → 1.1.1; CHANGELOG + schema updated.