All MicroEvals
backend/services/aggregator/service.v
Create MicroEval
Header image for backend/services/aggregator/service.v

backend/services/aggregator/service.v

Prompt

module models import vsupport import json2 import time pub struct Subtask { pub mut: id vsupport.Uuid task_id vsupport.Uuid label string execution_order int dependency_ids []string parallel_with_ids []string objective string acceptance_criteria []json2.Any inputs map[string]json2.Any expected_outputs map[string]json2.Any capability_class string worker_config map[string]json2.Any max_retries int max_time_budget_seconds int max_cost_budget_usd f64 risk_level string status string result_key ?string result_summary ?string confidence_estimate ?f64 validation_notes []json2.Any tool_call_records []json2.Any resource_usage map[string]json2.Any evidence_references []json2.Any retry_count int repair_count int celery_task_id ?string worker_type ?string correlation_id ?string created_at time.Time updated_at time.Time queued_at ?time.Time started_at ?time.Time completed_at ?time.Time failed_at ?time.Time elapsed_seconds ?f64 error_code ?string error_message ?string error_details map[string]json2.Any } pub fn subtask_cols() []vsupport.Column { return [ vsupport.Column{name: 'id', typ: .col_uuid} vsupport.Column{name: 'task_id', typ: .col_uuid} vsupport.Column{name: 'label', typ: .col_str} vsupport.Column{name: 'execution_order', typ: .col_int} vsupport.Column{name: 'dependency_ids', typ: .col_uuid_arr} vsupport.Column{name: 'parallel_with_ids', typ: .col_uuid_arr} vsupport.Column{name: 'objective', typ: .col_str} vsupport.Column{name: 'acceptance_criteria', typ: .col_json} vsupport.Column{name: 'inputs', typ: .col_json} vsupport.Column{name: 'expected_outputs', typ: .col_json} vsupport.Column{name: 'capability_class', typ: .col_str} vsupport.Column{name: 'worker_config', typ: .col_json} vsupport.Column{name: 'max_retries', typ: .col_int} vsupport.Column{name: 'max_time_budget_seconds', typ: .col_int} vsupport.Column{name: 'max_cost_budget_usd', typ: .col_f64} vsupport.Column{name: 'risk_level', typ: .col_str} vsupport.Column{name: 'status', typ: .col_str} vsupport.Column{name: 'result_key', typ: .col_str} vsupport.Column{name: 'result_summary', typ: .col_str} vsupport.Column{name: 'confidence_estimate', typ: .col_f64} vsupport.Column{name: 'validation_notes', typ: .col_json} vsupport.Column{name: 'tool_call_records', typ: .col_json} vsupport.Column{name: 'resource_usage', typ: .col_json} vsupport.Column{name: 'evidence_references', typ: .col_json} vsupport.Column{name: 'retry_count', typ: .col_int} vsupport.Column{name: 'repair_count', typ: .col_int} vsupport.Column{name: 'celery_task_id', typ: .col_str} vsupport.Column{name: 'worker_type', typ: .col_str} vsupport.Column{name: 'correlation_id', typ: .col_str} vsupport.Column{name: 'created_at', typ: .col_time} vsupport.Column{name: 'updated_at', typ: .col_time} vsupport.Column{name: 'queued_at', typ: .col_time} vsupport.Column{name: 'started_at', typ: .col_time} vsupport.Column{name: 'completed_at', typ: .col_time} vsupport.Column{name: 'failed_at', typ: .col_time} vsupport.Column{name: 'elapsed_seconds', typ: .col_f64} vsupport.Column{name: 'error_code', typ: .col_str} vsupport.Column{name: 'error_message', typ: .col_str} vsupport.Column{name: 'error_details', typ: .col_json} ] } pub fn subtask_select_cols() string { return 'id, task_id, label, execution_order, dependency_ids, parallel_with_ids, objective, acceptance_criteria, inputs, expected_outputs, capability_class, worker_config, max_retries, max_time_budget_seconds, max_cost_budget_usd, risk_level, status, result_key, result_summary, confidence_estimate, validation_notes, tool_call_records, resource_usage, evidence_references, retry_count, repair_count, celery_task_id, worker_type, correlation_id, created_at, updated_at, queued_at, started_at, completed_at, failed_at, elapsed_seconds, error_code, error_message, error_details' } pub fn subtask_from_row(r vsupport.PgRow) Subtask { return Subtask{ id: vsupport.row_uuid(r, 0) task_id: vsupport.row_uuid(r, 1) label: vsupport.row_str(r, 2) execution_order: vsupport.row_int(r, 3) dependency_ids: vsupport.row_str_arr(r, 4) parallel_with_ids: vsupport.row_str_arr(r, 5) objective: vsupport.row_str(r, 6) acceptance_criteria: vsupport.row_json_arr(r, 7) inputs: vsupport.row_json_obj(r, 8) expected_outputs: vsupport.row_json_obj(r, 9) capability_class: vsupport.row_str(r, 10) worker_config: vsupport.row_json_obj(r, 11) max_retries: vsupport.row_int(r, 12) max_time_budget_seconds: vsupport.row_int(r, 13) max_cost_budget_usd: vsupport.row_f64(r, 14) risk_level: vsupport.row_str(r, 15) status: vsupport.row_str(r, 16) result_key: vsupport.row_opt_str(r, 17) result_summary: vsupport.row_opt_str(r, 18) confidence_estimate: vsupport.row_opt_f64(r, 19) validation_notes: vsupport.row_json_arr(r, 20) tool_call_records: vsupport.row_json_arr(r, 21) resource_usage: vsupport.row_json_obj(r, 22) evidence_references: vsupport.row_json_arr(r, 23) retry_count: vsupport.row_int(r, 24) repair_count: vsupport.row_int(r, 25) celery_task_id: vsupport.row_opt_str(r, 26) worker_type: vsupport.row_opt_str(r, 27) correlation_id: vsupport.row_opt_str(r, 28) created_at: vsupport.row_time(r, 29) updated_at: vsupport.row_time(r, 30) queued_at: vsupport.row_opt_time(r, 31) started_at: vsupport.row_opt_time(r, 32) completed_at: vsupport.row_opt_time(r, 33) failed_at: vsupport.row_opt_time(r, 34) elapsed_seconds: vsupport.row_opt_f64(r, 35) error_code: vsupport.row_opt_str(r, 36) error_message: vsupport.row_opt_str(r, 37) error_details: vsupport.row_json_obj(r, 38) } } pub fn (t &Subtask) insert_vals() map[string]string { mut v := map[string]string{} v['id'] = t.id.str() v['task_id'] = t.task_id.str() v['label'] = t.label v['execution_order'] = '${t.execution_order}' if t.dependency_ids.len > 0 { v['dependency_ids'] = vsupport.str_arr_literal(t.dependency_ids) } if t.parallel_with_ids.len > 0 { v['parallel_with_ids'] = vsupport.str_arr_literal(t.parallel_with_ids) } v['objective'] = t.objective if t.acceptance_criteria.len > 0 { v['acceptance_criteria'] = vsupport.encode_arr(t.acceptance_criteria) } if t.inputs.len > 0 { v['inputs'] = vsupport.encode(t.inputs) } if t.expected_outputs.len > 0 { v['expected_outputs'] = vsupport.encode(t.expected_outputs) } v['capability_class'] = t.capability_class if t.worker_config.len > 0 { v['worker_config'] = vsupport.encode(t.worker_config) } v['max_retries'] = '${t.max_retries}' v['max_time_budget_seconds'] = '${t.max_time_budget_seconds}' v['max_cost_budget_usd'] = '${t.max_cost_budget_usd}' v['risk_level'] = t.risk_level v['status'] = t.status if r := t.result_key { v['result_key'] = r } if r := t.result_summary { v['result_summary'] = r } if c := t.confidence_estimate { v['confidence_estimate'] = '${c}' } if t.validation_notes.len > 0 { v['validation_notes'] = vsupport.encode_arr(t.validation_notes) } if t.tool_call_records.len > 0 { v['tool_call_records'] = vsupport.encode_arr(t.tool_call_records) } if t.resource_usage.len > 0 { v['resource_usage'] = vsupport.encode(t.resource_usage) } if t.evidence_references.len > 0 { v['evidence_references'] = vsupport.encode_arr(t.evidence_references) } v['retry_count'] = '${t.retry_count}' v['repair_count'] = '${t.repair_count}' if c := t.celery_task_id { v['celery_task_id'] = c } if w := t.worker_type { v['worker_type'] = w } if c := t.correlation_id { v['correlation_id'] = c } if q := t.queued_at { v['queued_at'] = vsupport.time_sql(q) } if q := t.started_at { v['started_at'] = vsupport.time_sql(q) } if q := t.completed_at { v['completed_at'] = vsupport.time_sql(q) } if q := t.failed_at { v['failed_at'] = vsupport.time_sql(q) } if e := t.elapsed_seconds { v['elapsed_seconds'] = '${e}' } if e := t.error_code { v['error_code'] = e } if e := t.error_message { v['error_message'] = e } if t.error_details.len > 0 { v['error_details'] = vsupport.encode(t.error_details) } return v } pub fn (t &Subtask) update_vals() map[string]string { mut v := t.insert_vals() v['updated_at'] = vsupport.time_sql(vsupport.now_utc()) return v } I want a complete error report on the code below so I can fix everything in one pass. TASK Read the code character by character. List every real error: syntax, compile, runtime, logic, type, missing imports, broken references, and any mock / dummy / stub / placeholder / fake / simulated content. Mentally execute the code and include errors that would occur at runtime. SUCCESS Every real error listed exactly once, each tied to a specific location. Nothing invented, nothing skipped, nothing merged. OUTPUT Numbered list, one error per line: #. [line/symbol] — : . Final line: END OF ERROR LIST. CONSTRAINTS Errors only — no fixes, no suggestions, no summary, no commentary. Ambiguities count as errors and must be listed Solve this with the constraint that you cannot use the obvious solution. What is the most powerful, strongest approach? now critique your answer and fix the weak parts