Repository navigation
fix(ci): drain plugin publication Git before trust and readback - #133368
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 30, 2026, 4:36 PM ET / 20:36 UTC. ClawSweeper reviewWhat this changesThe PR replaces direct Git commands in plugin ClawHub and npm publication workflows with the shared drained-process owner, adds exact-source readback fencing, and updates runner lifecycle coverage. Regression provenancePossible regression — probable (reviewed change; failure trace). No predecessor PR is attributed. Merge readinessNo introduced correctness or security defect was found, but this maintainer-authored, security-sensitive publication-workflow change should remain open for exact-head CI completion and release-owner review. Priority: P2 Review scores
Verification
How this fits togetherPlugin publication workflows fetch repository state, verify a publish target, then pass package metadata to npm or ClawHub publication steps. The shared Git owner is the process boundary between Git execution and later trust, hashing, and publication decisions. flowchart LR
A[Release dispatch] --> B[Plugin publication workflow]
B --> C[Shared Git process owner]
C --> D[Fetch and inspect repository state]
D --> E[Trust and artifact validation]
E --> F[Publication route]
C --> G[Process cleanup and cancellation fence]
Decision needed
Why: The patch changes OIDC-adjacent publication admission and is labeled for maintainer handling; source review can assess implementation but cannot substitute for release-owner acceptance of that enforcement boundary. Before merge
Agent review detailsSecurityNone. PR surfaceTests +651, Docs +2, Config +298, Other +15. Total +966 across 21 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the single drained Git-owner boundary, merge only after exact-head CI and release-workflow review confirm the protected publish and normal publish paths; the added policy cannot be absorbed into selected source checkouts without weakening the trusted-policy boundary. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: the dedicated lifecycle suite names the process-tree, cancellation, ancestry, and readback failure cases at the changed owner boundary, though this review did not execute it. Is this the best way to solve the issue? Yes: routing Git through the existing isolated owner preserves the workflow-specific trust checks while ensuring results are not consumed before process cleanup. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against af8dad8e9e32. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (6 earlier review cycles)
|
|
The late resolver P1 was checked against the raw parent, current workflow, downstream publication gates, and canonical owner. I am retaining the existing fallback contract, not accepting it as an introduced trust bypass. The pre-migration resolver already used Resolution is not publication authorization. The selected commit must still pass workflow-SHA or protected exact-tag binding, then independent main/release/matching-alpha ancestry, before the exact-SHA pack and environment-approved publication chain. Only ancestry status 1 advances to another trust source; enumeration failure is terminal. The canonical owner raises ordinary The review did identify an overbroad docs sentence. It is corrected to distinguish resolver fallback from ancestry admission, and to name the unconditional main/release versus optional release-tag fetch accurately. The existing terminal test now injects failure/cancellation inside the local verification probe with an available origin candidate, and checks that no second matching probe occurs. All 80 lifecycle cases passed again, the changed gate passed, and fresh autoreview of the refinement was scoped-clean at its configured P0 threshold. No workflow policy or timeout changed. The rebase candidate was pushed at The production-growth concern is also accounted for: net +298 is confined to workflow-owned typed policy, four pinned owner placements, and two exact-byte readback boundaries. Moving those policies into the selected publication source would break the trusted-policy boundary; the shared supervisor remains unchanged. After reusing the upstream finalizers and canonical Node flags, the installed-Vitest runner repair is production/tooling net -1, so the whole PR is net +297 production/tooling lines. It removes the redundant package-manager bootstrap rather than adding a cache or network workaround. A subsequent review accepted the preserved resolver contract and raised a separate P2 about batch Node defaults. That is fixed in Final land-ready head: The intervening CI failure also exposed a deterministic shared-runner admission lifecycle gap. The final cleanup fences already-suspended waiters before asynchronous teardown, then retires old roots/continuations with one canonical late reset. It composes with the independently landed basic reset, retaining upstream tests and deleting duplication. Ordered child-runner proof passed all 36 behavior fixtures; mock-resolution 7/7 and unchanged desktop-shutdown 6/6 passed. The original frozen CI selection passed 2,929 tests with this same runner repair. The original CI producer remains unattributed: this proves file-boundary cleanup, not comprehensive orphan-task joining. Fresh composed-tree checks and complete-candidate scoped autoreview passed at the configured P0 threshold. The latest exact-head review has no actionable correctness/security finding. Its requested conflict reconciliation and exact-head workflow/lifecycle proof are complete. Release-owner authority for the explicit maintainer-directed landing was verified, as were CODEOWNERS and live main rules: the required CI gate is satisfied and no additional independent-review rule is enforced. This accepts the existing publication trust policy, not new publication authority; workflow/tag binding, ancestry, immutable evidence, and environment approval remain intact. Proceeding through native prepare/merge, with no registry publication or release. |
6f3f4c2 to
447374c
Compare
Remove the redundant pnpm bootstrap and keep orchestration alive until child cleanup and cancellation report completion. Preserve native signal termination across Vite's signal-exit hook.
Document the preserved ordinary probe fallback separately from trust admission. Exercise terminal cleanup and cancellation inside that probe and forbid repeated matching operations.
Use the existing Vitest Node-argument resolver with the supplied batch environment. Exercise default and explicit Maglev opt-in behavior through the real installed CLI with no package-manager PATH.
Fence suspended admission waiters before existing asynchronous cleanup, then retire prior roots and reopen admission before module invalidation. Prove the boundary with ordered native producer/observer fixtures without changing Gateway runtime or shutdown assertions.
8251b2a to
030a37c
Compare
|
Merged via squash.
|
…claw#133368) * ci: own plugin publication Git lifecycle * fix(testing): run offline batches with installed Vitest Remove the redundant pnpm bootstrap and keep orchestration alive until child cleanup and cancellation report completion. Preserve native signal termination across Vite's signal-exit hook. * test(ci): clarify plugin ref fallback ownership Document the preserved ordinary probe fallback separately from trust admission. Exercise terminal cleanup and cancellation inside that probe and forbid repeated matching operations. * fix(testing): honor canonical Node flags in batches Use the existing Vitest Node-argument resolver with the supplied batch environment. Exercise default and explicit Maglev opt-in behavior through the real installed CLI with no package-manager PATH. * test: retire gateway admission between files Fence suspended admission waiters before existing asynchronous cleanup, then retire prior roots and reopen admission before module invalidation. Prove the boundary with ordered native producer/observer fixtures without changing Gateway runtime or shutdown assertions.
Related: Git lifecycle ownership campaign.
What Problem This Solves
Fixes an issue where plugin ClawHub or npm publication could select a trust fallback, publish a target SHA, hash source metadata, or invoke publication consumers after GNU
timeoutobserved only the Git leader while child or grandchild writers were still alive.The affected workflows also flattened Git inspection failures into product decisions: main ancestry errors could look like “try release/*,” release-ref enumeration failure could look like no release branches, and incomplete
git showoutput could be redirected into a sourcepackage.jsonfile before hashing and immutable evidence verification.Why This Change Was Made
Plugin ClawHub Release and Plugin NPM Release now prepare the reviewed canonical owner at
dd4528b6393e7d00063067a080ca7241b48ce475before selected-source or trusted-tooling checkout.Trusted inline policies own ClawHub target resolution, protected-tag validation, and main/release/alpha trust; npm target resolution, preflight/extended-stable identity, and main/release/alpha trust; and both exact source-package readbacks. In ancestry admission, only documented merge-base status
1advances to another trust source; other ancestry errors and release-ref enumeration failures are terminal. ClawHub deliberately preserves local-to-origin ref fallback after safely drained ordinary probe failures, as the original shellif/elifdid. Resolving that candidate does not authorize publication: independent workflow-SHA/protected-tag binding and trusted ancestry still apply. Owner setup/inspection/cleanup failure and cancellation are terminal throughout, including at the resolver fallback boundary.The migration preserves existing transport contracts: ClawHub retains three possible 120-second fetch sites; npm retains five; local probes, checkout, ref enumeration, ancestry, and object reads remain unbounded; no Git retry or backoff was added. Npm's separate 300-second token-bootstrap publication deadline is unchanged.
Both npm readback paths now write source
package.jsonbytes only after the exact depth-one fetch and unboundedgit showhave completed and drained. The publish-side chain is split only at its existing artifact-download → Git-read → evidence-verification ordering, with the same artifact metadata, protected parent identity, and publication output contract.Push-triggered plugin range discovery and ClawHub base-manifest history remain separately owned by their Node callers. This PR claims explicit workflow Git adoption only; those local owners remain a later serialized batch.
User Impact
There is no OpenClaw runtime behavior change. Release operators get deterministic plugin publication evidence: target SHAs, branch trust, exact package bytes, hashes, and publication routes are consumed only after every preceding Git process tree is verified extinct.
No release, npm/ClawHub publication, credentialed Git transport, remote tag mutation, version bump, changelog change, or credential-bearing release workflow was executed by this PR. Live proof uses disposable synthetic repositories and anonymous read-only GitHub transport.
Evidence
Live proof on
a9b5770377474d02f7d8eb1b198ddd5cd6052b55: 23/23 actual YAML-policy scenarios passed against real Git 2.54.0 and Python 3.9.6, using disposablefile://bare repositories with no mocked Git, process owner, or clock. The proof covered main/release/alpha admission, uppercase preflight SHA, preflight alpha exclusion, untrusted commits, current/stale extended-stable tips, remote-only branch resolution, annotated/lightweight tags and protected-tooling binding, missing refs, and both source readback paths. CRLF, UTF-8, and trailing newlines remained byte-identical (SHA-256e789b80a2d42ade9a3aef12f9534f5bf4a5ccb1974c97a0f8cc9c2cfe047bc47); missing blobs exited 128 without creating a readback file. Separately, an anonymous HTTPSls-remotethrough the exact pinned owner matched the PR head, retaining an unbounded operation deadline. No publication credentials were used.The first exact-head CI run failed eight report-owner batch cases at Corepack bootstrap, not plugin policy execution; Workflow Sanity passed. Commit
510eafd548cfef8424071fd09d4576b5c65cbf31repairs the installed-tool owner: the batch runner now resolves installed Vitest through the existing resolver and runs it directly through the existing owned process launcher. The redundantpnpm exechop, fixture bootstrap, and fake-pnpm tests are deleted. No network enablement, Corepack cache reader, dependency change, or new configuration is involved. Plugin workflow bytes are unchanged from the live-tested head.Full runner proof also exposed two cancellation races. The project orchestrator no longer competes with its leaf's 100 ms force-kill timer, so it can join children and write the cancellation receipt. Vite/Rolldown's already-loaded signal-exit hook also needs the process kept alive while it reraises native SIGTERM, or a numeric 143 exit can win. Direct dependency source was inspected; pre-fix native cancellation failed three times, and the initial repaired batch and project paths each passed three times with native SIGTERM, a recorded cancellation, and the next sibling unstarted.
While this PR was validating, the performance-fixture repair landed the same signal-finalization fix using the existing
waitForeverprimitive. The resulting real merge conflict was resolved by retaining both upstream finalizer files byte-for-byte and deleting this branch's alternative implementation. This PR now changes only the installed-Vitest launch and orchestrator lifetime; it does not carry a duplicate signal finalizer. The leaf kill budget and outer escape deadline are unchanged.Final candidate:
030a37c1f9fab0d20e6e854b79412d24e01be5eb. The preceding rebased head passed CI 33326714005 and Workflow Sanity 33326714043, plus 382 runner and 644 workflow/routing tests. Its latest review accepted the preserved ref fallback but identified the direct batch launch's missing canonical Node flags.That follow-up is fixed by calling the existing
resolveVitestNodeArgs(params.env)before the installed CLI entrypoint. The real native-launch regression failed before the fix because default--no-maglevwas absent; the explicit opt-in case passed. Both pass after the fix, including an opt-in supplied through the batch environment rather than the outer process. The complete runner proof now passes 383 tests (59 report-owner, 158 extension-runner, 128 Vitest-runner, 38 process-group), and scoped changed checks and fresh review of the correction passed. The complete preceding candidate and each subsequent correction received scoped-clean Codex review at the configured P0 threshold, not all-priority certification. Plugin workflow bytes remain identical to the 23-scenario live-tested version. The final head passed CI 33333690352, including the requiredopenclaw/ci-gate, and Workflow Sanity 33333690343. No failing check remained in the final inspected rollup.A subsequent CI run on the Node-flag correction failed the first desktop-shutdown case with one unexpected active Gateway admission. Investigation found a separate, deterministic shared-runner lifecycle gap: Gateway admission is process-global but is not registered for generic singleton teardown, so module invalidation could carry its roots and fences into another test file.
The shared runner now fences already-suspended admission waiters before existing asynchronous cleanup, then uses the canonical admission reset after lifecycle/DOM teardown and before module invalidation. The ordered native producer/observer regression failed with the same expected-0/received-1 state before repair; it also caught a reset-only partial repair reopening an old waiter. The final regression verifies old waiter rejection, stale continuation rejection, zero carried roots, and fresh admission. No production Gateway code, shutdown assertion, test deadline, or retry policy changed.
Final proof for that cleanup: the real child-Vitest regression passed all 36 behavior fixtures with only its intentionally failing collection fixture; mock-resolution siblings passed 7/7; unchanged desktop-shutdown cases passed 6/6; and the frozen 196-file/two-worker selection at exact failed CI merge
d4691eb4483bda764e8c7e1453db9b38aa0832c8passed 2,929 tests with the scoped repair applied. Final changed checks and fresh full-candidate scoped autoreview passed. The original CI producer is still unattributed: unmodified local shard and ordering probes also passed, so this is a demonstrated file-boundary repair, not a claim to have identified every unfinished asynchronous operation.A second real merge conflict arose when the diagnostic lifecycle repair independently added the basic admission reset. The final candidate rebases onto
d37f9a1ad68359e7f4256bf6e4ec4602eb32806d, retains the upstream root/draining assertions, reuses its fixture path, and keeps exactly one late reset plus the early suspended-waiter fence. The runner and both publication workflow files remain byte-identical to the previously tested8251b2a7fa5bf76b13aa749448dd74caa75fc27dversions. On the composed tree, the ordered child-runner regression, 7 mock-resolution tests, 6 unchanged shutdown tests, changed gates, and fresh complete-candidate scoped autoreview passed. The final head then passed 876 tests across five workflow/routing suites, including all 80 plugin lifecycle cases and 233 observed extinction boundaries; all fixture cleanup completed. Two Linux-only workflow guards were skipped on macOS. Fresh 23/23 real-Git actual-YAML scenarios and anonymous HTTPS exact-head readback also passed. Exact-head hosted CI and Workflow Sanity are green; the conflicting head's missing CI was never treated as passing proof.Final workflow/routing command:
124/125/143; timeout; setup/cleanup failure; cancellation; local-to-origin target fallback; protected tags; main/release/alpha ordering; extended-stable exact-tip admission; enumeration errors; exact source bytes; partial-output rejection; and readback consumer fences.a9b57703774.actionlint, parsed non-migrated workflow equivalence, docs inventory, no-direct-Git checks,git diff --check, targeted formatting, and mandatory autoreview passed with no accepted finding.pre-commit==4.6.2. No dependency or pin was changed; exact-head Workflow Sanity 33333690343 passed as the authoritative hosted check.Final candidate validation for the runner repair:
Commands for the focused runner proof:
node scripts/run-vitest.mjs run --config test/vitest/vitest.tooling.config.ts --configLoader runner test/scripts/run-vitest-state-cleanup.test.ts -t 'batch.*cleans its namespace'The late resolver finding is addressed in the source-backed review disposition. The fallback policy is deliberately preserved, not treated as new publication authority. Documentation now distinguishes ordinary probe fallback from terminal ancestry/owner failures and names the unconditional versus optional fetches accurately. The existing cancellation/cleanup test now exercises the local verification probe with an available origin candidate and forbids a second matching operation. The complete 80-case lifecycle matrix passed again, the two-file changed gate passed, and fresh Codex autoreview of that refinement returned scoped-clean at the configured P0 threshold. No production workflow bytes changed.
Commands for the final shared-runner cleanup proof:
The full snapshot proof used
scripts/ci-run-node-test-shard.mtswith the linked failed job's originalOPENCLAW_NODE_TEST_GROUPS_JSONand two-worker setting. Every selected file was required to exist; the missing-on-branch queued-collector test was preserved by applying only the two-file repair to the exact CI merge snapshot.Production/workflow/tooling LOC: +450/-153 (net +297). Tests and test support, including the changed-test routing support: +973/-306 (net +667). Documentation: +3/-1 (net +2). Total: +1426/-460 across 21 files; the test split includes a pure 45-line move, not new behavior. Product application runtime is unchanged.
Production growth is concentrated in the plugin workflow migration (+431/-133, net +298): four pinned owner placements, typed workflow-owned decisions, and two exact-byte readback owners. Keeping these policies in trusted workflow source prevents selected publication-source code from choosing its own owner or admission policy. The shared supervisor is reused unchanged; there is no new supervisor, retry layer, or generic release-policy framework. After reusing the upstream signal finalizers and canonical Node flags, the installed-Vitest repair is production/tooling net negative (+18/-19, net -1) and removes 73 net test/support lines. After composing with current main's independently added basic admission reset, the remaining shared-runner admission repair adds 45 net test/support lines, with no production runtime change.