Skip to content

wip init's owed-candidate index check compares blob content but never the staged mode #63

Closed

Description

@brettheap

wip init step 7's owed-candidate index check (PR #44 round 3) compares only the staged blob's CONTENT against the fetched template:

git -C "$checkout" cat-file -p ":$rel" 2>/dev/null | cmp -s -- "$dest" -

cat-file -p prints a blob's bytes, never its mode — so a template path a person staged with a DIFFERENT mode than the template's own (say git add --chmod=+x on a file whose content is otherwise byte-identical to handoffs/README.md) passes this check as "the index carries the template," and the run proceeds to git add -- "${written[@]}", which restages the WORKTREE file at whatever mode is currently on disk — silently replacing the person's staged mode with the template's own before the commit that follows.

What's open

Compare the index entry's mode as well as its blob before trusting it — git ls-files -s -- "$rel" reports the staged mode (the first field), which can be checked against the fetched template's own mode (a template file has no meaningful mode of its own beyond the ordinary 100644 every file in templates/workspace-root/ carries; a staged 100755 at that path is never this command's own leftover, since this command has never chmod'ed anything it wrote).

Filed rather than fixed in PR #44 round 3 per the durable word: round 3 already closed six real gaps in this exact branch with regression tests across several commits, and this is a further, narrower hardening layer — reported via a suppressed review comment (#44), not an inline thread, so there is no thread to resolve by number.

Related to #62 (same branch, a different gap — ancestor symlinks rather than index metadata).

Activity

  1. brettheap commented on Sep 14, 2026

    @brettheap
    ContributorAuthor

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

    Logged in lanes/log/openRepoTools-3.md at 5e446e4be03ee41478b4f8e082ac3a91d85499b2.

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

    1. existing `CLAIMED —` comments on opensoft/openRepoTools#63:
       none
    2. `gh pr list --repo opensoft/openRepoTools --state all --search "#63"`, kept where the row or its body names `#63`:
    24	Lane tooling moves home: filter-repo from brett-wip, openRepoTools wip init, --install installs the lane skill and hook (Amendment 9 act 3)	lanes/amendment-9-tooling-home	MERGED
    3. `git ls-remote --heads [email protected]:opensoft/openRepoTools` branches naming `63` 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:08Z, for #63

  3. brettheap commented on Sep 16, 2026

    @brettheap
    ContributorAuthor

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

    Logged in lanes/log/openRepoTools-1.md at 2ad2bf711861d56ab24ad5a855b707a5f62a3c50.

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

    1. existing `CLAIMED —` comments on opensoft/openRepoTools#63:
    6:CLAIMED — lane openRepoTools-3, session 4135b2c9-34a6-47e3-a156-5adebb632fae@Eagle, 2026-09-14T22:05:40Z, for opensoft/openRepoTools#63
    13:1. existing `CLAIMED —` comments on opensoft/openRepoTools#63:
    26:RELEASED — lane openRepoTools-3, session 4135b2c9-34a6-47e3-a156-5adebb632fae@Eagle, 2026-09-16T00:36:08Z, for opensoft/openRepoTools#63
    2. `gh pr list --repo opensoft/openRepoTools --state all --search "#63"`, kept where the row or its body names `#63`:
    24	Lane tooling moves home: filter-repo from brett-wip, openRepoTools wip init, --install installs the lane skill and hook (Amendment 9 act 3)	lanes/amendment-9-tooling-home	MERGED
    3. `git ls-remote --heads [email protected]:opensoft/openRepoTools` branches naming `63` 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