Project 03 · Offline collaborationProje 03 · Çevrimdışı ortak çalışma

WEAVE

Merging the changes is not enough. The system they produce has to be correct too.Değişikliklerin birleşmesi yetmez. Ortaya çıkan sistemin de doğru olması gerekir.

StatusDurum
Working prototype, 2026 · support projectÇalışan prototip, 2026 · destek projesi
RunsÇalıştığı yer
In the browser; two tabs; local storageTarayıcıda; iki sekme; yerel kayıt
Data layerVeri katmanı
Automerge 3.5 (CRDT)
My partBenim kısmım
Flow model, type rules, checks after the merge, tracing problems to edits, editorAkış modeli, tip kuralları, birleştirme sonrası denetim, sorunları değişikliklere bağlama, düzenleyici

The project in four partsDört bölümde proje

01

ProblemProblem

Two people edit the same sensor flow without a connection. One turns a smoothing step into a window of eight samples, so its output becomes a list. The other adds an overload check that expects a single number from that step. Each copy is valid. Merged, the data agrees and the system is wrong.

İki kişi aynı sensör akışını bağlantısız düzenliyor. Biri bir yumuşatma adımını 8 örneklik bir pencereye çeviriyor; adımın çıkışı bir listeye dönüşüyor. Öbürü o adımdan tek bir sayı bekleyen bir aşırı yük denetimi ekliyor. İki kopya da geçerli. Birleşince veri uyuşuyor, sistem yanlış oluyor.

02

ConstraintsKısıtlar

  • Edits happen offline and arrive in any order, sometimes twice.
  • A data merge cannot know that a threshold needs a number.
  • A problem must point at the edits that caused it, not only at the broken line.
  • The decision has to stay in the history.
  • Değişiklikler çevrimdışı yapılır; herhangi bir sırayla, bazen iki kez gelir.
  • Bir veri birleştirmesi, eşiğin sayı beklediğini bilemez.
  • Bir sorun yalnızca bozuk çizgiyi değil, ona yol açan değişiklikleri göstermeli.
  • Verilen karar geçmişte kalmalı.
03

DecisionKarar

Let Automerge merge the data: concurrent edits, stable ids, every conflicting value kept. Then run the rules of the flow again on the merged result and trace each problem back through the change history.

Veriyi Automerge birleştirsin: eş zamanlı değişiklikler, sabit kimlikler, çakışan her değer saklı. Ardından akışın kurallarını birleşik sonuç üzerinde yeniden çalıştır ve her sorunu değişiklik geçmişinde geriye doğru izle.

04

SolutionÇözüm

Four node types, three data types. Every edit is one change with a note of what it meant. After a merge, types, inputs, dangling connections, cycles and doubled inputs are checked; each problem opens the two edits behind it and the ways out, and the choice is written back as a change.

Dört düğüm türü, üç veri tipi. Her düzenleme, ne anlama geldiğini not eden tek bir değişiklik. Birleştirmeden sonra tipler, girişler, kopuk bağlantılar, döngüler ve çift girişler denetlenir; her sorun ardındaki iki değişikliği ve çıkış yollarını açar, seçim de bir değişiklik olarak geri yazılır.

Walkthrough · captured from the editor belowAdım adım · aşağıdaki düzenleyiciden alınmış ekranlar

Two valid copies, one broken systemİki geçerli kopya, tek bozuk sistem

Two offline devices with their own edits Kendi düzenlemeleriyle iki çevrimdışı cihaz The type problem traced to two edits İki değişikliğe bağlanan tip sorunu The flow valid again after the decision Karardan sonra yeniden geçerli akış

01Offline: device A turns the smoothing step into a window of eight samples; device B connects an overload check to it. Both copies are valid.Çevrimdışı: A cihazı yumuşatma adımını sekiz örneklik bir pencereye çeviriyor; B cihazı ona bir aşırı yük denetimi bağlıyor. İki kopya da geçerli.

