Skip to content

AGENTS.md migration gaps for repos bootstrapped before #297 #302

Description

@stackbilt-admin

Follow-up from #297 / PR #301, which changed bootstrap and adf init --emit-pointers to write uppercase AGENTS.md and removed lowercase agents.md from the generated pre-commit hook's VENDOR_FILES. That fix is correct for new repos but leaves three gaps for repos that already exist.

1. Repos tracking lowercase agents.md lose hook auto-tidy

The generated hook matches git diff --cached --name-only, which reports git's recorded path. After charter hook install --pre-commit is re-run, a tracked lowercase agents.md matches nothing in VENDOR_FILES and silently stops being auto-tidied on commit — on any filesystem, case-sensitive or not.

Mitigations that already exist: charter adf tidy and charter doctor run directly still handle both spellings (adf-tidy.ts keeps both deliberately). Generated hooks in existing checkouts don't change until reinstall, so this is latent rather than immediate.

Affected population is precisely the people who bootstrapped before the fix — i.e. the reporter of #297.

2. A hand-written uppercase AGENTS.md on Linux hits a dead end

bootstrap tells the user to run charter adf migrate first, but AGENTS.md is not in the AGENT_CONFIG_FILES scan lists (adf-migrate.ts:44, bootstrap.ts:960) — migrate never looks at that name. The instruction cannot succeed.

3. Adding AGENTS.md to those scan lists needs de-dup first

On a case-insensitive mount (macOS, WSL /mnt/c) agents.md and AGENTS.md are the same file, so naively adding the uppercase name double-processes it. This is not hypothetical: adf-tidy.ts:34-35 already walks the same file twice on such mounts today.

What a fix needs

  • A migration path for existing lowercase agents.md (case-safe two-step git mv, with handling for dirty index / untracked file / non-git directory — deliberately deferred from PR fix(bootstrap): emit AGENTS.md instead of lowercase agents.md #301 as a feature in its own right)
  • AGENTS.md added to the migrate scan lists, gated behind case-insensitivity de-dup
  • Ideally a doctor check that detects a tracked lowercase agents.md and tells the user what to run

Identified during constellation-loop review of PR #301.

Activity

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