[Spike] Assess verification against real wallet versions #118 - #131
Open
EmmanuelAdah wants to merge 19 commits into
Open
[Spike] Assess verification against real wallet versions #118#131EmmanuelAdah wants to merge 19 commits into
EmmanuelAdah wants to merge 19 commits into
Conversation
…tion, and improved decision handling.
…ge exclude paths.
…and Albedo, replace outdated POC coverage report, and adjust diagnostics parsing.
…hter, update Playwright config for real-wallet tests, and add wallet contract validation tests.
…optimize Playwright install process
…ghter and Albedo releases, including testing strategy recommendations, compatibility matrix, and protocol contract schema PoC.
Add a spike report analyzing why the existing synthetic e2e suite can't detect Freighter/Albedo protocol drift, plus the first real infrastructure toward closing that gap. - Add protocol-drift-spike.md: synthetic coverage/blind-spot analysis, wallet compatibility matrix template, protocol-fixture proposal, CI-vs-scheduled recommendation, and a follow-up plan. - Add src/intercept/externalWalletProtocol.ts: zod schemas and type guards for Freighter's SUBMIT_TRANSACTION request/response and Albedo's intent request/response. Built directly from the real fixtures already used by src/tests/walletContracts.test.ts, not from documentation or assumption. Distinct in purpose from the existing src/intercept/protocol.ts, which governs Gryd Lock's own internal message bus and cannot drift the way an upstream wallet's protocol can. Only the decline/reject path is confirmed against real fixtures for both wallets; success-response shapes remain explicitly marked unconfirmed. - Add e2e/real/real-freighter-version.spec.ts: loads a real, version-pinned Freighter build alongside dist/, captures whatever the real extension actually sends, and validates it against the schemas above. Skips gracefully when no vendored build is present. Isolated from the synthetic suite via playwright.canary.config.ts and a new testIgnore entry in playwright.e2e.config.ts, since real-wallet runs are slower and can fail for reasons unrelated to Gryd Lock (wallet-side bugs, network flakiness). - Add scripts/download-wallet-release.sh and tests/wallet-versions.json to pin and fetch wallet versions deliberately rather than testing against "latest" in any blocking path. NOTE: the script currently clones wallet source only; it does not yet build it. - Add scripts/record-freighter-onboarding.mjs and a scaffolded (not functional) e2e/real/helpers/onboardFreighter.ts. Discovered mid-work that a fresh Freighter profile has no onboarded account, so the real interception test currently reaches Freighter's #/welcome screen and captures nothing — expected given no account exists to sign with, not a broken trigger. Onboarding automation is blocked on real selectors from a recorded session; placeholders are marked TODO-SELECTOR and are not safe to run as-is. - Update .github/workflows/ci.yml: add npm run check:versions to the blocking path, add npm audit --omit=dev (blocking, production deps only) plus a full npm audit (informational, continue-on-error), and remove a redundant duplicate Playwright browser install. - Add .github/workflows/wallet-canary.yml: non-blocking scheduled job (nightly pinned versions, weekly latest), files/updates a GitHub issue on failure rather than blocking any PR. - Fix .gitignore: the previous fixtures/wallets/**/ pattern ignored the wallet build directories themselves, which meant git never descended into them to apply the !.pinned-version negation — that metadata file was silently never tracked despite the exception rule. Also add coverage/, playwright-report/, and .env* (untracked previously). Known gaps, tracked as follow-ups rather than blocking this commit: wallet build step unimplemented, onboarding selectors unverified, no golden-capture fixtures or docs/wallet-compatibility.md yet, no release-zip step implementing releaseArchiveName(), Albedo path not yet started, PyCharm Playwright plugin integration unresolved (CLI runs work correctly).
… to v1.18.0, and `bignumber.js` to v11.1.4.
…est/coverage-v8` to v4.1.11, and `vite` to v8.2.2; remove outdated and unused packages.
…eferences in `.last-run.json`.
Add a spike report analyzing why the existing synthetic e2e suite can't detect Freighter/Albedo protocol drift, plus the first real infrastructure toward closing that gap. - Add protocol-drift-spike.md: synthetic coverage/blind-spot analysis, wallet compatibility matrix template, protocol-fixture proposal, CI-vs-scheduled recommendation, and a follow-up plan. - Add src/intercept/externalWalletProtocol.ts: zod schemas and type guards for Freighter's SUBMIT_TRANSACTION request/response and Albedo's intent request/response. Built directly from the real fixtures already used by src/tests/walletContracts.test.ts, not from documentation or assumption. Distinct in purpose from the existing src/intercept/protocol.ts, which governs Gryd Lock's own internal message bus and cannot drift the way an upstream wallet's protocol can. Only the decline/reject path is confirmed against real fixtures for both wallets; success-response shapes remain explicitly marked unconfirmed. - Add e2e/real/real-freighter-version.spec.ts: loads a real, version-pinned Freighter build alongside dist/, captures whatever the real extension actually sends, and validates it against the schemas above. Skips gracefully when no vendored build is present. Isolated from the synthetic suite via playwright.canary.config.ts and a new testIgnore entry in playwright.e2e.config.ts, since real-wallet runs are slower and can fail for reasons unrelated to Gryd Lock (wallet-side bugs, network flakiness). - Add scripts/download-wallet-release.sh and tests/wallet-versions.json to pin and fetch wallet versions deliberately rather than testing against "latest" in any blocking path. NOTE: the script currently clones wallet source only; it does not yet build it. - Add scripts/record-freighter-onboarding.mjs and a scaffolded (not functional) e2e/real/helpers/onboardFreighter.ts. Discovered mid-work that a fresh Freighter profile has no onboarded account, so the real interception test currently reaches Freighter's #/welcome screen and captures nothing — expected given no account exists to sign with, not a broken trigger. Onboarding automation is blocked on real selectors from a recorded session; placeholders are marked TODO-SELECTOR and are not safe to run as-is. - Update .github/workflows/ci.yml: add npm run check:versions to the blocking path, add npm audit --omit=dev (blocking, production deps only) plus a full npm audit (informational, continue-on-error), and remove a redundant duplicate Playwright browser install. - Add .github/workflows/wallet-canary.yml: non-blocking scheduled job (nightly pinned versions, weekly latest), files/updates a GitHub issue on failure rather than blocking any PR. - Fix .gitignore: the previous fixtures/wallets/**/ pattern ignored the wallet build directories themselves, which meant git never descended into them to apply the !.pinned-version negation — that metadata file was silently never tracked despite the exception rule. Also add coverage/, playwright-report/, and .env* (untracked previously)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add protocol-drift detection infrastructure for real Freighter/Albedo wallet testing
Summary
Adds a spike report and initial infrastructure for detecting when real Freighter/Albedo
extension releases drift from what Gryd Lock's synthetic e2e fixtures assume. Splits
CI into fast/blocking checks vs. slower/non-blocking real-wallet canary checks, and adds
a first real-wallet interception test against a live Freighter build.
What's included
Docs
protocol-drift-spike.md— synthetic coverage analysis, wallet compatibility matrixtemplate, protocol-fixture proposal, CI/scheduled recommendation, follow-up plan.
External protocol contracts
src/intercept/externalWalletProtocol.ts— zod schemas + type guards for Freighter'sSUBMIT_TRANSACTIONrequest/response and Albedo's intent request/response, built fromthe real fixtures already used in
src/tests/walletContracts.test.ts. Distinct fromthe existing
src/intercept/protocol.ts, which governs Gryd Lock's own internalmessage bus and can't drift the way an upstream wallet can.
Success-response shapes for both are explicitly marked unconfirmed in comments.
Real-wallet e2e (new, isolated from the synthetic suite)
e2e/real/real-freighter-version.spec.ts— loads a real, version-pinned Freighterbuild alongside
dist/, captures whatever messages the real extension actually sends,and validates them against the schemas above. Skips gracefully if no vendored build
is present.
playwright.canary.config.ts— new, scoped toe2e/real, longer timeout than thesynthetic config.
playwright.e2e.config.ts— addedtestIgnore: '**/real/**'so the defaultnpm run test:e2enever picks up real-wallet tests.scripts/download-wallet-release.sh— fetches a pinned Freighter/Albedo tag.Clones source only — does not build it yet (see Known gaps).
tests/wallet-versions.json— single source of truth for pinned wallet versions.CI
.github/workflows/ci.yml— addednpm audit --omit=dev(blocking, production depsonly) and full
npm audit(informational,continue-on-error); removed a redundantduplicate Playwright browser install; added
npm run check:versionsto the PR-blockingpath.
.github/workflows/wallet-canary.yml— new, non-blocking, scheduled nightly (pinnedversions) + weekly (latest versions), files/updates a GitHub issue on failure.
Misc
.gitignore— fixed a real bug in thefixtures/wallets/**/pattern (git won'tdescend into an already-ignored directory to apply the
.pinned-versionnegation);added
coverage/,playwright-report/,.env*.Known gaps — do not merge assuming these are solved
scripts/download-wallet-release.shdoesn't build anything. Needs the realFreighter/Albedo build commands wired in once confirmed.
has no onboarded account and lands on
#/welcome.e2e/real/helpers/onboardFreighter.tsis a scaffold with placeholder selectors (marked
TODO-SELECTOR), not workingcode — it needs real selectors from a recorded onboarding session
(
scripts/record-freighter-onboarding.mjs) before this test can pass end-to-end.docs/wallet-compatibility.mdyet — the matrix inthe spike doc has unverified cells pending a real run.
releaseArchiveName()fromscripts/versioning.mjs.e2e/real/*.spec.ts— runsfine from terminal (
npx playwright test --config=playwright.canary.config.ts), IDEintegration untested/unresolved.
Testing
npx playwright test --config=playwright.canary.config.ts -g "Real-wallet protocol drift: Freighter"— currently fails at the onboarding gap described above (expected,not a regression).
npm run test:e2e) and unit/contract tests (npm run test:all)unaffected by this PR — no changes to existing passing tests.
Follow-ups (not in this PR)
onboardFreighter()with real recorded selectors.download-wallet-release.sh.interception point).
docs/wallet-compatibility.mdfrom actual PoC runs.