You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 5a89572
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/proof/reconcile-throttle-resilience/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ Production run 31634514031-era evidence showed `inspected_targets=3`, `skipped_t
4
4
5
5
The code investigation found that parked REST checks, standard REST checks, and batched GraphQL canonical discovery all selected `GITHUB_TOKEN`. In the scheduled workflow that variable was `${{ github.token }}`, the same repository Actions credential used by the prior-artifact download and stuck-run Actions API remediation. Round 1 moved those reads to one OpenClaw installation token, which would have failed every target owned outside that installation.
6
6
7
-
The owner decision preserves cross-owner recovery. The operator now reuses the Worker's canonical GitHub App plumbing—`githubAppCredentials`, `signGithubAppJwt`, `githubAppInstallationId`, and `createGithubAppTokenFor`—to mint a read-only contents/issues/pull-request token for each target owner. Tokens and rejected setup promises are cached per owner for the cycle, and GraphQL batches are owner-homogeneous. A genuinely missing or revoked installation is a per-target `installation_missing` skip with a bounded sample; it never aborts the cycle. Repository artifact and Actions-run operations remain on `${{ github.token }}`.
7
+
The owner decision preserves cross-owner recovery. The operator now reuses the Worker's canonical GitHub App plumbing—`githubAppCredentials`, `signGithubAppJwt`, `githubAppInstallationId`, and `createGithubAppTokenFor`—to mint a read-only contents/issues/pull-request token for each target owner. Successful tokens and setup-throttle rejections are cached per owner for the cycle, while `installation_missing` rejections are cached per repository so a selected-repositories installation can still reach an accessible sibling repository. GraphQL batches are owner-homogeneous. A genuinely missing or revoked installation is a per-target `installation_missing` skip with a bounded sample; it never aborts the cycle. Repository artifact and Actions-run operations remain on `${{ github.token }}`.
8
8
9
9
Round 4 closes the rollout boundary: the operator defaults target reads to `github-app` mode and validates the App ID/private-key pair synchronously at startup. A missing ID, missing key, or missing pair is a hard error naming exactly the absent field. The repository Actions token is usable for target reads only through the explicit `EXACT_REVIEW_TARGET_TOKEN_MODE=actions` opt-in. Both checked-in operator workflows select `github-app`, and the scheduled steps pass the referenced private-key secret; the repository currently exposes that secret name.
Copy file name to clipboardExpand all lines: docs/proof/reconcile-throttle-resilience/behavior-contract.md
+9-8Lines changed: 9 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@
4
4
5
5
Exact-review dead-letter reconciliation in `github-app` target-token mode requires a complete App ID/private-key pair at process startup. Key-only, ID-only, and entirely absent App credentials fail before any queue or GitHub request and name the missing field; complete credentials proceed. The repository Actions token can never become an implicit fallback and remains available only through the explicit `actions` mode.
6
6
7
-
With complete App credentials, reconciliation mints target-read credentials from each target owner's GitHub App installation, caches both successful tokens and rejected setup promises per owner for the cycle, and uses successful tokens for public target REST and owner-homogeneous GraphQL reads. A missing or revoked installation becomes an `installation_missing` skip for that target while other owners continue. One isolated GitHub-confirmed rate-limit or abuse 403, or any 429, during installation lookup, token minting, or a target read skips only the affected target, owner, or GraphQL batch, so later owners and targets can still be inspected and recovered. A cached setup rejection contributes only one actual call to the shared three-consecutive-throttle fuse. Three distinct consecutive confirmed throttles stop further inspection in that phase, preserving a bounded per-cycle request budget. App-setup skips are structured as `github_throttled scope=app_setup`; genuine 401 and non-throttle 403 setup failures retain the conservative abort behavior.
7
+
With complete App credentials, reconciliation mints target-read credentials from each target owner's GitHub App installation and uses successful tokens for public target REST and owner-homogeneous GraphQL reads. Successful installation-scoped tokens and rejected setup throttles are cached per owner for the cycle; `installation_missing` rejections are cached per repository. A missing selected repository therefore becomes an `installation_missing` skip while a later accessible repository under the same owner is still looked up and recovered. One isolated GitHub-confirmed rate-limit or abuse 403, or any 429, during installation lookup, token minting, or a target read skips only the affected target, owner, or GraphQL batch, so later owners and targets can still be inspected and recovered. A cached setup-throttle rejection contributes only one actual call to the shared three-consecutive-throttle fuse. Three distinct consecutive confirmed throttles stop further inspection in that phase, preserving a bounded per-cycle request budget. App-setup skips are structured as `github_throttled scope=app_setup`; genuine 401 and non-throttle 403 setup failures retain the conservative abort behavior.
8
8
9
9
## Exercised surface
10
10
@@ -21,13 +21,14 @@ With complete App credentials, reconciliation mints target-read credentials from
21
21
5. Ordinary authorization 403s in serial REST discovery, GraphQL discovery, and recovery revalidation abort the remaining phase and recover nothing.
22
22
6. Every target REST and GraphQL request carries the synthetic target-App token while the workflow YAML retains `${{ github.token }}` for repository Actions work.
23
23
7. Two targets under different owners exercise real App JWT signing and loopback installation/token endpoints. The installed owner recovers with its minted token; the absent owner reports one `installation_missing` skip and sample; the cycle completes.
24
-
8. Three targets under one valid installation mint one owner token. An ordinary authorization 403 on the first target remains fail-closed and aborts the untouched targets.
25
-
9. Token minting for owner A returns 429 or a confirmed rate-limit 403. Three owner-A targets report structured `github_throttled scope=app_setup stage=token_mint` skips, the rejected mint is requested once, owner B mints successfully, and the cycle recovers owner B.
26
-
10. Installation lookup for owner A returns a confirmed rate-limit 403. Owner A skips with `stage=installation_lookup`, owner B recovers, and the cycle completes.
27
-
11. One throttled owner spans three owner-homogeneous GraphQL batches. The cached rejection skips all 81 owner targets but counts once toward the fuse; the later healthy owner is inspected and recovered.
28
-
12. Three distinct owners return setup throttles. The shared fuse stops before a fourth owner's lookup or mint, bounding setup traffic to three calls.
29
-
13. Installation lookup and token minting each return genuine 401 and non-throttle 403 responses. Every variant keeps the fail-closed abort, while a 404 race between lookup and mint retains the prior bounded `installation_missing` behavior.
30
-
14. The real operator process runs the App-credential startup matrix: private-key only fails naming the App ID, App ID only fails naming the private key, neither fails naming both, and both proceed. The same credential-less fixture succeeds only after explicitly selecting `actions` mode. The scheduled and manual workflow YAML both select `github-app` and pass the private-key secret while retaining `${{ github.token }}` solely for repository-owned work.
24
+
8. Two repositories under one selected-repositories installation are checked in one cycle. Repository A returns an installation 404 and is skipped as `installation_missing`; repository B receives its own lookup, mints successfully, and recovers.
25
+
9. Three targets under one valid installation mint one owner token. An ordinary authorization 403 on the first target remains fail-closed and aborts the untouched targets.
26
+
10. Token minting for owner A returns 429 or a confirmed rate-limit 403. Three owner-A targets report structured `github_throttled scope=app_setup stage=token_mint` skips, the rejected mint is requested once, owner B mints successfully, and the cycle recovers owner B.
27
+
11. Installation lookup for owner A returns a confirmed rate-limit 403. Owner A skips with `stage=installation_lookup`, owner B recovers, and the cycle completes.
28
+
12. One throttled owner spans three owner-homogeneous GraphQL batches. The cached rejection skips all 81 owner targets but counts once toward the fuse; the later healthy owner is inspected and recovered.
29
+
13. Three distinct owners return setup throttles. The shared fuse stops before a fourth owner's lookup or mint, bounding setup traffic to three calls.
30
+
14. Installation lookup and token minting each return genuine 401 and non-throttle 403 responses. Every variant keeps the fail-closed abort, while a 404 race between lookup and mint retains the prior bounded `installation_missing` behavior.
31
+
15. The real operator process runs the App-credential startup matrix: private-key only fails naming the App ID, App ID only fails naming the private key, neither fails naming both, and both proceed. The same credential-less fixture succeeds only after explicitly selecting `actions` mode. The scheduled and manual workflow YAML both select `github-app` and pass the private-key secret while retaining `${{ github.token }}` solely for repository-owned work.
The green path makes `github-app` the default target-token mode, validates the App ID/private-key pair synchronously at startup, and returns the repository token only when `EXACT_REVIEW_TARGET_TOKEN_MODE=actions` is explicit. Key-only fails naming the missing App ID, ID-only fails naming the missing private key, neither fails naming both, and both proceeds. The scheduled and manual workflows now select `github-app`; repository settings expose the referenced private-key secret, so the inspected scheduled lane was fully configured, while any future missing secret will fail the cycle visibly instead of recreating the throttle.
74
74
75
75
The focused workflow/matrix selection passed 3/3 and the complete operator file passed 79/79 on Node 24. The final Docker receipt and full gate results are recorded in `receipt.json` and the PR body.
The round-5 red phase taught the loopback fixture to resolve installations by full `owner/repo` when supplied, then added one cycle containing a missing repository followed by an accessible repository under the same owner. Against the owner-level rejected-promise cache, the new regression failed while both existing owner-throttle cases remained green:
80
+
81
+
```text
82
+
tests 3
83
+
pass 2
84
+
fail 1
85
+
86
+
AssertionError: expected recovered_targets 1, actual 0
87
+
```
88
+
89
+
The green implementation keeps in-flight and rejected installation-missing mints under a normalized repository key. Only a successful installation token or a confirmed setup throttle is promoted to the owner cache. The same selection passed 3/3, including both 429 and confirmed-403 owner-throttle cases, and the complete operator file passed 80/80 on Node 24.
0 commit comments