Expand description
Tasks, claims and results (C0 1.9, section 1).
A task is a question or a piece of work in one Hive vault with an acceptance criterion. People create tasks on the web. An engine may only propose one, for its agent or for a contradiction it found, and a person approves it before anyone can claim it.
The rules:
- A task has at most one claim at a time. The claim is a bus lease
(
kind task, section 2), so Hold, Veto and Stop end it like any lease. - The holder reports short summaries (never prompts) and submits one result with evidence. Every write carries the claim’s fencing token, so a stale holder is refused.
- A result is a proposal (
origin task), with its knowledge change if it brings one. - The claiming instance never decides on it, not through its instance token either. A person decides (the instance’s owner included), or an auto-merge threshold. A threshold counts independent confirmations: in Team people and agents of other owners (one by default, configurable per vault), and in Personal sessions on the owner’s other instances (one by default): never the claiming instance, in any of its sessions (D1 per instance).
- A signal (message, offer) never changes a task’s state.
proposed --approve--> open --claim--> claimed --result--> submitted --accept--> done
| ^ ^ | |
+--reject--> rejected +--release / expiry / veto / stop ---+ +--decline--> open
proposed/open/claimed --cancel (people)--> cancelledHive v5 (additive): a result ends the task at once, done, or failed
when the request says outcome: failed; no person decides on it. Task
views carry a TaskLifecycle next to state (queued → claimed → running → completed | failed | cancelled), and a result references the
log seq of its knowledge instead of a proposal (proposal 0). A 1.x
Hive answers submitted and sends no lifecycle; an engine sends
outcome only to a Hive whose task views carry lifecycle.
Engine routes, all under /v1/vaults/{vault_id}/tasks:
| Route | Body | Answer | Lease right |
|---|---|---|---|
GET (?state=…&role=…&mine=true&priority=…) | TaskListV1 | tasks.read | |
GET /{number} | TaskV1 | tasks.read | |
POST | TaskProposeRequestV1 | TaskAckV1 (proposed) | tasks.propose |
POST /{number}/claim | TaskClaimRequestV1 | TaskClaimAckV1 | tasks.work |
POST /{number}/claim/renew | TaskClaimRenewRequestV1 | TaskClaimAckV1 | tasks.work |
POST /{number}/release | TaskReleaseRequestV1 | TaskAckV1 (open) | tasks.work |
POST /{number}/updates | TaskUpdateRequestV1 | TaskAckV1 | tasks.work |
POST /{number}/result | TaskResultRequestV1 | TaskAckV1 (submitted; v5 done or failed) | tasks.work |
POST /{number}/verify | TaskVerifyRequestV1 | TaskAckV1 (done or open; C0 2.2) | tasks.work |
PATCH /{number} | TaskFieldsRequestV1 | TaskAckV1 (C0 2.2) | tasks.propose |
C0 2.2: a result leaves the task submitted (failed with outcome: failed) until another agent verifies it (E48): accept → done,
reject → open. The verifier is never the result’s worker (403 forbidden_right, reason self_verify), and only a submitted task
takes a verdict (409 invalid_state, reason not_submitted).
Errors carry number (HiveErrorDetailV1::number):
409 invalid_state,reason:task_claimed: another claim holds the task;task_not_open: claim on a task that is notopen;stale_claim: the lease id or fencing token is not the current claim’s;task_closed: any write to adone,rejectedorcancelledtask;reviewer_not_independent: a confirmation that a threshold may not count.
403 forbidden_right,reason:not_permitted: the task’s role or the owner’s worker consent does not allow this agent;vetoed: a veto or stop holds this agent;optin_scope: the engine’s opt-in does not cover this vault (section 4).
409 invalid_state,reasonoptin_changedoroptin_inactive(section 4).429 rate_limited,reasondaily_budget: the opt-in’s daily budget is used up (retry_after_suntil it resets).
A proposed task, an update and a result carry their text in the clear.
Structs§
- Amend
Caller - Who is amending, as the caller established it: the result’s submitter,
the reviewer (the actor whose verdict made the task
done), a person, or a Queen session the app registered. - Claim
RefV1 - The claim a write acts under: the lease id and its fencing token.
- Evidence
V1 - One piece of evidence.
referenceis what the kind names: - Evidence
View V1 - Evidence as Hive shows it:
verifiedis set by Hive (areceiptwhose digest and signature it checked), never by a client. - Task
AckV1 - Answer of every task write: the number and the state afterwards.
- Task
Actor V1 - An actor as an engine sees it: never a user id or an email.
- Task
Amend Request V1 POST …/{number}/amend(3.12.3,tasks.work): a result is corrected without a claim (a submit ends the claim). Two shapes, by state (amend_rule):- Task
Claim AckV1 - Answer of claim and renew: the lease the holder writes under.
- Task
Claim Renew Request V1 POST …/{number}/claim/renew. 1.9 erratum: the renewed claim keeps its lease id and fencing token (the bus lease rule).- Task
Claim Request V1 POST …/{number}/claim.- Task
Claim V1 - The one claim on a task, as a task view shows it.
- Task
Decision V1 - The decision on a result.
- Task
Fields Request V1 PATCH …/{number}(C0 2.2 E47,tasks.propose): an agent sets a task’s priority and labels.base_versionis the task’sfields_version; a mismatch answers409 stale_base.- Task
List V1 GET /v1/vaults/{vault_id}/tasks.- Task
Merge V1 - 3.12.3: a
donetask’s merge record (amendwithmerge_commit). - Task
Origin V1 - Origin of a task.
factsnames exactly two distinct fact ids for a contradiction;messagenames the question’s message id for a question. - Task
Propose Request V1 POST /v1/vaults/{vault_id}/tasks: an engine proposes a task.- Task
Release Request V1 POST …/{number}/release: give the task back (blocked, out of scope).- Task
Result Request V1 POST …/{number}/result: the holder’s result. It ends the claim; a 1.x Hive turns it into a proposal (origin task), Hive v5 ends the task (done, orfailedwithoutcome: failed).draftis its knowledge change, if it brings one, exactly as a regular draft; a failed result brings none.- Task
Result V1 - The submitted result, as a task view shows it.
- Task
Summary V1 - One task in a listing.
- Task
Update Request V1 POST …/{number}/updates: one short summary from the holder.- Task
Update V1 - One update as a task view shows it.
- TaskV1
GET /v1/vaults/{vault_id}/tasks/{number}.- Task
Verification V1 - The last verdict on a task’s result, as a task view shows it (C0 2.2).
- Task
Verify Request V1 POST …/{number}/verify(C0 2.2 E48,tasks.work): another agent’s verdict.worker_idis the verifying agent, never the result’s (403 self_verify);reasonis required onreject.- UsageV1
- What the work cost the agent’s owner so far (self-reported): model tokens and, if known, US dollars in millionths (integers only, as everything under a signature).
Enums§
- Amend
Forbidden - Why this caller may not amend (
403with the code). - Amend
Refusal - Why a result cannot be amended (the Hive reason code in brackets).
- Decided
ByV1 - Who decided on a result: a person, or the auto-merge threshold (Personal).
- Evidence
Kind - Task
Actor Kind - Task
Decision Outcome - Task
Lifecycle - Hive v5 lifecycle of a task, sent next to
state(additive):queued → claimed → running → completed | failed | cancelled.running= claimed, and the holder reported progress under this claim. - Task
Origin Kind - Who created a task, and why.
- Task
Outcome - How the holder ends its claim with a result (Hive v5); absent on the
wire means
completed. - Task
Priority - A task’s priority (C0 2.2); absent means
normal. - Task
State - Lifecycle of a task.
- Task
Update Kind - What a task update is (C0 2.2): the holder’s progress, or a verifier’s verdict.
- Task
Verdict - A verifier’s verdict on a submitted result (C0 2.2):
acceptmakes the taskdone,rejectopens it again.
Constants§
- MAX_
ACCEPTANCE_ CHARS - MAX_
CLAIM_ MINUTES - MAX_
EVIDENCE - MAX_
EVIDENCE_ REF_ CHARS - MAX_
GOAL_ CHARS - MAX_
REASON_ CHARS - MAX_
SUMMARY_ CHARS - Updates and result summaries are summaries, not prompts: one line.
- MAX_
TASKS_ PAGE - MAX_
TASK_ LABELS - MAX_
TITLE_ CHARS - MAX_
VERIFY_ REASON_ CHARS - A verifier’s reason (C0 2.2 E48), required on
reject. - MAX_
VIEW_ UPDATES - Updates a task view carries, newest last.
- MIN_
CLAIM_ MINUTES - A claim is a bus lease: 5 to 15 minutes (
super::bus::MAX_BUS_LEASE_MS), renewed while work goes on, so a silent agent frees the task quickly. - MIN_
TITLE_ CHARS - TASK_
ACK_ SCHEMA - TASK_
AMEND_ SCHEMA - 3.12.3: the submitter corrects its submitted result (summary, evidence).
- TASK_
CLAIM_ ACK_ SCHEMA - TASK_
CLAIM_ RENEW_ SCHEMA - TASK_
CLAIM_ REQUEST_ SCHEMA - TASK_
FIELDS_ SCHEMA - C0 2.2 E47
PATCH: a task’s priority and labels. - TASK_
LIST_ SCHEMA - TASK_
PROPOSE_ SCHEMA - TASK_
RELEASE_ SCHEMA - TASK_
RESULT_ SCHEMA - TASK_
SCHEMA - TASK_
UPDATE_ SCHEMA - TASK_
VERIFY_ SCHEMA - C0 2.2 E48: another agent’s verdict on a submitted result.
Functions§
- amend_
rule - What a task’s state allows an amendment of its result:
submittedreplaces summary and evidence;donerecords the merge once and changes nothing else; any other state refuses. The one rule for Hive and the client (the client checks first, Hive enforces); who may amend ismay_amend. - may_
amend - Who may amend: the submitter always (a correction, or its merge
record); a merge record also a person or a registered Queen session;
never the reviewer (
not_merger), anyone elsenot_submitter. - merge_
evidence - The merge commit as a piece of evidence (how history shows it).
- validate_
labels - At most
MAX_TASK_LABELSunique labels of^[a-z0-9-]{1,32}$. - validate_
role - An agent role slug (section 5): 1-64 of
[a-z0-9-], starting with a letter.