Repository navigation
fix(ssh): sign an SSH conversion's manifest as the host parses it - #32369
Conversation
|
No actionable comments were generated in the recent review.
|
The conversion hashed the exported objects, but the manifest parser keeps only the fields it knows. A runtime-only field in the live session (gone after the next load) made the conversion's own journal and the host refuse the digest until the app restarted. Sign the parsed form of the JSON. Manifests without such a field sign exactly as before. Co-Authored-By: Claude <[email protected]>
1a8798b to
e453aad
Compare
ELI5
When Orca moves an SSH host's projects onto its managed server, it sends the server a list of what to move along with a fingerprint of that list. The server checks the fingerprint before accepting anything. Orca was fingerprinting one version of the list and then sending a slightly trimmed version, so the server refused it. Now Orca fingerprints exactly what it sends.
What Changed
orcad_migration_manifest_digest_mismatch, and only worked again after Orca was restarted.Mechanism:
createOrcadMigrationManifestused to hash the live export objects and then run them throughparseOrcadMigrationManifest. That parser keeps only the fields it knows, so the manifest that went to the journal and the host could be smaller than what was hashed. It now hashes the parsed form of the JSON and returns that same object.Why a restart helped:
session:setstores the window's session as it arrives, without running the session schema. So a tab can carry a field the schema drops. The next load does run the schema, which removes the field, and after that the hash matches again.Why
Hashing exactly what is sent and read back closes the whole class of mismatch: fields the parser drops, and values that serialize differently (anything with
toJSON). The alternative was to list which fields to strip before hashing. That list would go stale every time the session shape changes.Verification is unchanged. The host still checks the digest against the raw manifest it receives (
orcad-migration.ts).Mixed versions:
Linked Issue
N/A (internal). Found while fixing the same failure in the WSL mover (#32343).
Visual Proof
N/A: no UI change. The only visible difference is that a conversion that used to fail now succeeds.
Testing
New test in
orcad-migration-manifest-export.test.ts: a tab field the session schema drops. It fails onmainwithorcad_migration_manifest_digest_mismatchand passes here.src/main/ssh/orcad-migration*,src/main/ssh/targets,migrating-orcad-catalogandmoving-wsl-projectspass: 78 files, 715 tests.The SSH golden manifest digest is unchanged.
The full static job passes locally.
The managed-orcad Docker lane runs in CI.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Review
frozenSourceDigestagrees more often than before, not less.Agent skill upstream boundary
Notes
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)