tracegrpo / docs /CODE_GUIDE.md
Dhruv1000's picture
Publish approved Phase 1: scientific README/figures, canonical audit paths and preserved historical navigation
2ab3846 verified
|
Raw History Blame Contribute Delete
2.85 kB
# Code and configuration guide
The namespace and research artifact paths are unchanged. This guide distinguishes the maintained implementation from historical experiment entry points. Commands in old scripts are provenance, not authorization to rerun the closed empirical program.
| Area | Implementation | Role |
|---|---|---|
| Data construction | `src/data/` | Paired corpus, chronological/random/repository splits, collection and contamination checks |
| Program analysis | `src/cpg/` | Statement mapping, graph caches, def-use trace ground truth |
| Output contract | `src/contracts/` | Ordered XML, typed parsed representation and frozen JSON Schema |
| Teacher / SFT | `src/sft/` | Metadata-informed teacher generation, gold/silver filters, balanced assembly and masked/weighted loss |
| Verifiable rewards | `src/rewards/` | R1–R5 components, eligibility, fail-closed semantics and counterfactual reward variants |
| RL | `src/rl/` | GRPO policy training, provenance, state restoration and tripwires |
| Evaluation | `src/eval/` | Metrics, paired confidence intervals, matched inference protocol and statistical tests |
| Baselines | `src/baselines/` | Classical and neural comparison implementations |
## Safe archival maintenance entry points
- [build_publication_assets.py](../scripts/build_publication_assets.py): figures from frozen aggregate JSON and TRAIN diagnostic logs only.
- [verify_phase1_layout.py](../scripts/verify_phase1_layout.py): active links, scientific asset hashes, imports, accepted audit deck and grade validation.
- [export_llm_judge_package.py](../scripts/export_llm_judge_package.py): canonical local package path is `audit/llm_judge/package`; external historical archive prefix stays compatible. It refuses to overwrite a populated package.
- [analyze_review34_llm_judge.py](../scripts/analyze_review34_llm_judge.py): grade validation precedes private joins. Joined answer-key data is local-only; do not run the full analysis to regenerate frozen results during maintenance.
- [restore_complete_hf_release.py](../scripts/restore_complete_hf_release.py): use recorded manifests and an empty restore destination.
## Config and test boundaries
`configs/sft/`, `configs/rl/` and `configs/review23/` preserve original experiments. Their existence does not reopen training. `configs/data/`, `configs/cpg/` and `configs/eval/` record data/grounding/evaluation contracts. [REPRODUCTION.md](REPRODUCTION.md) records pinned software and base-model revision.
Tests use synthetic fixtures where possible, including full-state optimizer/scheduler/RNG restoration and canonical judge-package consumers. The full suite remains the compatibility gate. A legacy blinding test refreshes one existing report's mtime while leaving its bytes unchanged; this side effect is explicitly checked in the cleanup integrity record.