Skip to content

Commit b7b77bd

Browse files
committed
docs(proof): record GraphQL cursor v2 validation
1 parent 221ba1c commit b7b77bd

2 files changed

Lines changed: 146 additions & 0 deletions

File tree

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
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.
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"schema_version": 1,
3+
"recorded_at": "2026-08-14T03:46:00Z",
4+
"claim": "The v2 GraphQL cursor preserves stable PR activity decisions while reducing one check from six requests to two and an eight-PR batch from forty-eight requests to two.",
5+
"source": {
6+
"head": "221ba1c2cd159dfbc7c2e5a5fb12dbad73467bd7",
7+
"tree": "0f041426798f21da69efd4214bcc2912672db3e2",
8+
"commit_object_verified": true,
9+
"tree_object_verified": true
10+
},
11+
"crabbox": {
12+
"provider": "local-container",
13+
"lease_id": "cbx_d96385e7eb89",
14+
"slug": "harbor-krill-8b2b",
15+
"runtime": "docker",
16+
"image": "ubuntu:26.04",
17+
"architecture": "arm64",
18+
"node": "v24.19.0",
19+
"pnpm": "11.10.0",
20+
"exit_code": 0,
21+
"run_status": "succeeded",
22+
"lease_stopped": true,
23+
"total_ms": 10799
24+
},
25+
"transport": "loopback HTTP via GITHUB_API_URL and GITHUB_GRAPHQL_URL",
26+
"requests": {
27+
"single": {
28+
"v1": 6,
29+
"v2": 2
30+
},
31+
"batch": {
32+
"size": 8,
33+
"v1": 48,
34+
"v2": 2
35+
},
36+
"fail_closed_fallback": 7,
37+
"concurrent_change": 2
38+
},
39+
"assertions": {
40+
"single_request_reduction": true,
41+
"batch_request_reduction": true,
42+
"fallback_decision_unchanged": true,
43+
"fallback_telemetry_lines": 1,
44+
"concurrent_change_unstable": true,
45+
"double_read_preserved": true
46+
},
47+
"limits": [
48+
"The proof uses deterministic loopback GitHub fixtures rather than live target mutations.",
49+
"Connections over 100 reviews, 100 threads, or 100 comments per thread intentionally activate the complete v1 path.",
50+
"The receipt source commit precedes only this proof-artifact commit; the verification recipe rejects any intervening non-proof change."
51+
]
52+
}

0 commit comments

Comments
 (0)