A-287, A-288: gitea announces every state its manifest declares; its refusal test holds the meaning
KEPT gains failed-steps, idle and transfers, so each declared state can be read by its tools; the force-push refusal's test holds that the refusal names the one tool that may do it and that it runs on the operator's Approve of that call. Builds: design 47 G A-287, A-288 Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h
This commit is contained in:
@@ -1,13 +1,17 @@
|
||||
// The states this module keeps on the bus and whether other modules may read them (novox/hq ADR 0495 clause 2; issue
|
||||
// 1790): the module says it itself, from its code, as it starts (index.ts calls keeps with this list), and a reader is
|
||||
// granted what it said (clause 3). A state is readable when another module's manifest reads it: mesh-provisioner reads
|
||||
// `bound` (the forge accounts it binds), the condition keeper (mesh-conditions) reads `findings`. test/kept.test.ts holds the list to the manifest's `state`, and the catalogue's
|
||||
// `bound` (the forge accounts it binds), the condition keeper (mesh-conditions) reads `findings`. Every state the manifest
|
||||
// declares is named, so each can be read by its tools (design 47 G A-287). test/kept.test.ts holds the list to the manifest's `state`, and the catalogue's
|
||||
// checks/readable every state another manifest reads to a readable announcement.
|
||||
export const KEPT: readonly { readonly name: string; readonly readable?: boolean }[] = [
|
||||
{ name: "announced" },
|
||||
{ name: "bound", readable: true },
|
||||
{ name: "findings", readable: true },
|
||||
{ name: "failed-steps" },
|
||||
{ name: "first-views" },
|
||||
{ name: "idle" },
|
||||
{ name: "transfers" },
|
||||
];
|
||||
|
||||
/** The announcement of these states, in the layout mesh-sdk's go/announce reads (novox/hq ADR 0495 clause 2): version 1,
|
||||
|
||||
@@ -16,8 +16,8 @@ test("the states the module announces are the states its manifest declares", asy
|
||||
|
||||
test("the announcement has the layout mesh-sdk's go/announce reads: version 1, the module, the node, the states sorted by name", async () => {
|
||||
const { statesAnnouncement } = await import("../kept.ts");
|
||||
assert.deepEqual(statesAnnouncement("gitea", "ace"), { v: 1, module: "gitea", node: "ace", states: [{ name: "announced" }, { name: "bound", readable: true }, { name: "findings", readable: true }, { name: "first-views" }] });
|
||||
assert.deepEqual(statesAnnouncement("gitea", undefined), { v: 1, module: "gitea", states: [{ name: "announced" }, { name: "bound", readable: true }, { name: "findings", readable: true }, { name: "first-views" }] });
|
||||
assert.deepEqual(statesAnnouncement("gitea", "ace"), { v: 1, module: "gitea", node: "ace", states: [{ name: "announced" }, { name: "bound", readable: true }, { name: "failed-steps" }, { name: "findings", readable: true }, { name: "first-views" }, { name: "idle" }, { name: "transfers" }] });
|
||||
assert.deepEqual(statesAnnouncement("gitea", undefined), { v: 1, module: "gitea", states: [{ name: "announced" }, { name: "bound", readable: true }, { name: "failed-steps" }, { name: "findings", readable: true }, { name: "first-views" }, { name: "idle" }, { name: "transfers" }] });
|
||||
});
|
||||
|
||||
test("index.ts says the announcement as the event `states` before the tools are served", () => {
|
||||
|
||||
@@ -246,14 +246,13 @@ test("C: allow_merge_update, default_update_style and has_code are taken; projec
|
||||
});
|
||||
|
||||
// The operator, 2026-10-28 16:4x: a call waits for their Approve only if it removes branch protection or allows a
|
||||
// force-push to main. No tool of this module can ask yet (no TypeScript asker; ADR 0286's mark is unbuilt in the
|
||||
// runner), so until one can, such a call is refused, with nothing sent, and says it is the operator's; everything else
|
||||
// runs at once.
|
||||
// force-push to main. Such a call of this tool is refused, with nothing sent, and names the one tool that may do it and
|
||||
// that it runs on the operator's Approve of that call (design 47 G A-288); everything else runs at once.
|
||||
test("a force-push onto a rule covering main is refused, nothing sent; on another branch, and tightening, it runs", async () => {
|
||||
for (const args of [{ enable_force_push: true }, { enable_force_push: true, enable_force_push_allowlist: true },
|
||||
{ force_push_allowlist_usernames: ["jschoubben"] }, { force_push_allowlist_teams: ["owners"] },
|
||||
{ branch: "ma*", enable_force_push: true }, { branch: "**", force_push_allowlist_usernames: ["x"] }]) {
|
||||
await assert.rejects(setFull(args), /force-push to a trunk is the operator's/, JSON.stringify(args));
|
||||
await assert.rejects(setFull(args), /gitea_branch_protection_loosen's alone, which runs on the operator's Approve of that one call/, JSON.stringify(args));
|
||||
}
|
||||
assert.deepEqual(sent, []);
|
||||
await setFull({ branch: "release/*", enable_force_push: true });
|
||||
|
||||
Reference in New Issue
Block a user