Repository navigation
v0.9.0 — Dataset decision layer & annotate mode
[0.9.0] — Dataset decision layer & annotate mode
ADR-011: calibra prune no longer only removes episodes. It can now emit a
per-episode decision layer — every episode gets a disposition
(KEEP / DROP / ANNOTATE / …) and a characterization (quality_risk,
coverage_value, anomaly_score, calibra_score, redundancy, …) — and
annotate mode writes that as a training-ready, model-agnostic sidecar so a
metadata-conditioned policy can use data that aggressive pruning would drop.
The existing calibra prune coreset workflow is unchanged. See
docs/adr/adr-011-dataset-decision-layer.md and docs/annotate.md; the
research gate (does the metadata actually improve training?) is
experiments/METADATA_CONDITIONING_BENCHMARK.md.
Added
- Dataset decision layer (ADR-011), schema groundwork.
CurationReportnow carries adispositionslist — oneEpisodeCharacterizationper episode holding its decision (newDispositionenum:KEEP/DROP/DOWNWEIGHT/ANNOTATE/REVIEW/RECOLLECT) plus the signals behind it (n_steps,quality_risk,coverage_value,anomaly_score,integrity_flags,reasons, …). The legacyretained_indices/dropped_indicesare unchanged and now derived fromdispositions(KEEP / DOWNWEIGHT / ANNOTATE → retained) when only one side is supplied, so existing callers keep working.EpisodeCurator.curate()populatesdispositions(threshold pass →KEEP, threshold failure →DROP). NewCurationReport.by_disposition()/disposition_counts(). calibra prune --annotate DIR— annotate mode (ADR-011): instead of only removing episodes, write a training-ready sidecar that keeps every episode with a decision and characterization attached.calibra_annotations.jsonlhas one row per episode —calibra_disposition(KEEP/DROP/ANNOTATE) pluscalibra_score,quality_risk,coverage_value,anomaly_score,redundancy,success,n_steps,integrity_flags,weight— alongsidecalibra_annotations.manifest.json(versioned schema + a field dictionary, so the sidecar is self-describing) and the rawcalibra_curation_report.json. Redundant episodes (ones vanilla pruning would drop) are markedANNOTATE: keep them if your trainer conditions on the metadata.--annotate-format {jsonl,parquet,both}(defaultjsonl) additionally writescalibra_annotations.parquet(columnar, explicit typed schema; needs pyarrow). The schema is model-agnostic; ACT / Diffusion / VLA conditioning recipes live indocs/annotate.md. New:calibra.schema.annotations(AnnotationManifest,EpisodeAnnotation),calibra.annotate.write_annotations().- Decision-layer characterization —
EpisodeCharacterization(onCurationReport.dispositions) now carriescalibra_score(100·(1 − quality_risk)),quality_risk,anomaly_score,coverage_value,redundancy(1 − coverage_value) andsuccess, not just the triggering threshold. New helperscalibra.assessment.episode_calibra_score()/episode_redundancy().calibra.pruning.pruning_result_to_curation_report(result, batch, *, report=None, redundant_disposition=DROP)maps a prune run to the decision-layer schema — pass theDiagnosticReportto fill the assessment axes, andDOWNWEIGHT/ANNOTATEto retain redundant episodes instead of dropping them — and is also reachable asPruningResult.to_curation_report(batch, ...), soCoresetSelectorandEpisodeCuratorexpose the sameCurationReportview.EpisodeCurator.curate()populates the same enriched characterization. calibra experiment record --from-metrics PATH— reads GPU-hours / wall-clock / eval success / loss / energy straight out of a finished run's metrics file (flat JSON, or a Weights & Biaseswandb-summary.jsonfrom an offline run) instead of retyping them. Point it at a file or a run directory. A built-in alias table matches common key names;--map FIELD=path.to.key(repeatable) handles anything unusual. An explicit flag always overrides the file.gpu_hoursis only taken when literally present — never derived from wall-clock — so a derived figure can't be mistaken for a measured one by the benchmark classifier. The provenance string is stored on the record asmetrics_source. New modulecalibra/metrics_ingest.py. No network access.calibra experiment record --from-review PATH— folds acalibra review --jsonfile's per-episode assessments into the record'smean_anomaly_score/mean_quality_risk/mean_coverage_value, capturing the dataset side and the training-outcome side of an experiment in one command. Rejects a partial review queue rather than logging a biased dataset-level mean.calibra experiment record --dry-run— parse--from-metrics/--from-reviewand print what would be recorded, writing nothing.calibra experiment record— metadata-conditioning benchmark fields. New--arm(label in the A/B/C/D/R/R+ matrix),--metadata-conditioning(was the policy conditioned on the annotate-mode sidecar?), and--actual-retention PCT(fraction of the original dataset actually trained on — diverges from--retention, the nominal prune target, for the KEEP∪ANNOTATE arm where rescued episodes raise effective retention).ExperimentRecordgainsarm,metadata_conditioning,actual_retention_pct; old rows default them.calibra experiment listshowsarm=… +metaand(actual N%). Supportsexperiments/METADATA_CONDITIONING_BENCHMARK.md.
Fixed
- Annotate mode verified against real data.
tests/test_annotate_integration.py(markedintegration) runscalibra prune --annotateend-to-end againstlerobot/pusht(206 episodes, v2 Parquet) and asserts sidecar/dataset episode alignment, disposition partitioning,DROProws carrying integrity flags, populated non-degenerate characterization columns,ANNOTATE < KEEPmean coverage (rescue semantics), JSONL == Parquet ==load()round-trip, and that the coreset output is unchanged by--annotate. anomaly_scoreno longer saturates at 1.0 for every episode on small datasets.calibra.assessment.compute_episode_assessmentstook the max percentile-rank extremity across all ~9 per-episode metrics; with few episodes relative to the metric count, nearly every episode is the batch min or max on some metric, so the score collapsed to ~1.0 for the whole batch (visible incalibra reviewand the annotate-mode sidecar). A metric now counts towardanomaly_scoreonly when the episode is BOTH in that metric's rank tail (p≤0.1 or p≥0.9) AND ≥2.5 robust-MAD deviations from the batch median — i.e. being last in a tight cluster is not an anomaly, being a genuine magnitude outlier is. On a 12-episode dataset with two jerk-spike episodes,anomaly_scoreis now1.0for exactly those two and0.0for the rest (was1.0for all twelve). The reason list is unchanged. The signal is still weak below ~100 episodes and is documented as such.