|
| 1 | +# AGENTS.md |
| 2 | + |
| 3 | +Scope: applies to this repository (`analysis_pipeline`) and all subdirectories. |
| 4 | + |
| 5 | +## Cross-Machine Workflow (Linux Source of Truth) |
| 6 | + |
| 7 | +If the Linux machine already ran classic + deep neural model training, treat Linux outputs as the source of truth. |
| 8 | + |
| 9 | +When switching to Windows for documentation work: |
| 10 | + |
| 11 | +- Do not rerun Stage 6 model training unless the user explicitly asks. |
| 12 | +- Copy result artifacts from Linux first. |
| 13 | +- Regenerate plots/reports from copied `ml_results*.json` files. |
| 14 | + |
| 15 | +This saves time and avoids unnecessary retraining. |
| 16 | + |
| 17 | +## Baseline/Deep Handoff Rule (Linux -> Windows) |
| 18 | + |
| 19 | +When asked to rebuild baseline confusion reports on Windows, do **not** assume `git pull` is enough. |
| 20 | + |
| 21 | +Reason: key ML/report artifacts are gitignored (large/reproducible), including: |
| 22 | + |
| 23 | +- `analysis_pipeline/reports/ml_results*.json` |
| 24 | +- `analysis_pipeline/reports/confusion_highlights*.json` |
| 25 | +- `analysis_pipeline/reports/confusion_pngs/` |
| 26 | +- `analysis_pipeline/features/` |
| 27 | + |
| 28 | +## Required Linux Artifacts (Minimum for Plot/Report Regeneration) |
| 29 | + |
| 30 | +Copy these from Linux into the same paths on Windows: |
| 31 | + |
| 32 | +- Classic baseline results: |
| 33 | + - `analysis_pipeline/reports/ml_results_baseline_all_bins_baseline.json` |
| 34 | + - `analysis_pipeline/reports/ml_results_baseline_omit_hardest_baseline.json` |
| 35 | + - `analysis_pipeline/reports/ml_results_baseline_low_high_omit_hardest_baseline.json` |
| 36 | + - `analysis_pipeline/reports/ml_results_baseline_grouped_4class_omit_hardest_baseline.json` |
| 37 | + - `analysis_pipeline/reports/ml_results_baseline_omit_easiest_baseline.json` |
| 38 | +- Advanced NN baseline results: |
| 39 | + - `analysis_pipeline/reports/ml_results_baseline_all_bins_baseline_advanced_nn.json` |
| 40 | + - `analysis_pipeline/reports/ml_results_baseline_omit_hardest_baseline_advanced_nn.json` |
| 41 | + - `analysis_pipeline/reports/ml_results_baseline_low_high_omit_hardest_baseline_advanced_nn.json` |
| 42 | + - `analysis_pipeline/reports/ml_results_baseline_grouped_4class_omit_hardest_baseline_advanced_nn.json` |
| 43 | + - `analysis_pipeline/reports/ml_results_baseline_omit_easiest_baseline_advanced_nn.json` |
| 44 | +- Baseline split manifest used by stage6 configs: |
| 45 | + - `analysis_pipeline/features/split_manifest_tutorial_baseline.json` |
| 46 | + |
| 47 | +If Stage 6 rerun is explicitly requested, copy full baseline feature artifacts from Linux as well, at minimum: |
| 48 | + |
| 49 | +- `analysis_pipeline/features/split_manifest_tutorial_baseline.json` |
| 50 | +- `analysis_pipeline/features/features_fused_tutorial_baseline.tsv` |
| 51 | + |
| 52 | +## Required Verification Before Rebuild |
| 53 | + |
| 54 | +Run: |
| 55 | + |
| 56 | +```powershell |
| 57 | +Get-ChildItem .\analysis_pipeline\reports\ml_results_baseline_*_baseline.json | Measure-Object |
| 58 | +Get-ChildItem .\analysis_pipeline\reports\ml_results_baseline_*_baseline_advanced_nn.json | Measure-Object |
| 59 | +``` |
| 60 | + |
| 61 | +Each should report `Count = 5`. |
| 62 | + |
| 63 | +If either count is below 5: |
| 64 | + |
| 65 | +- Stop. |
| 66 | +- Ask user to sync missing Linux artifacts. |
| 67 | +- Do not claim full baseline/deep coverage. |
| 68 | + |
| 69 | +## Rebuild Command (All Baseline + Advanced JSONs Present) |
| 70 | + |
| 71 | +```powershell |
| 72 | +Get-ChildItem .\analysis_pipeline\reports\ml_results_baseline*.json | ForEach-Object { |
| 73 | + $scenario = $_.BaseName -replace '^ml_results_', '' |
| 74 | + python .\analysis_pipeline\stage6_highlight_confusions.py ` |
| 75 | + --results-json $_.FullName ` |
| 76 | + --out-json ("analysis_pipeline/reports/confusion_highlights_{0}.json" -f $scenario) ` |
| 77 | + --out-md ("analysis_pipeline/reports/confusion_highlights_{0}.md" -f $scenario) ` |
| 78 | + --metric balanced_accuracy_mean ` |
| 79 | + --top-k-per-protocol 1 ` |
| 80 | + --include-all ` |
| 81 | + --out-png-dir analysis_pipeline/reports/confusion_pngs |
| 82 | +} |
| 83 | +``` |
| 84 | + |
| 85 | +Then regenerate documentation outputs (docx/md): |
| 86 | + |
| 87 | +```powershell |
| 88 | +python .\scripts\build_coherent_docx.py |
| 89 | +``` |
| 90 | + |
| 91 | +## Output Naming Convention |
| 92 | + |
| 93 | +Baseline confusion markdown names should follow: |
| 94 | + |
| 95 | +- Classic: `confusion_highlights_baseline_{scenario}_baseline.md` |
| 96 | +- Advanced NN: `confusion_highlights_baseline_{scenario}_baseline_advanced_nn.md` |
| 97 | + |
| 98 | +Where `{scenario}` is one of: |
| 99 | + |
| 100 | +- `all_bins` |
| 101 | +- `omit_hardest` |
| 102 | +- `low_high_omit_hardest` |
| 103 | +- `grouped_4class_omit_hardest` |
| 104 | +- `omit_easiest` |
0 commit comments