Repository navigation
feat(orcad-migration): a capability-gated blob channel beside scrollback (D1b-6a) - #28866
Conversation
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⛔ Files ignored due to path filters: 1
⚙️ Run configuration
📥 Commits
⛔ Files ignored due to path filters: 1
You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 Walkthrough
Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to
|
There was a problem hiding this comment.
🧹 Nitpick comments: 1
src/main/persistence/migrating-orcad-catalog/orcad-migration-blob-staging.ts: 1
153-160: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueMove the misplaced doc comment to
commitOrcadMigrationBlobs.The first JSDoc block on lines 153-156 describes the precondition for
commitOrcadMigrationBlobs. In the code it sits directly above a second JSDoc block forassertOrcadMigrationBlobSetMatches. Because of this,commitOrcadMigrationBlobshas no documentation, and editors attach the commit precondition to the wrong function. Move the block to line 192.Note: the OpenGrep hint on line 251 is a false positive.
STAGED_BLOB_NAME.execisRegExp.prototype.exec, notchild_process.exec.Source: Linters/SAST tools
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
bf82faee-618f-411c-860a-0441578a558b
📥 Commits
Reviewing files that changed from the base of the PR and between 27c0275 and 430d606a045231c7c8f06fc2d7268e1f7a208dbd.
⛔ Files ignored due to path filters: 1
src/shared/rpc-contract/rpc-params-catalog.generated.tsis excluded by!**/*.generated.*
📒 Files selected for processing: 25
src/main/persistence-orcad-migration-blobs.test.tssrc/main/persistence/loading-store/store-runtime-state.tssrc/main/persistence/migrating-orcad-catalog/orcad-catalog-import.tssrc/main/persistence/migrating-orcad-catalog/orcad-migration-blob-staging.test.tssrc/main/persistence/migrating-orcad-catalog/orcad-migration-blob-staging.tssrc/main/persistence/migrating-orcad-catalog/orcad-migration-staged-file.tssrc/main/persistence/migrating-orcad-catalog/orcad-scrollback-snapshot-transfer.test.tssrc/main/persistence/migrating-orcad-catalog/orcad-scrollback-snapshot-transfer.tssrc/main/runtime/orca-runtime-get-status.tssrc/main/runtime/orca-runtime-migration-catalog.tssrc/main/runtime/orcad-migration-catalog-import.tssrc/main/runtime/rpc/methods/orcad-migration.test.tssrc/main/runtime/rpc/methods/orcad-migration.tssrc/main/runtime/runtime-store-contract.tssrc/main/ssh/orcad-migration-blob-coordinator.test.tssrc/main/ssh/orcad-migration-blob-coordinator.tssrc/main/ssh/orcad-migration-catalog-client-blob-kind.test.tssrc/main/ssh/orcad-migration-catalog-client.tssrc/shared/orcad-migration-blob-transfer.test.tssrc/shared/orcad-migration-blob-transfer.tssrc/shared/orcad-migration-catalog-state.tssrc/shared/orcad-migration-manifest.tssrc/shared/orcad-migration-scrollback.tssrc/shared/orcad-runtime-capabilities.tssrc/shared/rpc-contract/orcad-migration-params.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
…ack, for the WSL mover's new data (D1b-6a)
…ked blobs, reserved names refused (D1b-6a)
430d606 to
8901f93
Compare
ELI5
When Orca moves projects onto a managed Orca server, it already sends terminal scrollback in small chunks that can resume after an interruption. Moving a WSL project losslessly also needs other data: each pane's last folder, shell history and agent chat records. This PR adds a general channel for that data next to the scrollback channel. It is gated per kind of data, so a server that can't install a kind refuses the move instead of quietly dropping it. Nothing sends data on it yet, and SSH conversion works exactly as before.
What Changed
This is step D1b-6a of the lossless WSL project mover.
src/shared/orcad-migration-blob-transfer.ts):terminal-restore-hints,shell-historyandagent-session-records.conornulrefused.orcad.migration-blob.v1, plus one per kind (orcad.migration-blob.<kind>.v1).orcad.migration.stageBlobChunk, separate fromstageSnapshotChunk, with resume fromreceivedBytes. It requires host-admin permission and is gated to the migration runtime client.orcad-migration-staged-file.ts). Scrollback keeps identical paths, error codes and behavior, now pinned by a test.commitCatalogtakes an optionalexpectedBlobs. The destination refuses withorcad_migration_blob_set_mismatchunless the blobs it received match exactly, so a blob that never arrived can't be silently missing.src/main/ssh/orcad-migration-blob-coordinator.ts): it checks capabilities before sending anything. If a kind is unsupported, the move is refused naming that kind, and nothing is uploaded.ORCAD_MIGRATION_INSTALLABLE_BLOB_KINDSin the PR that adds its installer (D1b-6b, D1b-6c). Until then the sender refuses every kind, so nothing is staged that couldn't be applied.Why
Older servers silently drop manifest sections they don't recognize: the digest is checked on the raw manifest, but the import uses the re-parsed one. So new data can't simply be added to the manifest; it has to be gated before staging. Restore hints are captured after terminals pause, but the manifest is signed earlier, so they can't go into the manifest anyway. A separate, resumable, digest-checked channel solves both problems and keeps SSH manifests byte-identical.
Wire compatibility
{ manifest }. A test pins this even against a blob-capable host.expectedBlobs: it is sent only when the destination advertises the blob channel. That channel ships in the same change, so any host that advertises it understands the field.blobUploadsfield is optional, and older readers ignore it.Linked Issue
N/A (maintainer; tracked in the WSL-via-orcad implementation tracker, step D1b-6).
Visual Proof
N/A: no UI change and no production caller yet.
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Contract tests: key and size rules, Windows reserved names, and older catalog states still parsing.
Receiver tests:
Sender and client tests: resume, a lost acknowledgement, refusal when the base or per-kind capability is missing, and the commit field being sent only with blobs.
Regression pin: a test fixing the scrollback staging filename and error codes.
Checks: the SSH manifest golden test,
pnpm tc:node, both oxlint configs, the changed-code quality gate and the RPC params catalog check all pass. The only failing unit test,orca-runtime-agent-session-operation.test.ts, fails the same way on main.Adversarial review: no HIGH findings, and the shipped scrollback path was verified unchanged. Two MEDIUM issues (a missing blob undetectable at commit; received blobs leaking after a failed commit) and four LOW issues are fixed here.
AI Disclosure
Review
Agent skill upstream boundary
Notes
The SSH migration path is shared and refactored, so the SSH end-to-end shards must pass. No caller sends blobs yet, and every kind is refused until its installer lands.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)