Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions docs/DEPENDENCY.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
14 changes: 13 additions & 1 deletion tests/contracts.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
Expand All @@ -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'),
Expand Down
Loading