Skip to content

fix: apply field edits to primary line and shadow copies, not first match (#17) - #19

Merged
budhash merged 1 commit into
mainfrom
fix/edit-primary-not-shadow
Jul 13, 2026
Merged

budhash merged 1 commit into
mainfrom
fix/edit-primary-not-shadow

Conversation

@budhash

@budhash budhash commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Fixes #17.

Problem

set_tag, edit_links, and cmd_update all edited the first line carrying the target ID in file order. For a feature with a @shadow copy, the shadow can precede the primary (shadow in ## Now, primary in ## Backlog), so:

  • set F-N --milestone m1 tagged only the shadow → the feature appeared in both its milestone (list --milestone m1, via the shadow) and default (milestone --table / list --milestone default, via the untagged primary) — the dual-instance bucket leak reported on byteorb (F-1088/1089/1093/1094/1095, F-1002).
  • Same class: every set tag, link --deps/--rel, prio, and the status verbs (done F-N could mark the shadow done and leave the primary todo) — confirmed by repro.

Fix

New find_all_item_lines() returns every line carrying the ID (primary first, then shadows). The three editors apply the edit to all of them, keeping the derived copies in sync — consistent with how shadows are created (copied from the primary line, tags included). Link/deps values are read from the primary.

Verification

Patch release: __version__ 1.1.1 → 1.1.2; CHANGELOG/schema/docstring note the sync semantics.

…atch (#17)

set_tag, edit_links, and cmd_update each edited the FIRST line carrying the
target ID in file order. For a feature with a @shadow copy the shadow can
precede the primary (e.g. shadow in ## Now, primary in ## Backlog), so
`set F-N --milestone m1` tagged only the shadow: milestone --table and
`list --milestone default` showed the feature as unassigned while
`list --milestone m1` matched it via the shadow — a dual-bucket feature.
The same first-match bug hit every set tag, link --deps/--rel, prio, and the
status verbs (done F-N could mark the shadow done and leave the primary todo).

Fix: find_all_item_lines() returns every line carrying the ID (primary first,
then shadows); the three editors now apply the edit to all of them, keeping
derived copies in sync — consistent with shadow creation, which copies the
primary line tags included. Link values are read from the primary line.

New e2e scenario 49 reproduces #17 (shadow preceding primary) and checks
set --milestone, the rollup table row, prio, and link sync. Greps anchor on
the item title because the init template's # Meta code block contains a
literal (F-0001) example line.

version 1.1.1 -> 1.1.2.
@budhash
budhash merged commit 3f631ce into main Jul 13, 2026
5 checks passed
@budhash
budhash deleted the fix/edit-primary-not-shadow branch July 13, 2026 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

set --milestone tags the @shadow duplicate, not the canonical line (dual-instance features show in both their milestone and 'default')

1 participant