. as $root | .construction.initial.preparations[0].generation.report.body_paths as $p | $p.search as $s | $s.attempts[0] as $first | $p.declared_contract_ranking as $rank | { generated_now: $root.generated_now, source_sha256: $root.construction.initial.original_source_sha256, first_mask: $first.choice_mask, first_output_passed: $first.training_cases_passed, first_output_total: $first.training_cases_total, first_conditions: ($first.condition_results | if type == "array" then {total:length, passed:([.[]|select(.passed == true)]|length)} else null end), first_complete: (if $first == null or $first.training_cases_total == null or ($first.condition_results|type) != "array" then null else ($first.training_cases_total > 0 and $first.training_cases_passed == $first.training_cases_total and ($first.condition_results|all(.passed == true))) end), candidate_attempts: ($s.attempts | if type == "array" then length else null end), selected_choices: $s.selection.choices, search_status: $s.status, selected_output_passed: $s.selected_training_passed, selected_output_total: $s.training_cases, selected_conditions: ($p.conditions | if . == null then null else {declared,passed,not_reached,status} end), completeness_percent: $p.finite_functional_completeness_percent, model_calls: $s.selection.local_model_predictions, model_variant: $s.selection.model_variant, model_identity: ($p.model_retention | if . == null then null else {loaded,model_schema,artifact_sha256,model_fingerprint,resident_tensor_bytes,setup_ms,feature_version} end), context_status: $p.model_context.status, decline_reason: $p.model_context.reason, ranking: (if $rank == null then null else {schema:$rank.schema, model_fingerprint:$rank.model_fingerprint, calls:$rank.local_model_predictions, predict_ns:$rank.predict_ns, choice_count:$rank.choice_count, choice_logits:$rank.choice_logits[:$rank.choice_count], source_feature_sha256:$rank.source_feature_sha256[:$rank.choice_count], case_sha256:$rank.finite_cases_sha256, condition_feature_sha256:$rank.condition_feature_sha256} end), generation_timing: $p.timing, runtime_stage: $root.evaluation.runtime.stage, runtime_passed: $root.evaluation.runtime.finite_passed, runtime_total: $root.evaluation.runtime.finite_total, input_separation: $root.evaluation.runtime.input_separation }