Skip to content

guardrails: stale-path-verify's deleted-path set misses four real git states #1454

Closed as duplicate

Description

@kyle-sexton

stale-path-verify (shipped in #1432) adjudicates a citation by matching it against the set of paths git log HEAD --no-renames --diff-filter=D --name-only reports. Four review-raised cases show that set, or the candidate extraction feeding it, is narrower than the real git states a repository can be in. Each is a silent false negative: the guard stays quiet on a citation that satisfies its own provenance contract.

They are grouped into one issue because they share a resolution gate, not because they share a mechanism.

The four

  1. Deleted paths containing whitespace. normalize_candidate rejects any token containing whitespace, so `docs/old guide.md` never reaches the provenance set. The whitespace rule exists because a code span often holds a whole command; the exact deletion-history lookup could distinguish a spaced path from a command span, but does not get the chance.

  2. Deleted directories. normalize_candidate explicitly admits a trailing-slash candidate (docs/old/), but git tracks files, so the history walk only ever contains docs/old/a.md. DELETED["docs/old/"] can never be set, which makes the trailing-slash branch inert by construction. Either derive deleted ancestor directories from the file entries, or stop admitting the candidate shape.

  3. Non-ASCII paths. With git's default core.quotePath, --name-only emits "docs/caf\303\251.md" rather than the literal UTF-8 name, so the associative-array key never matches a literal citation. -c core.quotePath=false, and preferably NUL-delimited output, is the machine-safe form — see https://git-scm.com/docs/git-config#Documentation/git-config.txt-corequotePath.

  4. Deletions introduced by merge commits. git log does not emit merge-commit diffs by default, so a path deleted while resolving a merge — present in both parents, absent in the result — never enters the set. --diff-merges is the documented option: https://git-scm.com/docs/git-log#Documentation/git-log.txt--m.

Why these are deferred rather than folded into #1432

#1432's entire justification is a measured envelope: 0.20% firing at 50% precision across the full tracked-markdown corpus, deliberately sized against the shipped sibling skill-reference-verify (0.51%/57%). All four fixes widen what the guard fires on. Landing any of them makes the number in that PR's body and in the 0.17.0 CHANGELOG entry stop describing the shipped guard.

Item 4 is the one to weigh first: --diff-merges can enlarge the deleted-path set substantially in a squash-and-merge repository, and this repository squash-merges. That is a candidate for a materially different firing rate, not a rounding change.

Acceptance

  • Each item fixed or explicitly declined with a recorded reason.
  • A re-measured firing rate and precision against the same full-corpus sweep, reported per item and in aggregate, compared against the 0.20%/50% baseline.
  • Behavioral test cases for each admitted case, in both the fires and stays-quiet directions.
  • If the aggregate lands outside the sibling guard's regime, a decision on whether the guard stays advisory-on by default.

Related

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

    needs-triage

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions