Skip to content

perf(repair): stage validation proof gates - #502

Merged
steipete merged 97 commits into
mainfrom
perf/staged-proof-gates
Jul 12, 2026
Merged

steipete merged 97 commits into
mainfrom
perf/staged-proof-gates

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Jul 12, 2026 •

Copy link
Copy Markdown
Member

Summary

  • plan repair validation as ordered, risk-aware proof stages and independently rebuild exact proof semantics before replay
  • keep untrusted execution credential-free and lifecycle-script-free; bind immutable source, base, head, action, and output identities
  • publish only exact independently validated commit and tree bytes through credential-scoped mutation jobs
  • recheck live pause and structured security signals at every mutation boundary
  • checkpoint replacement publication before irreversible source closeout and recover only the exact authorized replacement PR
  • make retryable post-flight outcomes visible and durable for self-heal
  • resolve rerun handoff artifacts by trusted producer artifact ID and digest instead of consumer attempt names
  • reject unsafe command aliases and options, source mutation, proof drift, and terminal runtime budgets

Final hardening

  • revalidate every sealed issue and PR source in the shared guard immediately before privileged push/create/reopen/label/comment/close mutations
  • allow source drift only for the exact prepared source head or a closure recorded by the verified publication checkpoint
  • fail closed when a configured canonical changed-gate script disappears
  • allow only narrow read-only package-manager proof forms; reject lifecycle, registry, and account mutations across pnpm, npm, Bun, and Yarn
  • keep deadline-expired pending or missing checks retryable for durable self-heal
  • snapshot ignored dependency/tooling inputs and symlink targets around every staged proof command
  • verify every applicable strict ruleset, including bypass actors and the full effective required-check set
  • bind issue-implementation readiness to the exact head in the verified publication receipt

Validation

  • exact head: d4e6e7db6052acaae628c9f1713ea4f52d46b428
  • Node 26.5.0 / pnpm 11.10.0
  • focused hardening suites: execution handoff 25/25; post-flight 16/16; target validation 72/72; strict binding/post-flight 36/36
  • full unit suite: 922/922 passed
  • full repair suite: 839/839 passed
  • changed coverage: 100% lines, 86.90% branches, 100% functions
  • aggregate coverage: 73.17% lines, 72.19% branches, 83.26% functions
  • direct pnpm run check equivalents passed: active-surface and limits checks, all three TypeScript builds, all four lint lanes, unit and repair suites, changed and aggregate coverage, and formatter check on 350 files
  • the pnpm script wrapper refused before execution because it attempted a non-TTY reinstall of the shared node_modules (ERR_PNPM_ABORTED_REMOVE_MODULES_DIR_NO_TTY); no install or dependency replacement was performed
  • GitHub checks: 6/6 passed, including pnpm check, CodeQL for Actions and JavaScript/TypeScript, and the Windows Codex launcher

@clawsweeper

clawsweeper Bot commented Jul 12, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 12, 2026, 8:54 AM ET / 12:54 UTC.

Summary
The branch replaces the repair lane with credential-separated authorization, execution, validation, publication, and post-flight jobs backed by staged deterministic proof, receipt-bound mutations, strict base-policy checks, and durable recovery.

Reproducibility: not applicable. This PR introduces a new repair automation and trust architecture rather than reporting a narrowly reproducible current-main bug. The previously reported upload-path defect did have a source-reproducible path and is repaired on the current head.

Review metrics: 3 noteworthy metrics.

  • Patch surface: 52 files; +18,856/-985. The branch replaces multiple production trust and automation boundaries rather than making an isolated performance change.
  • Workflow surface: 4 workflows changed. Worker execution, verdict routing, commit intake, and sweep processing all participate in the new trust model.
  • Focused coverage: 7 new test files. Dedicated suites cover execution handoff, staged proof, artifact identity, post-flight reporting, strict base binding, and self-heal policy.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P2] Wait for pnpm check and all other required checks to complete successfully on exact head e16e0c8.

Risk before merge

  • [P1] Merging intentionally replaces production repair credential, proof, publication, and recovery boundaries; a latent defect could block repair execution, publication, recovery, or merge operations.
  • [P1] The exact-head pnpm check is still running, so current-head merge readiness has not yet been demonstrated.
  • [P1] Successful tests cannot by themselves authorize operational activation of a new privileged mutation boundary; the guarded rollout remains an owner decision.

Maintainer options:

  1. Complete guarded rollout gates (recommended)
    Merge only after pnpm check and every other required check succeeds on exact head e16e0c8, then monitor initial production runs.
  2. Stage activation separately
    Land with live execution and mutation disabled, collect shadow-run evidence, and enable the new boundary through a separate maintainer-controlled action.
  3. Pause the boundary replacement
    Pause or close this landing candidate if maintainers prefer smaller independently deployed changes over one large privileged-boundary rollout.

Next step before merge

  • [P2] No concrete automated repair remains; maintainers should wait for the running exact-head gate and then decide whether to activate the new production security boundary.

Maintainer decision needed

  • Question: Should production repair mutation and publication switch to this credential-separated, receipt-bound architecture after every check passes on exact head e16e0c8?
  • Rationale: The branch changes where privileged credentials exist, which proof receipts authorize mutation, and how production failures recover; code review and CI cannot decide operational acceptance of that live security boundary.
  • Likely owner: steipete — The provided discussion records this person performing reconciliation and authorizing the guarded rollout subject to exact-head gates.
  • Options:
    • Authorize guarded rollout (recommended): Merge after all exact-head gates pass, then monitor initial production repair runs while retaining the documented pause controls.
    • Stage without activation: Land the implementation with live execution disabled and enable it only after additional shadow or dry-run evidence.
    • Pause and decompose: Keep the existing production boundary and split the architecture into smaller independently deployable changes.

Security
Cleared: The current head narrows credential exposure and verifies privileged mutations against sealed authorization and publication receipts; live CodeQL is green and no concrete remaining security or supply-chain defect was found.

Review details

Best possible solution:

Preserve the credential-free independent validation and exact receipt-bound publication design, merge only after every required check succeeds on the exact head, and monitor the first guarded production repair runs with the documented pause controls available.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this PR introduces a new repair automation and trust architecture rather than reporting a narrowly reproducible current-main bug. The previously reported upload-path defect did have a source-reproducible path and is repaired on the current head.

Is this the best way to solve the issue?

Yes, the independent credential-free proof and exact receipt-bound mutation design is a strong maintainable solution for the stated safety goal; only exact-head gate completion and explicit production rollout acceptance remain.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against dfae81ca3bac.

Label changes

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body and maintainer comments provide detailed exact-head or direct-ancestor live test, coverage, dependency-audit, hosted-check, and after-fix workflow evidence; the remaining running check is a merge gate rather than absent proof.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add feature: ✨ showcase: ClawSweeper spotlight: unusually compelling feature idea for maintainer attention. Separating untrusted execution, independent deterministic proof reconstruction, and exact receipt-bound publication is an unusually compelling safety architecture for autonomous repair.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body and maintainer comments provide detailed exact-head or direct-ancestor live test, coverage, dependency-audit, hosted-check, and after-fix workflow evidence; the remaining running check is a merge gate rather than absent proof.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P2: This is a high-sensitivity automation improvement requiring guarded rollout, but no current emergency or confirmed remaining patch defect is shown.
  • merge-risk: 🚨 automation: The branch rewires repair jobs, artifact transfer, rerun recovery, verdict routing, and post-flight automation.
  • merge-risk: 🚨 security-boundary: The branch changes credential placement and the sealed authorization required for privileged GitHub mutations.
  • merge-risk: 🚨 availability: A latent defect in handoff, proof, strict-base verification, or recovery could stall repair execution and publication.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • feature: ✨ showcase: ClawSweeper spotlight: unusually compelling feature idea for maintainer attention. Separating untrusted execution, independent deterministic proof reconstruction, and exact receipt-bound publication is an unusually compelling safety architecture for autonomous repair.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body and maintainer comments provide detailed exact-head or direct-ancestor live test, coverage, dependency-audit, hosted-check, and after-fix workflow evidence; the remaining running check is a merge gate rather than absent proof.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body and maintainer comments provide detailed exact-head or direct-ancestor live test, coverage, dependency-audit, hosted-check, and after-fix workflow evidence; the remaining running check is a merge gate rather than absent proof.
Evidence reviewed

What I checked:

  • Prior finding repaired: The transfer upload now uses the same durable-job, self-heal-head, execution-mode, and non-dry-run predicates as worker execution, while preserving fatal missing-output behavior when execution was expected; focused coverage asserts the skip predicates. (.github/workflows/repair-cluster-worker.yml, e16e0c89804f)
  • Credential separation: The workflow withholds GitHub credentials from execution and validation, then mints scoped credentials only in trusted authorization, reporting, and mutation jobs. (.github/workflows/repair-cluster-worker.yml:60, e16e0c89804f)
  • Receipt-verified mutation boundary: Published-PR and sealed-source mutations re-verify authorization, validation, publication, and live identity context before executing terminal changes. (src/repair/execution-handoff.ts:905, e16e0c89804f)
  • Exact PR scope: The base-to-head range is 52 files with 18,856 additions and 985 deletions; unrelated dashboard deletions seen against newer current main are not part of the PR diff. (e16e0c89804f)
  • Live exact-head gates: CodeQL for Actions and JavaScript/TypeScript plus the Windows launcher pass on the exact current head; pnpm check remains in progress, leaving GitHub merge state unstable. (e16e0c89804f)
  • Feature-history provenance: The pre-PR repair workflow, validation, routing, and merge paths in the available main history trace to Vincent Koc's commit 1a7a10c; Peter Steinberger authored the latest exact-head workflow repair and reconciliation commits. (src/repair/apply-result.ts:620, 1a7a10c0d66a)

