Skip to content

(docs): doc-staleness edge cases — non-ancestor stamp, ambiguous SHA, subdirectory root #1399

Done

Description

@devsuitup

Follow-up to #1354 (PR #1398), from its cross-review. All MINOR.

  • scripts/doc-staleness.js: a verified SHA that is not an ancestor of HEAD (stamp written on a diverged branch) is counted with sha..HEAD and shows a plausible number. It should rank as unknown sha (git merge-base --is-ancestor).
  • An ambiguous 7-character abbreviation probably makes rev-parse --verify --quiet exit 128, not 1, which aborts the whole report instead of ranking one doc unknown sha. Not verified by experiment.
  • --repo-root pointing at a subdirectory: ls-files returns paths relative to it, so covers patterns mismatch. Resolve the top level first (git rev-parse --show-toplevel) or refuse.
  • Tests: :(literal) pathspecs are not pinned (no fixture doc covers a file with glob characters); non-ancestor stamp, rename and deleted covered file are untested.
  • .ai/contexts/fast-check.md: "Git failures exit nonzero" holds for failures inside collectStaleness only.

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