02Merged: the data agrees, the flow does not. The problem points at one edit on each branch and offers three ways out.Birleşti: veri uyuşuyor, akış uyuşmuyor. Sorun her daldan bir değişikliği gösteriyor ve üç çıkış yolu sunuyor.

03Decided: a conversion goes in, the flow is valid again, and the decision is in the history on both devices.Karar: bir dönüşüm ekleniyor, akış yeniden geçerli ve karar iki cihazın geçmişinde de duruyor.

Working demonstrationÇalışan gösterim

Edit two copies offline. Merge. See why it broke.İki kopyayı çevrimdışı düzenle. Birleştir. Neden bozulduğunu gör.

Pick a scenario, press "Edit both branches" while both devices are offline, then "Go online and merge". The problem turns amber: click it to see the two edits side by side and choose a way out. You can also open device B in a second tab, go offline, edit, and sync the two tabs.

Bir senaryo seç, iki cihaz çevrimdışıyken "İki dalı düzenle"ye, sonra "Çevrimiçi ol ve birleştir"e bas. Sorun turuncuya döner: iki değişikliği yan yana görmek ve bir çıkış yolu seçmek için üzerine tıkla. B cihazını ikinci bir sekmede açıp çevrimdışı düzenleyebilir ve iki sekmeyi eşitleyebilirsin.

Loads Automerge: 3.6 MB, 1.1 MB when the server compresses it with gzip. Your edits stay in this browser.Automerge'i yükler: 3,6 MB; sunucu gzip ile sıkıştırırsa 1,1 MB. Düzenlemelerin bu tarayıcıda kalır.

ValidationDoğrulama

What was checked, and howNeyin, nasıl denetlendiği

TestsTestler · 7/7

  1. types: each operation accepts and produces the right data typetipler: her işlem doğru veri tipini kabul ediyor ve üretiyor1 ms
  2. scenario 1: the data merges, the flow does not type-check, both changes are found, a conversion fixes itsenaryo 1: veri birleşiyor, akış tip denetiminden geçmiyor, iki değişiklik bulunuyor, dönüşüm düzeltiyor47 ms
  3. scenario 2: a new connection to a deleted node is caught and explained; restore or remove both worksenaryo 2: silinmiş düğüme yeni bağlantı yakalanıp açıklanıyor; geri getirme de kaldırma da çalışıyor8 ms
  4. scenario 3: opposite chains form a cycle and the same property got two values; both are resolvedsenaryo 3: ters zincirler döngü oluşturuyor ve aynı özelliğe iki değer geliyor; ikisi de çözülüyor11 ms
  5. convergence: changes delivered out of order and twice reach the same documentyakınsama: karışık sırayla ve iki kez gelen değişiklikler aynı belgeye ulaşıyor135 ms
  6. offline storage: a saved document reopens identical, a damaged one is refusedçevrimdışı kayıt: kaydedilen belge aynen açılıyor, bozuk olan reddediliyor15 ms
  7. free edits: a cycle, a doubled input and a missing input are all reportedserbest düzenleme: döngü, çift giriş ve eksik giriş raporlanıyor2 ms

Node v24.20.0 · run 2026-10-08 · node --test lab/tests/weave.test.mjsNode v24.20.0 · 2026-10-08 tarihinde çalıştırıldı · node --test lab/tests/weave.test.mjs

Order and duplicates do not matterSıra ve kopyalar fark etmez

All changes of both branches were delivered to a fresh copy in 300 random orders, each time with 4 changes delivered twice. 300 of 300 reached exactly the same document (same heads) as the direct merge.İki dalın bütün değişiklikleri yeni bir kopyaya 300 farklı rastgele sırayla, her seferinde 4 değişiklik iki kez gönderilerek iletildi. 300 denemenin 300 tanesi doğrudan birleştirmeyle tam olarak aynı belgeye (aynı başlıklar) ulaştı.

