Validation ensures that every packet, payload, and dialogue in the SUBIT‑Agent Protocol is structurally correct, SUBIT‑valid, and compliant with the protocol’s interaction rules.
All validation is deterministic and based solely on SUBIT‑Lingua structure and protocol constraints.
A packet is valid if it satisfies all of the following:
typemust existpayloadmust existtypemust be one of:
STATE,INTENT,ACTION,PLAN,TRACE,ERROR
- payload must be a SUBIT sequence
- bit length divisible by 6
- no invalid characters or malformed segments
metais optional- if present, it must be a JSON object
- metadata does not affect structural validity
Payloads must be valid SUBIT‑Lingua sequences.
- exactly 6 bits
- must decode to a valid SUBIT form index (0–63)
- exactly 12 bits
- must decode to two valid forms
- used for INTENT and ACTION
- length ≥ 6 bits
- divisible by 6
- each 6‑bit segment must decode to a valid form
- PLAN requires ≥ 3 forms
- TRACE requires ≥ 2 forms
- may be 1 form or 1 transition
- must still be valid SUBIT sequences
Each message type has structural constraints:
- payload = 1 form (6 bits)
- payload = 1 transition or short sequence
- minimum 12 bits
- payload = 1 transition
- exactly 12 bits
- payload = sequence of ≥ 3 forms
- minimum 18 bits
- payload = sequence of ≥ 2 forms
- minimum 12 bits
- payload = 1 form or 1 transition
- minimum 6 bits
Dialogue validation ensures that message sequences follow protocol rules.
- every dialogue must begin with
STATE STATEcannot appear afterACTIONorPLANunless preceded byERROR
STATE → INTENTis validINTENT → ACTIONis validSTATE → PLANis validPLAN → TRACEis validACTION → TRACEis valid
ACTION → INTENTACTION → STATEINTENT → STATETRACE → INTENTTRACE → ACTION
ANY → ERRORis valid- after
ERROR, the next message must beSTATE ERRORmay terminate a dialogue
A dialogue may end with:
ACTIONTRACEERROR
A packet or dialogue is invalid if:
- payload contains malformed SUBIT segments
- bit length is not divisible by 6
- message type does not match payload structure
- dialogue violates ordering rules
- PLAN or TRACE is too short
- ERROR is followed by anything except STATE
STATE → INTENT → ACTION
STATE → PLAN → TRACE
STATE → INTENT → ERROR → STATE → INTENT → ACTION
INTENT → ACTION
(no initial STATE)
ACTION → STATE
(illegal transition)
PLAN → INTENT
(backwards transition)