8000 feat!: townframe changes by dman-os · Pull Request #136 · inkandswitch/subduction · GitHub
[go: up one dir, main page]

Skip to content

feat!: townframe changes - #136

Draft
dman-os wants to merge 28 commits into
inkandswitch:mainfrom
dman-os:feat/observer-sketch
Draft

dman-os wants to merge 28 commits into
inkandswitch:mainfrom
dman-os:feat/observer-sketch

Conversation

@dman-os
@dman-os dman-os commented May 1, 2026 •
Copy link
Copy Markdown

This PR shows the bits and bobs I had to change when integrating subduction into my project.

  • feat(subduction_core): SyncSession: allows observation of single sync exchange with a peer. Allows downstream sedimentree observers to incrementally maintain derived state like Automerge docs as changes come in.
  • refactor(subduction_keyhive)!: sync check hacks: sends SyncConfirmation msgs even after recieved sync checks require no work. Acks allow the other side to synchronously wait on keyhive sync tasks instead of them happening in the background.
    • feat(subduction_keyhive): SyncStatus: done signal from handle_message if SyncConfirmation is recieved.

related to inkandswitch/keyhive#210

@dman-os
dman-os force-pushed the feat/observer-sketch branch 2 times, most recently from ff4e9e0 to 53ff986 Compare May 29, 2026 13:58
@dman-os
dman-os force-pushed the feat/observer-sketch branch from 4de6e00 to ad90a6f Compare July 1, 2026 01:42
@dman-os dman-os changed the title feat: sync_session sketch fork: townframe Jul 1, 2026
@dman-os dman-os changed the title fork: townframe feat!: townframe changes Jul 1, 2026
@dman-os
dman-os force-pushed the feat/observer-sketch branch 2 times, most recently from c38fdac to 15bec90 Compare July 27, 2026 17:28
Comment thread subduction_keyhive/src/storage_ops.rs Outdated
let hash = hash_event_bytes(&bytes);

// Quick type detection
let kind = bincode_deserialize::<StaticEvent<Vec<u8>>>(&bytes)
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REMOVEME

let conns = {
let subscriber_conns = self.get_authorized_subscriber_conns(id, &self_id).await;
if subscriber_conns.is_empty() {
tracing::debug!(tree = ?id, "no subscribers for sedimentree, broadcasting to all connections");
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Highlight bug: disabled this strange behavior.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REVERTME

peer = %peer,
"sync check passed, peers are in sync"
);
let confirmation = Message::SyncConfirmation {
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Highlight: we now do acks at the end of the sync round. Not happy about this extra wire message but this buys us the ability to do a deterministically synchronous sync_keyhive. Maybe there's a good timeout based scheme out there though.

request_id.clone(),
OutboundRequest {
peer: target_id.clone(),
advertised_events,
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Highlight: we hold onto advertised events for a single sync session/request lest concurrent changes break the visiblity of events to peer. I.e. the peer might request hashes it no longer has access too.

This is a basic solution and has memory costs, more protocol level support for changes across rounds might be appropriate.

@dman-os
dman-os force-pushed the feat/observer-sketch branch 2 times, most recently from 9b2422d to b2d05c6 Compare August 10, 2026 03:45
@dman-os dman-os mentioned this pull request Aug 13, 2026
4 of 20 tasks
@dman-os
dman-os force-pushed the feat/observer-sketch branch from 121fc25 to afd4c49 Compare August 14, 2026 06:49
- KeyhiveStorage::save_event_with_source (default ignores source); storage_ops
  thread an optional source peer through save_event/save_event_bytes.
- KeyhiveProtocol::with_change_reporter: post-ingestion hook invoked with the
  hashes of newly inserted events and the peer they were learned from.
- KeyhiveProtocol::notification_targets: classify a batch of changed hashes
  against the connected peer set using the published cache snapshot; returns
  selected peers + unclassified (pending/lagged) hashes.
- Fix pre-existing serde test-harness drift (Arc<Mutex<Keyhive>> -> Arc<Keyhive>,
  missing request_id fields) so the serde test build compiles; 8 stale protocol
  tests remain failing (pre-existing, unrelated to this change).
@dman-os
dman-os force-pushed the feat/observer-sketch branch from afd4c49 to c16da98 Compare August 14, 2026 07:03
@dman-os
dman-os force-pushed the feat/observer-sketch branch from ce7e5ec to f27daeb Compare August 26, 2026 08:39
@dman-os
dman-os force-pushed the feat/observer-sketch branch from 152848d to 35545a2 Compare September 7, 2026 06:41

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0