feat(labs): describe the lab task contract and the provisioner port

This commit is contained in:
shira committed 2026-10-11 15:40:14 +03:00
1 parent 3de226b16c
commit 9fdaa62b9b
91 files changed
+19262 -155

No files matched your search

@@ -84,6 +84,15 @@ export const assessmentAttemptOneOneCurrentItemOneContentSevenPublicExamplesMax
export const assessmentAttemptOneOneCurrentItemOneContentSevenMaxSourceLengthMax = 65536;
export const assessmentAttemptOneOneCurrentItemOneContentEightNodesItemNameMax = 15;
export const assessmentAttemptOneOneCurrentItemOneContentEightNodesItemNameRegExp = new RegExp('^[a-z][a-z0-9-]{0,14}$');
export const assessmentAttemptOneOneCurrentItemOneContentEightNodesMax = 8;
export const assessmentAttemptOneOneCurrentItemOneContentEightTimeLimitSecondsMin = 300;
export const assessmentAttemptOneOneCurrentItemOneContentEightTimeLimitSecondsMax = 14400;
export const assessmentAttemptOneOnePracticesItemVerdictOneScoreMin = 0;
export const assessmentAttemptOneOnePracticesItemVerdictOneScoreMax = 3;
@@ -180,6 +189,15 @@ export const assessmentAttemptTwoOneCurrentItemOneContentSevenPublicExamplesMax
export const assessmentAttemptTwoOneCurrentItemOneContentSevenMaxSourceLengthMax = 65536;
export const assessmentAttemptTwoOneCurrentItemOneContentEightNodesItemNameMax = 15;
export const assessmentAttemptTwoOneCurrentItemOneContentEightNodesItemNameRegExp = new RegExp('^[a-z][a-z0-9-]{0,14}$');
export const assessmentAttemptTwoOneCurrentItemOneContentEightNodesMax = 8;
export const assessmentAttemptTwoOneCurrentItemOneContentEightTimeLimitSecondsMin = 300;
export const assessmentAttemptTwoOneCurrentItemOneContentEightTimeLimitSecondsMax = 14400;
export const assessmentAttemptTwoOnePracticesItemVerdictOneScoreMin = 0;
export const assessmentAttemptTwoOnePracticesItemVerdictOneScoreMax = 3;
@@ -276,6 +294,15 @@ export const assessmentAttemptThreeOneCurrentItemOneContentSevenPublicExamplesMa
export const assessmentAttemptThreeOneCurrentItemOneContentSevenMaxSourceLengthMax = 65536;
export const assessmentAttemptThreeOneCurrentItemOneContentEightNodesItemNameMax = 15;
export const assessmentAttemptThreeOneCurrentItemOneContentEightNodesItemNameRegExp = new RegExp('^[a-z][a-z0-9-]{0,14}$');
export const assessmentAttemptThreeOneCurrentItemOneContentEightNodesMax = 8;
export const assessmentAttemptThreeOneCurrentItemOneContentEightTimeLimitSecondsMin = 300;
export const assessmentAttemptThreeOneCurrentItemOneContentEightTimeLimitSecondsMax = 14400;
export const assessmentAttemptThreeOnePracticesItemVerdictOneScoreMin = 0;
export const assessmentAttemptThreeOnePracticesItemVerdictOneScoreMax = 3;
@@ -367,7 +394,14 @@ export const AssessmentAttempt = zod.union([zod.object({
"expected_output": zod.string().max(assessmentAttemptOneOneCurrentItemOneContentSevenPublicExamplesItemExpectedOutputMax)
}).describe('Public example of the practice task: an input and its expected output. Hidden checks are never listed.')).max(assessmentAttemptOneOneCurrentItemOneContentSevenPublicExamplesMax),
"max_source_length": zod.int().min(1).max(assessmentAttemptOneOneCurrentItemOneContentSevenMaxSourceLengthMax).describe('Maximum length of the solution source in characters.')
}).describe('Code practice. The candidate submits one final solution, which runs in the isolated sandbox against three groups of hidden checks. The content lists only the statement, the allowed languages, and public examples; hidden checks, their inputs, and seeds never reach the client.')]).describe('Format-specific part of an item, selected by `format`. It holds only what the candidate needs to answer: never an answer key, a correct option, a score, a family or variant identifier, a seed, or a hidden check. Limits such as `multiple`, `max_selections`, and `max_length` belong to the format or the task family and never reveal the key.')
}).describe('Code practice. The candidate submits one final solution, which runs in the isolated sandbox against three groups of hidden checks. The content lists only the statement, the allowed languages, and public examples; hidden checks, their inputs, and seeds never reach the client.'),zod.object({
"format": zod.enum(['lab']),
"nodes": zod.array(zod.object({
"name": zod.string().min(1).max(assessmentAttemptOneOneCurrentItemOneContentEightNodesItemNameMax).regex(assessmentAttemptOneOneCurrentItemOneContentEightNodesItemNameRegExp).describe('Name of a lab node as the task statement uses it, such as `r1` or `srv`. It is a label of the task, not a host name or an address.'),
"kind": zod.enum(['mikrotik', 'ubuntu']).describe('What the console of a node shows.\n\n- mikrotik: a MikroTik router with the RouterOS console.\n- ubuntu: a small Ubuntu server with a Linux login.\n\nAdding a value is a contract change.')
}).describe('A node of a lab by its task name and kind. It never carries an address, a MAC address, a port, a password, a key, or an infrastructure name.')).min(1).max(assessmentAttemptOneOneCurrentItemOneContentEightNodesMax).describe('Nodes of the lab in the order of the statement.'),
"time_limit_seconds": zod.int().min(assessmentAttemptOneOneCurrentItemOneContentEightTimeLimitSecondsMin).max(assessmentAttemptOneOneCurrentItemOneContentEightTimeLimitSecondsMax).describe('Lifetime of a lab of this item from its creation. The lab also ends no later than the attempt deadline.')
}).describe('Practical lab: configure or repair a small network of virtual nodes through their consoles. The candidate starts the lab of the item with CreateMyAssessmentLab, works in the node consoles, and submits with SubmitMyAssessmentLab; the server then checks the state of the nodes. The content lists only the nodes the statement names and the lifetime of the lab, never the checker, its criteria, the seed, or an address. SubmitMyAssessmentAnswer takes no answer to a lab item; its result is submitted only with SubmitMyAssessmentLab.')]).describe('Format-specific part of an item, selected by `format`. It holds only what the candidate needs to answer: never an answer key, a correct option, a score, a family or variant identifier, a seed, or a hidden check. Limits such as `multiple`, `max_selections`, and `max_length` belong to the format or the task family and never reveal the key.')
}).describe('Item instance served to the candidate. The variant is fixed when it is first served: a reload, a retried request, or a resumed session returns the same instance with the same text and option order. The item never says whether an earlier answer was correct, and seed items, which are not scored, are indistinguishable from scored ones.'),zod.null()]).describe('Item to answer now: a test item in `in_progress`, the practice item to submit in `practice_pending` or `additional_practice_pending` while that practice is `not_started` or `failed`, and null otherwise.'),
"practices": zod.array(zod.object({
"kind": zod.enum(['main', 'additional']).describe('Role of a practice in the attempt.\n\n- main: the practice that every attempt with practice requires before a decision.\n- additional: adaptive only; offered by finalize when the probability of reaching the grade is in the band below confirmation. It continues the same attempt and spends no new attempt.\n\nAdding a value is a contract change.'),
@@ -468,7 +502,14 @@ export const AssessmentAttempt = zod.union([zod.object({
"expected_output": zod.string().max(assessmentAttemptTwoOneCurrentItemOneContentSevenPublicExamplesItemExpectedOutputMax)
}).describe('Public example of the practice task: an input and its expected output. Hidden checks are never listed.')).max(assessmentAttemptTwoOneCurrentItemOneContentSevenPublicExamplesMax),
"max_source_length": zod.int().min(1).max(assessmentAttemptTwoOneCurrentItemOneContentSevenMaxSourceLengthMax).describe('Maximum length of the solution source in characters.')
}).describe('Code practice. The candidate submits one final solution, which runs in the isolated sandbox against three groups of hidden checks. The content lists only the statement, the allowed languages, and public examples; hidden checks, their inputs, and seeds never reach the client.')]).describe('Format-specific part of an item, selected by `format`. It holds only what the candidate needs to answer: never an answer key, a correct option, a score, a family or variant identifier, a seed, or a hidden check. Limits such as `multiple`, `max_selections`, and `max_length` belong to the format or the task family and never reveal the key.')
}).describe('Code practice. The candidate submits one final solution, which runs in the isolated sandbox against three groups of hidden checks. The content lists only the statement, the allowed languages, and public examples; hidden checks, their inputs, and seeds never reach the client.'),zod.object({
"format": zod.enum(['lab']),
"nodes": zod.array(zod.object({
"name": zod.string().min(1).max(assessmentAttemptTwoOneCurrentItemOneContentEightNodesItemNameMax).regex(assessmentAttemptTwoOneCurrentItemOneContentEightNodesItemNameRegExp).describe('Name of a lab node as the task statement uses it, such as `r1` or `srv`. It is a label of the task, not a host name or an address.'),
"kind": zod.enum(['mikrotik', 'ubuntu']).describe('What the console of a node shows.\n\n- mikrotik: a MikroTik router with the RouterOS console.\n- ubuntu: a small Ubuntu server with a Linux login.\n\nAdding a value is a contract change.')
}).describe('A node of a lab by its task name and kind. It never carries an address, a MAC address, a port, a password, a key, or an infrastructure name.')).min(1).max(assessmentAttemptTwoOneCurrentItemOneContentEightNodesMax).describe('Nodes of the lab in the order of the statement.'),
"time_limit_seconds": zod.int().min(assessmentAttemptTwoOneCurrentItemOneContentEightTimeLimitSecondsMin).max(assessmentAttemptTwoOneCurrentItemOneContentEightTimeLimitSecondsMax).describe('Lifetime of a lab of this item from its creation. The lab also ends no later than the attempt deadline.')
}).describe('Practical lab: configure or repair a small network of virtual nodes through their consoles. The candidate starts the lab of the item with CreateMyAssessmentLab, works in the node consoles, and submits with SubmitMyAssessmentLab; the server then checks the state of the nodes. The content lists only the nodes the statement names and the lifetime of the lab, never the checker, its criteria, the seed, or an address. SubmitMyAssessmentAnswer takes no answer to a lab item; its result is submitted only with SubmitMyAssessmentLab.')]).describe('Format-specific part of an item, selected by `format`. It holds only what the candidate needs to answer: never an answer key, a correct option, a score, a family or variant identifier, a seed, or a hidden check. Limits such as `multiple`, `max_selections`, and `max_length` belong to the format or the task family and never reveal the key.')
}).describe('Item instance served to the candidate. The variant is fixed when it is first served: a reload, a retried request, or a resumed session returns the same instance with the same text and option order. The item never says whether an earlier answer was correct, and seed items, which are not scored, are indistinguishable from scored ones.'),zod.null()]).describe('Item to answer now: a test item in `in_progress`, the practice item to submit in `practice_pending` or `additional_practice_pending` while that practice is `not_started` or `failed`, and null otherwise.'),
"practices": zod.array(zod.object({
"kind": zod.enum(['main', 'additional']).describe('Role of a practice in the attempt.\n\n- main: the practice that every attempt with practice requires before a decision.\n- additional: adaptive only; offered by finalize when the probability of reaching the grade is in the band below confirmation. It continues the same attempt and spends no new attempt.\n\nAdding a value is a contract change.'),
@@ -569,7 +610,14 @@ export const AssessmentAttempt = zod.union([zod.object({
"expected_output": zod.string().max(assessmentAttemptThreeOneCurrentItemOneContentSevenPublicExamplesItemExpectedOutputMax)
}).describe('Public example of the practice task: an input and its expected output. Hidden checks are never listed.')).max(assessmentAttemptThreeOneCurrentItemOneContentSevenPublicExamplesMax),
"max_source_length": zod.int().min(1).max(assessmentAttemptThreeOneCurrentItemOneContentSevenMaxSourceLengthMax).describe('Maximum length of the solution source in characters.')
}).describe('Code practice. The candidate submits one final solution, which runs in the isolated sandbox against three groups of hidden checks. The content lists only the statement, the allowed languages, and public examples; hidden checks, their inputs, and seeds never reach the client.')]).describe('Format-specific part of an item, selected by `format`. It holds only what the candidate needs to answer: never an answer key, a correct option, a score, a family or variant identifier, a seed, or a hidden check. Limits such as `multiple`, `max_selections`, and `max_length` belong to the format or the task family and never reveal the key.')
}).describe('Code practice. The candidate submits one final solution, which runs in the isolated sandbox against three groups of hidden checks. The content lists only the statement, the allowed languages, and public examples; hidden checks, their inputs, and seeds never reach the client.'),zod.object({
"format": zod.enum(['lab']),
"nodes": zod.array(zod.object({
"name": zod.string().min(1).max(assessmentAttemptThreeOneCurrentItemOneContentEightNodesItemNameMax).regex(assessmentAttemptThreeOneCurrentItemOneContentEightNodesItemNameRegExp).describe('Name of a lab node as the task statement uses it, such as `r1` or `srv`. It is a label of the task, not a host name or an address.'),
"kind": zod.enum(['mikrotik', 'ubuntu']).describe('What the console of a node shows.\n\n- mikrotik: a MikroTik router with the RouterOS console.\n- ubuntu: a small Ubuntu server with a Linux login.\n\nAdding a value is a contract change.')
}).describe('A node of a lab by its task name and kind. It never carries an address, a MAC address, a port, a password, a key, or an infrastructure name.')).min(1).max(assessmentAttemptThreeOneCurrentItemOneContentEightNodesMax).describe('Nodes of the lab in the order of the statement.'),
"time_limit_seconds": zod.int().min(assessmentAttemptThreeOneCurrentItemOneContentEightTimeLimitSecondsMin).max(assessmentAttemptThreeOneCurrentItemOneContentEightTimeLimitSecondsMax).describe('Lifetime of a lab of this item from its creation. The lab also ends no later than the attempt deadline.')
}).describe('Practical lab: configure or repair a small network of virtual nodes through their consoles. The candidate starts the lab of the item with CreateMyAssessmentLab, works in the node consoles, and submits with SubmitMyAssessmentLab; the server then checks the state of the nodes. The content lists only the nodes the statement names and the lifetime of the lab, never the checker, its criteria, the seed, or an address. SubmitMyAssessmentAnswer takes no answer to a lab item; its result is submitted only with SubmitMyAssessmentLab.')]).describe('Format-specific part of an item, selected by `format`. It holds only what the candidate needs to answer: never an answer key, a correct option, a score, a family or variant identifier, a seed, or a hidden check. Limits such as `multiple`, `max_selections`, and `max_length` belong to the format or the task family and never reveal the key.')
}).describe('Item instance served to the candidate. The variant is fixed when it is first served: a reload, a retried request, or a resumed session returns the same instance with the same text and option order. The item never says whether an earlier answer was correct, and seed items, which are not scored, are indistinguishable from scored ones.'),zod.null()]).describe('Item to answer now: a test item in `in_progress`, the practice item to submit in `practice_pending` or `additional_practice_pending` while that practice is `not_started` or `failed`, and null otherwise.'),
"practices": zod.array(zod.object({
"kind": zod.enum(['main', 'additional']).describe('Role of a practice in the attempt.\n\n- main: the practice that every attempt with practice requires before a decision.\n- additional: adaptive only; offered by finalize when the probability of reaching the grade is in the band below confirmation. It continues the same attempt and spends no new attempt.\n\nAdding a value is a contract change.'),