From b4845aedcd4d3b2aa858320b10ace003bcaf1501 Mon Sep 17 00:00:00 2001 From: Eureka Date: Tue, 10 Nov 2026 17:08:40 +0000 Subject: [PATCH] huginn-mind: illegal retractions and non-label choices are stored refusals; claim_in_future follows the stored received_at DeskBody::IllegalRetraction stores Refused bad_retraction after steps 4-6 (digest carries the form, so it never replays as a plain answer); a choice is any 1-200 byte text, stored Refused choice_invalid when no option label, grammar or not. claim_in_future compares against the whole-second received_at written to the record. Co-Authored-By: Claude Sonnet 5.5 --- crates/huginn-mind/src/desk.rs | 214 ++++++++++++++++++++++++++++---- crates/huginn-mind/src/query.rs | 2 +- 2 files changed, 190 insertions(+), 26 deletions(-) diff --git a/crates/huginn-mind/src/desk.rs b/crates/huginn-mind/src/desk.rs index 4c89364..8681e63 100644 --- a/crates/huginn-mind/src/desk.rs +++ b/crates/huginn-mind/src/desk.rs @@ -18,7 +18,7 @@ //! displayed and flagged (`claim_in_future`), never compared for order, which is //! the per-question sequence, the receiver's order. `received_at` is the Mind's. -use chrono::{DateTime, Duration, SecondsFormat, Utc}; +use chrono::{DateTime, Duration, SecondsFormat, SubsecRound, Utc}; use eureka_pipeline::{ DeskAuthority, DeskOutcome, DeskRefusal, Label, PipelineDeskAnswer, PipelineDocument, PipelineKind, PipelineQuestion, PipelineRefusal, PipelineResolution, RequestId, ResolutionOutcome, Sha256Hex, Short, Slug, Words, @@ -44,12 +44,17 @@ pub struct DeskAnswerRequest { pub request_id: RequestId, } -/// An answer, or the retraction of one: a sum, so a retraction carrying an -/// answer, or naming no target, cannot be written down (R1 by construction). +/// An answer, a retraction of one, or one of the wire's illegal retraction forms. `choice` is +/// the person's text, any non-empty string: one that is no option label is a stored +/// `choice_invalid`, grammar or not (binding spec step 7). #[derive(Clone, Debug, PartialEq, Eq)] pub enum DeskBody { - Answer { choice: Option