mesh-knowledge: the overview's delivery block and the progress verb's groups lines go

Review round 1, Must 3: the groups and group-ended are retired; the overview
showed the deliveries, another module's state, which the status view owns.
The overview keeps two sources (the tracker, the asks), consumes no merge,
transition or pipeline's end, and the progress verb asks no groups.

Builds: design 47 H §764 (the gate's verb groups; the runner's group-ended); H-A-28; H-A-125

Claude-Session: https://claude.ai/code/session_01JG73KHUnBze48rdua8u2sy
This commit is contained in:
2026-11-20 06:04:16 +01:00
parent 5b06dd7e43
commit df79ab8769
11 changed files with 68 additions and 161 deletions
@@ -84,9 +84,15 @@ func TestItDeclaresAndHoldsTheKnowledgeBaseSeatOnceForTheMesh(t *testing.T) {
}
if !reflect.DeepEqual(m.Invokes, []string{"seat:issue-tracker.reserve", "claude-code.claude_code_judge", "records.records_status",
"records.records_list", "records.records_read", "seat:operator-channel.notify", "seat:issue-tracker.list", "seat:issue-tracker.get",
"seat:issue-tracker.milestones", "seat:issue-tracker.changes", "seat:mesh-delivery.deliveries", "seat:mesh-delivery.show", "seat:mesh-delivery.groups", "seat:operator-channel.asks", "seat:mesh-hand-acts.hand-act"}) {
"seat:issue-tracker.milestones", "seat:issue-tracker.changes", "seat:mesh-delivery.deliveries", "seat:mesh-delivery.show", "seat:operator-channel.asks", "seat:mesh-hand-acts.hand-act"}) {
t.Fatalf("invokes %v", m.Invokes)
}
// The overview keeps no delivery block (design 47 H, H-A-125): it hears no merge, transition or pipeline's end.
for _, e := range m.Consumes {
if strings.HasPrefix(e, "git.") || strings.HasPrefix(e, "mesh-delivery") || strings.HasPrefix(e, "mesh-pipeline-runner.") {
t.Errorf("it consumes %s, and the overview shows no deliveries", e)
}
}
src := ""
for _, f := range []string{"main.go", "hq.go", "progress.go", "progress_since.go", "milestones.go", "overview.go", "tools.go"} {
src += readFile(t, f)
@@ -282,7 +288,7 @@ func TestItAsksForItsBusStateInTheTypedForm(t *testing.T) {
// overviewConsumes are the events the overview page hears, in the order the manifest lists them.
func overviewConsumes() []string {
var out []string
for _, s := range []string{SourceTracker, SourceDelivery, SourceAsks} {
for _, s := range []string{SourceTracker, SourceAsks} {
out = append(out, OverviewEvents[s]...)
}
return out
@@ -2,9 +2,9 @@ package main
// The overview page (novox/hq to-be 55 §11, ADR 0616): one read-only page for the operator with three blocks: every design in
// progress with its milestones and their issues; the decisions and research efforts accepted in the last seven days and those
// waiting; and what waits on the operator (records waiting for an Approve, the operator channel's open asks, the delivery
// groups waiting). Built from mesh paths alone: the module's own ledger, and three other modules' verbs for the first view and
// their events after it. It never polls: a source is asked again only when it is marked unanswered, on a bounded backoff.
// waiting; and what waits on the operator (records waiting for an Approve, the operator channel's open asks). No delivery
// block: the deliveries are another module's state, read through the status view (design 47 H, H-A-125). Built from mesh
// paths alone: the module's own ledger, and two other modules' verbs for the first view and their events after it. It never polls: a source is asked again only when it is marked unanswered, on a bounded backoff.
import (
"encoding/json"
@@ -19,24 +19,21 @@ import (
// The sources of the page, besides the module's own ledger.
const (
SourceTracker = "issue-tracker"
SourceDelivery = "mesh-delivery"
SourceAsks = "operator-channel"
SourceTracker = "issue-tracker"
SourceAsks = "operator-channel"
)
// The verbs of the first view, and the events that keep each source current.
const (
TrackerMilestonesVerb = "seat:issue-tracker.milestones"
TrackerListVerb = "seat:issue-tracker.list"
DeliveryGroupsVerb = "seat:mesh-delivery.groups"
AsksVerb = "seat:operator-channel.asks"
)
// OverviewEvents are the events the page consumes, by source, as the manifest declares them.
var OverviewEvents = map[string][]string{
SourceTracker: {"mesh-issues.opened", "mesh-issues.moved", "mesh-issues.milestone-set", "mesh-issues.milestone-moved"},
SourceDelivery: {"git.pull-merged", "mesh-delivery-gate.transition", "mesh-pipeline-runner.group-ended"},
SourceAsks: {"messenger.offered", "messenger.closed"},
SourceTracker: {"mesh-issues.opened", "mesh-issues.moved", "mesh-issues.milestone-set", "mesh-issues.milestone-moved"},
SourceAsks: {"messenger.offered", "messenger.closed"},
}
// The unanswered marks: a verb that did not answer, or a subscription that missed its heartbeat.
@@ -123,7 +120,6 @@ type OverviewModel struct {
type OperatorBlock struct {
Records []RecordRow `json:"records"`
Asks []askRow `json:"asks"`
Groups []groupRow `json:"delivery-groups"`
}
// Overview is the page's model in memory, kept by events.
@@ -136,7 +132,6 @@ type Overview struct {
mu sync.Mutex
milestones map[string]trackerMilestone
issues map[int]trackerRow
groups map[string]groupRow
asks map[string]askRow
state map[string]*SourceState
rebuilt time.Time
@@ -147,8 +142,8 @@ type Overview struct {
// NewOverview is a model with no source answered: Start asks each source's verb once.
func NewOverview(ask SeatAsk, records func() ([]*Entry, error), now func() time.Time) *Overview {
o := &Overview{Ask: ask, Records: records, Now: now, milestones: map[string]trackerMilestone{}, issues: map[int]trackerRow{},
groups: map[string]groupRow{}, asks: map[string]askRow{}, state: map[string]*SourceState{}, verbCalls: map[string]int{}}
for _, s := range []string{SourceTracker, SourceDelivery, SourceAsks} {
asks: map[string]askRow{}, state: map[string]*SourceState{}, verbCalls: map[string]int{}}
for _, s := range []string{SourceTracker, SourceAsks} {
o.state[s] = &SourceState{Name: s}
}
return o
@@ -234,19 +229,6 @@ func (o *Overview) rebuildLocked(source string) error {
for _, r := range rows {
o.issues[r.Number] = r
}
case SourceDelivery:
raw, err := call(DeliveryGroupsVerb, map[string]any{})
if err != nil {
return fail(err.Error())
}
var gs []groupRow
if err := rowsOf(raw, &gs, "groups"); err != nil {
return fail("groups answered something else: " + err.Error())
}
o.groups = map[string]groupRow{}
for _, g := range gs {
o.groups[g.ID] = g
}
case SourceAsks:
raw, err := call(AsksVerb, map[string]any{})
if err != nil {
@@ -279,7 +261,7 @@ func (o *Overview) sourceNames() []string {
// Start is the first view: every source's verb asked once. A verb that does not answer marks its source.
func (o *Overview) Start() {
for _, s := range []string{SourceTracker, SourceDelivery, SourceAsks} {
for _, s := range []string{SourceTracker, SourceAsks} {
_ = o.Rebuild(s)
}
}
@@ -339,16 +321,11 @@ func (o *Overview) Heard(source, event string, body json.RawMessage) {
Number int `json:"number"`
Status string `json:"status"`
To string `json:"to"`
State string `json:"state"`
Title string `json:"title"`
Design int `json:"design"`
ID string `json:"id"`
Group string `json:"group"`
Branch string `json:"branch"`
Outcome string `json:"outcome"`
Issues []int `json:"issues"`
Members []string `json:"members"`
Why string `json:"why"`
Key string `json:"key"`
Asker string `json:"asker"`
Headline string `json:"headline"`
@@ -381,22 +358,6 @@ func (o *Overview) Heard(source, event string, body json.RawMessage) {
m.Status = firstNonEmpty(f.To, f.Status, m.Status)
o.milestones[k] = m
}
case SourceDelivery:
id := firstNonEmpty(f.Group, f.ID)
switch name {
case "pull-merged":
// A merged pull request leaves the group named by its head branch (a group's id is its branch name): it waits for
// the operator no longer (design 47 G §431).
delete(o.groups, f.Branch)
case "transition":
if g, ok := o.groups[id]; ok {
g.State = firstNonEmpty(f.To, f.State, g.State)
g.Why = firstNonEmpty(f.Why, g.Why)
o.groups[id] = g
}
case "group-ended":
delete(o.groups, id)
}
case SourceAsks:
switch name {
case "offered":
@@ -481,12 +442,6 @@ func (o *Overview) Model() (*OverviewModel, error) {
m.Operator.Asks = append(m.Operator.Asks, a)
}
sort.Slice(m.Operator.Asks, func(i, j int) bool { return m.Operator.Asks[i].Key < m.Operator.Asks[j].Key })
for _, g := range o.groups {
if g.State != "merged" {
m.Operator.Groups = append(m.Operator.Groups, g)
}
}
sort.Slice(m.Operator.Groups, func(i, j int) bool { return m.Operator.Groups[i].ID < m.Operator.Groups[j].ID })
for _, n := range o.sourceNames() {
m.Sources = append(m.Sources, *o.state[n])
}
@@ -25,7 +25,6 @@ func newOverviewWorld(t *testing.T) *overviewWorld {
w := &overviewWorld{now: time.Date(2026, 11, 4, 12, 0, 0, 0, time.UTC), fail: map[string]bool{}, answers: map[string]string{
TrackerMilestonesVerb: `{"milestones":[{"design":47,"id":"1","outcome":"A merge is never dropped","status":"open","issues":[973,525]},{"design":47,"id":"2","outcome":"Done thing","status":"done","issues":[1]}]}`,
TrackerListVerb: `[{"number":973,"title":"The window","status":"fixing"},{"number":525,"title":"The queue","status":"open"}]`,
DeliveryGroupsVerb: `[{"id":"fix/a","state":"held","why":"a member is held","members":["x@1"]},{"id":"fix/b","state":"checking","members":["y@2"]}]`,
AsksVerb: `{"asks":[{"key":"mesh-knowledge.1","asker":"mesh-knowledge","headline":"Approve ADR 0301","state":"open","offered_on":["telegram"]},{"key":"ask-0","asker":"x","headline":"old","state":"answered"}]}`,
}}
w.o = NewOverview(func(key string, body any) (json.RawMessage, error) {
@@ -45,8 +44,8 @@ func recordEntry(n int, status, date string, accepted time.Time, mut func(*Recor
return &Entry{Current: r, CurrentVersion: 1, Versions: 1}
}
// The page's model (ADR 0616 §1-3, AC P1): three blocks built from the ledger, the tracker's milestones and issues, the delivery
// groups and the operator channel's asks; events change the blocks and ask no verb; a record accepted eight days before the
// The page's model (ADR 0616 §1-3, AC P1): three blocks built from the ledger, the tracker's milestones and issues and the
// operator channel's asks, and no delivery block (design 47 H, H-A-125); events change the blocks and ask no verb; a record accepted eight days before the
// answer is not in the seven-day block, with no event between.
func TestThePageModelHasThreeBlocksKeptByEventsAndAsksNoVerbAgain(t *testing.T) {
w := newOverviewWorld(t)
@@ -68,28 +67,25 @@ func TestThePageModelHasThreeBlocksKeptByEventsAndAsksNoVerbAgain(t *testing.T)
t.Fatalf("the design block: %+v", m.Designs)
}
if len(m.Accepted) != 2 || len(m.Waiting) != 2 || len(m.Operator.Records) != 1 || m.Operator.Records[0].Record != "ADR 0303" ||
len(m.Operator.Asks) != 1 || m.Operator.Asks[0].Key != "mesh-knowledge.1" || len(m.Operator.Groups) != 2 {
len(m.Operator.Asks) != 1 || m.Operator.Asks[0].Key != "mesh-knowledge.1" || len(m.Sources) != 2 {
t.Fatalf("%+v", m)
}
asked := map[string]int{}
for _, v := range []string{TrackerMilestonesVerb, TrackerListVerb, DeliveryGroupsVerb, AsksVerb} {
for _, v := range []string{TrackerMilestonesVerb, TrackerListVerb, AsksVerb} {
asked[v] = w.o.Calls(v)
}
// Events change the blocks.
w.o.Heard(SourceDelivery, "git.pull-merged", json.RawMessage(`{"repository":"novox/y","number":2,"branch":"fix/b"}`))
w.o.Heard(SourceDelivery, "mesh-delivery-gate.transition", json.RawMessage(`{"group":"fix/a","to":"approved"}`))
w.o.Heard(SourceAsks, "messenger.offered", json.RawMessage(`{"id":"2","asker":"mesh-delivery","headline":"Approve the group","channels":["telegram"]}`))
w.o.Heard(SourceTracker, "mesh-issues.opened", json.RawMessage(`{"number":1999,"title":"New","status":"open"}`))
w.o.Heard(SourceTracker, "mesh-issues.milestone-moved", json.RawMessage(`{"design":47,"id":"1","to":"done","issues":[973,525,1999]}`))
m, _ = w.o.Model()
if len(m.Operator.Groups) != 1 || m.Operator.Groups[0].State != "approved" || len(m.Operator.Asks) != 2 || len(m.Designs) != 0 {
if len(m.Operator.Asks) != 2 || len(m.Designs) != 0 {
t.Fatalf("after the events: %+v", m)
}
w.o.Heard(SourceDelivery, "mesh-pipeline-runner.group-ended", json.RawMessage(`{"group":"fix/a","branch":"main","outcome":"passed"}`))
w.o.Heard(SourceAsks, "messenger.closed", json.RawMessage(`{"id":"1","asker":"mesh-knowledge","how":"answered"}`))
m, _ = w.o.Model()
if len(m.Operator.Groups) != 0 || len(m.Operator.Asks) != 1 || m.Operator.Asks[0].Key != "mesh-delivery.2" {
t.Fatalf("after the group ended and the ask closed: %+v", m.Operator)
if len(m.Operator.Asks) != 1 || m.Operator.Asks[0].Key != "mesh-delivery.2" {
t.Fatalf("after the ask closed: %+v", m.Operator)
}
for v, n := range asked {
if w.o.Calls(v) != n {
@@ -109,56 +105,56 @@ func TestThePageModelHasThreeBlocksKeptByEventsAndAsksNoVerbAgain(t *testing.T)
// next event; the model as a tool equals the page's model; the re-read tool asks one source and records the hand act.
func TestASourceThatDoesNotAnswerIsSaidAndAskedAgainOnABackoff(t *testing.T) {
w := newOverviewWorld(t)
w.fail[DeliveryGroupsVerb] = true
w.fail[AsksVerb] = true
w.o.Start()
m, _ := w.o.Model()
var delivery SourceState
var asks SourceState
for _, s := range m.Sources {
if s.Name == SourceDelivery {
delivery = s
if s.Name == SourceAsks {
asks = s
}
}
if delivery.Answered || delivery.Mark == nil || delivery.Mark.Cause != MarkVerb || len(m.Operator.Groups) != 0 || !strings.Contains(delivery.Mark.Why, "no answer in time") {
t.Fatalf("%+v", delivery)
if asks.Answered || asks.Mark == nil || asks.Mark.Cause != MarkVerb || len(m.Operator.Asks) != 0 || !strings.Contains(asks.Mark.Why, "no answer in time") {
t.Fatalf("%+v", asks)
}
if len(m.Designs) != 1 {
t.Fatalf("another source's block was lost: %+v", m.Designs)
}
// Asked again on the backoff alone: 10 s, then doubling, at most 5 minutes; no other source is asked.
calls := w.o.Calls(DeliveryGroupsVerb)
calls := w.o.Calls(AsksVerb)
if got := w.o.Due(); len(got) != 0 {
t.Fatalf("asked before the backoff ran out: %v", got)
}
var waits []time.Duration
for i := 0; i < 8; i++ {
before := w.now
w.now = w.o.state[SourceDelivery].Mark.Next
w.now = w.o.state[SourceAsks].Mark.Next
waits = append(waits, w.now.Sub(before))
if got := w.o.Due(); len(got) != 1 || got[0] != SourceDelivery {
if got := w.o.Due(); len(got) != 1 || got[0] != SourceAsks {
t.Fatalf("%v", got)
}
}
if waits[0] != BackoffFrom || waits[1] != 2*BackoffFrom || waits[7] != BackoffMost || w.o.Calls(DeliveryGroupsVerb) != calls+8 || w.o.Calls(AsksVerb) != 1 {
t.Fatalf("waits %v, delivery asked %d, asks asked %d", waits, w.o.Calls(DeliveryGroupsVerb), w.o.Calls(AsksVerb))
if waits[0] != BackoffFrom || waits[1] != 2*BackoffFrom || waits[7] != BackoffMost || w.o.Calls(AsksVerb) != calls+8 || w.o.Calls(TrackerListVerb) != 1 {
t.Fatalf("waits %v, asks asked %d, tracker asked %d", waits, w.o.Calls(AsksVerb), w.o.Calls(TrackerListVerb))
}
// Its first answer rebuilds the block and clears the mark.
w.fail[DeliveryGroupsVerb] = false
w.now = w.o.state[SourceDelivery].Mark.Next
w.fail[AsksVerb] = false
w.now = w.o.state[SourceAsks].Mark.Next
w.o.Due()
m, _ = w.o.Model()
if len(w.o.Unanswered()) != 0 || len(m.Operator.Groups) != 2 {
if len(w.o.Unanswered()) != 0 || len(m.Operator.Asks) != 1 {
t.Fatalf("%+v", m)
}
// A subscription that goes silent marks the source from the subscription and asks nothing while it is silent.
asked := w.o.Calls(AsksVerb)
w.now = w.now.Add(HeartbeatWithin + time.Second)
if got := w.o.Silent(); len(got) != 3 {
if got := w.o.Silent(); len(got) != 2 {
t.Fatalf("%v", got)
}
if got := w.o.Due(); len(got) != 0 || w.o.Calls(AsksVerb) != asked {
t.Fatalf("a silent subscription was asked: %v", got)
}
if u := w.o.Unanswered(); len(u) != 3 || u[0].Mark.Cause != MarkSubscription {
if u := w.o.Unanswered(); len(u) != 2 || u[0].Mark.Cause != MarkSubscription {
t.Fatalf("%+v", u)
}
// Its next event (or heartbeat) makes the module ask the verb once, and that answer clears the mark.
@@ -167,19 +163,19 @@ func TestASourceThatDoesNotAnswerIsSaidAndAskedAgainOnABackoff(t *testing.T) {
t.Fatalf("asked %d, mark %+v", w.o.Calls(AsksVerb), w.o.state[SourceAsks].Mark)
}
// An unanswered verb then turns the mark into one from the verb.
w.fail[DeliveryGroupsVerb] = true
w.o.Heard(SourceDelivery, "", nil)
if mk := w.o.state[SourceDelivery].Mark; mk == nil || mk.Cause != MarkVerb {
w.fail[TrackerMilestonesVerb] = true
w.o.Heard(SourceTracker, "", nil)
if mk := w.o.state[SourceTracker].Mark; mk == nil || mk.Cause != MarkVerb {
t.Fatalf("%+v", mk)
}
// The runtime's word on the module's consumer (stdio.OnHeartbeat): a missed heartbeat marks every subscribed source
// at once, before the bound passes, with the runtime's why; the next beat asks each verb once and clears the marks.
w.fail[DeliveryGroupsVerb] = false
w.now = w.o.state[SourceDelivery].Mark.Next
w.fail[TrackerMilestonesVerb] = false
w.now = w.o.state[SourceTracker].Mark.Next
w.o.Due()
asked = w.o.Calls(AsksVerb)
w.o.Beat(stdio.Heartbeat{At: w.now, Missed: true, Why: "the bus's heartbeat stopped arriving"})
if u := w.o.Unanswered(); len(u) != 3 || u[0].Mark.Cause != MarkSubscription || !strings.Contains(u[0].Mark.Why, "stopped arriving") {
if u := w.o.Unanswered(); len(u) != 2 || u[0].Mark.Cause != MarkSubscription || !strings.Contains(u[0].Mark.Why, "stopped arriving") {
t.Fatalf("a missed heartbeat marked %+v", u)
}
w.o.Beat(stdio.Heartbeat{At: w.now})
@@ -218,12 +214,12 @@ func TestThePagesModelIsAToolAndItsRereadIsAHandAct(t *testing.T) {
}
// The re-read asks the one source and no other, and records itself.
before := map[string]int{}
for _, v := range []string{TrackerListVerb, DeliveryGroupsVerb, AsksVerb} {
for _, v := range []string{TrackerListVerb, AsksVerb} {
before[v] = w.o.Calls(v)
}
w.fail[AsksVerb] = true
res, err := callTool(t, tools, RereadTool, map[string]any{"source": SourceAsks, "why": "the page showed it stale"})
if err != nil || res["answered"] != false || w.o.Calls(AsksVerb) != before[AsksVerb]+1 || w.o.Calls(DeliveryGroupsVerb) != before[DeliveryGroupsVerb] || w.o.Calls(TrackerListVerb) != before[TrackerListVerb] {
if err != nil || res["answered"] != false || w.o.Calls(AsksVerb) != before[AsksVerb]+1 || w.o.Calls(TrackerListVerb) != before[TrackerListVerb] {
t.Fatalf("%v %v", err, res)
}
if len(acts) != 1 || acts[0] != "seat:mesh-hand-acts.hand-act" {
@@ -88,13 +88,11 @@ code{font-size:.9em}.src{display:inline-block;margin-right:1rem}
{{if .Waiting}}<ul>{{range .Waiting}}<li>{{.Record}}: {{.Title}} <span class="mute">waits for {{.Waits}}</span></li>{{end}}</ul>{{else}}<p class="mute">None.</p>{{end}}
<h2>Waiting on you</h2>
{{range .Sources}}{{if and (eq .Name "operator-channel") (not .Answered)}}<p class="bad">The operator channel does not answer: the asks below are not complete (last answer {{clock .Last}}).</p>{{end}}{{if and (eq .Name "mesh-delivery") (not .Answered)}}<p class="bad">Delivery does not answer: the groups below are not complete (last answer {{clock .Last}}).</p>{{end}}{{end}}
{{range .Sources}}{{if and (eq .Name "operator-channel") (not .Answered)}}<p class="bad">The operator channel does not answer: the asks below are not complete (last answer {{clock .Last}}).</p>{{end}}{{end}}
<h3>Records waiting for your Approve</h3>
{{if .Operator.Records}}<ul>{{range .Operator.Records}}<li>{{.Record}}: {{.Title}}</li>{{end}}</ul>{{else}}<p class="mute">None.</p>{{end}}
<h3>Open asks</h3>
{{if .Operator.Asks}}<ul>{{range .Operator.Asks}}<li>{{.Headline}} <span class="mute">from {{.Asker}}{{if .Offered}}, offered on {{join .Offered ", "}}{{end}}</span></li>{{end}}</ul>{{else}}<p class="mute">None.</p>{{end}}
<h3>Delivery groups waiting</h3>
{{if .Operator.Groups}}<ul>{{range .Operator.Groups}}<li><code>{{.ID}}</code> {{.State}}{{if .Why}}: {{.Why}}{{end}}</li>{{end}}</ul>{{else}}<p class="mute">None.</p>{{end}}
</body></html>`))
// ServePage starts the overview: the model's first view, the events kept, the unanswered sources asked again on their backoff,
@@ -22,7 +22,7 @@ func TestThePageAnswersGetOnlyAndTheManifestKeepsItToThisMachine(t *testing.T) {
h.ServeHTTP(rec, httptest.NewRequest(http.MethodGet, "/", nil))
body := rec.Body.String()
if rec.Code != 200 || !strings.Contains(body, "Design 47, milestone 1") || !strings.Contains(body, "ADR 0301") || !strings.Contains(body, "Approve ADR 0301") ||
!strings.Contains(body, "fix/a") {
strings.Contains(body, "Delivery") { // no delivery block (design 47 H, H-A-125)
t.Fatalf("%d\n%.600s", rec.Code, body)
}
if strings.Contains(body, "<form") || strings.Contains(body, "<script") || !strings.Contains(rec.Header().Get("Content-Security-Policy"), "default-src 'none'") {
@@ -3,12 +3,12 @@ package main
// progress: how far a design, a milestone, an issue or a record has come, in one call (novox/hq issue 1947). The
// knowledge base works a design's state out and nobody writes it (ADR 0424 §1, §2); this verb says it at every
// level, in two forms: minimal, one line per child, cheap enough for every five minutes; detailed, the tree of a
// lead's report with the pull requests, the held groups and what waits on whom, for about every thirty.
// lead's report with the pull requests and what waits on whom, for about every thirty.
//
// It keeps no state of its own. It reads, each a request and reply over the bus: the designs' titles and states through
// the records module (design.go, cached by hq's commit), their milestones from the issue tracker (milestones.go,
// issue 1781), the issues from the issue tracker (`issue-tracker.list`, whose rows
// say each issue's delivery and when it last moved), and the deliveries and groups from mesh-delivery.
// say each issue's delivery and when it last moved), and the deliveries from mesh-delivery. It reads no groups: they went (design 47 H §764, H-A-125).
import (
"encoding/json"
@@ -112,19 +112,10 @@ type deliveryRow struct {
State string `json:"state"`
Since time.Time `json:"since"`
Waits string `json:"waits"`
Group string `json:"group"`
Issues []int `json:"-"`
Title string `json:"-"`
}
// groupRow is a row of `mesh-delivery.groups`.
type groupRow struct {
ID string `json:"id"`
State string `json:"state"`
Why string `json:"why"`
Members []string `json:"members"`
}
var (
designOf = regexp.MustCompile(`^design\s+([0-9]{1,3})$`)
milestoneOf = regexp.MustCompile(`(?i)^milestone\s+([0-9]{1,3})/(.+)$`)
@@ -596,11 +587,10 @@ func (k *KB) progressRecord(p *Progress, kind string, n int) error {
return nil
}
// extras is what a detailed answer reads beyond the rows: the open deliveries with their issues, the groups, and
// extras is what a detailed answer reads beyond the rows: the open deliveries with their issues, and
// each issue not done read whole.
type extras struct {
deliveries []deliveryRow
groups map[string]groupRow
gets map[int]*issueGot
warnings []string
}
@@ -616,9 +606,9 @@ func final(state string) bool {
return state == "merged" || state == "closed" || state == "delivered"
}
// readExtras reads the deliveries not final with the issues each names, the groups, and the issues not done.
// readExtras reads the deliveries not final with the issues each names, and the issues not done.
func (k *KB) readExtras(items []Item) (*extras, error) {
x := &extras{groups: map[string]groupRow{}, gets: map[int]*issueGot{}}
x := &extras{gets: map[int]*issueGot{}}
raw, err := k.Seats("seat:mesh-delivery.deliveries", map[string]any{})
if err != nil {
return nil, fmt.Errorf("mesh-delivery does not answer: %v", err)
@@ -656,17 +646,6 @@ func (k *KB) readExtras(items []Item) (*extras, error) {
d.Issues, d.Title = s.Delivery.Issues, s.Delivery.Title
x.deliveries = append(x.deliveries, d)
}
raw, err = k.Seats("seat:mesh-delivery.groups", map[string]any{})
if err != nil {
return nil, fmt.Errorf("mesh-delivery does not answer: %v", err)
}
var gs []groupRow
if err := json.Unmarshal(raw, &gs); err != nil {
return nil, fmt.Errorf("mesh-delivery.groups answered something else: %v", err)
}
for _, g := range gs {
x.groups[g.ID] = g
}
got := 0
for _, m := range items {
for _, c := range m.Children {
@@ -716,13 +695,12 @@ func (k *KB) readExtras(items []Item) (*extras, error) {
return x, nil
}
// pullLines is one line per open delivery naming issue n, and per group it is in.
// pullLines is one line per open delivery naming issue n.
func (x *extras) pullLines(n int) []string {
if x == nil {
return nil
}
var out []string
groups := map[string]bool{}
for _, d := range x.deliveries {
named := false
for _, i := range d.Issues {
@@ -744,31 +722,12 @@ func (x *extras) pullLines(n int) []string {
line += ", waits for " + d.Waits
}
out = append(out, line)
if d.Group != "" {
groups[d.Group] = true
}
}
var gids []string
for g := range groups {
gids = append(gids, g)
}
sort.Strings(gids)
for _, id := range gids {
g, ok := x.groups[id]
if !ok {
continue
}
mark := marks[StateMoving]
if g.State == "held" {
mark = marks[StateStuck]
}
out = append(out, fmt.Sprintf("%s group %s %s: %s", mark, g.ID, g.State, g.Why))
}
return out
}
// renderTree draws a design's or a milestone's tree: minimal, one line per milestone with the done ones folded into
// one line; detailed, each milestone not done with its issues, their pull requests and groups.
// one line; detailed, each milestone not done with its issues, their pull requests.
func renderTree(top Item, detail string, x *extras, oneMilestone bool) string {
var b strings.Builder
if oneMilestone {
@@ -815,7 +774,7 @@ func renderTree(top Item, detail string, x *extras, oneMilestone bool) string {
}
// writeIssues draws a milestone's issues: minimal, those not done; detailed, every issue, and under each not done
// its pull requests, groups and what it depends on.
// its pull requests and what it depends on.
func writeIssues(b *strings.Builder, indent string, kids []Item, detail string, x *extras) {
var show []Item
for _, c := range kids {
@@ -18,7 +18,7 @@ func TestProgressOverTheBus(t *testing.T) {
w := newBusWorld(t)
seats := newSeatsWorld(t)
for _, key := range []string{"seat:issue-tracker.list", "seat:issue-tracker.get", MilestonesVerb, "seat:mesh-delivery.deliveries",
"seat:mesh-delivery.groups", "seat:mesh-delivery.show"} {
"seat:mesh-delivery.show"} {
key := key
if _, err := w.nc.Subscribe("ask."+key, func(m *nats.Msg) {
var body map[string]any
@@ -76,8 +76,8 @@ func TestProgressOverTheBus(t *testing.T) {
seats.mu.Lock()
defer seats.mu.Unlock()
// Each one more than progress asks: the bundle's overview page takes its first view once it is served (ServePage's
// Start, the tracker's list and milestones and mesh-delivery's groups), whether or not it listens.
if seats.asked["seat:issue-tracker.list"] != 4 || seats.asked["seat:mesh-delivery.groups"] != 2 || seats.asked[MilestonesVerb] != 4 {
// Start, the tracker's list and milestones), whether or not it listens; nothing asks groups (design 47 H, H-A-125).
if seats.asked["seat:issue-tracker.list"] != 4 || seats.asked["seat:mesh-delivery.groups"] != 0 || seats.asked[MilestonesVerb] != 4 {
t.Fatalf("asked %v", seats.asked)
}
}
@@ -75,7 +75,7 @@ func newSeatsWorld(t *testing.T) *seatsWorld {
s.rows[n.Number] = r
}
s.milestones = readFixture(t, "tracker-milestones-47.json")
for _, f := range []string{"deliveries.json", "groups.json", "show-car-hunter-2.json"} {
for _, f := range []string{"deliveries.json", "show-car-hunter-2.json"} {
s.files[f] = readFixture(t, f)
}
return s
@@ -126,8 +126,6 @@ func (s *seatsWorld) ask(key string, body any) (json.RawMessage, error) {
"notes-left-out": 96, "links": []map[string]any{{"kind": "depends-on", "target": "1943"}}})
case "seat:mesh-delivery.deliveries":
return s.files["deliveries.json"], nil
case "seat:mesh-delivery.groups":
return s.files["groups.json"], nil
case "seat:mesh-delivery.show":
if a.ID == "jschoubben/car-hunter@cc4c8ce12901" {
return s.files["show-car-hunter-2.json"], nil
@@ -373,6 +371,10 @@ func TestProgressOfADesignMinimalAndDetailed(t *testing.T) {
if len(d.Items) != 1 || d.Items[0].ID != "design 47" {
t.Fatalf("items %+v", d.Items)
}
// The groups went (design 47 H §764, H-A-125): a detailed answer asks none and draws no group line.
if seats.asked["seat:mesh-delivery.groups"] != 0 {
t.Errorf("detailed asked groups %d times", seats.asked["seat:mesh-delivery.groups"])
}
m, err := k.Progress(ProgressAsk{Of: "milestone 47/r6", Detail: DetailDetailed})
if err != nil {
t.Fatal(err)
@@ -471,8 +473,6 @@ func sinceWorld(t *testing.T, changes bool) func(string, any) (json.RawMessage,
}
case "seat:mesh-delivery.deliveries":
return read("deliveries.json"), nil
case "seat:mesh-delivery.groups":
return json.RawMessage(`[]`), nil
case "seat:mesh-delivery.show":
if f, ok := shows[a.ID]; ok {
return read(f), nil
@@ -3,7 +3,7 @@ Captured for the progress verb's tests (novox/hq issue 1947), never written by h
- `hq/`: three designs of hq at the commit in `hq/COMMIT`, copied whole.
- `tracker-rows.json`: rows of `issue-tracker.list` with `numbers`, as the live tracker answered them on
2026-10-26 16:2x (before rows said `moved`).
- `deliveries.json`, `groups.json`, `show-car-hunter-2.json`: parts of `mesh-delivery.deliveries`, `.groups` and
- `deliveries.json`, `show-car-hunter-2.json`: parts of `mesh-delivery.deliveries` and
`.show` as the live delivery seat answered them on 2026-10-26 16:2x, cut to the members named here.
- `tracker-milestones-47.json`: the answer of `issue-tracker.milestones` for design 47 (issue 1781), made by running
the tracker's own table parse (mesh-issues `parseTable`, its seed) over `hq/`'s design 47, each issue two rows name
@@ -1,3 +0,0 @@
[
{"composed": "asked as mesh/check 3fad1982742a", "composed_gate": true, "id": "fix/1945-credential-when-row-without-seal", "members": ["novox/mesh-controller@fbf14b68dbab (held)", "novox/mesh-delivery@61196c99e6a4 (held)"], "state": "held", "why": "a member is held: novox/mesh-controller@fbf14b68dbab (merged without a passing check: only a person decides what follows); novox/mesh-delivery@61196c99e6a4 (merged without a passing check: only a person decides what follows)"}
]
-4
View File
@@ -217,9 +217,6 @@
"mesh-issues.moved",
"mesh-issues.milestone-set",
"mesh-issues.milestone-moved",
"git.pull-merged",
"mesh-delivery-gate.transition",
"mesh-pipeline-runner.group-ended",
"messenger.offered",
"messenger.closed",
"mesh-conditions.findings-asked"
@@ -240,7 +237,6 @@
"seat:issue-tracker.changes",
"seat:mesh-delivery.deliveries",
"seat:mesh-delivery.show",
"seat:mesh-delivery.groups",
"seat:operator-channel.asks",
"seat:mesh-hand-acts.hand-act"
],