88
99import yaml
1010
11+ try :
12+ from cli .checks .generated_paths import is_generated
13+ except ImportError : # pragma: no cover - package-relative import path
14+ from binder .cli .checks .generated_paths import is_generated
15+
1116LIST_FIELDS = {
1217 "primary_concepts" ,
1318 "secondary_concepts" ,
@@ -134,7 +139,8 @@ def _validate_concept_map_file(
134139def check_concept_maps (contents_dir : Path , repo_root : Path ) -> List [ConceptMapIssue ]:
135140 """Validate all concept maps in contents_dir."""
136141 findings : List [ConceptMapIssue ] = []
137- qmd_files = sorted (contents_dir .glob ("**/*.qmd" ))
142+ # 2026-09-12: stale _build copies of chapters failed the push hook.
143+ qmd_files = sorted (p for p in contents_dir .glob ("**/*.qmd" ) if not is_generated (p , contents_dir ))
138144 qmd_frontmatter = {path : _frontmatter (path ) for path in qmd_files }
139145
140146 referenced_maps : dict [Path , Path ] = {}
@@ -154,7 +160,9 @@ def check_concept_maps(contents_dir: Path, repo_root: Path) -> List[ConceptMapIs
154160 findings .append (ConceptMapIssue ("error" , qmd_rel , f"frontmatter concepts file is not YAML: { concepts_ref } " ))
155161 referenced_maps [concept_path .resolve ()] = qmd_path
156162
157- for concept_path in sorted (contents_dir .glob ("**/*_concepts.y*ml" )):
163+ for concept_path in sorted (
164+ p for p in contents_dir .glob ("**/*_concepts.y*ml" ) if not is_generated (p , contents_dir )
165+ ):
158166 _validate_concept_map_file (concept_path , qmd_frontmatter , repo_root , findings )
159167 if concept_path .resolve () not in referenced_maps :
160168 concept_rel = str (concept_path .relative_to (repo_root )) if concept_path .is_relative_to (repo_root ) else str (concept_path )
0 commit comments