|
| 1 | +# GraphQL PR activity cursor v2 proof |
| 2 | + |
| 3 | +- Status: historical proof artifact |
| 4 | +- Owner: ClawSweeper publication maintainers |
| 5 | +- Tested source: `openclaw/clawsweeper@221ba1c2cd159dfbc7c2e5a5fb12dbad73467bd7` |
| 6 | +- Update when: the v2 query, decoder, fallback, stability wrapper, or batch bound changes |
| 7 | + |
| 8 | +## Claim and exercised surface |
| 9 | + |
| 10 | +The controlled loopback scenario exercises the production cursor/query decoder |
| 11 | +through `createGitHubContext`: one stable v1 check performs reviews REST, inline |
| 12 | +review-comments REST, and GraphQL review-thread reads twice; v2 replaces those |
| 13 | +six requests with two complete GraphQL snapshots. The batch scenario aliases |
| 14 | +eight PRs and preserves the same two-read invariant while reducing 48 requests |
| 15 | +to two. |
| 16 | + |
| 17 | +Fixtures cover inline-comment edits, review dismissal, thread resolution, |
| 18 | +force-push handling through the unchanged head guard, and activity arriving |
| 19 | +between the two reads. A partial nested comment connection activates the full |
| 20 | +v1 reader, preserves the v1 decision, and emits one structured |
| 21 | +`reviewed_pr_activity_cursor_v2_fallback` line. |
| 22 | + |
| 23 | +The migration deliberately re-baselines persisted v1 reports. GitHub GraphQL |
| 24 | +does not expose REST's immutable `side` and `start_side` fields, so a v1/v2 |
| 25 | +comparison returns `rebaseline`; apply reports “cursor version requires a fresh |
| 26 | +review” and never claims that target activity changed. Fresh reports persist |
| 27 | +v2 cursors. |
| 28 | + |
| 29 | +OpenClaw Bay is unaffected. This changes internal GitHub read transport and |
| 30 | +cursor comparison only; it does not change Bay's observer-only status contract, |
| 31 | +public fields, lanes, or action boundary. |
| 32 | + |
| 33 | +## Environment and command |
| 34 | + |
| 35 | +The proof ran through Crabbox's explicitly selected Docker-backed |
| 36 | +`local-container` provider on Ubuntu 26.04/arm64 with Node 24.19.0 and pnpm |
| 37 | +11.10.0. The successful one-shot lease was `cbx_d96385e7eb89` and was stopped |
| 38 | +automatically. |
| 39 | + |
| 40 | +```bash |
| 41 | +proof_source_head="$(git rev-parse HEAD)" |
| 42 | +proof_source_tree="$(git rev-parse 'HEAD^{tree}')" |
| 43 | +git cat-file -e "${proof_source_head}^{commit}" |
| 44 | +git cat-file -e "${proof_source_tree}^{tree}" |
| 45 | +PROOF_SOURCE_HEAD="$proof_source_head" PROOF_SOURCE_TREE="$proof_source_tree" \ |
| 46 | + /Users/steipete/Projects/crabbox/bin/crabbox run \ |
| 47 | + --provider local-container --no-hydrate \ |
| 48 | + --allow-env PROOF_SOURCE_HEAD,PROOF_SOURCE_TREE \ |
| 49 | + --preflight --timing-json --shell -- \ |
| 50 | + "bash scripts/e2e/run-graphql-activity-cursor-v2-container.sh" |
| 51 | +``` |
| 52 | + |
| 53 | +Local-container Actions hydration could not execute the repository's |
| 54 | +`pnpm/action-setup` step, so the checked-in wrapper follows Crabbox's documented |
| 55 | +`--no-hydrate` recovery: it installs a checksummed Node 24.19.0 tarball in the |
| 56 | +ephemeral container, enables the repository-pinned Corepack/pnpm version, |
| 57 | +builds all TypeScript targets, and runs the loopback scenario. |
| 58 | + |
| 59 | +## Static verification recipe |
| 60 | + |
| 61 | +Run from the repository root. The final command proves the tested source is |
| 62 | +followed only by this proof directory, avoiding a self-referential commit hash |
| 63 | +inside its own receipt. |
| 64 | + |
| 65 | +```bash |
| 66 | +receipt="docs/proof/graphql-activity-cursor-v2/receipt.json" |
| 67 | +jq -e ' |
| 68 | + .schema_version == 1 and |
| 69 | + .crabbox.provider == "local-container" and |
| 70 | + .crabbox.runtime == "docker" and |
| 71 | + .crabbox.exit_code == 0 and |
| 72 | + .crabbox.run_status == "succeeded" and |
| 73 | + .crabbox.lease_stopped == true and |
| 74 | + .requests.single == {"v1": 6, "v2": 2} and |
| 75 | + .requests.batch == {"size": 8, "v1": 48, "v2": 2} and |
| 76 | + .assertions.single_request_reduction == true and |
| 77 | + .assertions.batch_request_reduction == true and |
| 78 | + .assertions.fallback_decision_unchanged == true and |
| 79 | + .assertions.fallback_telemetry_lines == 1 and |
| 80 | + .assertions.concurrent_change_unstable == true and |
| 81 | + .assertions.double_read_preserved == true |
| 82 | +' "$receipt" |
| 83 | +tested_head="$(jq -r '.source.head' "$receipt")" |
| 84 | +tested_tree="$(jq -r '.source.tree' "$receipt")" |
| 85 | +git cat-file -e "${tested_head}^{commit}" |
| 86 | +git cat-file -e "${tested_tree}^{tree}" |
| 87 | +test "$(git rev-parse "${tested_head}^{tree}")" = "$tested_tree" |
| 88 | +test -z "$(git diff --name-only "$tested_head"..HEAD -- . \ |
| 89 | + ':(exclude)docs/proof/graphql-activity-cursor-v2/**')" |
| 90 | +``` |
| 91 | + |
| 92 | +The receipt does not claim live GitHub mutation coverage. It proves request |
| 93 | +shape, bounded decoding, fallback, migration behavior, and race detection; the |
| 94 | +repository's full check supplies static, unit, integration, and coverage gates. |
0 commit comments