Test checks
Ask one of the local check's five model questions
POST /api/v1/tests/checks/{check_id}/questions
Asks one of a local check's model questions. Requires sign-in, model_api and an Idempotency-Key. Questions of a started check do not count again and continue through cap, month and plan changes, within the replay window and question bound. Older uncounted checks count when their first question receives a place. Queue mode runs up to four questions per person at once across their keys, agents and checks.
Six input kinds have exact v17 prompts. The service scrubs again, rejects oversized input without shortening it, and keeps IDs, hashes and scores for replay. The configured prompt token limit also determines the byte limits for the rendered prompt, the total input fields and the question body; stored answers can replay after those limits are lowered. Only Free accounts that opt in to sharing data to help improve Commitscale keep scrubbed input fields in a separate store; withdrawal deletes them. Responses echo IDs.
Retries must preserve the exact body, request_id and key. An expired replay never starts another charge. A model_unavailable problem leaves the question unanswered. Answer Yes means p_yes >= 0.5; it does not apply the CLI's policy thresholds.
Parameters
check_idpath · required · stringThe check's random UUID.
Idempotency-Keyheader · required · stringRequired for model checks and questions. Reuse the exact body and IDs on retries. Keys are scoped to the caller's namespace and retained as hashes after the 24-hour replay window. Expired identities return model_replay_expired and cannot count again.
Minimum length:
1· Maximum length:255
Example request
curl --request POST 'https://commitscale.com/api/v1/tests/checks/019a1f40-7c00-7000-8000-000000000001/questions' \
--header "Authorization: Bearer $CSCALE_CHECK_KEY" \
--header 'Idempotency-Key: 019a1f40-7c00-7000-8000-000000000003' \
--header 'Content-Type: application/json' \
--data '{
"candidate_id": "candidate:1",
"input": {
"hunk": "@@ -1 +1 @@\n-return total;\n+return total + tax;\n",
"kind": "hunk",
"path": "src/total.rs"
},
"prompt_version": "v17-layout-1",
"question": "behaviour",
"redaction_version": "1",
"request_id": "019a1f40-7c00-7000-8000-000000000002"
}'Example values illustrate the format. Use your own credentials and identifiers.
Request body
application/json
candidate_idrequired · stringOpaque candidate identifier, never a path or excerpt.
inputrequired · objectInput for this question. Its kind must match the question; excerpts must already have sensitive values removed.
Fields of
inputScrubbed code or test evidence for the selected model question.
One of these shapes
hunkrequired · stringChanged lines as a unified diff hunk, with sensitive values removed.
kindrequired ·hunkSelects the hunk shape.
pathrequired · stringRepository-relative file path. Do not send absolute machine paths.
coderequired · stringRelevant source code around the proposed mistake, with sensitive values removed.
editrequired · stringThe proposed edit, with sensitive values removed.
kindrequired ·mistakeSelects the mistake shape.
pathrequired · stringRepository-relative file path. Do not send absolute machine paths.
hunkrequired · stringOne @@ hunk header and its body, without diff file headers; sensitive values removed.
kindrequired ·test_codeSelects the test_code shape.
pathrequired · stringSend (path hidden). This question must not use the file name as evidence.
code_diffrequired · stringSource change as a unified diff, with sensitive values removed.
editrequired · stringThe proposed edit, with sensitive values removed.
kindrequired ·test_editSelects the test_edit shape.
kindrequired ·buildSelects the build shape.
logrequired · stringThe end of the failed test run's log, with sensitive values removed.
code_diffrequired · stringSource change as a unified diff, with sensitive values removed.
editrequired · stringThe proposed edit, with sensitive values removed.
kindrequired ·caughtSelects the caught shape.
test_diffrequired · stringTest change as a unified diff, or an empty string if no tests changed.
prompt_versionrequired · stringPrompt layout version. Send v17-layout-1.
questionrequired ·behaviour/test_code/test_edit/build/caughtOne of the five questions: behaviour, test_code, test_edit, build or caught.
redaction_versionrequired · stringVersion of the client's secret-scrubbing rules. The server scrubs the input again.
request_idrequired · string (uuid)Random UUID for this question, reused for exact retries.
Responses
200 First-token Yes/No probability, or the stored answer.
application/json
{
"answer": "Yes",
"candidate_id": "candidate:1",
"check_id": "019a1f40-7c00-7000-8000-000000000001",
"checkpoint": "v17-f16:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
"model_version": "v17-f16",
"p_yes": 0.98,
"prompt_sha256": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
"prompt_version": "v17-layout-1",
"question": "behaviour",
"request_id": "019a1f40-7c00-7000-8000-000000000002",
"template_version": "cscale-1-chat-v1",
"tokenizer_version": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
}answerrequired ·Yes/NoYes at p_yes >= 0.5. The CLI applies each question's policy separately.
candidate_idrequired · stringOpaque candidate identifier. Do not put a path or source excerpt here.
check_idrequired · string (uuid)Random UUID for this check, reused for exact retries.
checkpointrequired · stringIdentifies the model that answered: its version, a colon, and a SHA-256 checksum.
Pattern:
^[^:]+:[0-9a-f]{64}$model_versionrequired · stringThe served model's name, such as
v17-f16.p_yesrequired · number (double)Yes and No normalized against each other; not a policy threshold.
Minimum:
0· Maximum:1prompt_sha256required · stringSHA-256 of the scrubbed, rendered chat input, as UTF-8 bytes.
Pattern:
^[0-9a-f]{64}$prompt_versionrequired · stringPrompt layout version. Send v17-layout-1.
questionrequired ·behaviour/test_code/test_edit/build/caughtOne of the five questions: behaviour, test_code, test_edit, build or caught.
request_idrequired · string (uuid)Random UUID for this question, reused for exact retries.
template_versionrequired · stringChat template used to render this question, currently cscale-1-chat-v1.
tokenizer_versionrequired · stringSHA-256 of the pinned tokenizer.json.
Pattern:
^[0-9a-f]{64}$
RateLimit and RateLimit-Policy describe the request rate. Follow Retry-After when a response asks you to wait.
Problem responses
Errors use application/problem+json. Act on the stable code, and follow next when present. See the problem format.
model_check_cap_reached403The Free allowance of 100 checks this UTC calendar month is used across Free workspaces. Verified addresses that reach one inbox share the allowance. The check was not started.
Do not retry automatically. Open next.url to upgrade the workspace to Pro and keep checking. Already started checks may finish.
model_unavailable503The local check's model is not configured or could not return both answer probabilities.
Leave the question unanswered. Retry the exact body with the same check ID, request ID and idempotency key within the remaining check budget.
excerpt_too_large413A model request exceeds a field, line, rendered byte, token, body or internal per-check question bound.
Skip the question and leave it unanswered. Do not shorten a diff, split its meaning across questions or retry the same oversized input.
model_replay_expired410A model check's 24-hour replay window expired. Its retained identities cannot be charged again.
Leave this question unanswered. Never silently substitute a fresh check for an expired retry.
check_key_scope403A check-only key may call the test check, read its own usage and acceptance rule, contact support, and withdraw data sharing.
Use a person's sign-in for account management. More agent power needs the owner's passkey; this key cannot widen itself.
feature_off403The namespace plan does not include this feature.
Retrying on the same plan will not help. GET /api/v1/namespaces/{namespace}/plan, and the namespace's Plan page in Settings, show what its plan includes.
unauthenticated401The request carried no credentials.
Use this operation's sign-in method. Bearer credentials use
Authorization: Bearer <token>; browser credentials use the session cookie.invalid_token401The token is unknown, expired, or revoked, its agent was revoked, or an OAuth token was used outside its MCP resource.
Stop using it. Sign in again, or ask the owner to create a replacement agent key.
forbidden403The caller may not do this: only people may, only owners may, or the agent was not given this repository or write access.
Stop. Retrying will not help. Ask the owner for the access, or leave the step to a person.
not_found404It does not exist, or the caller cannot read it: a repository the caller cannot read is reported as not found.
Check the name or ID, and that the token has the repository.
invalid_request400 / 413 / 422The request is malformed or breaks a rule, such as a title that is too long, or a body that is not the expected JSON.
Fix the request as
detailsays. The same request fails the same way.quota_exceeded429With 429, the caller used its requests for the minute. With 422, a count limit was reached.
With 429, wait
Retry-Afterseconds and retry. With 422, remove one first.idempotency_key_reused409 / 422The idempotency key was already used for a different request.
Use a new key for each new request, and the same key only for a retry of the same request.
idempotency_key_in_use409The first request with this key is still running, including a queued model question, or it succeeded with a secret, such as a new token, which is never replayed.
When
Retry-Afteris set, retry then with the same key. Otherwise the first request succeeded: do not repeat it.internal500The server failed, and logged why.
Retry after
Retry-Afterseconds. A write is safe to retry with the same idempotency key.unavailable503With 502, a service the server needs did not answer, such as a sign-in provider. With 503, the server is busy, such as when a workspace is locked or host lookups are full, or a write with an idempotency key runs long: that write goes on, and its answer is kept for the key.
With 502, retry later, or sign in another way. With 503, retry after
Retry-Afterseconds, using the same idempotency key for a write; a long-running write can then replay its answer.