Repository navigation
refactor: import GitHub execution and context directly - #1905
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR replaces GitHub execution and context factories with direct imports, isolates mutation runners by command, and removes backtracking from Accept-header parsing. Example: Two overlapping commands PATCH issues 1 and 2.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR remains useful work absent from current main; the updated authority traces resolve the previous review’s evidence gap, and no actionable introduced defect was found. Priority: P3 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherReview and apply commands use the GitHub execution layer to turn context reads and guarded mutation requests into subprocess calls, parsed responses, and mutation receipts. flowchart TD
A[CLI command] --> B[Command data scope]
A --> C[Mutation receipt scope]
B --> D[GitHub context reads]
C --> E[Apply authority checks]
D --> F[GitHub execution]
E --> F
F --> G[GitHub transport]
Technical reviewBest possible solution: Land the direct-import cutover with command-local mutation ownership and the existing per-attempt authorization guards intact. Do we have a high-confidence way to reproduce the issue? This is primarily a refactor; supplied base-versus-head executable traces additionally demonstrate overlapping receipt misattribution on the base and isolation on the candidate. Is this the best way to solve the issue? Direct imports remove the obsolete factories while command scopes preserve independent receipt ownership and existing transport, retry, and authority checks. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 70cfbb0677b2. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (3 earlier review cycles)Reviewed October 10, 2026, 11:51 AM ET / 15:51 UTC (Revision 4). |
40f30d5 to
6f8ca66
Compare
0d278a6 to
721fa89
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: refactor: import GitHub execution and context directly This is item 1/1 in the current shard. Shard 0/1. This temporary status tracks the active review worker. The completed review will appear in the durable ClawSweeper review comment. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
721fa89 to
c6bfa98
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Authority-separation repair and current proof
Current head:
271e40eec00ed12dc45ee5e91a3ac3a45b84de74. The hosted security concern was an evidence gap; no publication-authority bypass was found. The real apply owner still selects the restricted runner for every mutation request, including retries. The CodeQL alert is fixed rather than dismissed.Native macOS arm64, Node v24.21.0; Pueue 1716 runs the real
node dist/clawsweeper.js apply-decisionswith temporary report/closed directories,--skip-dashboard, and executable GitHub/coordinator fixtures. A read-only Node load hook adds an observation callback immediately after the real apply owner installs its unchanged runner. The callback supplies forbidden mutation attempts throughghObservedMutationCommand; it does not substitute a permissive apply callback. The ordinary allowed comment is then published by the unmodified apply workflow.record_comment_onlypublicationmanual publication forbids this mutation; zero forbidden GitHub mutation dispatches.f58fc2d9, successful imports, sequential control and four executable PATCH requests precede the failing overlap assertion: receipts[[], [command_1, command_2]]. Candidate returns[[command_1], [command_2]].Redacted trace (synthetic item identity; no credentials, IPs or private endpoints):
Retained drivers and raw traces:
~/Developer/.agents/handoffs/clawsweeper-row3/1905-authority/(run.mjs,preload.mjs,head-271e40eec/,receipt-overlap-negative-control.mjs,receipt-overlap-sMyyRl/,validation-logs.json). The baseline fails specifically atoverlapping commands must retain their own mutation receipt runner, not an import or fixture failure; both sequential controls and all four executable requests pass.Limits: controlled executable transports, not live GitHub writes or a deployed coordinator. The overlapping review side exercises the production command receipt-scope owner, not a full model-backed review; the restricted side is the actual apply owner. Coordinator HTTP 409 replay and the real Worker ABA/expiry tests are complementary, not a claim of a deployed end-to-end queue call. No live apply, merge or deployment occurred. Early fixture setup failures (missing reviewed revision/lease tuple and invalid short head SHA) were corrected before the retained successful run; no production authority guard was weakened.
CodeQL disposition and validation
The failed check annotation at candidate line 628 is “Polynomial regular expression used on uncontrolled data.” Archived main has the identical expression at line 621. This explains the moved-line attribution but does not excuse the alert: replace the backtracking expression with fixed-prefix parsing, whitespace trimming and explicit line-terminator checks. Runtime-to-ETag-broker cases preserve case-insensitive headers, duplicate-header precedence, empty/whitespace-only behavior, long whitespace prefixes and malformed line terminators.
pnpm run build:all: passed (Pueue 1708, before the test-fixture-only correction).pnpm run lintandpnpm run format:check: passed (Pueue 1715).codex review --base origin/main: no actionable defects; its independent build and 114 focused tests also passed (Pueue 1715).-i; fixed the executable fixture to honor the real invocation before the successful run.OpenClaw Bay is unaffected: no observer payload, schema or status contract changes. Merge danger is a two-way door (revert restores the former implementation); blast radius is command mutation-runner selection and durable ETag cache-key parsing. Hosted CodeQL/CI for this new head remain to be observed.
Summary
Row 3 slice 4b, now rebased onto
origin/main(f58fc2d9de10b383b9f6505f157c53f73bef6472) after #1898 was squash-merged. The original refactor commit isc6bfa988958fb868ef1e89184084ebcbe341ae9d; the authority-proof/CodeQL repair head is recorded above.createGitHubExecution,createGitHubContext, and the test-only execution wrappers; production, tests and proof callers use plain imports.--paginate --slurpoutput shape and isolated per-case cleanup.No schema, stored-format or Bay contract change. No new production adapters.
Previous-head shipped-CLI equivalence proof
Claim: direct imports preserve repository routing, JSON parsing, retry behavior, terminal throttling, requests and credential selection.
Driver:
~/Developer/.agents/handoffs/clawsweeper-row3/github-cli-revision-proof.mjs.The baseline executable has main's GitHub runtime/context at
f58fc2d9de10b383b9f6505f157c53f73bef6472(built in the queue-part-2 worktree; its additional queue commands do not participate in this CLI). Candidate is the head above. 8/8 actualnode dist/clawsweeper.js reserve-review-leasesubprocess comparisons passed, with identical stdout, exit status, request traces and error classes:Full arm traces and summary:
~/Developer/.agents/handoffs/clawsweeper-row3/slice4b-restack-proof/(Pueue 1675).Previous-head validation
Pueue 1675, native macOS arm64, Node v24.21.0:
pnpm run build:allpassed.node scripts/e2e/ci-comment-read-budget.mjs, its--inlinemode,graphql-activity-cursor-v2-loopback.mjs, andpublication-quota-budget.mjspassed.pnpm run lintandpnpm run format:checkpassed.codex review --base origin/main: no actionable defects; reviewer also passed 87 focused tests and the GraphQL loopback check.node:24.21.0-bookworm, network disabled:docs/proof/hydration-deadline/run-proof.mjs --source-root <current-worktree> --expected-head c6bfa988958fb868ef1e89184084ebcbe341ae9d --expect candidatepassed. Output:~/Developer/.agents/handoffs/clawsweeper-row3/hydration-1905-restack/; result SHA-256278e37981fe3e77c5631bc1609ddfdeae47b24ed39bd4b6ac42f58a2a65b940c.~/Developer/.agents/handoffs/clawsweeper-row3/hydration-1905-restack-history/. The driver preserves independent SIGTERM, child exit/identity, no-metadata-response, no-fetch and missing-blob assertions; it observes the retry boundary'sGitHubOperationDeadlineErrorand admitted deadline.The initial restack exposed the inherited factory-based context test; it was migrated rather than restoring a compatibility factory. An intermediate run also observed an ETag fixture JSON parse failure; no ETag production change was made, and that test passed in the final 302-test run.
Limits: not the full suite; controlled transports do not measure production throughput or real quota accounting. The CLI fixture covers closed-item reservation, not lease creation or a deployed Worker. No live GitHub or Worker mutation occurred. No report-reading/retention changes, so the 80k report-memory proof is inapplicable. OpenClaw Bay is unaffected because no payload or status contract changes. Slice 5 remains separate. No merge or deployment is requested.