agent-apprenticeship 0.1.6 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/agent-apprenticeship.js +85 -37
- package/package.json +1 -1
- package/pyproject.toml +1 -1
- package/src/agent_apprenticeship_trace/__init__.py +1 -1
- package/src/agent_apprenticeship_trace/actual_outputs_normalizer.py +104 -28
- package/src/agent_apprenticeship_trace/apprentice_adapters.py +3 -1
- package/src/agent_apprenticeship_trace/artifact_resolver.py +6 -0
- package/src/agent_apprenticeship_trace/bundle_exporter.py +132 -2
- package/src/agent_apprenticeship_trace/cli.py +1171 -262
- package/src/agent_apprenticeship_trace/codex_runner.py +89 -6
- package/src/agent_apprenticeship_trace/config.py +251 -32
- package/src/agent_apprenticeship_trace/ecosystem_r2.py +515 -0
- package/src/agent_apprenticeship_trace/env.py +5 -5
- package/src/agent_apprenticeship_trace/evaluator.py +127 -11
- package/src/agent_apprenticeship_trace/grader.py +12 -11
- package/src/agent_apprenticeship_trace/learning.py +270 -1
- package/src/agent_apprenticeship_trace/llm_output_normalizer.py +8 -7
- package/src/agent_apprenticeship_trace/loop.py +103 -4
- package/src/agent_apprenticeship_trace/loop_review.py +686 -0
- package/src/agent_apprenticeship_trace/mentor_checkpoints.py +49 -21
- package/src/agent_apprenticeship_trace/openai_structured.py +84 -14
- package/src/agent_apprenticeship_trace/package_exporter.py +1 -1
- package/src/agent_apprenticeship_trace/progress.py +2 -1
- package/src/agent_apprenticeship_trace/public_run.py +369 -57
- package/src/agent_apprenticeship_trace/public_sanitizer.py +37 -1
- package/src/agent_apprenticeship_trace/rubric_generation.py +11 -10
- package/src/agent_apprenticeship_trace/schemas.py +378 -3
- package/src/agent_apprenticeship_trace/task_intake.py +43 -9
- package/src/agent_apprenticeship_trace/tdo.py +2304 -0
- package/src/agent_apprenticeship_trace/trace_normalizer.py +351 -17
- package/src/agent_apprenticeship_trace/trace_prompt.py +38 -11
- package/src/agent_apprenticeship_trace/training_signals.py +1 -1
- package/src/agent_apprenticeship_trace/verifier.py +12 -6
|
@@ -19,6 +19,9 @@ PUBLIC_OMIT_KEYS={
|
|
|
19
19
|
'source_url_or_ref','source_kind','source_url','source_ref','source_basis','source_license',
|
|
20
20
|
'expected_pay','expected_apprentice_pay',
|
|
21
21
|
'evaluation_mode','data_sharing_level','sensitive_info_masking',
|
|
22
|
+
'raw_llm_output','raw_model_output',
|
|
23
|
+
'limitations','known_limitations','limitations_count','when_not_to_use',
|
|
24
|
+
'not_useful_for','non_use_cases','rubric_limitations',
|
|
22
25
|
}
|
|
23
26
|
_ABS_LOCAL_PATH_RE=re.compile(r"(/Users/[^\s\"\']+|/home/[^\s\"\']+|/private/[^\s\"\']+|/tmp/[^\s\"\']+|/var/folders/[^\s\"\']+)")
|
|
24
27
|
_USAGE_RE=re.compile(r"(you['’]?ve hit your usage limit|usage limit|rate limit|quota)", re.I)
|
|
@@ -38,6 +41,36 @@ PUBLIC_TEXT_REPLACEMENTS=[
|
|
|
38
41
|
("evaluation_mode", "mentor_mode"),
|
|
39
42
|
("worker_attempt", "apprentice_attempt"),
|
|
40
43
|
("worker_agent", "apprentice_agent"),
|
|
44
|
+
("Gatekeeping", "Review Routing"),
|
|
45
|
+
("gatekeeping", "review routing"),
|
|
46
|
+
("Worker " + "Agent", "Apprentice Agent"),
|
|
47
|
+
("worker " + "agent", "Apprentice Agent"),
|
|
48
|
+
("Deep" + "Seek", "model provider"),
|
|
49
|
+
("files_created_" + "list" + "ing_inconsistency", "files_created_index_inconsistency"),
|
|
50
|
+
("Cur" + "ated", "Selected"),
|
|
51
|
+
("cur" + "ated", "selected"),
|
|
52
|
+
("Contribution " + "Bundle", "Experience Compilation"),
|
|
53
|
+
("contribution " + "bundle", "Experience Compilation"),
|
|
54
|
+
("Export Full " + "Training Package", "Export Full Experience Compilation"),
|
|
55
|
+
("Training Data " + "Optimization", "Experience Compiler"),
|
|
56
|
+
("T" + "DO", "Experience Compiler"),
|
|
57
|
+
("Honest " + "limitations", "Generation notes"),
|
|
58
|
+
("honest " + "limitations", "generation notes"),
|
|
59
|
+
("Limitations", "Generation Notes"),
|
|
60
|
+
("limitations", "generation notes"),
|
|
61
|
+
("limitation", "generation note"),
|
|
62
|
+
("Applic" + "ability", "Best Use"),
|
|
63
|
+
("applic" + "ability", "fit"),
|
|
64
|
+
("Required " + "Conditions", "Required Inputs"),
|
|
65
|
+
("Evidence " + "Coverage", "Source Evidence"),
|
|
66
|
+
("Evidence " + "coverage", "Source evidence"),
|
|
67
|
+
("evidence " + "coverage", "source evidence"),
|
|
68
|
+
("Coverage " + "Notes", "Generation Notes"),
|
|
69
|
+
("Data Coverage " + "Notes", "Generation Notes"),
|
|
70
|
+
("Transfer " + "Boundaries", "Transfer Notes"),
|
|
71
|
+
("Missing Evidence " + "Notes", "Generation Notes"),
|
|
72
|
+
("Quality " + "Notes", "Quality Signals"),
|
|
73
|
+
("quality " + "notes", "quality signals"),
|
|
41
74
|
]
|
|
42
75
|
|
|
43
76
|
def sha256_text(text: str | None) -> str | None:
|
|
@@ -89,7 +122,10 @@ def _sanitize_obj(obj: Any, prompt_text: str | None=None) -> Any:
|
|
|
89
122
|
for k,v in obj.items():
|
|
90
123
|
if k in CONTROLLER_TELEMETRY_KEYS or k in PUBLIC_OMIT_KEYS or k.startswith('stop_on_'):
|
|
91
124
|
continue
|
|
92
|
-
|
|
125
|
+
safe_key=sanitize_public_text(str(k), prompt_text) or str(k)
|
|
126
|
+
if safe_key in PUBLIC_OMIT_KEYS or safe_key.startswith('stop_on_'):
|
|
127
|
+
continue
|
|
128
|
+
out[safe_key]=_sanitize_obj(v, prompt_text)
|
|
93
129
|
return out
|
|
94
130
|
|
|
95
131
|
def sanitize_public_obj(obj: dict[str, Any], prompt_text: str | None=None) -> dict[str, Any]:
|
|
@@ -3,7 +3,7 @@ import json
|
|
|
3
3
|
from pathlib import Path
|
|
4
4
|
from pydantic import BaseModel
|
|
5
5
|
from .schemas import TaskIntakeSpec, RubricItem, RubricSpec, RubricQualityReport
|
|
6
|
-
from .config import get_settings
|
|
6
|
+
from .config import apprentice_agent_display_name, get_settings
|
|
7
7
|
from .io import read_json
|
|
8
8
|
from .openai_structured import get_model_provider_status, run_structured_role
|
|
9
9
|
from .public_sanitizer import sanitize_public_obj, sha256_text
|
|
@@ -22,14 +22,15 @@ def _mentor_provider_id() -> str:
|
|
|
22
22
|
def deterministic_rubric(spec: TaskIntakeSpec) -> tuple[RubricSpec, RubricQualityReport]:
|
|
23
23
|
reqs = spec.output_requirements or ['final deliverable']
|
|
24
24
|
weight = 1.0/len(reqs)
|
|
25
|
-
items=[RubricItem(rubric_item_id=f'ri_{i+1}', criterion_name=r, criterion_description=f'Output satisfies {r}', weight=weight, score_min=0, score_max=1, pass_threshold=0.7, observable_evidence=[r], required_artifacts=[r], scoring_method='deterministic', worker_visible=True, verifier_only=False, hidden_reference_required=False, failure_modes=['missing','incorrect'], partial_credit_rules=['partial if substantially present'], edge_cases=[], anti_cheat_notes=[], metadata_json={}) for i,r in enumerate(reqs)]
|
|
26
|
-
rub=RubricSpec(rubric_id=f'rubric_{spec.task_id}', task_id=spec.task_id, task_family_id=None, rubric_version='v0.1', rubric_items=items, total_weight=1.0, pass_threshold=0.7, worker_visible_rubric_ref='rubric/worker_visible_rubric.md', verifier_private_rubric_ref='rubric/verifier_private_rubric.json', hidden_reference_policy='No hidden references for deterministic seed.', scoring_aggregation='weighted_sum', required_artifacts=reqs, disqualifying_errors=['secret leak'], partial_credit_allowed=True, grader_kind='deterministic', rubric_generation_source='deterministic_seed', rubric_generation_agent_provider=None, rubric_generation_agent_model=None, rubric_generation_confidence=0.4, metadata_json={'rubric_source':'deterministic_fallback','rubric_limitations':['LLM rubric generation unavailable'],'rubric_confidence':'low'})
|
|
27
|
-
qr=RubricQualityReport(rubric_id=rub.rubric_id, task_id=spec.task_id, criteria_count=len(items), total_weight=1.0, weights_sum_valid=True, has_observable_evidence=True, has_required_artifacts=True, has_partial_credit_rules=True, has_disqualifying_errors=True, has_hidden_reference_policy=True, has_worker_visible_view=True, has_verifier_private_view=True, ambiguous_criteria_count=0, unverifiable_criteria_count=0, rubric_quality_score=0.85, quality_flags=[], blockers=[], metadata_json={})
|
|
28
25
|
settings=get_settings()
|
|
26
|
+
apprentice_name = apprentice_agent_display_name(settings)
|
|
27
|
+
items=[RubricItem(rubric_item_id=f'ri_{i+1}', criterion_name=r, criterion_description=f'Output satisfies {r}', weight=weight, score_min=0, score_max=1, pass_threshold=0.7, observable_evidence=[r], required_artifacts=[r], scoring_method='hybrid', worker_visible=True, verifier_only=False, hidden_reference_required=False, failure_modes=['missing','incorrect'], partial_credit_rules=['partial if substantially present'], edge_cases=[], anti_cheat_notes=[], metadata_json={'draft_author':'apprentice_agent','trace_quality_checks':['artifact_refs point to produced files','actual_outputs.json summarizes deliverables'],'environment_response_checks':['trace includes observed environment responses for meaningful tool/file actions']}) for i,r in enumerate(reqs)]
|
|
28
|
+
rub=RubricSpec(rubric_id=f'rubric_{spec.task_id}', task_id=spec.task_id, task_family_id=None, rubric_version='v0.1', rubric_items=items, total_weight=1.0, pass_threshold=0.7, worker_visible_rubric_ref='rubric/worker_visible_rubric.md', verifier_private_rubric_ref='rubric/verifier_private_rubric.json', hidden_reference_policy='No hidden references for this Apprentice-generated draft.', scoring_aggregation='weighted_sum', required_artifacts=reqs, disqualifying_errors=['secret leak'], partial_credit_allowed=True, grader_kind='hybrid', rubric_generation_source='agent_assisted', rubric_generation_agent_provider=None, rubric_generation_agent_model=None, rubric_generation_confidence=0.55, metadata_json={'rubric_source':'apprentice_agent_draft','draft_author':'apprentice_agent','apprentice_agent_id':settings.worker_agent,'apprentice_agent_name':apprentice_name,'mentor_audited':False,'mentor_audit_source':None,'audit_status':'unaudited','rubric_limitations':['Mentor audit has not completed for this rubric draft.'],'rubric_confidence':'medium','verifier_checks':reqs,'artifact_checks':reqs,'trace_quality_checks':['one meaningful action per trace step','artifact_refs and deliverable_refs are package-relative','actual_outputs.json is present'],'environment_response_checks':['environment_response_pairs can be extracted from observed trace output/state_change'],'reward_modeling_notes':['Use mentor/verifier/grader evidence when available; structural checks alone are not semantic quality labels.'],'process_supervision_notes':['Use trace step outcomes and evaluator feedback as labels when available.'],'revision_preference_notes':['Prefer revised attempts only when mentor/verifier/grader evidence supports improvement.'],'economic_value_checks':['Use expected economic value fields from task intake as context, not as outcome proof.']})
|
|
29
|
+
qr=RubricQualityReport(rubric_id=rub.rubric_id, task_id=spec.task_id, criteria_count=len(items), total_weight=1.0, weights_sum_valid=True, has_observable_evidence=True, has_required_artifacts=True, has_partial_credit_rules=True, has_disqualifying_errors=True, has_hidden_reference_policy=True, has_worker_visible_view=True, has_verifier_private_view=True, ambiguous_criteria_count=0, unverifiable_criteria_count=0, rubric_quality_score=0.8, quality_flags=['mentor_audit_pending'], blockers=[], metadata_json={'draft_author':'apprentice_agent','mentor_audited':False})
|
|
29
30
|
if settings.rubric_mode in {'hybrid','llm_default'} and _mentor_provider_can_attempt() and settings.llm_rubric_generation_enabled:
|
|
30
31
|
provider=_mentor_provider_id()
|
|
31
|
-
rub.grader_kind='hybrid'; rub.rubric_generation_agent_provider=provider; rub.rubric_generation_agent_model=settings.model_provider_model or settings.openai_model; rub.metadata_json.update({'llm_rubric_generation_enabled': True, '
|
|
32
|
-
qr.quality_flags.append('
|
|
32
|
+
rub.grader_kind='hybrid'; rub.rubric_generation_agent_provider=provider; rub.rubric_generation_agent_model=settings.model_provider_model or settings.openai_model; rub.metadata_json.update({'llm_rubric_generation_enabled': True, 'mentor_audit_status': 'not_completed', 'provider': provider})
|
|
33
|
+
qr.quality_flags.append('mentor_audit_not_completed')
|
|
33
34
|
return rub, qr
|
|
34
35
|
|
|
35
36
|
def deterministic_rubric_quality_check(rubric: RubricSpec) -> RubricQualityReport:
|
|
@@ -40,7 +41,7 @@ def _rubric_prompt(spec: TaskIntakeSpec) -> str:
|
|
|
40
41
|
public_spec=sanitize_public_obj(spec.model_dump(mode='json'))
|
|
41
42
|
return """Return only valid JSON. Do not include markdown. Do not add extra top-level fields; place extras under metadata_json.extra_model_fields.
|
|
42
43
|
Required skeleton: {"rubric_spec":{"rubric_id":"rubric_<task_id>","task_id":"...","rubric_version":"0.1","rubric_items":[{"rubric_item_id":"ri_1","criterion_name":"...","criterion_description":"...","weight":1.0,"score_min":0,"score_max":1,"pass_threshold":0.7,"observable_evidence":[],"required_artifacts":[],"scoring_method":"llm_rubric_judge","worker_visible":true,"verifier_only":false,"hidden_reference_required":false,"failure_modes":[],"partial_credit_rules":[],"edge_cases":[],"anti_cheat_notes":[],"metadata_json":{}}],"total_weight":1.0,"pass_threshold":0.7,"worker_visible_rubric_ref":"rubric/worker_visible_rubric.md","verifier_private_rubric_ref":"rubric/verifier_private_rubric.json","hidden_reference_policy":"no_hidden_reference_available","scoring_aggregation":"weighted_sum","required_artifacts":[],"disqualifying_errors":[],"partial_credit_allowed":true,"grader_kind":"llm_rubric_judge","rubric_generation_source":"task_specific_agent_draft","metadata_json":{}},"rubric_quality_report":{"rubric_id":"...","task_id":"...","criteria_count":1,"total_weight":1.0,"weights_sum_valid":true,"has_observable_evidence":true,"has_required_artifacts":true,"has_partial_credit_rules":true,"has_disqualifying_errors":false,"has_hidden_reference_policy":true,"has_worker_visible_view":true,"has_verifier_private_view":true,"ambiguous_criteria_count":0,"unverifiable_criteria_count":0,"rubric_quality_score":0.75,"quality_flags":[],"blockers":[],"metadata_json":{}}}.
|
|
43
|
-
Create a task-specific rubric with weighted rubric_items that sum to 1.0. Include explicit required_artifacts, observable_evidence, success criteria, failure modes, grader/verifier/evaluator guidance in metadata
|
|
44
|
+
Audit and improve an Apprentice Agent-generated task rubric draft. Keep the Apprentice Agent as the draft author; your role is Mentor audit/improvement. Create a task-specific rubric with weighted rubric_items that sum to 1.0. Include explicit required_artifacts, observable_evidence, success criteria, failure modes, trace_quality_checks, environment_response_checks, reward_modeling_notes, process_supervision_notes, revision_preference_notes, economic_value_checks, and grader/verifier/evaluator guidance in metadata. Do not rely on Apprentice Agent self-evaluation as outcome evidence. Do not leak hidden/reference answers to Apprentice-visible fields. Do not include commerce metadata or off-brand selection language.
|
|
44
45
|
TaskIntakeSpec JSON:
|
|
45
46
|
""" + json.dumps(public_spec, sort_keys=True)
|
|
46
47
|
|
|
@@ -56,9 +57,9 @@ def generate_rubric(spec: TaskIntakeSpec, role_root: Path | None=None) -> tuple[
|
|
|
56
57
|
parsed=read_json(role_root/'rubric_agent/parsed_output.json')
|
|
57
58
|
rub=RubricSpec.model_validate(parsed['rubric_spec'])
|
|
58
59
|
qr=deterministic_rubric_quality_check(rub)
|
|
59
|
-
rub.grader_kind='hybrid'; rub.rubric_generation_agent_provider=rr.provider; rub.rubric_generation_agent_model=rr.model; rub.rubric_generation_confidence=rub.rubric_generation_confidence or 0.75
|
|
60
|
-
rub.metadata_json.update({'rubric_source':'
|
|
61
|
-
qr.metadata_json.update({'
|
|
60
|
+
rub.grader_kind='hybrid'; rub.rubric_generation_source='agent_assisted'; rub.rubric_generation_agent_provider=rr.provider; rub.rubric_generation_agent_model=rr.model; rub.rubric_generation_confidence=rub.rubric_generation_confidence or 0.75
|
|
61
|
+
rub.metadata_json.update({'rubric_source':'apprentice_agent_draft','draft_author':'apprentice_agent','mentor_audited':True,'mentor_audit_source':'mentor_model','audit_status':'mentor_audited','provider':rr.provider,'model':rr.model,'llm_prompt_ref_internal':str(role_root/'rubric_agent/prompt.md'),'llm_response_ref_internal':str(role_root/'rubric_agent/raw_output.txt'),'prompt_template_id':'rubric_generation_agent_v0','prompt_template_version':'0.1','prompt_hash':sha256_text(prompt),'public_response_summary':'Mentor Model audited and improved an Apprentice-generated rubric draft.'})
|
|
62
|
+
qr.metadata_json.update({'draft_author':'apprentice_agent','mentor_audited':True,'mentor_audit_source':'mentor_model','role_result_ref_internal':str(role_root/'rubric_agent/role_result.json')})
|
|
62
63
|
return rub, qr
|
|
63
64
|
if settings.rubric_mode == 'llm_required' or settings.llm_fail_closed:
|
|
64
65
|
raise RuntimeError(rr.error_message or 'Model rubric generation failed')
|
|
@@ -3,6 +3,64 @@ from typing import Literal, Any
|
|
|
3
3
|
from pydantic import BaseModel, ConfigDict, Field, model_validator
|
|
4
4
|
|
|
5
5
|
DictAny = dict[str, Any]
|
|
6
|
+
EnvironmentDomain = Literal[
|
|
7
|
+
"terminal",
|
|
8
|
+
"browser",
|
|
9
|
+
"computer_use",
|
|
10
|
+
"web",
|
|
11
|
+
"search",
|
|
12
|
+
"codebase",
|
|
13
|
+
"software",
|
|
14
|
+
"os",
|
|
15
|
+
"android",
|
|
16
|
+
"mcp",
|
|
17
|
+
"api",
|
|
18
|
+
"database",
|
|
19
|
+
"spreadsheet",
|
|
20
|
+
"file",
|
|
21
|
+
"multimodal",
|
|
22
|
+
"device",
|
|
23
|
+
"robotics",
|
|
24
|
+
"lab",
|
|
25
|
+
"industrial",
|
|
26
|
+
"physical",
|
|
27
|
+
"mixed",
|
|
28
|
+
"unknown",
|
|
29
|
+
]
|
|
30
|
+
InteractionSurface = Literal[
|
|
31
|
+
"api",
|
|
32
|
+
"mcp_tool",
|
|
33
|
+
"mcp_resource",
|
|
34
|
+
"mcp_prompt",
|
|
35
|
+
"browser",
|
|
36
|
+
"computer_use",
|
|
37
|
+
"cli",
|
|
38
|
+
"file",
|
|
39
|
+
"codebase",
|
|
40
|
+
"database",
|
|
41
|
+
"spreadsheet",
|
|
42
|
+
"search",
|
|
43
|
+
"cloud_console",
|
|
44
|
+
"saas_app",
|
|
45
|
+
"async_job",
|
|
46
|
+
"queue",
|
|
47
|
+
"webhook",
|
|
48
|
+
"scheduler",
|
|
49
|
+
"messaging",
|
|
50
|
+
"email",
|
|
51
|
+
"collaboration",
|
|
52
|
+
"document",
|
|
53
|
+
"pdf",
|
|
54
|
+
"table",
|
|
55
|
+
"multimodal",
|
|
56
|
+
"device",
|
|
57
|
+
"industrial",
|
|
58
|
+
"physical",
|
|
59
|
+
"mixed",
|
|
60
|
+
"other_tool",
|
|
61
|
+
"other_surface",
|
|
62
|
+
"unknown",
|
|
63
|
+
]
|
|
6
64
|
|
|
7
65
|
class StrictModel(BaseModel):
|
|
8
66
|
model_config = ConfigDict(extra="forbid")
|
|
@@ -30,6 +88,7 @@ class ActualOutputs(StrictModel):
|
|
|
30
88
|
status: Literal["success","partial","failed","timeout","error"]
|
|
31
89
|
output_summary: str
|
|
32
90
|
primary_output_ref: str | None = None
|
|
91
|
+
input_artifact_refs: list[str] = Field(default_factory=list)
|
|
33
92
|
deliverable_refs: list[str] = Field(default_factory=list)
|
|
34
93
|
final_message_ref: str | None = None
|
|
35
94
|
artifact_refs: list[str] = Field(default_factory=list)
|
|
@@ -50,6 +109,7 @@ class AgentTraceStep(StrictModel):
|
|
|
50
109
|
action: Literal["user_message","agent_step","output","error"]
|
|
51
110
|
operation: Literal["plan","analyze","search","read","write","edit","execute","verify","download","install","ask_user","answer","select","grade","evaluate","revise","other"] | None = None
|
|
52
111
|
tool: str | None = None
|
|
112
|
+
environment_domain: EnvironmentDomain | None = None
|
|
53
113
|
execution_mode: Literal["serial","parallel"] | None = None
|
|
54
114
|
parallel_group: str | None = None
|
|
55
115
|
observation: str | None = None
|
|
@@ -73,6 +133,252 @@ class AgentTraceStep(StrictModel):
|
|
|
73
133
|
ended_at: str | None = None
|
|
74
134
|
retry_of: int | None = None
|
|
75
135
|
artifact_refs: list[str] = Field(default_factory=list)
|
|
136
|
+
actor_kind: Literal["user","apprentice_agent","mentor_model","verifier","grader","evaluator","subagent","tool","system","expert","unknown"] | None = None
|
|
137
|
+
actor_role: str | None = None
|
|
138
|
+
agent_id: str | None = None
|
|
139
|
+
agent_name: str | None = None
|
|
140
|
+
subagent_id: str | None = None
|
|
141
|
+
subagent_name: str | None = None
|
|
142
|
+
subagent_role: str | None = None
|
|
143
|
+
parent_agent_id: str | None = None
|
|
144
|
+
delegation_id: str | None = None
|
|
145
|
+
delegation_source_step: int | None = None
|
|
146
|
+
handoff_reason: str | None = None
|
|
147
|
+
handoff_payload_ref: str | None = None
|
|
148
|
+
handoff_output_refs: list[str] = Field(default_factory=list)
|
|
149
|
+
subagent_output_refs: list[str] = Field(default_factory=list)
|
|
150
|
+
coordination_pattern: Literal["sequential","parallel","debate","planner_worker","reviewer_reviser","swarm","unknown"] | None = None
|
|
151
|
+
communication_channel: Literal["trace","file","message","tool_call","api","shared_workspace","unknown"] | None = None
|
|
152
|
+
depends_on_agent_outputs: list[str] = Field(default_factory=list)
|
|
153
|
+
modality: Literal["text","image","screenshot","audio","video","pdf","spreadsheet","table","diagram","mixed","unknown"] | None = None
|
|
154
|
+
modalities: list[str] = Field(default_factory=list)
|
|
155
|
+
media_type: str | None = None
|
|
156
|
+
mime_type: str | None = None
|
|
157
|
+
artifact_role: Literal["input","output","evidence","intermediate","preview","transcript","ocr","annotation","verification"] | None = None
|
|
158
|
+
artifact_hash: str | None = None
|
|
159
|
+
artifact_preview_ref: str | None = None
|
|
160
|
+
ocr_text_ref: str | None = None
|
|
161
|
+
transcript_ref: str | None = None
|
|
162
|
+
annotation_ref: str | None = None
|
|
163
|
+
bbox_refs: list[str] = Field(default_factory=list)
|
|
164
|
+
frame_refs: list[str] = Field(default_factory=list)
|
|
165
|
+
timecode_refs: list[str] = Field(default_factory=list)
|
|
166
|
+
table_refs: list[str] = Field(default_factory=list)
|
|
167
|
+
sheet_refs: list[str] = Field(default_factory=list)
|
|
168
|
+
derived_text_summary: str | None = None
|
|
169
|
+
interaction_surface: InteractionSurface | None = None
|
|
170
|
+
surface_type: str | None = None
|
|
171
|
+
connected_surfaces: list[str] = Field(default_factory=list)
|
|
172
|
+
resource_id: str | None = None
|
|
173
|
+
resource_type: str | None = None
|
|
174
|
+
object_id: str | None = None
|
|
175
|
+
object_type: str | None = None
|
|
176
|
+
request_id: str | None = None
|
|
177
|
+
operation_id: str | None = None
|
|
178
|
+
job_id: str | None = None
|
|
179
|
+
event_id: str | None = None
|
|
180
|
+
session_id: str | None = None
|
|
181
|
+
transaction_id: str | None = None
|
|
182
|
+
correlation_id: str | None = None
|
|
183
|
+
idempotency_key: str | None = None
|
|
184
|
+
status_before: str | None = None
|
|
185
|
+
status_after: str | None = None
|
|
186
|
+
state_before_ref: str | None = None
|
|
187
|
+
state_after_ref: str | None = None
|
|
188
|
+
raw_request_ref: str | None = None
|
|
189
|
+
raw_response_ref: str | None = None
|
|
190
|
+
error_code: str | None = None
|
|
191
|
+
evidence_refs: list[str] = Field(default_factory=list)
|
|
192
|
+
verification_refs: list[str] = Field(default_factory=list)
|
|
193
|
+
redaction_notes: list[str] = Field(default_factory=list)
|
|
194
|
+
api_provider: str | None = None
|
|
195
|
+
api_service: str | None = None
|
|
196
|
+
api_endpoint: str | None = None
|
|
197
|
+
api_method: str | None = None
|
|
198
|
+
api_version: str | None = None
|
|
199
|
+
http_status: int | None = None
|
|
200
|
+
request_payload_ref: str | None = None
|
|
201
|
+
response_payload_ref: str | None = None
|
|
202
|
+
request_schema_ref: str | None = None
|
|
203
|
+
response_schema_ref: str | None = None
|
|
204
|
+
auth_mode: str | None = None
|
|
205
|
+
rate_limit_state: str | None = None
|
|
206
|
+
pagination_state: str | None = None
|
|
207
|
+
retry_count: int | None = None
|
|
208
|
+
mcp_server: str | None = None
|
|
209
|
+
mcp_server_version: str | None = None
|
|
210
|
+
mcp_capability_type: Literal["tool","resource","prompt"] | None = None
|
|
211
|
+
mcp_tool_name: str | None = None
|
|
212
|
+
mcp_resource_uri: str | None = None
|
|
213
|
+
mcp_prompt_name: str | None = None
|
|
214
|
+
mcp_arguments_ref: str | None = None
|
|
215
|
+
mcp_result_ref: str | None = None
|
|
216
|
+
mcp_schema_ref: str | None = None
|
|
217
|
+
mcp_error_code: str | None = None
|
|
218
|
+
mcp_error_message: str | None = None
|
|
219
|
+
mcp_call_id: str | None = None
|
|
220
|
+
database_type: str | None = None
|
|
221
|
+
database_name: str | None = None
|
|
222
|
+
schema_name: str | None = None
|
|
223
|
+
table_name: str | None = None
|
|
224
|
+
query_type: str | None = None
|
|
225
|
+
query_ref: str | None = None
|
|
226
|
+
query_hash: str | None = None
|
|
227
|
+
row_count: int | None = None
|
|
228
|
+
affected_row_count: int | None = None
|
|
229
|
+
isolation_level: str | None = None
|
|
230
|
+
migration_id: str | None = None
|
|
231
|
+
explain_plan_ref: str | None = None
|
|
232
|
+
before_snapshot_ref: str | None = None
|
|
233
|
+
after_snapshot_ref: str | None = None
|
|
234
|
+
rollback_ref: str | None = None
|
|
235
|
+
db_error_code: str | None = None
|
|
236
|
+
db_error_message: str | None = None
|
|
237
|
+
workbook_ref: str | None = None
|
|
238
|
+
sheet_name: str | None = None
|
|
239
|
+
table_ref: str | None = None
|
|
240
|
+
cell_range: str | None = None
|
|
241
|
+
column_count: int | None = None
|
|
242
|
+
formula_refs: list[str] = Field(default_factory=list)
|
|
243
|
+
pivot_refs: list[str] = Field(default_factory=list)
|
|
244
|
+
chart_refs: list[str] = Field(default_factory=list)
|
|
245
|
+
data_validation_refs: list[str] = Field(default_factory=list)
|
|
246
|
+
before_table_ref: str | None = None
|
|
247
|
+
after_table_ref: str | None = None
|
|
248
|
+
diff_ref: str | None = None
|
|
249
|
+
calculation_mode: str | None = None
|
|
250
|
+
spreadsheet_error: str | None = None
|
|
251
|
+
command: str | None = None
|
|
252
|
+
command_ref: str | None = None
|
|
253
|
+
cwd_ref: str | None = None
|
|
254
|
+
exit_code: int | None = None
|
|
255
|
+
stdout_ref: str | None = None
|
|
256
|
+
stderr_ref: str | None = None
|
|
257
|
+
file_path: str | None = None
|
|
258
|
+
file_paths: list[str] = Field(default_factory=list)
|
|
259
|
+
file_operation: str | None = None
|
|
260
|
+
patch_ref: str | None = None
|
|
261
|
+
git_branch: str | None = None
|
|
262
|
+
git_commit_before: str | None = None
|
|
263
|
+
git_commit_after: str | None = None
|
|
264
|
+
test_command: str | None = None
|
|
265
|
+
test_result_ref: str | None = None
|
|
266
|
+
build_result_ref: str | None = None
|
|
267
|
+
lint_result_ref: str | None = None
|
|
268
|
+
dependency_changes_ref: str | None = None
|
|
269
|
+
process_id: str | None = None
|
|
270
|
+
timeout_seconds: int | None = None
|
|
271
|
+
search_provider: str | None = None
|
|
272
|
+
query: str | None = None
|
|
273
|
+
query_ref: str | None = None
|
|
274
|
+
search_scope: str | None = None
|
|
275
|
+
filters: DictAny | None = None
|
|
276
|
+
result_count: int | None = None
|
|
277
|
+
selected_result_refs: list[str] = Field(default_factory=list)
|
|
278
|
+
citation_refs: list[str] = Field(default_factory=list)
|
|
279
|
+
ranking_signal: str | None = None
|
|
280
|
+
search_time_range: str | None = None
|
|
281
|
+
search_error: str | None = None
|
|
282
|
+
ui_surface: Literal["browser","desktop_app","mobile_app","terminal","ide","cloud_console","file_manager","spreadsheet_app","unknown"] | None = None
|
|
283
|
+
app_name: str | None = None
|
|
284
|
+
app_version: str | None = None
|
|
285
|
+
os_name: str | None = None
|
|
286
|
+
device_type: str | None = None
|
|
287
|
+
window_title: str | None = None
|
|
288
|
+
page_title: str | None = None
|
|
289
|
+
url_or_resource_id: str | None = None
|
|
290
|
+
visible_state_ref: str | None = None
|
|
291
|
+
screenshot_ref: str | None = None
|
|
292
|
+
dom_snapshot_ref: str | None = None
|
|
293
|
+
accessibility_tree_ref: str | None = None
|
|
294
|
+
element_selector: str | None = None
|
|
295
|
+
coordinates: str | None = None
|
|
296
|
+
action_type: str | None = None
|
|
297
|
+
input_text: str | None = None
|
|
298
|
+
before_state_ref: str | None = None
|
|
299
|
+
after_state_ref: str | None = None
|
|
300
|
+
network_ref: str | None = None
|
|
301
|
+
api_call_ref: str | None = None
|
|
302
|
+
software_state_ref: str | None = None
|
|
303
|
+
service_name: str | None = None
|
|
304
|
+
workspace_id: str | None = None
|
|
305
|
+
project_id: str | None = None
|
|
306
|
+
tenant_id: str | None = None
|
|
307
|
+
record_id: str | None = None
|
|
308
|
+
ticket_id: str | None = None
|
|
309
|
+
object_state_before_ref: str | None = None
|
|
310
|
+
object_state_after_ref: str | None = None
|
|
311
|
+
permission_context: str | None = None
|
|
312
|
+
region: str | None = None
|
|
313
|
+
environment_name: str | None = None
|
|
314
|
+
deployment_id: str | None = None
|
|
315
|
+
audit_log_ref: str | None = None
|
|
316
|
+
change_request_ref: str | None = None
|
|
317
|
+
queue_name: str | None = None
|
|
318
|
+
message_id: str | None = None
|
|
319
|
+
webhook_id: str | None = None
|
|
320
|
+
callback_url_ref: str | None = None
|
|
321
|
+
schedule_id: str | None = None
|
|
322
|
+
trigger_type: str | None = None
|
|
323
|
+
enqueue_time: str | None = None
|
|
324
|
+
start_time: str | None = None
|
|
325
|
+
completion_time: str | None = None
|
|
326
|
+
delivery_status: str | None = None
|
|
327
|
+
polling_status: str | None = None
|
|
328
|
+
callback_status: str | None = None
|
|
329
|
+
job_status_before: str | None = None
|
|
330
|
+
job_status_after: str | None = None
|
|
331
|
+
async_result_ref: str | None = None
|
|
332
|
+
dead_letter_ref: str | None = None
|
|
333
|
+
platform_name: str | None = None
|
|
334
|
+
channel_id: str | None = None
|
|
335
|
+
thread_id: str | None = None
|
|
336
|
+
sender_role: str | None = None
|
|
337
|
+
recipient_role: str | None = None
|
|
338
|
+
message_type: str | None = None
|
|
339
|
+
message_ref: str | None = None
|
|
340
|
+
attachment_refs: list[str] = Field(default_factory=list)
|
|
341
|
+
decision_refs: list[str] = Field(default_factory=list)
|
|
342
|
+
approval_state: str | None = None
|
|
343
|
+
followup_required: bool | None = None
|
|
344
|
+
document_ref: str | None = None
|
|
345
|
+
document_type: str | None = None
|
|
346
|
+
page_refs: list[str] = Field(default_factory=list)
|
|
347
|
+
section_refs: list[str] = Field(default_factory=list)
|
|
348
|
+
text_extract_ref: str | None = None
|
|
349
|
+
table_extract_refs: list[str] = Field(default_factory=list)
|
|
350
|
+
figure_refs: list[str] = Field(default_factory=list)
|
|
351
|
+
annotation_refs: list[str] = Field(default_factory=list)
|
|
352
|
+
summary_ref: str | None = None
|
|
353
|
+
document_diff_ref: str | None = None
|
|
354
|
+
physical_environment_type: str | None = None
|
|
355
|
+
device_id: str | None = None
|
|
356
|
+
device_model: str | None = None
|
|
357
|
+
sensor_readings_ref: str | None = None
|
|
358
|
+
actuator_command: str | None = None
|
|
359
|
+
control_mode: str | None = None
|
|
360
|
+
physical_state_before_ref: str | None = None
|
|
361
|
+
physical_state_after_ref: str | None = None
|
|
362
|
+
telemetry_ref: str | None = None
|
|
363
|
+
calibration_ref: str | None = None
|
|
364
|
+
safety_state: Literal["normal","warning","fault","emergency_stop","unknown"] | None = None
|
|
365
|
+
safety_limit_refs: list[str] = Field(default_factory=list)
|
|
366
|
+
operator_override: bool | None = None
|
|
367
|
+
human_supervisor_present: bool | None = None
|
|
368
|
+
simulation_or_real_world: Literal["simulation","real_world","hybrid","unknown"] | None = None
|
|
369
|
+
latency_ms: float | None = None
|
|
370
|
+
tolerance: str | None = None
|
|
371
|
+
rollback_action: str | None = None
|
|
372
|
+
emergency_stop: bool | None = None
|
|
373
|
+
compliance_refs: list[str] = Field(default_factory=list)
|
|
374
|
+
cross_system_dependencies: list[str] = Field(default_factory=list)
|
|
375
|
+
handoff_refs: list[str] = Field(default_factory=list)
|
|
376
|
+
state_sync_refs: list[str] = Field(default_factory=list)
|
|
377
|
+
consistency_checks: list[str] = Field(default_factory=list)
|
|
378
|
+
system_of_record: str | None = None
|
|
379
|
+
surface_capture_status: Literal["complete","partial","unavailable","not_applicable"] | None = None
|
|
380
|
+
surface_capture_notes: str | None = None
|
|
381
|
+
missing_surface_fields: list[str] = Field(default_factory=list)
|
|
76
382
|
metadata_json: DictAny = Field(default_factory=dict)
|
|
77
383
|
|
|
78
384
|
@model_validator(mode="after")
|
|
@@ -91,6 +397,9 @@ class AgentTrace(StrictModel):
|
|
|
91
397
|
schema_version: str = "aa-trace-v0.1"
|
|
92
398
|
trace_id: str
|
|
93
399
|
collection_id: str | None = None
|
|
400
|
+
run_id: str | None = None
|
|
401
|
+
package_id: str | None = None
|
|
402
|
+
bundle_id: str | None = None
|
|
94
403
|
prior_trace_id: str | None = None
|
|
95
404
|
trace_mode: Literal["live","retraced","hybrid"]
|
|
96
405
|
task: str
|
|
@@ -107,6 +416,13 @@ class AgentTrace(StrictModel):
|
|
|
107
416
|
skills: list[str] | None = None
|
|
108
417
|
memory: str | None = None
|
|
109
418
|
agent_config: DictAny | None = None
|
|
419
|
+
environment_domain: EnvironmentDomain | None = None
|
|
420
|
+
actual_outputs_ref: str | None = None
|
|
421
|
+
input_artifact_refs: list[str] = Field(default_factory=list)
|
|
422
|
+
artifact_refs: list[str] = Field(default_factory=list)
|
|
423
|
+
deliverable_refs: list[str] = Field(default_factory=list)
|
|
424
|
+
output_summary: str | None = None
|
|
425
|
+
final_output_summary: str | None = None
|
|
110
426
|
learning: str | None = None
|
|
111
427
|
termination_reason: Literal["task_complete","verifier_passed","verifier_failed","max_iterations_reached","agent_blocked","timeout","error_unrecoverable","partial_then_stopped","provider_usage_limit","other"]
|
|
112
428
|
steps: list[AgentTraceStep]
|
|
@@ -227,7 +543,7 @@ class TaskIntakeQualityReport(StrictModel):
|
|
|
227
543
|
class RubricItem(StrictModel):
|
|
228
544
|
rubric_item_id: str; criterion_name: str; criterion_description: str; weight: float; score_min: float; score_max: float; pass_threshold: float
|
|
229
545
|
observable_evidence: list[str]; required_artifacts: list[str]
|
|
230
|
-
scoring_method: Literal["llm_rubric_judge","deterministic","schema_match","regex","unit_test","hybrid","human_future"]
|
|
546
|
+
scoring_method: Literal["llm_rubric_judge","deterministic","schema_match","regex","unit_test","hybrid","human_future","structural_guardrail"]
|
|
231
547
|
worker_visible: bool; verifier_only: bool; hidden_reference_required: bool
|
|
232
548
|
failure_modes: list[str] = Field(default_factory=list); partial_credit_rules: list[str] = Field(default_factory=list); edge_cases: list[str] = Field(default_factory=list); anti_cheat_notes: list[str] = Field(default_factory=list); metadata_json: DictAny = Field(default_factory=dict)
|
|
233
549
|
|
|
@@ -236,7 +552,7 @@ class RubricSpec(StrictModel):
|
|
|
236
552
|
worker_visible_rubric_ref: str; verifier_private_rubric_ref: str; hidden_reference_policy: str
|
|
237
553
|
scoring_aggregation: Literal["weighted_sum","sum","all_required","custom"]
|
|
238
554
|
required_artifacts: list[str]; disqualifying_errors: list[str] = Field(default_factory=list); partial_credit_allowed: bool
|
|
239
|
-
grader_kind: Literal["llm_rubric_judge","deterministic","hybrid","human_future"]
|
|
555
|
+
grader_kind: Literal["llm_rubric_judge","deterministic","hybrid","human_future","structural_guardrail","unavailable"]
|
|
240
556
|
rubric_generation_source: Literal["agent_assisted","family_template","task_specific_agent_draft","expert_override","deterministic_seed"]
|
|
241
557
|
rubric_generation_agent_provider: str | None = None; rubric_generation_agent_model: str | None = None; rubric_generation_confidence: float | None = None; metadata_json: DictAny = Field(default_factory=dict)
|
|
242
558
|
@model_validator(mode="after")
|
|
@@ -252,7 +568,7 @@ class RubricQualityReport(StrictModel):
|
|
|
252
568
|
class RubricItemScore(StrictModel):
|
|
253
569
|
rubric_item_id: str; criterion_name: str; score: float; max_score: float; passed: bool; evidence_refs: list[str] = Field(default_factory=list); failure_mode: str | None = None; notes: str | None = None; confidence: float | None = None; artifact_presence_ok: bool | None = None; semantic_correctness_score: float | None = None; reasoning_summary: str | None = None; improvement_suggestion: str | None = None
|
|
254
570
|
class GraderResult(StrictModel):
|
|
255
|
-
grader_result_id: str; task_id: str; attempt_id: str; attempt_kind: str; rubric_id: str; grader_kind: Literal["llm_rubric_judge","llm","model","deterministic","hybrid","human_future"]; score_source: Literal["llm","llm_semantic","model_judged","deterministic","deterministic_artifact_contract","deterministic_fallback","hybrid","human_future"]; score: float; max_score: float; passed: bool; rubric_item_scores: list[RubricItemScore]; failed_criteria: list[str]; passed_criteria: list[str]; evidence_refs: list[str]; confidence: float; reasoning_summary: str | None = None; limitations: list[str] = Field(default_factory=list); hidden_reference_used: bool; hidden_reference_leaked: bool; artifact_contract_score: float | None = None; semantic_score: float | None = None; model_score: float | None = None; legacy_semantic_score: float | None = None; legacy_score_source: str | None = None; final_score: float | None = None; model: str | None = None; provider: str | None = None; deterministic_precheck_ref: str | None = None; llm_prompt_ref_internal: str | None = None; llm_response_ref_internal: str | None = None; public_prompt_hash: str | None = None; public_response_summary: str | None = None; score_reliability: Literal["verified","unverified","needs_review","failed_verification"] | None = None; verifier_status: str | None = None; verifier_confidence: float | None = None; verifier_issue_count: int | None = None; verifier_issues_summary: str | None = None; metadata_json: DictAny = Field(default_factory=dict)
|
|
571
|
+
grader_result_id: str; task_id: str; attempt_id: str; attempt_kind: str; rubric_id: str; grader_kind: Literal["llm_rubric_judge","llm","model","deterministic","hybrid","human_future","structural_guardrail","unavailable"]; score_source: Literal["llm","llm_semantic","model_judged","deterministic","deterministic_artifact_contract","deterministic_fallback","hybrid","human_future","structural_guardrail","unavailable"]; score: float; max_score: float; passed: bool; rubric_item_scores: list[RubricItemScore]; failed_criteria: list[str]; passed_criteria: list[str]; evidence_refs: list[str]; confidence: float; reasoning_summary: str | None = None; limitations: list[str] = Field(default_factory=list); hidden_reference_used: bool; hidden_reference_leaked: bool; artifact_contract_score: float | None = None; semantic_score: float | None = None; model_score: float | None = None; legacy_semantic_score: float | None = None; legacy_score_source: str | None = None; final_score: float | None = None; model: str | None = None; provider: str | None = None; deterministic_precheck_ref: str | None = None; llm_prompt_ref_internal: str | None = None; llm_response_ref_internal: str | None = None; public_prompt_hash: str | None = None; public_response_summary: str | None = None; score_reliability: Literal["verified","unverified","needs_review","failed_verification"] | None = None; verifier_status: str | None = None; verifier_confidence: float | None = None; verifier_issue_count: int | None = None; verifier_issues_summary: str | None = None; metadata_json: DictAny = Field(default_factory=dict)
|
|
256
572
|
class VerifierResult(StrictModel):
|
|
257
573
|
verifier_result_id: str; task_id: str; attempt_id: str; attempt_kind: str; grader_result_id: str | None = None; verification_status: Literal["verified","partially_verified","failed","not_run"]; artifact_contract_ok: bool; evidence_grounding_ok: bool; score_consistency_ok: bool; hidden_reference_leaked: bool; issues: list[str] = Field(default_factory=list); confidence: float; verifier_notes: str | None = None; semantic_evidence_grounding_ok: bool | None = None; unsupported_claims: list[str] = Field(default_factory=list); leakage_check_ok: bool | None = None; model: str | None = None; provider: str | None = None; metadata_json: DictAny = Field(default_factory=dict)
|
|
258
574
|
class EvaluatorFeedback(StrictModel):
|
|
@@ -271,3 +587,62 @@ class RewardModelingExample(StrictModel):
|
|
|
271
587
|
example_id: str; task_id: str; attempt_id: str; rubric_ref: str; output_refs: list[str]; attempt_summary: str; rubric_item_scores: list[RubricItemScore]; final_score: float; passed: bool; failure_modes: list[str]; grader_notes: str | None = None; evidence_refs: list[str]; score_source: str; grader_kind: str; confidence: float; score_reliability: str | None = None; verifier_status: str | None = None; verifier_confidence: float | None = None; verifier_issue_count: int | None = None; verifier_issues_summary: str | None = None; metadata_json: DictAny=Field(default_factory=dict)
|
|
272
588
|
class RevisionPreferencePair(StrictModel):
|
|
273
589
|
pair_id: str; task_id: str; rubric_ref: str; baseline_attempt_ref: str; revised_attempt_ref: str; chosen_attempt_id: str; rejected_attempt_id: str; baseline_score: float; revised_score: float; score_delta: float; criteria_improved: list[str]; criteria_regressed: list[str]; preference_reason: str; score_source: str; grader_kind: str; confidence: float; metadata_json: DictAny=Field(default_factory=dict)
|
|
590
|
+
|
|
591
|
+
class TDOJudgeResult(StrictModel):
|
|
592
|
+
tdo_round: int
|
|
593
|
+
tdo_judge_source: Literal["mentor_model", "apprentice_self_judge"]
|
|
594
|
+
mentor_audited: bool
|
|
595
|
+
verdict: Literal["accept", "improve", "reject"]
|
|
596
|
+
weak_pattern: str | None = None
|
|
597
|
+
strong_pattern: str | None = None
|
|
598
|
+
gap_interpretation: str | None = None
|
|
599
|
+
rubric_concerns: list[str] = Field(default_factory=list)
|
|
600
|
+
grounding_concerns: list[str] = Field(default_factory=list)
|
|
601
|
+
data_quality_concerns: list[str] = Field(default_factory=list)
|
|
602
|
+
grpo_suitability: Literal["high", "medium", "low", "unknown"]
|
|
603
|
+
learning_signal_quality: Literal["high", "medium", "low", "unknown"]
|
|
604
|
+
reuse_value: Literal["high", "medium", "low"]
|
|
605
|
+
quality_score: float
|
|
606
|
+
fidelity_score: float
|
|
607
|
+
difficulty_score: float
|
|
608
|
+
learnability_score: float
|
|
609
|
+
reuse_value_score: float
|
|
610
|
+
verdict_reason: str
|
|
611
|
+
suggestion_for_generator: str | None = None
|
|
612
|
+
metadata_json: DictAny = Field(default_factory=dict)
|
|
613
|
+
|
|
614
|
+
@model_validator(mode="after")
|
|
615
|
+
def validate_suggestion(self):
|
|
616
|
+
if self.verdict in {"improve", "reject"} and not self.suggestion_for_generator:
|
|
617
|
+
raise ValueError("suggestion_for_generator is required on improve/reject")
|
|
618
|
+
return self
|
|
619
|
+
|
|
620
|
+
class TDOReport(StrictModel):
|
|
621
|
+
tdo_id: str
|
|
622
|
+
source_package_id: str
|
|
623
|
+
source_task_id: str | None = None
|
|
624
|
+
created_at: str
|
|
625
|
+
generator_mode: str
|
|
626
|
+
tdo_judge_source: Literal["mentor_model", "apprentice_self_judge"]
|
|
627
|
+
mentor_audited: bool
|
|
628
|
+
rounds_run: int
|
|
629
|
+
stop_reason: str
|
|
630
|
+
tdo_status: Literal["completed", "failed", "disabled", "partial"]
|
|
631
|
+
rows_generated_by_type: DictAny = Field(default_factory=dict)
|
|
632
|
+
rows_accepted_by_type: DictAny = Field(default_factory=dict)
|
|
633
|
+
rows_rejected_by_type: DictAny = Field(default_factory=dict)
|
|
634
|
+
average_quality_score: float | None = None
|
|
635
|
+
average_fidelity_score: float | None = None
|
|
636
|
+
average_difficulty_score: float | None = None
|
|
637
|
+
average_learnability_score: float | None = None
|
|
638
|
+
average_reuse_value_score: float | None = None
|
|
639
|
+
schema_validation_passed: bool
|
|
640
|
+
sanitization_passed: bool
|
|
641
|
+
weak_strong_proxy_available: bool
|
|
642
|
+
average_solver_gap_proxy: float | None = None
|
|
643
|
+
grpo_suitability_distribution: DictAny = Field(default_factory=dict)
|
|
644
|
+
omitted_outputs: list[str] = Field(default_factory=list)
|
|
645
|
+
not_generated_counts: DictAny = Field(default_factory=dict)
|
|
646
|
+
generation_notes: list[str] = Field(default_factory=list)
|
|
647
|
+
recommended_uses: list[str] = Field(default_factory=list)
|
|
648
|
+
metadata_json: DictAny = Field(default_factory=dict)
|