Repository navigation
Description
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.
- A generated list of every shipped version of the root-doc templates (
CLAUDE.md,AGENTS.md), built from git history asscripts/generate-shipped-skill-hashes.mtsbuilds 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. - 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).
- 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. --dry-runagrees 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.- 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
[Air #1985] feat: replace an unedited CLAUDE.md / AGENTS.md from an o…
[Air #1985] fix: CMAP — drop unused history option; state the symlink…
[Air #1985] test: make the root-doc tests independent of line endings…
Merge pull request #1987 from cluesmith/builder/air-1985
[Bugfix #1990] Fix: write .codev-new in its root doc's line ending
[Bugfix #1990] Test: .codev-new takes its doc's line ending and is st…