mesh-knowledge: clear a never-reviewed notice once the record moves on, key it by version and run of tries, say times locally (review of #219)
mesh/merge-gate pass: builds mesh-knowledge → 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 superseded: a newer head of the same pull request

A notice left open kept telling the operator a record was proposed and not in force after it was proposed again
or accepted, and a later version's notice merged into it.
This commit is contained in:
2026-10-11 19:36:14 +02:00
parent 9cfb5f9edb
commit d45761678a
8 changed files with 231 additions and 14 deletions
@@ -87,6 +87,7 @@ func newKB(store Store) *KB {
Judge: busJudgement(os.Getenv("MESH_NODE")),
Asks: sdkAskBus{},
Notify: busNotifier,
Clear: busClearer,
Emit: func(event string, body any) error { return stdio.Emit(event, body) },
Settings: func() (Settings, error) { return readSettings(file) },
Logf: logf,
@@ -230,6 +231,14 @@ func busNotifier(key, summary, headline, explanation string) error {
return err
}
// busClearer tells the operator's channel that what it was told under key is over: the message is edited to say
// resolved (novox/hq issue 497).
func busClearer(key, resolved string) error {
_, err := stdio.Ask("seat:operator-channel.notify", map[string]any{"key": key, "subject": "the knowledge base",
"clear": true, "resolved": resolved})
return err
}
// ---- the store, opened when it is first needed ------------------------------------------------------------
// lazyStore opens the database on the first call, and again after a failure, so a database that arrives late is
@@ -329,6 +338,20 @@ func (l *lazyStore) Told(ctx context.Context, topic string) (bool, error) {
}
return s.Told(ctx, topic)
}
func (l *lazyStore) ToldOf(ctx context.Context, prefix string) ([]string, error) {
s, err := l.store(ctx)
if err != nil {
return nil, err
}
return s.ToldOf(ctx, prefix)
}
func (l *lazyStore) Untold(ctx context.Context, key string) error {
s, err := l.store(ctx)
if err != nil {
return err
}
return s.Untold(ctx, key)
}
// ---- prepare, check, dry-run --------------------------------------------------------------------------------