Skip to content

test(doctor): use fixed OAuth sidecar vectors - #121986

Merged
steipete merged 2 commits into
mainfrom
test/remove-oauth-sidecar-crypto-bridges
Aug 11, 2026
Merged

steipete merged 2 commits into
mainfrom
test/remove-oauth-sidecar-crypto-bridges

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Legacy OAuth sidecar migration tests generated ciphertext with production-only encryption helpers, then decrypted it with the same key/AAD implementation. A symmetric mistake could keep those tests green while breaking compatibility with bytes written by the historical sidecar format.

Those helpers were exposed through two process-global Symbols and forwarding test-support.ts files. The one-shot macOS Keychain warning also required a production reset hook solely to isolate two tests.

Why This Change Was Made

This change:

  • replaces self-generated encrypted sidecars with fixed historical AES-256-GCM vectors for successful migration, wrong-key rejection, shared-reference migration, and Keychain-only warning behavior;
  • removes the production-only encryption helper, key/AAD test exports, reset hook, global Symbol bridges, and both forwarding support files;
  • consolidates the warning checks into one ordered Darwin-to-Linux sequence without resetting module state; and
  • leaves doctor migration, decryption, backup, sidecar-retention/removal, agent discovery, and snapshot invalidation logic unchanged.

The fixed vectors independently lock the shipped contract: SHA-256 key derivation from the legacy seed, 12-byte IV, profile/ref/provider AAD, AES-256-GCM, 16-byte tag, and unpadded base64url fields.

AI-assisted: yes. Historical writer/reader commits, current migration callers, crypto contract, fixed-vector decryption, retained compatibility paths, and CI routing were inspected; fresh structured review found no actionable issue.

User Impact

No runtime behavior change. Doctor retains compatibility with historical encrypted and plaintext OAuth sidecars, with stronger tests and less test-only production surface.

Evidence

  • Owner and sequencing proof — 137 tests passed across OAuth sidecar migration, Keychain warning, doctor repair ordering, and health-contribution callers.
  • node scripts/check-changed.mjs -- ... for the six changed/deleted files — passed format, Plugin SDK API, type, lint, dead-export, boundary, architecture, auth, and safety gates through trusted local fallback because Blacksmith Testbox is unavailable on this host.
  • Obsolete seam grep — no remaining Symbol, test utility, or encryption-helper matches.
  • Fresh structured autoreviews before and after rebase plus secret scans — clean.
  • git diff --check — clean.

Production delta: −62 lines. Test support: −41 lines. Tests: −65 lines. Overall: −168 lines.

@clawsweeper

clawsweeper Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations size: M maintainer Maintainer-authored PR labels Aug 11, 2026
@steipete
steipete marked this pull request as ready for review August 11, 2026 09:53
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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 Aug 11, 2026
@clawsweeper

clawsweeper Bot commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 11, 2026, 6:54 AM ET / 10:54 UTC.

ClawSweeper review

What this changes

The branch replaces self-generated legacy OAuth-sidecar ciphertext in doctor tests with fixed historical AES-GCM vectors and removes test-only production bridges.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

No blocking findings: the current head addresses the prior warning-order finding, retains migration behavior, and removes only test-only bridges. This maintainer-owned PR remains necessary because current main still has the self-generated-vector tests and Symbol bridges.

Priority: P3
Reviewed head: dc46c9e66f4afc323e7ed1fb95498de0bef34222

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, net-negative test-boundary refactor with the prior ordering concern resolved and no actionable correctness or security finding.
Proof confidence 🌊 off-meta tidepool Not applicable: This is maintainer-authored test-only coverage work, so the external-contributor real-behavior-proof gate does not apply.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This is maintainer-authored test-only coverage work, so the external-contributor real-behavior-proof gate does not apply.
Evidence reviewed 6 items Prior warning-order finding is addressed: The current head runs the Linux call and asserts no warning before switching to Darwin, then verifies the one-shot warning; this is the independent negative assertion requested by the preceding ClawSweeper review.
Fixed vectors exercise the repair boundary: The migration test supplies a fixed AES-GCM sidecar and checks restored inline credentials and sidecar removal; the shared-reference case applies the same boundary to two stores.
Runtime compatibility contract remains unchanged: The reader still derives AAD from ref/profile/provider and the legacy key with SHA-256 before AES-GCM decryption; only encryption test helpers and global bridges are removed.
Findings None None.
Security None None.

How this fits together

Doctor repairs legacy OAuth sidecar files by reading encrypted material and restoring inline credentials in affected auth-profile stores. The tests exercise migration, rejection, shared references, and the macOS Keychain-only warning without changing the repair flow.

