Skip to content

Read a cd After an Earlier Command for Rule 6 in the Write Guard #3351

Closed

Description

@ptr727

Context

Found by the local review of the backslash-newline narrowing (branch feature/guard-backslash-newline-quoting), confirmed with a classify probe on develop using constructed commands and offline seams, where a directory ending in primary reads as a primary checkout.

Gap

Requirement 6 reads a cd only where it leads the command. A cd after any earlier command is not read, so a mutating git command after it is judged against the session's own directory. Develop allows each of these:

  • git status && cd /example/primary && git reset --hard
  • true; cd /example/primary; git commit -m x
  • cd /example/primary on one line and git commit -m x on the next, after any first line

The leading form, cd /example/primary; git commit -m x, is denied. The README states the leading-cd scope, so this may be the precision-over-recall stance rather than an oversight. An agent prefixing a harmless status check is a realistic shape, though.

Possible Direction

Track the directory through every cd in the command's top-level sequence, as the push rule already does for a cd anywhere, and fail closed where a cd sits inside a branch the guard cannot follow.

Activity

  1. added
    bugSomething isn't working
    pre-existingReview finding classed pre-existing per local-strict-review Disposing of Findings
    scriptA defect in hub tooling
    on Oct 22, 2026
  2. ptr727 commented on Oct 23, 2026

    @ptr727
    OwnerAuthor

    Closed under the maintainer's decision (ptr727, 2026-10-23) on #3391: the backlog keeps real bugs with a stated failure, features the maintainer wants, and open decisions. A finding the review loop filed on code or text a change did not touch, a refactor or consolidation chore, a tracker, a wording item, or a guard shape no session has produced is closed rather than worked. Reopen with the input and the wrong result if this issue states one.

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

    bugSomething isn't workingpre-existingReview finding classed pre-existing per local-strict-review Disposing of FindingsscriptA defect in hub tooling

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions