Make debug artifacts ATIF-compatible#380
Merged
Conversation
0b4d11b
into
mmprotest/add-full-transcript-and-atif-v1.7-artifacts
8 of 10 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Motivation
Description
_agent_metadata,_model_metadata,_api_compatibility, and_inference_provider, and usevillani_code.__version__for the agent version. (files changed:villani_code/debug_recorder.py,villani_code/atif_export.py,villani_code/trace_summary.py)model_metadatain the generic transcript artifact and addinference_provider+api_compatibilityinto the ATIFtrajectory.jsonagent extra fields while preserving existing schema fields. (files changed:villani_code/atif_export.py)trajectory.jsonis written for every run that starts successfully by writing a trajectory at run startup and again on model-request failure; this reuses existing debug artifact locations and filenames and does not add any benchmark-specific path or naming. (files changed:villani_code/state.py,villani_code/debug_recorder.py)agentandmodel_metadatainto summary aggregation by loadingsession_meta.jsonwhen building the run summary, without changing runner behavior. (files changed:villani_code/trace_summary.py)tests/test_regular_trace_artifacts.py,tests/test_debug_mode_and_recorder.py)Files changed:
villani_code/debug_recorder.py,villani_code/atif_export.py,villani_code/state.py,villani_code/trace_summary.py,tests/test_regular_trace_artifacts.py,tests/test_debug_mode_and_recorder.py.Testing
pytest tests/test_regular_trace_artifacts.py tests/test_debug_mode_and_recorder.pyand the suite passed (24 passed).pytest tests/test_regular_trace_artifacts.py::test_openai_compatible_metadata_uses_lmstudio_inference_provider tests/test_regular_trace_artifacts.py::test_regular_trajectory_exists_after_model_request_failure tests/test_regular_trace_artifacts.py::test_normal_debug_writes_generic_trajectory_only tests/test_debug_mode_and_recorder.py::test_debug_metadata_separates_api_compatibility_from_inference_providerand they passed.python -m compilealland checkedgit diff --check; both succeeded without warnings.Sample artifact snippets produced by the patch (examples):
session_meta.json/ run-start payload (generic run metadata):{
"agent": { "name": "villani-code", "version": "0.1.0rc1" },
"model_metadata": { "identifier": "local-model", "inference_provider": "lmstudio", "api_compatibility": "openai" }
}
ATIF
trajectory.jsonagent block (extra fields):{
"schema_version": "ATIF-v1.7",
"agent": {
"name": "villani-code",
"version": "0.1.0rc1",
"model_name": "local-model",
"extra": {
"provider": "openai",
"inference_provider": "lmstudio",
"api_compatibility": "openai",
"mode": "regular"
}
},
"extra": { "status": "completed", "termination_reason": "completed", "transcript_artifact": "transcript.full.json" }
}
Failed run (partial trajectory)
trajectory.jsonextra fields show failure:{
"schema_version": "ATIF-v1.7",
"extra": { "status": "failed", "termination_reason": "model_request_failed", "transcript_artifact": "transcript.full.json" },
"steps": [ { "source": "system", ... }, { "source": "user", ... } ]
}
Confirmations
Codex Task