gitea: a member whose base is no watched branch is merged plainly with the note, not refused

G1b unwatched-base-merged: judgeMember marks a member plain when its base is no
watched branch, whatever its repository; the note's words are the one constant
for both cases (DQ-49); the refusal row leaves the table and a row is added.

Builds: design 47 H2 H-A-704, H-A-717 (DQ-49)
This commit is contained in:
2026-11-25 17:05:52 +01:00
parent f282a74e59
commit ce04011f96
4 changed files with 30 additions and 29 deletions
+1 -1
View File
@@ -79,7 +79,7 @@ export type Say = (subject: string, body: unknown, id?: string) => Promise<void>
/** The merge-called of a kept call (design 47 H §736, §767): its landed members, each with its base and merge commit, and its
* refused ones; undefined for a call that landed no member, which says none. A member merged plainly, carrying the note
* no delivery (its repository has no watched branch), starts no delivery and is left out, by the kept note (H2 H-A-471). */
* no delivery (its base is no watched branch), starts no delivery and is left out, by the kept note (H2 H-A-471). */
export function mergeCalledOf(c: KeptCall): MergeCalledEvent | undefined {
const landed = c.members.filter((m) => m.state === "merged" && m.commit && !m.note);
if (landed.length === 0) return undefined;
+12 -12
View File
@@ -5,11 +5,11 @@
// `already-merged` with its commit), and no run at the head's build-input fingerprint failed a `required` step (the
// module's own `failed-steps`). No branch protection is judged (ADR 0682 §13). When one member is refused, none is merged
// and the answer names every refused member and why; else the members are merged in the order the call names them. The
// verb answers once, at the call's end: `call` and each member's outcome. A member whose repository has no watched branch
// (no entry, or an empty set, in the registrations' watched branches) is the forge's business alone (H2 H-A-471 and its
// addendum): judged against nothing of the module graph, merged plainly in the order named, answered and kept merged with
// the note no delivery, and left out of merge-called, so it starts no delivery. A watched repository whose base is no
// watched branch stays refused. A member is merged plainly only from a view of the watched branches read since the last
// verb answers once, at the call's end: `call` and each member's outcome. A member whose base is no watched branch,
// whatever its repository (no entry, or an empty set, in the registrations' watched branches, or a set that does not
// hold the base), is the forge's business alone (H2 H-A-471 and its addendum, H-A-704): judged against nothing of the
// module graph, merged plainly in the order named, answered and kept merged with the note no delivery, and left out of
// merge-called, so it starts no delivery. A member is merged plainly only from a view of the watched branches read since the last
// registration-changed heard (the second addendum): while the view is unread or stale, every member is refused, never
// merged with the note.
@@ -57,14 +57,14 @@ export interface Member {
state: MemberOutcome["state"];
commit?: string;
why?: string;
/** Set on a member merged plainly, its repository having no watched branch (H-A-471). */
/** Set on a member merged plainly, its base being no watched branch (H-A-471, H-A-704). */
note?: string;
/** Its repository has no watched branch: judged against nothing of the module graph (H-A-471). */
/** Its base is no watched branch: judged against nothing of the module graph (H-A-471, H-A-704). */
plain?: boolean;
}
/** The note of a member merged plainly: it starts no delivery (H-A-471). */
export const NO_DELIVERY = "no delivery: the repository has no watched branch";
/** The note of a member merged plainly: it starts no delivery (H-A-471, H-A-704; its words H-A-717, DQ-49). */
export const NO_DELIVERY = "no delivery: its base is no watched branch";
/** Why every member is refused while the watched branches are unread or stale (H-A-471, second addendum). */
export const NOT_READ = "the watched branches are not read yet";
@@ -107,12 +107,12 @@ async function judgeMember(forge: CallForge, deps: CallDeps, watched: ReadonlyMa
return `head-moved: its head is ${String(pull.head_sha).slice(0, 12)}, not the ${m.head.slice(0, 12)} the caller names`;
}
const branches = watched.get(m.repository);
// A repository of no module: no build-input fingerprint and no required step judge it (H-A-471).
if (!branches || branches.size === 0) {
// A base no registration watches, whatever the repository: no build-input fingerprint and no required step judge it
// (H-A-471, H-A-704).
if (!branches || !branches.has(m.branch)) {
m.plain = true;
return "";
}
if (!branches.has(m.branch)) return `its base ${m.branch} is no watched branch`;
const failed = await deps.judge(m.head);
if (failed) {
return `the ${failed.step} step of ${failed.module} failed in run ${failed.run} at its build-input fingerprint ${failed.fingerprint}`;
+2 -2
View File
@@ -91,9 +91,9 @@ test("a call says one merge-called of what landed; none for a call that landed n
assert.deepEqual(said.map((s) => s.body.members.map((x: any) => x.number)), [[1, 2]]);
assert.equal(said[0].body.refused, undefined, "a member not merged after a stop is no refused member");
assert.deepEqual(await sayUnsaid(calls, say), [], "said once");
// A member merged plainly, its repository having no watched branch, starts no delivery: the start's re-say leaves it
// A member merged plainly, its base being no watched branch, starts no delivery: the start's re-say leaves it
// out by the kept note (design 47 H2 H-A-471 addendum (2)), and a call of such members alone says none.
const noted = { ...m(4, "merged"), repository: "novox/hq", note: "no delivery: the repository has no watched branch" };
const noted = { ...m(4, "merged"), repository: "novox/hq", note: "no delivery: its base is no watched branch" };
await calls.put("00000000000000dd", { by: "lead@shanks", account: "x", at: "2026-11-20T03:02:00Z", members: [noted, m(5, "merged")], said: false } as any);
await calls.put("00000000000000ee", { by: "lead@shanks", account: "x", at: "2026-11-20T03:03:00Z", members: [noted], said: false } as any);
said.length = 0;
+15 -14
View File
@@ -66,7 +66,6 @@ test("a member refused at judging merges none and names every refused member and
{ name: "the second member's head moved", set: (p) => { p["novox/lib#9"].head = MOVED; }, why: /head-moved: its head is cccccccccccc, not the bbbbbbbbbbbb/ },
{ name: "already merged", set: (p) => { Object.assign(p["novox/lib#9"], { merged: true, merge: "e".repeat(40) }); }, why: /already-merged: .* as e{40}/ },
{ name: "closed", set: (p) => { p["novox/lib#9"].state = "closed"; }, why: /is closed/ },
{ name: "a base no registration watches", set: (p) => { p["novox/lib#9"].base = "feat/x"; }, why: /its base feat\/x is no watched branch/ },
{ name: "a required step failed at its head's fingerprint",
set: () => {}, over: { judge: async (h: string) => (h === B ? { run: "main.7", module: "lib", step: "unit", fingerprint: "fp" } : null) },
why: /the unit step of lib failed in run main\.7 at its build-input fingerprint fp/ },
@@ -83,20 +82,22 @@ test("a member refused at judging merges none and names every refused member and
}
});
// **A repository of no module is merged plainly** (design 47 H2 H-A-471 and its addendum): a member whose repository has
// no watched branch (no entry, or an empty set, in the registrations' watched branches) is judged against nothing of the
// **A base no registration watches is merged plainly** (design 47 H2 H-A-471 and its addendum, H-A-704): a member whose base
// is no watched branch, whatever its repository (no entry, an empty set, or a set that does not hold the base, in the
// registrations' watched branches), is judged against nothing of the
// module graph (no failed required step), merged in the order named, answered merged with the note no delivery, and left
// out of merge-called; the watched members of the same call are judged and delivered as any call's. A watched
// repository whose base is unwatched stays refused (the row above).
test("a member of a repository with no watched branch is merged plainly, noted no delivery, and left out of merge-called", async () => {
const NOTE = "no delivery: the repository has no watched branch";
const rows: { name: string; watched: Map<string, Set<string>> }[] = [
{ name: "no entry", watched: new Map([["novox/app", new Set(["main"])]]) },
{ name: "an empty set", watched: new Map([["novox/app", new Set(["main"])], ["novox/hq", new Set<string>()]]) },
// out of merge-called; the watched members of the same call are judged and delivered as any call's.
test("a member whose base is no watched branch is merged plainly, noted no delivery, and left out of merge-called", async () => {
const NOTE = "no delivery: its base is no watched branch";
const rows: { name: string; base: string; watched: Map<string, Set<string>> }[] = [
{ name: "no entry", base: "main", watched: new Map([["novox/app", new Set(["main"])]]) },
{ name: "an empty set", base: "main", watched: new Map([["novox/app", new Set(["main"])], ["novox/hq", new Set<string>()]]) },
{ name: "a watched repository's pull request into a branch it does not watch", base: "feat/x",
watched: new Map([["novox/app", new Set(["main"])], ["novox/hq", new Set(["main"])]]) },
];
for (const r of rows) {
const pulls = open();
pulls["novox/hq#799"] = { base: "main", head: B, state: "open", merged: false };
pulls["novox/hq#799"] = { base: r.base, head: B, state: "open", merged: false };
const f = forge(pulls);
const judged: string[] = [];
const said: any[] = [];
@@ -109,7 +110,7 @@ test("a member of a repository with no watched branch is merged plainly, noted n
assert.equal(got.members[0].state, "judged", r.name);
assert.equal(got.members[1].state, "refused", r.name);
// Without the failed step the call lands both: the unwatched noted, merge-called naming only the watched.
const f2 = forge(Object.assign(open(), { "novox/hq#799": { base: "main", head: B, state: "open", merged: false } }));
const f2 = forge(Object.assign(open(), { "novox/hq#799": { base: r.base, head: B, state: "open", merged: false } }));
said.length = 0;
const landed = await call(f2, mixed, { watched: () => r.watched, say: async (_s: string, body: unknown) => { said.push(body); } });
assert.deepEqual(f2.merges, ["novox/hq#799", "novox/app#5"], `${r.name}: merged in the order named`);
@@ -117,7 +118,7 @@ test("a member of a repository with no watched branch is merged plainly, noted n
[["novox/hq", "merged", NOTE, undefined], ["novox/app", "merged", undefined, undefined]], r.name);
assert.deepEqual(said.map((b) => b.members.map((m: any) => m.repository)), [["novox/app"]], `${r.name}: merge-called leaves it out`);
// A call of unwatched members alone merges and starts no delivery: no merge-called.
const f3 = forge({ "novox/hq#799": { base: "main", head: B, state: "open", merged: false } });
const f3 = forge({ "novox/hq#799": { base: r.base, head: B, state: "open", merged: false } });
said.length = 0;
const alone = await call(f3, { by: "lead@shanks", pulls: [mixed.pulls[0]] }, { watched: () => r.watched,
say: async (_s: string, body: unknown) => { said.push(body); } });
@@ -170,7 +171,7 @@ test("a member is merged plainly only from a watched-branches view read since th
const f3 = forge(pulls());
const landed = await call(f3, hq, { watched: view });
assert.deepEqual([f3.merges, landed.members.map((m: any) => [m.state, m.note])],
[["novox/hq#799", "novox/app#5"], [["merged", "no delivery: the repository has no watched branch"], ["merged", undefined]]]);
[["novox/hq#799", "novox/app#5"], [["merged", "no delivery: its base is no watched branch"], ["merged", undefined]]]);
});
test("a call is refused whole with no proved caller, no by, no registration or no pull request", async () => {