@@ -71,7 +71,12 @@ def __init__(self, project_root: str = "."):
7171 }
7272 }
7373
74- # Temporary/demo files that should be automatically deleted
74+ # Temporary/demo files that can optionally be deleted.
75+ #
76+ # Safety First:
77+ # - deletion is opt-in (see --cleanup-temp-files)
78+ # - scanning is limited to root + scripts (via `locations`) to avoid noisy matches
79+ # in docs/ and other directories
7580 self .cleanup_patterns = {
7681 "temporary_scripts" : {
7782 "pattern" : r"^(query_|show_|list_|simple_|build_|test_).*\.py$" ,
@@ -82,6 +87,7 @@ def __init__(self, project_root: str = "."):
8287 "empty_files" : {
8388 "pattern" : r".*\.py$" ,
8489 "size_threshold" : 50 , # bytes
90+ "locations" : ["." , "scripts/" ],
8591 "description" : "Empty or nearly empty Python files" ,
8692 "action" : "delete"
8793 },
@@ -111,11 +117,23 @@ def __init__(self, project_root: str = "."):
111117 "examples" : ["USER_STORY_CATALOG.md" , "SPRINT_SUMMARY.md" ]
112118 },
113119
120+ "agile_core_documents" : {
121+ # The agile core directory intentionally contains a mix of:
122+ # - CAPITAL_CASE.md (system-level specs)
123+ # - lowercase_case.md (operational rules/guides)
124+ # - lowercase-hyphens.md (guide-style docs)
125+ "pattern" : r"^(?:[A-Z][A-Z0-9_]*|[a-z][a-z0-9_]*|[a-z][a-z0-9\-]*)\.md$" ,
126+ "description" : "Agile core docs may be CAPITAL_CASE, lowercase_case, or lowercase-hyphens" ,
127+ "directories" : [
128+ "docs/agile/core/" ,
129+ ],
130+ "examples" : ["AGILE_COORDINATION_SYSTEM.md" , "definition_of_done.md" , "agile_workflow.md" ]
131+ },
132+
114133 "operational_documents" : {
115134 "pattern" : r"^[a-z][a-z0-9_]*\.md$" ,
116135 "description" : "lowercase_case.md for operational documents" ,
117136 "directories" : [
118- "docs/agile/core/" ,
119137 "docs/troubleshooting/" ,
120138 "docs/testing/" ,
121139 "docs/operating-modes/"
@@ -137,13 +155,20 @@ def __init__(self, project_root: str = "."):
137155 },
138156
139157 "unique_identifiers" : {
140- "pattern" : r"^[A-Z]{2,}-[A-Z0-9\-]+\.md$" ,
141- "description" : "CODE-PATTERN.md for unique identifiers" ,
158+ # These directories contain canonical user story IDs *and* occasional narrative docs.
159+ "pattern" : (
160+ r"^(?:"
161+ r"(?:US|EPIC|T)-[A-Z0-9]+(?:-[A-Z0-9]+)*(?:[-_][A-Za-z0-9][A-Za-z0-9_-]*)?"
162+ r"|[a-z][a-z0-9_]*"
163+ r"|[a-z][a-z0-9\-]*"
164+ r")\.md$"
165+ ),
166+ "description" : "User story docs are either ID-based (US-...) or lowercase docs" ,
142167 "directories" : [
143168 "docs/agile/sprints/*/user_stories/" ,
144169 "docs/agile/user_stories/"
145170 ],
146- "examples" : ["US-001.md" , "US-PE-01 .md" ]
171+ "examples" : ["US-001.md" , "US-035-VIBE_CODER_AGENT_BUILDER.md" , "story_monitoring_rule_optimization .md" ]
147172 }
148173 }
149174
@@ -642,7 +667,7 @@ def create_automation_config(self) -> Dict:
642667 "ci_integration" : {
643668 "pre_commit_hook" : True ,
644669 "github_actions" : True ,
645- "validation_command" : "python scripts/hilbert_consistency_validator.py" ,
670+ "validation_command" : "python scripts/hilbert_consistency_validator.py --scope docs/agile " ,
646671 "failure_threshold" : 95.0 # 95% consistency required
647672 },
648673
@@ -677,6 +702,11 @@ def main():
677702 default = None ,
678703 help = "Limit validation to these paths (files or directories)." ,
679704 )
705+ parser .add_argument (
706+ "--full-project" ,
707+ action = "store_true" ,
708+ help = "Validate the entire repository (may fail due to legacy files outside docs/agile)." ,
709+ )
680710 parser .add_argument (
681711 "--write-report" ,
682712 action = "store_true" ,
@@ -702,6 +732,11 @@ def main():
702732 print ("[INFO] Hilbert consistency validation" )
703733 print ("=" * 60 )
704734
735+ # Default scope: docs/agile (the actively-maintained system).
736+ # Full-repo validation is opt-in via --full-project.
737+ if not args .scope and not args .full_project :
738+ args .scope = ["docs/agile" ]
739+
705740 validator = HilbertConsistencyValidator ()
706741 validation_summary = validator .validate_project_consistency (
707742 cleanup_temp_files = args .cleanup_temp_files ,
0 commit comments