Saved document: about 1,229 bytes. Merge time, first scenario: 36.8 ms including setup. Editor 91 kB, Automerge WebAssembly 3.6 MB, loaded on request.Kaydedilen belge: yaklaşık 1.229 bayt. İlk senaryoda birleştirme süresi: kurulum dahil 36,8 ms. Düzenleyici 91 kB, Automerge WebAssembly 3,6 MB, istenince yükleniyor.

The three scenarios after the mergeBirleştirmeden sonra üç senaryo

ScenarioSenaryoProblem foundBulunan sorunTraced toBağlandığı değişikliklerWays out that fix itDüzelten çıkış yolları
1. An output type changes while a new connection relies on itBir çıkışın tipi değişirken yeni bir bağlantı eski tipe güveniyortype mismatchtip uyuşmazlığıA: changed a settingA: bir ayarı değiştirdi
B: made a connectionB: bağlantı kurdu
3 / 3
2. A node is deleted while another branch connects to itBir düğüm silinirken başka bir dal ona bağlanıyorconnection to a deleted nodesilinmiş düğüme bağlantıA: deleted a nodeA: düğüm sildi
B: made a connectionB: bağlantı kurdu
1 edit lost in the merge, reportedbirleştirmede 1 düzenleme kayboldu, raporlandı
2 / 2
input missinggiriş eksik–1 / 1
3. Two branches chain the same filters in opposite orderİki dal aynı filtreleri ters sırayla zincirliyorcycledöngüA: made a connectionA: bağlantı kurdu
B: made a connectionB: bağlantı kurdu
2 / 2
two values for one settingbir ayara iki değerA: changed a settingA: bir ayarı değiştirdi
B: changed a settingB: bir ayarı değiştirdi
2 / 2

Every branch is valid on its own before the merge. Automerge 3.5, Node v24.20.0.Birleştirmeden önce her dal tek başına geçerli. Automerge 3.5, Node v24.20.0.

Decision notesKarar notları

Constraint, method, resultKısıt, yöntem, sonuç

Two layers of checkingİki katmanlı denetim

ConstraintKısıt
Automerge guarantees that every copy ends with the same data. It does not know what a threshold accepts.Automerge her kopyanın aynı veriye ulaşmasını garanti eder. Bir eşiğin ne kabul ettiğini bilmez.
MethodYöntem
The domain rules run again on the merged result, separately from the merge.Alan kuralları, birleştirmeden ayrı olarak birleşik sonuç üzerinde yeniden çalışır.
ResultSonuç
In all three scenarios the merge succeeds and the rules still find the problem: a wrong type, a link to a deleted node, a cycle.Üç senaryoda da birleştirme başarılı ve kurallar sorunu yine buluyor: yanlış tip, silinmiş düğüme bağlantı, döngü.

Edits carry their intentDeğişiklikler niyetini taşır

ConstraintKısıt
Raw operations say "set key op". They cannot say "connected while the output was still a number".Ham işlemler "op anahtarını ayarla" der. "Çıkış hâlâ sayıyken bağlandı" diyemez.
MethodYöntem
Each edit is one Automerge change with a note: what it did, which node, and the type it saw at the time.Her düzenleme tek bir Automerge değişikliği ve bir not taşır: ne yaptı, hangi düğüm, o anda gördüğü tip.
ResultSonuç
Every problem in the three scenarios is traced to the right pair of edits, with the type each branch saw.Üç senaryodaki her sorun doğru değişiklik çiftine, her dalın gördüğü tiple birlikte bağlanıyor.

Keep conflicts visibleÇakışmaları görünür tut

ConstraintKısıt
Two branches set the same limit to 2.5 and 3. Automerge shows one value and keeps both.İki dal aynı sınırı 2,5 ve 3 yaptı. Automerge birini gösterir, ikisini de saklar.
MethodYöntem
WEAVE reads every kept value, labels it with its branch and asks which one stays.WEAVE saklanan her değeri okur, dalıyla etiketler ve hangisinin kalacağını sorar.
ResultSonuç
Both values of the limit appear with their branch, and either choice resolves the conflict.Sınırın iki değeri de dalıyla birlikte görünüyor; hangisi seçilirse seçilsin çakışma çözülüyor.

