Skip to content

987 follow-up: codev adopt into a repo with no root docs skips the hot-tier managed block; refresh stale starter CLAUDE/AGENTS templates #1035

@waleedkadous

Description

@waleedkadous

Context

Follow-up from #987 / PR #1034 (symmetric hot/cold governance docs). Two minor install-path items deliberately left out of #1034's scope (the spec's managed-block criterion covers init + update, not adopt). Surfaced by the Codex integration CMAP; verified against the code by the architect.

1. codev adopt into a repo with NO root docs misses the interactive managed block

adopt.ts intentionally does not call syncHotContextBlock (it won't clobber a pre-existing CLAUDE.md/AGENTS.md — correct for the common case, where the conflict path spawns a merge instead). But when a repo adopts Codev with no existing root docs, copyRootFiles creates CLAUDE.md/AGENTS.md from the skeleton template and no hot-tier managed block is injected — the project gets porch-runtime injection + materialized hot files, but the interactive always-on block only appears after a manual codev update.

Fix: in the adopt path, inject the managed block only when adopt is creating the root docs (no pre-existing file), mirroring init. Leave the existing-docs path untouched (still merge, don't clobber). Add a test for "adopt into a repo with no CLAUDE.md/AGENTS.md → block present."

2. Stale generic starter templates

codev-skeleton/templates/CLAUDE.md and AGENTS.md (what copyRootFiles scaffolds from) predate the hot/cold model and don't mention it in their prose. The feature still lands (via syncHotContextBlock), so this is cosmetic — but the starter prose should describe the hot/cold model + managed-block convention so downstream root docs read coherently.

Not a blocker

The core feature ships correctly in #1034 (porch injection for all builders; full managed block on init and update, both tested). These are completeness polish for the adopt-into-bare-repo case + starter-doc prose.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/scaffoldArea: Install path — codev init/adopt/update/doctor, codev-skeleton, four-tier resolverbugSomething isn't working

    Type

    No type
    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