Documentation menu

Reconciliation and Publication

Compare candidates with accepted state and publish geometry, handlers, and mounted ownership at the same retained boundary.

Reconciliation connects a newly evaluated interface with the scene the server has already accepted. Kit retains that accepted tree as its baseline, then compares it with a candidate containing resolved layout, properties, handlers, and mounted storage. The differences become the protocol operations needed to propose the update.

Identity Matching and Diff Operations

The reconciler uses structural identity and explicit keys to decide which nodes can be reused. It assigns protocol identities where needed and emits the corresponding structural operations, property patches, content updates, and reorders, preserving the accepted scene as the reference point.

Some candidate changes affect only client-side behavior. Refreshing callbacks or environment ownership can leave serialized visual state unchanged, so a model update does not necessarily produce a wire diff even when local publication is needed.

Pending Candidates

A nonempty diff remains a pending candidate until its retained outcome arrives. The normal UI loop waits for that outcome before publishing another candidate, ensuring that reconciliation never starts a dependent update from a tree the server has not accepted.

The application can continue receiving model updates while waiting. A requested evaluation after resolution uses the latest model against the appropriate accepted baseline.

Atomic Acceptance

When CommitAccepted arrives, Kit promotes the candidate's tree, layout, handlers, and mounted ownership together. This aligns the locally active description with the retained scene. For an empty wire diff, Kit can perform that publication locally because the server has no scene change to resolve.

CommitAck is later GPU progress and does not perform this promotion. Using it as the baseline boundary would unnecessarily delay or misorder accepted callback publication.

Rejection and Accepted State

If the server rejects the candidate, its tree and handlers never replace the accepted ones. Newly created storage loses speculative ownership, while the accepted tree keeps values for any children whose proposed removal was rejected. The next attempt can therefore start from the last confirmed description.

The underlying model can still contain the writes that produced the failed candidate. Layout and reconciliation bookkeeping must preserve the earlier scene baseline so a later evaluation can compare that current model output with what the server actually accepted.

Input Lineage

Input targets and cancellation can refer to accepted controls even while a candidate is pending. Handler publication, environment scope, and focusability must follow the accepted tree rather than whichever description was built most recently.

See mounted identity, input dispatch, and commit outcomes.

Source Reference

The following files in the Hera checkout define the behavior described on this page.

  • crates/kit/src/app/mod.rs
  • crates/kit/src/app/reconcile/mod.rs
  • crates/kit/src/threading/mod.rs