Skip to content

fix: resolve UAT audit findings in BYO pinning and migration flows#479

Merged
FSM1 merged 5 commits into
mainfrom
fix/audit-f03-byo-status-wiring
Jun 11, 2026
Merged

fix: resolve UAT audit findings in BYO pinning and migration flows#479
FSM1 merged 5 commits into
mainfrom
fix/audit-f03-byo-status-wiring

Conversation

@FSM1

@FSM1 FSM1 commented Jun 11, 2026

Copy link
Copy Markdown
Owner

Summary

Closes out the outstanding /gsd:audit-fix findings from the cross-phase UAT/verification audit (sources: phase 21 BYO IPFS UAT, phase 35 Phala TEE UAT). Four findings resolved — three code fixes and one documentation disposition.

Changes

F-03 — BYO quota badge was unreachable (high)

StorageTab save flow now calls PATCH /vault/byo-status (vaultControllerSetByoStatus) after persisting the pinning config: isByo: true for external/dual mode, false for cipherbox. The call is non-fatal — a failure logs a warning and never trips the save error. The existing fetchQuota() immediately after picks up the advisory flag, so the quota badge updates in the same save.

Key files: apps/web/src/components/settings/StorageTab.tsx

F-04 — stale failed migration rendered as active, polling never restarted (medium)

  • MigrationProgress now renders terminal failed jobs as > migration failed: X/Y pins migrated (error styling) instead of the active-looking migrating: X/Y pins.
  • StorageTab remounts MigrationProgress (React key keyed on a migrationRunId counter incremented after migrationApi.start) so a new migration restarts the poll loop instead of displaying the previous terminal job until remount.

Key files: apps/web/src/components/settings/MigrationProgress.tsx, apps/web/src/components/settings/StorageTab.tsx

F-05 — migration stats double-counted on batch timeout race (medium)

  • Batch HTTP timeout raised 120s → 300s; observed worst-case TEE batch duration is ~130s, so the old timeout aborted in-flight batches client-side and counted them failed while the TEE worker completed them (observed: 77 results on a 57-CID migration).
  • MigrationService.updateProgress is now self-consistent: failedCidList is deduped and becomes the source of truth for the failed count, and migratedCids is clamped so migrated + failed never exceeds totalCids on double-reported batches.

Key files: apps/api/src/migration/migration.processor.ts, apps/api/src/migration/migration.service.ts

F-08 — orphaned Phala staging credentials (medium)

Marked not-applicable in 35-UAT.md: Phala credits are expected, the staging TEE will likely return to Phala Cloud, so PHALA_CLOUD_API_KEY / PHALA_TEE_WORKER_URL stay inert intentionally.

Verification

  • apps/api migration specs: 38/38 passing (3 new dedup/clamp tests + a 300s timeout assertion)
  • apps/web test suite: 23/23 passing
  • tsc --noEmit and eslint clean on all touched files
  • No API contract changes (no DTO/controller/endpoint signatures touched) — no client regeneration needed
  • Not covered by automated tests (no component-test infra in apps/web): visual confirmation of the failed-migration text and badge activation after save

Key Decisions

  • F-05 stays within existing columns — no schema change. The deduped failedCidList is the failure source of truth; per-CID success tracking (full idempotency) was deliberately deferred.
  • Remount-via-key chosen over lifting poll state for F-04 — smallest change that restarts polling in the product flow.
  • Audit findings F-01/F-02/F-06/F-07/F-09 were verified already fixed on main; F-10 below severity threshold.

TDD Audit

Test commit Impl commit gate_status
779510385 fix(web): resolve F-03 — wire byo-status flag into storage tab save flow missing
e4276235d fix(web): resolve F-04 — render failed migrations distinctly and restart progress polling on new migration missing
97ee0a56f fix(api): resolve F-05 — raise migration batch timeout and make progress accounting idempotent missing
aadc6c9e0 chore(planning): resolve F-08 — mark orphaned phala staging credentials not applicable missing

Aggregate: 0 skill, 0 fallback, 0 exempt — 4 missing (audit-fix pipeline commits; F-05 tests landed with the impl commit).

🤖 Generated with Claude Code

gate_status: skill=0, fallback=0, exempt=0, missing=4

Summary by CodeRabbit

  • New Features

    • Added dedicated failed migration status display showing migrated/total counts
    • Storage settings now sync BYO enablement status to server
  • Bug Fixes

    • Increased TEE service request timeout to 5 minutes to prevent premature operation failures
    • Fixed migration progress tracking to prevent double-counting of failed batches
    • Deduplicated failed CID reporting for accurate failure counts
  • Tests

    • Added timeout verification coverage for migration processing

FSM1 added 4 commits June 11, 2026 15:19
…art progress polling on new migration

Entire-Checkpoint: 882a574381e9
…ess accounting idempotent

Entire-Checkpoint: 3ca03e3156a3
…ls not applicable

Entire-Checkpoint: c3b1c8c3f8bc
@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown

Review Change Stack

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 94a4355b-08ee-4699-9707-27d085f96141

📥 Commits

Reviewing files that changed from the base of the PR and between 5eced52 and 65cc588.

📒 Files selected for processing (8)
  • .planning/phases/35-phala-testnet-tee-migration/35-UAT.md
  • apps/api/src/migration/migration.processor.spec.ts
  • apps/api/src/migration/migration.processor.ts
  • apps/api/src/migration/migration.service.spec.ts
  • apps/api/src/migration/migration.service.ts
  • apps/web/src/components/settings/MigrationProgress.tsx
  • apps/web/src/components/settings/StorageTab.tsx
  • release-please-config.json

