row 285: a chief-of-staff or creative instance that names publish refuses at load, keeping today's N10 refusal; instance-settings :289 follows the companion's gitea (#1790, mos-1332)
The fence sits near business.mjs:166, clear of row 287's :283-291. Its message starts with the N10 text. An assistant-instance test keeps the no-gitea branch covered, and a creative-instance test covers the fence. Nothing here has run.
This commit is contained in:
1 parent
115889e4a0
commit
aabfdfc604
5 files changed
+54
-24
No files matched your search
@@ -162,6 +162,12 @@ function checkRoles(roles, file, rolesDir, business) {
|
||||
// names are checked against projects once those are read.
|
||||
if (entry.identity !== undefined) out[instance].identity = checkIdentity(entry.identity, `${at}.identity`);
|
||||
if (entry.publish !== undefined) {
|
||||
// Row 285 (#1790, mos-1332 item 3): the chief of staff and the creative roles declare gitea for
|
||||
// the library alone, so publish refuses at load as it did before they declared it. #giteaRole
|
||||
// refuses both at raise (mos-1163, sage-2921).
|
||||
if (CREATIVE_DEFINITIONS.includes(entry.definition) || entry.definition === "chief-of-staff") {
|
||||
refuse(`${at}.publish needs identity and a gitea definition (${entry.definition} never publishes)`);
|
||||
}
|
||||
// N10: one message for both, naming the grant.
|
||||
if (!out[instance].identity || !services.includes("gitea")) refuse(`${at}.publish needs identity and a gitea definition`);
|
||||
out[instance].publish = requireDistinctList(entry.publish, `${at}.publish`, (p) => requireId(p, `${at}.publish entry`), { nonEmpty: true });
|
||||
|
||||
@@ -50,6 +50,13 @@ test("N10: publish needs identity and a gitea definition, and the error names th
|
||||
/roles\.chief\.publish needs identity and a gitea definition/);
|
||||
});
|
||||
|
||||
// Row 285 (mos-1332 item 3): the chief now declares gitea and refuses at the row 285 fence, so this
|
||||
// case is the one that reaches N10's "no gitea definition" branch.
|
||||
test("row 285: an instance whose definition has no gitea refuses publish with the N10 text", () => {
|
||||
refuses(() => check((d) => { d.roles.helper = { definition: "assistant", holder: "mos", identity: structuredClone(IDENTITY), publish: ["stack"] }; }),
|
||||
/roles\.helper\.publish needs identity and a gitea definition$/);
|
||||
});
|
||||
|
||||
test("publish names declared projects that have a remote, each once", () => {
|
||||
refuses(() => check((d) => { d.roles.coder.publish = ["books"]; }), /publish names books, which the business file doesn't declare/);
|
||||
refuses(() => check((d) => { delete d.projects.stack.remote; }), /publish names stack, which has no "remote"/);
|
||||
|
||||
@@ -310,14 +310,17 @@ test("row 285: a chief or creative instance without credentials.gitea refuses at
|
||||
|
||||
// Row 285 (C2-08b, brief): a creative instance may carry identity and publish, under the rules at
|
||||
// business.mjs:155-166, which the grant path reads. The grant itself still refuses it (#giteaRole).
|
||||
test("row 285: a creative instance with identity and publish loads", () => {
|
||||
// Row 285 (mos-1332 item 3): a creative instance holds gitea and may hold an identity, but publish
|
||||
// still refuses at load with the N10 text, as before its definition declared gitea.
|
||||
test("row 285: a creative instance with gitea, identity and publish refuses at load", () => {
|
||||
const identity = { name: "Bean", email: "[email protected]", gitea: { url: "https://git.example", user: "acme-bean" } };
|
||||
const business = check((d) => {
|
||||
const bean = (extra) => (d) => {
|
||||
d.projects.stack.remote = "https://git.example/acme/stack";
|
||||
d.roles.bean = { definition: "companion", credentials: CREATIVE_GITEA, identity, publish: ["stack"] };
|
||||
});
|
||||
d.roles.bean = { definition: "companion", credentials: CREATIVE_GITEA, identity, ...extra };
|
||||
};
|
||||
const business = check(bean({}));
|
||||
assert.deepEqual({ ...business.roles.bean.identity, gitea: { ...business.roles.bean.identity.gitea } }, identity);
|
||||
assert.deepEqual([...business.roles.bean.publish], ["stack"]);
|
||||
refuses(() => check(bean({ publish: ["stack"] })), /roles\.bean\.publish needs identity and a gitea definition \(companion never publishes\)/);
|
||||
});
|
||||
|
||||
// Row 194 (#1692, D2.5, T17): the per-agent forbid and the retired list.
|
||||
|
||||
@@ -286,7 +286,8 @@ test("row 213 a creative instance is the human's: add, vars and definition chang
|
||||
writeFileSync(join(f.root, "config", "personas", "acme", "bean.md"), text, { mode: 0o600 });
|
||||
const persona = { "persona.name": "Bean", "persona.sha256": createHash("sha256").update(text).digest("hex") };
|
||||
const view = f.settings.read("acme");
|
||||
assert.deepEqual(view.definitions.companion, { services: [], accepted: true });
|
||||
// Row 285 (mos-1332 item 4): the companion definition declares gitea.
|
||||
assert.deepEqual(view.definitions.companion, { services: ["gitea"], accepted: true });
|
||||
const add = { instance: "bean", op: "add", definition: "companion", vars: persona };
|
||||
for (const actor of ["chief-of-staff.chief", "tester"]) {
|
||||
assert.throws(() => f.settings.set("acme", { revision: view.revision, ...add }, actor), e => e.code === "organization-creative-human-only", actor);
|
||||
|
||||
Reference in new issue
Block a user