Skip to content

wip init's owed-candidate symlink check covers the final path component, not its ancestors #62

Closed

Description

@brettheap

wip init step 7's owed-candidate branch asks whether $checkout/$rel itself is a symlink (path_kind, added in PR #44 round 3), but never walks $rel's own PARENT components. An adopted checkout can carry a tracked symlink at a template directory's own path — handoffs or lanes, say, replaced by a symlink to somewhere else in a person's own working copy — and every check the branch asks answers as if nothing is there at all:

  • [ -e "$checkout/$rel" ] and [ -L "$checkout/$rel" ] are both false when the resolved target does not itself exist (lstat on a path through a non-existent intermediate segment fails outright, or resolves to nothing at the far end).
  • git cat-file -e ":$rel" and HEAD:$rel" are both false: git has no notion of "a file inside a tracked symlink," so a handoffs/README.md can never be a valid tracked path once handoffs itself is a symlink.
  • git status reports the parent's own type change if anything, not a change at $rel's own path, and step 6a's exclusion is keyed on $rel by name, so it does not help either.

So the outer test falls through to the plain MISSING branch: mkdir -p -- "$checkout/$(dirname -- "$rel")" treats the existing symlink-to-a-directory as satisfying "the directory is there" (a no-op), and the following cp -- "$dest" "$checkout/$rel" follows the parent link and writes this run's template bytes wherever it points — outside the checkout, if that is where the link leads — before the later git add has any path to fail on.

What's open

Walk $rel's ancestor path components between $checkout and the file itself (mirroring unusable_dir_kind's ancestor walk, though that function answers a different question — writability of the nearest existing directory — rather than "is any component of this exact relative path a symlink") and refuse before mkdir -p/cp if any of them is one. Filed rather than fixed in PR #44 round 3 per the durable word (take what a round introduces, file what predates or extends it once the round's own diff has already taken its most load-bearing findings): round 3 already closed five real gaps in this branch with regression tests (openRepoTools:1647, :1613, :1615, :1699 twice), and this is a further hardening layer on the exact same code rather than a restatement of any of those — reported via a suppressed review comment on PR #44 (#44), not an inline thread, so there is no thread to resolve by number.

Related but distinct from #48 (ownership, not symlinks) and #49 (a git status failure masked by || :).

Activity

  1. brettheap commented on Sep 14, 2026

    @brettheap
    ContributorAuthor

    CLAIMED — lane openRepoTools-3, session 4135b2c9-34a6-47e3-a156-5adebb632fae@Eagle, 2026-09-14T22:00:27Z, for #62

    Logged in lanes/log/openRepoTools-3.md at f1baa4d2387e4130045eacd888c49c7daa0dd6d7.

    The three reads (lane-collision-protocol Rule 1):

    1. existing `CLAIMED —` comments on opensoft/openRepoTools#62:
       none
    2. `gh pr list --repo opensoft/openRepoTools --state all --search "#62"`, kept where the row or its body names `#62`:
       none
    3. `git ls-remote --heads [email protected]:opensoft/openRepoTools` branches naming `62` as a whole token:
       none
    
  2. brettheap commented on Sep 16, 2026

    @brettheap
    ContributorAuthor

    RELEASED — lane openRepoTools-3, session 4135b2c9-34a6-47e3-a156-5adebb632fae@Eagle, 2026-09-16T00:36:00Z, for #62

  3. brettheap commented on Sep 16, 2026

    @brettheap
    ContributorAuthor

    CLAIMED — lane openRepoTools-1, session df82f553-7803-49c4-8ddf-3f9acdcb8ee0@Eagle, 2026-09-16T01:06:23Z, for #62

    Logged in lanes/log/openRepoTools-1.md at 04a0ea36715d10c73c529985d1457cdc8de4ac53.

    The three reads (lane-collision-protocol Rule 1):

    1. existing `CLAIMED —` comments on opensoft/openRepoTools#62:
    6:CLAIMED — lane openRepoTools-3, session 4135b2c9-34a6-47e3-a156-5adebb632fae@Eagle, 2026-09-14T22:00:27Z, for opensoft/openRepoTools#62
    13:1. existing `CLAIMED —` comments on opensoft/openRepoTools#62:
    26:RELEASED — lane openRepoTools-3, session 4135b2c9-34a6-47e3-a156-5adebb632fae@Eagle, 2026-09-16T00:36:00Z, for opensoft/openRepoTools#62
    2. `gh pr list --repo opensoft/openRepoTools --state all --search "#62"`, kept where the row or its body names `#62`:
    44	`--install` stamps the documented mode on every artifact and refuses a target it cannot write in the planning phase, and `wip init` stages the template paths it wrote rather than `git add -A -- .`	fix/install-modes-and-wip-init-staging	MERGED
    3. `git ls-remote --heads [email protected]:opensoft/openRepoTools` branches naming `62` as a whole token:
       none
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    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