Walkthrough

Increase the TEE /migrate batch timeout to 300,000ms; deduplicate reported failed CIDs and clamp migrated/failed counters; add tests for timeout and progress edge cases; improve migration UI lifecycle and BYO-status save wiring; update an audit gap record and bump release config versions.

Changes

TEE Migration Robustness Improvements

Layer / File(s) Summary
TEE batch timeout configuration
apps/api/src/migration/migration.processor.ts, apps/api/src/migration/migration.processor.spec.ts
Per-batch TEE /migrate request timeout changed to 300,000ms with comments about observed batch durations; unit test verifies AbortSignal.timeout is called with 300_000.
Migration progress accounting and CID deduplication
apps/api/src/migration/migration.service.ts, apps/api/src/migration/migration.service.spec.ts
When failedCids are provided, merge into persisted failedCidList, dedupe, set failedCids from deduped length, and clamp migratedCids so migratedCids + failedCidstotalCids; tests cover dedupe, clamping, and duplicate-report scenarios.
Migration UI lifecycle and BYO flag wiring
apps/web/src/components/settings/MigrationProgress.tsx, apps/web/src/components/settings/StorageTab.tsx
Render a failed-specific progress message when status is failed; add migrationRunId state to force MigrationProgress remount on new runs; call vaultControllerSetByoStatus on save in a non-fatal try/catch and log warnings on failure.
Audit documentation update
.planning/phases/35-phala-testnet-tee-migration/35-UAT.md
Reclassify the CI configuration gap from failed to not-applicable and add a 2026-06-11 resolution note regarding inert/orphaned PHALA credentials.

Release configuration bumps

Layer / File(s) Summary
release-please version pins
release-please-config.json
Bump release-as pins: apps/desktop 0.41.0→0.42.0, packages/api-client 0.38.0→0.38.1, packages/sdk-core 0.36.2→0.36.3, crates/fuse 0.5.3→0.5.4.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: resolve UAT audit findings in BYO pinning and migration flows' directly addresses the main purpose of the changeset, which is to close outstanding UAT audit findings (F-03, F-04, F-05, F-08) across BYO pinning and migration functionality.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/audit-f03-byo-status-wiring

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added release:web:fix Patch version bump (bug fix) for web release:api:fix Patch version bump (bug fix) for api release:sdk-core:fix Patch version bump (bug fix) for sdk-core release:sdk:fix Patch version bump (bug fix) for sdk release:cipherbox-fuse:fix Patch version bump (bug fix) for cipherbox-fuse release:cipherbox-sdk:fix Patch version bump (bug fix) for cipherbox-sdk release:desktop:fix Patch version bump (bug fix) for desktop release:tee-worker:fix Patch version bump (bug fix) for tee-worker labels Jun 11, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Release Preview

Package Bump Label Source
api patch release:api:fix Direct (fix commit)
cipherbox-fuse patch release:cipherbox-fuse:fix Cascade (api patch)
cipherbox-sdk patch release:cipherbox-sdk:fix Cascade (api patch)
desktop minor release:desktop:fix Cascade (api patch)
sdk patch release:sdk:fix Cascade (api patch)
sdk-core patch release:sdk-core:fix Cascade (api patch)
tee-worker patch release:tee-worker:fix Cascade (sdk-core patch)
web minor release:web:fix Direct (fix commit)

Cascade Details

  • api patch -> sdk-core patch (direct dependency)
  • api patch -> sdk patch (direct dependency)
  • api patch -> cipherbox-fuse patch (direct dependency)
  • api patch -> cipherbox-sdk patch (direct dependency)
  • api patch -> desktop patch (direct dependency)
  • sdk-core patch -> tee-worker patch (direct dependency)

@FSM1 FSM1 closed this Jun 11, 2026
@FSM1 FSM1 reopened this Jun 11, 2026
@codecov

codecov Bot commented Jun 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 62.35%. Comparing base (5eced52) to head (65cc588).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #479      +/-   ##
==========================================
+ Coverage   62.34%   62.35%   +0.01%     
==========================================
  Files         135      135              
  Lines       10157    10162       +5     
  Branches     1081     1083       +2     
==========================================
+ Hits         6332     6337       +5     
  Misses       3601     3601              
  Partials      224      224              
Flag Coverage Δ
api 84.68% <100.00%> (+0.01%) ⬆️
api-client 84.68% <100.00%> (+0.01%) ⬆️
core 84.68% <100.00%> (+0.01%) ⬆️
crypto 84.68% <100.00%> (+0.01%) ⬆️
sdk 84.68% <100.00%> (+0.01%) ⬆️
sdk-core 84.68% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
apps/api/src/migration/migration.processor.ts 94.64% <ø> (ø)
apps/api/src/migration/migration.service.ts 96.72% <100.00%> (+0.29%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@FSM1 FSM1 merged commit 9f3136a into main Jun 11, 2026
27 checks passed
@FSM1 FSM1 deleted the fix/audit-f03-byo-status-wiring branch June 11, 2026 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release:api:fix Patch version bump (bug fix) for api release:cipherbox-fuse:fix Patch version bump (bug fix) for cipherbox-fuse release:cipherbox-sdk:fix Patch version bump (bug fix) for cipherbox-sdk release:desktop:fix Patch version bump (bug fix) for desktop release:sdk:fix Patch version bump (bug fix) for sdk release:sdk-core:fix Patch version bump (bug fix) for sdk-core release:tee-worker:fix Patch version bump (bug fix) for tee-worker release:web:fix Patch version bump (bug fix) for web

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant