Skip to content

Commit 6034abc

Browse files
Revise Phase 0 for repository token
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent 61e6c92 commit 6034abc

9 files changed

Lines changed: 531 additions & 296 deletions

File tree

.github/agentic-refresh/README.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,16 @@
33
This directory contains the Phase 0 governance boundary for future quest refresh
44
automation.
55

6-
- [`capabilities.json`](./capabilities.json) keeps every repository report-only
7-
until an administrator confirms all write prerequisites.
8-
- [`quests.json`](./quests.json) defines source allowlists, repository ownership,
9-
approval identity, branch shape, and operational limits.
10-
- [`governance.md`](./governance.md) documents the GitHub App and repository
11-
settings that require administrator action.
6+
- [`capabilities.json`](./capabilities.json) keeps Buildathon writes disabled
7+
until the repository-scoped token and dispatch spikes pass. External
8+
repositories are permanently report-only under this strategy.
9+
- [`quests.json`](./quests.json) defines source allowlists, Buildathon ownership,
10+
external observation paths, approval identity, branch shape, and operational
11+
limits.
12+
- [`github-token.json`](./github-token.json) defines the built-in
13+
`GITHUB_TOKEN` permission and event model without storing a PAT or App key.
14+
- [`governance.md`](./governance.md) documents the repository settings and
15+
technical spikes required before enabling Buildathon write automation.
1216
- [`lifecycle-policy.md`](./lifecycle-policy.md),
1317
[`audience-style-guide.md`](./audience-style-guide.md),
1418
[`report-contract.md`](./report-contract.md),
Lines changed: 32 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
11
{
2-
"version": 1,
2+
"version": 2,
33
"defaultMode": "report-only",
4-
"lastReviewedAt": "2026-07-23",
4+
"lastReviewedAt": "2026-07-24",
55
"repositories": [
66
{
77
"name": "Azure-Samples/JavaScript-AI-Buildathon",
8+
"role": "automation-host",
89
"status": "blocked",
910
"writeAutomationAllowed": false,
1011
"capabilities": {
11-
"githubAppInstalled": false,
12+
"repositoryScopedTokenSelected": true,
1213
"copilotCodeReviewEnabled": true,
14+
"copilotInferenceAvailable": false,
1315
"aiCreditBudgetAvailable": false,
1416
"repositoryAdministratorAvailable": true,
17+
"githubTokenIssueWritesConfirmed": false,
18+
"githubTokenPullRequestWritesConfirmed": false,
19+
"explicitDispatchChecksConfirmed": false,
1520
"refreshBranchCreationAllowed": false,
1621
"rulesetConfigured": false,
1722
"conversationResolutionRequired": true,
@@ -34,25 +39,31 @@
3439
"copilotCodeReviewWorkflowId": 209015997,
3540
"rulesetId": 19622585,
3641
"approverVariable": "REFRESH_APPROVER_LOGIN=juliamuiruri4",
37-
"labelsConfigured": true
42+
"labelsConfigured": true,
43+
"phaseZeroPullRequest": 110
3844
},
3945
"blockers": [
40-
"An Azure-Samples organization owner must create or approve and install the dedicated GitHub App.",
41-
"The Copilot Code Review AI-credit budget has not been confirmed.",
46+
"The Copilot inference permission and AI-credit budget have not been confirmed.",
47+
"A manual trial must prove that GITHUB_TOKEN can create Buildathon issues, refresh/** branches, and pull requests under the organization policy.",
48+
"A required-check spike must prove explicit workflow dispatch after GITHUB_TOKEN-created pull requests and branch updates.",
4249
"Ruleset 19622585 must be activated after CODEOWNERS and both Phase 0 validation checks are merged and have successful check runs.",
43-
"The human-only merge ruleset template must be created or confirmed in repository settings; the REST API returned 404 when user bypass was requested.",
44-
"Automation permission to create refresh/** branches has not been approved."
50+
"The human-only merge ruleset template must be created or confirmed in repository settings; the REST API returned 404 when user bypass was requested."
4551
]
4652
},
4753
{
4854
"name": "Azure-Samples/serverless-chat-langchainjs",
49-
"status": "blocked",
55+
"role": "external-report-only",
56+
"status": "report-only",
5057
"writeAutomationAllowed": false,
5158
"capabilities": {
52-
"githubAppInstalled": false,
59+
"repositoryScopedTokenSelected": false,
5360
"copilotCodeReviewEnabled": true,
61+
"copilotInferenceAvailable": false,
5462
"aiCreditBudgetAvailable": false,
5563
"repositoryAdministratorAvailable": false,
64+
"githubTokenIssueWritesConfirmed": false,
65+
"githubTokenPullRequestWritesConfirmed": false,
66+
"explicitDispatchChecksConfirmed": false,
5667
"refreshBranchCreationAllowed": false,
5768
"rulesetConfigured": false,
5869
"conversationResolutionRequired": false,
@@ -65,23 +76,23 @@
6576
"approvedAt": null,
6677
"evidence": null
6778
},
68-
"blockers": [
69-
"No repository administrator confirmation has been recorded.",
70-
"An Azure-Samples organization owner must approve and install the dedicated GitHub App.",
71-
"The Copilot Code Review AI-credit budget has not been confirmed.",
72-
"The active rulesets have not been confirmed to satisfy the refresh governance contract.",
73-
"Automation permission to create refresh/** branches has not been approved."
74-
]
79+
"policyReason": "Cross-repository writes are intentionally disabled; findings require a manual maintainer handoff.",
80+
"blockers": []
7581
},
7682
{
7783
"name": "Azure-Samples/mcp-agent-langchainjs",
78-
"status": "blocked",
84+
"role": "external-report-only",
85+
"status": "report-only",
7986
"writeAutomationAllowed": false,
8087
"capabilities": {
81-
"githubAppInstalled": false,
88+
"repositoryScopedTokenSelected": false,
8289
"copilotCodeReviewEnabled": true,
90+
"copilotInferenceAvailable": false,
8391
"aiCreditBudgetAvailable": false,
8492
"repositoryAdministratorAvailable": false,
93+
"githubTokenIssueWritesConfirmed": false,
94+
"githubTokenPullRequestWritesConfirmed": false,
95+
"explicitDispatchChecksConfirmed": false,
8596
"refreshBranchCreationAllowed": false,
8697
"rulesetConfigured": false,
8798
"conversationResolutionRequired": false,
@@ -94,13 +105,8 @@
94105
"approvedAt": null,
95106
"evidence": null
96107
},
97-
"blockers": [
98-
"No repository administrator confirmation has been recorded.",
99-
"An Azure-Samples organization owner must approve and install the dedicated GitHub App.",
100-
"The Copilot Code Review AI-credit budget has not been confirmed.",
101-
"No qualifying main-branch ruleset or classic branch protection was visible.",
102-
"Automation permission to create refresh/** branches has not been approved."
103-
]
108+
"policyReason": "Cross-repository writes are intentionally disabled; findings require a manual maintainer handoff.",
109+
"blockers": []
104110
}
105111
]
106112
}
Lines changed: 51 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,69 @@
11
# Refresh capability matrix
22

