T-022: Report v2 (MANIFEST.json + SCAN/INIT snapshots) with selective includes #126
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.
π― Overview
This PR implements T-022: Report v2 with comprehensive documentation capabilities, adding MANIFEST.json and selective includes for scan results and devcontainer previews.
β¨ Features
New Report Command
autorepro report- Generate comprehensive report bundles--include scan,init,plan,exec- Selective section inclusion--out -- Stdout preview with schema=v2 marker--exec- Include execution logs in bundle--format md|json- Plan content format selectionMANIFEST.json (Schema v2)
sectionsarray (only included sections)filesarray in stable orderSelective Sections
SCAN.jsonvia scan --json integrationINIT.preview.jsonwithout modifying repositoryrepro.mdorrepro.jsonbased on formatENV.txtwith environment informationrun.logandruns.jsonlwhen --exec is usedπ§ Implementation Details
CLI Integration
_setup_report_parser()with comprehensive argument parsing_dispatch_report_command()for command routingcreate_parser()and_dispatch_command()Report Module
cmd_report()main function with full validation_generate_scan_json()- Language detection results_generate_init_preview()- Devcontainer preview_generate_exec_logs()- Execution logs_generate_manifest_json()- MANIFEST.json generationBackward Compatibility
plan+env(plusexecwhen--execis used)π§ͺ Testing
Manual Test Case (from requirements)
```bash
TMP=$(mktemp -d) && cd "$TMP" && touch pyproject.toml
autorepro report --desc "pytest failing" --include scan,init --out r.zip
python -c "import zipfile, json; z = zipfile.ZipFile('r.zip'); ns = set(z.namelist()); assert 'MANIFEST.json' in ns; m = json.loads(z.read('MANIFEST.json')); assert m['schema_version'] == 2; assert 'SCAN.json' in m['files']; assert 'INIT.preview.json' in m['files']; print('OK_MANIFEST_V2')"
```
Result: β OK_MANIFEST_V2
Test Suite
π Usage Examples
Basic Report
```bash
autorepro report --desc "pytest failing"
Creates repro_bundle.zip with plan + env + MANIFEST.json
```
With Selective Includes
```bash
autorepro report --desc "build issues" --include scan,init --out issue.zip
Creates issue.zip with scan + init + MANIFEST.json
```
Stdout Preview
```bash
autorepro report --desc "test failures" --include scan,init,plan --out -
Outputs:
schema=v2
Report bundle contents:
MANIFEST.json
repro.md
SCAN.json
INIT.preview.json
```
With Execution
```bash
autorepro report --desc "CI tests" --exec --include plan,env,exec
Creates bundle with plan + env + exec logs + MANIFEST.json
```
π Files Changed
β Acceptance Criteria Met
π Related
Resolves #113
π Ready for Review
This implementation provides comprehensive report generation capabilities while maintaining full backward compatibility. The selective includes feature enables flexible documentation bundles for different use cases, from basic reproduction plans to comprehensive CI/issue tracking artifacts.