A repeated value is not a decisionAynı değeri yazmak karar değildir

ConstraintKısıt
Writing the value that is already shown is skipped as a no-op, so the conflict stays. The test caught this.Zaten gösterilen değeri yazmak boş işlem sayılıp atlanır ve çakışma kalır. Test bunu yakaladı.
MethodYöntem
The resolution deletes and rewrites the property in one change that comes after both values.Çözüm, özelliği her iki değerden sonra gelen tek bir değişiklikte silip yeniden yazar.
ResultSonuç
With delete and rewrite, all 10 offered ways out resolve their problem.Silip yeniden yazmayla önerilen 10 çıkış yolunun hepsi sorununu çözüyor.

Ids, not positionsKonum değil kimlik

ConstraintKısıt
In a list, two concurrent additions shift each other, and a connection cannot be followed across branches.Bir listede eş zamanlı iki ekleme birbirini kaydırır ve bir bağlantı dallar arasında izlenemez.
MethodYöntem
Nodes and connections live in maps keyed by stable ids that never change.Düğümler ve bağlantılar, hiç değişmeyen sabit kimliklerle anahtarlanmış haritalarda durur.
ResultSonuç
300 shuffled deliveries, each with duplicates, all reached the same document.Her birinde tekrar eden değişiklikler olan 300 karışık teslimin hepsi aynı belgeye ulaştı.

Say what was lostKaybolanı söyle

ConstraintKısıt
When one branch deletes a node that the other branch edited, the edit disappears with the node, silently.Bir dal, öbür dalın düzenlediği bir düğümü silince o düzenleme düğümle birlikte sessizce kaybolur.
MethodYöntem
The explanation lists the edits that were merged away, so restoring the node is an informed choice.Açıklama, birleştirmede kaybolan düzenlemeleri listeler; düğümü geri getirmek bilinçli bir seçim olur.
ResultSonuç
In the deleted-node scenario, the one edit lost in the merge is listed before you choose.Silinen düğüm senaryosunda birleştirmede kaybolan tek düzenleme, seçimden önce listeleniyor.

Built on, and what I addedÜzerine kurulduğu altyapı ve benim eklediklerim

Built onAltyapı

  • Automerge 3.5The document, its merge, change history, kept conflicts and binary save. MIT.Belge, birleştirme, değişiklik geçmişi, saklanan çakışmalar ve ikili kayıt. MIT.
  • Ink & Switch, PatchworkResearch on branches and reviewing changes visually in creative work. Ideas, not code.Yaratıcı işlerde dallar ve değişiklikleri görsel incelemeye dair araştırma. Kod değil, fikir.

Added in WEAVEWEAVE'de eklenenler

  • RulesKurallarFlow model, data types, checks for types, inputs, dangling connections, cycles, doubled inputs.Akış modeli, veri tipleri; tip, giriş, kopuk bağlantı, döngü ve çift giriş denetimleri.
  • TracingİzlemeEach problem linked to the edits behind it, lost edits reported, conflicts labelled by branch.Her sorun ardındaki değişikliklere bağlı, kaybolan düzenlemeler raporlanıyor, çakışmalar dala göre etiketli.
  • DecisionsKararlarWays out for each problem, applied as a change and kept in the history.Her sorun için çıkış yolları; değişiklik olarak uygulanıp geçmişte saklanıyor.
  • Editor and syncDüzenleyici ve eşitlemeGraph editor, offline switch, local storage, two-tab sync over BroadcastChannel.Grafik düzenleyici, çevrimdışı anahtarı, yerel kayıt, BroadcastChannel ile iki sekme eşitlemesi.