gitea, mesh-issues: no timer said for main's rules; the checker is no owner

Review round 1, notes: keep-main-rules acts at the token's mint alone since the
ten-minute step went (H-A-100), and the issue tracker's owners named the
checker's path, which a search for the checker must not find (§764).

Builds: design 47 H §764 (the forge module's ten-minute timer; the checker whole); H-A-100

Claude-Session: https://claude.ai/code/session_01JG73KHUnBze48rdua8u2sy
This commit is contained in:
2026-11-20 06:06:57 +01:00
parent df79ab8769
commit c775aab29a
7 changed files with 25 additions and 9 deletions
+2 -3
View File
@@ -469,9 +469,8 @@ if (gitea) {
}
void registrations.start().then(() => reloadHeads()).catch(say);
}
// Main takes no push and only the tools' account merges, in every repository, kept and not only when a token is
// minted: at the start and every ten minutes after, so a repository made later gets it too (issue 948, ADR 0398 §2).
// Only while the setting keep-main-rules is true (mainrules.ts); false, the default, leaves every repository's rule as set.
// Main's rule is put right only when the tools' account's token is minted, and only while the setting keep-main-rules is
// true (mainrules.ts); no timer keeps it (design 47 H §764, H-A-100).
// The package seats' write token (packages-account.ts): minted at the start; after that renewed only when the Go
// bundle that writes with it says the forge refused it (the finding PACKAGES_TOKEN_REFUSED), never on a timer.
try {
+1 -1
View File
@@ -220,7 +220,7 @@
},
"keep-main-rules": {
"type": "boolean",
"description": "Whether the module keeps main's branch protection as the mesh wants it. True: every ten minutes, and at the start, main's rule in every repository of the organisation novox is put to no push and the tools' account alone merging, and each apply of the `repositories` value narrows the main rule of the repositories it lists, requiring no status. False (the default): the module changes no existing repository's branch protection, whoever set it at the forge, but takes away a required status it finds on a rule covering main, once (ADR 0534 §1); a repository listed in `repositories` that does not exist is still made, with its first protection.",
"description": "Whether the module keeps main's branch protection as the mesh wants it. True: when the tools' account's token is minted, main's rule in every repository of the organisation novox is put to no push and the tools' account alone merging, and each apply of the `repositories` value narrows the main rule of the repositories it lists, requiring no status. False (the default): the module changes no existing repository's branch protection, whoever set it at the forge, but takes away a required status it finds on a rule covering main, once (ADR 0534 §1); a repository listed in `repositories` that does not exist is still made, with its first protection.",
"trusted": true,
"default": false
},
+9 -1
View File
@@ -2,7 +2,7 @@
// writes nothing at the forge, true puts main's rule right as before.
import { test } from "node:test";
import assert from "node:assert/strict";
import { mkdtempSync, writeFileSync } from "node:fs";
import { mkdtempSync, readFileSync, writeFileSync } from "node:fs";
import { tmpdir } from "node:os";
import { join } from "node:path";
@@ -15,6 +15,14 @@ function env(body?: string): NodeJS.ProcessEnv {
return { MESH_GITEA_CONFIG_FILE: f };
}
// No timer keeps main's rules (design 47 H §764, H-A-100): the setting's description says when it acts, and names none.
test("the setting's description names no timer", () => {
const manifest = JSON.parse(readFileSync(new URL("../module.json", import.meta.url), "utf8"));
const said: string = manifest.config["keep-main-rules"].description;
assert.match(said, /token is minted/);
assert.doesNotMatch(said, /every ten minutes|every \w+ minutes/);
});
test("the setting is false unless the config says true", () => {
assert.equal(keepMainRules(env()), false);
assert.equal(keepMainRules(env("{}")), false);
@@ -13,7 +13,7 @@ func TestIsCoreNamesTheBuildModulesAndTheDeliveryParts(t *testing.T) {
for _, e := range []string{
"mesh-catalog modules/mesh-build-go", "mesh-catalog modules/mesh-build-node", "mesh-catalog modules/mesh-build-image",
"mesh-catalog modules/mesh-build-go/cmd/mesh-build-go",
"mesh-delivery", "mesh-delivery modules/mesh-delivery-checker", "mesh-catalog modules/mesh-delivery-gate",
"mesh-delivery", "mesh-catalog modules/mesh-delivery-gate",
"mesh-catalog modules/nats", "mesh-catalog modules/gitea", "mesh-sdk",
} {
if !IsCore([]string{e}) {
@@ -43,5 +43,16 @@ func TestNoOwnerNamesBuildAgent(t *testing.T) {
if strings.Contains(o, "build-agent") {
t.Errorf("the owner %q is registered: build-agent is gone (ADR 0524 §5)", o)
}
if strings.Contains(o, "mesh-delivery-checker") {
t.Errorf("the owner %q is registered: the checker is gone whole (design 47 H §764)", o)
}
}
// The manifest's default owners name it no more either.
raw, err := os.ReadFile(filepath.Join("..", "..", "module.json"))
if err != nil {
t.Fatal(err)
}
if strings.Contains(string(raw), "mesh-delivery-checker") {
t.Error("the manifest names mesh-delivery-checker: the checker is gone whole (design 47 H §764)")
}
}
@@ -264,7 +264,7 @@ func TestEveryCodeModuleOfTheCatalogueIsAnOwner(t *testing.T) {
}
// 1815/AC2: the delivery repository's modules cannot ride on its repository entry (owns refuses a folder
// of a repository that is registered only as a whole), so each is named.
for _, m := range []string{"builder", "checker", "indexer"} {
for _, m := range []string{"builder", "indexer"} { // the checker went whole (design 47 H §764)
if Owners(s.Owners).owns("mesh-delivery modules/mesh-delivery-"+m) == "" {
t.Errorf("mesh-delivery-%s is not an owner", m)
}
-1
View File
@@ -147,7 +147,6 @@
"mesh-catalog modules/zsh-syntax-highlighting",
"mesh-delivery",
"mesh-delivery modules/mesh-delivery-builder",
"mesh-delivery modules/mesh-delivery-checker",
"mesh-delivery modules/mesh-delivery-forge-bridge",
"mesh-delivery modules/mesh-delivery-indexer",
"mesh-delivery modules/mesh-delivery-teller",
-1
View File
@@ -259,7 +259,6 @@
"mesh-catalog modules/zsh-syntax-highlighting",
"mesh-delivery",
"mesh-delivery modules/mesh-delivery-builder",
"mesh-delivery modules/mesh-delivery-checker",
"mesh-delivery modules/mesh-delivery-forge-bridge",
"mesh-delivery modules/mesh-delivery-indexer",
"mesh-delivery modules/mesh-delivery-teller",