pub struct EconomicsTask {Show 13 fields
pub schema: String,
pub id: String,
pub title: String,
pub category: String,
pub complexity: String,
pub source: String,
pub fixture: String,
pub setup: Option<String>,
pub acceptance: String,
pub reference: String,
pub verify: String,
pub scope: Vec<String>,
pub sessions: Vec<EconomicsTaskSession>,
}Expand description
A task, as .ai/repo/benchmarks/economics/tasks/<id>/task.yaml declares it: the fixture
a run starts from, the prompt of each session in order, and the hidden acceptance tests
and verify command that decide whether the run succeeded.
use majordomus_cli::economics::model::EconomicsTask;
let t: EconomicsTask = serde_json::from_value(serde_json::json!({
"schema": "economics-task/v1", "id": "recurring-invoices", "title": "Recurring invoices",
"category": "multi-session", "complexity": "medium", "source": "Work across sessions.",
"fixture": "test/fixtures/economics/ledgerlite",
"acceptance": "test/fixtures/economics/acceptance/recurring-invoices",
"reference": "test/fixtures/economics/reference/recurring-invoices.patch",
"verify": "python3 -m unittest discover -s tests -q", "scope": ["ledgerlite", "tests"],
"sessions": [{ "prompt": "prompt-1.md" }, { "prompt": "prompt-2.md" }]
}))
.unwrap();
assert_eq!(t.sessions.len(), 2);
assert!(t.setup.is_none(), "a task with no setup patch starts from the bare fixture");Fields§
§schema: Stringeconomics-task/v1.
id: StringThe task’s id.
title: StringA name.
category: StringThe category results are segmented by.
complexity: Stringsmall, medium, large.
source: StringThe development pattern it stands for.
fixture: StringThe fixture repository the task starts from.
setup: Option<String>A patch applied to the fixture before the first session.
acceptance: StringThe hidden acceptance tests, copied in after the last session.
reference: StringA reference solution, which proves the acceptance tests can be satisfied.
verify: StringThe command whose exit decides the test gates.
scope: Vec<String>Where the task is expected to change files.
sessions: Vec<EconomicsTaskSession>The sessions, in order.
Trait Implementations§
Source§impl Clone for EconomicsTask
impl Clone for EconomicsTask
Source§fn clone(&self) -> EconomicsTask
fn clone(&self) -> EconomicsTask
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EconomicsTask
impl Debug for EconomicsTask
Source§impl<'de> Deserialize<'de> for EconomicsTask
impl<'de> Deserialize<'de> for EconomicsTask
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl JsonSchema for EconomicsTask
impl JsonSchema for EconomicsTask
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for EconomicsTask
impl PartialEq for EconomicsTask
Source§fn eq(&self, other: &EconomicsTask) -> bool
fn eq(&self, other: &EconomicsTask) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for EconomicsTask
impl Serialize for EconomicsTask
impl StructuralPartialEq for EconomicsTask
Auto Trait Implementations§
impl Freeze for EconomicsTask
impl RefUnwindSafe for EconomicsTask
impl Send for EconomicsTask
impl Sync for EconomicsTask
impl Unpin for EconomicsTask
impl UnsafeUnpin for EconomicsTask
impl UnwindSafe for EconomicsTask
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more