From f79c0a7b784ceea9438af676b9fcda8a808b1011 Mon Sep 17 00:00:00 2001 From: jochen Date: Fri, 20 Nov 2026 03:39:29 +0100 Subject: [PATCH] C3b: the seat mesh-delivery's owed acts name no merge MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .../clients/meshdeliveryclient/client_test.go | 22 +++++++++++++++++++ .../go/seats/meshdelivery/contract.go | 3 +-- .../go/seats/meshdelivery/contract_test.go | 2 -- .../seats/mesh-delivery/fixtures/events.json | 15 ------------- .../seats/mesh-delivery/seat.json | 3 +-- .../ts/seats/meshdelivery/index.d.ts | 4 ++-- .../mesh-delivery-forge-bridge/gate_test.go | 4 +--- .../internal/bridge/owed_test.go | 3 +-- 8 files changed, 28 insertions(+), 28 deletions(-) diff --git a/modules/mesh-delivery-contracts/go/clients/meshdeliveryclient/client_test.go b/modules/mesh-delivery-contracts/go/clients/meshdeliveryclient/client_test.go index a8f0e9e1..4086eefe 100644 --- a/modules/mesh-delivery-contracts/go/clients/meshdeliveryclient/client_test.go +++ b/modules/mesh-delivery-contracts/go/clients/meshdeliveryclient/client_test.go @@ -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) + } } diff --git a/modules/mesh-delivery-contracts/go/seats/meshdelivery/contract.go b/modules/mesh-delivery-contracts/go/seats/meshdelivery/contract.go index bd4badad..d393057a 100644 --- a/modules/mesh-delivery-contracts/go/seats/meshdelivery/contract.go +++ b/modules/mesh-delivery-contracts/go/seats/meshdelivery/contract.go @@ -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" diff --git a/modules/mesh-delivery-contracts/go/seats/meshdelivery/contract_test.go b/modules/mesh-delivery-contracts/go/seats/meshdelivery/contract_test.go index 364734a0..ecf2ddf3 100644 --- a/modules/mesh-delivery-contracts/go/seats/meshdelivery/contract_test.go +++ b/modules/mesh-delivery-contracts/go/seats/meshdelivery/contract_test.go @@ -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}", diff --git a/modules/mesh-delivery-contracts/seats/mesh-delivery/fixtures/events.json b/modules/mesh-delivery-contracts/seats/mesh-delivery/fixtures/events.json index 03bf11b8..1488efd3 100644 --- a/modules/mesh-delivery-contracts/seats/mesh-delivery/fixtures/events.json +++ b/modules/mesh-delivery-contracts/seats/mesh-delivery/fixtures/events.json @@ -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", diff --git a/modules/mesh-delivery-contracts/seats/mesh-delivery/seat.json b/modules/mesh-delivery-contracts/seats/mesh-delivery/seat.json index 5546f304..744014a5 100644 --- a/modules/mesh-delivery-contracts/seats/mesh-delivery/seat.json +++ b/modules/mesh-delivery-contracts/seats/mesh-delivery/seat.json @@ -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", diff --git a/modules/mesh-delivery-contracts/ts/seats/meshdelivery/index.d.ts b/modules/mesh-delivery-contracts/ts/seats/meshdelivery/index.d.ts index 11e963b8..6131f639 100644 --- a/modules/mesh-delivery-contracts/ts/seats/meshdelivery/index.d.ts +++ b/modules/mesh-delivery-contracts/ts/seats/meshdelivery/index.d.ts @@ -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 */ diff --git a/modules/mesh-delivery-forge-bridge/cmd/mesh-delivery-forge-bridge/gate_test.go b/modules/mesh-delivery-forge-bridge/cmd/mesh-delivery-forge-bridge/gate_test.go index db0c6332..4b6c5c89 100644 --- a/modules/mesh-delivery-forge-bridge/cmd/mesh-delivery-forge-bridge/gate_test.go +++ b/modules/mesh-delivery-forge-bridge/cmd/mesh-delivery-forge-bridge/gate_test.go @@ -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"), diff --git a/modules/mesh-delivery-forge-bridge/internal/bridge/owed_test.go b/modules/mesh-delivery-forge-bridge/internal/bridge/owed_test.go index 50fd163d..e59b80e5 100644 --- a/modules/mesh-delivery-forge-bridge/internal/bridge/owed_test.go +++ b/modules/mesh-delivery-forge-bridge/internal/bridge/owed_test.go @@ -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"},