33
The machine-readable source of truth is
4-
[`capabilities.json`](./capabilities.json). A repository is **report-only**
5-
unless every required capability is confirmed, an administrator records
6-
approval evidence, and `writeAutomationAllowed` is explicitly set to `true`.
4+
[`capabilities.json`](./capabilities.json).
75

8-
| Repository | Current mode | Capability status | Administrator approval |
6+
- Buildathon stays **report-only** until every same-repository write and dispatch
7+
capability is confirmed, approval evidence is recorded, and
8+
`writeAutomationAllowed` is explicitly set to `true`.
9+
- The two external sample repositories are intentionally **report-only** and do
10+
not have an automated write-enablement path under this strategy.
11+
12+
| Repository | Role | Current mode | Capability status |
913
|---|---|---|---|
10-
| `Azure-Samples/JavaScript-AI-Buildathon` | Report-only | Blocked | Missing |
11-
| `Azure-Samples/serverless-chat-langchainjs` | Report-only | Blocked | Missing |
12-
| `Azure-Samples/mcp-agent-langchainjs` | Report-only | Blocked | Missing |
14+
| `Azure-Samples/JavaScript-AI-Buildathon` | Automation host | Report-only | Blocked |
15+
| `Azure-Samples/serverless-chat-langchainjs` | External evidence | Report-only | Policy |
16+
| `Azure-Samples/mcp-agent-langchainjs` | External evidence | Report-only | Policy |
1317

14-
## Required confirmation
18+
## Buildathon confirmation
1519

16-
For each repository, an administrator must confirm:
20+
Before Buildathon write automation is enabled, confirm:
1721

