From 8008d397d19f65e66d33ccb27e4ae2acb9b840be Mon Sep 17 00:00:00 2001 From: "r4yharris-agent-coder[bot]" <334673250+r4yharris-agent-coder[bot]@users.noreply.github.com> Date: Tue, 13 Oct 2026 14:57:48 -0400 Subject: [PATCH] fix(deps): consume reviewed resume administration-read repair Parent #570 and #569 remain open. Related R4yHarris/github-agent-contracts#14 MERGED0050ada7184d7ef167310ef25b4312a024069505; reviewed submodule pointer only, no vendor source rewrite. Ray approved upstream repair/consumption2026-10-13. Preserve normal publish scopes; exact-headresume requestsAdminread, HTTP403/422denywithoutfallback. Read-onlyinstallationgrant diagnostic afterrepairfailedHTTP422; stopresume, no narrowedtokenretry, Appsettings/humanfallback or consumerPRmutation. Codeapproved doesn't establish acceptedinstallationgrant. Spec sections5.1/5.5/5.8 honors3/7. ParentNode20.20.2 compatibility60/60PASS0fail0skip145002.2726ms before added explicitscopecontrol; finalcontracts10/10PASS1196.909ms. Upstreamfull129/129PASS. Docs updated permission gates, defaulttoken unchanged/adminwrite refused. No runtime deps/Node-range/policy/workflow edit. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> AI-Agent: r4yharris-agent-coder AI-Model: GPT-6.1-Sol AI-Run: 1|github-copilot|GPT-6.1-Sol@-|x|-/1000000|-|ghcp-20261013-contracts-consume|570 --- docs/DEPENDENCY.md | 12 ++++++++++-- tests/contracts.test.mjs | 14 +++++++++++++- vendor/github-agent-contracts | 2 +- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/docs/DEPENDENCY.md b/docs/DEPENDENCY.md index 43b91f5..6f992ee 100644 --- a/docs/DEPENDENCY.md +++ b/docs/DEPENDENCY.md @@ -125,9 +125,17 @@ committed model/run and original bot author/committer; do not supply `--model`, `--message` or `--files`, or substitute current GHCP metadata for a completed seat. It rechecks local/remote/PR identity, reviewed policy and all required exact-head checks, including ruleset-only branch protections. +The reviewed revision `0050ada7184d7ef167310ef25b4312a024069505` +also requests repository-scoped **Administration read** for resume only, so +legacy branch-protection requirements can be inspected. Normal publication +and `--merge-when-green` alone retain their existing token scopes. A human +must grant and accept Administration read on the App installation; approving +the code change does not establish that GitHub accepted the permission. Missing or conflicting metadata authority, dirty state, real head drift, -missing/merged PR or permission failure stops explicitly. HTTP 422 remains a -Checks-permission stop, not permission to use another token or human fallback. +missing/merged PR or permission failure stops explicitly. HTTP 403/422 while +requesting the resume token stops without a reduced-scope retry; a Checks +permission HTTP 422 is likewise a stop, not permission to use another token +or human fallback. Merge remains separately authorized and conservative cleanup can report a confirmed remote merge with incomplete local worktree cleanup. diff --git a/tests/contracts.test.mjs b/tests/contracts.test.mjs index ee34fee..818ee6c 100644 --- a/tests/contracts.test.mjs +++ b/tests/contracts.test.mjs @@ -9,7 +9,7 @@ import { parseConfig } from '../src/lib/config.mjs'; import { runLoop } from '../src/runtime/loop.mjs'; import { createTools } from '../src/runtime/tools.mjs'; import { planStub } from '../src/planner/stub.mjs'; -import { parseArgs } from '../vendor/github-agent-contracts/scripts/agent-pr.mjs'; +import { buildInstallationPermissions, parseArgs } from '../vendor/github-agent-contracts/scripts/agent-pr.mjs'; const config = parseConfig(readFileSync(new URL('../roster.config.example.yml', import.meta.url), 'utf8') .replace('base_url: ""', 'base_url: http://localhost:8000/v1').replace('model: ""', 'model: test-model')); @@ -35,6 +35,18 @@ test('reviewed contracts exposes exact-head resume without replacing committed m ]) assert.throws(() => parseArgs(args, {}), /resume/); }); +test('reviewed contracts adds explicit read-only inspection without widening default publication', () => { + assert.deepEqual(buildInstallationPermissions(), { contents: 'write', pull_requests: 'write' }); + assert.deepEqual(buildInstallationPermissions({ readChecks: true }), { + contents: 'write', pull_requests: 'write', checks: 'read', + }); + assert.deepEqual(buildInstallationPermissions({ readChecks: true, readAdministration: true }), { + contents: 'write', pull_requests: 'write', checks: 'read', administration: 'read', + }); + assert.throws(() => buildInstallationPermissions({ additionalPermissions: { administration: 'write' } }), + /Unsupported additional installation permission/); +}); + test('worktree initialization runs recursive submodule update at its root and verifies a declared publisher', async (t) => { const worktree = fixture(t); writeFileSync(path.join(worktree, '.gitmodules'), diff --git a/vendor/github-agent-contracts b/vendor/github-agent-contracts index fa48c24..0050ada 160000 --- a/vendor/github-agent-contracts +++ b/vendor/github-agent-contracts @@ -1 +1 @@ -Subproject commit fa48c244bc9b8ead5df927ec705ef41a39c56f68 +Subproject commit 0050ada7184d7ef167310ef25b4312a024069505