Skip to content

fix(ci): restore Crabbox publisher credentials - #131535

Merged
vincentkoc merged 1 commit into
mainfrom
fix/ci-crabbox-publisher-secrets
Aug 28, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
fix/ci-crabbox-publisher-secrets

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Aug 28, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes an issue where the protected-main Crabbox gate publisher received empty coordinator credentials, so an otherwise successful exact-head AWS proof could not publish its trusted check.

Why This Change Was Made

The publisher job now owns the existing qa-live-shared environment and resolves the primary coordinator secret names before the established OPENCLAW_QA_MANTIS_* fallback names. The broker client still requires the coordinator URL and bearer token; Cloudflare Access service-token credentials are optional only as a complete pair, with half-configured pairs rejected.

The protected-main trigger, checkout binding, organization-admin validation, and minimal workflow permissions are unchanged.

User Impact

Maintainers can publish a trusted openclaw/crabbox-gate from the existing bearer-only coordinator deployment. Deployments fronted by Cloudflare Access continue to send both Access headers.

Evidence

  • Exact head: 5a48d3e39a392db0bf644ad4839325d91ff10224
  • Tested branch base: 593c7ed65a01bf4454717b029a775aef40ae8f6d
  • Live PR base at evidence refresh: 9b51558d0c7ba49198420666baed2b933d7f9b1a
  • Patch-id: bd41f4937e1a447960ef219c02f081fcf546d72b
  • node scripts/run-vitest.mjs test/scripts/pr-crabbox-gate-publisher.test.ts test/scripts/ci-workflow-guards.test.ts: 170 passed, 2 existing skips on the final lean head
  • actionlint .github/workflows/pr-crabbox-gate-publisher.yml: passed
  • pnpm lint:scripts: passed
  • scoped pnpm format:check: passed
  • node scripts/check-changed.mjs --dry-run -- <four changed files>: testRoot,tooling
  • actual changed gate passed conflict, attribution, registry, extension, duplication, coercion, dependency, formatting, patch, and temp-file checks. Test-root typecheck remained blocked only by unrelated missing generated/shared checkout artifacts; no changed-file type errors remain.
  • pnpm check:workflows was attempted twice and stopped before repository validation because the local Python package index does not contain pinned pre-commit==4.6.2; direct Actionlint and workflow guard tests pass.
  • Autoreview was attempted; the Codex engine exited before returning a verdict.

LOC classification:

  • Workflow + publisher tooling: +22/-15, net +7
  • Publisher script alone: +19/-13, net +6
  • Tests: +62/-15

Dependency contracts inspected directly:

  • Crabbox v0.46.0 (8ba71f913bbe57285ae29af45ef0d8ec6712477d): coordinator requests send bearer auth independently and add Cloudflare Access client headers only when both service-token values are present (internal/cli/coordinator.go).
  • Codex 5f49aba876922d6f2f55caa153bbb0ed1b46feba: explicit command environment values are merged after environment-policy construction, then non-inheritable launch credentials are removed (codex-rs/exec-server/src/local_process.rs, codex-rs/protocol/src/shell_environment.rs).

AI-assisted: yes. The implementation and proof were reviewed directly against the repository and released dependency source.

Maintainer Decision

  • Live organization membership: vincentkoc is active / admin.
  • Live qa-live-shared secret inventory contains both primary and OPENCLAW_QA_MANTIS_* coordinator URL/token names. Secret values were not read.
  • As organization owner, I confirm this protected publisher is intended to use that environment and the bearer-authenticated coordinator route. Released Crabbox v0.46.0 independently applies bearer auth and only adds Cloudflare Access headers when a complete pair is configured.
  • Exact direct broker proof run_b0b4977c26be used https://crabbox.openclaw.ai with accessAuth missing and broker auth configured, then reached succeeded / released.
  • ClawSweeper reviewed exact head 5a48d3e39a392db0bf644ad4839325d91ff10224 with no implementation or security findings. Its operational owner decision is accepted.
  • Rank-up move resolved: this body records the exact change, validation, LOC, dependency contracts, and remaining post-landing deployment exercise.

Agent Transcript

Redacted task transcript
[user]
Repair only the protected Crabbox publisher credential deployment: bind the job to qa-live-shared, use primary coordinator secrets with Mantis fallbacks, allow bearer-only broker auth, require Access credentials as a complete pair, update owning tests, validate, publish a draft PR, and land through the native squash flow.

[assistant]
Created a fresh GWT from origin/main, read the scoped repository and testing rules, and inspected Crabbox v0.46 plus the sibling Codex environment contract.

[assistant]
Implemented only the workflow, publisher, publisher tests, and workflow guard tests. The client requires coordinator URL and bearer auth, emits Access headers only for a complete pair, and rejects either half-pair.

[user]
Run a lean-code pass before landing; compress the publisher script to net no more than +10 operational LOC without changing behavior.

[assistant]
Collapsed optional Access normalization into empty-string defaults, one boolean parity check, and one conditional headers object. Final script delta is +19/-13 (net +6); focused proof remains 170 passed with 2 existing skips.

@clawsweeper

clawsweeper Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@vincentkoc vincentkoc self-assigned this Aug 28, 2026
@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: S maintainer Maintainer-authored PR labels Aug 28, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review August 28, 2026 04:40
@vincentkoc
vincentkoc force-pushed the fix/ci-crabbox-publisher-secrets branch from 7831930 to 5a48d3e Compare August 28, 2026 04:43
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. labels Aug 28, 2026
@clawsweeper

clawsweeper Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 28, 2026, 12:48 AM ET / 04:48 UTC.

ClawSweeper review

What this changes

The PR binds the Crabbox gate publisher to the shared QA environment, adds coordinator-secret fallbacks, and permits bearer-only coordinator requests when Cloudflare Access credentials are absent.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 4 items remain

Keep open for protected maintainer review. No introduced code defect was found, but this changes the environment-scoped credential boundary and needs confirmation that the coordinator supports the intended bearer-only deployment.

Priority: P2
Reviewed head: 5a48d3e39a392db0bf644ad4839325d91ff10224
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) PR readiness rating was derived from proof quality, review findings, security review, and reviewer confidence.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): ClawSweeper live verification passed on the reviewed terminal surface.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): ClawSweeper live verification passed on the reviewed terminal surface.
Evidence reviewed 5 items Current main still has the reported failure mode: Current main requires both Cloudflare Access values before creating the coordinator client, so a bearer-only deployment fails before its proof can be read.
Introduced authentication boundary is narrow: The proposed client still requires coordinator URL and bearer token, rejects incomplete Access pairs, and sends Access headers only when both values are present.
Workflow and behavior coverage: Focused tests cover complete Access credentials, bearer-only authentication, incomplete pairs, required coordinator values, and the environment secret mapping.
Findings None None.
Security None None.

Live Verification

Command: node --input-type=module -e "import('./scripts/pr-crabbox-gate-publisher.mjs').then(({createJsonApi})=›console.log(Object.keys(createJsonApi({baseUrl:'https://broker.example/',token:'coordinator-token'})).join(',')))"

Result: PASS (completed)

request

















































Assertions:

  • PASS expect_output: request

How this fits together

The protected-main Crabbox gate publishes a trusted GitHub check after validating coordinator-held proof. The workflow supplies environment secrets to the publisher, which authenticates with the coordinator before publishing the check.

flowchart LR
  A[Protected main proof] --> B[Publisher workflow]
  B --> C[Shared QA environment]
  C --> D[Publisher script]
  D --> E[Coordinator request]
  E --> F[Trusted GitHub check]
Loading

Decision needed

Question Recommendation
Does qa-live-shared intentionally authorize this protected publisher to use the primary or Mantis-fallback coordinator secrets with bearer-only coordinator authentication? Confirm the deployed boundary: Verify the QA environment holds the intended coordinator secrets and that bearer-only requests are accepted; then retain this repair.

