Skip to content

Commit 9bb05f7

Browse files
committed
transport: add spec references for fork selection and pinning
Add AIT-CT13e and AIT-CT13f spec point references to the view's fork auto-selection and selection pinning code paths. Update the specification submodule with the corresponding new spec points and View-based API revisions.
1 parent 57d0fa0 commit 9bb05f7

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

specification

src/core/transport/view.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ export class DefaultView<TEvent, TMessage> implements View<TEvent, TMessage> {
262262

263263
const result = await this._sendDelegate(input, options, { flattenNodes: () => this.flattenNodes() });
264264

265+
// Spec: AIT-CT13e
265266
// Auto-select the new fork in this view when creating a fork.
266267
// The delegate's optimistic insert created the sibling — pin this
267268
// view to the latest (new) sibling so the user sees their edit/regeneration.
@@ -560,6 +561,7 @@ export class DefaultView<TEvent, TMessage> implements View<TEvent, TMessage> {
560561
if (!this._tree.hasSiblings(msgId)) continue;
561562
const groupRoot = this._tree.getGroupRoot(msgId);
562563

564+
// Spec: AIT-CT13e
563565
// Check if this fork was initiated by this view (e.g. regenerate).
564566
// If so, select the newest sibling and clear the pending state.
565567
// The pending set stores the forkOf msgId (the group root), but the
@@ -573,6 +575,8 @@ export class DefaultView<TEvent, TMessage> implements View<TEvent, TMessage> {
573575
continue;
574576
}
575577

578+
// Spec: AIT-CT13f
579+
// External fork — pin to the currently-visible sibling.
576580
if (this._selections.has(groupRoot)) continue;
577581
const idx = this._tree.getSiblingIndex(msgId);
578582
if (idx >= 0) {

0 commit comments

Comments
 (0)