G-10 §479: a per-branch state's first view is named <owner>.<state>.<branch>

FollowBranch on the Reader and the ProcessReader, BranchState names the view with the
branch escaped as a key's name is; one row per branch in the first views.

Builds: design 47 G §479

Claude-Session: https://claude.ai/code/session_01JG73KEq4zoDfM9WtYpcQgZ
This commit is contained in:
2026-11-11 12:10:08 +01:00
parent 66ad4956d5
commit eed96854ae
3 changed files with 49 additions and 0 deletions
+12
View File
@@ -12,6 +12,7 @@ import (
"time"
stdio "git.novox.be/novox/mesh-sdk/go"
"git.novox.be/novox/mesh-sdk/go/keys"
)
// Reader is a module's pictures of the owners' states it used to read (novox/hq ADR 0615 §1): it
@@ -86,6 +87,17 @@ func (r *Reader) Follow(owner, state, tool string) *Follower {
return f
}
// BranchState is the name of a per-branch state's view: `<state>.<branch>`, the branch escaped as a key's name is (design
// 47 G §479), so a reader names the view `<owner>.<state>.<branch>`. A state that is not per branch keeps its name.
func BranchState(state, branch string) string { return state + "." + keys.EscapeName(branch) }
// FollowBranch is Follow for a state kept per branch: the view of one branch is named `<owner>.<state>.<branch>`
// (BranchState), so a reader follows several branches of one state, each its own view and its own row of
// `<module>_first_views` (design 47 G §479). Call it before Start.
func (r *Reader) FollowBranch(owner, state, branch, tool string) *Follower {
return r.Follow(owner, BranchState(state, branch), tool)
}
// Adopt takes a follower a seat's client made (its Ask a seat's verb, such as the catalog half's view) as one of the
// reader's first views, so the client's callers write no glue: the reader sets its conditions (the unanswered first view
// and view-waits, in the reader's findings), its log and clock, and hands each change to Watch, Changed and the