flowchart LR
A[Legacy OAuth sidecar] --> B[Doctor repair]
B --> C[Sidecar reader]
C --> D[Decrypt and validate]
D --> E[Inline auth profile]
F[Fixed compatibility vectors] --> G[Migration tests]
G --> B
Loading

Before merge

  • Complete next step (P2) - No repair work is indicated; this protected maintainer PR only awaits normal exact-head merge validation.
Agent review details

Security

None.

PR surface

Source -103, Tests -63. Total -166 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 4 1 104 -103
Tests 2 45 108 -63
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 46 212 -166

Review metrics

Metric Value Why it matters
Production vs test LOC production −62, tests −63, test support −41 The patch is net-negative and removes test-only production bridges while adding no runtime capability.

Stored data model

Persistent data-model change detected: migration/backfill/repair: src/commands/doctor-auth-oauth-sidecar.test-support.ts, migration/backfill/repair: src/commands/doctor-auth-oauth-sidecar.test.ts, migration/backfill/repair: src/commands/doctor-auth-oauth-sidecar.ts, migration/backfill/repair: src/commands/doctor/shared/legacy-oauth-sidecar.test-support.ts, migration/backfill/repair: src/commands/doctor/shared/legacy-oauth-sidecar.test.ts, migration/backfill/repair: src/commands/doctor/shared/legacy-oauth-sidecar.ts, and 5 more. Migration or upgrade compatibility proof is recorded; maintainers should verify it before merge.

Technical review

Best possible solution:

Merge the focused test-boundary refactor once the remaining exact-head CI check is green; retain the fixed vectors and deleted test-only bridges.

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

Not applicable: this PR improves regression coverage for an existing migration contract rather than reporting a new user-facing failure.

Is this the best way to solve the issue?

Yes: fixed compatibility vectors test the migration boundary without preserving production-only encryption exports or global test hooks.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This is maintainer-authored test-only coverage work, so the external-contributor real-behavior-proof gate does not apply.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P3: This is focused regression-test and test-seam cleanup with no intended operator-visible behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This is maintainer-authored test-only coverage work, so the external-contributor real-behavior-proof gate does not apply.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Blame attributes the legacy key/AAD compatibility contract to this author, and the current PR and recent area history continue that work. (role: feature owner and recent area contributor; confidence: high; commits: a4c7b1b7b586, 149c95c70227, dc46c9e66f4a; files: src/commands/doctor/shared/legacy-oauth-sidecar.ts, src/commands/doctor/shared/legacy-oauth-sidecar.test.ts, src/commands/doctor-auth-oauth-sidecar.test.ts)
  • Andy Ye: Recent history records a focused repair for unresolved OAuth-sidecar failures in the same owner module. (role: adjacent owner; confidence: medium; commits: e992af4b6ed2; files: src/commands/doctor/shared/legacy-oauth-sidecar.ts)

Rank-up moves

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

  • Let the remaining exact-head CI check complete successfully before merge.

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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-08-11T09:59:58.814Z sha 149c95c :: found issues before merge. :: [P2] Run the Linux assertion before the one-shot warning

@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. 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 Aug 11, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Land-ready proof for dc46c9e66f4afc323e7ed1fb95498de0bef34222:

  • OAuth migration, Keychain warning, doctor repair ordering, and health-contribution caller proof — 137 tests passed.
  • Full changed-file gate — passed format, Plugin SDK API, type, lint, dead-export, boundary, architecture, auth, and safety checks through trusted local fallback because Blacksmith Testbox is unavailable on this host.
  • Obsolete seam grep — no global Symbol, test utility, reset, or encryption-helper matches remain.
  • Fresh structured reviews, secret scans, and git diff --check — clean.
  • Native review artifacts — validated with recommendation READY FOR /prepare-pr and zero findings.
  • Hosted exact-head CI: run 31481194731 — green after rerunning one unrelated src/node-host/mcp.test.ts shard failure on the unchanged head.

ClawSweeper's P2 finding is addressed: the consolidated warning test runs Linux first while the latch is untouched, then runs Darwin twice to independently prove warning and one-shot deduplication. The fixed historical AES-GCM vectors retain migration and wrong-key compatibility without production test encoders or reset hooks.

Production delta: −62 lines. Test support: −41 lines. Tests: −63 lines. Overall: −166. No proof gaps remain.

@steipete
steipete merged commit 63bba28 into main Aug 11, 2026
192 of 194 checks passed
@steipete
steipete deleted the test/remove-oauth-sidecar-crypto-bridges branch August 11, 2026 11:00
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 12, 2026
* test(doctor): use fixed OAuth sidecar vectors

* test(doctor): preserve Linux warning assertion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M 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