C2: a kept call's member names its base branch

So the forge module can say merge-called for what landed after a restart
without reading the forge again, each member of the state calls keeps the
pull request's base, read at judging.

Builds: design 47 H §766; lead answer H-A-71 (2)

Claude-Session: https://claude.ai/code/session_01JG73KHUnBze48rdua8u2sy
This commit is contained in:
2026-11-20 02:51:26 +01:00
parent 5042d9c426
commit d24d6a0890
5 changed files with 14 additions and 3 deletions
@@ -192,6 +192,8 @@ type Call struct {
// CallMember is one member of a kept call.
type CallMember struct {
// the pull request's base, a watched branch, read at judging
Branch string `json:"branch"`
// for merged, the merge commit
Commit string `json:"commit,omitempty"`
Head string `json:"head"`
@@ -41,7 +41,7 @@ func TestFixtures(t *testing.T) {
err := json.Unmarshal(b, &v)
return v, err
}, subjectIs: nil},
{name: "a merge call kept", subject: "", given: "{\"account\":\"tools-shanks\",\"at\":\"2026-11-20T02:00:00Z\",\"by\":\"lead-47@workstation\",\"members\":[{\"commit\":\"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"head\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"number\":178,\"repository\":\"novox/mesh-sdk\",\"state\":\"merged\"},{\"head\":\"cccccccccccccccccccccccccccccccccccccccc\",\"number\":261,\"repository\":\"novox/mesh-delivery\",\"state\":\"judged\"}],\"said\":false}", wire: "{\"account\":\"tools-shanks\",\"at\":\"2026-11-20T02:00:00Z\",\"by\":\"lead-47@workstation\",\"members\":[{\"commit\":\"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"head\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"number\":178,\"repository\":\"novox/mesh-sdk\",\"state\":\"merged\"},{\"head\":\"cccccccccccccccccccccccccccccccccccccccc\",\"number\":261,\"repository\":\"novox/mesh-delivery\",\"state\":\"judged\"}],\"said\":false}",
{name: "a merge call kept", subject: "", given: "{\"account\":\"tools-shanks\",\"at\":\"2026-11-20T02:00:00Z\",\"by\":\"lead-47@workstation\",\"members\":[{\"branch\":\"main\",\"commit\":\"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"head\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"number\":178,\"repository\":\"novox/mesh-sdk\",\"state\":\"merged\"},{\"branch\":\"main\",\"head\":\"cccccccccccccccccccccccccccccccccccccccc\",\"number\":261,\"repository\":\"novox/mesh-delivery\",\"state\":\"judged\"}],\"said\":false}", wire: "{\"account\":\"tools-shanks\",\"at\":\"2026-11-20T02:00:00Z\",\"by\":\"lead-47@workstation\",\"members\":[{\"branch\":\"main\",\"commit\":\"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"head\":\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",\"number\":178,\"repository\":\"novox/mesh-sdk\",\"state\":\"merged\"},{\"branch\":\"main\",\"head\":\"cccccccccccccccccccccccccccccccccccccccc\",\"number\":261,\"repository\":\"novox/mesh-delivery\",\"state\":\"judged\"}],\"said\":false}",
decode: func(b []byte) (any, error) { var v CallsByCallCallValue; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
{name: "pull asks", subject: "", given: "{\"merge-commit\":\"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"repository\":\"novox/mesh-sdk\"}", wire: "{\"merge-commit\":\"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",\"repository\":\"novox/mesh-sdk\"}",
decode: func(b []byte) (any, error) { var v PullInput; err := json.Unmarshal(b, &v); return v, err }, subjectIs: nil},
@@ -29,13 +29,15 @@
"head": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"number": 178,
"repository": "novox/mesh-sdk",
"state": "merged"
"state": "merged",
"branch": "main"
},
{
"head": "cccccccccccccccccccccccccccccccccccccccc",
"number": 261,
"repository": "novox/mesh-delivery",
"state": "judged"
"state": "judged",
"branch": "main"
}
],
"said": false
@@ -1607,6 +1607,10 @@
"number": {
"type": "integer"
},
"branch": {
"type": "string",
"description": "the pull request's base, a watched branch, read at judging"
},
"head": {
"type": "string",
"pattern": "^[0-9a-f]{40}$"
@@ -1632,6 +1636,7 @@
"required": [
"repository",
"number",
"branch",
"head",
"state"
]
@@ -90,6 +90,8 @@ export interface Call {
/** one member of a kept call */
export interface CallMember {
/** the pull request's base, a watched branch, read at judging */
"branch": string;
/** for merged, the merge commit */
"commit"?: string;
"head": string;