mesh-issues: import hq's issue folders at their own numbers, and an issue with a folder is whole in the tracker (hq ADR 0275, to-be 53 slice 3)
mesh/merge-gate pass: builds mesh-issues → novox; no bus step; every machine composes with the change as it did without (4 of 4 compose)
mesh/repo-check pass: its merge-check.sh passed, each part in its toolchain: merge-check.sh (go), merge-check-typescript.sh (typescript)
mesh/delivery delivered

This commit is contained in:
jochen
2026-10-10 16:00:19 +02:00
parent 1fcf46fbfc
commit d05308a419
19 changed files with 2243 additions and 49 deletions
+6 -22
View File
@@ -26,6 +26,8 @@ type Tracker struct {
Logf func(format string, a ...any)
// Sleep waits between rounds of a counter that other openers keep winning.
Sleep func(time.Duration)
// Records is the record the import reads; nil is the records module over the bus.
Records Records
}
// The events this module says, one per kind of change.
@@ -119,16 +121,9 @@ func (t *Tracker) Open(a OpenAsk) (*Opened, error) {
if record, err = checkSlug(a.Record); err != nil {
return nil, err
}
if len(located) > 0 {
return nil, errors.New("an issue with a folder in hq keeps located-in in that folder's report until " +
"the import: open it without located-in, or without record")
}
}
at := t.now()
is := Issue{Title: title, Report: report, Opened: at, OpenedBy: t.by(), LocatedIn: located, Opening: newID()}
if record == "" {
is.Status = StatusOpen
}
is := Issue{Title: title, Status: StatusOpen, Report: report, Opened: at, OpenedBy: t.by(), LocatedIn: located, Opening: newID()}
n, err := t.next()
if err != nil {
@@ -144,7 +139,7 @@ func (t *Tracker) Open(a OpenAsk) (*Opened, error) {
out := &Opened{Number: n, Title: title, Status: is.Status, LocatedIn: located, Record: is.Record, By: is.OpenedBy}
out.Said = fmt.Sprintf("Opened issue %d: %s.", n, title)
if is.Record != "" {
out.Said += fmt.Sprintf(" Its narrative goes in hq's %s/00-report.md, which keeps its status.", is.Record)
out.Said += fmt.Sprintf(" Its narrative goes in hq's %s/00-report.md; its status stays here.", is.Record)
}
out.Announced, out.Warning = t.emit(EventOpened, map[string]any{
"number": n, "title": title, "status": is.Status, "located-in": located, "record": is.Record,
@@ -377,10 +372,6 @@ func (t *Tracker) Move(a MoveAsk) (*Moved, error) {
var changed []string
is, err := t.change(a.Number, func(is *Issue) error {
changed = nil
if is.Record != "" {
return fmt.Errorf("issue %d keeps its status in its folder %s until the import of slice 3 has run: "+
"change it there. The tracker holds its number, title, notes and links", is.Number, is.Record)
}
from = is.Status
if from == to {
return fmt.Errorf("issue %d is already %s", is.Number, to)
@@ -391,7 +382,7 @@ func (t *Tracker) Move(a MoveAsk) (*Moved, error) {
changed = append(changed, name)
}
}
set("located-in", located != nil, func() { is.LocatedIn = located })
set("located-in", located != nil, func() { is.LocatedIn, is.LocatedInUnverified = located, nil })
set("fixed-by", fixed != nil, func() { is.FixedBy = fixed })
set("amended-design", designs != nil, func() { is.AmendedDesign = designs })
set("replay", replay != "", func() { is.Replay, is.ReplayNone = replay, "" })
@@ -591,9 +582,6 @@ type Listed struct {
Said string `json:"said"`
}
// InFolder is the status a list shows for an issue whose folder in hq keeps its status.
const InFolder = "kept in its folder"
// List is the issues that match, newest first.
func (t *Tracker) List(a ListAsk) (*Listed, error) {
status := strings.TrimSpace(a.Status)
@@ -649,11 +637,7 @@ func (t *Tracker) List(a ListAsk) (*Listed, error) {
}
out.Matched++
if len(out.Rows) < limit {
st := is.Status
if is.Record != "" {
st = InFolder
}
out.Rows = append(out.Rows, Row{Number: n, Status: st, Owner: strings.Join(is.LocatedIn, "; "), Title: is.Title})
out.Rows = append(out.Rows, Row{Number: n, Status: is.Status, Owner: strings.Join(is.LocatedIn, "; "), Title: is.Title})
}
}
switch {