18-
1. The dedicated GitHub App is installed for that repository.
19-
2. Copilot Code Review is enabled and an AI-credit budget is available.
20-
3. `refresh/**` branches may be created by the App.
21-
4. The main-branch ruleset requires pull requests, CODEOWNER approval,
22-
conversation resolution, and the repository's known CI checks.
23-
5. The App cannot bypass the ruleset, push to `main`, force-push, delete a
24-
protected branch, or merge.
25-
6. `REFRESH_APPROVER_LOGIN` is set to the exact approved GitHub login.
26-
7. `AGENTIC_REFRESH_APP_ID` and `AGENTIC_REFRESH_APP_PRIVATE_KEY` are configured
27-
without exposing their values in issues, logs, or repository files.
22+
1. Copilot inference works with `copilot-requests: write` and the organization
23+
has an available AI-credit budget.
24+
2. `GITHUB_TOKEN` can create a Buildathon issue through a bounded safe output.
25+
3. `GITHUB_TOKEN` can create and update only `refresh/**` branches and open a
26+
Buildathon pull request through bounded safe outputs.
27+
4. Explicit workflow dispatch produces every required check for the current head
28+
SHA after token-created PRs and subsequent automated updates.
29+
5. Copilot Code Review can be explicitly requested for the current head SHA.
30+
6. The main ruleset requires pull requests, CODEOWNER approval, conversation
31+
resolution, and the known required checks.
32+
7. The workflow cannot push to `main`, merge, force-push, delete branches, or
33+
write to another repository.
34+
8. `REFRESH_APPROVER_LOGIN` is set to the exact approved GitHub login.
2835

29-
Record the approver login, UTC timestamp, and a settings or approval reference
30-
in `capabilities.json`. Do not replace an unknown capability with an assumption.
36+
Record the approver login, UTC timestamp, and trial evidence in
37+
`capabilities.json`. Do not replace an unknown capability with an assumption.
3138

3239
## Audit findings
3340

3441
The SSO-authorized keyring token completed a read-only audit on July 23, 2026.
3542

36-
- Buildathon: Julia has repository administration; Copilot Code Review is
37-
active; refresh labels and `REFRESH_APPROVER_LOGIN` are configured. Active
38-
branch protection requires one approval and conversation resolution. Disabled
39-
ruleset `19622585` is prepared to require the Phase 0 checks, one CODEOWNER
40-
approval, approval after the latest push, conversation resolution, and to
41-
block deletion and force-push after this Phase 0 change lands. A separate
42-
update-restriction template permits only Julia, through a pull request, to
43-
update `main`; the App is not a bypass actor. GitHub returned HTTP 404 when
44-
that user-bypass ruleset was created through the REST API, so an administrator
45-
must confirm or create it in repository settings. The App, AI-credit budget
46-
confirmation, ruleset activation, and explicit App permission for
47-
`refresh/**` branches are missing.
48-
- Serverless Chat: Julia has write but not administration; two active rulesets
49-
and Copilot Code Review are visible. An administrator must confirm the
50-
rulesets, budget, App installation, and `refresh/**` branch policy.
51-
- MCP Agent: Julia has write but not administration; Copilot Code Review is
52-
visible, but no qualifying ruleset or classic main-branch protection was
53-
visible. An administrator must establish the complete governance boundary.
54-
55-
Julia cannot access the Azure-Samples organization settings needed to create an
56-
organization-owned App. An organization owner must complete that action.
43+
- Buildathon: Copilot Code Review is active; refresh labels and
44+
`REFRESH_APPROVER_LOGIN` are configured. Active branch protection requires one
45+
approval and conversation resolution. Disabled ruleset `19622585` is prepared
46+
to require the Phase 0 checks, CODEOWNER approval, approval after the latest
47+
push, conversation resolution, and to block deletion and force-push. A
48+
separate human-only update template still requires administrator confirmation
49+
because the user-bypass REST request returned HTTP 404.
50+
- Serverless Chat and MCP Agent remain external evidence sources only. No
51+
workflow in Buildathon may write to them.
5752

58-
## Organization-owner handoff
53+
The unavailable organization-owned GitHub App is no longer a blocker or planned
54+
dependency. Built-in-token event suppression and repository write permissions
55+
are the new technical gates.
5956

60-
Ask an Azure-Samples owner to:
57+
## Activation sequence
6158

