feat: persist pragmata-owned train metadata#271
Conversation
lramir14
left a comment
There was a problem hiding this comment.
Thanks for the nice work. I am only flagging a potential issue with the integration between Pragmata and TLMTC. "atomic_write_json" requires its parent directory to already exist, and every other caller in the repo satisfies that itself via an explicit ensure_dirs() on a pragmata-owned path bundle. export_eval_train_meta is the exception — it writes into train_outputs/<run_id>/, a directory pragmata never creates itself; it only exists because tlmtc happens to create it as a side effect of training. Would it be worth adding a defensive path.parent.mkdir(parents=True, exist_ok=True) before the write, so pragmata satisfies its own utility's contract directly instead of relying on tlmtc's internal behavior?
936f0c5 to
09f6d04
Compare
Good point about making the |
Summary
Persists
pragmata-owned metadata for completed eval training runs.This is needed because
tlmtcowns the training artifacts but has no concept ofpragmataeval tasks. By writing a smallpragmata_train.meta.jsonsidecar with therun_id,task, and optionalannotation_export_id, later predict workflows can select the latest compatible model for a task and validate explicit run IDs against the requested task.Key changes
EvalTrainMetatosrc/pragmata/core/schemas/eval_output.py.resolve_eval_train_meta_pathtosrc/pragmata/core/paths/eval_paths.py.src/pragmata/core/eval/export.py.pragmata_train.meta.jsonafter successfulrun_tlmtc_train.train_evaluatorreturn value unchanged.tlmtctrain run artifacts undereval/train_outputs/<run_id>/.Tests