# GitHub connector probe, 2026-11-23

Gate 1 evidence for the [approved connector spec](2026-11-22-equipo-github-connector.md).
Controller ran the probes against scratch organisation `oficina-equipo-test`,
repositories `probe` and `probe-other`, private App `oficina-equipo-probe-acbafc`
(id `5891080`). This document records the supplied sanitized reports; the seam
implementation did not rerun the probes or read their credentials.

Scripts outside this repository: `agent-tools/github-probe/probe.py` and
`agent-tools/github-probe/probe_actions.py`. The full probe report below is the
fresh run saved at 2026-11-23 17:16:51 UTC. The Actions report was saved at
17:16:21 UTC. Credentials, JWTs and installation tokens are deliberately absent.

## Organisation manifest flow: confirmed

The controller confirms that private App `oficina-equipo-probe-acbafc`,
ID `5891080`, was created through the manifest flow in organisation
`oficina-equipo-test` and installed there on `probe` and `probe-other`.
The saved full report confirms the installation lookup returned `200`,
with exactly G4 permissions and no webhook events. It does not retain
creation response bodies or the conversion code.

The reviewed external `agent-tools/github-probe/manifest_server.py` binds
only loopback. Its form posts the private App manifest with G4 permissions,
an inactive webhook and empty default events to
`https://github.com/organizations/oficina-equipo-test/settings/apps/new`.
The callback checks its random state and the one-time code before
`POST https://api.github.com/app-manifests/{code}/conversions`.
It writes the returned credentials privately with mode 0600 and redirects
to `https://github.com/apps/{slug}/installations/new`. Its creation response log contains only
the App ID and slug. Neither credentials nor conversion values were read
or copied for this record.

## Calls and checks

All REST calls use `https://api.github.com`, API version `2022-11-28`, Accept
`application/vnd.github+json`, User-Agent `equipo-probe`. App authentication
is a short RS256 JWT. Installation-token calls use the minted token.
`{installation}`, `{first_sha}`, `{judged_sha}`, `{merge_sha}`, `{pr}` and
`{graphql_id}` below are response-derived identifiers. They are placeholders,
not invented captured values: the report does not retain these identifiers.

| Call or operation | Request and exact reported answer |
| --- | --- |
| `GET /orgs/oficina-equipo-test/installation` | `200`; permissions exactly contents/write, pull_requests/write, checks/read, statuses/read, actions/read, metadata/read; events `[]`. |
| `POST /app/installations/{installation}/access_tokens` | Body `{"repositories":["probe"],"permissions":{"contents":"write","pull_requests":"write","checks":"read","statuses":"read","actions":"read"}}`; `201`, lifetime `3600 s`, repository list `["probe"]`. |
| `GET /repos/oficina-equipo-test/probe-other` | Scoped token: `404`. |
| `GET /repos/oficina-equipo-test/probe` | Scoped token: `200`. |
| `POST /app/installations/{installation}/access_tokens` | Read token body `{"repositories":["probe"],"permissions":{"contents":"read","pull_requests":"read"}}`. Its response status was not separately retained. |
| `GET /repos/oficina-equipo-test/probe/git/ref/heads/main` | Fetch the SHA used by the read-token branch attempt; response status not separately retained. |
| `POST /repos/oficina-equipo-test/probe/git/refs` | Read token body `{"ref":"refs/heads/equipo/readonly-should-fail","sha":"{main_sha}"}`; `403`. |
| `git clone -q https://github.com/oficina-equipo-test/probe.git` | Installation token through a private askpass file, username `x-access-token`; exit 0. Helpers disabled. |
| First branch push | `git checkout -q -b equipo/probe-1795454216`; write `probe.txt` containing `first\n`; commit `Probe: first change`; `git push -q origin equipo/probe-1795454216`: exit 0. Git's PR-link answer is preserved below. |
| Workflow push | Add `.github/workflows/equipo-{unix_time}.yml`, contents `on: push\njobs: {}\n`; commit `Probe: workflow change should be refused`; same push: nonzero, exact last stderr line below. Reset to `{first_sha}` afterward. The refreshed script uses an existing-directory-safe mkdir and a fresh filename because the repository now contains a real workflow. |
| `POST /repos/oficina-equipo-test/probe/pulls` | Body `{"title":"Probe: draft PR","head":"equipo/probe-1795454216","base":"main","body":"Equipo connector probe.","draft":true}`; `201 draft=True`. |
| Second push | `probe.txt` becomes `first\nsecond\n`; commit `Probe: second change`; push the same branch, obtain `{judged_sha}`. |
| `PATCH /repos/oficina-equipo-test/probe/pulls/{pr}` | Body `{"draft":false}`; attempted by script but status not retained and not the proof of readiness. |
| `POST /graphql` | Query `mutation($id:ID!){markPullRequestReadyForReview(input:{pullRequestId:$id}){pullRequest{isDraft}}}`, variables `{"id":"{graphql_id}"}`; `graphql status 200`. The script checks HTTP success, not the GraphQL errors field or returned isDraft. Controller reports the PR was marked ready. |
| `PUT /repos/oficina-equipo-test/probe/pulls/{pr}/merge` | Body `{"sha":"{first_sha}","merge_method":"merge"}`; `409 Head branch was modified. Review and try the merge again.` |
| `GET /repos/oficina-equipo-test/probe/commits/{judged_sha}/check-runs` | `200`. |
| `GET /repos/oficina-equipo-test/probe/commits/{judged_sha}/status` | `200`. |
| `GET /repos/oficina-equipo-test/probe/actions/runs?per_page=1` | `200`. |
| `PUT /repos/oficina-equipo-test/probe/pulls/{pr}/merge` | Body `{"sha":"{judged_sha}","merge_method":"merge"}`; `200`, script also checks `merged == true`. |
| `GET /repos/oficina-equipo-test/probe/commits/{merge_sha}` | `parents=2`. |
| `DELETE /installation/token` | `204`. |
| `GET /repos/oficina-equipo-test/probe` after revocation | `401` immediately. Read token also revoked; scratch directory removed. |

