Skip to content

codev update: replace an unedited CLAUDE.md / AGENTS.md from an older release (shipped-template hash list, as skills have) #1985

Done

Description

@waleedkadous

Problem

After PR #1984 (issue #1982), codev update no longer calls an unedited CLAUDE.md / AGENTS.md a conflict when it matches the current template. One case is left, stated in that PR and pinned by a test there:

A root doc the adopter never edited, written by an older release whose template has since changed outside the managed block, is still reported as a conflict, with a .codev-new beside it. The root-doc template has changed many times, so an adopter upgrading across releases meets this on most updates, and has to merge a file they never touched.

Skills do not have this problem: SHIPPED_SKILL_HASHES (issue #1811) lists the hash of every shipped version of every skill, and codev update replaces a skill whose hash is listed, because the user never edited it.

Ask

Give the root docs the same treatment.

  1. A generated list of every shipped version of the root-doc templates (CLAUDE.md, AGENTS.md), built from git history as scripts/generate-shipped-skill-hashes.mts builds the skill list, in the same file or a sibling, regenerated by the same command, with the same staleness test that fails when a template changes and the list was not regenerated.
  2. Hash the normalised form, not the raw file. Use the normalisation PR Fix #1982: codev update no longer reports unedited CLAUDE.md / AGENTS.md as conflicts; dry run matches the real run #1984 introduced for matching (the managed block emptied, line endings normalised, the project name not counted), so that a doc written by any release, for any project name, with any hot-tier block content, hashes to its template's entry. State how the project name is neutralised for hashing (PR Fix #1982: codev update no longer reports unedited CLAUDE.md / AGENTS.md as conflicts; dry run matches the real run #1984 matches it as a wildcard, which a hash cannot do; decide and say how).
  3. Update behaviour. A root doc whose normalised hash is in the list, and is not the current template: replaced with the current template (project name substituted, managed block regenerated), reported as updated, no .codev-new. A doc whose hash is not in the list: a conflict as today, the adopter's content kept. A doc matching the current template: up to date, as PR Fix #1982: codev update no longer reports unedited CLAUDE.md / AGENTS.md as conflicts; dry run matches the real run #1984 made it.
  4. --dry-run agrees with the real run, as PR Fix #1982: codev update no longer reports unedited CLAUDE.md / AGENTS.md as conflicts; dry run matches the real run #1984 established.
  5. Do not widen the match. Anything not provably a shipped template is the adopter's content and is never overwritten. If history holds a template version that cannot be normalised (for example one from before the managed block existed), say which, and leave docs from it as conflicts.

Tests

  • For each of at least three historical template versions taken from git history: a project holding that version unedited is updated with zero conflicts and zero .codev-new; the same version with one line added outside the block is a conflict and keeps the line.
  • A different project name than the directory name, and CRLF line endings, still match.
  • The staleness test: changing a template without regenerating fails.
  • The test PR Fix #1982: codev update no longer reports unedited CLAUDE.md / AGENTS.md as conflicts; dry run matches the real run #1984 added to pin the known limit is changed to assert the new behaviour.

Verify

In a scratch directory outside any repository: codev init with an older released build (or a project seeded from an older template in git history), then codev update --dry-run and codev update --agent with the new build: no conflicts on the root docs, the docs equal the current template, no .codev-new.

Activity

  1. added
    area/scaffold
    on Nov 25, 2026
  2. added 4 commits that reference this issue on Nov 25, 2026
  3. added 2 commits that reference this issue on Nov 25, 2026
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

    area/scaffold

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions