Skip to content

fix(ci): run Telegram release QA from trusted harness - #103207

Merged
vincentkoc merged 8 commits into
mainfrom
fix/qa-telegram-trusted-harness
Jul 10, 2026
Merged

vincentkoc merged 8 commits into
mainfrom
fix/qa-telegram-trusted-harness

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Jul 10, 2026 •

Copy link
Copy Markdown
Member

Fixes #103188

What Problem This Solves

Release validation for an older selected ref could execute that candidate's Telegram QA harness and scenarios. That left current regression assertions unproven against the release candidate and allowed the candidate checkout to share the trusted runner process boundary.

Why This Change Was Made

The Telegram release lane now:

  • restores the harness from the trusted github.workflow_sha
  • verifies and extracts the exact candidate archive separately
  • runs the candidate gateway and plugins under a distinct unprivileged UID
  • binds lifecycle control to root-verified PID, UID/GID, process group, start time, executable, cwd, and command-line evidence
  • uses pidfd-backed signals, exact-UID cleanup, credential-lease quarantine, and redacted evidence
  • restricts candidate provenance to trusted release refs
  • keeps installed-package Telegram validation on the packaged plugin path

The candidate runtime is isolated from workflow secrets and trusted workspace state while current scenarios remain owned by the trusted workflow.

User Impact

Release maintainers get current Telegram QA assertions against the exact candidate runtime/plugin SHA, with explicit provenance and process-boundary evidence. There is no product runtime change.

Evidence

  • Exact PR head: 6a37b44dcf73ed739eab70e9d43eb0aa37df794c
  • Blacksmith Testbox: tbx_01kx6d9kf82x9ywjgtepvvkyab (run 29107041853)
  • Exact-head path-scoped pnpm check:changed: passed both extension tsgo lanes, extension/scripts lint, and all guards
  • Focused exact-head tests: 358 passed
    • tooling/workflow/archive/package acceptance: 103 passed
    • QA process boundary, gateway, suite, scenario, and Telegram runtime: 255 passed
  • Privileged Ubuntu 24.04 / Node 24.13 smoke: AUDIT_RESULT=PASS
    • workflow SHA-256: 6e02b93a63f4e50600b1a96f055ad01711bfaf5f08da6e223b6f7331663b6a42
    • launcher SHA-256: 334b98545129f16c62711956efc33a12972980c0b947431e9487d555f4bb706d
    • boundary module SHA-256: bb2c01aeaf5aaf23cf441183af2502f752c84b2c341e48199b54d8bcbd212d3f
    • pre-entry and live root verification passed
    • start-time and command-digest tampering rejected
    • protected/writable filesystem masks passed
    • detached child and UID-fallback cleanup passed
  • actionlint passed for the touched release workflows
  • zizmor passed for .github/workflows/openclaw-release-telegram-qa.yml
  • OpenGrep host-env rule: generic test env mutation removed in favor of explicit Vitest env stubs
  • Fresh Codex autoreview: no accepted/actionable findings; patch correct, confidence 0.87

@openclaw-barnacle openclaw-barnacle Bot added size: L maintainer Maintainer-authored PR labels Jul 10, 2026
@vincentkoc vincentkoc self-assigned this Jul 10, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review July 10, 2026 01:16
@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 backlog priority with limited blast radius. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. labels Jul 10, 2026
@clawsweeper

clawsweeper Bot commented Jul 10, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge. Reviewed July 10, 2026, 1:06 PM ET / 17:06 UTC.

Summary
The PR adds a trusted reusable Telegram release-QA workflow and candidate isolation, plus archive validation, process-boundary control, credential quarantine, redaction, and structural tests.

PR surface: Source +1259, Tests +895, Config +2269, Other +510. Total +4933 across 21 files.

Reproducibility: yes. Exact-head source deterministically shows the trusted workflow is orphaned, the old candidate-owned command remains active, credentials persist, raw Telegram token forms are not redacted, and archive validation has unsafe worst-case resource behavior.

Review metrics: 3 noteworthy metrics.

  • Trusted workflow callers: 0 callers. A workflow_call-only file cannot change release behavior until an active workflow invokes it.
  • Candidate checkout credential mode: 1 changed: disabled → persisted. The selected-ref worktree retains a GitHub credential on the still-active candidate-owned path.
  • Archive member ceiling: 1,000,000 members. The current per-link linear scan permits quadratic worst-case CPU at the configured limit.

Stored data model
Persistent data-model change detected: persistent cache schema: test/scripts/openclaw-release-telegram-qa-workflow.test.ts, serialized state: extensions/qa-lab/src/cli.runtime.test.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #103188
Summary: This PR is the direct candidate fix for the linked release-QA ownership bug, but its exact head leaves the canonical path active and is not merge-ready.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🧂 unranked krab
Proof: 🐚 platinum hermit
Patch quality: 🧂 unranked krab
Result: blocked by patch quality or review findings.

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

Rank-up moves:

  • [P2] Repair the complete active workflow, credential, redaction, and archive boundary.
  • Rerun exact-head integrated release QA plus adversarial raw-token, oversized-extension, and many-link archive cases.

Risk before merge

  • [P1] Candidate-controlled output can expose the live Telegram bot token in artifacts retained for 14 days.
  • [P2] A malicious or corrupted candidate archive can consume excessive trusted-runner memory or timeout-scale CPU before rejection.

Maintainer options:

  1. Repair the complete boundary (recommended)
    Fix the caller, old path, credentials, token redaction, and archive resource bounds, then rerun the exact-head integrated release lane.
  2. Pause for boundary redesign
    Keep the PR open but unmerged if release and security owners prefer a different workflow or archive parsing boundary.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Wire `.github/workflows/openclaw-release-checks.yml` to the trusted reusable Telegram QA workflow; remove or fail-closed gate the old candidate-owned Telegram path; restore `persist-credentials: false`; add a structural caller/orphan test; redact bare Telegram bot tokens and `/bot<TOKEN>/` URLs before evidence upload; reject oversized PAX/GNU extension records before Python `tarfile` buffers them; and replace per-link full-set prefix scans with a bounded index.

Next step before merge

  • All five blockers have concrete file-level repairs that can be attempted on the PR branch without choosing new product direction.

Security
Needs attention: The exact head exposes checkout credentials and Telegram tokens and permits hostile candidate archives to exhaust trusted-runner resources.

Review findings

  • [P1] Wire the trusted workflow into release checks — .github/workflows/openclaw-release-telegram-qa.yml:3-4
  • [P1] Do not persist credentials in the candidate checkout — .github/workflows/openclaw-release-checks.yml:1479
  • [P1] Redact raw Telegram tokens before uploading logs — extensions/qa-lab/src/gateway-log-redaction.ts:94-105
Review details

Best possible solution:

Make the active release checks call the trusted reusable workflow, remove or fail closed the old candidate-owned path, keep candidate credentials absent, use complete shared secret redaction, and enforce archive memory and CPU bounds before extraction.

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

Yes. Exact-head source deterministically shows the trusted workflow is orphaned, the old candidate-owned command remains active, credentials persist, raw Telegram token forms are not redacted, and archive validation has unsafe worst-case resource behavior.

Is this the best way to solve the issue?

No. The trusted-harness/candidate-runtime split is the right architecture, but this implementation does not yet enforce that boundary at the active entry point or across credentials, evidence, and hostile archives.

Full review comments:

  • [P1] Wire the trusted workflow into release checks — .github/workflows/openclaw-release-telegram-qa.yml:3-4
    The new file is workflow_call-only, but no workflow calls it; the active Telegram release job still checks out the selected candidate and runs that checkout's QA CLI. The trusted harness therefore never executes and the linked bug remains unfixed. Add the caller, remove or fail-closed gate the old path, and add a structural orphan test.
    Confidence: 0.99
  • [P1] Do not persist credentials in the candidate checkout — .github/workflows/openclaw-release-checks.yml:1479
    This retains the GITHUB_TOKEN credential in the still-active selected-ref checkout before candidate-controlled tooling runs. Restore persist-credentials: false; the trusted workflow design should not require placing credentials in the candidate worktree.
    Confidence: 0.99
  • [P1] Redact raw Telegram tokens before uploading logs — extensions/qa-lab/src/gateway-log-redaction.ts:94-105
    The sanitizer only catches keyed assignments, bearer strings, and query parameters. A bare Telegram bot token or /bot<TOKEN>/ URL emitted by the candidate remains intact and can enter durable evidence. Reuse the shared redactor or add both token shapes with realistic fixtures.
    Confidence: 0.98
  • [P1] Bound tar extension records before Python allocates them — scripts/release-telegram-candidate-archive.py:285
    The helper applies entry and expanded-size checks only after tarfile yields a member, but tarfile reads PAX and GNU longname payloads while constructing that member. A compressible extension record can allocate far beyond the intended memory bound first. Reject extension record sizes before those reads.
    Confidence: 0.96
  • [P1] Index link-prefix checks instead of scanning all entries — scripts/release-telegram-candidate-archive.py:332
    Every link member scans the entire seen_names set for descendants. Under the one-million-entry limit, many links can force quadratic CPU work on the trusted runner. Maintain a prefix-aware index or another bounded lookup.
    Confidence: 0.97

Overall correctness: patch is incorrect
Overall confidence: 0.99

AGENTS.md: found and applied where relevant.

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

Label changes

Label changes:

  • add P1: The patch leaves the reproduced release-validation bug active and introduces credential, secret-artifact, and trusted-runner availability regressions.
  • add merge-risk: 🚨 availability: Hostile archive metadata can exhaust trusted-runner memory or quadratic CPU before rejection.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🐚 platinum hermit and patch quality is 🧂 unranked krab.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: The author is a repository member, so the external-contributor proof gate does not apply; the submitted Testbox and privileged smoke evidence does not cover the confirmed active-caller, raw-token, or adversarial-archive gaps.
  • remove P2: Current review triage priority is P1, so this older priority label is no longer current.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🧂 unranked krab, so this older rating label is no longer current.
  • remove status: 👀 ready for maintainer look: Current PR status label is status: ⏳ waiting on author.

Label justifications:

  • P1: The patch leaves the reproduced release-validation bug active and introduces credential, secret-artifact, and trusted-runner availability regressions.
  • merge-risk: 🚨 automation: The added trusted workflow is unreachable, so release automation would continue using the candidate-owned path.
  • merge-risk: 🚨 security-boundary: The active candidate checkout retains credentials and its output can leak Telegram bot tokens into durable artifacts.
  • merge-risk: 🚨 availability: Hostile archive metadata can exhaust trusted-runner memory or quadratic CPU before rejection.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🐚 platinum hermit and patch quality is 🧂 unranked krab.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: The author is a repository member, so the external-contributor proof gate does not apply; the submitted Testbox and privileged smoke evidence does not cover the confirmed active-caller, raw-token, or adversarial-archive gaps.
Evidence reviewed

PR surface:

Source +1259, Tests +895, Config +2269, Other +510. Total +4933 across 21 files.

View PR surface stats
Area Files Added Removed Net
Source 8 1354 95 +1259
Tests 9 899 4 +895
Docs 0 0 0 0
Config 2 2270 1 +2269
Generated 0 0 0 0
Other 2 513 3 +510
Total 21 5036 103 +4933

Security concerns:

  • [high] Candidate checkout retains GITHUB_TOKEN credentials — .github/workflows/openclaw-release-checks.yml:1479
    The selected-candidate worktree persists checkout credentials before candidate-controlled tooling executes.
    Confidence: 0.99
  • [high] Candidate logs can leak Telegram bot tokens — extensions/qa-lab/src/gateway-log-redaction.ts:94
    The QA evidence sanitizer omits bare bot-token and Bot API URL forms before artifact upload.
    Confidence: 0.98
  • [high] Candidate archive can exhaust runner resources — scripts/release-telegram-candidate-archive.py:285
    PAX/GNU extension payloads are buffered before helper checks, and link validation has quadratic worst-case CPU.
    Confidence: 0.96

Acceptance criteria:

  • [P1] pnpm test test/scripts/openclaw-release-telegram-qa-workflow.test.ts.
  • [P1] pnpm test extensions/qa-lab/src/gateway-log-redaction.test.ts.
  • [P1] pnpm test test/scripts/release-telegram-candidate-archive.test.ts.
  • [P1] actionlint .github/workflows/openclaw-release-checks.yml .github/workflows/openclaw-release-telegram-qa.yml.
  • [P1] zizmor .github/workflows/openclaw-release-telegram-qa.yml.

What I checked:

Likely related people:

  • vincentkoc: Current assignee and author of the linked issue; the PR is a sustained implementation of the Telegram release-QA trust boundary. (role: recent area contributor; confidence: high; commits: 71be6bf3f9b9, 7eea2b770eac, d880f43f95a4; files: .github/workflows/openclaw-release-checks.yml, .github/workflows/openclaw-release-telegram-qa.yml, extensions/qa-lab/src/gateway-process-boundary.ts)
  • steipete: GitHub commit metadata and blame tie commit 8cdd96f to the current candidate-owned release job and QA redactor that this PR changes. (role: introduced behavior; confidence: high; commits: 8cdd96fe9904; files: .github/workflows/openclaw-release-checks.yml, extensions/qa-lab/src/gateway-log-redaction.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 (2 earlier review cycles)
  • reviewed 2026-07-10T09:16:57.961Z sha d8a0993 :: needs maintainer review before merge. :: none
  • reviewed 2026-07-10T14:51:01.366Z sha d8a0993 :: needs maintainer review before merge. :: none

@vincentkoc
vincentkoc marked this pull request as draft July 10, 2026 14:27
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Jul 10, 2026
@vincentkoc
vincentkoc force-pushed the fix/qa-telegram-trusted-harness branch from d8a0993 to 8cfb693 Compare July 10, 2026 16:20
@vincentkoc
vincentkoc marked this pull request as ready for review July 10, 2026 16:34
@vincentkoc

vincentkoc commented Jul 10, 2026 •

Copy link
Copy Markdown
Member Author

Land-ready update for exact head fec679215c085f62e77b6347c785c81a6dfe6fbf.

All earlier blocking findings are resolved:

  • Release Checks calls the trusted Telegram reusable workflow from main, binds its separately resolved immutable SHA through OIDC, and removes the candidate-owned credentialed Telegram path.
  • Telegram token and workflow-command redaction is covered across raw tokens, Bot API URLs, large inputs, chunk boundaries, and Unicode whitespace.
  • Candidate archive extraction bounds extension/path/stream metadata, keeps TarInfo cache usage constant, requires explicit prior parent directories, and avoids quadratic link lookup.

Exact proof:

  • Hosted wave: 71 success, 0 failure, 0 pending, 29 skipped.
  • CI 29114342371, Blacksmith Testbox 29114342114, ARM 29114342084, Build Artifacts 29114342552, CodeQL 29114342088, Workflow Sanity 29114342149, and OpenGrep 29114342052 all succeeded.
  • Blacksmith Testbox tbx_01kx6d9kf82x9ywjgtepvvkyab: 165/165 focused tests and exact pnpm check:changed passed.
  • The formerly failing full tooling shard passed 318 files and 5,232 tests, with expected skips only.
  • macOS archive suite passed 36 tests with one expected GNU-tar-only skip.
  • Fresh autoreview found no issues (patch is correct, confidence 0.87); independent frozen-byte review found no P0-P2 findings.
  • OPENCLAW_TESTBOX=1 scripts/pr prepare-run 103207 passed at this exact head.
  • Current-main merge preview is conflict-free; all three overlap paths preserve the PR contracts.

No release branch or publication state was touched by this PR lane.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Jul 10, 2026
@clawsweeper clawsweeper Bot added status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. and removed status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P2 Normal backlog priority with limited blast radius. labels Jul 10, 2026
@vincentkoc
vincentkoc merged commit 2a1d6e4 into main Jul 10, 2026
101 checks passed
@vincentkoc
vincentkoc deleted the fix/qa-telegram-trusted-harness branch July 10, 2026 18:32
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 11, 2026
* fix(ci): use trusted Telegram QA harness

* fix(ci): restrict trusted Telegram QA candidate

* fix(ci): isolate trusted Telegram QA candidate

* fix(ci): harden Telegram QA process boundary

* fix(ci): pass Telegram QA release gates

* test(qa): stub Telegram env explicitly

* fix(ci): harden Telegram release QA boundary

* test(ci): harden trusted workflow and memory guards
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: qa-lab maintainer Maintainer-authored PR merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. scripts Repository scripts size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Telegram release QA uses the selected candidate harness

2 participants