## Actions on an App push: confirmed

Paul installed `.github/workflows/probe.yml` through `gh`, since the App has
no workflow write permission. It runs on pushes to non-main branches and on
pull requests. The Actions script looks up the installation, then mints a
one-repository token with contents/write, actions/read and checks/read. It
clones, creates `equipo/actions-{unix_time}`, writes `a.txt` containing `x\n`,
commits `Probe: does Actions run?`, and pushes with that token. It polls
`GET /repos/oficina-equipo-test/probe/actions/runs?head_sha={sha}` every 10
seconds, up to 30 times, then reads
`GET /repos/oficina-equipo-test/probe/commits/{sha}/check-runs` with the same
token. Observed event `push`, completed/success; check `check`, completed/success.
Finally it revokes the token and removes scratch.

## Exact sanitized reports

`probe-20261123T171651Z.txt`:

```text
{
  "installation_found": {
    "ok": true,
    "detail": "status 200"
  },
  "installation_permissions_match_G4": {
    "ok": true,
    "detail": "{\"checks\": \"read\", \"actions\": \"read\", \"contents\": \"write\", \"metadata\": \"read\", \"statuses\": \"read\", \"pull_requests\": \"write\"}"
  },
  "no_webhook_events": {
    "ok": true,
    "detail": "[]"
  },
  "scoped_token_minted": {
    "ok": true,
    "detail": "status 201"
  },
  "token_lifetime_about_one_hour": {
    "ok": true,
    "detail": "3600 s"
  },
  "token_scoped_to_one_repo": {
    "ok": true,
    "detail": "[\"probe\"]"
  },
  "other_repo_unreachable": {
    "ok": true,
    "detail": "status 404"
  },
  "own_repo_reachable": {
    "ok": true,
    "detail": "status 200"
  },
  "read_token_cannot_create_branch": {
    "ok": true,
    "detail": "status 403"
  },
  "clone_with_installation_token": {
    "ok": true,
    "detail": ""
  },
  "push_branch_with_token": {
    "ok": true,
    "detail": "\nremote: Create a pull request for 'equipo/probe-1795454216' on GitHub by visiting:        \nremote:      https://github.com/oficina-equipo-test/probe/pull/new/equipo/probe-1795454216        \nremote: \n"
  },
  "workflow_file_push_refused": {
    "ok": true,
    "detail": "error: failed to push some refs to 'https://github.com/oficina-equipo-test/probe.git'"
  },
  "draft_pr_opened": {
    "ok": true,
    "detail": "status 201 draft=True"
  },
  "draft_marked_ready": {
    "ok": true,
    "detail": "graphql status 200"
  },
  "merge_refused_for_stale_sha": {
    "ok": true,
    "detail": "status 409 Head branch was modified. Review and try the merge again."
  },
  "check_runs_readable": {
    "ok": true,
    "detail": "status 200"
  },
  "commit_status_readable": {
    "ok": true,
    "detail": "status 200"
  },
  "actions_runs_readable": {
    "ok": true,
    "detail": "status 200"
  },
  "merge_pinned_to_judged_sha": {
    "ok": true,
    "detail": "status 200"
  },
  "merge_commit_has_two_parents": {
    "ok": true,
    "detail": "parents=2"
  },
  "token_revoked": {
    "ok": true,
    "detail": "status 204"
  },
  "revoked_token_refused": {
    "ok": true,
    "detail": "status 401"
  }
}
PASS
```