Why: The repository source proves the job and client behavior, but GitHub Environment protections, secret placement, and the deployed coordinator policy are external operational security state.

Before merge

  • Resolve merge risk (P1) - Bearer-only coordinator access is a credential-boundary change. The cited Crabbox source revision was not available locally and GitHub could not be reached during review, so the actual QA coordinator deployment still needs owner confirmation.
  • Resolve merge risk (P1) - Selecting qa-live-shared changes which GitHub Environment releases coordinator secrets; its protection rules and exact secret placement are outside repository source.
  • Resolve merge risk (P1) - The bug fix has a net production/tooling increase of seven lines; the added pair-validation and environment binding are the smallest visible expression of the new authentication contract, with no redundant branch found to remove.
Agent review details

Security

None.

PR surface

Tests +47, Config +1, Other +6. Total +54 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 62 15 +47
Docs 0 0 0 0
Config 1 3 2 +1
Generated 0 0 0 0
Other 1 19 13 +6
Total 4 84 30 +54

Review metrics

Metric Value Why it matters
Production versus test delta production/tooling +7 net (+22/-15); tests +47 net (+62/-15) The production growth is confined to environment selection and complete-pair authentication validation; tests cover each resulting mode.

Merge-risk options

Maintainer options:

  1. Confirm bearer-only deployment support (recommended)
    Before merge, verify that the coordinator behind qa-live-shared accepts the bearer token without Cloudflare Access headers and that the environment owns the fallback secrets.
  2. Retain the prior Access requirement
    If that deployment is Access-protected, keep both Access values mandatory and restore the secrets through the environment rather than changing request authentication.

Technical review

Best possible solution:

Retain the narrow environment binding and all-or-nothing Access headers after the QA environment owner confirms that its coordinator accepts bearer-only requests and exposes the intended secret names.

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

Source reproducible: current main rejects a coordinator deployment with URL and bearer token but no Access pair, while the proposed client accepts that exact input shape. A live coordinator run was not available in this read-only review.

Is this the best way to solve the issue?

Unclear pending operational confirmation: the code is the narrowest repair for a bearer-only coordinator, but the authoritative deployed coordinator contract could not be inspected directly.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: This is a bounded CI proof-publication repair, not an emergency user-runtime outage.
  • add merge-risk: 🚨 security-boundary: The patch changes which environment secrets reach a protected job and when coordinator requests omit Cloudflare Access headers.
  • add proof: sufficient: Contributor real behavior proof is sufficient. ClawSweeper live verification passed on the reviewed terminal surface.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): ClawSweeper live verification passed on the reviewed terminal surface.

Label justifications:

  • P2: This is a bounded CI proof-publication repair, not an emergency user-runtime outage.
  • merge-risk: 🚨 security-boundary: The patch changes which environment secrets reach a protected job and when coordinator requests omit Cloudflare Access headers.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): ClawSweeper live verification passed on the reviewed terminal surface.
  • proof: sufficient: Contributor real behavior proof is sufficient. ClawSweeper live verification passed on the reviewed terminal surface.

Evidence

What I checked:

Likely related people:

  • vincentkoc: Git blame traces the original coordinator client to the Crabbox gate feature commit and this authentication repair to the same author. (role: feature owner and recent area contributor; confidence: high; commits: a03cc38b05aa, 5a48d3e39a39; files: scripts/pr-crabbox-gate-publisher.mjs, .github/workflows/pr-crabbox-gate-publisher.yml)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Tighten the PR description with what changed, how it was validated, and any remaining risk.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • 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.

@vincentkoc
vincentkoc merged commit d4c1acb into main Aug 28, 2026
186 checks passed
@vincentkoc
vincentkoc deleted the fix/ci-crabbox-publisher-secrets branch August 28, 2026 05:13
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

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

Labels

maintainer Maintainer-authored PR merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: S 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.

1 participant