Harden relay proof commands

This commit is contained in:
rcourtman 2026-03-28 17:49:04 +00:00
parent 038d782d5c
commit 091f7a9957
6 changed files with 35 additions and 21 deletions

View file

@ -360,7 +360,7 @@ Companion drill:
`go test ./internal/relay -run 'TestClient_E2E_MultiMobileClientRelay|TestClient_AbruptDisconnectCancelsInFlightHandlers|TestClient_AbruptDisconnectMultipleChannelCleanup|TestClient_DrainDuringInFlightData|TestClient_DrainWithMultipleInFlightChannels|TestClientRegister_SessionResumeRejectionClearsCachedSession|TestRunLoop_SessionResumeRejectionFallsBackToFreshRegister' -count=1`
`go test ./internal/api -run 'TestRelayEndpointsRequireLicenseFeature|TestRelayOnboardingEndpointsRequireLicenseFeature|TestRelayLicenseGatingResponseFormat|TestOnboardingQRPayloadStructure|TestOnboardingValidateSuccessAndFailure|TestOnboardingDeepLinkFormat' -count=1`
`cd frontend-modern && npx vitest run src/components/Dashboard/__tests__/RelayOnboardingCard.test.tsx src/components/Settings/__tests__/RelaySettingsPanel.runtime.test.tsx src/components/Settings/__tests__/settingsReadOnlyPanels.test.tsx`
`cd /Volumes/Development/pulse/repos/pulse-mobile && npm test -- --runTestsByPath src/relay/__tests__/client.test.ts src/relay/__tests__/client-hardening.test.ts src/relay/__tests__/protocol-contract.test.ts`
`cd /Volumes/Development/pulse/repos/pulse-mobile && npx jest --runInBand --detectOpenHandles --runTestsByPath src/relay/__tests__/client.test.ts src/relay/__tests__/client-hardening.test.ts src/relay/__tests__/protocol-contract.test.ts`
- Manual scenario:
1. Register a fresh relay client.
2. Force reconnect after a normal disconnect.
@ -442,10 +442,10 @@ Companion drill:
`pulse-mobile/src/hooks/useRelay.ts`
`pulse-mobile/src/api/client.ts`
- Automated proof:
`cd /Volumes/Development/pulse/repos/pulse-mobile && npm test -- --runTestsByPath src/__tests__/mobileRelayAuthApprovals.rehearsal.test.ts src/utils/__tests__/secureStorage.test.ts src/hooks/__tests__/useRelayLifecycle.test.ts src/hooks/__tests__/approvalActionPolicy.test.ts src/stores/__tests__/instanceStore.test.ts src/stores/__tests__/authStore.test.ts src/stores/__tests__/approvalStore.test.ts`
`cd /Volumes/Development/pulse/repos/pulse-mobile && npm test -- --runTestsByPath src/relay/__tests__/client.test.ts src/relay/__tests__/client-hardening.test.ts src/relay/__tests__/protocol-contract.test.ts`
`cd /Volumes/Development/pulse/repos/pulse-mobile && npm test -- --runTestsByPath src/api/__tests__/client.test.ts`
`cd /Volumes/Development/pulse/repos/pulse-mobile && npm test -- --runTestsByPath src/hooks/__tests__/useRelay.test.ts src/hooks/__tests__/relayPushRefresh.test.ts src/notifications/__tests__/notificationRouting.test.ts src/stores/__tests__/mobileAccessState.test.ts`
`cd /Volumes/Development/pulse/repos/pulse-mobile && npx jest --runInBand --detectOpenHandles --runTestsByPath src/__tests__/mobileRelayAuthApprovals.rehearsal.test.ts src/utils/__tests__/secureStorage.test.ts src/hooks/__tests__/useRelayLifecycle.test.ts src/hooks/__tests__/approvalActionPolicy.test.ts src/stores/__tests__/instanceStore.test.ts src/stores/__tests__/authStore.test.ts src/stores/__tests__/approvalStore.test.ts`
`cd /Volumes/Development/pulse/repos/pulse-mobile && npx jest --runInBand --detectOpenHandles --runTestsByPath src/relay/__tests__/client.test.ts src/relay/__tests__/client-hardening.test.ts src/relay/__tests__/protocol-contract.test.ts`
`cd /Volumes/Development/pulse/repos/pulse-mobile && npx jest --runInBand --detectOpenHandles --runTestsByPath src/api/__tests__/client.test.ts`
`cd /Volumes/Development/pulse/repos/pulse-mobile && npx jest --runInBand --detectOpenHandles --runTestsByPath src/hooks/__tests__/useRelay.test.ts src/hooks/__tests__/relayPushRefresh.test.ts src/notifications/__tests__/notificationRouting.test.ts src/stores/__tests__/mobileAccessState.test.ts`
`cd /Volumes/Development/pulse/repos/pulse-enterprise && go test ./internal/aiautofix -run 'TestHandleListApprovals|TestHandleApproveAndExecuteInvestigationFix|TestHandleApprove' -count=1`
- Manual scenario:
1. Pair the mobile app to a real instance through the relay onboarding path.

