circuits-agent
Safe HaskellNone
LanguageGHC2024

Circuit.Agent.Mark

Description

The halt-mark grammar as a type.

Marks are the bus's boundary vocabulary: a finite set of glyphs that prefix a post body and announce the post's role in an exchange. This is the level-0 grammar of the quiescence thread — the free boundary K + payload with K finite, the stateless isMark of the mark machine (spinMark). Anything stateful (round counters, roles) lives above this layer.

The glyphs:

  • 🟡 Motion — a claim: "I pick this up".
  • Consent — no objection.
  • Amendment — an amendment offered.
  • 🔴 Escalate — "I can't move this"; the human's door.
  • 🟢 Landed — halt: the claim landed.
  • 🔵 StandDown — halt: standing down. Also the quiescence mark: a runner that judges observed quiet posts this to convert its judgment into decided quiet for everyone downstream.

History note: the quiescence marker was previously posted under 🟡, colliding with Motion. Legacy bodies like "🟡 quiescent after N empty cycles" parse as Motion under this grammar — that ambiguity is exactly why quiescence moved to 🔵. Do not reintroduce it.

Design card: coffee/loom/board.md ("what the halt-mark grammar is").

Synopsis

Documentation

data Mark Source #

A boundary mark.

Constructors

Motion

🟡 claim: "I pick this up".

Consent

✓ no objection.

Amendment

↩ amendment offered.

Escalate

🔴 escalation: "I can't move this".

Landed

🟢 halt: landed.

StandDown

🔵 halt: standing down / quiescent.

Instances

Instances details
Eq Mark Source # 
Instance details

Defined in Circuit.Agent.Mark

Methods

(==) :: Mark -> Mark -> Bool #

(/=) :: Mark -> Mark -> Bool #

Ord Mark Source # 
Instance details

Defined in Circuit.Agent.Mark

Methods

compare :: Mark -> Mark -> Ordering #

(<) :: Mark -> Mark -> Bool #

(<=) :: Mark -> Mark -> Bool #

(>) :: Mark -> Mark -> Bool #

(>=) :: Mark -> Mark -> Bool #

max :: Mark -> Mark -> Mark #

min :: Mark -> Mark -> Mark #

Bounded Mark Source # 
Instance details

Defined in Circuit.Agent.Mark

Enum Mark Source # 
Instance details

Defined in Circuit.Agent.Mark

Methods

succ :: Mark -> Mark #

pred :: Mark -> Mark #

toEnum :: Int -> Mark #

fromEnum :: Mark -> Int #

enumFrom :: Mark -> [Mark] #

enumFromThen :: Mark -> Mark -> [Mark] #

enumFromTo :: Mark -> Mark -> [Mark] #

enumFromThenTo :: Mark -> Mark -> Mark -> [Mark] #

Show Mark Source # 
Instance details

Defined in Circuit.Agent.Mark

Methods

showsPrec :: Int -> Mark -> ShowS #

show :: Mark -> String #

showList :: [Mark] -> ShowS #

markGlyph :: Mark -> Text Source #

The glyph that renders a mark.

parseMark :: Text -> Maybe Mark Source #

Parse a mark from the start of a body. Tolerates the emoji variation selector (U+FE0F) between glyph and rest. Exact glyphs only — no fuzzy matching, so a body that merely talks about marks is not one.

markOf :: Post Text -> Maybe Mark Source #

The mark carried by a post's body, if any.

isHalt :: Mark -> Bool Source #

Halt marks: the exchange is over. Landed and StandDown.

isEscalate :: Mark -> Bool Source #

Escalation: leave the loop, wake the human.