T-1: a TypeScript part reads a definition's callers as the format's list
Text and a bare name are refused naming the verb, as the Go reader does. Builds: design 47 G §196, §336, §392 Claude-Session: https://claude.ai/code/session_01JG73KEq4zoDfM9WtYpcQgZ
This commit is contained in:
+6
-1
@@ -663,7 +663,7 @@ test("the provider loop is named for what it is, and its old name stays an alias
|
||||
assert.equal(loop.FAILING_EVENT, "provisioner.failing");
|
||||
});
|
||||
|
||||
import { allows, refusal, parseCallers, parseVerbCallers, parseConfiguredVerbCallers, moduleOf, UNPROVEN } from "../dist/callers/index.js";
|
||||
import { allows, refusal, parseCallers, parseVerbCallers, parseConfiguredVerbCallers, readDefinitionCallers, moduleOf, UNPROVEN } from "../dist/callers/index.js";
|
||||
import { Follower, statusTools, keepStatus, statusKey, viewWaitsFinding, type Answer, type Status } from "../dist/views/index.js";
|
||||
|
||||
test("callers and verb callers judge a proved caller by the Go side's rules (ADR 0459 §2, ADR 0627 §2)", () => {
|
||||
@@ -677,6 +677,11 @@ test("callers and verb callers judge a proved caller by the Go side's rules (ADR
|
||||
];
|
||||
for (const [what, list, caller, want] of rows) assert.equal(allows(list, caller), want, what);
|
||||
assert.deepEqual(parseCallers('{"callers":["a","person.b"]}'), ["a", "person.b"]);
|
||||
// design 47 G §336, §392: a definition's callers are a list of the format's forms; text and a bare name are refused
|
||||
assert.deepEqual(readDefinitionCallers("list", ["operator", "invokers", "seat:mesh-grants", "holder:node-backup@same-node"]),
|
||||
["operator", "invokers", "seat:mesh-grants", "holder:node-backup@same-node"]);
|
||||
assert.throws(() => readDefinitionCallers("list", "a person"), /list: callers are text/);
|
||||
assert.throws(() => readDefinitionCallers("list", ["mesh-grants"]), /list: the callers entry "mesh-grants" is none of/);
|
||||
assert.throws(() => parseCallers('{"callers":["a"],"more":1}'), /unknown field "more"/);
|
||||
|
||||
const verbs = parseVerbCallers('{"pull":["*"],"merge-pull":["mesh-delivery-forge-bridge"],"comment":["operator"]}', ["pull", "merge-pull", "comment"], {});
|
||||
|
||||
Reference in New Issue
Block a user