@@ -8,7 +8,7 @@ The `infrastructure/` directory contains **reusable, generic build and validatio
88
99### Subfolder Organization
1010
11- ```
11+ ``` text
1212infrastructure/<module>/
1313├── __init__.py # Public API exports
1414├── AGENTS.md # documentation
@@ -31,7 +31,7 @@ infrastructure/<module>/
3131
3232### Test Organization
3333
34- ```
34+ ``` text
3535tests/infra_tests/test_<module>/
3636├── __init__.py
3737├── conftest.py # Shared fixtures
@@ -53,29 +53,29 @@ tests/infra_tests/test_<module>/
5353
5454``` python
5555# Good: Import from infrastructure package
56- from infrastructure.literature import LiteratureSearch
56+ from infrastructure.reporting import generate_pipeline_report
5757from infrastructure.llm import LLMClient
5858from infrastructure.rendering import RenderManager
5959from infrastructure.reporting import generate_pipeline_report, get_error_aggregator
6060
6161# Bad: Relative imports outside package
62- from ..literature import LiteratureSearch # DON'T
62+ from ..reporting import generate_pipeline_report # DON'T
6363```
6464
6565### Exception Handling
6666
6767``` python
6868# Good: Use infrastructure exceptions
6969from infrastructure.core.exceptions import (
70- LiteratureSearchError ,
70+ ReportingError ,
7171 LLMConnectionError,
7272 RenderingError
7373)
7474
7575# Good: Raise with context
76- raise LiteratureSearchError (
77- " API request failed" ,
78- context = {" source " : " arxiv " , " query " : query }
76+ raise ReportingError (
77+ " Report generation failed" ,
78+ context = {" format " : " html " , " stage " : stage_name }
7979)
8080```
8181
@@ -93,12 +93,12 @@ logger.info(f"Processing {count} items")
9393
9494## Module-Specific Guidelines
9595
96- ### Literature Module
96+ ### Documentation Module
9797
98- - ** Multi-source ** : Support multiple academic databases
99- - ** Rate limiting ** : Respect API rate limits automatically
100- - ** Caching ** : Cache responses where possible
101- - ** Deduplication ** : Merge results from multiple sources
98+ - ** Standards enforcement ** : Validate AGENTS.md and README.md structure
99+ - ** Cross-referencing ** : Check internal link integrity
100+ - ** Template generation ** : Auto-generate documentation scaffolds
101+ - ** Coverage tracking ** : Monitor documentation completeness
102102
103103### LLM Module
104104
@@ -133,7 +133,7 @@ logger.info(f"Processing {count} items")
133133
134134### Environment Variables
135135
136- - Prefix with module name: ` LITERATURE_API_KEY `
136+ - Prefix with module name: ` REPORTING_OUTPUT_DIR `
137137- Document in module README.md
138138- Provide sensible defaults
139139
@@ -176,7 +176,7 @@ class ModuleConfig:
176176
177177``` python
178178# Good
179- raise LiteratureSearchError( " Query failed" )
179+ raise ReportingError( " Report generation failed" )
180180
181181# Bad
182182raise Exception (" Query failed" )
@@ -188,7 +188,7 @@ raise Exception("Query failed")
188188try :
189189 api_call()
190190except RequestException as e:
191- raise LiteratureSearchError( " API failed" ) from e
191+ raise ReportingError( " Report generation failed" ) from e
192192```
193193
194194## Documentation Requirements
@@ -244,8 +244,9 @@ Infrastructure modules are integrated into the build pipeline through:
2442445 . ** Validation** (` scripts/04_validate_output.py ` ) - Quality assurance
245245
246246** Pipeline Entry Points** : Two orchestrators available:
247+
247248- ` ./run.sh --pipeline ` : 10 stages (0-9) with optional LLM stages (stage 0 cleanup, stages 1-9 tracked)
248- - ` python3 scripts/run_all.py ` : 8-stage core pipeline (00-05 ) only
249+ - ` python3 scripts/run_all.py ` : 8-stage core pipeline (00-07 ) only
249250
250251Update these scripts to discover and use new infrastructure modules as needed.
251252
@@ -258,7 +259,7 @@ Before committing:
258259- [ ] AGENTS.md - [ ] README.md written
259260- [ ] Type hints on all public APIs
260261- [ ] Docstrings on all functions
261- - [ ] infrastructure/__ init __ .py updated
262+ - [ ] infrastructure/** init ** .py updated
262263- [ ] infrastructure/AGENTS.md updated
263264- [ ] No linter errors
264265- [ ] Wrapper script created (if needed)
@@ -285,7 +286,7 @@ Before committing:
285286
286287### Module Structure
287288
288- ```
289+ ``` text
289290infrastructure/example_module/
290291├── __init__.py # Public API exports
291292├── core.py # Core functionality
@@ -295,7 +296,7 @@ infrastructure/example_module/
295296└── README.md # Quick reference
296297```
297298
298- ### __ init __ .py Example
299+ ### ** init ** .py Example
299300
300301``` python
301302""" Example module - brief description.
@@ -465,20 +466,19 @@ Before merging a new infrastructure module:
465466- [ ] Configuration documented
466467- [ ] CLI interface working (if applicable)
467468- [ ] No imports from project-specific code
468- - [ ] infrastructure/__ init __ .py updated
469+ - [ ] infrastructure/** init ** .py updated
469470- [ ] infrastructure/AGENTS.md updated
470471- [ ] Tests pass locally
471472- [ ] No linter errors
472473
473474## References
474475
475476- [ Infrastructure AGENTS.md] ( ../infrastructure/AGENTS.md ) - Module organization
476- - [ Modules Guide] ( ../docs/modules/MODULES_GUIDE .md ) - guide to all advanced modules
477- - [ API Reference] ( ../docs/reference/API_REFERENCE .md ) - API documentation for all modules
478- - [ Two-Layer Architecture] ( ../docs/architecture/TWO_LAYER_ARCHITECTURE .md ) - Architecture explanation
477+ - [ Modules Guide] ( ../docs/modules/modules-guide .md ) - guide to all advanced modules
478+ - [ API Reference] ( ../docs/reference/api-reference .md ) - API documentation for all modules
479+ - [ Two-Layer Architecture] ( ../docs/architecture/two-layer-architecture .md ) - Architecture explanation
479480- [ Testing Guide] ( testing_standards.md ) - Testing infrastructure code
480481- [ Error Handling Guide] ( error_handling.md ) - Exception patterns
481482- [ Logging Guide] ( python_logging.md ) - Logging standards
482483- [ Documentation Guide] ( documentation_standards.md ) - Writing module docs
483484- [ Type Hints Guide] ( type_hints_standards.md ) - Type annotation patterns
484-
0 commit comments