Make template/ the source of truth for documented directory trees - #16
Merged
Conversation
The last item on the review's tail. Each archetype's directory tree was hand-maintained in two places — the archetype README and the published docs page — so both drifted independently of the template. The archetype READMEs were corrected in #11/#15, which left the docs pages as the only stale copy. They documented 78 files that no template generates: serve.py, predictor.py, preprocessing.py, schemas/, docker-compose.yml, benchmarks/, MODEL_CARD.md, three example notebooks, and so on. - Regenerated every docs/archetypes/*.md tree directly from the rendered template, so they now describe exactly what `whet init` produces. 78 -> 0 documented-but-absent files. - Normalized placeholder syntax across archetype READMEs. Three different spellings were in use: ${var} (correct), {{var}} (INERT — the engine never substitutes it, so cv-inference-service's README was actively misleading), and <var> (invented). All now use ${var}. Three guards so the trees cannot silently drift again: - test_readme_tree_matches_template - test_docs_page_tree_matches_template - test_readme_uses_real_placeholder_syntax Verified the tree guard bites by planting a ghost entry: it failed with "model-zoo README documents files its template does not ship: ['ghost_file.py']". 279 tests pass; ruff, format, mypy --strict, and mkdocs --strict clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
CI caught a real packaging bug that local runs could not see. The repo's root .gitignore has `data/`, which silently excluded template files living under a data/ path: archetypes/research-notebook/template/data/raw/.gitkeep archetypes/research-notebook/template/data/processed/.gitkeep archetypes/pytorch-training-project/template/configs/data/default.yaml They existed on disk, so every local test passed. They were never committed, so a clean checkout — CI, or any user cloning the repo — got templates missing those paths. `whet init research-notebook` produced a project without the data/raw and data/processed directories its README documents, and `whet init pytorch-training-project` shipped a Hydra config tree missing its entire `data` config group, which @hydra.main composes by name. The new tree-accuracy guards from this PR are what surfaced it: they compare documented paths against a freshly rendered template, so in CI the documented data/ entries had nothing to match. - Negate the ignore for archetypes/*/template/**/data/ so template scaffolding is committed while real datasets stay ignored. - Track the three affected files. 279 tests pass locally; the guards now have the same view in CI. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
The last item on the review's tail.
The problem
Each archetype's directory tree was hand-maintained in two places — the archetype README and the published docs page — so both drifted independently of the actual template.
#11 and #15 corrected the archetype READMEs, which left the docs pages as the only stale copy. They documented 78 files no template generates:
base.py,dataset.py,download.py,configs/, …)serve.py,predictor.py,preprocessing.py,schemas/,docker-compose.yml, …)MODEL_CARD.md,benchmarks/,model_configs.py, …)helpers.py,module.py,api/,guides/, …)datamodule.py,detector.py,metrics.py,coco.yaml, …)utils.py,plots.py, …)The fix
Regenerated every
docs/archetypes/*.mdtree directly from the rendered template, so each now describes exactly whatwhet initproduces. 78 → 0 documented-but-absent files.Also normalized placeholder syntax across the archetype READMEs. Three different spellings were in use:
${var}— correct, whatstring.Templatesubstitutes{{var}}— inert; the engine never substitutes it, socv-inference-service's README was actively misleading<var>— inventedAll now use
${var}.Guards
Three tests so the trees can't silently drift again:
test_readme_tree_matches_templatetest_docs_page_tree_matches_templatetest_readme_uses_real_placeholder_syntaxI verified the tree guard actually bites by planting a ghost entry — it failed with
model-zoo README documents files its template does not ship: ['ghost_file.py']— then restored the file.Verification
uv run pytest tests/→ 279 passed (3 new guards)mypy --strict/mkdocs build --strict→ clean🤖 Generated with Claude Code