View file

@ -238,7 +238,7 @@ If mobile is in scope, also run:
cd /Volumes/Development/pulse/repos/pulse-mobile
git status --porcelain
npm test -- --runTestsByPath src/utils/__tests__/secureStorage.test.ts src/stores/__tests__/instanceStore.test.ts src/stores/__tests__/authStore.test.ts
npm test -- --runTestsByPath src/relay/__tests__/client.test.ts src/relay/__tests__/client-hardening.test.ts
npx jest --runInBand --runTestsByPath src/relay/__tests__/client.test.ts src/relay/__tests__/client-hardening.test.ts
npm test -- --runTestsByPath src/stores/__tests__/approvalStore.test.ts
```

View file

@ -69,9 +69,10 @@ def build_command_specs(args: argparse.Namespace) -> list[CommandSpec]:
name="mobile-api-client",
cwd=str(pulse_mobile_dir),
command=[
"npm",
"test",
"--",
"npx",
"jest",
"--runInBand",
"--detectOpenHandles",
"--runTestsByPath",
"src/api/__tests__/client.test.ts",
],
@ -80,9 +81,10 @@ def build_command_specs(args: argparse.Namespace) -> list[CommandSpec]:
name="mobile-relay-runtime",
cwd=str(pulse_mobile_dir),
command=[
"npm",
"test",
"--",
"npx",
"jest",
"--runInBand",
"--detectOpenHandles",
"--runTestsByPath",
"src/hooks/__tests__/useRelay.test.ts",
"src/hooks/__tests__/relayPushRefresh.test.ts",
@ -94,9 +96,10 @@ def build_command_specs(args: argparse.Namespace) -> list[CommandSpec]:
name="mobile-secure-persistence-and-approvals",
cwd=str(pulse_mobile_dir),
command=[
"npm",
"test",
"--",
"npx",
"jest",
"--runInBand",
"--detectOpenHandles",
"--runTestsByPath",
"src/__tests__/mobileRelayAuthApprovals.rehearsal.test.ts",
"src/utils/__tests__/secureStorage.test.ts",
@ -111,9 +114,10 @@ def build_command_specs(args: argparse.Namespace) -> list[CommandSpec]:
name="mobile-wire-protocol",
cwd=str(pulse_mobile_dir),
command=[
"npm",
"test",
"--",
"npx",
"jest",
"--runInBand",
"--detectOpenHandles",
"--runTestsByPath",
"src/relay/__tests__/client.test.ts",
"src/relay/__tests__/client-hardening.test.ts",

View file

@ -36,6 +36,10 @@ class MobileRelayAuthApprovalsProofTest(unittest.TestCase):
)
self.assertTrue(any(Path(spec.cwd) == proof.default_pulse_enterprise_dir() for spec in specs))
self.assertTrue(any(Path(spec.cwd) == proof.default_pulse_mobile_dir() for spec in specs))
mobile_specs = [spec for spec in specs if Path(spec.cwd) == proof.default_pulse_mobile_dir()]
self.assertTrue(
all(spec.command[:4] == ["npx", "jest", "--runInBand", "--detectOpenHandles"] for spec in mobile_specs)
)
if __name__ == "__main__":

View file

@ -109,9 +109,10 @@ def build_command_specs(args: argparse.Namespace) -> list[CommandSpec]:
name="relay-mobile-client",
cwd=str(pulse_mobile_dir),
command=[
"npm",
"test",
"--",
"npx",
"jest",
"--runInBand",
"--detectOpenHandles",
"--runTestsByPath",
"src/relay/__tests__/client.test.ts",
"src/relay/__tests__/client-hardening.test.ts",

View file

@ -31,6 +31,11 @@ class RelayRegistrationReconnectDrainProofTest(unittest.TestCase):
self.assertTrue(any(Path(spec.cwd) == proof.default_pulse_dir() / "frontend-modern" for spec in specs))
self.assertTrue(any(Path(spec.cwd) == proof.default_pulse_mobile_dir() for spec in specs))
self.assertTrue(any(Path(spec.cwd) == proof.default_pulse_dir() for spec in specs))
mobile_spec = next(spec for spec in specs if spec.name == "relay-mobile-client")
self.assertEqual(
mobile_spec.command[:4],
["npx", "jest", "--runInBand", "--detectOpenHandles"],
)
if __name__ == "__main__":