62-
1. Create an organization-owned **Azure Samples Agentic Refresh** GitHub App
63-
with the repository permissions in `github-app.json` and no organization
64-
permissions.
65-
2. Disable webhooks and restrict installation to the Azure-Samples account.
66-
3. Install it only on `Azure-Samples/JavaScript-AI-Buildathon`.
67-
4. Provide the App ID through repository variable
68-
`AGENTIC_REFRESH_APP_ID`.
69-
5. Store the generated PEM private key directly in repository secret
70-
`AGENTIC_REFRESH_APP_PRIVATE_KEY`; never send it through chat or an issue.
71-
6. Confirm that Copilot Code Review has an available AI-credit budget.
72-
7. Confirm that the App may create `refresh/**` branches but cannot bypass
73-
ruleset `19622585`, write to `main`, or merge.
74-
8. After the Phase 0 pull request merges and both validation checks have run
75-
successfully, activate ruleset `19622585` and the human-only merge ruleset.
76-
9. Confirm that App installation tokens are available only to the pinned
77-
deterministic safe-output action and never to an agent or generic shell step.
59+
1. Merge the Phase 0 pull request.
60+
2. Confirm or create the human-only merge ruleset in repository settings.
61+
3. Activate ruleset `19622585` and the human-only merge ruleset.
62+
4. Run read-only discovery trials.
63+
5. Run the bounded `GITHUB_TOKEN` issue, branch, PR, explicit-dispatch, and
64+
Copilot-review spike.
65+
6. Enable issue-only reporting if issue writes pass.
66+
7. Enable Buildathon implementation only after every write/review gate passes.
7867

79-
The external repositories stay report-only. Their App installation requires a
80-
separate capability approval after a repository administrator confirms each
81-
ruleset, CI, CODEOWNER, branch, and budget requirement.
68+
External CodeTour findings remain manual handoffs regardless of Buildathon
69+
capability results.

.github/agentic-refresh/github-app.json

Lines changed: 0 additions & 55 deletions
This file was deleted.
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
{
2+
"version": 1,
3+
"token": "GITHUB_TOKEN",
4+
"scope": "current-repository-only",
5+
"storedSecretRequired": false,
6+
"personalTokenFallbackAllowed": false,
7+
"crossRepositoryWritesAllowed": false,
8+
"copilotInference": {
9+
"permission": "copilot-requests: write",
10+
"personalTokenFallbackAllowed": false
11+
},
12+
"permissionsByOperation": {
13+
"discoveryReport": {
14+
"contents": "read",
15+
"issues": "write",
16+
"copilot-requests": "write"
17+
},
18+
"implementation": {
19+
"contents": "write",
20+
"issues": "write",
21+
"pull-requests": "write",
22+
"copilot-requests": "write"
23+
},
24+
"validationDispatch": {
25+
"actions": "write",
26+
"contents": "read"
27+
}
28+
},
29+
"constraints": {
30+
"allowedRepository": "Azure-Samples/JavaScript-AI-Buildathon",
31+
"allowedBranchPrefix": "refresh/",
32+
"defaultBranchWritesAllowed": false,
33+
"mergeAllowed": false,
34+
"humanMergeRuleset": ".github/agentic-refresh/rulesets/human-merge.json"
35+
},
36+
"writeHandling": {
37+
"agentGitHubTools": "read-only",
38+
"consumer": "gh-aw-safe-outputs",
39+
"allowedOperations": [
40+
"createRefreshBranch",
41+
"updateRefreshBranch",
42+
"createPullRequest",
43+
"updatePullRequest",
44+
"createIssue",
45+
"updateIssue",
46+
"comment"
47+
],
48+
"forbiddenOperations": [
49+
"mergePullRequest",
50+
"updateDefaultBranch",
51+
"deleteBranch",
52+
"forcePush",
53+
"writeExternalRepository"
54+
]
55+
},
56+
"eventModel": {
57+
"tokenGeneratedEventsTriggerWorkflows": false,
58+
"explicitDispatchRequiredAfterPullRequestCreation": true,
59+
"explicitDispatchRequiredAfterRefreshBranchUpdate": true,
60+
"requiredCheckDispatchMustBeProvenBeforeWrites": true
61+
},
62+
"externalRepositories": {
63+
"mode": "report-only",
64+
"manualHandoffRequired": true
65+
}
66+
}

0 commit comments

Comments
 (0)