huginn-mind: desk answers take the decider list as input, store attribution, received_at and request_id
DeskStamp carries answerer, attribution (Operator/Steward/Member per CultLib PR #72) and the decider list; membership decides rule 5, the attribution never does. answer_desk and DeskStamp are crate-private. The receipt names the operator only for the operator's account. counted_answer and R1 consider options_hash. A stored answer keeps received_at, claim_in_future, request_id and a body digest; the same (answerer, request_id) and body replays the stored outcome and writes nothing, another body is request_id_conflict. Notes are Words (1..=4000 bytes, not blank); answered_at must be UTC. The vector file is re-sliced byte for byte from PR #72 head 2dea6c56. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
f1691ffc0d
commit
dcc51c170f
10 changed files with 679 additions and 447 deletions
|
|
@ -3,7 +3,8 @@
|
|||
"DeskAuthority": {
|
||||
"enum": [
|
||||
"Operator",
|
||||
"Decider"
|
||||
"Steward",
|
||||
"Member"
|
||||
],
|
||||
"type": "string"
|
||||
},
|
||||
|
|
@ -94,9 +95,9 @@
|
|||
"maxLength": 64,
|
||||
"type": "string"
|
||||
},
|
||||
"Para": {
|
||||
"description": "Text of at most 4,000 UTF-8 bytes; longer narrative is cited by `DocRef`.",
|
||||
"maxLength": 4000,
|
||||
"RequestId": {
|
||||
"description": "A client's retry token: a lowercase D-format UUID.",
|
||||
"maxLength": 36,
|
||||
"type": "string"
|
||||
},
|
||||
"Sha256Hex": {
|
||||
|
|
@ -113,11 +114,17 @@
|
|||
"description": "A campaign slug or key segment: label parts joined by `.`.",
|
||||
"maxLength": 64,
|
||||
"type": "string"
|
||||
},
|
||||
"Words": {
|
||||
"description": "A person's words, verbatim: 1 to 4,000 UTF-8 bytes, not blank (CultLib PR #72, `answer.note`).",
|
||||
"maxLength": 4000,
|
||||
"minLength": 1,
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"$id": "https://gamecult.dev/epiphany/cultnet/epiphany.pipeline.desk_answer.v2.schema.json",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"description": "One answer the fork desk's receiver passed to the Mind, refused ones included.\n`answerer` and `authority` are stamped by the Mind from the verified caller and\nare absent from the request type; `answered_at` is the client's claim kept as\nwritten, display only: order is `sequence`, the receiver's order. `sequence` is\nper question and is the last part of the key (the answer id).",
|
||||
"description": "One answer the fork desk's receiver passed to the Mind, refused ones included.\n`answerer` and `authority` (an attribution, never a decision) are stamped by the\nMind from the verified caller and are absent from the request type; `answered_at`\nis the client's claim kept as written, display only: order is `sequence`, the\nreceiver's order. `received_at` is the Mind's admission time (UTC) and\n`claim_in_future` is set when `answered_at` is more than five minutes after it.\n`request_id` is the client's retry token and `body_sha256` the digest of the\nrequest it came with: the pair that makes a retry the same answer, never a new\none; the key is `(answerer, request_id)`. A record holds no card: a replayed\n`stale_fork` is shown the current card. `sequence` is per question and is the\nlast part of the key (the answer id).",
|
||||
"properties": {
|
||||
"answered_at": {
|
||||
"$ref": "#/$defs/Short"
|
||||
|
|
@ -126,14 +133,10 @@
|
|||
"$ref": "#/$defs/Short"
|
||||
},
|
||||
"authority": {
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/$defs/DeskAuthority"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
"$ref": "#/$defs/DeskAuthority"
|
||||
},
|
||||
"body_sha256": {
|
||||
"$ref": "#/$defs/Sha256Hex"
|
||||
},
|
||||
"campaign": {
|
||||
"$ref": "#/$defs/Slug"
|
||||
|
|
@ -148,13 +151,16 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
"claim_in_future": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"fork": {
|
||||
"$ref": "#/$defs/Short"
|
||||
},
|
||||
"note": {
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/$defs/Para"
|
||||
"$ref": "#/$defs/Words"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
|
|
@ -167,6 +173,12 @@
|
|||
"outcome": {
|
||||
"$ref": "#/$defs/DeskOutcome"
|
||||
},
|
||||
"received_at": {
|
||||
"$ref": "#/$defs/Short"
|
||||
},
|
||||
"request_id": {
|
||||
"$ref": "#/$defs/RequestId"
|
||||
},
|
||||
"sequence": {
|
||||
"format": "uint32",
|
||||
"minimum": 0,
|
||||
|
|
@ -179,7 +191,12 @@
|
|||
"sequence",
|
||||
"options_hash",
|
||||
"answered_at",
|
||||
"received_at",
|
||||
"claim_in_future",
|
||||
"request_id",
|
||||
"body_sha256",
|
||||
"answerer",
|
||||
"authority",
|
||||
"outcome"
|
||||
],
|
||||
"title": "PipelineDeskAnswer",
|
||||
|
|
|
|||
|
|
@ -399,7 +399,8 @@
|
|||
"type": "string",
|
||||
"enum": [
|
||||
"Operator",
|
||||
"Decider"
|
||||
"Steward",
|
||||
"Member"
|
||||
]
|
||||
},
|
||||
"DeskOutcome": {
|
||||
|
|
@ -1181,7 +1182,7 @@
|
|||
]
|
||||
},
|
||||
"PipelineDeskAnswer": {
|
||||
"description": "One answer the fork desk's receiver passed to the Mind, refused ones included.\n`answerer` and `authority` are stamped by the Mind from the verified caller and\nare absent from the request type; `answered_at` is the client's claim kept as\nwritten, display only: order is `sequence`, the receiver's order. `sequence` is\nper question and is the last part of the key (the answer id).",
|
||||
"description": "One answer the fork desk's receiver passed to the Mind, refused ones included.\n`answerer` and `authority` (an attribution, never a decision) are stamped by the\nMind from the verified caller and are absent from the request type; `answered_at`\nis the client's claim kept as written, display only: order is `sequence`, the\nreceiver's order. `received_at` is the Mind's admission time (UTC) and\n`claim_in_future` is set when `answered_at` is more than five minutes after it.\n`request_id` is the client's retry token and `body_sha256` the digest of the\nrequest it came with: the pair that makes a retry the same answer, never a new\none; the key is `(answerer, request_id)`. A record holds no card: a replayed\n`stale_fork` is shown the current card. `sequence` is per question and is the\nlast part of the key (the answer id).",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"answered_at": {
|
||||
|
|
@ -1191,14 +1192,10 @@
|
|||
"$ref": "#/$defs/Short"
|
||||
},
|
||||
"authority": {
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/$defs/DeskAuthority"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
"$ref": "#/$defs/DeskAuthority"
|
||||
},
|
||||
"body_sha256": {
|
||||
"$ref": "#/$defs/Sha256Hex"
|
||||
},
|
||||
"campaign": {
|
||||
"$ref": "#/$defs/Slug"
|
||||
|
|
@ -1213,13 +1210,16 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
"claim_in_future": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"fork": {
|
||||
"$ref": "#/$defs/Short"
|
||||
},
|
||||
"note": {
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/$defs/Para"
|
||||
"$ref": "#/$defs/Words"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
|
|
@ -1232,6 +1232,12 @@
|
|||
"outcome": {
|
||||
"$ref": "#/$defs/DeskOutcome"
|
||||
},
|
||||
"received_at": {
|
||||
"$ref": "#/$defs/Short"
|
||||
},
|
||||
"request_id": {
|
||||
"$ref": "#/$defs/RequestId"
|
||||
},
|
||||
"sequence": {
|
||||
"type": "integer",
|
||||
"format": "uint32",
|
||||
|
|
@ -1244,7 +1250,12 @@
|
|||
"sequence",
|
||||
"options_hash",
|
||||
"answered_at",
|
||||
"received_at",
|
||||
"claim_in_future",
|
||||
"request_id",
|
||||
"body_sha256",
|
||||
"answerer",
|
||||
"authority",
|
||||
"outcome"
|
||||
]
|
||||
},
|
||||
|
|
@ -2606,6 +2617,11 @@
|
|||
"builds"
|
||||
]
|
||||
},
|
||||
"RequestId": {
|
||||
"description": "A client's retry token: a lowercase D-format UUID.",
|
||||
"type": "string",
|
||||
"maxLength": 36
|
||||
},
|
||||
"ResearchSource": {
|
||||
"description": "Where a research claim comes from. A `Repo` pin and a `Web` page are\noutside the document set; an `Observed` result reuses a finding's evidence;\na `Document` is the one source that is a citation edge.",
|
||||
"oneOf": [
|
||||
|
|
@ -3151,6 +3167,12 @@
|
|||
"name",
|
||||
"pins"
|
||||
]
|
||||
},
|
||||
"Words": {
|
||||
"description": "A person's words, verbatim: 1 to 4,000 UTF-8 bytes, not blank (CultLib PR #72, `answer.note`).",
|
||||
"type": "string",
|
||||
"maxLength": 4000,
|
||||
"minLength": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -408,7 +408,8 @@
|
|||
"type": "string",
|
||||
"enum": [
|
||||
"Operator",
|
||||
"Decider"
|
||||
"Steward",
|
||||
"Member"
|
||||
]
|
||||
},
|
||||
"DeskOutcome": {
|
||||
|
|
@ -1533,6 +1534,27 @@
|
|||
"DeskRequestInvalid"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "The desk's `request_id_conflict` (CultLib PR #72): this `(answerer, request_id)` already bound another body. Nothing is stored.",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"DeskRequestIdConflict": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"request_id": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"request_id"
|
||||
]
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"DeskRequestIdConflict"
|
||||
]
|
||||
},
|
||||
{
|
||||
"description": "`campaign` names the refused document: a campaign, or a target revision that empties its predecessor's repos.",
|
||||
"type": "object",
|
||||
|
|
@ -2663,7 +2685,7 @@
|
|||
]
|
||||
},
|
||||
"PipelineDeskAnswer": {
|
||||
"description": "One answer the fork desk's receiver passed to the Mind, refused ones included.\n`answerer` and `authority` are stamped by the Mind from the verified caller and\nare absent from the request type; `answered_at` is the client's claim kept as\nwritten, display only: order is `sequence`, the receiver's order. `sequence` is\nper question and is the last part of the key (the answer id).",
|
||||
"description": "One answer the fork desk's receiver passed to the Mind, refused ones included.\n`answerer` and `authority` (an attribution, never a decision) are stamped by the\nMind from the verified caller and are absent from the request type; `answered_at`\nis the client's claim kept as written, display only: order is `sequence`, the\nreceiver's order. `received_at` is the Mind's admission time (UTC) and\n`claim_in_future` is set when `answered_at` is more than five minutes after it.\n`request_id` is the client's retry token and `body_sha256` the digest of the\nrequest it came with: the pair that makes a retry the same answer, never a new\none; the key is `(answerer, request_id)`. A record holds no card: a replayed\n`stale_fork` is shown the current card. `sequence` is per question and is the\nlast part of the key (the answer id).",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"answered_at": {
|
||||
|
|
@ -2673,14 +2695,10 @@
|
|||
"$ref": "#/$defs/Short"
|
||||
},
|
||||
"authority": {
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/$defs/DeskAuthority"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
"$ref": "#/$defs/DeskAuthority"
|
||||
},
|
||||
"body_sha256": {
|
||||
"$ref": "#/$defs/Sha256Hex"
|
||||
},
|
||||
"campaign": {
|
||||
"$ref": "#/$defs/Slug"
|
||||
|
|
@ -2695,13 +2713,16 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
"claim_in_future": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"fork": {
|
||||
"$ref": "#/$defs/Short"
|
||||
},
|
||||
"note": {
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/$defs/Para"
|
||||
"$ref": "#/$defs/Words"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
|
|
@ -2714,6 +2735,12 @@
|
|||
"outcome": {
|
||||
"$ref": "#/$defs/DeskOutcome"
|
||||
},
|
||||
"received_at": {
|
||||
"$ref": "#/$defs/Short"
|
||||
},
|
||||
"request_id": {
|
||||
"$ref": "#/$defs/RequestId"
|
||||
},
|
||||
"sequence": {
|
||||
"type": "integer",
|
||||
"format": "uint32",
|
||||
|
|
@ -2726,7 +2753,12 @@
|
|||
"sequence",
|
||||
"options_hash",
|
||||
"answered_at",
|
||||
"received_at",
|
||||
"claim_in_future",
|
||||
"request_id",
|
||||
"body_sha256",
|
||||
"answerer",
|
||||
"authority",
|
||||
"outcome"
|
||||
]
|
||||
},
|
||||
|
|
@ -4011,14 +4043,7 @@
|
|||
"type": "object",
|
||||
"properties": {
|
||||
"authority": {
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/$defs/DeskAuthority"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
"$ref": "#/$defs/DeskAuthority"
|
||||
},
|
||||
"fork": {
|
||||
"$ref": "#/$defs/Short"
|
||||
|
|
@ -4035,7 +4060,8 @@
|
|||
"required": [
|
||||
"fork",
|
||||
"sequence",
|
||||
"outcome"
|
||||
"outcome",
|
||||
"authority"
|
||||
]
|
||||
}
|
||||
},
|
||||
|
|
@ -5520,6 +5546,11 @@
|
|||
"builds"
|
||||
]
|
||||
},
|
||||
"RequestId": {
|
||||
"description": "A client's retry token: a lowercase D-format UUID.",
|
||||
"type": "string",
|
||||
"maxLength": 36
|
||||
},
|
||||
"ResearchSource": {
|
||||
"description": "Where a research claim comes from. A `Repo` pin and a `Web` page are\noutside the document set; an `Observed` result reuses a finding's evidence;\na `Document` is the one source that is a citation edge.",
|
||||
"oneOf": [
|
||||
|
|
@ -6124,6 +6155,12 @@
|
|||
"name",
|
||||
"pins"
|
||||
]
|
||||
},
|
||||
"Words": {
|
||||
"description": "A person's words, verbatim: 1 to 4,000 UTF-8 bytes, not blank (CultLib PR #72, `answer.note`).",
|
||||
"type": "string",
|
||||
"maxLength": 4000,
|
||||
"minLength": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue