Repository navigation
refactor: Entry module - #1
Merged
Merged
Conversation
Entry, Kind, Ref and FileInfo get a module of their own, the first step towards one home for what each kind of entry is. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Frame::Msg wraps entry::Wire, and Entry::into_wire replaces to_frame. The JSON is unchanged: the wire-format tests pass as they were. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Wire::admit turns a msg frame into the entry that's stored, replacing the inline rules in read_loop. The per-kind limits (text, emoji, lifetime, files) live in entry.rs, used strictly for my entries and leniently for a peer's. New tests cover a round trip for every kind, which target counts when a frame names several, and each repair. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Kind::Inert is an entry kept in its author's log but never applied, shown or sent. Admission and the log both make an edit or delete of someone else's message inert, so announce and insert no longer check the author themselves; the SQL in current is the one other place that rule lives. A kind this build doesn't know (left by a newer build, after going back to an older one) used to load as a plain message, and catch-up could send it to the peer as one. It now loads as inert and isn't sent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
README's layout lists entry.rs, AGENTS.md points to Wire for the msg frame's body, and GLOSSARY.md names log, entry, inert entry, admission and message. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AGENTS.md gets an Agent skills section pointing to docs/agents/: issues live in GitHub Issues, triage uses the five default labels, and the domain docs are single-context (GLOSSARY.md and docs/adr/ at the root). Co-Authored-By: Claude Opus 5.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.
Summary
Each kind of log entry now has one home. Before, a kind was translated by hand in four places across
chat.rsanddb.rs, and the rule that only an author's own edits and deletes count was repeated in each of them.src-tauri/src/ +├── entry.rs # Entry, Kind, Ref, FileInfo; Wire (a msg frame's body); admission; limits per kind ├── chat.rs # Frame::Msg(Wire); read_loop calls admission └── db.rs # row mapping and the projection (show, current, reactions, scrub)A new kind,
Kind::Inert, covers entries that are kept in their author's log but never applied, shown or sent:Admission and the row decode both produce it, so
announceandinsertno longer check the author themselves. The SQL incurrentis the one other place that rule lives.GLOSSARY.mdis new: it defines log, entry, inert entry, admission and message.AGENTS.mdpoints to it.Also included is configuration for the agent skills: an
## Agent skillssection inAGENTS.mdanddocs/agents/, covering:docs/adr/at the repo rootEvidence
Before (
main): a row whose kind this build doesn't know loads as a reply, and catch-up would send it to the peer as one.After: it loads as inert, and
into_wirereturnsNone, so catch-up skips it.Wire format is unchanged:
known_frames_keep_their_wire_formatandextra_fields_on_known_frames_are_ignoredpass with their JSON assertions as they were. Only the code that builds the frame changed.New tests: 7 new tests, all plain
#[test]s with no networking:entry::every_kind_survives_the_wireentry::only_one_target_counts: delete > edit > reactionentry::admission_repairs_what_it_canentry::changes_to_someone_elses_message_are_inertdb::every_kind_survives_the_logentry.rscargo fmt --check,cargo clippy --all-targets -- -D warnings,cargo test(19 unit tests, pluspagingandtwo_peers), andbun run checkall pass locally on Windows.Merge Danger
Door: two-way
There's no schema change and no wire change, so reverting is a plain revert.
Blast Radius: sync
read_loopadmission and catch-up are on the path every message takes between peers. Two things could go wrong:two_peersstill passes end to end.haveis the highest entry it holds, so a gap is harmless.🤖 Generated with Claude Code