`probe-actions-20261123T171621Z.txt`:

```text
pushed True
{
  "actions_run_triggered_by_app_push": true,
  "status": "completed",
  "conclusion": "success",
  "event": "push"
}
check_runs_on_commit: 200 [('check', 'completed', 'success')]
```

## CARLOS egress: PASS

The controller confirmed this gate at about 19:12 UTC on 2026-11-23, using a
throwaway CARLOS app with default capabilities, as Equipo has, on the bds
fleet in Dublin, host `annie-welding`. It made the same unauthenticated
request to `https://api.github.com/meta`. The app was deleted afterward.
The two observed answers supplied by the controller were:

```text
https://api.github.com/meta reachable: true; status: 200; latency: 38ms; TLS peer: 4.208.26.200:443
https://api.github.com/meta reachable: true; status: 200; latency: 11ms; TLS peer: 4.208.26.200:443
```

The control, `www.google.com/generate_204`, returned 204. No GitHub credential
was used. This establishes CARLOS egress with Equipo's default capabilities
and meets the entry gate for implementing Connect GitHub.

The diagnostic command landed on main as `33fd8660`. It has not yet run in
the Equipo production instance. Running `check-github` there after the next
production upgrade remains confirmation. The temporary-app method was used
because staging restaging was blocked by an unrelated corrupt platform
replica of equipo-staging's database, tree `chat_events`, dating from
2026-11-23 12:00 to 12:30 UTC. Staging stayed on `474c4f61`; the controller
reported the production replica clean and did not bypass the release's
in-flight or backup checks.

## Gate 1 items still open

- Exercise every row of the merge response table, including review, branch
  protection, CI and merge queue cases, in the later merge implementation.
- Capture the workflow-push refusal cause line, as detailed below.

The completed checks above do not claim these remaining gates passed.

### Workflow refusal cause still to capture

The saved report retains only:

```text
error: failed to push some refs to 'https://github.com/oficina-equipo-test/probe.git'
```

It proves a nonzero push exit, but does not retain GitHub's cause line.
Capturing that exact remote refusal, specifically the missing workflows
permission, remains open. The complete merge table remains open as recorded
above. The organisation manifest flow, Actions on an App push and CARLOS
egress are confirmed, with the CARLOS method and production confirmation
remaining explicitly distinguished above.

## Branch A inventory-token gate, 2026-11-23 20:15 UTC

The controller ran `agent-tools/github-probe/probe_inventory.py` against the
probe GitHub App installed on `oficina-equipo-test`. It minted two tokens with
exactly metadata read, listed repositories, compared conditional requests with
the same token and a fresh token, attempted a contents read, and revoked both.
The script uses the controller's credentials outside the repository. Branch A
uses generated keys only. No token, key or ETag value is copied here; ETags in
this saved report are eight-character SHA-256 prefixes.

The token response may omit `repositories`, as it did for this all-repositories
installation. Item permission booleans are all false and do not establish reach.
A token change invalidates cached ETags. The metadata-only token remains in
instance memory until 30 seconds before its one-hour expiry or invalidation.

Verbatim sanitized report `probe-inventory-20261123T201513Z.txt`:

