diff --git a/docs/architecture/software-factory-design.md b/docs/architecture/software-factory-design.md index 5677818cf..5c51cf3b6 100644 --- a/docs/architecture/software-factory-design.md +++ b/docs/architecture/software-factory-design.md @@ -1064,10 +1064,17 @@ ci_workflows: ["CI"] verify: setup: "scripts/factory-setup.sh" test: "scripts/factory-test.sh" - protected_paths: ["scripts/factory-setup.sh", "scripts/factory-test.sh", ".github/**", "CODEOWNERS"] + protected_paths: ["scripts/factory-setup.sh", "scripts/factory-test.sh", ".github/", "CODEOWNERS"] reviewers: [coderabbit, cubic, gemini-code-assist, sonarqube-cloud] ``` +Its `protected_paths` are in the syntax of `config/hooks.json`'s paths, read alike by the Kernel's matcher and the +session hooks': a final `/` is the directory and everything below it, `*` is any part of one name, and case is +ignored. `**` as a whole name is any run of names, which both matchers read, as a rubric's paths use it (decision 0029), +though `config/hooks.json` itself names none. So `.github/*` leaves `.github/workflows/` open, and `CODEOWNERS` leaves +`.github/CODEOWNERS` open. They name the setup and test scripts. `schemas/consumer.schema.json` and +`tools/check_examples.py` hold them to it ("Consumer entry: its protected_paths in the hooks' syntax", issue 141). + Adopting the Factory is more than this entry. The repo also needs the two scripts, a ruleset that matches, the machine user as a code owner, and its Advisory reviewers configured. A **readiness check** in each pass compares every Consumer repo with that list and publishes what is missing, so @@ -2183,7 +2190,7 @@ Run by `factory / verify` over the manifests and the authority table. - An Intent that decides a gate and owns no category of Finding, as the readiness Intent does, has a promotion record of its own before any Effect of it is applied. - A Role named `owner` of a category has a promotion record. A `shadow` Role's decision is never read by the gate. -- Every Consumer entry names an owner Role, a setup command, a test command and protected paths. +- Every Consumer entry names an owner Role, a setup script, a test script and protected paths that name both. The interaction matrix in ยง5.1 is generated from this data in the Factory repo. A stale copy fails the check. diff --git a/examples/consumer.json b/examples/consumer.json new file mode 100644 index 000000000..a22f1ca91 --- /dev/null +++ b/examples/consumer.json @@ -0,0 +1,28 @@ +{ + "schema": "consumer/1", + "repo": "combsmith/markets", + "ring": "next", + "owner_role": "devops-lead", + "ci_workflows": [ + "CI" + ], + "verify": { + "setup": "scripts/factory-setup.sh", + "test": "scripts/factory-test.sh", + "protected_paths": [ + "scripts/factory-setup.sh", + "scripts/factory-test.sh", + ".github/", + "CODEOWNERS", + "docs/CODEOWNERS", + "tests/**/conftest.py", + "**/*.lock" + ] + }, + "reviewers": [ + "coderabbit", + "cubic", + "gemini-code-assist", + "sonarqube-cloud" + ] +} diff --git a/examples/invalid/consumer.a-glob-of-another-syntax.json b/examples/invalid/consumer.a-glob-of-another-syntax.json new file mode 100644 index 000000000..aa0b2ad1f --- /dev/null +++ b/examples/invalid/consumer.a-glob-of-another-syntax.json @@ -0,0 +1,24 @@ +{ + "schema": "consumer/1", + "repo": "combsmith/markets", + "ring": "next", + "owner_role": "devops-lead", + "ci_workflows": [ + "CI" + ], + "verify": { + "setup": "scripts/factory-setup.sh", + "test": "scripts/factory-test.sh", + "protected_paths": [ + "scripts/factory-setup.sh", + "scripts/factory-test.sh", + "scripts/factory-?.sh" + ] + }, + "reviewers": [ + "coderabbit", + "cubic", + "gemini-code-assist", + "sonarqube-cloud" + ] +} diff --git a/examples/invalid/consumer.a-path-from-the-root.json b/examples/invalid/consumer.a-path-from-the-root.json new file mode 100644 index 000000000..e524a858a --- /dev/null +++ b/examples/invalid/consumer.a-path-from-the-root.json @@ -0,0 +1,24 @@ +{ + "schema": "consumer/1", + "repo": "combsmith/markets", + "ring": "next", + "owner_role": "devops-lead", + "ci_workflows": [ + "CI" + ], + "verify": { + "setup": "scripts/factory-setup.sh", + "test": "scripts/factory-test.sh", + "protected_paths": [ + "scripts/factory-setup.sh", + "scripts/factory-test.sh", + "/CODEOWNERS" + ] + }, + "reviewers": [ + "coderabbit", + "cubic", + "gemini-code-assist", + "sonarqube-cloud" + ] +} diff --git a/examples/invalid/consumer.a-path-that-climbs-out.json b/examples/invalid/consumer.a-path-that-climbs-out.json new file mode 100644 index 000000000..a34aa9225 --- /dev/null +++ b/examples/invalid/consumer.a-path-that-climbs-out.json @@ -0,0 +1,24 @@ +{ + "schema": "consumer/1", + "repo": "combsmith/markets", + "ring": "next", + "owner_role": "devops-lead", + "ci_workflows": [ + "CI" + ], + "verify": { + "setup": "scripts/factory-setup.sh", + "test": "scripts/factory-test.sh", + "protected_paths": [ + "scripts/factory-setup.sh", + "scripts/factory-test.sh", + "../CODEOWNERS" + ] + }, + "reviewers": [ + "coderabbit", + "cubic", + "gemini-code-assist", + "sonarqube-cloud" + ] +} diff --git a/examples/invalid/consumer.a-script-left-unprotected.json b/examples/invalid/consumer.a-script-left-unprotected.json new file mode 100644 index 000000000..48f81d2f6 --- /dev/null +++ b/examples/invalid/consumer.a-script-left-unprotected.json @@ -0,0 +1,24 @@ +{ + "schema": "consumer/1", + "repo": "combsmith/markets", + "ring": "next", + "owner_role": "devops-lead", + "ci_workflows": [ + "CI" + ], + "verify": { + "setup": "scripts/factory-setup.sh", + "test": "scripts/factory-test.sh", + "protected_paths": [ + "scripts/factory-setup.sh", + ".github/", + "CODEOWNERS" + ] + }, + "reviewers": [ + "coderabbit", + "cubic", + "gemini-code-assist", + "sonarqube-cloud" + ] +} diff --git a/examples/invalid/consumer.a-script-named-by-a-pattern.json b/examples/invalid/consumer.a-script-named-by-a-pattern.json new file mode 100644 index 000000000..ac84e8fef --- /dev/null +++ b/examples/invalid/consumer.a-script-named-by-a-pattern.json @@ -0,0 +1,29 @@ +{ + "schema": "consumer/1", + "repo": "combsmith/markets", + "ring": "next", + "owner_role": "devops-lead", + "ci_workflows": [ + "CI" + ], + "verify": { + "setup": "scripts/*-setup.sh", + "test": "scripts/factory-test.sh", + "protected_paths": [ + "scripts/factory-setup.sh", + "scripts/factory-test.sh", + ".github/", + "CODEOWNERS", + "docs/CODEOWNERS", + "tests/**/conftest.py", + "**/*.lock", + "scripts/" + ] + }, + "reviewers": [ + "coderabbit", + "cubic", + "gemini-code-assist", + "sonarqube-cloud" + ] +} diff --git a/schemas/consumer.schema.json b/schemas/consumer.schema.json new file mode 100644 index 000000000..2c035be2f --- /dev/null +++ b/schemas/consumer.schema.json @@ -0,0 +1,89 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "consumer/1: how one Consumer repo is served (design section 3.12). A data file: its path is its identity and the commit its Release. Its protected paths are in the one syntax of config/hooks.json, read alike by the Kernel's matcher (kernel/derive.py, matches) and the session hooks' (tools/hooks/protected.py, entries); and they name its setup and test scripts, which tools/check_examples.py holds. What reads an entry, the readiness check and apply's refusal for a Consumer repo, is slice 3's.", + "type": "object", + "additionalProperties": false, + "required": [ + "schema", + "repo", + "ring", + "owner_role", + "ci_workflows", + "verify", + "reviewers" + ], + "properties": { + "schema": { + "const": "consumer/1" + }, + "repo": { + "type": "string", + "pattern": "^[A-Za-z0-9-]+/[A-Za-z0-9._-]+$" + }, + "ring": { + "description": "The Channel that serves the repo, as release/rings.json names it.", + "enum": [ + "next", + "stable" + ] + }, + "owner_role": { + "type": "string", + "pattern": "^[a-z][a-z-]*[a-z]$" + }, + "ci_workflows": { + "description": "The name of each of the repo's own workflows whose checks the Factory reads, as GitHub shows it.", + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { + "type": "string", + "minLength": 1 + } + }, + "verify": { + "type": "object", + "additionalProperties": false, + "required": [ + "setup", + "test", + "protected_paths" + ], + "properties": { + "setup": { + "description": "The repo's setup script, by its path from the top of the repo.", + "$ref": "#/$defs/file" + }, + "test": { + "description": "The repo's test script, by its path from the top of the repo.", + "$ref": "#/$defs/file" + }, + "protected_paths": { + "description": "What apply refuses a Role's push to without a person (slice 3's): relative to the top of the repo; a path ending in / is a directory and all below it; * stands for any part of one name; ** as a whole name for any run of names, which both matchers read, as a rubric's paths use it (decision 0029), though config/hooks.json itself names none; case is ignored (issue 141, decision 0020). Its setup and test scripts are among them.", + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { + "$ref": "hooks.schema.json#/$defs/path" + } + } + } + }, + "reviewers": { + "description": "The repo's Advisory reviewers, by the name the Factory gives each, one at least: adopting the Factory needs them configured (design section 3.12).", + "type": "array", + "minItems": 1, + "uniqueItems": true, + "items": { + "type": "string", + "pattern": "^[a-z][a-z0-9-]*$" + } + } + }, + "$defs": { + "file": { + "type": "string", + "pattern": "^(?!.*(^|/)\\.{1,2}(/|$))[A-Za-z0-9_.-]+(/[A-Za-z0-9_.-]+)*$" + } + } +} diff --git a/tests/test_tools.py b/tests/test_tools.py index b93782b36..496a63acc 100644 --- a/tests/test_tools.py +++ b/tests/test_tools.py @@ -1217,6 +1217,72 @@ def test_what_the_machine_user_may_never_hold_has_a_counter_example(self): # is names = {path.name for path in (ROOT / "examples" / "invalid").glob("machine-user.*.json")} self.assertEqual(len(names), 6) + def test_a_consumer_entrys_protected_paths_are_in_the_hooks_syntax_and_read_by_one_matcher(self): # issue 141 + # A Consumer entry's protected paths are config/hooks.json's own paths (decision 0020): the schema holds each + # to that syntax and refuses a list with none, and the Kernel and the session hooks read each alike. + from tools import jsonschema_lite + from tools.hooks import protected + self.assertEqual([p for p in check_examples.run(ROOT) if "consumer" in p], []) + schemas = {p.name[: -len(".schema.json")]: json.loads(p.read_text()) for p in (ROOT / "schemas").glob("*.schema.json")} + entry = json.loads((ROOT / "examples" / "consumer.json").read_text()) + patterns = entry["verify"]["protected_paths"] + for wrong in ([], ["CODEOWNERS", "CODEOWNERS"], ["/CODEOWNERS"], ["scripts/factory-?.sh"], ["../CODEOWNERS"], + ["docs//CODEOWNERS"], ["./CODEOWNERS"], ["scripts/{a,b}.sh"], ["C:\\scripts"]): + bad = copy.deepcopy(entry) + bad["verify"]["protected_paths"] = wrong + self.assertTrue(jsonschema_lite.validate(bad, schemas["consumer"], schemas=schemas), wrong) + bad = copy.deepcopy(entry) + del bad["verify"]["protected_paths"] + self.assertTrue(jsonschema_lite.validate(bad, schemas["consumer"], schemas=schemas)) + # The rest of the entry is held whole too: each field there, each in its shape, nothing beside them. + for where, wrong in ((("repo",), "markets"), (("ring",), "canary"), (("owner_role",), "devops-"), (("ci_workflows",), []), + (("ci_workflows",), ["CI", "CI"]), (("ci_workflows",), [""]), (("verify", "setup"), "/bin/sh"), + (("verify", "test"), "../t.sh"), (("verify", "test"), "scripts/factory-*.sh"), + (("reviewers",), ["cubic", "cubic"]), (("reviewers",), ["Cubic"]), (("reviewers",), []), (("extra",), True), + (("owner_role",), None), (("repo",), 1), (("reviewers",), "cubic"), (("ci_workflows",), "CI"), + (("verify",), "scripts/"), (("verify", "protected_paths"), "CODEOWNERS"), (("verify", "setup"), 1), + (("verify", "extra"), True)): + bad = copy.deepcopy(entry) + parent = bad + for key in where[:-1]: + parent = parent[key] + parent[where[-1]] = wrong + self.assertTrue(jsonschema_lite.validate(bad, schemas["consumer"], schemas=schemas), (where, wrong)) + for where in (("repo",), ("ring",), ("owner_role",), ("ci_workflows",), ("verify",), ("reviewers",), ("verify", "setup"), ("verify", "test")): + bad = copy.deepcopy(entry) + parent = bad + for key in where[:-1]: + parent = parent[key] + del parent[where[-1]] + self.assertTrue(jsonschema_lite.validate(bad, schemas["consumer"], schemas=schemas), where) + # Its setup and test scripts are among its protected paths, read by the Kernel's matcher, in an example as in a + # counter-example, or an author could weaken the tests it is judged by. + self.assertEqual(check_examples._unprotected(entry), []) + for paths, said in ((["scripts/factory-setup.sh"], "does not protect its own scripts/factory-test.sh"), + (["CODEOWNERS"], "protects neither its own scripts/factory-setup.sh nor scripts/factory-test.sh"), + (["scripts/factory-test.sh"], "does not protect its own scripts/factory-setup.sh"), + (["scripts/*-setup.sh", "SCRIPTS/"], "")): + bad = copy.deepcopy(entry) + bad["verify"]["protected_paths"] = paths + self.assertEqual(check_examples._unprotected(bad), ["$.verify: " + said] if said else [], paths) + bad["verify"]["protected_paths"] = ["scripts/factory-setup.sh"] + root = clone({"examples/consumer.json": json.dumps(bad)}) + self.assertTrue(caught(check_examples.run(root), "consumer.json: $.verify: does not protect its own scripts/factory-test.sh")) + # Each the schema lets through is one the Kernel reads, and each the Kernel refuses the schema refuses too. + for pattern in patterns + ["*/__init__.*", "a/**/b/", "**"]: + self.assertTrue(derive.readable_pattern(pattern), pattern) + for pattern in ("/CODEOWNERS", "../CODEOWNERS", "docs//CODEOWNERS", "./CODEOWNERS"): + self.assertFalse(derive.readable_pattern(pattern), pattern) + # One matcher: what the Kernel finds each path to be, the session hooks find it to be, in any case. + hooks = protected.entries([(p, "") for p in patterns]) + for path, want in (("scripts/factory-setup.sh", ["scripts/factory-setup.sh"]), ("SCRIPTS/Factory-Test.sh", ["scripts/factory-test.sh"]), + (".github/workflows/ci.yml", [".github/"]), (".github", [".github/"]), ("CODEOWNERS", ["CODEOWNERS"]), + ("tests/conftest.py", ["tests/**/conftest.py"]), + ("tests/a/b/conftest.py", ["tests/**/conftest.py"]), ("poetry.lock", ["**/*.lock"]), + ("a/b/poetry.lock", ["**/*.lock"]), ("docs/CODEOWNERS", ["docs/CODEOWNERS"]), ("scripts/other.sh", []), (".githubx/a", [])): + self.assertEqual([p for p in patterns if derive.matches(p, path)], want, path) + self.assertEqual([p for p, _, _, whole in hooks if whole.match(path.casefold())], want, path) + def machine_users_live_answers(self, held: dict) -> list: """What GitHub answers when nothing has drifted: the org's repos hold the two left out, an archived one and an advisory's fork, and each repo has another team beside the code owners'.""" diff --git a/tools/check_examples.py b/tools/check_examples.py index 4f0be28fe..b596ba891 100644 --- a/tools/check_examples.py +++ b/tools/check_examples.py @@ -5,7 +5,7 @@ import pathlib import re -from kernel import decide, issue +from kernel import decide, derive, issue from kernel.coverage import covered from tools import walk from tools.jsonschema_lite import ANNOTATIONS, FILE, SchemaError, _resolve, validate @@ -40,7 +40,7 @@ "config": "data", "hooks": "data", "lifecycle": "data", "authority": "data", "apps": "data", "rubric": "data", "checklist": "data", "acceptance": "data", "trial": "data", "role": "data", "feed": "data", "eval-case": "data", "eval-set": "data", "context-eval": "data", "controller": "data", "harness": "data", "rulesets": "data", "credential-ages": "data", "machine-user": "data", - "rings": "data", "release-fixture": "data", "release-exchanges": "record", "decision-points": "data"} + "rings": "data", "consumer": "data", "release-fixture": "data", "release-exchanges": "record", "decision-points": "data"} RELEASE = "^factory/v(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)$" # What one Run carries, and what is written from it, holds codes, never text: a string in these schemas is held by an # enum, a const or a pattern anchored at both ends, unless it is a property named `body`, or sits under one named @@ -237,6 +237,17 @@ def _table(feed, decision_schema) -> list: return out +def _unprotected(value) -> list: + """What is wrong with `value`, a Consumer entry valid to its schema: nothing, or its setup or test script that none + of its protected paths names, by the Kernel's own matcher, so that an author could weaken the tests it is judged by + (design section 3.12, issue 141). One problem, naming each such script.""" + verify = value["verify"] + left = [verify[k] for k in ("setup", "test") if not any(derive.matches(p, verify[k]) for p in verify["protected_paths"])] + if len(left) > 1: + return ["$.verify: protects neither its own %s nor %s" % tuple(left)] + return ["$.verify: does not protect its own %s" % left[0]] if left else [] + + def _uncovered(value, root: pathlib.Path) -> list: """What kernel/coverage.py says is wrong with `value`, a coverage example valid to its schema: nothing, or one problem naming what it left uncovered, or why it could not be judged.""" @@ -334,6 +345,7 @@ def load(path: pathlib.Path): errors = _uncovered(value, root) errors = errors or (_reason_unsuited(value) if kind == "result" else []) errors = errors or (_held(value) if kind == "eval-set" else []) + errors = errors or (_unprotected(value) if kind == "consumer" else []) for err in errors: problems.append("%s: %s" % (path.name, err)) for path in sorted((root / "examples" / "invalid").glob("*.json")): @@ -363,6 +375,8 @@ def load(path: pathlib.Path): errors = check_release.fixture_problems(value, "invalid/" + path.name) if kind == "result" and not errors: errors = _reason_unsuited(value) + if kind == "consumer" and not errors: + errors = _unprotected(value) if not errors: problems.append("invalid/%s: was accepted, and must be rejected" % path.name) elif len(errors) > 1: diff --git a/tools/mutants.py b/tools/mutants.py index 9121065e4..0aa5cde71 100644 --- a/tools/mutants.py +++ b/tools/mutants.py @@ -4917,6 +4917,59 @@ def moved_before(rel: str, block: str, anchor: str) -> tuple: ('a preflight case keeps no mark in the ledger', 'harness/eval/__init__.py', ' alternates=beside, surplus=away, usages=spent)["cases"]]', ' usages=spent)["cases"]]', ('tests.test_evals.EvalJob.test_a_preflight_case_keeps_its_marks_in_the_ledger_as_the_sets_do',)), + # Issue 141: a Consumer entry's protected paths are in the hooks' syntax, one at least, each once as written, and + # name its setup and test scripts. + ("a Consumer's script may be any string", 'schemas/consumer.schema.json', + ' "file": {\n "type": "string",\n "pattern": "^(?!.*(^|/)\\\\.{1,2}(/|$))[A-Za-z0-9_.-]+(/[A-Za-z0-9_.-]+)*$"\n }', + ' "file": {\n "type": "string"\n }', ('tests.test_tools.Apps.test_a_consumer_entrys_protected_paths_are_in_the_hooks_syntax_and_read_by_one_matcher',)), + ("a Consumer entry may leave its scripts unprotected", 'tools/check_examples.py', + ' errors = errors or (_unprotected(value) if kind == "consumer" else [])\n', '', ('tests.test_tools.Apps.test_a_consumer_entrys_protected_paths_are_in_the_hooks_syntax_and_read_by_one_matcher',)), + ("a counter-example Consumer entry is not held to its scripts", 'tools/check_examples.py', + ' if kind == "consumer" and not errors:\n errors = _unprotected(value)\n', '', ('tests.test_tools.Apps.test_a_consumer_entrys_protected_paths_are_in_the_hooks_syntax_and_read_by_one_matcher',)), + ("a Consumer entry protecting one of its scripts protects both", 'tools/check_examples.py', + 'if not any(derive.matches(p, verify[k]) for p in verify["protected_paths"])]', 'if not any(derive.matches(p, verify[j]) for p in verify["protected_paths"] for j in ("setup", "test"))]', ('tests.test_tools.Apps.test_a_consumer_entrys_protected_paths_are_in_the_hooks_syntax_and_read_by_one_matcher',)), + ("a Consumer's protected path may be in any syntax", 'schemas/consumer.schema.json', + '"$ref": "hooks.schema.json#/$defs/path"', '"type": "string"', ('tests.test_tools.Apps.test_a_consumer_entrys_protected_paths_are_in_the_hooks_syntax_and_read_by_one_matcher',)), + ("a Consumer may protect no path", 'schemas/consumer.schema.json', + ' "minItems": 1,\n "uniqueItems": true,\n "items": {\n "$ref"', ' "uniqueItems": true,\n "items": {\n "$ref"', ('tests.test_tools.Apps.test_a_consumer_entrys_protected_paths_are_in_the_hooks_syntax_and_read_by_one_matcher',)), + ("a Consumer's protected path may be listed twice", 'schemas/consumer.schema.json', + ' "uniqueItems": true,\n "items": {\n "$ref"', ' "items": {\n "$ref"', ('tests.test_tools.Apps.test_a_consumer_entrys_protected_paths_are_in_the_hooks_syntax_and_read_by_one_matcher',)), + ("a Consumer entry needs no protected paths", 'schemas/consumer.schema.json', + ' "test",\n "protected_paths"\n', ' "test"\n', ('tests.test_tools.Apps.test_a_consumer_entrys_protected_paths_are_in_the_hooks_syntax_and_read_by_one_matcher',)), + ("a Consumer entry may serve any ring", 'schemas/consumer.schema.json', + ' "enum": [\n "next",\n "stable"\n ]', ' "type": "string"', ('tests.test_tools.Apps.test_a_consumer_entrys_protected_paths_are_in_the_hooks_syntax_and_read_by_one_matcher',)), + ("a Consumer entry may read no workflow", 'schemas/consumer.schema.json', + ' "type": "array",\n "minItems": 1,\n "uniqueItems": true,\n "items": {\n "type": "string",\n "minLength": 1', + ' "type": "array",\n "uniqueItems": true,\n "items": {\n "type": "string",\n "minLength": 1', ('tests.test_tools.Apps.test_a_consumer_entrys_protected_paths_are_in_the_hooks_syntax_and_read_by_one_matcher',)), + ("a Consumer entry may name a workflow by nothing", 'schemas/consumer.schema.json', + ' "type": "string",\n "minLength": 1\n }\n },\n "verify"', ' "type": "string"\n }\n },\n "verify"', ('tests.test_tools.Apps.test_a_consumer_entrys_protected_paths_are_in_the_hooks_syntax_and_read_by_one_matcher',)), + ("a Consumer's test script may be a pattern", 'schemas/consumer.schema.json', + '"description": "The repo\'s test script, by its path from the top of the repo.",\n "$ref": "#/$defs/file"', + '"description": "The repo\'s test script, by its path from the top of the repo.",\n "$ref": "hooks.schema.json#/$defs/path"', ('tests.test_tools.Apps.test_a_consumer_entrys_protected_paths_are_in_the_hooks_syntax_and_read_by_one_matcher',)), + ("a Consumer entry's owner Role may be of any type", 'schemas/consumer.schema.json', + ' "owner_role": {\n "type": "string",\n', ' "owner_role": {\n', ('tests.test_tools.Apps.test_a_consumer_entrys_protected_paths_are_in_the_hooks_syntax_and_read_by_one_matcher',)), + ("a Consumer entry's reviewers may be of any type", 'schemas/consumer.schema.json', + '"description": "The repo\'s Advisory reviewers, by the name the Factory gives each, one at least: adopting the Factory needs them configured (design section 3.12).",\n "type": "array",\n', + '"description": "The repo\'s Advisory reviewers, by the name the Factory gives each, one at least: adopting the Factory needs them configured (design section 3.12).",\n', ('tests.test_tools.Apps.test_a_consumer_entrys_protected_paths_are_in_the_hooks_syntax_and_read_by_one_matcher',)), + ("a Consumer entry leaving its setup script alone unprotected is read", 'tools/check_examples.py', + ' if left else []', ' if verify["test"] in left else []', ('tests.test_tools.Apps.test_a_consumer_entrys_protected_paths_are_in_the_hooks_syntax_and_read_by_one_matcher',)), + ("a Consumer entry needs no setup script", 'schemas/consumer.schema.json', + ' "setup",\n "test",\n', ' "test",\n', ('tests.test_tools.Apps.test_a_consumer_entrys_protected_paths_are_in_the_hooks_syntax_and_read_by_one_matcher',)), + ("a Consumer entry may name its repo in any form", 'schemas/consumer.schema.json', + '"pattern": "^[A-Za-z0-9-]+/[A-Za-z0-9._-]+$"', '"minLength": 1', ('tests.test_tools.Apps.test_a_consumer_entrys_protected_paths_are_in_the_hooks_syntax_and_read_by_one_matcher',)), + ("a Consumer entry may name an owner Role in any form", 'schemas/consumer.schema.json', + '"pattern": "^[a-z][a-z-]*[a-z]$"', '"pattern": "^[a-z][a-z-]*$"', ('tests.test_tools.Apps.test_a_consumer_entrys_protected_paths_are_in_the_hooks_syntax_and_read_by_one_matcher',)), + ("a Consumer entry may name a reviewer twice", 'schemas/consumer.schema.json', + ' "minItems": 1,\n "uniqueItems": true,\n "items": {\n "type": "string",\n "pattern": "^[a-z][a-z0-9-]*$"', + ' "minItems": 1,\n "items": {\n "type": "string",\n "pattern": "^[a-z][a-z0-9-]*$"', ('tests.test_tools.Apps.test_a_consumer_entrys_protected_paths_are_in_the_hooks_syntax_and_read_by_one_matcher',)), + ("a Consumer entry may name no reviewer", 'schemas/consumer.schema.json', + ' "minItems": 1,\n "uniqueItems": true,\n "items": {\n "type": "string",\n "pattern": "^[a-z][a-z0-9-]*$"', + ' "uniqueItems": true,\n "items": {\n "type": "string",\n "pattern": "^[a-z][a-z0-9-]*$"', ('tests.test_tools.Apps.test_a_consumer_entrys_protected_paths_are_in_the_hooks_syntax_and_read_by_one_matcher',)), + ("a Consumer entry may carry any field", 'schemas/consumer.schema.json', + ' "type": "object",\n "additionalProperties": false,\n "required": [\n "schema",\n "repo"', + ' "type": "object",\n "required": [\n "schema",\n "repo"', ('tests.test_tools.Apps.test_a_consumer_entrys_protected_paths_are_in_the_hooks_syntax_and_read_by_one_matcher',)), + ("a Consumer entry is in no class of the envelope", 'tools/check_examples.py', + ' "consumer": "data",', '', ('tests.test_tools.Apps.test_a_consumer_entrys_protected_paths_are_in_the_hooks_syntax_and_read_by_one_matcher',)), ('a ledger need hold no preflight', 'schemas/eval-ledger.schema.json', ' "cases",\n "preflight"\n', ' "cases"\n', ('tests.test_evals.TheSet.test_a_case_dropped_under_evals_in_any_file_is_caught',)),