diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 0b655a9..4cc99fa 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -44,6 +44,8 @@ jobs: 'https://github.com/atrinik/agent-integrations.git': { 'f723d04a095e8e8d44d54b5ca6a85475f2713912', '0401a87fe0e8f87bf7783e9d040d717d28afff23', + '86ea8241c54d13cad38a5eb0928770e4c97156ab', + '98196a538e77622ee2aa804b3d90c053d52a11d3', '38a3f01939c67e5172e4a7eedd8f6330e9339bbd', }, 'https://github.com/atrinik/atrinik.git': { @@ -53,8 +55,8 @@ jobs: } repository = 'https://github.com/atrinik/agent-integrations.git' records = json.loads(Path('plugins/atrinik-development/provenance.json').read_text())['local_authored_updates'] - if not isinstance(records, list) or len(records) != 2: - raise ValueError('Expected two local provenance records') + if not isinstance(records, list) or len(records) != 3: + raise ValueError('Expected three local provenance records') revisions = set() for record in records: if record.get('repository') != repository: diff --git a/PROVENANCE.md b/PROVENANCE.md index a27755a..e9fc486 100644 --- a/PROVENANCE.md +++ b/PROVENANCE.md @@ -53,9 +53,10 @@ verification store excludes checkout objects, inherited object directories and alternates, so a cached local commit cannot mask an unavailable remote object. Remote availability alone does not establish reviewed history. Source-controlled -policy admits only the independently reviewed immutable provider source `f723d04`, -baseline `0401a87`, anchor `38a3f01`, and wrapper updates `a9661a2` and `8b00b5b`; -the executable policy uses full commit IDs. CI rejects other IDs before fetching. -Offline validation additionally restricts each approved ID to its reviewed role -and source paths. Adding an ID or changing its role requires an independently +policy admits only the independently reviewed immutable provider source/baseline +pairs `f723d04`/`0401a87` (Linux qualification and workspace guidance) and +`86ea824`/`98196a5` (GitHub governance guidance), anchor `38a3f01`, and wrapper +updates `a9661a2` and `8b00b5b`; the executable policy uses full commit IDs. CI +rejects other IDs before fetching. Offline validation additionally restricts each +approved ID to its reviewed role and source paths. Adding an ID or changing its role requires an independently reviewed source policy change; editing provenance metadata cannot expand trust. diff --git a/plugins/atrinik-development/.codex-plugin/plugin.json b/plugins/atrinik-development/.codex-plugin/plugin.json index 0b59c84..010ba11 100644 --- a/plugins/atrinik-development/.codex-plugin/plugin.json +++ b/plugins/atrinik-development/.codex-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "atrinik-development", - "version": "1.0.1", + "version": "1.0.2", "description": "Reusable Atrinik development skills with portable public references.", "author": { "name": "Atrinik contributors", diff --git a/plugins/atrinik-development/plugin.json b/plugins/atrinik-development/plugin.json index cb33cf6..aeb83ef 100644 --- a/plugins/atrinik-development/plugin.json +++ b/plugins/atrinik-development/plugin.json @@ -1,7 +1,7 @@ { "$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json", "name": "atrinik-development", - "version": "1.0.1", + "version": "1.0.2", "description": "Reusable Atrinik development skills with portable public references.", "author": { "name": "Atrinik contributors", diff --git a/plugins/atrinik-development/provenance.json b/plugins/atrinik-development/provenance.json index c87506b..934af53 100644 --- a/plugins/atrinik-development/provenance.json +++ b/plugins/atrinik-development/provenance.json @@ -341,6 +341,30 @@ "Locally authored wording compression from the recorded baseline: shortened diagnostics, source routing, workspace selection and handoff prose by 120 bytes.", "Preserved every Markdown link and shell command block, and all ownership, authority, lease, cleanup, runtime, host-authentication and provenance conditions." ] + }, + { + "repository": "https://github.com/atrinik/agent-integrations.git", + "revision": "86ea8241c54d13cad38a5eb0928770e4c97156ab", + "source_path": "plugins/atrinik-development/skills/atrinik-github-governance/SKILL.md", + "source_url": "https://github.com/atrinik/agent-integrations/blob/86ea8241c54d13cad38a5eb0928770e4c97156ab/plugins/atrinik-development/skills/atrinik-github-governance/SKILL.md", + "source_blob": "c0a5c1798ebe690cb779ac2d3c5796f2523ddf8c", + "destination_path": "plugins/atrinik-development/skills/atrinik-github-governance/SKILL.md", + "destination_blob": "c0a5c1798ebe690cb779ac2d3c5796f2523ddf8c", + "baseline": { + "revision": "98196a538e77622ee2aa804b3d90c053d52a11d3", + "path": "plugins/atrinik-development/skills/atrinik-github-governance/SKILL.md", + "blob": "95cf8844f7e0770c3db68d0e25c4039270d37802" + }, + "license": { + "spdx": "MIT", + "path": "LICENSE", + "blob": "ae279af2f927edd5ab41f7fa95c72d2d99010de2", + "source_url": "https://github.com/atrinik/agent-integrations/blob/86ea8241c54d13cad38a5eb0928770e4c97156ab/LICENSE" + }, + "transformations": [ + "Locally authored update from the recorded baseline: the atrinik/github-settings publisher, audit and Project sync are retired; route settings work to that repository's current README.md and AGENTS.md, forbid its bin/ scripts from the current tree, old checkouts or releases, and describe task-authorized hand changes that are exported first, re-read live and recorded in the same task.", + "Corrected the PR-only step range to 3-5; made allowlist and ruleset changes from workflow edits task-authorized only; retained the stack contract, PR publication contract, links and authority boundaries." + ] } ] } diff --git a/plugins/atrinik-development/skills/atrinik-github-governance/SKILL.md b/plugins/atrinik-development/skills/atrinik-github-governance/SKILL.md index 95cf884..c0a5c17 100644 --- a/plugins/atrinik-development/skills/atrinik-github-governance/SKILL.md +++ b/plugins/atrinik-development/skills/atrinik-github-governance/SKILL.md @@ -11,12 +11,21 @@ description: Publish Atrinik PRs, govern GitHub policy, or review and explicitly follow [the stack contract](references/pr-stack-review-and-merge.md) in full; Review-only work is read-only and never grants merge authority. 2. For PR-only work, read its repository's `AGENTS.md`, use **Publish pull - requests**, and skip steps 3–6. + requests**, and skip steps 3–5. 3. For policy, settings, Actions, checks, or release governance, read the - workspace and `github-settings/AGENTS.md` guides. Compare configuration, - publisher, workflows, and history with the live GitHub API. -4. Run the publisher plan before `--apply`; external changes and workflow - dispatch need explicit authorization. + workspace guide and the current `README.md` and `AGENTS.md` of + `atrinik/github-settings`, then compare them with the live GitHub API. + Its publisher, audit and Project sync are retired. Never run its `bin/` + scripts (`publish*`, `audit`, `sync-project` and the rest), with or without + `--apply`, from its current tree, an old checkout or a release, even where + its `README.md` or `AGENTS.md` still describes them. +4. Organization-wide rules live in organization rulesets aimed at all + repositories, not lists of names; a required-check ruleset targets its one + repository. Change a setting by hand under the owner's login only when the + current task asks for that change; workflow dispatch also needs explicit + authorization. Export each object before the change, re-read it live + afterwards, and record the change in the same task where that `README.md` + says records live. Never record a setting for later application. 5. Keep controls Team-plan compatible; document and review Enterprise-only migrations. @@ -32,9 +41,9 @@ repository commit-signing policy. ## Change policy coherently -- Synchronize required workflow jobs with repository rulesets; when workflows - change, update the Actions allowlist, permissions, dependency pins, and - required aggregate status. +- When workflows change, update their permissions and dependency pins, and + report any Actions allowlist, ruleset or required-check change they need; + make it only if the task asks for it (step 4). - Keep merge methods, semantic-release, Conventional Commit policy, visibility, default branches, and Codecov/OIDC policy consistent. - Use least-privilege permissions and policy-required immutable action refs. @@ -57,10 +66,11 @@ validation sections. ## Validate and hand off -For policy changes, run JSON/shell validation, ShellCheck, actionlint, publisher -plan mode, and `git diff --check`; inspect the plan before apply. For PR-only -work, run repository validation and the rendered-view check. +For settings changes, check each changed object against a fresh live read. +For workflow changes, run actionlint, ShellCheck where shell changed, and +`git diff --check`. For PR-only work, run repository validation and the +rendered-view check. -For policy, document affected repositories, required checks, plan/rollback -steps, and unchanged live state. For PRs, record remote render verification. -Use Conventional Commits. +For policy, document affected repositories, required checks, the pre-change +export used for rollback, and unchanged live state. For PRs, record remote +render verification. Use Conventional Commits. diff --git a/tests/test_imported_skill_contracts.py b/tests/test_imported_skill_contracts.py index deb82dd..1d6f575 100644 --- a/tests/test_imported_skill_contracts.py +++ b/tests/test_imported_skill_contracts.py @@ -266,8 +266,32 @@ def test_native_pr_stack_governance_is_guarded_and_complete(self) -> None: self.assertIn("review and explicitly merge native PR stacks", description) self.assertIn("references/pr-stack-review-and-merge.md", body) self.assertIn("Review-only work is read-only", body) - self.assertIn("skip steps 3–6", body) + self.assertIn("skip steps 3–5", body) + self.assertNotIn("skip steps 3–6", body) self.assertNotIn("skip steps 2–5", body) + # The github-settings publisher, audit and Project sync are retired. + normalized_body = " ".join(body.split()) + for marker in { + "publisher, audit and Project sync are retired", + "Never run its `bin/` scripts", + "from its current tree, an old checkout or a release", + "make it only if the task asks for it (step 4)", + "organization rulesets aimed at all repositories", + "only when the current task asks for that change", + "record the change in the same task", + }: + with self.subTest(marker=marker): + self.assertIn(marker, normalized_body) + for stale in {"publisher plan", "github-settings/AGENTS.md", "before `--apply`", + "tools its current `README.md` documents", + "update the Actions allowlist"}: + with self.subTest(stale=stale): + self.assertNotIn(stale, normalized_body) + for name in ("atrinik-issue-delivery/references/preparation.md", + "atrinik-program-delivery/SKILL.md"): + with self.subTest(status_source=name): + self.assertIn("`github-settings/config/planning.json`", + (SKILLS / name).read_text(encoding="utf-8")) self.assertIn("review a native PR stack", interface) self.assertIn("explicit user authority", interface) diff --git a/tests/test_package.py b/tests/test_package.py index ae8d2ef..445c329 100644 --- a/tests/test_package.py +++ b/tests/test_package.py @@ -43,21 +43,31 @@ MAX_IMPORTED_CATALOG_BYTES = 2_250 MAX_IMPORTED_SKILL_BYTES = 62_500 LINK = re.compile(r"\[[^]]+\]\(([^)]+)\)") -LOCAL_UPDATE_PATHS = { - "plugins/atrinik-development/skills/atrinik-linux-gpu-qualification/references/linux-vulkan.md", - "plugins/atrinik-development/skills/atrinik-multi-repo-workspace/SKILL.md", -} CURRENT_UPDATE_PATHS = {"docs/LINUX_EXECUTION.md", "docs/WINDOWS_GPU_PREFLIGHT.md"} PROVENANCE_BASELINE = "38a3f01939c67e5172e4a7eedd8f6330e9339bbd" PROVENANCE_PATH = "plugins/atrinik-development/provenance.json" LOCAL_SOURCE_REVISION = "f723d04a095e8e8d44d54b5ca6a85475f2713912" LOCAL_BASELINE_REVISION = "0401a87fe0e8f87bf7783e9d040d717d28afff23" +GOVERNANCE_SOURCE_REVISION = "86ea8241c54d13cad38a5eb0928770e4c97156ab" +GOVERNANCE_BASELINE_REVISION = "98196a538e77622ee2aa804b3d90c053d52a11d3" +# Each locally authored path admits exactly one reviewed (source, baseline) role pair. +LOCAL_UPDATE_ROLES = { + "plugins/atrinik-development/skills/atrinik-linux-gpu-qualification/references/linux-vulkan.md": + (LOCAL_SOURCE_REVISION, LOCAL_BASELINE_REVISION), + "plugins/atrinik-development/skills/atrinik-multi-repo-workspace/SKILL.md": + (LOCAL_SOURCE_REVISION, LOCAL_BASELINE_REVISION), + "plugins/atrinik-development/skills/atrinik-github-governance/SKILL.md": + (GOVERNANCE_SOURCE_REVISION, GOVERNANCE_BASELINE_REVISION), +} +LOCAL_UPDATE_PATHS = set(LOCAL_UPDATE_ROLES) CURRENT_UPDATE_REVISIONS = { "docs/LINUX_EXECUTION.md": {"a9661a2bd978107fe4e01e45b2e22fcd1e2d095c", "8b00b5b3b44f1230b5df97715b613a68150e5a68"}, "docs/WINDOWS_GPU_PREFLIGHT.md": {"a9661a2bd978107fe4e01e45b2e22fcd1e2d095c"}, } APPROVED_PROVENANCE_REVISIONS = { - "https://github.com/atrinik/agent-integrations.git": {LOCAL_SOURCE_REVISION, LOCAL_BASELINE_REVISION, PROVENANCE_BASELINE}, + "https://github.com/atrinik/agent-integrations.git": { + *(revision for roles in LOCAL_UPDATE_ROLES.values() for revision in roles), PROVENANCE_BASELINE, + }, "https://github.com/atrinik/atrinik.git": set().union(*CURRENT_UPDATE_REVISIONS.values()), } LINK_TRANSFORMATION = "Retained package-relative links to the five packaged resources; replaced links outside the package with immutable source-revision URLs." @@ -190,7 +200,7 @@ def validate_provenance_sources(provenance: dict) -> None: baseline["revision"], baseline["blob"], license_record["blob"]): if not isinstance(value, str) or not re.fullmatch(r"[0-9a-f]{40}", value): raise ValueError("Nonimmutable Git identity") - if record["revision"] != LOCAL_SOURCE_REVISION or baseline["revision"] != LOCAL_BASELINE_REVISION: + if (record["revision"], baseline["revision"]) != LOCAL_UPDATE_ROLES[path]: raise ValueError("Unapproved local provenance revision for source or baseline role") prefix = f"https://github.com/atrinik/agent-integrations/blob/{record['revision']}/" if (record["source_path"] != path or baseline["path"] != path @@ -268,7 +278,7 @@ def test_marketplace_and_plugin_manifests_are_consistent(self) -> None: self.assertEqual(codex["name"], entry["name"]) self.assertEqual(plugin["version"], codex["version"]) self.assertEqual(codex["skills"], "./skills/") - self.assertEqual(plugin["version"], "1.0.1") + self.assertEqual(plugin["version"], "1.0.2") self.assertEqual( plugin["repository"], "https://github.com/atrinik/agent-integrations", @@ -550,6 +560,18 @@ def test_reviewed_provenance_policy_rejects_wrong_roles(self) -> None: record["baseline"]["blob"] = recorded_git_blob(revision, record["baseline"]["path"]) with self.subTest(role=role), self.assertRaisesRegex(ValueError, "Unapproved local provenance revision"): validate_provenance_sources(candidate) + # An approved revision from another path's role pair is still refused. + governance = next(index for index, record in enumerate(original["local_authored_updates"]) + if record["destination_path"].endswith("atrinik-github-governance/SKILL.md")) + for index, revision in ((0, GOVERNANCE_SOURCE_REVISION), (governance, LOCAL_SOURCE_REVISION)): + candidate = copy.deepcopy(original) + record = candidate["local_authored_updates"][index] + old = record["revision"] + record["revision"] = revision + record["source_url"] = record["source_url"].replace(old, revision) + record["license"]["source_url"] = record["license"]["source_url"].replace(old, revision) + with self.subTest(cross_role=index), self.assertRaisesRegex(ValueError, "Unapproved local provenance revision"): + validate_provenance_sources(candidate) candidate = copy.deepcopy(original) record = copy.deepcopy(candidate["current_file_updates"][1]) record["revision"] = candidate["current_file_updates"][-1]["revision"]