Sync SPEC.md from fmsg-spec v0.5.0 consistency fixes - #33
Open
markmnl wants to merge 9 commits into
Open
Conversation
Notable for fmsgd: the spec now states what the implementation already does — stored-message verification includes messages the host sent, exactly one header-response code, add to may not overlap to, add-to copies omit topic and set has-pid, unsupported first byte gets code 2. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Aug 10, 2026
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Syncs SPEC.md with markmnl/fmsg#29 (spec v0.5.0 consistency fixes). The spec changes largely encode what fmsgd already does, so no code changes are needed here: stored-message verification includes messages the host sent, exactly one header-response code,
add tomay not overlapto, add-to copies omittopicand set has-pid, an unsupported message version gets code 2 (an unsupported CHALLENGE version terminates without responding — see #40).Also encodes the confirmed add-to design ruling: added recipients are participants of the add-to batch message only (their replies reference the batch via
pid); batches form sibling branches under the original, so the thread evolves as a tree; and batch identity is the batch message hash (which coverstime) — re-issuing the same addresses at a new time is a distinct batch, not a duplicate.Confirmed follow-up fixes (to land as separate small PRs, this PR stays docs-only)
addToBatchRecordedidentifies a duplicate batch by recipient-address set (msg_add_torows), whereas SPEC §11 defines batch identity by message hash (which includestime) — a re-issued batch with the same addresses but a new time must be recorded as a distinct batch, not rejected as a duplicate.host.go~1751-1759, ~1450-1457, ~1552) — spec calls for per-recipient 105 (or aborting); the sender ends up recording code 3 as a recipient's code.storeMsgHeaderOnly's INSERT branch (store.go:576) is unreachable (code 11 is only issued when the parent row exists, so the attach path always wins); if it were ever reached, the reloaded row would havePidequal to its own hash andisMessageRetrievablewould recurse on itself. Remove the branch.Flags&FlagHasPid == 1(pkg/fmsg/fmsg.go:93,host.go:1014) works only because the flag is bit 0; use!= 0.Resolved by design ruling (not bugs)
Earlier-batch participants are never notified of later batches— by design: participants added in an earlier batch are not participants of a later batch message, so they are not notified of it.sha256— not a bug: every legitimate remote reference to such a message arrives via an add-to batch, which crossed the wire and has its hash. Optional hygiene: compute the hash at store time for uniformity.🤖 Generated with Claude Code