C3b: the seat mesh-delivery's owed acts name no merge

The bridge performs no merge since the merge call (design 47 H §764), so the owed act merge
(OwedActMerge) leaves the seat's definition, its fixture and the generated contracts; the
bridge's tests no longer read a merge fixture to refuse. A row of the client's test reads the
definition's act enum and fails while merge is in it.

Builds: design 47 H §764 (the forge bridge: the merge act of a switched key); lead answer H-A-91 (3)

Claude-Session: https://claude.ai/code/session_01JG73KHUnBze48rdua8u2sy
This commit is contained in:
2026-11-20 03:39:29 +01:00
parent 9fe6330d79
commit f79c0a7b78
8 changed files with 28 additions and 28 deletions
@@ -1,6 +1,9 @@
package meshdeliveryclient
import (
"encoding/json"
"os"
"reflect"
"strings"
"testing"
@@ -85,4 +88,23 @@ func TestTheAsksAndOwedActsKeepTheirFormsAndRules(t *testing.T) {
t.Errorf("%s: CheckOwed = %v, want %q", name, err, c.says)
}
}
// Design 47 H §764 (the forge bridge: the merge act of a switched key), H-A-91 (3): the seat's owed acts name no merge.
raw, err := os.ReadFile("../../../seats/mesh-delivery/seat.json")
if err != nil {
t.Fatal(err)
}
var def struct {
Defs map[string]struct {
Properties map[string]struct {
Enum []string `json:"enum"`
} `json:"properties"`
} `json:"defs"`
}
if err := json.Unmarshal(raw, &def); err != nil {
t.Fatal(err)
}
if acts, want := def.Defs["Owed"].Properties["act"].Enum, []string{"status", "view", "comment", "note"}; !reflect.DeepEqual(acts, want) {
t.Errorf("the owed acts are %v, want %v", acts, want)
}
}
@@ -230,7 +230,7 @@ type Fill struct {
// Owed is one act the gate owes the forge, said once under its id and safe to repeat at the forge (design 47 *What the gate owes the forge*); the forge bridge performs it through the seat git's verb of the same act.
type Owed struct {
// the act: merge (the seat git's merge-pull), status, view, comment or note
// the act: status, view, comment or note
Act string `json:"act"`
// the operator's ask that approved the heads, for a merge
Ask string `json:"ask,omitempty"`
@@ -264,7 +264,6 @@ type Owed struct {
// The values of Owed's act.
const (
OwedActMerge = "merge"
OwedActStatus = "status"
OwedActView = "view"
OwedActComment = "comment"
@@ -17,8 +17,6 @@ func TestFixtures(t *testing.T) {
decode func([]byte) (any, error)
subjectIs *regexp.Regexp
}{
{name: "owed is said, a merge", subject: "mesh.seat.mesh-delivery.event.owed.novox/mesh-sdk.178", given: "{\"act\":\"merge\",\"ask\":\"merge.feat=47-G.0123456789ab\",\"group\":\"feat/47-G\",\"head\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"id\":\"merge.feat=47-G.0123456789ab.novox/mesh-sdk#178\",\"number\":178,\"repository\":\"novox/mesh-sdk\",\"said\":\"2026-11-09T20:00:00Z\"}", wire: "{\"act\":\"merge\",\"ask\":\"merge.feat=47-G.0123456789ab\",\"group\":\"feat/47-G\",\"head\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"id\":\"merge.feat=47-G.0123456789ab.novox/mesh-sdk#178\",\"number\":178,\"repository\":\"novox/mesh-sdk\",\"said\":\"2026-11-09T20:00:00Z\"}",
decode: func(b []byte) (any, error) { var v OwedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-delivery\\.event\\.owed\\.[^.*> ]+\\.[^.*> ]+$")},
{name: "owed is said, a status", subject: "mesh.seat.mesh-delivery.event.owed.novox/mesh-sdk.178", given: "{\"act\":\"status\",\"context\":\"mesh/merge-gate\",\"description\":\"waits for the operator's Approve\",\"head\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"id\":\"status.novox/mesh-sdk#178.aaaaaaaaaaaa.mesh/merge-gate\",\"number\":178,\"repository\":\"novox/mesh-sdk\",\"state\":\"pending\",\"target\":\"https://forge.test/x\"}", wire: "{\"act\":\"status\",\"context\":\"mesh/merge-gate\",\"description\":\"waits for the operator's Approve\",\"head\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"id\":\"status.novox/mesh-sdk#178.aaaaaaaaaaaa.mesh/merge-gate\",\"number\":178,\"repository\":\"novox/mesh-sdk\",\"state\":\"pending\",\"target\":\"https://forge.test/x\"}",
decode: func(b []byte) (any, error) { var v OwedEvent; err := json.Unmarshal(b, &v); return v, err }, subjectIs: regexp.MustCompile("^mesh\\.seat\\.mesh-delivery\\.event\\.owed\\.[^.*> ]+\\.[^.*> ]+$")},
{name: "record-opened is said", subject: "mesh.seat.mesh-delivery.event.record-opened.0123456789abcdef", given: "{\"at\":\"2026-11-20T02:00:00Z\",\"branch\":\"main\",\"call\":\"0123456789abcdef\",\"milestone\":\"main.1044\",\"record\":\"main.1044\",\"source\":1044}", wire: "{\"at\":\"2026-11-20T02:00:00Z\",\"branch\":\"main\",\"call\":\"0123456789abcdef\",\"milestone\":\"main.1044\",\"record\":\"main.1044\",\"source\":1044}",
@@ -1,19 +1,4 @@
[
{
"name": "owed is said, a merge",
"of": "event:owed",
"subject": "mesh.seat.mesh-delivery.event.owed.novox/mesh-sdk.178",
"given": {
"id": "merge.feat=47-G.0123456789ab.novox/mesh-sdk#178",
"act": "merge",
"repository": "novox/mesh-sdk",
"number": 178,
"head": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"group": "feat/47-G",
"ask": "merge.feat=47-G.0123456789ab",
"said": "2026-11-09T20:00:00Z"
}
},
{
"name": "owed is said, a status",
"of": "event:owed",
@@ -553,13 +553,12 @@
"act": {
"type": "string",
"enum": [
"merge",
"status",
"view",
"comment",
"note"
],
"description": "the act: merge (the seat git's merge-pull), status, view, comment or note"
"description": "the act: status, view, comment or note"
},
"repository": {
"type": "string",
@@ -90,8 +90,8 @@ export interface Fill {
/** one act the gate owes the forge, said once under its id and safe to repeat at the forge (design 47 *What the gate owes the forge*); the forge bridge performs it through the seat git's verb of the same act */
export interface Owed {
/** the act: merge (the seat git's merge-pull), status, view, comment or note */
"act": "merge" | "status" | "view" | "comment" | "note";
/** the act: status, view, comment or note */
"act": "status" | "view" | "comment" | "note";
/** the operator's ask that approved the heads, for a merge */
"ask"?: string;
/** the commit a status or a note line is on; the head when absent */
@@ -59,8 +59,7 @@ func newOwing(f *seatFake) (*owing, *fakePub, memPerformed) {
}
// Design 47 *What the gate owes the forge*: an owed act is the seat git's verb under its id, its outcome said as
// owed.ended on the stream forge before it is kept in performed, an act it cannot read said undecodable (a merge among
// them: the bridge performs no merge, design 47 H §764).
// owed.ended on the stream forge before it is kept in performed, an act it cannot read said undecodable.
func TestWhatIsOwedIsPerformedSaidAndKept(t *testing.T) {
t.Run("the names are the manifest's", theNamesAreTheManifests)
t.Run("performed is opened by its binding", performedIsOpenedByItsBinding)
@@ -82,7 +81,6 @@ func TestWhatIsOwedIsPerformedSaidAndKept(t *testing.T) {
map[string]json.RawMessage{"seat:git.status": answer("status", "status answers an error, never none")}, nil,
"seat:git.status", forgemsg.OwedRefused, true, ""},
{"a status not answered", seat.Seat, gate("owed is said, a status"), nil, nil, "seat:git.status", forgemsg.OwedCouldNotBePerformed, true, ""},
{"a merge, which the bridge does not perform", seat.Seat, gate("owed is said, a merge"), nil, nil, "", forgemsg.OwedUndecodable, true, ""},
{"an act it cannot read", seat.Seat, []byte(`{`), nil, nil, "", forgemsg.OwedUndecodable, false, ""},
{"a seat that says no owed act", "mesh-delivery-checker", gate("owed is said, a status"), nil, nil, "", forgemsg.OwedUndecodable, false, ""},
{"the stream forge refusing the outcome", seat.Seat, gate("owed is said, a status"), statusOK, errors.New("no responders"),
@@ -37,7 +37,6 @@ func TestAnOwedEventIsTheSeatGitsVerbAndItsAnswerOneOutcome(t *testing.T) {
input any
bad string
}{
{"a merge, which the bridge no longer performs (design 47 H §764)", GateOwed, gate("owed is said, a merge"), "", nil, "none the seat git"},
{"a status on the head", GateOwed, gate("owed is said, a status"), "status", git.StatusInput{ID: "status.novox/mesh-sdk#178.aaaaaaaaaaaa.mesh/merge-gate",
Repository: "novox/mesh-sdk", Commit: a40, Context: "mesh/merge-gate", State: "pending", Description: "waits for the operator's Approve", Target: "https://forge.test/x"}, ""},
{"a view", GateOwed, edit(edit(gate("owed is said, a status"), "act", "view"), "text", "the view"), "view",
@@ -47,7 +46,7 @@ func TestAnOwedEventIsTheSeatGitsVerbAndItsAnswerOneOutcome(t *testing.T) {
{"a note line on its commit", GateOwed, edit(edit(edit(gate("owed is said, a status"), "act", "note"), "line", "a line"), "commit", strings.Repeat("c", 40)), "note",
git.NoteInput{ID: "status.novox/mesh-sdk#178.aaaaaaaaaaaa.mesh/merge-gate", Repository: "novox/mesh-sdk", Commit: strings.Repeat("c", 40), Line: "a line"}, ""},
{"not json", GateOwed, []byte("{"), "", nil, "not json"},
{"no id", GateOwed, edit(gate("owed is said, a merge"), "id", nil), "", nil, "no id"},
{"no id", GateOwed, edit(gate("owed is said, a status"), "id", nil), "", nil, "no id"},
{"a short head", GateOwed, edit(gate("owed is said, a status"), "head", "abc"), "", nil, "40 hex"},
{"a comment on no pull request", GateOwed, edit(edit(gate("owed is said, a status"), "act", "comment"), "number", 0), "", nil, "no pull request"},
{"an act of no kind", GateOwed, edit(gate("owed is said, a status"), "act", "label"), "", nil, "none the seat git"},