Likely related people:

  • vincentkoc: The available current-main history attributes the existing repair workflow, validation, routing, and merge paths to Vincent Koc, and this branch develops the replacement architecture across those same files. (role: feature owner; confidence: high; commits: 1a7a10c0d66a; files: .github/workflows/repair-cluster-worker.yml, src/repair/execute-fix-artifact.ts, src/repair/target-validation.ts)
  • steipete: The PR discussion records reconciliation and guarded-rollout review, and this person authored the npm validation corrections and the current-head repair for the prior workflow finding. (role: reviewer and recent area contributor; confidence: high; commits: 03e4543b749d, 4c2861619bdb, cbdd3ec72e3c; files: .github/workflows/repair-cluster-worker.yml, src/repair/validation-command-utils.ts, test/repair/target-validation.test.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
Review history (25 earlier review cycles; latest 8 shown)
  • reviewed 2026-07-12T10:49:10.158Z sha 84e4c6e :: needs maintainer review before merge. :: none
  • reviewed 2026-07-12T10:58:55.579Z sha c1c5172 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-12T11:09:56.628Z sha f54ebcf :: needs maintainer review before merge. :: none
  • reviewed 2026-07-12T11:18:17.551Z sha d47535e :: needs maintainer review before merge. :: none
  • reviewed 2026-07-12T11:51:36.492Z sha 84d4bdc :: needs maintainer review before merge. :: none
  • reviewed 2026-07-12T12:18:47.246Z sha e48cc61 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-12T12:28:21.148Z sha 5ef0d27 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-12T12:46:50.715Z sha 25ba578 :: needs changes before merge. :: [P2] Guard worker upload when no run is produced

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. labels Jul 12, 2026
@vincentkoc
vincentkoc force-pushed the perf/staged-proof-gates branch from 95a8b3f to 21c99f1 Compare July 12, 2026 04:42
@clawsweeper clawsweeper Bot added status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Jul 12, 2026
@clawsweeper

clawsweeper Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: perf(repair): stage validation proof gates This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@clawsweeper clawsweeper Bot removed merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. merge-risk: 🚨 availability 🚨 Merging this PR could cause crashes, hangs, restart loops, stalls, or process outages. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. feature: ✨ showcase ClawSweeper spotlight: unusually compelling feature idea for maintainer attention. labels Jul 12, 2026
@steipete

Copy link
Copy Markdown
Contributor

Proof refresh for exact head 25ba5789f6ac69016b1e5ba3b2193cb4fd2c6c35 after contributor head advancement:

  • Range-diff confirms the prior exact candidate cbdd3ec72e3c3b78846c85ba4ccd2541b3edde55 is an ancestor; all contributor and maintainer commits remain intact.
  • Reviewed the three appended contributor commits covering complete repair-proof cohort recovery and source-close receipt identity rechecks; no actionable defect found.
  • Focused cohort, handoff, and workflow tests: 60/60 passed.
  • Full repair suite: 880/880 passed.
  • Repair build and repository format check: passed.
  • AutoReview of the three-commit delta: no accepted/actionable findings.
  • Production dependency audit: no known vulnerabilities.
  • Public Model Identifier Gate: PASS for the refreshed exact diff, build, and logs.

Fresh hosted CI, CodeQL, Windows, Socket Security, and ClawSweeper review for this exact head remain mandatory before merge.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cbdd3ec72e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

name: clawsweeper-repair-worker-${{ github.run_id }}-${{ github.run_attempt }}
path: .clawsweeper-repair/runs
if-no-files-found: warn
if-no-files-found: error

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Guard worker upload when no run is produced

In execute/autonomous dispatches where the job is stale (job_exists=0) or the self-heal head verifier skips the worker (matched=false), the Run worker step above does not create .clawsweeper-repair/runs. This upload still runs under always() and now treats missing files as an error, so those intentionally skipped dispatches fail the cluster job instead of cleanly skipping downstream authorization/reporting; keep this upload conditional on an actual worker run or make the no-files case non-fatal.

Useful? React with 👍 / 👎.

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. merge-risk: 🚨 availability 🚨 Merging this PR could cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. labels Jul 12, 2026
@steipete

Copy link
Copy Markdown
Contributor

Review finding repaired on exact head e16e0c89804f86b3f65d83d267cf6c3e0b4e7fa4.

  • Fixed .github/workflows/repair-cluster-worker.yml: worker transfer upload now requires the same durable-job and self-heal-head conditions as Run worker, so both supported no-run paths remain clean no-ops.
  • Preserved if-no-files-found: error whenever worker execution was expected.
  • Added an exact workflow regression assertion covering both skip predicates in test/repair/execute-fix-artifact-source.test.ts.
  • Focused workflow tests: 15/15 passed.
  • Full repair suite: 880/880 passed.
  • Repair build, repository format, and git diff --check: passed.
  • AutoReview: no accepted/actionable findings.
  • Production dependency audit: no known vulnerabilities.
  • Public Model Identifier Gate: PASS; the repair introduces no model identifier.

Fresh exact-head hosted CI, CodeQL, Windows, Socket Security, and ClawSweeper review are required before merge.

@clawsweeper clawsweeper Bot added proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. feature: ✨ showcase ClawSweeper spotlight: unusually compelling feature idea for maintainer attention. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jul 12, 2026
@steipete
steipete merged commit 588c64d into main Jul 12, 2026
12 checks passed
@steipete
steipete deleted the perf/staged-proof-gates branch July 12, 2026 12:57
@steipete

Copy link
Copy Markdown
Contributor

Merged and verified on main at 588c64d4d2f0fdfed174e9e2a5d15d2df936205d.

  • Rebase merge preserved the contributor commit stack and authorship; CHANGELOG.md retains thanks to @vincentkoc.
  • Hosted exact-head pnpm check, Windows launcher, Actions and JavaScript/TypeScript CodeQL, aggregate CodeQL, and Socket Security gates passed.
  • Exact-head ClawSweeper review confirmed the prior upload-path finding was repaired and reported no remaining concrete defect.
  • Post-merge focused repair/workflow suites: 153/153 passed.
  • Post-merge full repair suite: 880/880 passed.
  • Post-merge repair build and repository format check passed.
  • No linked issue requires closure. Related open PR search found no duplicate implementation; the only keyword match is the separate action-ledger work in feat(ledger): add immutable action history core #511.

CI: https://github.com/openclaw/clawsweeper/actions/runs/29193348124

CodeQL: https://github.com/openclaw/clawsweeper/actions/runs/29193348127

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature: ✨ showcase ClawSweeper spotlight: unusually compelling feature idea for maintainer attention. merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. merge-risk: 🚨 availability 🚨 Merging this PR could cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants