scaffold: bootstrap cold-tier codev/resources/ (arch.md, lessons-learned.md) on init/adopt/update#1046
Open
amrmelsayed wants to merge 28 commits into
Open
scaffold: bootstrap cold-tier codev/resources/ (arch.md, lessons-learned.md) on init/adopt/update#1046amrmelsayed wants to merge 28 commits into
amrmelsayed wants to merge 28 commits into
Conversation
amrmelsayed
added a commit
that referenced
this pull request
Jun 14, 2026
amrmelsayed
added a commit
that referenced
this pull request
Jun 14, 2026
…d) on init/adopt/update
…ad of inline constants
971215c to
170cd14
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PIR Review: Bootstrap cold-tier
codev/resources/files on init/adopt/updateFixes #1012
Summary
Fresh
codev initprojects had nocodev/resources/arch.mdorlessons-learned.md, so the first PIR/SPIR/ASPIR/MAINTAIN review phase failed when it read those files. Spec 987 had already wired up materialization of the hot-tier governance files (arch-critical.md,lessons-critical.md) but left the cold tier uncreated. This change addscopyColdTierDefaults, which materializesarch.mdandlessons-learned.mdfrom minimal skeleton placeholder starters (templates/{arch,lessons-learned}.starter.md) on init/adopt/update — mirroring the hot-tier pattern, skip-existing so curated copies are never overwritten, andupdatebackfills the cold files for projects created before this fix.Preview
Files Changed
codev-skeleton/templates/arch.starter.md(+9 / -0) — new minimal cold starter with an explicitSTARTER:replace-me markercodev-skeleton/templates/lessons-learned.starter.md(+9 / -0) — same, for lessonspackages/codev/src/lib/scaffold.ts(+56 / -0) —COLD_TIER_FILESmapping +copyColdTierDefaultspackages/codev/src/commands/init.ts(+9 / -0) — wire cold materialization beside hotpackages/codev/src/commands/adopt.ts(+8 / -0) — same (skip-existing)packages/codev/src/commands/update.ts(+13 / -0) — same, with dry-run +newFilesreporting (backfill for existing adopters)packages/codev/src/__tests__/cold-tier-materialization.test.ts(+129 / -0) — new test file (7 tests)packages/codev/src/__tests__/init.test.ts(+7 / -1) — positive assertions for all four resource filespackages/codev/src/__tests__/adopt.test.ts(+4 / -0) — assert cold files created on adoptcodev/resources/arch.md,codev/resources/lessons-learned.md— governance-doc updates (see below)Commits
f0e75182[PIR scaffold:codev initbootstraps emptycodev/resources/with arch.md + lessons-learned.md starters #1012] Bootstrap cold-tier resources (arch.md, lessons-learned.md) on init/adopt/update04e4deb1[PIR scaffold:codev initbootstraps emptycodev/resources/with arch.md + lessons-learned.md starters #1012] Tests: cold-tier materialization + init/adopt assertions2d133f13[PIR scaffold:codev initbootstraps emptycodev/resources/with arch.md + lessons-learned.md starters #1012] Source cold-tier content from skeleton *.starter.md instead of inline constants04478a98[PIR scaffold:codev initbootstraps emptycodev/resources/with arch.md + lessons-learned.md starters #1012] Tests: cold-tier copies from skeleton startersf5f4b118[PIR scaffold:codev initbootstraps emptycodev/resources/with arch.md + lessons-learned.md starters #1012] Mark cold-tier starters with explicit STARTER replace-me comment[PIR #1012] Thread:/Plan:housekeeping commits)Test Results
pnpm build: ✓ pass (build core first from worktree root —codev-coreisn't pre-built in a fresh worktree)pnpm test: ✓ pass — full suite 163 files / 3310 tests, 48 pre-existing skips; 7 new cold-tier testsinitinto a temp dir createscodev/resources/{arch,lessons-learned}.mdwith the placeholder +STARTER:marker;.starter.mdsource files do not leak into the project;updatebackfills missing cold files without clobbering a customized one;--dry-runwrites nothing.Architecture Updates
COLD (
codev/resources/arch.md) — updated. The "Governance Docs (Hot/Cold Tiers)" section previously stated only the hot files were materialized; extended it to record that the cold files are now bootstrapped bycopyColdTierDefaultsfrom*.starter.mdplaceholders (distinct from the rich manual-cpreference templates), both materializers skip-existing. No HOT (arch-critical.md) change: the existing hot fact about two-tier routing is unaffected — this adds materialization detail, which is reference-tier, not a capped always-on fact.Lessons Learned Updates
COLD (
codev/resources/lessons-learned.md) — added two entries under Documentation: (1) materialized starter files belong incodev-skeleton/templates/and are copied, never hardcoded as TS constants — add a dedicated*.starter.mdwhen the desired starter differs from an existing rich template; (2) a placeholder filled by the agent-driven review path needs an explicit "replace me" marker (mirroring the hot-tierSTARTER:convention), since the review prompts andupdate-arch-docsskill never mention the placeholder. No HOT (lessons-critical.md) change: these are scaffold-convention reference tips, not behavior-changing rules warranting a capped slot.Things to Look At During PR Review
COLD_TIER_FILESis a{ src, dest }mapping (arch.starter.md→arch.md), unlike the hot tier's same-name copy. This is deliberate: the plaintemplates/arch.mdis the rich reference template (with a "this file is not copied into projects" note) and must NOT be the copied starter, so the minimal starter lives in a separate*.starter.mdsource.copyHotTierDefaultsis untouched — the cold function is a sibling, so the load-bearing Spec 987 hot path carries zero risk from this change.updatebackfill: cold files are already inUSER_DATA_PATTERNS(templates.ts), so update's clean step never overwrote them; this change makes update create the missing ones (consistent with how 987 backfills the hot files).git diff <merge-base>...HEADshowed the governance edits are purely additive (no removals); the branch was simply behind main, and those entries were added to main after the branch point. Resolved by rebasing onto current main — the branch is now 0 commits behind,#859is present, and the net governance diff remains additive (arch.md +1 sentence, lessons-learned.md +2 entries).How to Test Locally
For reviewers pulling the branch:
pnpm build(from worktree root), thennode packages/codev/dist/cli.js init /tmp/p --yes→ inspect/tmp/p/codev/resources/(all four.mdpresent;arch.md/lessons-learned.mdcarry theSTARTER:marker; no.starter.mdfiles).codev updatebackfills both; a customizedarch.mdsurvives byte-identical.codev update --dry-runwrites nothing.