```json
{
  "calls": [
    {
      "call": "POST /app/installations/{id}/access_tokens {permissions:{metadata:read}} (token A)",
      "status": 201,
      "permissions": {
        "metadata": "read"
      },
      "repository_selection": "all",
      "repositories_field_present": false,
      "lifetime_s": 3600,
      "token_prefix": "ghs_"
    },
    {
      "call": "GET /installation/repositories?per_page=100 (token A, first)",
      "status": 200,
      "if_none_match_sent": false,
      "etag_hash": "20ff57d5",
      "etag_weak": false,
      "vary": "Accept, Authorization, Cookie, X-GitHub-OTP,Accept-Encoding, Accept, X-Requested-With",
      "cache_control": "private, max-age=60, s-maxage=60",
      "x_ratelimit_used_present": true,
      "total_count": 2,
      "repositories": [
        "probe",
        "probe-other"
      ],
      "repo_ids_present": true,
      "permissions_in_items": [
        "{\"admin\": false, \"maintain\": false, \"push\": false, \"triage\": false, \"pull\": false}"
      ]
    },
    {
      "call": "GET /installation/repositories?per_page=100 (token A, If-None-Match from token A)",
      "status": 304,
      "if_none_match_sent": true,
      "etag_hash": "20ff57d5",
      "etag_weak": false,
      "vary": "Accept, Authorization, Cookie, X-GitHub-OTP,Accept-Encoding, Accept, X-Requested-With",
      "cache_control": "private, max-age=60, s-maxage=60",
      "x_ratelimit_used_present": true,
      "total_count": null,
      "repositories": null,
      "repo_ids_present": null,
      "permissions_in_items": null
    },
    {
      "call": "POST /app/installations/{id}/access_tokens {permissions:{metadata:read}} (token B, fresh)",
      "status": 201,
      "permissions": {
        "metadata": "read"
      },
      "repository_selection": "all",
      "repositories_field_present": false,
      "lifetime_s": 3600,
      "token_prefix": "ghs_"
    },
    {
      "call": "GET /installation/repositories?per_page=100 (token B, If-None-Match from token A)",
      "status": 200,
      "if_none_match_sent": true,
      "etag_hash": "ce4399ed",
      "etag_weak": false,
      "vary": "Accept, Authorization, Cookie, X-GitHub-OTP,Accept-Encoding, Accept, X-Requested-With",
      "cache_control": "private, max-age=60, s-maxage=60",
      "x_ratelimit_used_present": true,
      "total_count": 2,
      "repositories": [
        "probe",
        "probe-other"
      ],
      "repo_ids_present": true,
      "permissions_in_items": [
        "{\"admin\": false, \"maintain\": false, \"push\": false, \"triage\": false, \"pull\": false}"
      ]
    },
    {
      "call": "GET /installation/repositories?per_page=100 (token B, unconditional)",
      "status": 200,
      "if_none_match_sent": false,
      "etag_hash": "ce4399ed",
      "etag_weak": false,
      "vary": "Accept, Authorization, Cookie, X-GitHub-OTP,Accept-Encoding, Accept, X-Requested-With",
      "cache_control": "private, max-age=60, s-maxage=60",
      "x_ratelimit_used_present": true,
      "total_count": 2,
      "repositories": [
        "probe",
        "probe-other"
      ],
      "repo_ids_present": true,
      "permissions_in_items": [
        "{\"admin\": false, \"maintain\": false, \"push\": false, \"triage\": false, \"pull\": false}"
      ]
    },
    {
      "call": "GET /installation/repositories?per_page=100 (token B, If-None-Match from token B)",
      "status": 304,
      "if_none_match_sent": true,
      "etag_hash": "ce4399ed",
      "etag_weak": false,
      "vary": "Accept, Authorization, Cookie, X-GitHub-OTP,Accept-Encoding, Accept, X-Requested-With",
      "cache_control": "private, max-age=60, s-maxage=60",
      "x_ratelimit_used_present": true,
      "total_count": null,
      "repositories": null,
      "repo_ids_present": null,
      "permissions_in_items": null
    },
    {
      "call": "GET /repos/{org}/probe/contents/README.md (token A)",
      "status": 403
    },
    {
      "call": "DELETE /installation/token (A)",
      "status": 204
    },
    {
      "call": "DELETE /installation/token (B)",
      "status": 204
    },
    {
      "call": "GET /installation/repositories after revoke (token A)",
      "status": 401
    }
  ],
  "installation": {
    "status": 200,
    "repository_selection": "all",
    "suspended_at": null
  },
  "etag_same_across_tokens": false
}
```
